Browse Source

高级查询调试

zhongxiaoyu 2 năm trước cách đây
mục cha
commit
e466549753

+ 119 - 67
src/components/SimpleTable/index.vue

@@ -15,8 +15,8 @@
       :cell-class-name="cellClass"
       :span-method="tableSpanMethod"
       :show-summary="showSummary"
-      :summary-method="summaryMethod"
-      height="100%"
+      :summary-method="tableSummaryMethod"
+      :height="height"
       stripe
       fit
       border
@@ -29,7 +29,7 @@
         :label="col.columnLabel"
         :width="col.width"
         :show-overflow-tooltip="showOverflowTooltip"
-        :formatter="formatter"
+        :formatter="tableFormatter"
       >
         <template #header>
           <el-tooltip
@@ -54,6 +54,7 @@
 <script>
 import TableHeaderCell from '../TableHeaderCell'
 import { setTableFilters } from '@/utils/table'
+import { mapGetters } from 'vuex'
 
 export default {
   name: 'SimpleTable',
@@ -63,6 +64,10 @@ export default {
       type: Boolean,
       default: false
     },
+    height: {
+      type: [String, Number],
+      default: '100%'
+    },
     tableCols: {
       type: Array,
       default: () => []
@@ -71,41 +76,17 @@ export default {
       type: Array,
       default: () => []
     },
-    headerCellClass: {
-      type: Function,
-      default: function ({ row, column, rowIndex, columnIndex }) {
-        const classes = []
-        const rule = this.tableDataSortRules[column.property]
-        if (rule) {
-          classes.push(rule)
-        }
-        return classes.join(' ')
-      }
+    headerCellClassName: {
+      type: Function
     },
-    rowClass: {
-      type: Function,
-      default: function () {
-        return ''
-      }
+    rowClassName: {
+      type: Function
     },
-    cellClass: {
-      type: Function,
-      default: function () {
-        return ''
-      }
+    cellClassName: {
+      type: Function
     },
-    tableSpanMethod: {
-      type: Function,
-      default: function ({ 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
-          }
-        }
-      }
+    spanMethod: {
+      type: Function
     },
     // 是否显示合计行
     showSummary: {
@@ -113,30 +94,7 @@ export default {
       default: false
     },
     summaryMethod: {
-      type: Function,
-      default: function (param) {
-        const { columns, data } = param
-        const sums = []
-        columns.forEach((column, index) => {
-          this.tableCols.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
-      }
+      type: Function
     },
     // 不换行,溢出隐藏
     showOverflowTooltip: {
@@ -144,14 +102,7 @@ export default {
       default: false
     },
     formatter: {
-      type: Function,
-      default: function (cellValue) {
-        return cellValue
-      }
-    },
-    cellClickHandler: {
-      type: Function,
-      default: function () {}
+      type: Function
     }
   },
   data() {
@@ -165,6 +116,7 @@ export default {
     }
   },
   computed: {
+    ...mapGetters(['clickedCells']),
     filteredTableCols() {
       return this.tableCols.filter(col => col.needShow)
     },
@@ -231,6 +183,53 @@ export default {
         this.spanArr = spanArr
       },
       deep: true
+    },
+    headerCellClassName: {
+      handler(func) {
+        if (func) {
+          this.headerCellClass = func.bind(this)
+        }
+      },
+      deep: true
+    },
+    rowClassName: {
+      handler(func) {
+        if (func) {
+          this.rowClass = func.bind(this)
+        }
+      },
+      deep: true
+    },
+    cellClassName: {
+      handler(func) {
+        if (func) {
+          this.cellClass = func.bind(this)
+        }
+      },
+      deep: true
+    },
+    spanMethod: {
+      handler(func) {
+        if (func) {
+          this.tableSpanMethod = func.bind(this)
+        }
+      },
+      deep: true
+    },
+    summaryMethod: {
+      handler(func) {
+        if (func) {
+          this.tableSummaryMethod = func.bind(this)
+        }
+      },
+      deep: true
+    },
+    formatter: {
+      handler(func) {
+        if (func) {
+          this.tableFormatter = func
+        }
+      }
     }
   },
   updated() {
@@ -240,6 +239,59 @@ export default {
     load() {
       this.$emit('load')
     },
+    headerCellClass({ row, column, rowIndex, columnIndex }) {
+      const classes = []
+      const rule = this.tableDataSortRules[column.property]
+      if (rule) {
+        classes.push(rule)
+      }
+      return classes.join(' ')
+    },
+    rowClass() {
+      return ''
+    },
+    cellClass() {
+      return ''
+    },
+    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
+        }
+      }
+    },
+    tableSummaryMethod(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        this.tableCols.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
+    },
+    cellClickHandler(...params) {
+      this.$emit('cell-click', ...params)
+    },
+    tableFormatter(row, column, cellValue) {
+      return cellValue
+    },
     setTableFilters() {
       this.tableDataFilters = {}
       this.filteredTableCols.forEach(col => {

+ 227 - 80
src/views/advancedQuery/views/advancedNew.vue

@@ -43,6 +43,7 @@
     <div class="advance__table">
       <SimpleTable
         :loading="loading"
+        height="calc(100vh - 158px)"
         :table-cols="tableCols"
         :data="tableData"
         :header-cell-class-name="headerCellClass"
@@ -51,6 +52,7 @@
         :formatter="tableFormatter"
         show-summary
         @load="load"
+        @cell-click="cellClickHandler"
       />
     </div>
     <!--高级查询-->
@@ -132,7 +134,7 @@
                       <el-select
                         v-model="scope.row[col.prop]"
                         placeholder="请选择"
-                        :disabled="scope.$index < 2 && ['paramKey', 'connector'].includes(col.prop)"
+                        :disabled="scope.$index < 2 && ['leftBrackets', 'paramKey', 'rightBrackets', 'connector'].includes(col.prop)"
                         @change="value => { selectChangeHandler(value, scope.$index, index) }"
                       >
                         <el-option
@@ -140,6 +142,7 @@
                           :key="index"
                           :value="option.value"
                           :label="option.label"
+                          :disabled="col.prop === 'paramKey' && option.value === 'flightDate'"
                         />
                       </el-select>
                     </template>
@@ -168,6 +171,8 @@
                         value-format="yyyy-MM-dd"
                         placeholder="请选择"
                         :clearable="false"
+                        :picker-options="datePickerOptions(scope.$index, index)"
+                        @change="value => { dateChangeHandler(value, scope.$index, index) }"
                       />
                     </template>
                     <template v-else-if="col.inputType[scope.$index] === 'datetime'">
@@ -280,7 +285,7 @@ export default {
             leftBrackets: '',
             paramKey: 'flightDate',
             comparisonOperator: '>=',
-            paramValue: '',
+            paramValue: parseTime(new Date(), '{y}-{m}-{d}'),
             rightBrackets: '',
             connector: 'and'
           },
@@ -288,7 +293,7 @@ export default {
             leftBrackets: '',
             paramKey: 'flightDate',
             comparisonOperator: '<=',
-            paramValue: '',
+            paramValue: parseTime(new Date(), '{y}-{m}-{d}'),
             rightBrackets: '',
             connector: 'and'
           }
@@ -373,24 +378,15 @@ export default {
       columnSet: {}
     }
   },
-  computed: {
-    ...mapGetters(['clickedCells'])
-  },
   watch: {
-    // flightDate: {
-    //   handler(val) {
-    //     if (val === null) {
-    //       this.flightDate = ['', '']
+    // $route: {
+    //   handler({ path, query }) {
+    //     if (path === '/advance') {
+    //       this.queryHandler(query)
     //     }
     //   },
     //   deep: true
     // },
-    queryString: {
-      handler() {
-        this.resetTable()
-        this.queryTableData()
-      }
-    },
     tableCols: {
       handler(arr) {
         this.getColumnSet(arr)
@@ -398,10 +394,9 @@ export default {
       deep: true
     }
   },
-  created() {
-    this.paramsForm.params[0].paramValue = this.flightDate[0]
-    this.paramsForm.params[1].paramValue = this.flightDate[1]
-  },
+  // mounted() {
+  //   this.queryHandler(this.$route.query)
+  // },
   deactivated() {
     this.loading = false
   },
@@ -409,11 +404,55 @@ export default {
     this.loading = false
   },
   methods: {
+    queryHandler(query) {
+      // let queryFlag = false
+      // const { singleJump } = query
+      // const queryEntries = Object.entries(query)
+      // if (queryEntries.length) {
+      //   this.clearForm()
+      //   queryEntries.forEach(([key, value]) => {
+      //     if ((value ?? '') !== '') {
+      //       queryFlag = true
+      //       switch (key) {
+      //         case 'singleJump':
+      //           break
+      //         case 'startDate':
+      //           this.$set(this.flightDate, 0, value)
+      //           break
+      //         case 'endDate':
+      //           this.$set(this.flightDate, 1, value)
+      //           break
+      //         case 'unLoad':
+      //         case 'checkIn':
+      //         case 'active':
+      //         case 'transferIn':
+      //         case 'canceled':
+      //           this.paramsForm.params.push({
+      //             leftBrackets: '',
+      //             paramKey: key,
+      //             comparisonOperator: '=',
+      //             paramValue: value,
+      //             rightBrackets: '',
+      //             connector: 'and'
+      //           })
+      //           break
+      //         default:
+      //           break
+      //       }
+      //     }
+      //   })
+      // }
+      // if (queryFlag) {
+      //   this.advancedQueryHandler(singleJump)
+      // }
+    },
     dateRangePickHandler({ maxDate, minDate }) {
       if (!maxDate) {
         this.pickedDate = minDate
       } else {
         this.pickedDate = null
+        this.paramsForm.params[0].paramValue = minDate
+        this.paramsForm.params[1].paramValue = maxDate
       }
     },
     dateRangeDisabled(date) {
@@ -442,7 +481,7 @@ export default {
         comparisonOperator: '',
         paramValue: '',
         rightBrackets: '',
-        connector: ''
+        connector: 'and'
       })
     },
     selectChangeHandler(value, rowIndex, colIndex) {
@@ -458,14 +497,15 @@ export default {
           this.paramsTableCols[2].options[rowIndex] = comparisonOperatorOptions.slice(4, 5)
           this.paramsTableCols[3].inputType[rowIndex] = 'select'
           this.paramsTableCols[3].options[rowIndex] = options
+          this.paramsForm.params[rowIndex].paramValue = ''
         } else if (dataType === 'number') {
           this.paramsTableCols[2].options[rowIndex] = comparisonOperatorOptions.slice(0, 5).reverse()
           this.paramsTableCols[3].inputType[rowIndex] = 'number'
+          this.paramsForm.params[rowIndex].paramValue = ''
         } else {
           this.paramsTableCols[2].options[rowIndex] = comparisonOperatorOptions.slice(4)
           this.paramsTableCols[3].inputType[rowIndex] = 'text'
         }
-
         this.paramsForm.params[rowIndex].comparisonOperator = this.paramsTableCols[2].options[rowIndex][0].value
       } else if (colIndex === 2) {
         if (['is Null', 'is not Null'].includes(value)) {
@@ -476,6 +516,39 @@ export default {
         }
       }
     },
+    datePickerOptions(rowIndex, colIndex) {
+      return rowIndex === 1 && colIndex === 3 ? { disabledDate: this.endDateDisabled } : {}
+    },
+    endDateDisabled(endDate) {
+      const startDate = new Date(this.paramsForm.params[0].paramValue)
+      endDate = new Date(endDate)
+      return (
+        startDate.getTime() >= endDate.getTime() + 24 * 60 * 60 * 1000 ||
+        startDate.getTime() < endDate.getTime() - 3 * 24 * 60 * 60 * 1000
+      )
+    },
+    dateChangeHandler(dateString, rowIndex, colIndex) {
+      if (colIndex !== 3) {
+        return
+      }
+      let startDate, endDate
+      if (rowIndex === 0) {
+        startDate = new Date(dateString)
+        endDate = new Date(this.paramsForm.params[1].paramValue)
+      } else if (rowIndex === 1) {
+        startDate = new Date(this.paramsForm.params[0].paramValue)
+        endDate = new Date(dateString)
+      }
+      if (startDate.getTime() >= endDate.getTime() + 24 * 60 * 60 * 1000) {
+        this.$message.warning('开始日期不能大于结束日期')
+        this.paramsForm.params[1].paramValue = ''
+      } else if (startDate.getTime() < endDate.getTime() - 3 * 24 * 60 * 60 * 1000) {
+        this.$message.warning('间隔日期不能超过三天')
+        this.paramsForm.params[1].paramValue = ''
+      } else {
+        this.flightDate = [this.paramsForm.params[0].paramValue, this.paramsForm.params[1].paramValue]
+      }
+    },
     inputHold(value) {
       this.checkValue = value
     },
@@ -489,7 +562,7 @@ export default {
         this.paramsForm.params[rowIndex].paramValue = value.slice(0, -1)
       }
     },
-    advancedQueryHandler() {
+    advancedQueryHandler(singleJump) {
       let bracketsDifference = 0
       try {
         const paramsRowNum = this.paramsForm.params.length
@@ -499,19 +572,18 @@ export default {
             if (bracketsDifference < 0) {
               throw new Error('左右括号不匹配!')
             }
-            return (
-              preString +
-              leftBrackets +
-              paramKey +
-              ` ${comparisonOperator} ` +
-              (['is Null', 'is not Null'].includes(comparisonOperator)
-                ? ''
-                : comparisonOperator === 'like'
-                ? `%${paramValue}%`
-                : paramValue) +
-              rightBrackets +
-              (index < paramsRowNum - 1 ? connector : '')
-            )
+            preString += leftBrackets + paramKey + ` ${comparisonOperator} `
+            if (!['is Null', 'is not Null'].includes(comparisonOperator)) {
+              if (comparisonOperator === 'like') {
+                preString += `\'%${paramValue}%\'`
+              } else if (this.columnSet[paramKey].dataType === 'number') {
+                preString += paramValue
+              } else {
+                preString += `\'${paramValue}\'`
+              }
+            }
+            preString += rightBrackets + (index < paramsRowNum - 1 ? ` ${connector} ` : '')
+            return preString
           },
           ''
         )
@@ -519,6 +591,8 @@ export default {
           throw new Error('左右括号不匹配!')
         }
         this.queryString = queryString
+        this.resetTable()
+        this.queryTableData(singleJump)
         this.dialogHide()
       } catch (error) {
         this.$message.error(error.message)
@@ -527,25 +601,26 @@ export default {
     deleteParam(index) {
       this.paramsTableCols[3].inputType.splice(index, 1)
       this.paramsForm.params.splice(index, 1)
+      this.paramsForm.disabled.splice(index, 1)
     },
     clearForm() {
-      this.paramsTableCols[2].options = []
-      this.paramsTableCols[3].inputType = ['text']
+      this.paramsTableCols[2].options = new Array(2).fill(comparisonOperatorOptions.slice(0, 5).reverse())
+      this.paramsTableCols[3].inputType = ['date', 'date']
       this.paramsTableCols[3].options = []
-      this.$refs['paramsForm'].resetFields()
+      this.paramsForm.params.splice(2)
+      this.paramsForm.disabled = []
     },
-    getColumnSet(columnSet) {
-      this.columnSet = {}
-      this.paramsTableCols[1].options = []
+    async getColumnSet(columnSet) {
+      const reflect = {}
       columnSet.forEach(async column => {
         if (!this.columnSet[column.columnName]) {
           this.columnSet[column.columnName] = column
-          if (column.listqueryTemplateID && !this.columnSet[column.columnName.options]) {
-            const options = await this.getSelectData(column.listqueryTemplateID)
-            this.columnSet[column.columnName].options = options.map(option => ({
-              label: option.k,
-              value: option.v
-            }))
+          if ((column.listqueryTemplateID ?? '') !== '' && !this.columnSet[column.columnName].options) {
+            if (reflect[column.listqueryTemplateID]) {
+              reflect[column.listqueryTemplateID].push(column.columnName)
+            } else {
+              reflect[column.listqueryTemplateID] = [column.columnName]
+            }
           }
           this.paramsTableCols[1].options.push({
             label: column.columnLabel,
@@ -553,6 +628,17 @@ export default {
           })
         }
       })
+      const optionsList = await Promise.all(
+        Object.keys(reflect).map(listqueryTemplateID => this.getSelectData(Number(listqueryTemplateID)))
+      )
+      optionsList.forEach(({ id, options }) => {
+        reflect[id].forEach(columnName => {
+          this.columnSet[columnName].options = options.map(option => ({
+            label: option.k,
+            value: option.v
+          }))
+        })
+      })
     },
     load() {
       if (this.noMore || this.loading) {
@@ -678,8 +764,8 @@ export default {
     },
     // 清除查询
     clearSearchData() {
-      this.clearForm()
-      this.resetTable()
+      // this.clearForm()
+      // this.resetTable()
     },
     // 统计行数
     summaryRow(num) {
@@ -688,47 +774,74 @@ export default {
       }
     },
     getSearchData(val) {
-      this.$message.info('开发中')
-      // this.clearForm()
-      // if (!val) {
-      //   this.$message.error('请先输入完整查询信息')
-      //   return
-      // }
-      // const az = /^[a-zA-Z]+$/
-      // const azNum = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/
-      // const top2 = /^([a-zA-Z][0-9])|([0-9][a-zA-Z])|([a-zA-Z]{2})/
-      // const num = /^[0-9]+$/
-      // const bagNo = /^[a-zA-Z]{2}[0-9]{6}$/
-      // // 纯字母则为旅客姓名
-      // if (az.test(val)) {
-      //
-      // } else if (azNum.test(val) && top2.test(val)) {
-      //   // 字母加数字且前两位为字母则为航班号
-      //
-      // } else if ((num.test(val) && val.length === 10) || bagNo.test(val)) {
-      //   // 纯数字且位数等于10则为行李牌号
-      //
-      // } else {
-      //   this.$message.error('请先输入有效查询信息如航班号、旅客姓名首字母、行李牌号')
-      // }
+      // this.$message.info('开发中')
+      this.clearForm()
+      if (!val) {
+        this.$message.error('请先输入完整查询信息')
+        return
+      }
+      const az = /^[a-zA-Z]+$/
+      const azNum = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/
+      const top2 = /^([a-zA-Z][0-9])|([0-9][a-zA-Z])|([a-zA-Z]{2})/
+      const num = /^[0-9]+$/
+      const bagNo = /^[a-zA-Z]{2}[0-9]{6}$/
+      if (az.test(val)) {
+        // 纯字母则为旅客姓名
+        this.paramsForm.params.push({
+          leftBrackets: '',
+          paramKey: 'passengerName',
+          comparisonOperator: '=',
+          paramValue: val,
+          rightBrackets: '',
+          connector: 'and'
+        })
+      } else if (azNum.test(val) && top2.test(val)) {
+        // 字母加数字且前两位为字母则为航班号
+        this.paramsForm.params.push({
+          leftBrackets: '',
+          paramKey: 'flightNO',
+          comparisonOperator: '=',
+          paramValue: val,
+          rightBrackets: '',
+          connector: 'and'
+        })
+      } else if ((num.test(val) && val.length === 10) || bagNo.test(val)) {
+        // 纯数字且位数等于10则为行李牌号
+        this.paramsForm.params.push({
+          leftBrackets: '',
+          paramKey: 'bagNo',
+          comparisonOperator: '=',
+          paramValue: val,
+          rightBrackets: '',
+          connector: 'and'
+        })
+      } else {
+        this.$message.error('请先输入有效查询信息如航班号、旅客姓名首字母、行李牌号')
+        return
+      }
+      this.paramsTableCols[2].options[2] = comparisonOperatorOptions.slice(4)
+      this.paramsTableCols[3].inputType[2] = 'text'
+      this.advancedQueryHandler()
     },
     // 获取下拉数据
     async getSelectData(id) {
+      const result = { id }
       try {
         const { code, returnData } = await Query({
           id,
           dataContent: []
         })
         if (Number(code) === 0) {
-          return returnData.listValues
+          result.options = returnData.listValues
         } else {
-          return []
+          result.options = []
         }
       } catch (error) {
-        this.$message.error('失败')
+        result.options = []
       }
+      return result
     },
-    async queryTableData() {
+    async queryTableData(singleJump) {
       this.loading = true
       try {
         const {
@@ -737,12 +850,47 @@ export default {
         } = await Query({
           id: DATACONTENT_ID.advancedQueryNew,
           needPage: ++this.page,
-          dataContent: this.queryString ? { whereString: this.queryString } : []
+          dataContent: [],
+          queryConcat: this.queryString || '1 = 2'
         })
         if (Number(code) === 0) {
-          if (listValues.length === 0) {
+          if (!listValues.length) {
             this.page--
             this.noMore = true
+          } else if (singleJump) {
+            if (listValues.length === 1) {
+              this.$router.push({
+                path: '/advance/baggageView',
+                query: {
+                  bagSN: listValues[0].bagSN,
+                  flightNO: listValues[0].flightNO,
+                  flightDate: listValues[0].flightDate
+                }
+              })
+            } else {
+              const onlyFlight = listValues.reduce((pre, curr) => {
+                if (
+                  pre === null ||
+                  (curr.flightNO &&
+                    curr.flightDate &&
+                    curr.flightNO === pre.flightNO &&
+                    curr.flightDate === pre.flightDate)
+                ) {
+                  return {
+                    flightNO: curr.flightNO,
+                    flightDate: curr.flightDate
+                  }
+                } else {
+                  return {}
+                }
+              }, null)
+              if (onlyFlight.flightNO) {
+                this.$router.push({
+                  path: '/advance/flightView',
+                  query: onlyFlight
+                })
+              }
+            }
           }
           this.tableCols = columnSet
           this.tableData.push(...listValues)
@@ -792,7 +940,6 @@ export default {
 }
 .advance__table {
   width: 100%;
-  height: calc(100vh - 158px);
   ::v-deep .el-table {
     .el-table__body-wrapper {
       tr.bgl-deleted {

+ 32 - 20
src/views/systemSettings/views/queryTemplate/queryTemplatePreview.vue

@@ -11,6 +11,7 @@
     <div class="template-content">
       <SimpleTable
         :loading="loading"
+        height="calc(100vh - 80px - 24px - 32px - 20px - 14px)"
         :table-cols="tableCols"
         :data="tableData"
         show-overflow-tooltip
@@ -239,7 +240,7 @@ export default {
             comparisonOperator: '',
             paramValue: '',
             rightBrackets: '',
-            connector: ''
+            connector: 'and'
           }
         ],
         validateRules: {},
@@ -368,7 +369,7 @@ export default {
         comparisonOperator: '',
         paramValue: '',
         rightBrackets: '',
-        connector: ''
+        connector: 'and'
       })
     },
     selectChangeHandler(value, rowIndex, colIndex) {
@@ -433,10 +434,10 @@ export default {
               (['is Null', 'is not Null'].includes(comparisonOperator)
                 ? ''
                 : comparisonOperator === 'like'
-                ? `%${paramValue}%`
-                : paramValue) +
+                ? `\'%${paramValue}%\'`
+                : `\'${paramValue}\'`) +
               rightBrackets +
-              (index < paramsRowNum - 1 ? connector : '')
+              (index < paramsRowNum - 1 ? ` ${connector} ` : '')
             )
           },
           ''
@@ -454,18 +455,18 @@ export default {
       this.paramsTableCols[3].inputType.splice(index, 1)
       this.paramsForm.params.splice(index, 1)
     },
-    getColumnSet(columnSet) {
-      this.columnSet = {}
+    async getColumnSet(columnSet) {
       this.paramsTableCols[1].options = []
+      const reflect = {}
       columnSet.forEach(async column => {
         if (!this.columnSet[column.columnName]) {
           this.columnSet[column.columnName] = column
-          if (column.listqueryTemplateID && !this.columnSet[column.columnName.options]) {
-            const options = await this.getSelectData(column.listqueryTemplateID)
-            this.columnSet[column.columnName].options = options.map(option => ({
-              label: option.k,
-              value: option.v
-            }))
+          if ((column.listqueryTemplateID ?? '') !== '' && !this.columnSet[column.columnName].options) {
+            if (reflect[column.listqueryTemplateID]) {
+              reflect[column.listqueryTemplateID].push(column.columnName)
+            } else {
+              reflect[column.listqueryTemplateID] = [column.columnName]
+            }
           }
           this.paramsTableCols[1].options.push({
             label: column.columnLabel,
@@ -473,6 +474,17 @@ export default {
           })
         }
       })
+      const optionsList = await Promise.all(
+        Object.keys(reflect).map(listqueryTemplateID => this.getSelectData(Number(listqueryTemplateID)))
+      )
+      optionsList.forEach(({ id, options }) => {
+        reflect[id].forEach(columnName => {
+          this.columnSet[columnName].options = options.map(option => ({
+            label: option.k,
+            value: option.v
+          }))
+        })
+      })
     },
     load() {
       if (this.noMore || this.loading) {
@@ -487,19 +499,21 @@ export default {
     },
     // 获取下拉数据
     async getSelectData(id) {
+      const result = { id }
       try {
         const { code, returnData } = await Query({
           id,
           dataContent: []
         })
         if (Number(code) === 0) {
-          return returnData.listValues
+          result.options = returnData.listValues
         } else {
-          return []
+          result.options = []
         }
       } catch (error) {
-        this.$message.error('失败')
+        result.options = []
       }
+      return result
     },
     async queryTableData() {
       this.loading = true
@@ -510,7 +524,8 @@ export default {
         } = await Query({
           id: this.queryTemplateID,
           needPage: ++this.page,
-          dataContent: this.queryString ? { whereString: this.queryString } : []
+          dataContent: [],
+          queryConcat: this.queryString || '1 = 2'
         })
         if (Number(code) === 0) {
           if (listValues.length === 0) {
@@ -539,9 +554,6 @@ export default {
   line-height: 32px;
   margin-bottom: 20px;
 }
-.template-content {
-  height: calc(100vh - 80px - 24px - 32px - 20px - 14px);
-}
 #dialogSearch {
   .title {
     display: flex;