Răsfoiți Sursa

1.0.93 修复查询窗口按钮分组bug

liuyanpeng 1 an în urmă
părinte
comite
7ca502f3f1
2 a modificat fișierele cu 27 adăugiri și 21 ștergeri
  1. 1 1
      package.json
  2. 26 20
      packages/info/src/QueryPageButton.vue

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pc-component-v3",
-  "version": "1.0.92",
+  "version": "1.0.93",
   "description": "",
   "main": "dist/pc-component-v3.js",
   "scripts": {

+ 26 - 20
packages/info/src/QueryPageButton.vue

@@ -6,7 +6,7 @@
           <a-menu>
             <template v-if="group.children && group.children.length">
               <a-menu-item v-for="item in group.children" :key="item.name">
-                <AuthImage :auth-src="getSrc(item.icon)" class="auth_image" />
+                <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
                 <span v-if="item.action === 'RUN_PROCESS_REPORT'" @click="execute(item)">
                   {{ Language.getNameTrl($i18n.locale, item) }}
                 </span>
@@ -37,7 +37,7 @@
           </a-menu>
         </template>
         <a-button>
-          <AuthImage :auth-src="getSrc(group.info.icon)" class="auth_image" />
+          <AuthImage v-if="group.info.icon" :auth-src="getSrc(group.info.icon)" class="auth_image" />
           {{ Language.getNameTrl($i18n.locale, group.info) }}
           <DownOutlined />
         </a-button>
@@ -46,36 +46,38 @@
     <template v-if="otherButtons && otherButtons.length">
       <template v-for="(item, index) in otherButtons" :key="index">
         <a-button v-if="item.action === 'RUN_PROCESS_REPORT'" @click="execute(item)">
+          <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
         <a-button v-else-if="item.action === 'OPEN_CUSTOMER_WINDOW'" @click="execute(item)">
+          <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
         <a-button v-else-if="item.action === 'OPEN_HTML_WINDOW'" @click="execute(item)">
+          <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
         <a-button v-else-if="item.action === 'EXPORT'" @click="exportDatas">
-          <AuthImage :auth-src="getSrc(item.icon)" class="auth_image" />
+          <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
         <a-button v-else-if="item.action === 'REFRESH'" @click="refresh">
-          <AuthImage :auth-src="getSrc(item.icon)" class="auth_image" />
+          <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
         <a-button v-else-if="item.action === 'NOTICE'">
-          <AuthImage :auth-src="getSrc(item.icon)" class="auth_image" />
+          <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
         <a-button
           v-else-if="item.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'"
           @click=" openRemoteComponentModule(item)"
         >
-          <AuthImage :auth-src="getSrc(item.icon)" class="auth_image" />
+          <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
         <a-button v-else>
-          <AuthImage :auth-src="getSrc(item.icon)" class="auth_image" />
-
+          <AuthImage v-if="item.icon" :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
       </template>
@@ -116,6 +118,7 @@ const buttonGroup = ref([]);
 const otherButtons = ref([]);
 const modal1Component = ref(null);
 const modal1Open = ref(false);
+const infoButtons = ref([]);
 
 watch(() => props.infoButtons, newValue => {
   if (newValue && newValue.length > 0) {
@@ -125,18 +128,21 @@ watch(() => props.infoButtons, newValue => {
     newValue.forEach(item => {
       if (item.isOption) {
         buttonGroup.value.push({ name: item.name, info: item, children: [] });
-      }
-      if (!item.isOption && item.infoButtonOptionNo) {
-        buttonGroup.value.forEach(group => {
-          if (group.name === item.infoButtonOptionNo) {
-            group.children.push(item);
-          }
-        });
+      } else {
+        infoButtons.value.push(item);
       }
       if (!item.isOption && !item.infoButtonOptionNo) {
         otherButtons.value.push(item);
       }
     });
+
+    infoButtons.value.forEach(button => {
+      buttonGroup.value.forEach(group => {
+        if (group.name === button.infoButtonOptionNo) {
+          group.children.push(button);
+        }
+      });
+    });
   };
 }, { immediate: true, deep: true });
 
@@ -232,13 +238,13 @@ const openRemoteComponentModule = async tabButton => {
 
 <style scoped>
 .auth_image {
-    width: 18px;
-    cursor: pointer;
-    margin-right: 4px;
-    margin-bottom: 3px;
+  width: 18px;
+  cursor: pointer;
+  margin-right: 8px;
+  margin-bottom: 3px;
 }
 
 :deep(.ant-btn) {
-    padding: 4px 8px;
+  padding: 4px 8px;
 }
 </style>