Browse Source

Merge remote-tracking branch 'refs/remotes/origin/1.2.4' into 1.2.2yang

# Conflicts:
#	src/views/basic/dynamicModel/list/index.vue
yangfan 2 months ago
parent
commit
5bc0477dac

+ 1 - 1
src/views/basic/dynamicModel/list/Form.vue

@@ -67,7 +67,7 @@
         </template>
         <span slot="footer" class="dialog-footer" v-if="detailType !== 'detail'">
           <template v-if="dataForm.id">
-            <template v-for="(item, i) in buttons">
+            <template v-for="(item, i) in buttons?.filter(o=>o?.buttonType !== 2)">
               <el-button type="primary" :icon="item.icon" @click="customBtnsHandel(item)">{{ item.label }}</el-button>
             </template>
           </template>

+ 15 - 13
src/views/basic/dynamicModel/list/index.vue

@@ -370,7 +370,7 @@
                   <el-dropdown-item v-if="columnData.isQrcode">
                     <el-button size="mini" type="text" @click="getQrcode(scope.row, scope.row)">下载二维码</el-button>
                   </el-dropdown-item>
-                  <div v-for="item in getPreconditionObj[scope.row[columnDict[idKey]]]" :key="item.id">
+                  <div v-for="item in getPreconditionObj[scope.row[columnDict[idKey]]]?.filter(o=> o?.buttonType !== 2)" :key="item.id">
                     <el-dropdown-item>
                       <el-button size="mini" type="text" :icon="item.icon" @click="isCustomBtnsHandel(item, scope)">
                         {{ item.buttonName }}
@@ -2228,9 +2228,9 @@ export default {
         if (!btn.condition) {
           condFlag = true
         } else {
-          let rowKey = row[this.columnDict[this.idKey]]
-          let btns = this.getPreconditionObj[rowKey] || []
-          condFlag = !!btns.find((i) => i.id === btn.id)
+          let rowKey = row[this.columnDict[this.idKey]];
+          let btns = this.getPreconditionObj[rowKey] || [];
+          condFlag = !!btns.find(i => i.id == btn.id);
         }
       } else {
         condFlag = true
@@ -3187,9 +3187,9 @@ export default {
             getPreconditionObj[i.authId] = i?.buttonList || []
             if (getPreconditionObj[i.authId].length > 0) {
               getPreconditionObj[i.authId].forEach((j) => {
-                j.label = j.buttonName
-                j.buttonId = j.id
-              })
+                  j.label = j.buttonName;
+                  j.buttonId = j.id;
+              });
             }
           })
           this.getPreconditionObj = getPreconditionObj
@@ -3482,12 +3482,14 @@ export default {
       }
     },
     async customBtnsHandel(button, row, isQizhi = false) {
-      const data = {}
-      // 查询关联表数据  自定义事件中修改关联数据使用
-      for (const [key, value] of Object.entries(row.row)) {
-        const field = this.columnData.joinList.find((i) => i.columnName === key)
-        if (field) {
-          data[key] = value
+      const data = {};
+      if(this.columnData.joinList && this.columnData.joinList.length){
+        // 查询关联表数据  自定义事件中修改关联数据使用
+        for (const [key, value] of Object.entries(row.row)) {
+          const field = this.columnData.joinList.find((i) => i.columnName === key);
+          if(field){
+            data[key] = value;
+          }
         }
       }
       Object.entries(this.columnDict).forEach((item) => {