yrik 4 éve
szülő
commit
1d11aec97b

+ 9 - 1
ruoyi-ui/src/api/system/table.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 获取表单数据
 export function getQueryList(data) {
   return request({
-    url: '/boman-web-core/p/cs/queryList',
+    url: '/boman-web-core/p/cs/table/getByTableName',
     method: 'POST',
     data
   })
@@ -16,3 +16,11 @@ export function getTableQuery(data) {
     data
   })
 }
+
+// 删除菜单
+export function delMenu(id) {
+  return request({
+    url: 'boman-web-core/p/cs/objectDelete',
+    method: 'delete'
+  })
+}

+ 1 - 0
ruoyi-ui/src/components/DynamicForms/index.vue

@@ -137,6 +137,7 @@
         console.log(file);
       },
       handleQuery() {
+        
         this.$emit('btns')
       },
       handleCheckedCitiesChange(value){

+ 4 - 2
ruoyi-ui/src/views/index.vue

@@ -367,11 +367,13 @@ export default {
       },
       //日历弹框
       calendaradd:{
-        table:'sys_schedule'
+        table:'sys_schedule',
+        isUi:false
       },
       //备忘录弹框
       calendaraddmer:{
-        table:'sys_memorandum'
+        table:'sys_memorandum',
+        isUi:false
       },
       // input
       inputList:[],

+ 1 - 0
ruoyi-ui/src/views/system/surface/index.vue

@@ -94,6 +94,7 @@
       },
       /** 搜索按钮操作 */
       handleQuery() {
+        console.log(3)
         for(let item of this.queryData.queryList){
           if(item.htmlType == 'checkbox' || item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload'){
             this.queryParams[item.columnName] = this.$refs[item.columnName][0].config

+ 57 - 33
ruoyi-ui/src/views/system/table/index.vue

@@ -4,44 +4,29 @@
       <p>单表</p>
       <el-divider></el-divider>
       <div class="table_headerBtun" v-if="queryData.buttonList">
-        <el-button type="primary" plain v-for="(item,index) in queryData.buttonList.split('')" :key="index">{{item | btnConversion}}</el-button>
+        <el-button type="primary" plain v-for="(item,index) in queryData.buttonList.split('')" :key="index" @click="handleQuery()">{{item | btnConversion}}</el-button>
       </div>
-
     </div>
     <!-- 内容 -->
     <div class="table_nav headertable_nav">
       <el-collapse v-model="activeNames" @change="handleChange">
-        <el-collapse-item :title="title" :name="index" v-for="(item,index) in 4" :key="index">
+        <el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in taleLisst" :key="index">
           <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="120px">
             <el-row :gutter="0">
               <el-col :span="24"  :key="index">
-                  <dynamic-forms :config="queryParams" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList" :key='index' />
+                  <dynamic-forms :ref="items.columnName" :config="queryParams" @inputs = "changeFn" :formConfig="items" v-for="(items,indexs) in item.hrChildren" :key='indexs' />
               </el-col>
-              <!-- <el-col :span="6" v-for="(item,index) in 12" :key="index">
-                  <el-form-item :label="labletit" prop="dictName">
-                   <el-input
-                       v-model="queryParams.dictName"
-                       placeholder="请输入字典名称"
-                       clearable
-                       size="small"
-                       @keyup.enter.native="handleQuery"
-                  />
-                 </el-form-item>
-              </el-col> -->
             </el-row>
           </el-form>
         </el-collapse-item>
-
       </el-collapse>
     </div>
-
   </div>
-
 </template>
-
 <script>
   import {
-    getTableQuery
+    getTableQuery,
+    getQueryList
   } from '@/api/system/table.js'
   export default {
     name: "index",
@@ -51,13 +36,21 @@
         showSearch: true,
         activeNames: ['1'],
         title: '单表1',
+        tabledeLise:{
+          table:'obj_test',
+          isUi:true
+        },
         queryData: {},
         // 查询参数
         queryParams: {
           pageNum: 1,
           pageSize: 10,
         },
-        labletit: '查询参数1233'
+        labletit: '查询参数1233',
+        tableZbie:{
+          table:'obj_test'
+        },
+        taleLisst:[]
       };
     },
     filters:{
@@ -84,6 +77,7 @@
     },
     mounted() {
       this.init()
+      this.tablsie()
     },
     methods: {
       changeFn(obj) {
@@ -96,6 +90,14 @@
       },
       /** 搜索按钮操作 */
       handleQuery() {
+         console.log(this.taleLisst,4)
+        for(let item of this.taleLisst){
+          if(item.htmlType == 'checkbox' || item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload'){
+            this.queryParams[item.columnName] = this.$refs[item.columnName][0].config
+          } else{
+            this.queryParams[item.columnName] = this.$refs[item.columnName][0].config[item.columnName]
+          }
+        }
         console.log(this.queryParams)
         // this.getList();
       },
@@ -103,24 +105,46 @@
 
       },
       init() {
-        getTableQuery({
-          table: 'obj_test'
-        }).then(res => {
+        getTableQuery(
+          this.tableZbie
+        ).then(res => {
           let data = res.data
           this.queryData = data
-          console.log( this.queryData.queryList)
-          this.queryData.queryList.filter(route => {
-            if(route.htmlType == 'checkbox'){
-              route.sysDictDatatwo = []
-              route.sysDictDatatwo.push(route.columnName)
-              console.log(route.sysDictDatatwo,846)
-            }
-          })
-          console.log(this.queryData.queryList)
+          console.log(this.queryData,567)
+        })
+      },
+      tablsie(){
+        console.log(1234)
+        getQueryList(
+          this.tabledeLise
+        ).then(res => {
+          let data = res.data
+          this.taleLisst = data
+          // console.log(this.queryData.queryList)
         })
       },
       handleChange(val) {
         console.log(val);
+      },
+      // 按钮点击
+      delet(index){
+      console.log(index)
+      if(index == 'D'){
+        this.handleDelete(index)
+      }
+      },
+      //删除
+      handleDelete(row) {
+        this.$confirm('是否确认删除名称为"' + row + '"的数据项?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+            // return delMenu(row.id);
+          }).then(() => {
+            // this.getList();
+            this.msgSuccess("删除成功");
+          })
       }
     },
   };