Zn před 1 rokem
rodič
revize
9aa0fb87fe

+ 19 - 10
ruoyi-ui/src/views/dialogMange/index.vue

@@ -1171,18 +1171,21 @@ export default {
     },
     getCountrelyList(){
       // console.log('123456');
-      this.countdragTableList.forEach(item => {
+      this.countdragTableList?.forEach(item => {
         // console.log(this.countData.relytableName);
         if(this.countData.relytableName == item.dtName){
           this.countdragTableFilds = JSON.parse(item.dtColumnName)
         }
       })
-      this.countdragTableFilds.forEach(item => {
-        for(let val in item){
-          item.key = val
-          item.val = item[val]
-        }
-      })
+      if(this.countdragTableFilds) {
+
+        this.countdragTableFilds.forEach(item => {
+          for(let val in item){
+            item.key = val
+            item.val = item[val]
+          }
+        })
+      }
       // console.log(this.countdragTableFilds);
     },
     getdragTable(){
@@ -1944,9 +1947,9 @@ export default {
            
             if(item.dtName == this.countData.relytableName){
 
-              console.log(123);
+              // console.log(123);
               const info = await dragTableInfo({queryMap: {tableKey : item.tableKey }})
-              console.log('info', info);
+              // console.log('info', info);
               let infoSql = info.data.resultMap.querySql.tableSql
 
               let state = this.getTableSql(infoSql,this.countData.relaykey)
@@ -2047,12 +2050,18 @@ export default {
             item.tableKey = this.subEchoData.tableKey;
           });
 
-          console.log('回显', this.statusCount);
+          
+          // console.log('回显', this.statusCount);
           stateList.forEach((item) => {
             item.id = this.statusCount.id
             item.sqlKey = this.statusCount.sqlKey
             item.tableKey = this.statusCount.tableKey;
           });
+
+       
+         stateSqlList.forEach(item => {
+          item.sqlKey = this.statusCount.sqlKey
+         })
           // 修改统计数据
           await updateStatistic({
             tableKey: this.subEchoData.tableKey,

+ 29 - 12
ruoyi-ui/src/views/relateTable/components/RelateTableCard.vue

@@ -1,7 +1,7 @@
 <template>
   <el-card class="box-card" :body-style="{ padding: '0px' }">
     <div slot="header" class="clearfix">
-      <el-tag class="tag_NO">{{ Number(index) + 1 }}</el-tag>
+      <el-tag class="tag_NO">{{ dtName }}</el-tag>
       <!-- <span class="title">{{ cardData.title }}</span> -->
       <el-button icon="el-icon-plus" type="primary" @click="handleAdd">新增数据</el-button>
     </div>
@@ -69,8 +69,10 @@
       <k-form-build
         class="formBuild"
         ref="addFromRef"
+        :dynamicData="dynamicData"
         :defaultValue="defaultValue"
         @submit="tempSubBtn"
+        @change="formChangeHandler"
         :value="jsonData"
       />
       <div slot="footer" class="dialog-footer">
@@ -125,7 +127,8 @@ export default {
         },
       },
       columns: [],
-      defaultValue: '',
+      // 回显表格数据,
+      defaultValue: {},
       currentValue:{},
       //存放表单渲染数据
       jsonData: {},
@@ -144,7 +147,10 @@ export default {
       templateInfo: {},
       tableName: '',
       queryFromWhere:'',
-      condition: []
+      condition: [],
+      dtName: '',
+      // 下拉框动态数据
+      dynamicData: {},
     };
   },
 
@@ -172,7 +178,7 @@ export default {
     },
     tableKeyWatcher: {
       handler(newval){
-        console.log(newval)
+        // console.log(newval)
         this.gettableListHandler(newval);
       },
       deep: true,
@@ -204,6 +210,8 @@ export default {
         // 根据拖拽时设置当前列表排列顺序
         this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC"
         this.tableName = this.templateInfo.template.dtTableName;
+        this.dtName = this.templateInfo.template.dtName;
+
         // 得到查询条件
         this.queryFromWhere = res.data.resultMap.where;
         //  得到当前列表信息
@@ -250,8 +258,8 @@ export default {
     },
     // 获取表数据
     async getDataHandler(contion, list){
-      console.log(contion);
-      console.log(list);
+      // console.log(contion);
+      // console.log(list);
       if(contion){
         let key = contion.split('.')
         this.queryParams.queryMap['#{' + contion] = "'" + list[key[1]] + "'";
@@ -277,8 +285,7 @@ export default {
             }
             return kv;
           })
-
-          console.log(this.tableList);
+          // console.log(this.tableList);
         }
         this.total = tableLists.total;
         this.loading = false; 
@@ -309,15 +316,19 @@ export default {
     handleAdd(row) {
       // this.reset();
       this.defaultValue = {};
-      getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({data}) => {
+      getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
         if (!data || !data.dfVueTemplate) {
           this.$message.error("当前表格未绑定表单!");
           return;
         }
+        if (data.dfFormSql) {
+          let dynamicData = JSON.parse(data.dfFormSql);
+          Object.assign(this.dynamicData, dynamicData);
+        }
         this.jsonData = JSON.parse(data.dfVueTemplate);
         this.open = true;
         this.title = "添加信息";
-        // this.form.password = this.initPassword;
+        this.form.password = this.initPassword;
         this.$nextTick(() => {
           this.$refs.addFromRef.reset();
           inputDisableComplete();
@@ -370,7 +381,8 @@ export default {
             } else {
               this.$modal.msgError("修改失败");
             }
-            this.getDataHandler();
+            this.gettableListHandler(this.tableKey)
+
           } else {
             let res = await addTableData(data);
             if (res.code == 200) {
@@ -378,7 +390,7 @@ export default {
             } else {
               this.$modal.msgError("添加失败");
             }
-            this.getDataHandler();
+            this.gettableListHandler(this.tableKey)
           }
           this.defaultValue = {};
           this.getDataHandler();
@@ -423,6 +435,10 @@ export default {
         this.title = "修改当前信息";
         this.form.password = "";
       });
+    },
+     // k-form-build表单变化回调
+     formChangeHandler(value, label) {
+      // console.log(value, label);
     },
         /** 删除按钮操作
      *
@@ -450,6 +466,7 @@ export default {
           return delTableData(data);
         })
         .then(() => {
+
           // 调用子组件查询方法 目的是携带上子组件中的查询参数
           this.$refs.mychild.pageList();
           this.$modal.msgSuccess("删除成功");

+ 9 - 5
ruoyi-ui/src/views/relateTable/index.vue

@@ -142,12 +142,12 @@
           >新增</el-button
         >
         <el-form :model="groupForm" :rules="grouprules" ref="groupForm" label-width="100px" class="demo-ruleForm">
-          <el-form-item label="表格组名" prop="groupName">
-            <el-input v-model="groupForm.groupName" placeholder="请输入表格组名"
+          <el-form-item label="菜单名称" prop="groupName">
+            <el-input v-model="groupForm.groupName" placeholder="请输入菜单名称"
             ></el-input>
           </el-form-item>
-          <el-form-item label="表格描述" prop="groupDescription">
-            <el-input v-model="groupForm.groupDescription" placeholder="请输入表格描述"
+          <el-form-item label="菜单描述" prop="groupDescription">
+            <el-input v-model="groupForm.groupDescription" placeholder="请输入菜单描述"
             ></el-input>
           </el-form-item>
           <el-form-item label="菜单路由" prop="routePath">
@@ -1482,9 +1482,13 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
+      console.log(selection);
       this.ids = selection.map((item) => item.id);
       this.Keys = selection.map((item) => item.sqlKey);
-      this.menuIds = selection.map((item) => item.menuId);
+      selection.forEach(vals => {
+        this.menuIds = vals.groupTableInfo.map(item => item.menuId)
+          console.log( this.menuIds);
+      })
       this.selection = selection;
       this.single = selection.length !== 1;
       this.multiple = !selection.length;

+ 46 - 18
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -261,10 +261,31 @@
       title="提示"
       :visible.sync="btnDialogVisible"
       :before-close="handleClose">
-      <DialogTemplate 
+      <DialogTemplate
        ref="dialogRef"
         :groupKey="groupKey"
-        :rowobj="rowobj" 
+        :rowobj="rowobj"
+        :subCount="subCount"
+        :tableCount="tableCount"
+        :subTableName="subTableName"
+        @addList="addListHandler"
+        >
+      </DialogTemplate>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="btnDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="btnComfirm">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 绑定按钮dialog -->
+    <el-dialog
+      title="提示"
+      :visible.sync="btnDialogVisible"
+      :before-close="handleClose">
+      <DialogTemplate
+       ref="dialogRef"
+        :groupKey="groupKey"
+        :rowobj="rowobj"
         :subCount="subCount"
         :tableCount="tableCount"
         :subTableName="subTableName"
@@ -416,14 +437,14 @@ export default {
   watch: {
     tableList: {
       handler(val) {
-        console.log(JSON.parse(JSON.stringify(val)), "tableListChange");
+        // console.log(JSON.parse(JSON.stringify(val)), "tableListChange");
       },
       deep: true,
     },
   },
   computed: {
     isShowExcuteCol() {
-      console.log(!this.excuteBtnArr?.every((arr) => arr.children.length == 0));
+      // console.log(!this.excuteBtnArr?.every((arr) => arr.children.length == 0));
       // return true;
       return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
     },
@@ -654,7 +675,7 @@ export default {
     /** 修改按钮操作 */
     async handleUpdate(row, btnData) {
       // console.log(this.currentBtnData);
-      
+
       let nameTable = this.templateInfo.template.dtTableName
       // console.log(nameTable);
       // console.log('row', row);
@@ -662,14 +683,19 @@ export default {
       let obj = {}
       for(let key in row) {
 
-        let modifiedTable = key.replace(/[A-Z]/g, (match) => `_${match}`).toLowerCase(); 
+        let modifiedTable = key.replace(/[A-Z]/g, (match) => `_${match}`).toLowerCase();
 
         this.rowobj[modifiedTable] = row[key];
 
         let str = modifiedTable.substring(nameTable.length+1)
         obj[str] = row[key];
       }
-      console.log("row", row);
+      // console.log("row", row);
+    // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
+    //   if (!data || !data.dfVueTemplate) {
+    //     this.$message.error("当前表格未绑定表单!");
+    //     return;
+    //   }});
 
       // 新的修改请求
       try {
@@ -689,11 +715,12 @@ export default {
         payLoad.conditionMap[this.templateInfo.template?.primaryKey] =
           row[primary];
         let res = await btnCommonApi(payLoad);
-        this.subTableName = res.data.result.dragTables[1].dtTableName
         // 判断是否绑定dialog弹窗
-        if (this.currentBtnData.btnTableFormGroupKey == '') {
-          this.$message.error("当前表格未绑定表单!");
-          return;
+        if (!this.currentBtnData.btnTableFormGroupKey) {
+          if (!res.data || !res.data.template) {
+            this.$message.error("当前按钮未绑定表单!");
+            return;
+          }
 
           res.data.template.dfFormSql &&
           (this.dynamicData = JSON.parse(res.data.template.dfFormSql));
@@ -709,6 +736,7 @@ export default {
             this.$refs.addFromRef.setData(res.data.result.resultMap);
           });
         }else{
+          this.subTableName = res.data.result.dragTables[1].dtTableName
           this.btnDialogVisible = true
           this.groupKey = this.currentBtnData.btnTableFormGroupKey
           this.$nextTick(()=>{
@@ -719,7 +747,7 @@ export default {
           })
 
           let tablesubKey = res.data.result.dragTables[1].tableKey
-     
+
           // 查询统计信息
           getStatisticList({
             queryMap: {
@@ -748,7 +776,7 @@ export default {
             this.tableCount = res.data
           });
         }
-       
+
         // let fieldList = Object.keys(resultMap);
         // let tableName = this.longestCommonSubstring(fieldList);
         // fieldList.forEach((field) => {
@@ -756,7 +784,7 @@ export default {
         //   realField = realField[0].toLocaleLowerCase() + realField.substring(1);
         //   resultMap[realField] = resultMap[field];
         // });
-   
+
       } catch (error) {
         this.$message.error("网络异常,请稍后再试");
         console.log(error);
@@ -951,7 +979,7 @@ export default {
     // 弹窗新增的数
     addListHandler(val){
       this.addLists.push(...val)
-      console.log(this.addLists);
+      // console.log(this.addLists);
     },
     // 绑定弹窗Dialog确定按钮
     btnComfirm(){
@@ -972,7 +1000,7 @@ export default {
     },
     // 去掉表名 开头字母小写
     formatField(field = "", tableName) {
-      console.log(field, tableName);
+      // console.log(field, tableName);
       let temp = field.replace(tableName, "");
       return toUnderline(temp[0].toLowerCase() + temp.slice(1));
     },
@@ -1131,7 +1159,7 @@ export default {
       );
       if (!fieldConditionList.length) return tableList;
       let res = await this.setDictStyleData();
-      console.log(res);
+      // console.log(res);
       this.dictStyleObj = res;
       // console.log(JSON.parse(JSON.stringify(this.dictStyleObj)));
       tableList.forEach((row) => {
@@ -1252,7 +1280,7 @@ export default {
 
     // k-form-build表单变化回调
     formChangeHandler(value, label) {
-      console.log(value, label);
+      // console.log(value, label);
     },
   },
 };

+ 25 - 9
ruoyi-ui/src/views/tablelist/components/cardCountPanel.vue

@@ -14,12 +14,15 @@
           :content="item.statisticTitle ? item.statisticTitle : item.statisticDescription"
           placement="top-start"
         >
-          <div class="title">{{ item.statisticTitle ? item.statisticTitle : item.statisticDescription }}</div>
+          <div class="title">
+            <span class="left">{{ item.statisticTitle ? item.statisticTitle : item.statisticDescription }}</span>
+            <span class="right">{{ item.result }}</span>
+          </div>
         </el-tooltip>
 
-        <div class="type">
-          <div class="count">{{ item.result }}</div>
-        </div>
+        <!-- <div class="type">
+          <div class="count"></div>
+        </div> -->
       </el-card>
     </div>
   </div>
@@ -52,24 +55,37 @@ export default {
 
 <style lang="scss" scoped>
 .cardBox {
-  display: flex;
+  /* display: flex;
   align-content: space-between;
   flex-wrap: wrap;
-  align-content: flex-start;
+  align-content: flex-start; */
+  display: flex;
 }
 .card {
-  /* width:15%; */
-  flex-basis: 15%;
+  width:100%;
+  /* flex-basis: 15%; */
   margin-bottom: 10px;
   margin-right: 15px;
-  min-width: 130px;
+  /* min-width: 130px; */
   .title {
     /* width:20%; */
+    /* display: flex; */
+    /* align-content: space-between; */
     font-size: 18px;
     margin-bottom: 5px;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
+
+    .left{
+      float: left;
+    }
+
+    .right{
+      float: right;
+      font-size: 20px;
+      font-weight: 800;
+    }
   }
   .description {
     width: 70%;