Prechádzať zdrojové kódy

1.0.92 查询窗口按钮组图标实现

liuyanpeng 1 rok pred
rodič
commit
f2160a542e

+ 1 - 1
package.json

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

+ 1 - 1
packages/info/src/QueryPage.vue

@@ -40,7 +40,7 @@
 
       <div v-if="!isSearchWidget" style="display: inline-block">
         <QueryPageButton
-          :info-buttons="infoWindowDto.infoButtons" :info-window-no="infoWindowDto.no" :select-info-data="selectInfoData" :class-name="className"
+          :info-buttons="infoWindowDto.infoButtons" :info-window-no="infoWindowDto.no" :select-info-data="selectInfoData" :icon-src="iconSrc"
           @refresh-datas="pageSearch" @execute-export="executeExport" @execute-process="executeProcess"
         />
       </div>

+ 39 - 60
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="getImageSrc(item.icon)" style="width: 40px; cursor: pointer" /> -->
+                <AuthImage :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>
-          <ProjectTwoTone />
+          <AuthImage :auth-src="getSrc(group.info.icon)" class="auth_image" />
           {{ Language.getNameTrl($i18n.locale, group.info) }}
           <DownOutlined />
         </a-button>
@@ -45,37 +45,39 @@
     </template>
     <template v-if="otherButtons && otherButtons.length">
       <template v-for="(item, index) in otherButtons" :key="index">
-        <a-button v-if="item.action === 'RUN_PROCESS_REPORT'" :icon="h(ControlTwoTone)" @click="execute(item)">
+        <a-button v-if="item.action === 'RUN_PROCESS_REPORT'" @click="execute(item)">
           {{ item.name }}
         </a-button>
-        <a-button
-          v-else-if="item.action === 'OPEN_CUSTOMER_WINDOW'" :icon="h(BookTwoTone)"
-          @click="execute(item)"
-        >
+        <a-button v-else-if="item.action === 'OPEN_CUSTOMER_WINDOW'" @click="execute(item)">
           {{ item.name }}
         </a-button>
-        <a-button
-          v-else-if="item.action === 'OPEN_HTML_WINDOW'" :icon="h(ContainerTwoTone)"
-          @click="execute(item)"
-        >
+        <a-button v-else-if="item.action === 'OPEN_HTML_WINDOW'" @click="execute(item)">
           {{ item.name }}
         </a-button>
-        <a-button v-else-if="item.action === 'EXPORT'" :icon="h(DownloadOutlined)" @click="exportDatas">
+        <a-button v-else-if="item.action === 'EXPORT'" @click="exportDatas">
+          <AuthImage :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
-        <a-button v-else-if="item.action === 'REFRESH'" :icon="h(ReloadOutlined)" @click="refresh">
+        <a-button v-else-if="item.action === 'REFRESH'" @click="refresh">
+          <AuthImage :auth-src="getSrc(item.icon)" class="auth_image" />
           {{ item.name }}
         </a-button>
-        <a-button v-else-if="item.action === 'NOTICE'" :icon="h(BellTwoTone)">
+        <a-button v-else-if="item.action === 'NOTICE'">
+          <AuthImage :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'" :icon="h(HddOutlined)"
-          @click="openRemoteComponentModule(item)"
+          v-else-if="item.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'"
+          @click=" openRemoteComponentModule(item)"
         >
+          <AuthImage :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" />
+
           {{ item.name }}
         </a-button>
-        <a-button v-else :icon="h(LayoutTwoTone)">{{ item.name }}</a-button>
       </template>
     </template>
   </a-space>
@@ -86,26 +88,12 @@
 </template>
 
 <script setup>
-import { defineProps, defineEmits, defineAsyncComponent, ref, watch, h } from 'vue';
+import { defineProps, defineEmits, defineAsyncComponent, ref, watch } from 'vue';
 import Language from '../../common/Language.js';
-import {
-  PlusSquareTwoTone,
-  DeleteTwoTone,
-  EditTwoTone,
-  BookTwoTone,
-  BellTwoTone,
-  HddOutlined,
-  FileTextTwoTone,
-  ContainerTwoTone,
-  ControlTwoTone,
-  ReloadOutlined,
-  LayoutTwoTone,
-  DownOutlined, DownloadOutlined, ProjectTwoTone,
-} from '@ant-design/icons-vue';
+import { DownOutlined } from '@ant-design/icons-vue';
 import { Spin as ASpin, Empty as AEmpty, message } from 'ant-design-vue';
 import CssUtil from '../../common/CssUtil.js';
 import AuthImage from '../../image/src/AuthImage.vue';
-import Common from '../../common/Common.js';
 
 const emit = defineEmits(['refreshDatas', 'executeExport', 'executeProcess']);
 const props = defineProps({
@@ -117,9 +105,9 @@ const props = defineProps({
     type: Object,
     default: null,
   },
-  infoWindowNo: {
+  iconSrc: {
     type: String,
-    default: null,
+    default: '',
   },
 });
 
@@ -129,7 +117,6 @@ const otherButtons = ref([]);
 const modal1Component = ref(null);
 const modal1Open = ref(false);
 
-
 watch(() => props.infoButtons, newValue => {
   if (newValue && newValue.length > 0) {
     buttons.value = [];
@@ -153,29 +140,10 @@ watch(() => props.infoButtons, newValue => {
   };
 }, { immediate: true, deep: true });
 
-// const getImageSrc = icon => {
-//   const params = {
-
-//   };
-//   if (icon) {
-
-//     getSrc(params).then(
-//       successData => {
-//         if (successData.errorCode === 0) {
-//           _self.iconSrc = Common.getRootPath() + successData.data;
-//         } else {
-//           message.warning(successData.errorMessage);
-//         }
-//       },
-//       errorData => {
-//         Common.processException(errorData);
-//       },
-//     );
-//     return Common.getImageSrc(_self.className, item);
-//   } else {
-//     return '';
-//   }
-// };
+const getSrc = icon => {
+  if (!icon) return '';
+  return props.iconSrc + icon;
+};
 
 // 执行导出
 const exportDatas = () => {
@@ -262,4 +230,15 @@ const openRemoteComponentModule = async tabButton => {
 };
 </script>
 
-<style scoped></style>
+<style scoped>
+.auth_image {
+    width: 18px;
+    cursor: pointer;
+    margin-right: 4px;
+    margin-bottom: 3px;
+}
+
+:deep(.ant-btn) {
+    padding: 4px 8px;
+}
+</style>