Kaynağa Gözat

refactor(shop-information): 优化表格列定义和移除无用代码

- 为序列号列添加标题并调整宽度
- 统一运营、国家、状态等列的标题格式
- 移除 EditDrawer 组件中的无用函数
- 调整表格列的对齐方式
WanGxC 7 ay önce
ebeveyn
işleme
271eb7e8da

+ 2 - 6
src/views/shop-information/components/EditDrawer.vue

@@ -182,7 +182,7 @@ function replaceCol() {
     if (key in gridOptions.data[0]) {
       // 特殊处理 operatorName 字段
       if (key === 'operatorName') {
-        const names = gridOptions.data[0][key].split(','); // 以逗号分隔
+        const names = gridOptions.data[0][key].split(',');
         const ids = names
             .map((name: any) => {
               const operator = operatorOption.find(opt => opt.name === name.trim()); // 去除多余空格并查找
@@ -198,10 +198,6 @@ function replaceCol() {
   }, {} as { [key: string]: any });
   Object.assign(ruleForm, result);
 }
-
-function xx() {
-  console.log('ruleForm.operatorName=> ', ruleForm.operatorName);
-}
 </script>
 
 <template>
@@ -214,7 +210,7 @@ function xx() {
         label-width="auto"
         status-icon>
       <el-form-item label="运营" prop="operatorName">
-        <el-select v-model="ruleForm.operatorName" collapse-tags collapse-tags-tooltip multiple @change="xx">
+        <el-select v-model="ruleForm.operatorName" collapse-tags collapse-tags-tooltip multiple>
           <el-option v-for="item in operatorOption" :key="item.id" :label="item.name" :value="item.id">
           </el-option>
         </el-select>

+ 23 - 23
src/views/shop-information/useColumns.tsx

@@ -17,9 +17,9 @@ async function main() {
 main();
 
 export const platformColumns = [
-  { type: 'seq', width: 50, align: 'center', fixed: 'left' },
+  { type: 'seq', title: '序 号', width: 60, align: 'center', fixed: 'left' },
   {
-    field: 'operatorName', title: '运营', minWidth: 'auto', align: 'center', fixed: 'left',
+    field: 'operatorName', title: '运 营', minWidth: 'auto', align: 'center', fixed: 'left',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.operatorName ? row.operatorName : '--' }</span>;
@@ -38,7 +38,7 @@ export const platformColumns = [
     }
   },
   {
-    field: 'country', title: '国家', minWidth: 'auto', align: 'center',
+    field: 'country', title: '国 家', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         const country = countryInfoStore.countries.find(c => c.name === row.country);
@@ -65,7 +65,7 @@ export const platformColumns = [
     }
   },
   {
-    field: 'status', title: '状态', minWidth: 'auto', align: 'center',
+    field: 'status', title: '状 态', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.status ? row.status : '--' }</span>;
@@ -73,7 +73,7 @@ export const platformColumns = [
     }
   },
   {
-    field: 'platform', title: '平台', minWidth: 'auto', align: 'center',
+    field: 'platform', title: '平 台', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.platform ? row.platform : '--' }</span>;
@@ -81,7 +81,7 @@ export const platformColumns = [
     }
   },
   {
-    field: 'line', title: '线路', minWidth: 'auto', align: 'center',
+    field: 'line', title: '线 路', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.line ? row.line : '--' }</span>;
@@ -190,9 +190,9 @@ export const platformColumns = [
 ];
 
 export const shopCurrentColumns = [
-  { type: 'seq', width: 50, align: 'center', fixed: 'left' },
+  { type: 'seq', title: '序 号', width: 60, align: 'center', fixed: 'left' },
   {
-    field: 'operatorName', title: '运营', minWidth: 'auto', align: 'center', fixed: 'left',
+    field: 'operatorName', title: '运 营', minWidth: 'auto', align: 'center', fixed: 'left',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.operatorName ? row.operatorName : '--' }</span>;
@@ -216,7 +216,7 @@ export const shopCurrentColumns = [
     }
   },
   {
-    field: 'country', title: '国家', minWidth: 'auto', align: 'center',
+    field: 'country', title: '国 家', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         const country = countryInfoStore.countries.find(c => c.name === row.country);
@@ -243,7 +243,7 @@ export const shopCurrentColumns = [
     }
   },
   {
-    field: 'status', title: '状态', minWidth: 'auto', align: 'center',
+    field: 'status', title: '状 态', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return (
@@ -258,7 +258,7 @@ export const shopCurrentColumns = [
     }
   },
   {
-    field: 'platform', title: '平台', minWidth: 'auto', align: 'center',
+    field: 'platform', title: '平 台', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.platform ? row.platform : '--' }</span>;
@@ -266,7 +266,7 @@ export const shopCurrentColumns = [
     }
   },
   {
-    field: 'line', title: '线路', minWidth: 'auto', align: 'center',
+    field: 'line', title: '线 路', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.line ? row.line : '--' }</span>;
@@ -315,7 +315,7 @@ export const shopCurrentColumns = [
     }
   },
   {
-    field: 'juridicalPerson', title: '法人', minWidth: 'auto', align: 'center',
+    field: 'juridicalPerson', title: '法 人', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.juridicalPerson ? row.juridicalPerson : '--' }</span>;
@@ -408,9 +408,9 @@ export const shopCurrentColumns = [
 ];
 
 export const historyColumns: any = [
-  { type: 'seq', width: 50, align: 'center', fixed: 'left' },
+  { type: 'seq', title: '序 号', width: 60, align: 'center', fixed: 'left' },
   {
-    field: 'operatorName', title: '运营', minWidth: 'auto', align: 'center', fixed: 'left',
+    field: 'operatorName', title: '运 营', minWidth: 'auto', align: 'center', fixed: 'left',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.operatorName ? row.operatorName : '--' }</span>;
@@ -434,7 +434,7 @@ export const historyColumns: any = [
     }
   },
   {
-    field: 'country', title: '国家', minWidth: 'auto', align: 'center',
+    field: 'country', title: '国 家', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         const country = countryInfoStore.countries.find(c => c.name === row.country);
@@ -461,7 +461,7 @@ export const historyColumns: any = [
     }
   },
   {
-    field: 'status', title: '状态', minWidth: 'auto', align: 'center',
+    field: 'status', title: '状 态', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return (
@@ -476,7 +476,7 @@ export const historyColumns: any = [
     }
   },
   {
-    field: 'platform', title: '平台', minWidth: 'auto', align: 'center',
+    field: 'platform', title: '平 台', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.platform ? row.platform : '--' }</span>;
@@ -484,7 +484,7 @@ export const historyColumns: any = [
     }
   },
   {
-    field: 'line', title: '线路', minWidth: 'auto', align: 'center',
+    field: 'line', title: '线 路', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.line ? row.line : '--' }</span>;
@@ -524,7 +524,7 @@ export const historyColumns: any = [
     }
   },
   {
-    field: 'juridicalPerson', title: '法人', minWidth: 'auto', align: 'center',
+    field: 'juridicalPerson', title: '法 人', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.juridicalPerson ? row.juridicalPerson : '--' }</span>;
@@ -591,7 +591,7 @@ export const historyColumns: any = [
     }
   },
   {
-    field: 'approveNum', title: '审批数量', minWidth: 'auto', align: 'center',
+    field: 'approveNum', title: '审批单号', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.approveNum ? row.approveNum : '--' }</span>;
@@ -633,7 +633,7 @@ export const historyColumns: any = [
 ];
 
 export const computerColumns: any = [
-  { type: 'seq', width: 50, align: 'center', fixed: 'left' },
+  { type: 'seq', title: '序 号', width: 60, align: 'center', fixed: 'left' },
   {
     field: 'operatorName', title: '使用人', minWidth: 'auto', align: 'center',
     slots: {
@@ -659,7 +659,7 @@ export const computerColumns: any = [
     }
   },
   {
-    field: 'station', title: '位置', minWidth: 'auto', align: 'center',
+    field: 'station', title: '位 置', minWidth: 'auto', align: 'center',
     slots: {
       default({ row }: any) {
         return <span class={ 'font-medium' }>{ row.station ? row.station : '--' }</span>;