zhaoke 1 жил өмнө
parent
commit
0081e3034b

+ 6 - 6
public/staticConfig.js

@@ -51,10 +51,10 @@ switch (baseNewUrl) {
   case 'localhost':
     PLATFROM_CONFIG = {
       ...PLATFROM_CONFIG,
-      baseNewUrl: 'http://120.26.64.82:9500',
-      baseURLCA: 'http://120.26.64.82:9500',
-      fileUrl: 'http://120.26.64.82:9500',
-      expressUrl: 'http://120.26.64.82:9500',
+      baseNewUrl: 'http://192.168.3.79:9500',
+      baseURLCA: 'http://192.168.3.79:9500',
+      fileUrl: 'http://192.168.3.79:9500',
+      expressUrl: 'http://192.168.3.79:9500',
       tempUrl: 'http://10.211.67.163:16300', // 1.0临时地址
       tempToken: 'bb1bcfcb336b40e9b8602e808b053c3b', // 1.0临时token
       tempUserId: '1656481036109',
@@ -65,8 +65,8 @@ switch (baseNewUrl) {
   default:
     PLATFROM_CONFIG = {
       ...PLATFROM_CONFIG,
-      baseNewUrl: 'http://120.26.64.82:9500',
-      baseURLCA: 'http://120.26.64.82:9500',
+      baseNewUrl: 'http://192.168.3.79:9500',
+      baseURLCA: 'http://192.168.3.79:9500',
     }
     break
 }

+ 135 - 45
src/components/AdvancedQuery/index.vue

@@ -1,73 +1,88 @@
 <template>
   <div class="AdvancedQuery">
     <div class="AdvancedQuery_from">
-      <el-form ref="paramsForm" class="query-params" :model="paramsForm" :rules="paramsForm.validateRules">
-        <el-row class="query-params-wrapper">
-          <el-col v-for="(row, rowIndex) in paramsForm.params" class="query-params-wrapper-list flex-wrap" :key="rowIndex" :span="24">
-            <el-form-item v-for="(col, colIndex) in paramsTableCols" :key="colIndex" :prop="'params.' + rowIndex + '.' + col.prop" :rules="paramsForm.validateRules[col.prop]">
-              <template v-if="
+      <el-scrollbar style="height: 100%" :horizontal="false">
+        <el-form ref="paramsForm" class="query-params" :model="paramsForm" :rules="paramsForm.validateRules">
+          <el-row class="query-params-wrapper">
+            <el-col v-for="(row, rowIndex) in paramsForm.params" class="query-params-wrapper-list flex-wrap" :key="rowIndex" :span="24">
+              <el-form-item v-for="(col, colIndex) in paramsTableCols" :key="colIndex" :prop="'params.' + rowIndex + '.' + col.prop" :rules="paramsForm.validateRules[col.prop]">
+                <template v-if="
                   col.prop === 'comparisonOperator' ||
                   col.inputType[rowIndex] === 'select'
                 ">
-                <el-select style="width: 120px;" v-model="row[col.prop]" placeholder="请选择" @change="
+                  <el-select style="width: 120px;" v-model="row[col.prop]" placeholder="请选择" @change="
                     value => {
                       selectChangeHandler(value, rowIndex, colIndex)
                     }
                   ">
-                  <el-option v-for="(option, i) in col.options[rowIndex]" :key="i" :value="option.value" :label="option.label" />
-                </el-select>
-              </template>
-              <template v-else-if="col.inputType === 'select'">
-                <el-select v-model="row[col.prop]" placeholder="请选择" @change="
+                    <el-option v-for="(option, i) in col.options[rowIndex]" :key="i" :value="option.value" :label="option.label" />
+                  </el-select>
+                </template>
+                <template v-else-if="col.inputType === 'select'">
+                  <el-select style="width: 130px;" v-model="row[col.prop]" placeholder="请选择" @change="
                     value => {
                       selectChangeHandler(value, rowIndex, colIndex)
                     }
                   ">
-                  <el-option v-for="(option, i) in col.options" :key="i" :value="option.value" :label="option.label" />
-                </el-select>
-              </template>
-              <template v-else-if="
+                    <el-option v-for="(option, i) in col.options" :key="i" :value="option.value" :label="option.label" />
+                  </el-select>
+                </template>
+                <template v-else-if="
                   ['varchar', 'text', 'longtext'].includes(
                     col.inputType[rowIndex]
                   )
                 ">
-                <el-input v-model="row[col.prop]" placeholder="请输入" :disabled="
+                  <el-input v-model="row[col.prop]" placeholder="请输入" :disabled="
                     col.prop === 'paramValue' && paramsForm.disabled[rowIndex]
                   " />
-              </template>
-              <template v-else-if="col.inputType[rowIndex] === 'number'">
-                <el-input v-model="row[col.prop]" placeholder="请输入" :disabled="
+                </template>
+                <template v-else-if="col.inputType[rowIndex] === 'number'">
+                  <el-input v-model="row[col.prop]" placeholder="请输入" :disabled="
                     col.prop === 'paramValue' && paramsForm.disabled[rowIndex]
                   " @keydown.native="inputHold(row[col.prop])" @input="inputLimit(row[col.prop], rowIndex)" @blur="inputFix(row[col.prop], rowIndex)" />
-              </template>
-              <template v-else-if="col.inputType[rowIndex] === 'date'">
-                <el-date-picker v-model="row[col.prop]" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" :clearable="false" />
-              </template>
-              <template v-else-if="col.inputType[rowIndex] === 'datetime'">
-                <el-date-picker v-model="row[col.prop]" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :clearable="false" />
-              </template>
-              <template v-else-if="col.inputType === 'delete'">
-                <i class="clickable-delete el-icon-error" @click="deleteParam(rowIndex)" />
-              </template>
-              <template v-else-if="col.inputType === 'connector'">
-                <div v-if="row.connector" class="clickable-toggle" @click="toggle(rowIndex)">
-                  {{ row.connector === 'and' ? '并且' : '或者' }}
-                </div>
-                <div v-else class="clickable-add" @click="addParamsHandler">
-                  <span class="el-icon-circle-plus-outline"></span>
-                </div>
-              </template>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
+                </template>
+                <template v-else-if="col.inputType[rowIndex] === 'date'">
+                  <el-date-picker v-model="row[col.prop]" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" :clearable="false" />
+                </template>
+                <template v-else-if="col.inputType[rowIndex] === 'datetime'">
+                  <el-date-picker v-model="row[col.prop]" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :clearable="false" />
+                </template>
+                <template v-else-if="col.inputType === 'delete'">
+                  <i class="clickable-delete el-icon-error" @click="deleteParam(rowIndex)" />
+                </template>
+                <template v-else-if="col.inputType === 'connector'">
+                  <div v-if="row.connector" class="clickable-toggle" @click="toggle(rowIndex)">
+                    {{ row.connector === 'and' ? '并且' : '或者' }}
+                  </div>
+                  <div v-else class="clickable-add" @click="addParamsHandler">
+                    <span class="el-icon-circle-plus-outline"></span>
+                  </div>
+                </template>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-scrollbar>
+    </div>
+    <div class="AdvancedQuery_list">
+      <el-scrollbar style="height: 100%" :horizontal="false">
+        <div v-for="(item,index) in catchOptions" :key="index">
+          <div style="cursor: pointer;" class="flex">
+            <span class="AdvancedQuery_list_text">{{ item.itemKey }}</span>
+            <el-popconfirm :title="'确定删除'+item.itemKey+'吗?'">
+              <span slot="reference" class="el-icon-error"></span>
+            </el-popconfirm>
+          </div>
+          <el-divider v-if="catchOptions.length != index+1"></el-divider>
+        </div>
+      </el-scrollbar>
     </div>
-    <div class="AdvancedQuery_list"></div>
   </div>
 </template>
 
 <script>
 import { parseTime } from '@/utils/index'
+import { mapGetters } from 'vuex'
 const comparisonOperatorOptions = [
   {
     label: '小于等于',
@@ -108,9 +123,17 @@ const comparisonOperatorOptions = [
 ]
 export default {
   name: 'AdvancedQueryForm',
+  props: {
+    selectOptions: {
+      type: Array,
+      default: () => []
+    }
+  },
   data () {
     return {
       queryContent: [],
+      catchOptions: JSON.parse(localStorage.getItem('catchOptions')) || [],
+      catchOptionsAll: [],
       flightDate: new Array(2).fill(parseTime(new Date(), '{y}-{m}-{d}')),
       paramsForm: {
         params: [],
@@ -167,10 +190,36 @@ export default {
       columnSet: {},
     }
   },
+  computed: {
+    ...mapGetters(['authMsg']),
+  },
+  watch: {
+    'paramsForm.params': {
+      handler (params) {
+        const { length } = params
+        params[length - 1].connector = ''
+        if (params[length - 2] && !params[length - 2].connector) {
+          params[length - 2].connector = 'and'
+        }
+      },
+    },
+  },
   mounted () {
-    this.addParamsHandler()
+    this.queryHandler()
   },
   methods: {
+    queryHandler () {
+      const colDatas = this.authMsg
+      console.log(colDatas)
+      if (colDatas?.length) {
+        const columns = colDatas.filter(item => item.isdisplay != 0)
+        const datas = _.orderBy(columns, ['displaynumber'], ['asc', 'desc'])
+        this.getColumnSet(datas)
+      }
+      if (!this.paramsForm.params.length) {
+        this.addParamsHandler()
+      }
+    },
     advancedQueryHandler () {
       try {
         this.$refs['paramsForm'].validate(valid => {
@@ -302,17 +351,58 @@ export default {
       this.paramsForm.params[rowIndex].connector =
         connector === 'and' ? 'or' : 'and'
     },
+    getColumnSet (columnSet) {
+      const reflect = {}
+      columnSet.forEach(async item => {
+        if (!this.columnSet[item.columncode]) {
+          this.columnSet[item.columncode] = item
+
+          this.paramsTableCols[0].options.push({
+            label: item.columnname,
+            value: item.columncode,
+          })
+        }
+      })
+    },
+    //收藏
+    advancedQueryCollect () {
+      this.advancedQueryHandler()
+      if (!this.queryContent.length) return
+      this.$prompt('请输入收藏标题', '收藏', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputPattern: /^.+$/,
+        inputErrorMessage: '请输入收藏标题'
+      }).then(({ value }) => {
+        this.catchOptionsAll.push(this.queryContent)
+        const catchItem = {
+          itemKey: value,
+          itemVal: this.catchOptionsAll?.at(-1)
+        }
+        this.catchOptions.push(catchItem)
+        localStorage.setItem('catchOptions', JSON.stringify(this.catchOptions))
+      }).catch((err) => {
+        console.log(err)
+        this.$message({
+          type: 'info',
+          message: '取消输入'
+        });
+      });
+    }
   }
 }
 </script>
 
 <style lang="scss" scoped>
 .AdvancedQuery {
-  height: 100%;
+  height: calc(100vh - 172px);
   position: relative;
   width: 100%;
   &_from {
-    height: 65%;
+    height: 80%;
+  }
+  &_list {
+    height: 20%;
   }
   .query-params-wrapper-list {
     .el-form-item {

+ 1 - 1
src/getMenu.js

@@ -49,7 +49,7 @@ router.beforeEach(async (to, from, next) => {
       } else {
         try {
           const treeData = await store.dispatch('user/getMenuInfo')
-          if (Array.isArray(treeData)) {
+          if (Array.isArray(treeData) && treeData.length) {
             const nd = treeData.filter(item => item.pageconfigurationid)
             store.dispatch('auth/changeAuthArrs', nd)
             // const typeData = setType(treeData, 'up_auth_id', 'auth_id')

+ 0 - 1
src/utils/validate.js

@@ -315,7 +315,6 @@ export function setTree (arr, parentKey, key) {
 
 export function getAuthData (key) {
   const datas = store.state.auth.authArrs ?? []
-  console.log(datas)
   if (datas.length) {
     const type = datas.filter(item => item['pageconfigurationid'] == key)[0]['pagetype']
     const arrs = datas.filter(item => item['superiorid'] == key)

+ 0 - 1
src/views/table/components/authButton.vue

@@ -32,7 +32,6 @@ export default {
       } else if (servicetype == 3) {
         func = (row) => context.parent.handleEdit(row)
       } else if (servicetype == 4) {
-        console.log(321)
         func = (row) => context.parent.handleRemove(row)
       } else if (servicetype == 5) {
         func = (row, auth) => context.parent.handleOther(row, auth)

+ 8 - 15
src/views/table/index.vue

@@ -89,7 +89,7 @@
       <Dialog dialog-title="高级查询" dialogSize="600px" :dialog-drawer="advancedDrawer" @handleClose="advancedDrawer = false" @handleSubmit="advancedTable('advancedDialogForm')">
         <AdvancedQuery ref="advancedDialogForm" @getAdvancedQueryData="getAdvancedQueryData" />
         <template slot="d_foot">
-          <el-button size="small" type="primary">收藏</el-button>
+          <el-button size="small" @click="queryCollect('advancedDialogForm')" type="primary">收藏</el-button>
         </template>
       </Dialog>
     </div>
@@ -209,7 +209,8 @@ export default {
       tableDataSortRules: {},
       tableKey: '',
       dataContent: {},
-      advancedDrawer: false
+      advancedDrawer: false,
+      selectOptions: [],
     };
   },
   computed: {
@@ -382,8 +383,6 @@ export default {
       })
     },
     autoBtnObj (item) {
-      console.log(item)
-
       switch (item.servicetype) {
         case '1':
           this.btnQueryObj = item
@@ -613,9 +612,7 @@ export default {
           obj.value = data
         } else if (event == 2) {
           obj.value = data
-          console.log(obj.filter)
           obj.filter[key] = obj.value[key]
-          console.log(obj.filter)
           if (obj.value[key]) {
             delete obj.value[key]
           }
@@ -676,11 +673,9 @@ export default {
     },
     //初始化表格
     initTableData () {
-      console.log(this.tableCols)
       this.tableColsCopy = this.tableCols.filter((item) => item.isdisplay == 2);
       this.tableColsCopy = _.orderBy(this.tableColsCopy, ['displaynumber'], ['asc']);
       this.formItem = this.tableCols.filter((item) => item.isdisplay == 2 || item.isdisplay == 3);
-      console.log(this.formItem)
       this.formItem = _.orderBy(this.formItem, ['displaynumber'], ['asc']);
       this.tableDataCopy = _.cloneDeep(this.tableData);
       const datas = _.cloneDeep(this.tableColsCopy);
@@ -893,13 +888,10 @@ export default {
     //表格-编辑
     async handleEdit (row) {
       const { openmode, pageroute } = this.btnEditObj
-      console.log(this.btnEditObj)
       if (openmode) {
         if (openmode != 2) {
           this.autoBtnClick(openmode, pageroute)
         } else {
-          console.log(111)
-
           this.flag = true;
           this.tableType = "edit";
           this.tableTitle = "编辑";
@@ -921,14 +913,11 @@ export default {
     //表格-数据恢复
     async handleRecord (row) {
       const { openmode, pageroute } = this.btnRecordObj
-      console.log(code)
-
       const params = {
         "serviceId": row.serviceId,
         "dataObjectId": row.dataObjectId
       }
       const { code } = await abnormalDataRecovery(params)
-      console.log(code)
     },
 
     // 新增/编辑-确认
@@ -1023,8 +1012,12 @@ export default {
       this.$refs[refName].advancedQueryHandler()
     },
     getAdvancedQueryData (dataRules) {
-      console.log(dataRules)
+      this.selectOptions.push(dataRules)
     },
+    //收藏
+    queryCollect (refName) {
+      this.$refs[refName].advancedQueryCollect()
+    }
   },
 };
 </script>