Browse Source

feat:代理

ljc 1 month ago
parent
commit
1c959250df

+ 29 - 20
components/cwg-complex-search.vue

@@ -129,6 +129,11 @@ const props = defineProps({
         type: Number,
         default: 1
     },
+    // 不设置默认数据
+  noData: {
+        type: Boolean,
+        default: false
+    },
     // 表单初始值 / v-model 绑定值
     modelValue: {
         type: Object,
@@ -207,28 +212,32 @@ const selectChip = (key, value) => {
 // 初始化表单数据
 const initFormData = () => {
     const initial = {}
+  if (!props.noData) {
     props.fields.forEach(field => {
-        // 1. 优先使用外部传入的 modelValue(如果值不为 null 或 undefined)
-        if (props.modelValue && props.modelValue[field.key] != null) {
-            initial[field.key] = props.modelValue[field.key]
-        }
-        // 2. 其次使用字段配置的 defaultValue
-        else if (field.defaultValue !== undefined) {
-            initial[field.key] = field.defaultValue
-        }
-        // 3. 日期字段特殊处理:默认当前月(即使 modelValue 中存在但为 null/undefined)
-        else if (field.type === 'date' || field.type === 'daterange') {
-            initial[field.key] = getDefaultDateValue(field)
-        }
-        // 4. select 类型字段如果没有默认值,默认置空,不强制选第一个
-        else if (field.type === 'select') {
-            initial[field.key] = null
-        }
-        // 5. 其他字段默认为空字符串
-        else {
-            initial[field.key] = ''
-        }
+      // 1. 优先使用外部传入的 modelValue(如果值不为 null 或 undefined)
+      if (props.modelValue && props.modelValue[field.key] != null) {
+        initial[field.key] = props.modelValue[field.key]
+      }
+      // 2. 其次使用字段配置的 defaultValue
+      else if (field.defaultValue !== undefined) {
+        initial[field.key] = field.defaultValue
+        return
+      }
+      // 3. 日期字段特殊处理:默认当前月(即使 modelValue 中存在但为 null/undefined)
+      else if (field.type === 'date' || field.type === 'daterange') {
+        initial[field.key] = getDefaultDateValue(field)
+      }
+      // 4. select 类型字段如果没有默认值,默认置空,不强制选第一个
+      else if (field.type === 'select') {
+        initial[field.key] = null
+      }
+      // 5. 其他字段默认为空字符串
+      else {
+        initial[field.key] = ''
+      }
     })
+  }
+
     formData.value = initial
     tempFormData.value = JSON.parse(JSON.stringify(initial))
     handleSearch()

+ 5 - 1
components/cwg-icon.vue

@@ -1,5 +1,5 @@
 <template>
-	<SvgIcon :color="color" :icon="props.name || props.icon" class="icon" :height="size" :width="size" />
+	<SvgIcon :color="curColor" :icon="props.name || props.icon" class="icon" :height="size" :width="size" />
 </template>
 
 <script setup>
@@ -36,6 +36,10 @@ const props = defineProps({
 	}
 });
 
+const curColor = computed(() => {
+  return props.color ? props.color : isDark.value ? '#fff' : '#000';
+});
+
 </script>
 
 <style scoped>

+ 2 - 3
components/cwg-tabel.vue

@@ -43,13 +43,12 @@
                                     :menuList="getComputedMenuList(column.menuList, row)" placement="bottom-end"
                                     @menuClick="(payload) => handleActionClick(payload, row)">
                                     <view class="action-trigger">
-                                        <cwg-icon name="crm-ellipsis" :size="24" color="#000" />
+                                        <cwg-icon name="crm-ellipsis" :size="24" />
                                     </view>
                                 </cwg-droplist>
                             </view>
                             <template v-else-if="column.type === 'more'">
-                                <cwg-icon v-if="isMobile" name="crm-chevron-down" class="crm-chevron-down" :size="16"
-                                    color="#007" />
+                                <cwg-icon v-if="isMobile" name="crm-chevron-down" class="crm-chevron-down" :size="16" />
                             </template>
 
                             <template v-else>

+ 8 - 8
pages/ib/components/applyIbDialog.vue

@@ -12,8 +12,8 @@
           <table class="commission-table">
             <thead>
             <tr>
-              <th style="width: 80px;">{{ t('Ib.Custom.Status') }}</th>
-              <th style="width: 100px;"></th>
+              <th style="width: 60px;">{{ t('Ib.Custom.Status') }}</th>
+              <th style="width: 135px;"></th>
               <th style="width: 100px;"></th>
               <th style="width: 80px;">METAL</th>
               <th>FX</th>
@@ -27,7 +27,7 @@
             <tr v-for="(item, iIndex) in group.items" :key="iIndex">
               <td v-if="iIndex === 0" :rowspan="group.items.length" class="center-td">
                 <switch :checked="group.isOpen" @change="(e) => onGroupSwitchChange(e, group)" color="#2b5aed"
-                        style="transform:scale(0.8)" />
+                        style="transform:scale(0.7)" />
               </td>
               <td v-if="iIndex === 0" :rowspan="group.items.length" class="center-td group-name-td">
                 {{ group.accountGroup }}
@@ -35,7 +35,7 @@
               <td class="center-td type-td">
                 {{ item.type }}
               </td>
-              <td style="width: 80px;">
+              <td style="width: 75px;">
                 <cwg-combox v-model:value="item.energy" :options="formatOptions(item.energyOptions)"
                             :placeholder="t('placeholder.choose')" />
               </td>
@@ -543,7 +543,7 @@
     }
 
     th {
-      padding: px2rpx(12) px2rpx(10);
+      padding: px2rpx(12) px2rpx(5);
       text-align: center;
       font-weight: bold;
       color: var(--bs-emphasis-color);
@@ -553,7 +553,7 @@
     }
 
     td {
-      padding: px2rpx(8) px2rpx(10);
+      padding: px2rpx(8) px2rpx(7);
       border: 1px solid #ebeef5;
       vertical-align: middle;
     }
@@ -568,12 +568,12 @@
     }
 
     .type-td {
-      color: #606266;
+      color: var(--bs-emphasis-color);
     }
 
     :deep(.cwg-combox) {
       width: 100%;
-      min-width: px2rpx(80);
+      width: px2rpx(60);
     }
   }
 

+ 2 - 2
pages/ib/subsList.vue

@@ -23,7 +23,7 @@
         <view class="search-content pc-search-content">
           <view class="search-bar">
             <cwg-complex-search :fields="filterFields" v-model="searchParams" @search="handleSearch"
-                                @reset="handleReset" />
+                                @reset="handleReset" noDate/>
           </view>
           <view class="search-bar">
             <button type="primary" class="search-button" @click="addSub">
@@ -104,7 +104,7 @@
       defaultValue: '',
     },
     { key: 'cId', type: 'input', label: 'CID', placeholder: 'CID', defaultValue: '' },
-    { key: 'date', label: t('placeholder.Start') + ' - ' + t('placeholder.End'), type: 'daterange' },
+    { key: 'date', label: t('placeholder.Start') + ' - ' + t('placeholder.End'), type: 'daterange',defaultValue: ['',''] },
   ]
   const tableRef = ref(null)
   const applyIbDialogRef = ref(null)