Zn пре 1 година
родитељ
комит
2af11f9be0

+ 43 - 53
ruoyi-ui/src/views/relateTable/index.vue

@@ -831,29 +831,28 @@ export default {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           let columns = [],
-          searchFieldList = []
-          this.getCol(
-            this.tableFieldList,
-            columns,
-            searchFieldList,
-          );
-
+            searchFieldList = []
+            this.getCol(
+              this.tableFieldList,
+              columns,
+              searchFieldList,
+            );
           // 判断是否有包含查询字段
           if (!searchFieldList.length) {
           this.$message.warning("请至少选择一个包含查询字段");
           return false;
           }
-          console.log('新增表格标题等字段',this.tableItemForm)
-          console.log(this.tableFieldList)
-          let tableKey = uuidv4();
-          let sqlKey = uuidv4();
-          let echoData = {
-            tableName: this.tableItemForm.tableName,
-            tableFieldData: this.tableFieldList,
-            formData: this.groupForm,
-          }
-
-          this.addDragData.push({
+          // 判断是新增还是修改 true新增
+          if(this.relateTitle){    
+            
+            let echoData = {
+              tableName: this.tableItemForm.tableName,
+              tableFieldData: this.tableFieldList,
+              formData: this.groupForm,
+            }
+            let tableKey = uuidv4();
+            let sqlKey = uuidv4();
+            this.addDragData.push({
             tId: this.tId,
             dtName: this.tableItemForm.title,
             tableKey: tableKey,
@@ -868,25 +867,30 @@ export default {
             tableSql: this.getSQLStr(), 
             tableExportField: '',
             echoData: JSON.stringify(echoData),
-          }) 
-
-          // 判断是新增还是修改 true新增
-          if(this.relateTitle){
+            })
 
             this.tableItemForm.rowId = Date.now();
             this.groupList.push({tableFieldList: this.tableFieldList, tableItemForm: this.tableItemForm})
 
             this.tableDataList.push(this.tableItemForm);
-
-            console.log(this.tableDataList)
           } else {
-            // this.tableDataList.forEach((item, index) => {
-            //   if(item.rowId == this.tableItemForm){
-            //     this.tableDataList[index] = this.tableItemForm
-            //   }
-            // })
+            let columns = [],
+            searchFieldList = []
+            this.getCol(
+              this.tableFieldList,
+              columns,
+              searchFieldList,
+            );
+            let echoData = {
+              tableName: this.tableItemForm.tableName,
+              tableFieldData: this.tableFieldList,
+              formData: this.groupForm,
+            }
+            console.log(this.tableDataList)
+            console.log('修改')
           }
-          console.log(this.groupList);
+          console.log(this.addDragData);
+
           this.isShowForm = false
           this.tableItemForm = {}
           this.tableFieldList = []
@@ -896,20 +900,6 @@ export default {
           return false;
         }
       });
-
-      // if(this.relateTitle){
-      //   this.tableItemForm.rowId = Date.now();
-      //   this.tableDataList.push(this.tableItemForm);
-      // } else {
-      //   this.tableDataList.forEach((item, index) => {
-      //     if(item.rowId == this.tableItemForm){
-      //       this.tableDataList[index] = this.tableItemForm
-      //     }
-      //   })
-      // }
-      
-      // this.isShowForm = false;
-      // this.tableItemForm = {}
     },
     // 修改一个表格数据
     relateOne(row){
@@ -971,11 +961,11 @@ export default {
       this.$refs[formName].validate(async (valid) => {
           if (valid) {
             // console.log('groupList', this.groupList);
-            let tableKeyObj = {
-              tableKey: this.uuidv4(),
+            let groupKeyObj = {
+              groupKey: uuidv4(),
             };
             let payLoad = {
-              component: "tablelist/commonTable/grouplistInfo",
+              component: "relateTable/relateTableEdit",
               icon: "",
               isCache: "0",
               isFrame: "1",
@@ -983,8 +973,8 @@ export default {
               menuType: "C",
               orderNum: this.menuOrderNum,
               parentId: this.groupForm.routePath,
-              path: sqlKey,
-              query: JSON.stringify(tableKeyObj),
+              path: groupKeyObj.groupKey,
+              query: JSON.stringify(groupKey),
               status: "0",
               visible: "0",
             };
@@ -994,10 +984,10 @@ export default {
             if(result.code == 200){
               this.reloadRouter();
               let data = {
-              groupName: '',
-              groupDescription: '',
-              groupTableInfo: [],
-              dragTables:[]
+                groupName: '',
+                groupDescription: '',
+                groupTableInfo: [],
+                dragTables:[]
               }
               this.addDragData.forEach((item, index) => {
               item.menuId = result.data;

+ 3 - 2
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -320,7 +320,7 @@ export default {
         .then((res) => {
           // 得到当前模版信息 --- sql columns queryWhere
           this.templateInfo = res.data.resultMap;
-
+          console.log('res', this.templateInfo)
           this.queryParams.orderByColumn =
             res.data.resultMap.querySql.orderByColumn;
           this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
@@ -337,11 +337,12 @@ export default {
         .finally((fes) => {
           if (this.templateInfo == {}) return;
           // 调用查询需要携带当前table的唯一标识
-          this.queryParams.queryMap.sqlkey = this.sqlkey;
+          this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
           this.queryParams.orderByColumn = camelCase(
             this.queryParams.orderByColumn || ""
           );
           // 根据sql语句查询当前表数据
+          console.log(this.queryParams)
           unionListTableData(this.queryParams).then((res) => {
             // console.log('unionListTableData');
             this.tableList = [];

+ 5 - 12
ruoyi-ui/src/views/tablelist/commonTable/queryfrom.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div class="cardBox" v-show="showCount" >
+    <!-- <div class="cardBox" v-show="showCount" >
       <el-card
         shadow="hover"
         :body-style="{ padding: '20px' }"
@@ -17,21 +17,12 @@
           <div class="title">{{ item.statisticTitle ? item.statisticTitle : item.statisticDescription }}</div>
         </el-tooltip>
 
-        <!-- <el-tooltip
-          class="item"
-          effect="dark"
-          :content="item.description"
-          placement="top-start"
-        >
-          <div class="description">{{ item.description }}</div>
-        </el-tooltip> -->
-
         <div class="type">
-          <!-- <div>{{ item.type }}</div> -->
           <div class="count">{{ item.result }}</div>
         </div>
       </el-card>
-    </div>
+    </div> -->
+    <cardcountpanel :showCount="showCount" :statisticList="statisticList" />
     <el-form
       :model="queryParams.queryMap"
       ref="queryForm"
@@ -181,6 +172,7 @@
 </template>
 
 <script>
+import cardcountpanel from "../components/cardCountPanel.vue"
 export default {
   name: "queryfrom",
   props: {
@@ -195,6 +187,7 @@ export default {
       type: Array,
     }
   },
+  components:{cardcountpanel},
   data() {
     return {
       // 时间范围临时存储

+ 93 - 0
ruoyi-ui/src/views/tablelist/components/cardCountPanel.vue

@@ -0,0 +1,93 @@
+<template>
+  <div>
+    <div class="cardBox" v-show="showCount" >
+      <el-card
+        shadow="hover"
+        :body-style="{ padding: '20px' }"
+        class="card"
+        v-for="(item, index) in statisticList"
+        :key="index"
+      >
+        <el-tooltip
+          class="item"
+          effect="dark"
+          :content="item.statisticTitle ? item.statisticTitle : item.statisticDescription"
+          placement="top-start"
+        >
+          <div class="title">{{ item.statisticTitle ? item.statisticTitle : item.statisticDescription }}</div>
+        </el-tooltip>
+
+        <div class="type">
+          <div class="count">{{ item.result }}</div>
+        </div>
+      </el-card>
+    </div>
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: "cardcountpanel",
+  props: {
+    showCount : {
+      type: Boolean,
+    },
+    statisticList:{
+      type: Array,
+    }
+  },
+  data () {
+   return {
+    
+   }
+ },
+  methods: {
+   
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.cardBox {
+  display: flex;
+  align-content: space-between;
+  flex-wrap: wrap;
+  align-content: flex-start;
+}
+.card {
+  /* width:15%; */
+  flex-basis: 15%;
+  margin-bottom: 10px;
+  margin-right: 15px;
+  min-width: 130px;
+  .title {
+    /* width:20%; */
+    font-size: 18px;
+    margin-bottom: 5px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+  .description {
+    width: 70%;
+    font-size: 13px;
+    color: #9699a2;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: 3;
+    word-break: break-all;
+    float: left;
+  }
+  .type {
+    float: right;
+    margin-top: 10px;
+  }
+  .count {
+    font-size: 30px;
+  }
+}
+  
+</style>