Просмотр исходного кода

按钮处理公共接口添加btnKey字段

lph 1 год назад
Родитель
Сommit
e7cce455bb

+ 24 - 3
ruoyi-ui/src/components/kFormDesign/OptionsEdit.vue

@@ -2,11 +2,12 @@
   <div class="option-edit-wrap">
     <el-button
       type="info"
-      size="default"
+      size="small"
       icon="el-icon-edit"
       @click="editHandler"
     >
     </el-button>
+    <!-- 按钮 -->
     <el-dialog
       title="设置下拉选项数据"
       :visible.sync="isShow"
@@ -317,10 +318,11 @@ import { mapState } from "vuex";
 import getOptionsSqlString from "@/utils/sqlString";
 export default {
   name: "OptionsEdit",
-  props: ["options", "selectItem"],
+  props: ["options", "selectItem", "dynamicKey"],
   components: {},
   data() {
     return {
+      relateOptionShow: false,
       isShow: false,
       flagShow: false,
       flagEditIndex: "",
@@ -381,11 +383,26 @@ export default {
       ],
     };
   },
+  watch: {
+    myDynamicKey: {
+      handler(nval) {
+        this.formData.dynamicName = nval;
+        console.log(this.formData.dynamicName);
+      },
+      deep: true,
+    },
+  },
   computed: {
     ...mapState({
       databaseName: (state) => state.user.dataSource.databaseName,
       databaseType: (state) => state.user.dataSource.databaseType,
     }),
+    domType() {
+      return this.selectItem.type; //select  treeSelect  cascader
+    },
+    myDynamicKey() {
+      return this.dynamicKey;
+    },
   },
   methods: {
     // 重置条件表单数据
@@ -403,7 +420,11 @@ export default {
     // 开始编辑回调
     async editHandler() {
       await this.getAllTable();
-      this.isShow = true;
+      if (this.domType == "select") {
+        this.isShow = true;
+      } else {
+        this.relateOptionShow = true;
+      }
     },
     // 弹窗取消回调
     cancleHandler() {

+ 0 - 1
ruoyi-ui/src/views/system/bpmnPro/components/Toolbar/tools/Save.vue

@@ -131,7 +131,6 @@ export default {
       let xmlPro = await this.getProcess("xml");
       var xmlObj = this.xmlStr2XmlObj(xmlPro);
       let validateNodeRes = validateNode(xmlObj);
-      console.log(validateNodeRes);
       if (!validateNodeRes.flag) {
         this.$message.error(validateNodeRes.msg);
         return;

+ 17 - 10
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -368,6 +368,8 @@ export default {
       excuteBtnArr: [],
       // 下拉框动态数据
       dynamicData: {},
+      // 当前点击按钮的数据
+      currentBtnData: {},
     };
   },
 
@@ -601,14 +603,15 @@ export default {
     },
 
     /** 修改按钮操作 */
-    async handleUpdate(row) {
-      console.log(row);
+    async handleUpdate(row, btnData) {
+      console.log(this.currentBtnData);
 
       // 新的修改请求
       try {
         let payLoad = {
           basicMap: {
             btnType: 8,
+            btnKey: this.currentBtnData.btnKey,
             visible: "false",
             sqlKey: this.templateInfo.template.sqlKey,
             tableName: this.tableName,
@@ -712,7 +715,7 @@ export default {
      *
      * 删除提示信息语句(标识)
      * */
-    handleDelete(row) {
+    handleDelete(row, btnData) {
       let delIds = this.ids;
       let primary = camelCase(this.templateInfo.template?.primaryKey);
       this.addRealFieldName(row);
@@ -723,6 +726,7 @@ export default {
       let data = {
         basicMap: {
           btnType: 9,
+          btnKey: btnData.btnKey,
           tableName: this.tableName,
         },
         conditionMap: {
@@ -823,6 +827,8 @@ export default {
           let data = {
             basicMap: {
               tableName: this.tableName,
+              // btnKey: btnData.btnKey,
+              btnKey: this.currentBtnData.btnKey,
             },
             addListMap: [values],
             conditionMap: {},
@@ -890,6 +896,7 @@ export default {
           //   }
           //   this.getList();
           // }
+          this.getList();
           this.defaultValue = {};
           this.open = false;
         })
@@ -1025,8 +1032,8 @@ export default {
     },
 
     // 内链页面跳转
-    routerHandler(link, type) {
-      console.log(link);
+    routerHandler(btnData, type) {
+      let link = btnData.btnParams;
       if (type == "3") {
         this.$router.push(link);
       } else {
@@ -1036,22 +1043,22 @@ export default {
 
     // 操作列回调
     excuteHandler(btnData, row) {
-      console.log(btnData, row);
       let { btnType, btnParams } = btnData;
+      this.currentBtnData = btnData;
       switch (
         btnType //3:内链  6:目录  7:外链  8:修改  9:删除
       ) {
         case "3":
-          this.routerHandler(btnParams, btnType);
+          this.routerHandler(btnData, btnType);
           break;
         case "7":
-          this.routerHandler(btnParams, btnType);
+          this.routerHandler(btnData, btnType);
           break;
         case "8":
-          this.handleUpdate(row);
+          this.handleUpdate(row, btnData);
           break;
         case "9":
-          this.handleDelete(row);
+          this.handleDelete(row, btnData);
           break;
         default:
           break;