Przeglądaj źródła

修复代码合并的BUG.

YangZhiJie 1 rok temu
rodzic
commit
009250bb1e
1 zmienionych plików z 127 dodań i 55 usunięć
  1. 127 55
      src/window1/tabGridView/CellTextItem.vue

+ 127 - 55
src/window1/tabGridView/CellTextItem.vue

@@ -1,15 +1,17 @@
 <template>
   <div class="table-cell-text">
-    <div v-if="!fieldUtil.isManyToManySetType(gridFieldItem)
-      && !fieldUtil.isImageType(gridFieldItem)
-      && !fieldUtil.isImageListType(gridFieldItem)
-      && !fieldUtil.isVideoType(gridFieldItem)
-      && !fieldUtil.isFileType(gridFieldItem)
-      && !fieldUtil.isEnumMultiType(gridFieldItem)
-      && !fieldUtil.isEnumListType(gridFieldItem)
-      && !fieldUtil.isTextAreaType(gridFieldItem)
-      && !fieldUtil.isRichTextAreaEditor(gridFieldItem)
-      && !fieldUtil.isCustomerRender(gridFieldItem)">
+    <div
+      v-if="!fieldUtil.isManyToManySetType(gridFieldItem)
+        && !fieldUtil.isImageType(gridFieldItem)
+        && !fieldUtil.isImageListType(gridFieldItem)
+        && !fieldUtil.isVideoType(gridFieldItem)
+        && !fieldUtil.isFileType(gridFieldItem)
+        && !fieldUtil.isEnumMultiType(gridFieldItem)
+        && !fieldUtil.isEnumListType(gridFieldItem)
+        && !fieldUtil.isTextAreaType(gridFieldItem)
+        && !fieldUtil.isRichTextAreaEditor(gridFieldItem)
+        && !fieldUtil.isCustomerRender(gridFieldItem)"
+    >
       {{ displayValue(modelData) }}
     </div>
 
@@ -24,13 +26,13 @@
     <div v-else-if="fieldUtil.isEnumListType(gridFieldItem)">
       {{ getEnmuValue() === "编辑中" ? $t("lang.TabFormFieldView.editing") :
         getEnmuValue() === "审批中" ? $t("lang.TabFormFieldView.pendingApproval") :
-          getEnmuValue() === "审批通过" ? $t("lang.TabFormFieldView.approved") :
-            getEnmuValue() === "审批不通过" ? $t("lang.TabFormFieldView.rejected") :
-              getEnmuValue() === "单据已撤回" ? $t("lang.TabFormFieldView.withdraw") :
-                getEnmuValue() === "转移" ? $t("lang.TabFormFieldView.transfer") :
-                  getEnmuValue() === "报废" ? $t("lang.TabFormFieldView.disposal") :
-                    getEnmuValue() === "全盘" ? $t("lang.TabFormFieldView.overall") :
-                      getEnmuValue() === "抽盘" ? $t("lang.TabFormFieldView.randomInventory") : getEnmuValue()
+        getEnmuValue() === "审批通过" ? $t("lang.TabFormFieldView.approved") :
+        getEnmuValue() === "审批不通过" ? $t("lang.TabFormFieldView.rejected") :
+        getEnmuValue() === "单据已撤回" ? $t("lang.TabFormFieldView.withdraw") :
+        getEnmuValue() === "转移" ? $t("lang.TabFormFieldView.transfer") :
+        getEnmuValue() === "报废" ? $t("lang.TabFormFieldView.disposal") :
+        getEnmuValue() === "全盘" ? $t("lang.TabFormFieldView.overall") :
+        getEnmuValue() === "抽盘" ? $t("lang.TabFormFieldView.randomInventory") : getEnmuValue()
       }}
     </div>
 
@@ -47,53 +49,88 @@
     <AuthImage v-else-if="fieldUtil.isImageType(gridFieldItem)" :auth-src="imageUrl" class="cell-image" />
 
     <span v-else-if="fieldUtil.isImageListType(gridFieldItem)">
-      <AuthImage v-for="singleImageName in imageUrls" :key="singleImageName" :auth-src="singleImageName"
-        class="cell-image-list" />
+      <AuthImage
+        v-for="singleImageName in imageUrls" :key="singleImageName" :auth-src="singleImageName"
+        class="cell-image-list"
+      />
     </span>
 
-    <VideoListCell v-else-if="fieldUtil.isVideoType(gridFieldItem)" :field="gridFieldItem" :field-value="fieldValue"
-      :class-name="className" :readonly="true" />
+    <VideoListCell
+      v-else-if="fieldUtil.isVideoType(gridFieldItem)" :field="gridFieldItem" :field-value="fieldValue"
+      :class-name="className" :readonly="true"
+    />
 
-    <ButtonCell v-else-if="fieldUtil.isButtonType(gridFieldItem)" :field="gridFieldItem" :field-value="fieldValue"
-      :readonly="readOnly" @execute-callout="executeCallout" />
+    <ButtonCell
+      v-else-if="fieldUtil.isButtonType(gridFieldItem)" :field="gridFieldItem" :field-value="fieldValue"
+      :readonly="readOnly" @execute-callout="executeCallout"
+    />
 
     <div v-else-if="fieldUtil.isFileType(gridFieldItem)" style="padding: 0px 10px">
       <FileListWidget :field="gridFieldItem" :field-value="fieldValue" :class-name="className" :readonly="true" />
     </div>
 
 
-    <component :is="customerComponentName" v-else-if="fieldUtil.isCustomerRender(gridFieldItem)" :field="gridFieldItem"
-      :field-value="fieldValue" :class-name="className" />
+    <component
+      :is="customerComponentName" v-else-if="fieldUtil.isCustomerRender(gridFieldItem)" :field="gridFieldItem"
+      :field-value="fieldValue" :class-name="className"
+    />
     <div v-if="fieldUtil.isGridButtonEditor(gridFieldItem)">
       <template v-for="(tabGridButtonItem, index) in gridFieldItem.tabGridButtonDtos" :key="tabGridButtonItem.name">
         <template v-if="visible[index]">
           <a-button
             v-if="tabGridButtonItem.action === 'CREATE' || tabGridButtonItem.action === 'SAVE' || tabGridButtonItem.action === 'RUN' || tabGridButtonItem.action === 'EXPORT' || tabGridButtonItem.action === 'NOTICE' || tabGridButtonItem.action === 'REFRESH'"
-            type="link" @click="buttonClick">{{ tabGridButtonItem.name }}</a-button>
-          <a-button v-if="tabGridButtonItem.action === 'DELETE'" type="link" danger @click="deleteRecord">{{
-            tabGridButtonItem.name }}</a-button>
-          <a-button v-if="tabGridButtonItem.action === 'EDIT'" type="link" @click="editRecord">{{ tabGridButtonItem.name
-            }}</a-button>
-          <a-button v-if="tabGridButtonItem.action === 'SEE'" type="link" @click="readRecord">{{ tabGridButtonItem.name
-            }}</a-button>
-          <a-button v-if="tabGridButtonItem.action === 'RUN_PROCESS_REPORT'" type="link"
-            @click="execute(tabGridButtonItem)">{{ tabGridButtonItem.name }}</a-button>
-          <a-button v-if="tabGridButtonItem.action === 'OPEN_CUSTOMER_WINDOW'" type="link"
-            @click="execute(tabGridButtonItem)">{{ tabGridButtonItem.name }}</a-button>
-          <a-button v-if="tabGridButtonItem.action === 'OPEN_HTML_WINDOW'" type="link"
-            @click="execute(tabGridButtonItem)">{{ tabGridButtonItem.name }}</a-button>
-          <a-button v-if="tabGridButtonItem.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'" type="link"
-            @click="openRemoteComponentModule(tabGridButtonItem)">{{ tabGridButtonItem.name }}</a-button>
+            type="link" @click="buttonClick"
+          >
+            {{ tabGridButtonItem.name }}
+          </a-button>
+          <a-button v-if="tabGridButtonItem.action === 'DELETE'" type="link" danger @click="deleteRecord">
+            {{
+              tabGridButtonItem.name }}
+          </a-button>
+          <a-button v-if="tabGridButtonItem.action === 'EDIT'" type="link" @click="editRecord">
+            {{ tabGridButtonItem.name
+            }}
+          </a-button>
+          <a-button v-if="tabGridButtonItem.action === 'SEE'" type="link" @click="readRecord">
+            {{ tabGridButtonItem.name
+            }}
+          </a-button>
+          <a-button
+            v-if="tabGridButtonItem.action === 'RUN_PROCESS_REPORT'" type="link"
+            @click="execute(tabGridButtonItem)"
+          >
+            {{ tabGridButtonItem.name }}
+          </a-button>
+          <a-button
+            v-if="tabGridButtonItem.action === 'OPEN_CUSTOMER_WINDOW'" type="link"
+            @click="execute(tabGridButtonItem)"
+          >
+            {{ tabGridButtonItem.name }}
+          </a-button>
+          <a-button
+            v-if="tabGridButtonItem.action === 'OPEN_HTML_WINDOW'" type="link"
+            @click="execute(tabGridButtonItem)"
+          >
+            {{ tabGridButtonItem.name }}
+          </a-button>
+          <a-button
+            v-if="tabGridButtonItem.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'" type="link"
+            @click="openRemoteComponentModule(tabGridButtonItem)"
+          >
+            {{ tabGridButtonItem.name }}
+          </a-button>
         </template>
       </template>
     </div>
   </div>
   <Modal v-model:show="modal" :full="true">
-    <ProcessReportResultPreview v-if="
-      processReportResult != null &&
-      (processReportResult.reportResults != null ||
-        processReportResult.processResult != null)
-    " :process-report-result="processReportResult" :pdf-only="false" :excel-only="false" />
+    <ProcessReportResultPreview
+      v-if="
+        processReportResult != null &&
+          (processReportResult.reportResults != null ||
+            processReportResult.processResult != null)
+      " :process-report-result="processReportResult" :pdf-only="false" :excel-only="false"
+    />
     <template #header>
       {{ $t("lang.tabButton.executeResult") }}
     </template>
@@ -129,8 +166,6 @@ import VideoListCell from '../tabGridWidget/VideoListCell.vue';
 import FileListWidget from '../tabFormWidget/FileListWidget.vue';
 import ButtonCell from '../tabGridWidget/ButtonCell.vue';
 import AuthImage from '../../widget/AuthImage.vue';
-import { CssUtil } from 'pc-component-v3';
-import { defineAsyncComponent } from 'vue';
 import CustomerWindowResource from '../../api/dic/CustomerWindowResource.js';
 import HtmlWindowResource from '../../api/dic/HtmlWindowResource.js';
 import ProcessReportResource from '../../api/dic/ProcessReportResource.js';
@@ -479,12 +514,15 @@ export default {
     readRecord: function () {
       this.$emit('readRecord');
     },
+
+
+    
     /**
      * 远程加载ES VUE组件模块,并在模态框中打开。
      * @param jsUrl js路径
      * @param cssUrl css路径
      */
-    openRemoteComponentModule: function (tabButton) {
+     openRemoteComponentModule: function (tabButton) {
       var _self = this;
       let jsUrl = tabButton.remoteComponentModuleJsUrl;
       let cssUrl = tabButton.remoteComponentModuleCssUrl;
@@ -519,11 +557,13 @@ export default {
           timeout: 10000,
         });
 
-        _self.customerComponentName = testAsyncRemoteComponent;
-        console.log(_self.customerComponentName);
+        _self.modal1Component = testAsyncRemoteComponent;
+        _self.modal1Open = true;
+        console.log(_self.modal1Component);
       }
     },
 
+    
     /**
      * 远程加载ES VUE组件模块。
      * @param jsUrl js路径
@@ -533,11 +573,43 @@ export default {
       const _self = this;
       let jsUrl = this.gridFieldItem.remoteComponentModuleJsUrl;
       let cssUrl = this.gridFieldItem.remoteComponentModuleCssUrl;
-      _self.modal1Component = testAsyncRemoteComponent;
-      _self.modal1Open = true;
-      console.log(_self.modal1Component);
-    }
+
+      // 显示模态框
+      // 异步的加载js组件
+      //let jsUrl = './static/client-eam-module-v3/dist/AssetCheckCreate.js';
+      //let cssUrl = './static/client-eam-module-v3/dist/AssetCheckCreate.css';
+
+      if (cssUrl != null && cssUrl.length > 0) {
+        let cssUrlHash = _self.getHash(cssUrl);
+        CssUtil.dynamicLoadCss(cssUrl, cssUrlHash);
+      }
+      // webpackIgnore:设置为 true 时,禁用动态导入解析。
+      // const testAsyncRemoteComponent  = await import(/* webpackIgnore: true */ jsUrl);
+
+      // console.log(testAsyncRemoteComponent);
+      if (jsUrl != null && jsUrl.length > 0) {
+        const asyncRemoteComponent = defineAsyncComponent({
+          // 加载函数
+          loader: () => {
+            return import(/* webpackIgnore: true */ jsUrl);
+          },
+          // 加载异步组件时使用的组件
+          loadingComponent: ASpin,
+          // 展示加载组件前的延迟时间,默认为 200ms
+          delay: 200,
+          // 加载失败后展示的组件
+          errorComponent: AEmpty,
+          // 如果提供了一个 timeout 时间限制,并超时了
+          // 也会显示这里配置的报错组件,默认值是:Infinity
+          timeout: 10000,
+        });
+
+        _self.customerComponentName = asyncRemoteComponent;
+        console.log(_self.customerComponentName);
+      }
+    },
   },
+  
   //跳转或执行流程
   execute: function (tabButton) {
     var _self = this;
@@ -705,7 +777,7 @@ export default {
     var _self = this;
     _self.titleModal = false;
   },
-}
+};
 
 
 </script>