Ver Fonte

添加按钮组绑定情况过滤

lph há 1 ano atrás
pai
commit
5a0fa5204f

+ 1 - 1
ruoyi-ui/src/views/dialogMange/index.vue

@@ -2716,7 +2716,7 @@ export default {
     // 获取按钮组数据
     async getBtnList() {
       let res = await listBtn({ isEnablePaging: false, btnParentId: 0 });
-      this.btnGroupOptions = res.rows;
+      this.btnGroupOptions = res.rows.filter((item) => !item.whetherBind);
     },
   },
   created() {},

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

@@ -3,7 +3,9 @@
     <div slot="header" class="clearfix">
       <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>
+      <el-button icon="el-icon-plus" type="primary" @click="handleAdd"
+        >新增数据</el-button
+      >
     </div>
     <!-- body -->
     <el-table
@@ -11,7 +13,9 @@
       :data="tableList"
       height="300"
       highlight-current-row
-      @row-click="(row,e,column) => handleCurrentChange(row,e,column,cardData)"
+      @row-click="
+        (row, e, column) => handleCurrentChange(row, e, column, cardData)
+      "
       style="width: 100%"
     >
       <el-table-column
@@ -19,33 +23,33 @@
         align="center"
         class-name="small-padding fixed-width"
       >
-          <template slot-scope="scope">
-            <el-dropdown>
-              <el-button type="warning" plain size="small">
-                处理<i class="el-icon-arrow-down el-icon--right"></i>
-              </el-button>
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item>
-                  <el-button
-                    size="mini"
-                    type="text"
-                    icon="el-icon-edit"
-                    @click="handleUpdate(scope.row)"
+        <template slot-scope="scope">
+          <el-dropdown>
+            <el-button type="warning" plain size="small">
+              处理<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit"
+                  @click="handleUpdate(scope.row)"
                   >修改
-                  </el-button>
-                </el-dropdown-item>
-                <el-dropdown-item>
-                  <el-button
-                    size="mini"
-                    type="text"
-                    icon="el-icon-delete"
-                    @click="handleDelete(scope.row)"
+                </el-button>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-delete"
+                  @click="handleDelete(scope.row)"
                   >删除
-                  </el-button>
-                </el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-          </template>
+                </el-button>
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
       </el-table-column>
       <el-table-column
         v-for="(item, index) in columns"
@@ -54,7 +58,6 @@
         :label="item.value"
       >
       </el-table-column>
-   
     </el-table>
 
     <pagination
@@ -92,9 +95,9 @@ import {
   addTableData,
   batchEdit,
 } from "@/api/tablelist/commonTable";
-import {inputDisableComplete} from "@/utils/other";
+import { inputDisableComplete } from "@/utils/other";
 
-import {camelCase} from "@/utils";
+import { camelCase } from "@/utils";
 export default {
   name: "RelateTableCard",
   props: ["cardData", "index", "tableKey", "sort"],
@@ -104,7 +107,7 @@ export default {
       // 总条数
       total: 0,
       tableList: [],
-      newsort: '',
+      newsort: "",
       queryParams: {
         pageNum: 1, // 第几页
         pageSize: 10, // 每页大小
@@ -126,7 +129,7 @@ export default {
       columns: [],
       // 回显表格数据,
       defaultValue: {},
-      currentValue:{},
+      currentValue: {},
       //存放表单渲染数据
       jsonData: {},
       // 弹出层标题
@@ -141,161 +144,163 @@ export default {
       sortOrder: true,
       // 当前模版信息
       templateInfo: {},
-      tableName: '',
-      queryFromWhere:'',
+      tableName: "",
+      queryFromWhere: "",
       condition: [],
-      dtName: '',
+      dtName: "",
       // 下拉框动态数据
       dynamicData: {},
       row: null,
-      myContion:null,
-      preRow:{}
+      myContion: null,
+      preRow: {},
     };
   },
   computed: {
     // currentValues
-    cardDataWatcher: function(){
-      return this.cardData
+    cardDataWatcher: function () {
+      return this.cardData;
     },
-    tableKeyWatcher: function(){
-      return this.tableKey
+    tableKeyWatcher: function () {
+      return this.tableKey;
     },
-    sortWatcher: function(){
-      return this.sort
+    sortWatcher: function () {
+      return this.sort;
     },
   },
-    watch:{
+  watch: {
     cardDataWatcher: {
-      handler(newval,oldval){
+      handler(newval, oldval) {
         // debugger;
-       this.currentValue=newval;
-       this.$refs.singleTable?.doLayout()
+        this.currentValue = newval;
+        this.$refs.singleTable?.doLayout();
       },
       deep: true,
-      immediate:true,
+      immediate: true,
     },
     tableKeyWatcher: {
-      handler(newval){
+      handler(newval) {
         // console.log(newval)
         this.gettableListHandler(newval);
       },
       deep: true,
-      immediate:true,
+      immediate: true,
     },
     sortWatcher: {
-      handler(newval){
-        this.newsort = newval
+      handler(newval) {
+        this.newsort = newval;
       },
       deep: true,
-      immediate:true,
-    }
-  },
-  mounted() {
+      immediate: true,
+    },
   },
+  mounted() {},
   methods: {
     // 根据tablekey请求数据表头数据
-    async gettableListHandler(tableKey, paramsContion = [], defaultVal ={}){
-      const res = await dragTableInfo({queryMap: {tableKey : tableKey }})
-      this.getTableHandle(res, paramsContion = [],defaultVal = {})
+    async gettableListHandler(tableKey, paramsContion = [], defaultVal = {}) {
+      const res = await dragTableInfo({ queryMap: { tableKey: tableKey } });
+      this.getTableHandle(res, (paramsContion = []), (defaultVal = {}));
     },
     // 处理表格表头
-    async getTableHandle(res){
-        this.columns = []
-        // 得到当前模版信息 --- sql columns queryWhere
-        this.templateInfo = res.data.resultMap;
-        this.queryParams.orderByColumn =
-          res.data.resultMap.querySql.orderByColumn;
-        this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
-        // 根据拖拽时设置当前列表排列顺序
-        this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC"
-        this.tableName = this.templateInfo.template.dtTableName;
-        this.dtName = this.templateInfo.template.dtName;
+    async getTableHandle(res) {
+      this.columns = [];
+      // 得到当前模版信息 --- sql columns queryWhere
+      this.templateInfo = res.data.resultMap;
+      this.queryParams.orderByColumn =
+        res.data.resultMap.querySql.orderByColumn;
+      this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
+      // 根据拖拽时设置当前列表排列顺序
+      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;
-        //  得到当前列表表头信息
-        this.columns = this.columnsHandler(
-          JSON.parse(this.templateInfo.template.dtColumnName)
-        );
-      
-        if (this.templateInfo) {
-            this.tableCondition = this.templateInfo.querySql.tableCondition
-            this.tableCondition = this.tableCondition.split('AND')
+      // 得到查询条件
+      this.queryFromWhere = res.data.resultMap.where;
+      //  得到当前列表表头信息
+      this.columns = this.columnsHandler(
+        JSON.parse(this.templateInfo.template.dtColumnName)
+      );
+
+      if (this.templateInfo) {
+        this.tableCondition = this.templateInfo.querySql.tableCondition;
+        this.tableCondition = this.tableCondition.split("AND");
+
+        this.condition = [];
 
-            this.condition = [];
-              
-            // 调用查询需要携带当前table的唯一标识
-            this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
+        // 调用查询需要携带当前table的唯一标识
+        this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
 
-            this.queryParams.orderByColumn = camelCase(
-              this.queryParams.orderByColumn || ""
-            );
-            // 根据sql语句查询当前表数据
-            this.contion = this.templateInfo.template.dtTableName + '.' + this.templateInfo.template.primaryKey
+        this.queryParams.orderByColumn = camelCase(
+          this.queryParams.orderByColumn || ""
+        );
+        // 根据sql语句查询当前表数据
+        this.contion =
+          this.templateInfo.template.dtTableName +
+          "." +
+          this.templateInfo.template.primaryKey;
 
-            this.$nextTick(async ()=>{
-              if(this.newsort == 0){
-                // 第一张表请求表数据不需要条件
-             await this.getDataHandler()
-            }else{
-              if(this.myContion){
-                await this.getDataHandler(this.myContion,this.preRow)
-              }
+        this.$nextTick(async () => {
+          if (this.newsort == 0) {
+            // 第一张表请求表数据不需要条件
+            await this.getDataHandler();
+          } else {
+            if (this.myContion) {
+              await this.getDataHandler(this.myContion, this.preRow);
+              console.log(this.myContion, this.preRow);
             }
-            })
-            
-            //处理三张不同表的依赖关系
-            // let k;
-            // this.tableCondition.forEach((item, i) => {
-            //   let val = item.split('=')
-            //   if(i!==0){
-                
-            //     k =val[0].split('.')
-            //     let str = k[0].trim() + '.' + k[1]
-            //     this.condition.push({
-            //       key: k[0].trim(),
-            //       value: k[1]
-            //     })
-            //   }
-            // })
-            
-        }  
+          }
+        });
+
+        //处理三张不同表的依赖关系
+        // let k;
+        // this.tableCondition.forEach((item, i) => {
+        //   let val = item.split('=')
+        //   if(i!==0){
+
+        //     k =val[0].split('.')
+        //     let str = k[0].trim() + '.' + k[1]
+        //     this.condition.push({
+        //       key: k[0].trim(),
+        //       value: k[1]
+        //     })
+        //   }
+        // })
+      }
     },
     // 获取表格数据
-    async getDataHandler(contion, list){
-      // console.log(contion);
-      this.myContion=contion;
-      this.preRow=list;
+    async getDataHandler(contion, list) {
+      console.log(contion, list);
+      this.myContion = contion;
+      this.preRow = list;
       // console.log(list);
       // 处理请求下一张表数据的依赖条件
-      if(contion){
-        let key = contion.split('.')
-        this.queryParams.queryMap['#{' + contion] = "'" + list[key[1]] + "'";
+      if (contion) {
+        let key = contion.split(".");
+        this.queryParams.queryMap["#{" + contion] = "'" + list[key[1]] + "'";
       }
       this.queryParams.queryMap.sqlkey = this.templateInfo.template.sqlKey;
-      
+
       this.tableList = [];
-      let tableLists = await unionListTableData(this.queryParams)
-      if(tableLists.code == 200){
+      let tableLists = await unionListTableData(this.queryParams);
+      if (tableLists.code == 200) {
         // 默认根据这张表的第一条数据请求下一张表的数据
-        this.$emit('getDefaultCardData', this.index)
+        this.$emit("getDefaultCardData", this.index);
 
         tableLists.rows.forEach((item) => {
           this.tableList.push(item.resultMap);
         });
-        
-          // 驼峰转换
-          this.tableList = this.tableList.map((item) => {
-            let kv = {};
-            for (let itemKey in item) {
-              kv[camelCase(itemKey)] = item[itemKey];
-            }
-            return kv;
-          })
-          // console.log(this.tableList);
-        }
-        this.total = tableLists.total;
-        this.loading = false; 
+
+        // 驼峰转换
+        this.tableList = this.tableList.map((item) => {
+          let kv = {};
+          for (let itemKey in item) {
+            kv[camelCase(itemKey)] = item[itemKey];
+          }
+          return kv;
+        });
+        // console.log(this.tableList);
+      }
+      this.total = tableLists.total;
+      this.loading = false;
     },
     // 处理列表信息
     columnsHandler(columns) {
@@ -311,14 +316,10 @@ export default {
       return resArr;
     },
     // 调用父组件方法更新表格数据
-    handleCurrentChange(row,event,column,val) {
-      this.row = row
+    handleCurrentChange(row, event, column, val) {
+      this.row = row;
       // console.log(row);
-      this.$emit(
-        "updateData",
-        row,
-        this.index,
-      );
+      this.$emit("updateData", row, this.index);
     },
     /** 新增按钮操作 */
     handleAdd(row) {
@@ -344,12 +345,12 @@ export default {
       });
     },
     // 下一表数据
-    getNextCardData(){
-      this.handleCurrentChange(this.row)
+    getNextCardData() {
+      this.handleCurrentChange(this.row);
     },
     // 根据表格第一条数据请求下一个表格的数据
-    getDefaultCard(){
-      this.handleCurrentChange(this.tableList[0])
+    getDefaultCard() {
+      this.handleCurrentChange(this.tableList[0]);
     },
     // 使用提交数据类型的按钮获取数据
     tempSubBtn(getData) {
@@ -384,10 +385,10 @@ export default {
             };
 
             // 后台接收需要是表中字段真实的名称,无所谓驼峰。
-          updateData.conditionMap[this.templateInfo.template?.primaryKey] =
+            updateData.conditionMap[this.templateInfo.template?.primaryKey] =
               this.defaultValue[
                 camelCase(this.templateInfo.template?.primaryKey)
-                ];
+              ];
             Object.keys(values).map((k) => {
               updateData.commMap[k] = values[k];
             });
@@ -398,6 +399,7 @@ export default {
               this.$modal.msgError("修改失败");
             }
           } else {
+            // data;
             let res = await addTableData(data);
             if (res.code == 200) {
               this.$modal.msgSuccess("添加成功");
@@ -406,19 +408,18 @@ export default {
             }
           }
           // this.tableList = []
-          if(this.index == 0){
-            this.getDataHandler()
+          if (this.index == 0) {
+            this.getDataHandler();
           } else {
             // 判断修改是否点击了上一表格的数据
-            if(this.row){
-              this.$emit('getChildData', this.index)
+            if (this.row) {
+              this.$emit("getChildData", this.index);
             } else {
-              this.$emit('getEditHandle', this.index)
+              this.$emit("getEditHandle", this.index);
             }
           }
           this.defaultValue = {};
           this.open = false;
-
         })
         .catch((res) => {
           this.$modal.msgError("表单校验失败,请规范填写数据");
@@ -427,18 +428,20 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false;
-      this.defaultVal = {}
+      this.defaultVal = {};
       // this.reset();
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      let obj = {}
-      for(let key in row) {
-        let modifiedTable = key.replace(/[A-Z]/g, (match) => `_${match}`).toLowerCase();
+      let obj = {};
+      for (let key in row) {
+        let modifiedTable = key
+          .replace(/[A-Z]/g, (match) => `_${match}`)
+          .toLowerCase();
         obj[modifiedTable] = row[key];
       }
 
-      getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({data}) => {
+      getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
         if (!data || !data.dfVueTemplate) {
           this.$message.error("当前表格未绑定表单!");
           return;
@@ -467,11 +470,11 @@ export default {
         this.form.password = "";
       });
     },
-     // k-form-build表单变化回调
-     formChangeHandler(value, label) {
+    // k-form-build表单变化回调
+    formChangeHandler(value, label) {
       // console.log(value, label);
     },
-        /** 删除按钮操作
+    /** 删除按钮操作
      *
      * 删除提示信息语句(标识)
      * */
@@ -500,11 +503,9 @@ export default {
           // 调用子组件查询方法 目的是携带上子组件中的查询参数
           // this.$refs.mychild.pageList();
           this.$modal.msgSuccess("删除成功");
-          this.gettableListHandler(this.tableKey)
-
+          this.gettableListHandler(this.tableKey);
         })
-        .catch(() => {
-        });
+        .catch(() => {});
     },
   },
 };
@@ -531,5 +532,4 @@ export default {
   overflow: hidden;
   text-overflow: ellipsis;
 }
-
-</style>
+</style>

+ 47 - 42
ruoyi-ui/src/views/relateTable/relateTableEdit.vue

@@ -29,7 +29,7 @@
 
 <script>
 import TableCard from "./components/RelateTableCard.vue";
-import {dragGroupTableInfo} from "@/api/relateTable/index"
+import { dragGroupTableInfo } from "@/api/relateTable/index";
 
 export default {
   name: "relateTableEdit",
@@ -37,7 +37,7 @@ export default {
   components: { TableCard },
   data() {
     return {
-      tableLists:[],
+      tableLists: [],
       // 共通查询参数接受子组件的参数
       queryParams: {
         pageNum: 1, // 第几页
@@ -58,71 +58,76 @@ export default {
         },
       },
       columns: [],
-      defaultValue: '',
+      defaultValue: "",
     };
   },
   computed: {},
   mounted() {
     this.groupKey = this.$route.query.groupKey;
-    this.getLists()
+    this.getLists();
   },
-  methods: { 
+  methods: {
     // 获取相关表格信息
-    async getLists(){
-      let res = await dragGroupTableInfo({queryMap: {groupKey: this.groupKey}})
-      this.tableLists = JSON.parse(res.msg)
+    async getLists() {
+      let res = await dragGroupTableInfo({
+        queryMap: { groupKey: this.groupKey },
+      });
+      console.log(JSON.parse(res.msg));
+      this.tableLists = JSON.parse(res.msg);
     },
     // 子组件触发点击事件 获得下一表格数据
-    updateDataList(row,index) {
-      if(index == 0){
+    updateDataList(row, index) {
+      if (index == 0) {
         this.tableLists.forEach((item, i) => {
-          if(i !== 0){
-            this.$refs['childComponent'+i][0].tableList = []
-            this.$refs['childComponent'+i][0].total = 0
+          if (i !== 0) {
+            this.$refs["childComponent" + i][0].tableList = [];
+            this.$refs["childComponent" + i][0].total = 0;
           }
-        })
+        });
       }
-      let beforeChild = this.$refs['childComponent'+index][0]
-      index++
+      let beforeChild = this.$refs["childComponent" + index][0];
+      index++;
       // 判断是不是最后一个表格触发点击事件
-      if(this.$refs['childComponent'+index]){
-        const chlid = this.$refs['childComponent'+index][0]
-        if(!chlid) return
-        chlid.getDataHandler(beforeChild.contion,row)
+      if (this.$refs["childComponent" + index]) {
+        const chlid = this.$refs["childComponent" + index][0];
+        if (!chlid) return;
+        chlid.getDataHandler(beforeChild.contion, row);
       }
     },
     // 新增数据调用
     getChildData(index) {
       // console.log(index);
-      let targetRef = 'childComponent'
-      if(index == 0){
-        targetRef += index
-      }else{
-        targetRef += (index - 1)
+      let targetRef = "childComponent";
+      if (index == 0) {
+        targetRef += index;
+      } else {
+        targetRef += index - 1;
       }
-      this.$nextTick(()=>{
-        this.$refs[targetRef][0].getNextCardData()
-      })
+      this.$nextTick(() => {
+        this.$refs[targetRef][0].getNextCardData();
+      });
     },
     // 默认不点击获取表格数据
-    getDefaultCardData(index){
-      let currentChild = this.$refs['childComponent'+index][0]
+    getDefaultCardData(index) {
+      let currentChild = this.$refs["childComponent" + index][0];
       this.$nextTick(() => {
-        if(this.$refs['childComponent' + (index+1)]){
-          let nextChild = this.$refs['childComponent' + (index+1)][0]
-          nextChild.getDataHandler(currentChild.contion, currentChild.tableList[0])
+        if (this.$refs["childComponent" + (index + 1)]) {
+          let nextChild = this.$refs["childComponent" + (index + 1)][0];
+          nextChild.getDataHandler(
+            currentChild.contion,
+            currentChild.tableList[0]
+          );
         }
-
-      })
+      });
     },
     // 不点击上一表格数据时修改调用函数
-    getEditHandle(index){
-      let beforeChild = this.$refs['childComponent'+(index - 1)][0]
+    getEditHandle(index) {
+      let beforeChild = this.$refs["childComponent" + (index - 1)][0];
 
-      let currentRef = this.$refs['childComponent'+index][0]
+      let currentRef = this.$refs["childComponent" + index][0];
 
-      currentRef.getDataHandler(beforeChild.contion, beforeChild.tableList[0])
-    }
+      currentRef.getDataHandler(beforeChild.contion, beforeChild.tableList[0]);
+    },
   },
 };
 </script>
@@ -136,7 +141,7 @@ export default {
     margin-right: 20px;
   }
 }
-::v-deep .box-card[data-v-f25ef500]{
+::v-deep .box-card[data-v-f25ef500] {
   padding-bottom: 40px !important;
 }
-</style>
+</style>

+ 5 - 1
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementNormalTask.vue

@@ -131,7 +131,11 @@ export default {
       this.scriptList = filterUtil(
         { scriptType: 1, industryType },
         this.allScriptList
-      );
+      ).map((item) => ({
+        value: item.scriptKey,
+        label: item.scriptName,
+      }));
+      console.log(this.scriptList);
       // this.scriptList = res.rows.map((item) => ({
       //   value: item.scriptKey,
       //   label: item.scriptName,

+ 1 - 1
ruoyi-ui/src/views/system/bpmnPro/components/bo-utils/filterUtil.js

@@ -8,7 +8,7 @@
 export function filterUtil(condition = {}, dataList = []) {
   if (dataList.length == 0) return [];
   const keys = Object.keys(condition)
-  if (keys.length == 0) return []
+  if (keys.length == 0) return dataList
 
   let res = dataList.filter(item => keys.every(key =>
     condition[key] == item[key]

+ 1 - 1
ruoyi-ui/src/views/tableMange/index.vue

@@ -1870,7 +1870,7 @@ export default {
     // 获取按钮组数据
     async getBtnList() {
       let res = await listBtn({ isEnablePaging: false, btnParentId: 0 });
-      this.btnGroupOptions = res.rows;
+      this.btnGroupOptions = res.rows.filter((item) => !item.whetherBind);
     },
   },
   created() {},