zhaoke 2 年之前
父節點
當前提交
0ea1d6a9b7

+ 2 - 0
public/config.js

@@ -14,4 +14,6 @@ window.SERVICE_ID = {
   userAuthorizationId: 10027,//用户授权
   depTableId: 185, //机器维护-表头
   serTableId: 203, //服务设置-表头
+  bagTableId: 20030, //行李详情-表头
+  bagDetailId: 20027 //行李详情-表格
 };

+ 31 - 52
src/views/newBagDetails/components/baggageList.vue

@@ -19,16 +19,26 @@ import tableColsMixin from '@/views/flightViewManagement/mixins/tableCols'
 export default {
   name: 'BaggageList',
   mixins: [pf, tableColsMixin],
+  props: {
+    query: {
+      type: Object,
+      default: () => { }
+    },
+    tagObj: {
+      type: Object,
+      default: () => { }
+    }
+  },
   data () {
     return {
       tableCols: [
-        { name: '航班号', prop: 'F1', fixed: true },
-        { name: '航班日期', prop: 'F2', width: 95, fixed: true },
+        { name: '航班号', prop: 'flightNo', fixed: true },
+        { name: '航班日期', prop: 'flightDate', width: 95, fixed: true },
         // { name: '起飞航站\n起飞时间', prop: 'departureInfo', width: 100 },
         // { name: '目的航站\n降落时间', prop: 'landingInfo', width: 100 },
-        { name: '旅客舱位', prop: 'U4', width: 70 },
-        { name: '旅客座位号', prop: 'S2' },
-        { name: '值机序号', prop: 'passengerCheckInNumber', width: 70 },
+        { name: '旅客舱位', prop: 'passenger_cabin', width: 70 },
+        { name: '旅客座位号', prop: 'seatNum' },
+        { name: '值机序号', prop: 'checkin_number', width: 70 },
         { name: '节点标识', prop: 'nodeCode', width: 100 },
         { name: '节点名称', prop: 'nodeName', width: 70 },
         { name: '位置标识', prop: 'J8' },
@@ -58,55 +68,24 @@ export default {
     this.queryDetails()
   },
   methods: {
-    async queryDetails (queryData = this.queryData) {
-      function setDataSource (item) {
-        if (item['b_type'] !== 'BSM') {
-          const resourceCode = item['resourceFile']?.slice(-4)
-          switch (resourceCode) {
-            case '0100':
-              if (
-                (item['DeviceCode'] && item['DeviceCode'].toUpperCase() === 'STARHUB') ||
-                (!item['DeviceCode'] && !['LOAD', 'INFL'].includes(item['nodeCode']))
-              ) {
-                item['dataSource'] = 'Manual Load'
-              } else {
-                item['dataSource'] = 'BRS'
-              }
-              break
-            case '0101':
-              item['dataSource'] = 'RFID'
-              break
-            case '0102':
-              item['dataSource'] = '首都机场'
-              break
-            default:
-              break
-          }
-        }
-      }
-      const dataContent = queryData
-      const newData = Object.entries(dataContent)
-      const datas = []
-      newData.forEach(item => {
-        const obj = {}
-        obj[item[0]] = item[1]
-        datas.push(obj)
-      })
+    async queryDetails () {
       try {
-        const baggageDetails = await this.getQueryList(18128, datas, ['B2', 'F1', 'F2'])
-        this.baggageTableData = baggageDetails.map((item, index) => {
-          if (item['dealTime']) {
-            item['dealTime'] = item['dealTime'].replace('T', ' ')
-          }
-          item['departureInfo'] = `${item['departureAirport']}\n${item['departureTime'] ? item['departureTime'].replace('T', '\n') : ''
-            }`
-          item['landingInfo'] = `${item['landingAirport']}\n${item['landingTime'] ? item['landingTime'].replace('T', '\n') : ''
-            }`
-          setDataSource(item)
-          return item
-        })
-        this.initTableData(this.baggageTableData)
+        const { code, returnData } = await this.getQueryList(SERVICE_ID.bagDetailId, this.query)
+        if (code == 0 && returnData && returnData.length) {
+          this.baggageTableData = returnData.map((item, index) => {
+            if (item['dealTime']) {
+              item['dealTime'] = item['dealTime'].replace('T', ' ')
+            }
+            item['departureInfo'] = `${item['departureAirport']}\n${item['departureTime'] ? item['departureTime'].replace('T', '\n') : ''
+              }`
+            item['landingInfo'] = `${item['landingAirport']}\n${item['landingTime'] ? item['landingTime'].replace('T', '\n') : ''
+              }`
+            return item
+          })
+          this.initTableData(this.baggageTableData)
+        }
       } catch (error) {
+        console.log(error)
         this.$message.error('失败')
       }
     },

+ 55 - 2
src/views/newBagDetails/components/baggageMessage.vue

@@ -4,9 +4,9 @@
       <el-row :gutter="24" type="flex">
         <el-col v-for="(message, index) in messageList" :key="index" :span="6">
           <div class="card">
-            <div class="message-date">{{ message.date }}</div>
+            <div class="message-date">{{ message.flightDate }}</div>
             <div class="message-content">
-              {{ message.dataContent.replaceAll(/[\r\n]{2,}/g, '\n').replaceAll('\\', '') }}
+              {{ message.sourceData.replaceAll(/[\r\n]{2,}/g, '\n').replaceAll('\\', '') }}
             </div>
           </div>
         </el-col>
@@ -19,12 +19,40 @@
 </template>
 
 <script>
+import pf from '@/layout/mixin/publicFunc'
 export default {
   name: 'BaggageMessage',
+  mixins: [pf],
+  props: {
+    query: {
+      type: Object,
+      default: () => { }
+    },
+    tagObj: {
+      type: Object,
+      default: () => { }
+    }
+  },
   data () {
     return {
       messageList: [],
     }
+  },
+  mounted () {
+    this.queryDetails()
+  },
+  methods: {
+    async queryDetails () {
+      try {
+        const { code, returnData } = await this.getQueryList(SERVICE_ID.bagDetailId, this.query)
+        if (code == 0 && returnData && returnData.length) {
+          this.messageList = [...returnData]
+        }
+      } catch (error) {
+        console.log(error)
+        this.$message.error('失败')
+      }
+    },
   }
 }
 </script>
@@ -32,5 +60,30 @@ export default {
 <style lang="scss" scoped>
 .baggageMessage {
   height: 100%;
+  .card {
+    width: 100%;
+    min-height: 440px;
+    padding: 20px;
+    background: #ffffff;
+    box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, 0.29);
+    margin-bottom: 24px;
+    > .message-date {
+      width: 180px;
+      height: 26px;
+      line-height: 14px;
+      font-size: 14px;
+      font-family: Helvetica;
+      color: #afb4bf;
+      border-bottom: 1px solid #afb4bf;
+      margin-bottom: 18px;
+    }
+    > .message-content {
+      white-space: pre-line;
+      line-height: 24px;
+      font-size: 14px;
+      color: #303133;
+      word-break: break-all;
+    }
+  }
 }
 </style>

+ 92 - 21
src/views/newBagDetails/components/baggageView.vue

@@ -1,29 +1,31 @@
 <template>
-  <div class="baggageView">
+  <div v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="baggageView">
     <el-scrollbar style="height: 100%">
-      <div v-for="item in 10" :key="item" class="baggageView-list">
-        <div class="part2">
-          <div class="part2_info">
-            <div class="title">
-              <div class="fightNo">CA1234</div>
-              <div class="fightDate">2023-03-07</div>
-              <div class="fightLine">双流T2 -- 首都T1</div>
-              <div class="fightTime">08:22 -- 10:22</div>
-            </div>
-            <div class="baggage-track-chart">
-              <div class="step-line">
-                <div v-for="(line, index) in 6" :key="index" :class="['step-line-segment', { 'step-line-active': activeStepLine(index) }]" />
+      <div v-infinite-scroll="load" class="baggageView-content">
+        <div v-for="item in tableData" :key="item.ID" class="baggageView-list">
+          <div class="part2">
+            <div class="part2_info">
+              <div class="title">
+                <div class="fightNo">{{ item.flightNo }}</div>
+                <div class="fightDate">{{ item.flightDate }}</div>
+                <div class="fightLine">{{ item.sourceAirport }}{{ item.takeoff_terminal }} -- {{item.target_airport}}{{ item.target_terminal }}</div>
+                <div class="fightTime">08:22 -- 10:22</div>
               </div>
-              <div v-for="(item, index) in stepNodes" :key="index" :class="{ 'step-item': true, 'active-item': item.status }">
-                <div class="step-circle">
-                  <span class="step-name">{{ item.nodeName }}</span>
+              <div class="baggage-track-chart">
+                <div class="step-line">
+                  <div v-for="(line, index) in 6" :key="index" :class="['step-line-segment', { 'step-line-active': activeStepLine(index) }]" />
                 </div>
-                <div v-if="item.status" class="step-info">
-                  <div :class="statusClasses(item.status)">{{ item.status }}</div>
-                  <span class="step-time">{{ item.processingTime }}</span>
-                  <div class="step-location">{{ item.locationId }}</div>
+                <div v-for="(item, index) in stepNodes" :key="index" :class="{ 'step-item': true, 'active-item': item.status }">
+                  <div class="step-circle">
+                    <span class="step-name">{{ item.nodeName }}</span>
+                  </div>
+                  <div v-if="item.status" class="step-info">
+                    <div :class="statusClasses(item.status)">{{ item.status }}</div>
+                    <span class="step-time">{{ item.processingTime }}</span>
+                    <div class="step-location">{{ item.locationId }}</div>
+                  </div>
+                  <div v-else class="step-info">无</div>
                 </div>
-                <div v-else class="step-info">无</div>
               </div>
             </div>
           </div>
@@ -34,11 +36,29 @@
 </template>
 
 <script>
+import pf from '@/layout/mixin/publicFunc'
 export default {
   name: 'BaggageView',
+  mixins: [pf],
+  props: {
+    query: {
+      type: Object,
+      default: () => { }
+    },
+    tagObj: {
+      type: Object,
+      default: () => { }
+    }
+  },
   data () {
     return {
       stepNodes: [],
+      tableData: [],
+      page: 0,
+      pageSize: 20,
+      dataContent: {},
+      loading: false,
+      noMore: false
     }
   },
   computed: {
@@ -62,10 +82,61 @@ export default {
       }
     },
   },
+  watch: {
+    tagObj: {
+      handler (obj) {
+        this.dataContent = obj
+        this.restTable()
+        this.load()
+      },
+      deep: true
+    }
+  },
   mounted () {
     this.resetStepNodes()
   },
   methods: {
+    //获取行李信息
+    async getLuggageList () {
+      try {
+        this.loading = true
+        const { luggageNum, flightNo, flightDate } = this.query
+        const dataContent = {
+          flightNo,
+          luggageNum,
+          flightDate
+        }
+        this.dataContent = dataContent
+        const { code, returnData } = await this.getQueryList(SERVICE_ID.bagDetailId, dataContent, this.page, this.pageSize)
+        if (code == 0) {
+          if (returnData.length === 0) {
+            this.page--;
+            this.noMore = true;
+            this.loading = false;
+          }
+          this.tableData.push(...returnData);
+          this.loading = false;
+        } else {
+          this.page--;
+          this.loading = false;
+          this.$message.error("获取表格数据失败");
+        }
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    restTable () {
+      this.loading = false
+      this.noMore = false
+      this.page = 0
+      this.tableData = []
+    },
+    load () {
+      if (this.noMore || this.loading) {
+        return;
+      }
+      this.getLuggageList(SERVICE_ID.bagDetailId, this.dataContent, ++this.page, this.pageSize);
+    },
     resetStepNodes () {
       this.stepNodes = [
         {

+ 105 - 40
src/views/newBagDetails/index.vue

@@ -4,7 +4,7 @@
       <div class="newBagDetails-info-look">
         <el-row :gutter="20">
           <el-col :span="4">
-            <span class="newBagDetails-info-look-name">XINGMING</span>
+            <span class="newBagDetails-info-look-name">{{ passengerName }}</span>
             <el-button type="text">查看</el-button>
           </el-col>
           <el-col :span="item.rows" v-for="(item,index) in infoArrs" :key="index">{{ item.label }}:{{ item.value }}</el-col>
@@ -13,7 +13,7 @@
       <div class="newBagDetails-info-details">
         <div class="newBagDetails-info-details-tags">
           <scroll-pane ref="scrollPane" class="tags-view-wrapper">
-            <div v-for="(item,index) in detailsArr" class="tags-view-item" @click="tagClick(item,index)" :class="activeIndex == index ? 'active' : ''" :key="index">{{ item.no }}</div>
+            <div v-for="(item,index) in detailsArr" class="tags-view-item" @click="tagClick(item,index)" :class="activeIndex == index ? 'active' : ''" :key="index">{{ item.luggageNum }}</div>
           </scroll-pane>
         </div>
         <div class="newBagDetails-info-details-msgs">
@@ -34,7 +34,7 @@
         </div>
       </div>
       <div class="newBagDetails-contents-page">
-        <component ref="dataChild" :is="componentName"></component>
+        <component ref="dataChild" :query="query" :tagObj="tagObj" :is="componentName"></component>
       </div>
     </div>
   </div>
@@ -45,8 +45,10 @@ import ScrollPane from "@/layout/components/TagsView/ScrollPane.vue"
 import baggageView from './components/baggageView.vue'
 import baggageList from './components/baggageList.vue'
 import baggageMessage from './components/baggageMessage.vue'
+import pf from '@/layout/mixin/publicFunc'
 export default {
   name: 'NewBagDetails',
+  mixins: [pf],
   components: { ScrollPane, baggageView, baggageList, baggageMessage },
   data () {
     return {
@@ -58,36 +60,37 @@ export default {
           value: '3'
         },
         {
-          prop: '',
+          prop: 'luggageWeight',
           label: '重量',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'PNRNO',
           label: 'PNR编号',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'groupName',
           label: '企业或团队名称',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'frequentflyerNO',
           label: '常旅客号',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'frequentflyerGrade',
           label: '常旅客级别',
           rows: 3,
-          value: '3'
+          value: ''
         }
       ],
+      passenger_name: '',
       detailsArr: [
         {
           no: '39998979441'
@@ -102,84 +105,84 @@ export default {
       activeIndex: null,
       msgs1: [
         {
-          prop: '',
-          label: '最新结果',
+          prop: 'latest_node',
+          label: '最新节点',
           rows: 4,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'latest_status',
           label: '最新状态',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'luggageType',
           label: '特殊行李类型',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'no_checkin',
           label: '删除',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'activeState',
           label: '激活',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'file_code',
           label: '卷宗号',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'No_BSM',
           label: '无BSM',
           rows: 3,
-          value: '3'
+          value: ''
         }
       ],
       msgs2: [
         {
-          prop: '',
+          prop: 'compensation_type',
           label: '赔偿类型',
           rows: 4,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'compensation_amount',
           label: '赔偿金额',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'abnormal_state',
           label: '异常状态',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'loading_number',
           label: '装载序列号',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'Loadable',
           label: '可装载',
           rows: 3,
-          value: '3'
+          value: ''
         },
         {
-          prop: '',
+          prop: 'Transport',
           label: '可运输',
           rows: 3,
-          value: '3'
+          value: ''
         },
       ],
       tabMenu: [
@@ -198,10 +201,72 @@ export default {
       ],
       tabIndex: 0,
       componentName: 'baggageView',
+      query: '',
+      passengerName: '',
+      tagObj: {}
     }
   },
+  created () {
+    const { query } = this.$route
+    this.query = query
+  },
+  mounted () {
+    this.getLuggageInfo()
+  },
   methods: {
+    //获取行李信息
+    async getLuggageInfo () {
+      try {
+        const { code, returnData } = await this.getQueryList(SERVICE_ID.bagTableId, this.query)
+        if (code == 0 && returnData && returnData.length) {
+          const datasObj = [...returnData][0]
+          this.passengerName = datasObj['passengerName']
+          for (const key in datasObj) {
+            this.infoArrs.map(item => {
+              if (item.prop == key) {
+                item.value = datasObj[key]
+              }
+            })
+            this.msgs1.map(item => {
+              if (item.prop == key) {
+                item.value = datasObj[key]
+              }
+            })
+            this.msgs2.map(item => {
+              if (item.prop == key) {
+                item.value = datasObj[key]
+              }
+            })
+          }
+          this.getLuggageNums()
+        }
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    //获取行李号
+    async getLuggageNums () {
+      try {
+        const { flightDate, flightNo } = this.query
+        const { code, returnData } = await this.getQueryList(SERVICE_ID.bagTableId, {
+          passengerName: this.passengerName,
+          flightDate,
+          flightNo
+        })
+        if (code == 0 && returnData && returnData.length) {
+          this.detailsArr = [...returnData]
+        }
+      } catch (error) {
+        console.log(error)
+      }
+    },
     tagClick (item, index) {
+      const { luggageNum, flightDate, flightNo } = item
+      this.tagObj = {
+        luggageNum,
+        flightDate,
+        flightNo
+      }
       this.activeIndex = index
     },
     tabClick (item, index) {

+ 4 - 2
src/views/newQuery/components/search.vue

@@ -27,7 +27,7 @@
                             selectChangeHandler(value, scope.$index, index)
                           }
                         ">
-                    <el-option v-for="(option, index) in col.options" :key="index" :value="option.value" :label="option.label" :disabled="col.prop === 'paramKey' && option.value === 'flightDate'" />
+                    <el-option v-for="(option, index) in col.options" :key="index" :value="option.value" :label="option.label" />
                   </el-select>
                 </template>
                 <template v-else-if="['varchar', 'text', 'longtext'].includes(col.inputType[scope.$index])">
@@ -260,7 +260,9 @@ export default {
     const colDatas = this.authMsg
     if (colDatas && colDatas.length) {
       const columns = colDatas.filter(item => item.is_search == 1)
-      this.getColumnSet(columns)
+      const datas = columns.sort((a, b) => b.orderNumber - a.orderNumber)
+      console.log(datas)
+      this.getColumnSet(datas)
     }
   },
   deactivated () {

+ 324 - 0
src/views/newQuery/components/table.vue

@@ -0,0 +1,324 @@
+<template>
+  <div class="newQueryTable">
+    <el-table v-el-table-infinite-scroll="load" :data="filteredTableData" :summary-method="getSummaries" :span-method="tableSpanMethod" stripe :show-summary="showSummary" border @cell-click="cellClick" :cell-class-name="cellClass" ref="table" height="100%" class="table infinite-list">
+      <el-table-column v-for="(item, index) in tableColsCopy" :sortable="item.needSort ? true : false" :key="index" :prop="item.columnName" :label="item.columnLabel" :show-overflow-tooltip="showOverflowTooltip">
+        <template #header>
+          <span class="colTips">
+            <el-tooltip :content="item.columnDescribe" placement="top">
+              <span>{{ item.columnLabel }}</span>
+            </el-tooltip>
+          </span>
+          <span v-if="item.needFilters">
+            <el-popover placement="bottom" trigger="click" @show="popoverShowHandler(item.columnName)" @hide="popoverHideHandler">
+              <i slot="reference" :class="[
+                        'filter-arrow',
+                        'el-icon-arrow-down',
+                        arrowClass(item.columnName),
+                      ]" />
+              <el-form>
+                <el-form-item :label="item.columnLabel">
+                  <el-select v-model="filterValues[item.columnName]" size="small" placeholder="筛选" default-first-option filterable clearable>
+                    <el-option v-for="(option, optionIndex) in tableDataFilters[
+                              item.columnName
+                            ]" :key="option.value + optionIndex" :value="option.value" :label="option.text" />
+                  </el-select>
+                </el-form-item>
+              </el-form>
+            </el-popover>
+          </span>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import pf from '@/layout/mixin/publicFunc';
+import { setTableFilters } from "@/utils/table";
+import { getToken } from '@/utils/auth';
+import { getAuthData } from "@/utils/validate";
+export default {
+  name: 'NewQueryTable',
+  mixins: [pf],
+  props: {
+    // 是否显示合计行
+    showSummary: {
+      type: Boolean,
+      default: false,
+    },
+    // 不换行,溢出隐藏
+    showOverflowTooltip: {
+      type: Boolean,
+      default: true,
+    },
+    isTable: {
+      type: Boolean,
+      default: false,
+    },
+    tableTag: {
+      type: Object,
+      default: () => { }
+    }
+  },
+  data () {
+    return {
+      page: 0,
+      pageSize: 20,
+      queryId: '',
+      noMore: false,
+      loading: false,
+      tableCols: [], //表头数据
+      tableData: [], //表格数据
+      tableColsCopy: [], //表头数据缓存
+      tableDataFilters: {}, //表头-下拉数据
+      filterValues: {}, //表头-下拉-选中数据
+      tableDataCopy: [], //缓存table数据
+      tableGroups: [], //表格分组数据
+      colShowFilter: "", //表头-下拉-箭头
+      spanArr: [], //表格分组数据缓存
+      pos: 0, //表格分组计数
+      dataContent: [],
+      authBtns: [],
+      authBtnCol: [],
+      authBtnColName: [],
+    }
+  },
+  computed: {
+    //设置表头-下拉-选中数据
+    filteredTableData () {
+      return this.tableData.filter((item) => {
+        let flag = true;
+        Object.entries(this.filterValues).forEach(([key, value]) => {
+          if (value !== "" && item[key] !== value) {
+            flag = false;
+          }
+        });
+        return flag;
+      });
+    },
+  },
+  watch: {
+    tableTag: {
+      handler (val) {
+        this.getQuery(this.AqueryId, val)
+      },
+      deep: true
+    }
+  },
+  mounted () {
+    this.getColumnData()
+    this.setCellClick()
+  },
+  methods: {
+    //获取表头数据
+    async getColumnData () {
+      try {
+        const { code, returnData } = await this.getQueryList(SERVICE_ID.sysUserAuthId, [{
+          user_id: getToken('userid'),
+          auth_id: this.AauthId
+        }]);
+        if (code == 0) {
+          if (returnData && returnData.length) {
+            this.$store.dispatch('auth/changeAuthMsg', returnData)
+            this.tableCols = returnData.sort((a, b) => b.orderNumber - a.orderNumber);
+            this.tableColsCopy = this.tableCols.filter((item) => item.needShow);
+          }
+        } else {
+          this.$message.error("获取表头数据失败");
+        }
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    //获取表格数据
+    async getQuery (id, dataContent) {
+      try {
+        this.loading = true;
+        this.queryId = id;
+        this.dataContent = dataContent;
+        const { code, returnData } = await this.getQueryList(id, dataContent, ++this.page, this.pageSize);
+        if (code == 0) {
+          if (returnData.length === 0) {
+            this.page--;
+            this.noMore = true;
+            this.loading = false;
+          }
+          this.tableData.push(...returnData);
+          setTimeout(() => {
+            this.initTableData();
+            this.loading = false;
+          }, 100);
+        } else {
+          this.page--;
+          this.loading = false;
+          this.$message.error("获取表格数据失败");
+        }
+      } catch (error) {
+        this.page--;
+        this.loading = false;
+      }
+    },
+    load () {
+      if (this.isTable) {
+        if (this.noMore || this.loading) {
+          return;
+        }
+        this.getQuery(this.queryId, this.dataContent, ++this.page, this.pageSize);
+      }
+    },
+    setCellClick () {
+      const { auth_id } = this.$route.meta
+      const { arrs } = getAuthData(auth_id)
+      const table = arrs.filter(item => item.auth_type == 4)
+      if (table && table.length) {
+        const obj = table[0]
+        const { arrs } = getAuthData(obj.auth_id)
+        console.log(arrs)
+        this.authBtnCol = arrs.filter(item => Number(item.service_type) == 6)
+        if (this.authBtnCol.length) {
+          this.authBtnCol.forEach(item => {
+            this.authBtnColName.push(item.relation_data)
+          })
+        }
+      }
+    },
+    //初始化表格
+    initTableData () {
+      this.tableDataCopy = _.cloneDeep(this.tableData);
+      const datas = _.cloneDeep(this.tableColsCopy);
+      // const reqUts = [];
+      datas.forEach(async (item) => {
+        this.tableDataFilters[item.columnName] = [];
+        if (item.needGroup) {
+          this.tableGroups.push(item.columnName);
+        }
+      });
+      setTableFilters(this.tableData, this.tableDataFilters);
+      this.tableGroup(this.tableData);
+    },
+    //分组
+    tableGroup (tableData) {
+      const spanArr = [];
+      let pos = 0;
+      let ifYj = this.tableGroups[0];
+      for (let i = 0; i < tableData.length; i++) {
+        if (i === 0) {
+          spanArr.push(1);
+        } else {
+          if (tableData[i][ifYj] === tableData[i - 1][ifYj]) {
+            spanArr[pos] += 1;
+            spanArr.push(0);
+          } else {
+            spanArr.push(1);
+            pos = i;
+          }
+        }
+      }
+      this.spanArr = spanArr;
+      this.pos = pos;
+    },
+    popoverShowHandler (prop) {
+      this.colShowFilter = prop;
+    },
+    popoverHideHandler () {
+      this.colShowFilter = "";
+    },
+    //设置表头-下拉-箭头样式
+    arrowClass () {
+      return function (prop) {
+        let classString = "";
+        if (this.colShowFilter === prop) {
+          return "arrow-active";
+        }
+        if (
+          Object.entries(this.tableDataFilters).find(
+            ([key, arr]) => this.filterValues[prop]
+          )
+        ) {
+          classString += "arrow-blue";
+        }
+        return classString;
+      };
+    },
+    //合计
+    getSummaries (param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        this.tableColsCopy.forEach((p) => {
+          if (column.property == p.columnName && p.needCount) {
+            const values = data.map((item) => Number(item[column.property]));
+            if (!values.every((value) => isNaN(value))) {
+              sums[index] = values.reduce((prev, curr) => {
+                const value = Number(curr);
+                if (!isNaN(value)) {
+                  return prev + curr;
+                } else {
+                  return prev;
+                }
+              }, 0);
+              sums[index] += "";
+            }
+          }
+        });
+      });
+      return sums;
+    },
+    //分组
+    tableSpanMethod ({ row, column, rowIndex, columnIndex }) {
+      if (this.tableGroups.includes(column["property"])) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col,
+        };
+      }
+    },
+    //表格-设置单元格样式
+    cellClass ({ row, column, rowIndex, columnIndex }) {
+      if (this.authBtnColName.includes(column.property)) {
+        return 'is-click-btn'
+      }
+    },
+    //表格-单元格点击
+    cellClick (row, column) {
+      const dataBtns = this.authBtnCol
+      if (dataBtns && dataBtns.length) {
+        const clickBtn = dataBtns.filter(item => item.relation_data == column.property)[0]
+        if (clickBtn) {
+          const { open_method, route_info, pass_parameters } = clickBtn
+          if (open_method == 2) {
+            if (pass_parameters) {
+              const query = pass_parameters.split(',')
+              const obj = {}
+              query.forEach(item => {
+                obj[item] = row[item]
+              })
+              this.$router.push({
+                path: route_info,
+                query: obj
+              })
+            }
+          }
+        }
+      }
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.newQueryTable {
+  height: 100%;
+  ::v-deep .table {
+    .is-click-btn {
+      .cell {
+        color: #409eff;
+        cursor: pointer;
+        position: relative;
+      }
+    }
+  }
+}
+</style>

+ 8 - 4
src/views/newQuery/index.vue

@@ -30,7 +30,7 @@
         <Search :dataQuery="dataQuery" @getColData="getColData" ref="searchTable" />
       </div>
       <div :style="{height:tableHeight}" class="newQuery-table">
-        <Table />
+        <Table :tableTag="tableTag" />
       </div>
     </div>
     <Dialog width="520px" :flag="diaFlag">
@@ -68,7 +68,7 @@
 
 <script>
 import Search from './components/search.vue'
-import Table from '../table/index.vue'
+import Table from './components/table.vue'
 import Dialog from '@/layout/components/Dialog/index.vue'
 import { getToken } from '@/utils/auth'
 import pf from '@/layout/mixin/publicFunc'
@@ -92,6 +92,7 @@ export default {
       rmTitle: '',
       tbObj: {},
       dataQuery: [],
+      tableTag: {},
       queryItems: JSON.parse(localStorage.getItem('localItems')) ?? []
     }
   },
@@ -121,6 +122,9 @@ export default {
       const { value } = item
       setTimeout(() => {
         this.dataQuery = value
+        this.tableTag = {
+          filter: value
+        }
       }, 50);
     },
     // 保存条件
@@ -144,9 +148,9 @@ export default {
       if (this.queryType == 'save') {
         this.queryArrs.push(arrs)
       } else {
-        this.getQueryList(this.AqueryId, {
+        this.tableTag = {
           filter: arrs
-        })
+        }
       }
     },
     //查询