Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

Administrator 4 жил өмнө
parent
commit
23a7d2c095

+ 55 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/ObjController.java

@@ -152,6 +152,61 @@ public class ObjController {
         return tableServiceCmdService.getTableQuery(condition);
         return tableServiceCmdService.getTableQuery(condition);
     }
     }
 
 
+    /**
+     * 功能描述: 获取表单查询字段
+     * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
+     * 刷新的入口为 {@link MyController#loadTable(com.boman.gen.domain.GenTable)}
+     *
+     *                    eg:{
+     *                          "table": "sys_config"
+     *                        }
+     *
+     * @param condition condition
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    @ApiOperation(value = "获取表单查询字段")
+    @PostMapping("/getQueryParam")
+    public AjaxResult getQueryParam(@RequestBody BaseTableSaveDTO condition) {
+        return tableServiceCmdService.getQueryParam(condition);
+    }
+
+
+    /**
+     * 功能描述: 获取表单表头
+     * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
+     * 刷新的入口为 {@link MyController#loadTable(com.boman.gen.domain.GenTable)}
+     *
+     *                    eg:{
+     *                          "table": "sys_config"
+     *                        }
+     *
+     * @param condition condition
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    @ApiOperation(value = "获取表单表头")
+    @PostMapping("/getTableHead")
+    public AjaxResult getTableHead(@RequestBody BaseTableSaveDTO condition) {
+        return tableServiceCmdService.getTableHead(condition);
+    }
+
+    /**
+     * 功能描述: 获取表单按钮
+     * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
+     * 刷新的入口为 {@link MyController#loadTable(com.boman.gen.domain.GenTable)}
+     *
+     *                    eg:{
+     *                          "table": "sys_config"
+     *                        }
+     *
+     * @param condition condition
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    @ApiOperation(value = "获取表单按钮")
+    @PostMapping("/getButton")
+    public AjaxResult getButton(@RequestBody BaseTableSaveDTO condition) {
+        return tableServiceCmdService.getButton(condition);
+    }
+
     /**
     /**
      * 功能描述: 获取表单子表
      * 功能描述: 获取表单子表
      *
      *

+ 65 - 0
boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java

@@ -353,6 +353,71 @@ public class TableServiceCmdService {
         return AjaxResult.success(jsonObject);
         return AjaxResult.success(jsonObject);
     }
     }
 
 
+    /**
+     * 功能描述: 获取表单查询字段
+     * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
+     * 刷新的入口为 {@link MyController#loadTable(com.boman.gen.domain.GenTable)}
+     *
+     *                    eg:{
+     *                          "table": "sys_config"
+     *                        }
+     *
+     * @param condition condition
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    public AjaxResult getQueryParam(BaseTableSaveDTO condition) {
+        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
+        List<GenTableColumn> columns = genTable.getColumns();
+        // 查询字段
+        ArrayList<GenTableColumn> queryList = Lists.newArrayListWithCapacity(16);
+        for (GenTableColumn column : columns) {
+            if (GenTableColumn.IS_QUERY.equalsIgnoreCase(column.getIsQuery())) {
+                String dictType = column.getDictType();
+                if (ObjectUtils.isNotEmpty(dictType)) {
+                    List<SysDictData> sysDictData1 = remoteDictDataService.listByType(dictType);
+                    column.setSysDictData(sysDictData1);
+                }
+                queryList.add(column);
+            }
+        }
+
+        return AjaxResult.success(queryList);
+    }
+
+    /**
+     * 功能描述: 获取表单表头
+     * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
+     * 刷新的入口为 {@link MyController#loadTable(com.boman.gen.domain.GenTable)}
+     *
+     *                    eg:{
+     *                          "table": "sys_config"
+     *                        }
+     *
+     * @param condition condition
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    public AjaxResult getTableHead(BaseTableSaveDTO condition) {
+        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
+        return AjaxResult.success(getTableHeadList(genTable));
+    }
+
+    /**
+     * 功能描述: 获取表单按钮
+     * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
+     * 刷新的入口为 {@link MyController#loadTable(com.boman.gen.domain.GenTable)}
+     *
+     *                    eg:{
+     *                          "table": "sys_config"
+     *                        }
+     *
+     * @param condition condition
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    public AjaxResult getButton(BaseTableSaveDTO condition) {
+        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
+        return AjaxResult.success("成功", Strings.nullToEmpty(genTable.getMenuRole()));
+    }
+
 
 
     /**
     /**
      * 根据表对象获取要显示的表头信息
      * 根据表对象获取要显示的表头信息

+ 18 - 0
ruoyi-ui/src/api/system/form.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+// 获取表单的查询字段、按钮、表头信息
+export function getTableQuery(data) {
+  return request({
+    url: '/boman-web-core/p/cs/getTableQuery',
+    method: 'POST',
+    data
+  })
+}
+// 获取单表单数据
+export function getObject(data) {
+  return request({
+    url: '/boman-web-core/p/cs/getObject',
+    method: 'POST',
+    data
+  })
+}

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

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 获取表单数据
 // 获取表单数据
 export function getQueryList(data) {
 export function getQueryList(data) {
   return request({
   return request({
-    url: '/boman-web-core/p/cs/queryList',
+    url: '/boman-web-core/p/cs/table/getByTableName',
     method: 'POST',
     method: 'POST',
     data
     data
   })
   })
@@ -16,3 +16,35 @@ export function getTableQuery(data) {
     data
     data
   })
   })
 }
 }
+
+// 保存
+export function addbjectSave(data) {
+  return request({
+    url: '/boman-web-core/p/cs/objectSave',
+    method: 'POST',
+    data
+  })
+}
+// 获取表单列表数据
+export function getObject(data) {
+  return request({
+    url: '/boman-web-core/p/cs/getObject',
+    method: 'POST',
+    data
+  })
+}
+// 根据表名获取表单信息
+export function getByTableName(data) {
+  return request({
+    url: '/boman-web-core/p/cs/table/getByTableName',
+    method: 'POST',
+    data
+  })
+}
+export function delMenu(id) {
+  return request({
+    url: 'boman-web-core/p/cs/objectDelete',
+    method: 'delete'
+  })
+}
+

BIN
ruoyi-ui/src/assets/images/login-background.jpg


+ 19 - 2
ruoyi-ui/src/components/DynamicForm/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-    <el-form-item :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
+    <el-form-item :label="formConfig.columnComment" :label-width="converByte(formConfig.columnComment)*7+'px'" style="display: inline-block;" :prop="formConfig.columnName">
       <!-- 输入框 -->
       <!-- 输入框 -->
       <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
       <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
         clearable @keyup.enter.native="handleQuery" />
         clearable @keyup.enter.native="handleQuery" />
@@ -22,7 +22,7 @@
         <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
         <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
       </el-radio-group>
       </el-radio-group>
       <!-- 时间控件 -->
       <!-- 时间控件 -->
-      <el-date-picker value-format="yyyy-MM-dda" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date" :placeholder="'请输入'+formConfig.columnComment">
+      <el-date-picker v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date" :placeholder="'请输入'+formConfig.columnComment">
       </el-date-picker>
       </el-date-picker>
       <!-- 上传图片 -->
       <!-- 上传图片 -->
       <el-upload v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'" :file-list="config" list-type="picture-card"
       <el-upload v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'" :file-list="config" list-type="picture-card"
@@ -84,6 +84,23 @@
     mounted() {
     mounted() {
     },
     },
     methods: {
     methods: {
+      // 字符串转成字节
+      converByte(str){
+        var bt=0;
+            for (var i = 0; i < str.length; i++) {
+                var un = str.charCodeAt(i);
+                if (un>=0 && un<=127) {
+                    bt+=1;
+                }else if (un>127 && un<=2048) {
+                    bt+=2;
+                }else if (un>2048 && un<=65536) {
+                    bt+=3;
+                }else if (un>65536 && un<=2097152) {
+                    bt+=4;
+                }
+            }
+            return bt
+      },
       upImageFn(res, file){
       upImageFn(res, file){
         this.config.push({
         this.config.push({
           name: res.data.name,
           name: res.data.name,

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

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

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

@@ -1,7 +1,7 @@
 module.exports = {
 module.exports = {
   title: '博曼办公协作',
   title: '博曼办公协作',
-  // urls: `http://192.168.101.11:8090`,
-  urls: `http://192.168.101.110:8080`,
+  urls: `http://192.168.101.11:8090`,
+  // urls: `http://192.168.101.110:8080`,
   // urls: `http://192.168.101.49:8080`,
   // urls: `http://192.168.101.49:8080`,
 
 
   // urls: `http://192.168.101.10:8080`,
   // urls: `http://192.168.101.10:8080`,

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

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

+ 253 - 194
ruoyi-ui/src/views/system/form/index.vue

@@ -1,111 +1,95 @@
-<template >
+<template>
   <div class="tabForm">
   <div class="tabForm">
-   <div class="tabForm_header">
-     <p class="index_headetab">
-       <span :class="[num == index ? ' spanto' : '']" v-for="(item,index) in editableTabs" :key="index" @click="tabSbu(index)">{{item.title}}</span>
-     </p>
-     <div class="table_headerBtun">
-          <el-button type="primary" plain v-for="(item,index) in 7" :key="index">新增</el-button>
-     </div>
-   </div>
-   <!-- 内容 -->
-   <div class="table_nav">
-    <el-collapse v-model="activeNames" @change="handleChange">
-      <el-collapse-item :title="title" :name="index" v-for="(item,index) in 1" :key="index" class="eitde">
-        <el-form :model="queryParams" ref="queryForm" :inline="true"  >
-          <el-row :gutter="0">
-            <el-col :span="6" v-for="(item,index) in 8" :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-item :title="title" :name="index" v-for="(item,index) in 1" :key="index" class="eitde">
-      <div class="ppl">
-        <p v-for="(item,index) in 6" :key="index" @click="enditTab(index)">
-          <img src="../../../assets/images/icon_tbtab_normal.png" alt="" class="index_headerImg" v-if="numtab !== index">
-          <img src="../../../assets/images/icon_tbtab_selected.png" alt="" class="index_headerImg" v-if="numtab == index">
-          <span :class="[index == numtab ? 'span' : '']">列表名称</span>
-        </p>
+    <div class="tabForm_header">
+      <div class="table_headerBtun">
+        <el-button type="primary" plain @click="headerBtn(item)" v-for="(item,index) in tabList.buttonList.split('')" :key="index">{{item | btnConversion}}</el-button>
       </div>
       </div>
-      <el-form style="margin-top: 30px;" :model="queryParams" ref="queryForm" :inline="true"  label-width="118px">
-        <el-form-item label="岗位编码" prop="postCode" v-for="(item,index) in 2" :key="index">
-          <el-input
-            v-model="queryParams.postCode"
-            placeholder="请输入岗位编码"
-            clearable
-            size="small"
-            @keyup.enter.native="handleQuery"
-          />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        </el-form-item>
-      </el-form>
-      <el-divider></el-divider>
-       <el-table stripe v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
-         <el-table-column label="序号" align="center" prop="noticeId" width="80" />
-         <el-table-column :label="surlable" align="center" prop="name" />
-         <el-table-column :label="surlable" align="center" sortable prop="name" />
-         <el-table-column label="岗位编码" align="center" prop="postCode" />
-         <el-table-column label="岗位名称" align="center" prop="postName" />
-         <el-table-column label="岗位排序" align="center" prop="postSort" />
-         <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
-         <el-table-column label="创建时间" align="center" prop="createTime" width="160">
-           <template slot-scope="scope">
-             <span>{{ parseTime(scope.row.createTime) }}</span>
-           </template>
-         </el-table-column>
-         <el-table-column label="可用" align="center" class-name="small-padding fixed-width">
+    </div>
+    <!-- 内容 -->
+    <div class="table_nav">
+      <el-collapse v-model="activeNames">
+        <el-collapse-item :title="title" :name="index" v-for="(item,index) in 1" :key="index" class="eitde">
+          <el-form :model="queryParams" ref="queryForm" :inline="true">
+            <el-row :gutter="0">
+              <el-col :span="6" v-for="(item,index) in 8" :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-table-column>
-       </el-table>
-       <div class="index_haderPagin">
-         <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
-              :current-page.sync="currentPage3"
-              :page-size="pageSize"
-              layout="prev, pager, next, jumper"
-              :total="1000">   
-         </el-pagination>
+        <!-- 列表 -->
+        <el-collapse-item :title="title" :name="index" v-for="(item,index) in 1" :key="index" class="eitde">
+          <div class="ppl">
+            <p v-for="(item,index) in 6" :key="index" @click="enditTab(index)">
+              <img src="../../../assets/images/icon_tbtab_normal.png" alt="" class="index_headerImg" v-if="numtab !== index">
+              <img src="../../../assets/images/icon_tbtab_selected.png" alt="" class="index_headerImg" v-if="numtab == index">
+              <span :class="[index == numtab ? 'span' : '']">列表名称</span>
+            </p>
+          </div>
+          <el-form style="margin-top: 30px;" :model="queryParams" ref="queryForm" :inline="true" label-width="118px">
+            <el-form-item label="岗位编码" prop="postCode" v-for="(item,index) in 2" :key="index">
+              <el-input v-model="queryParams.postCode" placeholder="请输入岗位编码" clearable size="small" @keyup.enter.native="handleQuery" />
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+            </el-form-item>
+          </el-form>
+          <el-divider></el-divider>
+          <el-table stripe v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
+            <el-table-column label="序号" align="center" prop="noticeId" width="80" />
+            <el-table-column :label="surlable" align="center" prop="name" />
+            <el-table-column :label="surlable" align="center" sortable prop="name" />
+            <el-table-column label="岗位编码" align="center" prop="postCode" />
+            <el-table-column label="岗位名称" align="center" prop="postName" />
+            <el-table-column label="岗位排序" align="center" prop="postSort" />
+            <el-table-column label="创建时间" align="center" prop="createTime" width="160">
+              <template slot-scope="scope">
+                <span>{{ parseTime(scope.row.createTime) }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="可用" align="center" class-name="small-padding fixed-width">
 
 
-       </div>
-     </el-collapse-item>
+            </el-table-column>
+          </el-table>
+          <div class="index_haderPagin">
+            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage3"
+              :page-size="queryParams.pageSize" layout="prev, pager, next, jumper" :total="1000">
+            </el-pagination>
+          </div>
+        </el-collapse-item>
 
 
-    </el-collapse>
-   </div>
+      </el-collapse>
+    </div>
 
 
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+  import {
+    getTableQuery,
+    getObject
+  } from '@/api/system/form.js'
+
   export default {
   export default {
     name: "index",
     name: "index",
     data() {
     data() {
       return {
       return {
-          editableTabs: [{
-                   title: 'Tab 1',
-                   name: '1',
-                   content: 'Tab 1 content'
-                 }, {
-                   title: 'Tab 2',
-                   name: '2',
-                   content: 'Tab 2 content'
-                 }],
-        num:0,
+        num: 0,
+        loading:true,
+        tabList: {},
+        currentPage3: 0,
         activeNames: ['1'],
         activeNames: ['1'],
-        title:'单表1',
+        title: '单表1',
+        objParams: {
+          table: 'sys_config',
+          fixedData: {
+            id: -1
+          }
+        },
         // 查询参数
         // 查询参数
         queryParams: {
         queryParams: {
           pageNum: 1,
           pageNum: 1,
@@ -114,117 +98,187 @@
           dictType: undefined,
           dictType: undefined,
           status: undefined
           status: undefined
         },
         },
-        labletit:'查询参数1233',
-        surlable:'实际数据库表',
-        postList:[
-          {
-                    date: '2016-05-02',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1518 弄'
-                  }, {
-                    date: '2016-05-04',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1517 弄'
-                  }, {
-                    date: '2016-05-01',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1519 弄'
-                  }, {
-                    date: '2016-05-03',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1516 弄'
-                  }
-        ],
-        numtab:0
+        labletit: '查询参数1233',
+        surlable: '实际数据库表',
+        postList: [{
+          date: '2016-05-02',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }],
+        numtab: 0
       };
       };
     },
     },
+    filters:{
+      btnConversion(val) {
+        switch(val){
+          case 'A':
+          return '新增';
+          case 'M':
+          return '修改';
+          case 'D':
+          return '删除';
+          case 'Q':
+          return '查询';
+          case 'S':
+          return '提交';
+          case 'U':
+          return '反提交';
+          case 'I':
+          return '导入';
+          case 'E':
+          return '导出';
+        }
+      }
+    },
+    mounted() {
+      this.init()
+    },
     methods: {
     methods: {
+      handleCurrentChange() {
+        
+      },
+      handleSizeChange() {
+        
+      },
+      handleSelectionChange() {
 
 
-        // tab点击
-      tabSbu(index){
-       this.num = index
       },
       },
-      enditTab(index){
-       this.numtab = index
+      handleQuery() {
+
+      },
+      headerBtn(item) {
+        switch(item) {
+          case 'A': {
+            return
+          }
+          case 'M': {
+            return
+          }
+          case 'D': {
+            return
+          }
+          case 'Q': {
+            return
+          }
+          case 'S': {
+            return
+          }
+          case 'U': {
+            return
+          }
+          case 'E': {
+            return
+          }
+        }
+      },
+      init() {
+        getTableQuery({
+          table: 'sys_config'
+        }).then(res => {
+          this.tabList = res.data
+          console.log(res)
+        })
+        getObject(this.objParams).then(res => {
+          console.log(res)
+        })
+      },
+      // tab点击
+      tabSbu(index) {
+        this.num = index
+      },
+      enditTab(index) {
+        this.numtab = index
       }
       }
     },
     },
   };
   };
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
-  .tabForm{
-    .el-collapse-item__content{
+  .tabForm {
+    .el-collapse-item__content {
       padding: 0;
       padding: 0;
     }
     }
-   .table_nav{
-     .el-collapse-item__wrap{
-       border-bottom: 0;
-     }
-     .el-collapse-item__header{
-       border-bottom: 0;
-       font-size: 15px;
-       font-family: PingFang SC;
-       font-weight: bold;
-       color: #3C8DBC;
-       line-height: 36px;
-     }
-     .el-form-item__content{
-       width: 55%;
-     }
-     .el-collapse{
-       border-top: 0;
-     }
-     .el-divider--horizontal{
-       margin-top: 0;
-     }
-     .eitde{
-       background-color: #fff;
-       border-radius: 6px;
-       padding: 23px;
-       margin-bottom: 20px;
-     }
-   }
+
+    .table_nav {
+      .el-collapse-item__wrap {
+        border-bottom: 0;
+      }
+
+      .el-collapse-item__header {
+        border-bottom: 0;
+        font-size: 15px;
+        font-family: PingFang SC;
+        font-weight: bold;
+        color: #3C8DBC;
+        line-height: 36px;
+      }
+
+      .el-form-item__content {
+        width: 55%;
+      }
+
+      .el-collapse {
+        border-top: 0;
+      }
+
+      .el-divider--horizontal {
+        margin-top: 0;
+      }
+
+      .eitde {
+        background-color: #fff;
+        border-radius: 6px;
+        padding: 23px;
+        margin-bottom: 20px;
+      }
+    }
   }
   }
 </style>
 </style>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
-
-  .tabForm{
+  .tabForm {
     background-color: #eef0ff;
     background-color: #eef0ff;
     height: 100%;
     height: 100%;
     padding: 20px;
     padding: 20px;
-    p{
+
+    p {
       margin: 0;
       margin: 0;
     }
     }
+
     // 头部
     // 头部
-    .tabForm_header{
-       background-color: #fff;
-       border-radius: 6px;
-       padding: 23px;
-       margin-bottom: 20px;
+    .tabForm_header {
+      background-color: #fff;
+      border-radius: 6px;
+      padding: 23px;
+      margin-bottom: 20px;
 
 
     }
     }
+
     // 内容
     // 内容
-    .table_nav{
+    .table_nav {
+
       // background-color: #fff;
       // background-color: #fff;
       // border-radius: 6px;
       // border-radius: 6px;
       // padding: 23px;
       // padding: 23px;
-      .ppl{
+      .ppl {
         display: flex;
         display: flex;
         height: 38px;
         height: 38px;
-        p{
+
+        p {
           position: relative;
           position: relative;
           width: 113px;
           width: 113px;
           height: 38px;
           height: 38px;
-          img{
+
+          img {
             position: absolute;
             position: absolute;
-            top:0;
+            top: 0;
             left: 0;
             left: 0;
             width: 100%;
             width: 100%;
             height: 100%;
             height: 100%;
             // z-index: -1;
             // z-index: -1;
           }
           }
-          span{
+
+          span {
             width: 100%;
             width: 100%;
             position: absolute;
             position: absolute;
             top: 0;
             top: 0;
@@ -237,48 +291,53 @@
             font-weight: bold;
             font-weight: bold;
             color: #aaa;
             color: #aaa;
           }
           }
-          .span{
+
+          .span {
             color: #3C8DBC;
             color: #3C8DBC;
           }
           }
         }
         }
       }
       }
     }
     }
   }
   }
+
   // tab
   // tab
-  .index_headetab{
+  .index_headetab {
     display: flex;
     display: flex;
     border-bottom: 1px solid #E5E5E5;
     border-bottom: 1px solid #E5E5E5;
     height: 53px;
     height: 53px;
     // padding-top: 20px;
     // padding-top: 20px;
     padding-bottom: 10px;
     padding-bottom: 10px;
     margin-bottom: 20px !important;
     margin-bottom: 20px !important;
-   span{
-     width: 70px;
-     text-align: center;
-     line-height: 53px;
-     height: 53px;
-     font-size: 15px;
-     font-family: PingFang SC;
-     font-weight: bold;
-     color: #666;
-     position: relative;
-     // flex: 1;
-     // border-bottom: ;
-   }
-   .span{
-     content: '';
-     display: block;
-     width: 18px;
-     height: 8px;
-     border-radius: 3px;
-     background-color: #3C8DBC;
-     color: #3C8DBC !important;
-     // position: absolute;
-     // border-bottom: ;
-   }
-  .spanto{
-    color:#3C8DBC ;
-    border-bottom: 3px solid #3C8DBC;
-  }
+
+    span {
+      width: 70px;
+      text-align: center;
+      line-height: 53px;
+      height: 53px;
+      font-size: 15px;
+      font-family: PingFang SC;
+      font-weight: bold;
+      color: #666;
+      position: relative;
+      // flex: 1;
+      // border-bottom: ;
+    }
+
+    .span {
+      content: '';
+      display: block;
+      width: 18px;
+      height: 8px;
+      border-radius: 3px;
+      background-color: #3C8DBC;
+      color: #3C8DBC !important;
+      // position: absolute;
+      // border-bottom: ;
+    }
+
+    .spanto {
+      color: #3C8DBC;
+      border-bottom: 3px solid #3C8DBC;
+    }
   }
   }
 </style>
 </style>

+ 5 - 0
ruoyi-ui/src/views/system/menu/index.vue

@@ -143,6 +143,11 @@
               <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
               <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="表名称" prop="sysTableName">
+              <el-input v-model="form.sysTableName" placeholder="请输入表名称" />
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
           <el-col :span="12">
             <el-form-item v-if="form.menuType != 'F'" label="是否外链">
             <el-form-item v-if="form.menuType != 'F'" label="是否外链">
               <el-radio-group v-model="form.isFrame">
               <el-radio-group v-model="form.isFrame">

+ 99 - 36
ruoyi-ui/src/views/system/surface/index.vue

@@ -4,7 +4,7 @@
       <!-- <p>单表</p>
       <!-- <p>单表</p>
       <el-divider></el-divider> -->
       <el-divider></el-divider> -->
       <div class="table_headerBtun" v-if="queryData.buttonList">
       <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 @click="headerBtn(item)" v-for="(item,index) in queryData.buttonList.split('')" :key="index">{{item | btnConversion}}</el-button>
       </div>
       </div>
       <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" >
       <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" >
         <dynamic-form :ref="item.columnName" :config="queryParams" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList" :key='index' />
         <dynamic-form :ref="item.columnName" :config="queryParams" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList" :key='index' />
@@ -16,46 +16,58 @@
     </div>
     </div>
     <!-- 内容 -->
     <!-- 内容 -->
     <div class="table_nav">
     <div class="table_nav">
-      <!-- <el-collapse v-model="activeNames" @change="handleChange">
-        <el-collapse-item :title="title" :name="index" v-for="(item,index) in 4" :key="index">
-          <el-form :model="queryParams" ref="queryForm" :inline="true">
-            <el-row :gutter="0">
-              <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> -->
+      <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column :label="item.columnComment" align="center" :prop="item.columnName" v-for="(item,index) in queryData.tableHeadList" :key="index"/>
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNo"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
     </div>
     </div>
-
   </div>
   </div>
 
 
 </template>
 </template>
 
 
 <script>
 <script>
   import {
   import {
-    getTableQuery
+    getTableQuery,
+    getQueryList,
+    addbjectSave,
+    getByTableName,
+    getObject
   } from '@/api/system/table.js'
   } from '@/api/system/table.js'
   export default {
   export default {
     name: "index",
     name: "index",
     data() {
     data() {
       return {
       return {
+        open: false,
+        // 遮罩层
+        loading: true,
+        total: 0,
+        // 岗位表格数据
+        postList: [],
         // 显示搜索条件
         // 显示搜索条件
         showSearch: true,
         showSearch: true,
         activeNames: ['1'],
         activeNames: ['1'],
         title: '单表1',
         title: '单表1',
         queryData: {},
         queryData: {},
+        form: {
+          table: 'obj_test',
+          objId: -1,
+          fixedData: {}
+        },
         // 查询参数
         // 查询参数
         queryParams: {
         queryParams: {
-          pageNum: 1,
+          table: 'obj_test',
+          pageNo: 1,
           pageSize: 10,
           pageSize: 10,
-        },
-        labletit: '查询参数1233'
+          orderBy: 'create_time desc',
+          fixedData: {}
+        }
       };
       };
     },
     },
     filters:{
     filters:{
@@ -81,31 +93,89 @@
       }
       }
     },
     },
     mounted() {
     mounted() {
-      this.init()
+      this.init();
+      this.getList();
     },
     },
     methods: {
     methods: {
+      headerBtn(item) {
+        switch(item) {
+          case 'A': {
+            this.$router.push('/system/table')
+            return
+          }
+          case 'M': {
+            return
+          }
+          case 'D': {
+            return
+          }
+          case 'Q': {
+            return
+          }
+          case 'S': {
+            return
+          }
+          case 'U': {
+            return
+          }
+          case 'E': {
+            return
+          }
+        }
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.id)
+        this.single = selection.length!=1
+        this.multiple = !selection.length
+      },
       changeFn(obj) {
       changeFn(obj) {
         for(let key in obj){
         for(let key in obj){
-          this.queryParams[key] = obj[key]
+          this.queryParams.fixedData[key] = obj[key]
         }
         }
       },
       },
+      // 表单重置
+      reset() {
+        this.form = {
+          table: 'obj_test',
+          objId: '',
+          fixedData: {},
+        };
+        this.resetForm("form");
+      },
       resetQuery() {
       resetQuery() {
 
 
       },
       },
       /** 搜索按钮操作 */
       /** 搜索按钮操作 */
       handleQuery() {
       handleQuery() {
-        for(let item of this.queryData.queryList){
+        this.grabFn(this.queryData.queryList,this.queryParams.fixedData)
+        this.getList();
+      },
+      // 抓取参数
+      grabFn(arr,parForm) {
+        for(let item of arr){
           if(item.htmlType == 'checkbox' || item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload'){
           if(item.htmlType == 'checkbox' || item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload'){
-            this.queryParams[item.columnName] = this.$refs[item.columnName][0].config
+            if(this.$refs[item.columnName][0].config.length){
+              console.log(this.$refs[item.columnName][0].config)
+              parForm[item.columnName] = this.$refs[item.columnName][0].config
+            }
           } else{
           } else{
-            this.queryParams[item.columnName] = this.$refs[item.columnName][0].config[item.columnName]
+            console.log(this.$refs[item.columnName][0].config[item.columnName])
+            parForm[item.columnName] = this.$refs[item.columnName][0].config[item.columnName]
           }
           }
         }
         }
-        console.log(this.queryParams,22311)
-        this.getList();
       },
       },
       getList() {
       getList() {
-
+        getQueryList(this.queryParams).then(response => {
+          this.postList = response.data.rows;
+          this.total = response.data.total;
+          this.loading = false;
+        });
       },
       },
       init() {
       init() {
         getTableQuery({
         getTableQuery({
@@ -113,13 +183,6 @@
         }).then(res => {
         }).then(res => {
           let data = res.data
           let data = res.data
           this.queryData = data
           this.queryData = data
-          // this.queryData.queryList.filter(route => {
-          //   if(route.htmlType == 'checkbox'){
-          //     route.sysDictDatatwo = []
-          //     route.sysDictDatatwo.push(route.columnName)
-          //     console.log(route.sysDictDatatwo,846)
-          //   }
-          // })
         })
         })
       },
       },
       handleChange(val) {
       handleChange(val) {

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

@@ -4,44 +4,29 @@
       <p>单表</p>
       <p>单表</p>
       <el-divider></el-divider>
       <el-divider></el-divider>
       <div class="table_headerBtun" v-if="queryData.buttonList">
       <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>
     </div>
     <!-- 内容 -->
     <!-- 内容 -->
     <div class="table_nav headertable_nav">
     <div class="table_nav headertable_nav">
       <el-collapse v-model="activeNames" @change="handleChange">
       <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-form :model="queryParams" ref="queryForm" :inline="true" label-width="120px">
             <el-row :gutter="0">
             <el-row :gutter="0">
               <el-col :span="24"  :key="index">
               <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>
-              <!-- <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-row>
           </el-form>
           </el-form>
         </el-collapse-item>
         </el-collapse-item>
-
       </el-collapse>
       </el-collapse>
     </div>
     </div>
-
   </div>
   </div>
-
 </template>
 </template>
-
 <script>
 <script>
   import {
   import {
-    getTableQuery
+    getTableQuery,
+    getQueryList
   } from '@/api/system/table.js'
   } from '@/api/system/table.js'
   export default {
   export default {
     name: "index",
     name: "index",
@@ -51,13 +36,21 @@
         showSearch: true,
         showSearch: true,
         activeNames: ['1'],
         activeNames: ['1'],
         title: '单表1',
         title: '单表1',
+        tabledeLise:{
+          table:'obj_test',
+          isUi:true
+        },
         queryData: {},
         queryData: {},
         // 查询参数
         // 查询参数
         queryParams: {
         queryParams: {
           pageNum: 1,
           pageNum: 1,
           pageSize: 10,
           pageSize: 10,
         },
         },
-        labletit: '查询参数1233'
+        labletit: '查询参数1233',
+        tableZbie:{
+          table:'obj_test'
+        },
+        taleLisst:[]
       };
       };
     },
     },
     filters:{
     filters:{
@@ -84,6 +77,7 @@
     },
     },
     mounted() {
     mounted() {
       this.init()
       this.init()
+      this.tablsie()
     },
     },
     methods: {
     methods: {
       changeFn(obj) {
       changeFn(obj) {
@@ -96,6 +90,14 @@
       },
       },
       /** 搜索按钮操作 */
       /** 搜索按钮操作 */
       handleQuery() {
       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)
         console.log(this.queryParams)
         // this.getList();
         // this.getList();
       },
       },
@@ -103,24 +105,46 @@
 
 
       },
       },
       init() {
       init() {
-        getTableQuery({
-          table: 'obj_test'
-        }).then(res => {
+        getTableQuery(
+          this.tableZbie
+        ).then(res => {
           let data = res.data
           let data = res.data
           this.queryData = 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) {
       handleChange(val) {
         console.log(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("删除成功");
+          })
       }
       }
     },
     },
   };
   };