zhongxiaoyu 2 年之前
父節點
當前提交
c7c13310da

+ 1 - 1
src/views/dataQuery/components/DataQueryView/index.vue

@@ -135,7 +135,7 @@ const keyWordsValidator = (rule: any, value: any, callback: any) => {
     return callback(new Error(`请输入${searchTitle}`))
   }
   const regsMap: { [x: string]: RegExp[] } = {
-    flight: [/^[A-Za-z0-9][A-Za-z][0-9]{4}$/],
+    flight: [/^[A-Za-z0-9][A-Za-z][0-9]{4}$/, /^[0-9]{4}$/],
     waybill: [/^[0-9]{3}\-[0-9]{8}/],
     freight: [/^[0-9]{5}$/, /^[0-9]{3}\-[0-9]{8}\-[0-9]{5}$/],
   }

+ 7 - 1
src/views/dataQuery/components/DataQueryView/useTable.ts

@@ -33,7 +33,13 @@ export function useTable(
       if (Number(code) !== 0) {
         throw new Error(message || '失败')
       }
-      tableColumns.value = columnSet
+      tableColumns.value = columnSet.map(column => ({
+        ...column,
+        width:
+          tableName === 'flight' &&
+          ['IATACode', 'flightNO'].includes(column.columnName) &&
+          80,
+      }))
       tableData.value = listValues.filter(
         row =>
           !Object.values(row).some(