瀏覽代碼

修改bug

zhaoke 1 年之前
父節點
當前提交
4dc6032c26

+ 13 - 25
src/utils/axiosReq.ts

@@ -62,33 +62,21 @@ service.interceptors.request.use(
 )
 // 响应拦截
 service.interceptors.response.use(
-  response => {
+  (response) => {
     const res = response.data
-
     // if the custom code is not 20000, it is judged as an error.
     if (res.code != '0') {
-      ElMessage({
-        message: res.message ?? '执行失败',
-        type: 'error',
-        duration: 5 * 1000,
-      })
-
-      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
-      if (res.code === 500 || res.code === 50012 || res.code === 50014) {
-        // to re-login
-        ElMessageBox.confirm(
-          'You have been logged out, you can cancel to stay on this page, or log in again',
-          'Confirm logout',
-          {
-            confirmButtonText: 'Re-Login',
-            cancelButtonText: 'Cancel',
-            type: 'warning',
-          }
-        ).then(async () => {
-          sessionStorage.removeItem('userName')
-          // store.dispatch("app/toggleOutflag", false);
-          await useUserStore().logout()
-          router.push(`/login`)
+      if (res.message && res.message.includes('Duplicate entry')) {
+        ElMessage({
+          message: '执行失败',
+          type: 'error',
+          duration: 5 * 1000,
+        })
+      } else {
+        ElMessage({
+          message: res.message ?? '执行失败',
+          type: 'error',
+          duration: 5 * 1000,
         })
       }
       return Promise.reject(res.message || res.returnData?.message || 'Error')
@@ -96,7 +84,7 @@ service.interceptors.response.use(
       return res
     }
   },
-  error => {
+  (error) => {
     const des500 = `${error}`.split(' ').includes('500')
     if (des500) {
       ElMessage({

+ 12 - 12
src/views/BasicsData/equipmentMaintenance/index.vue

@@ -25,19 +25,16 @@
                   <el-input v-model="tableForm.deviceName" placeholder="请输入设备名称" />
                 </el-form-item>
               </el-col>
-              <!-- <el-col>
-                <el-form-item
-                  label="设备类型"
-                  size="default"
-                  prop="deviceType"
-                  :rules="formRules.isNotNull"
-                >
-                  <el-input
-                    v-model="tableForm.deviceType"
-                    placeholder="请输入设备类型"
-                  />
+              <el-col>
+                <el-form-item label="设备类型" size="default" prop="deviceType">
+                  <el-input v-model="tableForm.deviceType" placeholder="请输入设备类型" />
                 </el-form-item>
-              </el-col> -->
+              </el-col>
+              <el-col>
+                <el-form-item label="设备位置" size="default" prop="location">
+                  <el-input v-model="tableForm.location" placeholder="请输入设备位置" />
+                </el-form-item>
+              </el-col>
               <el-col>
                 <el-form-item label="设备编码" size="default" prop="deviceCode" :rules="formRules.isNotNull">
                   <el-input v-model="tableForm.deviceCode" placeholder="请输入设备编码" />
@@ -83,6 +80,7 @@ const tableForm = reactive<any>({
   deviceName: "",
   deviceType: "",
   deviceIP: "",
+  location: "",
   deviceCode: "",
   remarks: "",
   event: "",
@@ -169,6 +167,7 @@ const btnClick = (row, index, param) => {
     tableForm.deviceID = index.deviceID;
     tableForm.deviceName = index.deviceName;
     tableForm.deviceType = index.deviceType;
+    tableForm.location = index.location;
     tableForm.deviceIP = index.deviceIP;
     tableForm.deviceCode = index.deviceCode;
     tableForm.remarks = index.remarks;
@@ -180,6 +179,7 @@ const btnClick = (row, index, param) => {
     tableForm.deviceID = index.deviceID;
     tableForm.deviceName = index.deviceName;
     tableForm.deviceType = index.deviceType;
+    tableForm.location = index.location;
     tableForm.deviceIP = index.deviceIP;
     tableForm.deviceCode = index.deviceCode;
     tableForm.deviceCode = index.deviceCode;

+ 33 - 147
src/views/dataQuery/components/DataQueryView/index.vue

@@ -2,53 +2,26 @@
   <div class="data-query">
     <div class="data-query-header">
       <div class="manageTitle">{{ title }}</div>
-      <el-form
-        ref="formRef"
-        :model="formData"
-        class="data-query-form"
-        :rules="rules"
-        @submit.native.prevent
-      >
+      <el-form ref="formRef" :model="formData" class="data-query-form" :rules="rules" @submit.native.prevent>
         <div v-if="name === 'freight'" class="form-left">
           <el-form-item prop="startDate">
-            <el-date-picker
-              v-model="formData.startDate"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-              size="default"
-              type="date"
-              placeholder="开始日期"
-              :prefix-icon="datePreTitle('开始')"
-              :clearable="false"
-              class="pre-text"
-            />
+            <el-date-picker v-model="formData.startDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default" type="date" placeholder="开始日期" :prefix-icon="datePreTitle('开始')" :clearable="false" class="pre-text" />
           </el-form-item>
           <el-form-item prop="endDate">
-            <el-date-picker
-              v-model="formData.endDate"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-              :disabled-date="disabledEndDate"
-              size="default"
-              type="date"
-              placeholder="结束日期"
-              :prefix-icon="datePreTitle('结束')"
-              :clearable="false"
-              class="pre-text"
-            />
+            <el-date-picker v-model="formData.endDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" :disabled-date="disabledEndDate" size="default" type="date" placeholder="结束日期" :prefix-icon="datePreTitle('结束')" :clearable="false" class="pre-text" />
+          </el-form-item>
+        </div>
+        <div v-if="name === 'waybill'" class="form-left">
+          <el-form-item>
+            <el-date-picker v-model="formData.startDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default" type="date" placeholder="开始日期" :prefix-icon="datePreTitle('开始')" :clearable="false" class="pre-text" />
+          </el-form-item>
+          <el-form-item>
+            <el-date-picker v-model="formData.endDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" :disabled-date="disabledEndDate" size="default" type="date" placeholder="结束日期" :prefix-icon="datePreTitle('结束')" :clearable="false" class="pre-text" />
           </el-form-item>
         </div>
         <div v-if="name === 'flight'" class="form-left">
           <el-form-item prop="flightDate" style="width: 148px">
-            <el-date-picker
-              v-model="formData.flightDate"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-              size="default"
-              type="date"
-              placeholder="请选择航班日期"
-              :clearable="false"
-            />
+            <el-date-picker v-model="formData.flightDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default" type="date" placeholder="请选择航班日期" :clearable="false" />
           </el-form-item>
           <el-form-item prop="inOrOut" style="width: 108px">
             <el-select v-model="formData.inOrOut" size="default">
@@ -57,141 +30,53 @@
             </el-select>
           </el-form-item>
           <el-form-item prop="flightType" style="width: 108px">
-            <el-select
-              v-model="formData.flightType"
-              size="default"
-              placeholder="航班类型"
-              clearable
-            >
+            <el-select v-model="formData.flightType" size="default" placeholder="航班类型" clearable>
               <el-option :value="0" label="货机" />
               <el-option :value="1" label="客机" />
               <el-option :value="2" label="其他" />
             </el-select>
           </el-form-item>
           <el-form-item prop="sAirport" style="width: 108px">
-            <el-select
-              v-model="formData.sAirport"
-              :disabled="formData.inOrOut === 'out'"
-              size="default"
-              placeholder="始发站"
-              filterable
-              clearable
-            >
-              <el-option
-                v-for="{ value, label } in airportOptions"
-                :key="value"
-                :value="value"
-                :label="label"
-              />
+            <el-select v-model="formData.sAirport" :disabled="formData.inOrOut === 'out'" size="default" placeholder="始发站" filterable clearable>
+              <el-option v-for="{ value, label } in airportOptions" :key="value" :value="value" :label="label" />
             </el-select>
           </el-form-item>
           <el-form-item prop="eAirport" style="width: 108px">
-            <el-select
-              v-model="formData.eAirport"
-              :disabled="formData.inOrOut === 'in'"
-              size="default"
-              placeholder="目的站"
-              filterable
-              clearable
-            >
-              <el-option
-                v-for="{ value, label } in airportOptions"
-                :key="value"
-                :value="value"
-                :label="label"
-              />
+            <el-select v-model="formData.eAirport" :disabled="formData.inOrOut === 'in'" size="default" placeholder="目的站" filterable clearable>
+              <el-option v-for="{ value, label } in airportOptions" :key="value" :value="value" :label="label" />
             </el-select>
           </el-form-item>
           <el-form-item prop="planeType" style="width: 108px">
-            <el-select
-              v-model="formData.planeType"
-              size="default"
-              placeholder="属性"
-              clearable
-            >
+            <el-select v-model="formData.planeType" size="default" placeholder="属性" clearable>
               <el-option value="DOM" label="国内" />
               <el-option value="INT" label="国际" />
             </el-select>
           </el-form-item>
           <el-form-item prop="sFlightDate" style="width: 148px">
-            <el-date-picker
-              v-model="formData.sFlightDate"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-              size="default"
-              type="date"
-              placeholder="请选择实飞时间"
-            />
+            <el-date-picker v-model="formData.sFlightDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" size="default" type="date" placeholder="请选择实飞时间" />
           </el-form-item>
         </div>
         <div class="form-right">
-          <el-form-item
-            v-if="name === 'flight'"
-            prop="company"
-            style="width: 180px"
-          >
-            <el-input
-              v-model.trim="formData.company"
-              size="default"
-              placeholder="请输入航司进行搜索"
-              :prefix-icon="Search"
-              clearable
-              @keyup.enter.prevent="dataQuery"
-            />
+          <el-form-item v-if="name === 'flight'" prop="company" style="width: 180px">
+            <el-input v-model.trim="formData.company" size="default" placeholder="请输入航司进行搜索" :prefix-icon="Search" clearable @keyup.enter.prevent="dataQuery" />
+          </el-form-item>
+          <el-form-item prop="flightNO" style="width: 180px">
+            <el-input v-model.trim="formData.flightNO" size="default" placeholder="请输入航班号" clearable />
           </el-form-item>
-          <el-form-item
-            prop="keyWords"
-            :style="name === 'flight' ? { width: '190px' } : {}"
-          >
-            <el-input
-              v-model.trim="formData.keyWords"
-              size="default"
-              :placeholder="keyWordsPlaceHolder"
-              :prefix-icon="Search"
-              clearable
-              @keyup.enter.prevent="dataQuery"
-            />
+          <el-form-item prop="keyWords" :style="name === 'flight' ? { width: '190px' } : {}">
+            <el-input v-model.trim="formData.keyWords" size="default" :placeholder="keyWordsPlaceHolder" :prefix-icon="Search" clearable @keyup.enter.prevent="dataQuery" />
           </el-form-item>
         </div>
       </el-form>
-      <el-button size="default" color="#ac014d" @click="dataQuery"
-        >搜索</el-button
-      >
+      <el-button size="default" color="#ac014d" @click="dataQuery">搜索</el-button>
       <el-button size="default" plain @click="resetForm">重置</el-button>
-      <ColumnSet
-        :table-columns="tableColumns"
-        @checked-submit="columnChecked"
-      />
+      <ColumnSet :table-columns="tableColumns" @checked-submit="columnChecked" />
     </div>
-    <div
-      v-loading="loading"
-      element-loading-text="拼命加载中"
-      element-loading-background="rgba(0, 0, 0, 0.8)"
-      class="data-query-table"
-    >
-      <SimpleTable
-        :header-cell-style="() => ({ background: '#F9FAFC' })"
-        ref="tableRef"
-        :data="
+    <div v-loading="loading" element-loading-text="拼命加载中" element-loading-background="rgba(0, 0, 0, 0.8)" class="data-query-table">
+      <SimpleTable :header-cell-style="() => ({ background: '#F9FAFC' })" ref="tableRef" :data="
           tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)
-        "
-        :columns="tableColumns"
-        :cell-class-name="cellClass"
-        :column-props="{ formatter }"
-        height="calc(100vh - 220px)"
-        custom-sequence
-        @cell-click="cellClickHandler"
-      />
-      <el-pagination
-        v-if="tableData.length > 0"
-        background
-        layout="total, prev, pager, next, jumper"
-        :total="tableData.length"
-        :page-size="pageSize"
-        style="position: absolute; right: 19px; bottom: 10px"
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-      >
+        " :columns="tableColumns" :cell-class-name="cellClass" :column-props="{ formatter }" height="calc(100vh - 220px)" custom-sequence @cell-click="cellClickHandler" />
+      <el-pagination v-if="tableData.length > 0" background layout="total, prev, pager, next, jumper" :total="tableData.length" :page-size="pageSize" style="position: absolute; right: 19px; bottom: 10px" @size-change="handleSizeChange" @current-change="handleCurrentChange">
       </el-pagination>
     </div>
   </div>
@@ -233,6 +118,7 @@ const formData = reactive({
   startDate: today,
   endDate: today,
   keyWords: '',
+  flightNO:''
 })
 watchEffect(() => {
   if (formData.inOrOut === 'in') {

+ 8 - 4
src/views/dataQuery/components/DataQueryView/useTable.ts

@@ -141,6 +141,7 @@ export function useTable(
         startDate,
         endDate,
         keyWords,
+        flightNO,
       } = formData
       if (
         tableName === 'waybill' &&
@@ -161,8 +162,11 @@ export function useTable(
               flightType,
               sFlightDate,
             ]
+          : tableName === 'waybill'
+          ? [startDate, endDate, flightNO, keyWords]
           : [startDate, endDate, keyWords]
-      dataContent = dataContent.map(v => (v === '' ? null : v))
+      dataContent = dataContent.map((v) => (v === '' ? null : v))
+      console.log(defaultDataContent)
       const {
         code,
         returnData: { columnSet, listValues },
@@ -182,9 +186,9 @@ export function useTable(
       if (listValues.length) {
         tableData.value.push(
           ...listValues.filter(
-            row =>
+            (row) =>
               !Object.values(row).some(
-                cellValue =>
+                (cellValue) =>
                   typeof cellValue === 'string' &&
                   cellValue.includes('undefined')
               )
@@ -212,7 +216,7 @@ export function useTable(
 
   onMounted(() => {
     if (tableColumnsMap[tableName]) {
-      tableColumns.value = tableColumnsMap[tableName].map(column => ({
+      tableColumns.value = tableColumnsMap[tableName].map((column) => ({
         columnDescribe: '',
         dataType: '',
         listqueryTemplateID: null,

+ 7 - 45
src/views/realTime/components/AirportView/index.vue

@@ -3,62 +3,24 @@
     <div class="airport-header">
       <AirportForm :name="name" @form-data-change="formDataChangeHandler" />
       <div class="airport-count">
-        <CountBox
-          :count-number="airportCount.flightNum"
-          label="今日计划航班数(班)"
-          :length="3"
-        />
-        <CountBox
-          :count-number="airportCount.finishFlightNum"
-          label="已完成航班数(班)"
-          :length="3"
-        />
-        <CountBox
-          :count-number="airportCount.weight"
-          :label="`已${isDeparture ? '装载' : '卸载'}重量(吨)`"
-          :length="4"
-        />
+        <CountBox :count-number="airportCount.flightNum" label="今日计划航班数(班)" :length="3" />
+        <CountBox :count-number="airportCount.finishFlightNum" label="已完成航班数(班)" :length="3" />
+        <CountBox :count-number="airportCount.weight" :label="`已${isDeparture ? '装载' : '卸载'}重量(吨)`" :length="4" />
       </div>
       <div class="airport-settings">
         <div v-permission="getPermission('count')">
           <CommonSwitch v-model:flag="countFlag" label="显示件数" />
         </div>
         <div v-permission="getPermission('UTC')">
-          <CommonSwitch
-            :flag="UTCFlag"
-            label="开启UTC"
-            @update:flag="flag => timeZoneStore.toggleUTCFlag(flag)"
-          />
+          <CommonSwitch :flag="UTCFlag" label="开启UTC" @update:flag="flag => timeZoneStore.toggleUTCFlag(flag)" />
         </div>
         <div v-permission="getPermission('columnSet')">
-          <ColumnSet
-            :table-columns="tableColumns"
-            @checked-submit="columnChecked"
-          />
+          <ColumnSet :table-columns="tableColumns" @checked-submit="columnChecked" />
         </div>
       </div>
     </div>
     <div class="airport-table">
-      <SimpleTable
-        ref="tableRef"
-        :columns="tableColumns"
-        :data="tableData"
-        row-key="rowKey"
-        sequence
-        highlight-current-row
-        scrollbar-always-on
-        :stripe="false"
-        show-summary
-        :summary-method="summaryMethod"
-        :cache-keys="cacheKeys"
-        :filter-sort-options="filterSortOptions"
-        :label-formatter="tableColumnFormatter"
-        :row-class-name="rowClassName"
-        :cell-class-name="cellClass"
-        :column-props="{ formatter: tableDataFormatter }"
-        @sort-rule-change="sortRuleChangeHandler"
-        @cell-click="cellClickHandler"
-      />
+      <SimpleTable ref="tableRef" :columns="tableColumns" :data="tableData" row-key="rowKey" sequence highlight-current-row scrollbar-always-on :stripe="false" show-summary :summary-method="summaryMethod" :cache-keys="cacheKeys" :filter-sort-options="filterSortOptions" :label-formatter="tableColumnFormatter" :row-class-name="rowClassName" :cell-class-name="cellClass" :column-props="{ formatter: tableDataFormatter }" @sort-rule-change="sortRuleChangeHandler" @cell-click="cellClickHandler" />
     </div>
   </div>
 </template>
@@ -537,5 +499,5 @@ watch(tableData, async () => {
 })
 </script>
 <style lang="scss" scoped>
-@import './index.scss';
+@import "./index.scss";
 </style>

+ 6 - 6
src/views/realTime/components/AirportView/useAirportTable.ts

@@ -974,7 +974,7 @@ const headerClassMap = {
 
 const computedWidth = (column: SimpleColumn) => {
   let width = 0
-  column.columnLabel.split('\n').forEach(line => {
+  column.columnLabel.split('\n').forEach((line) => {
     const len = line.length
     let realLength = 0
     for (let i = 0; i < len; i++) {
@@ -1027,7 +1027,7 @@ export function useAirportTable(name: string, formData: CommonData) {
     const groups = columnGroupsMap[name]
     tableColumns.value = groups.reduce(
       (columns: CommonTableColumn[], group) => {
-        group.children.forEach(column => {
+        group.children.forEach((column) => {
           columns.push({
             key: column.columnName,
             dataKey: column.columnName,
@@ -1060,14 +1060,14 @@ export function useAirportTable(name: string, formData: CommonData) {
       },
       []
     )
-    Object.keys(tableColumnsCountIndexMap).forEach(key => {
+    Object.keys(tableColumnsCountIndexMap).forEach((key) => {
       delete tableColumnsCountIndexMap[key]
     })
-    tableColumns.value.forEach(column => {
+    tableColumns.value.forEach((column) => {
       const matched = column.columnLabel.match(/(?<=\()\S+(?=\))/)
       if (matched) {
         const machedStr = matched[0]
-        const countIndex = machedStr.split('/').findIndex(str => str === '件')
+        const countIndex = machedStr.split('/').findIndex((str) => str === '件')
         if (countIndex > -1) {
           tableColumnsCountIndexMap[column.columnName] = countIndex
         }
@@ -1115,7 +1115,7 @@ export function useAirportTable(name: string, formData: CommonData) {
       //   align: 'center',
       //   ...column,
       // }))
-      tableData.value = listValues.map(row => {
+      tableData.value = listValues.map((row) => {
         // if (name === 'DepartureAirport') {
         //   row.securityYes =
         //     typeof row.addCargo === 'string'

+ 2 - 2
src/views/realTime/hooks/useTableStyle.ts

@@ -89,10 +89,10 @@ export function useTableStyle(
         if (warningNodesMap && warningNodesMap[row.rowKey]) {
           const { warningNodes, alarmNodes } = warningNodesMap[row.rowKey]
           const hasWarningNode = warningNodes.some(
-            node => node.node_code === column.property
+            (node) => node.node_code === column.property
           )
           const hasAlarmNode = alarmNodes.some(
-            node => node.node_code === column.property
+            (node) => node.node_code === column.property
           )
           if (hasWarningNode) {
             classes.push('cell-warning')

+ 1 - 1
src/views/systemSettings/warningSet/index.vue

@@ -24,7 +24,7 @@
                 </el-form-item>
               </el-col> -->
               <el-col :span="12">
-                <el-form-item label="名称" prop="alarmname" size="default">
+                <el-form-item label="名称" prop="alarmname" size="default" :rules="formRules.isNotNull">
                   <el-input v-model="tableForm.alarmname" placeholder="请输入名称" />
                 </el-form-item>
               </el-col>