sr 4 年之前
父節點
當前提交
fcd944194c
共有 2 個文件被更改,包括 77 次插入22 次删除
  1. 8 0
      ruoyi-ui/src/api/tool/gen.js
  2. 69 22
      ruoyi-ui/src/views/tool/gen/editTable.vue

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

@@ -1,5 +1,13 @@
 import request from '@/utils/request'
 
+// 关联表列表
+export function tabList(query) {
+  return request({
+    url: '/boman-gen/genTableRelation/list',
+    method: 'get',
+    params: query
+  })
+}
 // 查询生成表数据
 export function listTable(query) {
   return request({

+ 69 - 22
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -47,36 +47,47 @@
           </el-table-column>
           <el-table-column label="显示类型" min-width="12%" align="center" prop="htmlType"/>
           <el-table-column label="字典类型" min-width="12%" align="center" prop="dictType"/>
-
         </el-table>
       </el-tab-pane>
-     <!-- <el-tab-pane label="生成信息" name="genInfo">
+    <!-- <el-tab-pane label="生成信息" name="genInfo">
         <gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus"/>
       </el-tab-pane> -->
       <el-tab-pane label="关联表" name="genInfo">
         <el-row style="margin-bottom: 20px;">
           <el-col :span="12">
-            <el-button style="background-color: #1591FF;color: #fff;border: 1px solid #1591FF;">保存</el-button>
-            <el-button style="background-color: #fff;color: #5B636C;border: 1px solid #ECECEC;">返回</el-button>
+            <!-- <el-button style="background-color: #1591FF;color: #fff;border: 1px solid #1591FF;">保存</el-button>
+            <el-button style="background-color: #fff;color: #5B636C;border: 1px solid #ECECEC;">返回</el-button> -->
           </el-col>
-          <el-col :span="12" style="text-align: right;">
-            <el-button style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;">新增</el-button>
+          <el-col :span="12">
+            <el-button @click="handleAdd" style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;">新增</el-button>
             <el-button style="background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;">删除</el-button>
           </el-col>
         </el-row>
-         <el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight">
-           <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="可用" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="描述" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="关联表" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="字段(关联到主表PK)" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="显示条件" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="关联方式" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="内嵌编辑" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="修改人" type="index" min-width="5%" class-name="allowDrag" />
-           <el-table-column label="修改时间" type="index" min-width="5%" class-name="allowDrag" />
+         <el-table ref="dragTable" v-loading="loading" :data="postList" row-key="columnId" align="center" :max-height="tableHeight">
+           <el-table-column type="selection" width="55" align="center" />
+           <el-table-column label="id" align="center" prop="id"/>
+           <el-table-column label="可用" align="center" prop="isDel">
+             <template slot-scope="scope">
+               <el-checkbox true-label="Y" disabled v-model="scope.row.isDel"></el-checkbox>
+             </template>
+             </el-table-column>
+           <el-table-column label="序号" align="center" prop="sort" />
+           <el-table-column label="描述" align="center" prop="description" />
+           <el-table-column label="关联表" align="center" prop="relationParentId" />
+           <el-table-column label="字段(关联到主表PK)" align="center" prop="relationChildId"/>
+           <el-table-column label="显示条件" align="center" prop="displayConditions" />
+           <el-table-column label="关联方式" align="center" prop="relationType" />
+           <el-table-column label="内嵌编辑" align="center" prop="embedEdit" />
+           <el-table-column label="修改人" align="center" prop="updateBy"/>
+           <el-table-column label="修改时间" align="center" prop="updateTime" />
          </el-table>
+         <pagination
+           v-show="total>0"
+           :total="total"
+           :page.sync="queryParams.pageNum"
+           :limit.sync="queryParams.pageSize"
+           @pagination="tabList"
+         />
        </el-tab-pane>
        <el-tab-pane label="数据库SQL" name="genSql">
           <el-row>
@@ -94,7 +105,7 @@
        </el-tab-pane>
     </el-tabs>
     <el-form label-width="100px">
-      <el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;">
+      <el-form-item v-if="activeName=='cloum'" style="text-align: center;margin-left:-100px;margin-top:10px;">
         <el-button type="primary" @click="submitForm()">提交</el-button>
         <el-button @click="close()">返回</el-button>
       </el-form-item>
@@ -121,7 +132,7 @@
           <el-input-number v-model="form.postSort" controls-position="right" :min="0" />
         </el-form-item>
         <el-form-item label="序号:" prop="status">
-          
+
         </el-form-item>
         <el-form-item label="可用:" prop="remark">
           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
@@ -135,7 +146,7 @@
   </el-card>
 </template>
 <script>
-import { getGenTable, updateGenTable } from "@/api/tool/gen";
+import { getGenTable, updateGenTable, tabList} from "@/api/tool/gen";
 import { optionselect as getDictOptionselect } from "@/api/system/dict/type";
 import { listMenu as getMenuTreeselect } from "@/api/system/menu";
 import basicInfoForm from "./basicInfoForm";
@@ -150,10 +161,18 @@ export default {
   },
   data() {
     return {
-      title: "新增关联表",
+      title: "",
+      loading: false,
       open: false,
       form: {},
       rules: {},
+      postList: [],
+      total: 1,
+      // 关联表查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
       // 选中选项卡的 name
       activeName: "cloum",
       // 表格的高度
@@ -188,8 +207,31 @@ export default {
         this.menus = this.handleTree(response.data, "menuId");
       });
     }
+    this.tabList()
   },
   methods: {
+    // 关联表数据
+    tabList() {
+      this.loading = true;
+      tabList(this.queryParams).then(response => {
+        this.postList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "新增关联表";
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+
+      };
+      this.resetForm("form");
+    },
     /** 提交按钮 */
     submitForm() {
       const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
@@ -245,3 +287,8 @@ export default {
   }
 };
 </script>
+<style lang="scss">
+  .pagination-container{
+    height: 35px;
+  }
+</style>