Browse Source

页面更新

sr 4 years ago
parent
commit
c84d3cf126
3 changed files with 119 additions and 5 deletions
  1. 7 0
      ruoyi-ui/src/api/tool/gen.js
  2. 1 1
      ruoyi-ui/src/settings.js
  3. 111 4
      ruoyi-ui/src/views/tool/gen/editTable.vue

+ 7 - 0
ruoyi-ui/src/api/tool/gen.js

@@ -201,6 +201,13 @@ export function getGenTableColumn(tableId) {
   })
 }
 // 获取字段信息
+export function getByIdWithForeignKey(tableId) {
+  return request({
+    url: '/boman-gen/genTableColumn/getByIdWithForeignKey/' + tableId,
+    method: 'get',
+  })
+}
+// 获取字段信息
 export function getLoadTable() {
   return request({
     url: 'boman-gen/init/loadTable',

+ 1 - 1
ruoyi-ui/src/settings.js

@@ -24,7 +24,7 @@ module.exports = {
   /**
    * 是否固定头部
    */
-  fixedHeader: false,
+  fixedHeader: true,
 
   /**
    * 是否显示logo

+ 111 - 4
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -135,9 +135,12 @@
               </el-col>
               <el-col :span="8">
                 <el-form-item label="外键(FK):" prop="foreignKey">
-                  <el-select style="width: 100%;" filterable v-model="formZd.foreignKey" placeholder="请选择外键(FK)" clearable size="small">
+                  <!-- <el-select style="width: 100%;" filterable v-model="formZd.foreignKey" placeholder="请选择外键(FK)" clearable size="small">
                     <el-option v-for="dict in columList" :key="dict.columnId" :label="dict.columnName" :value="dict.columnId" />
-                  </el-select>
+                  </el-select> -->
+                  <div style="cursor: pointer;" @click="fkzdFn">
+                    <el-input readonly style="width: 100%;" v-model="ForeName" placeholder="请选择外键(FK)" />
+                  </div>
                 </el-form-item>
               </el-col>
 
@@ -356,6 +359,26 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <!-- 快速搜索对话框 -->
+    <el-dialog :close-on-click-modal="false" :title="titleopenquery" :visible.sync="openquery" width="1200px" append-to-body>
+      <el-form ref="formquery" @row-dblclick="dbSelectedZd" :model="formquery" :rules="rules" label-width="100px">
+          <dynamic-forms :ref="item.columnName" :config="formquery.fixedData" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList" :key='index' />
+      <el-form-item style="display: inline-block;">
+        <el-button type="primary"   @click="handleQuery">搜索</el-button>
+        <el-button   @click="openquery = false">取消</el-button>
+      </el-form-item>
+      </el-form>
+      <el-table stripe @row-dblclick="tableBtn" :data="postListquery.rows" @selection-change="handleSelectionChange">
+        <el-table-column :label="item.columnComment" align="center" :prop="item.columnName" v-for="(item,index) in postListquery.tableHeadList" :key="index"  />
+      </el-table>
+      <pagination
+        v-show="totalquery>0"
+        :total="totalquery"
+        :page.sync="aliemg.pageNo"
+        :limit.sync="aliemg.pageSize"
+        @pagination="getLisail"
+      />
+    </el-dialog>
   </el-card>
 </template>
 <script>
@@ -377,6 +400,9 @@
     delGenTableColumn,
     setGenTableColumn,
     getGenTableColumn,
+    getByIdWithForeignKey,
+    listIndexfou,
+    tableQuery,
     qurGenTable
   } from "@/api/tool/gen";
   import {
@@ -399,13 +425,36 @@
     data() {
       _this = this
       return {
+        ForeName: '',
+        totalquery:0,
+        // 多行查询
+        titleopenquery:'快速查询',
+        // 获取输入框的参数
+        queryLisr:{
+          table:'gen_table_column'
+        },
+        aliemg:{
+          table:'gen_table_column',
+          orderBy:'create_time desc',
+          pageNo:1,
+          pageSize:10,
+          fixedData:{
+            condition:''
+          }
+        },
+        postListquery:{},
+        queryData: {},
+        openquery:false,
+        formquery:{},
         // 字段信息
         tableSqlData: [],
         columList: [],
         columHRList: [],
         foreignKey: [],
         openZd: false,
-        formZd: {},
+        formZd: {
+          columnId: ''
+        },
         rulesZd: {
           columnName: [{
             required: true,
@@ -581,8 +630,65 @@
         });
       }
       this.tabList()
+
     },
     methods: {
+      tableBtn(row){
+        this.openquery = false
+        this.ForeName = row.column_name
+        this.formZd.foreignKey = row.column_id
+      },
+      fkzdFn() {
+        this.queryedit()
+        this.getLisail()
+        this.openquery = true
+      },
+      changeFn(obj) {
+        console.log(obj)
+        for(let key in obj){
+          this.formquery.fixedData[key] = obj[key]
+        }
+      },
+      // 快速查询
+      queryedit(){
+        this.loading = true;
+        tableQuery(this.queryLisr).then(response => {
+           let data = response.data
+           this.queryData = data
+            this.loading = false;
+          })
+      },
+      handleQuery(){
+        for(let item of this.queryData.queryList){
+          if(item.htmlType == 'checkbox' || item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload'){
+            this.formquery[item.columnName] = this.$refs[item.columnName][0].config
+          } else{
+            this.formquery[item.columnName] = this.$refs[item.columnName][0].config[item.columnName]
+          }
+        }
+       this.aliemg.fixedData.condition = this.formquery
+       this.getLisail()
+      },
+      // 快速查询列表
+      getLisail() {
+        this.loading = true;
+        listIndexfou(this.aliemg).then(response => {
+            if(response.data !== undefined){
+              // this.tableDataalid = response.data.tableHeadList;
+              this.postListquery = response.data
+              this.postListquery.rows.filter(route => {
+
+                if(route.dept_id !== undefined){
+                   route.dept_id = route.dept_id.value
+                }
+              })
+              console.log(this.tableDataalid,67)
+              this.totalquery = response.data.total;
+            }
+            this.loading = false;
+          }
+        );
+      },
       submitFormZd() {
         this.$refs["formZd"].validate(valid => {
           if (valid) {
@@ -652,10 +758,11 @@
       dbSelectedZd(row) {
         this.reset();
         const id = row.columnId
-        getGenTableColumn(id).then(response => {
+        getByIdWithForeignKey(id).then(response => {
           let data = response.data
           data.foreignKey = data.foreignKey ? data.foreignKey - 0 : ''
           this.formZd = data;
+          this.ForeName = data.fkInfo.value
           this.openZd = true;
           this.title = "修改字段信息";
         });