Przeglądaj źródła

行内按钮判断优化

wu 2 miesięcy temu
rodzic
commit
118ae40c89

+ 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>

+ 5 - 5
src/views/basic/dynamicModel/list/index.vue

@@ -385,7 +385,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 }}
@@ -2287,12 +2287,12 @@ export default {
         } else {
           let rowKey = row[this.columnDict[this.idKey]];
           let btns = this.getPreconditionObj[rowKey] || [];
-          condFlag = !!btns.find(i => i.id === btn.id);
+          condFlag = !!btns.find(i => i.id == btn.id);
         }
       } else {
         condFlag = true;
       }
-      return authFlag && condFlag;
+      return authFlag && condFlag
     },
     handleFilterChange() {
       this.filterListSearch = [];
@@ -3227,8 +3227,8 @@ 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;
               });
             }
           });