liuyanpeng 1 an în urmă
părinte
comite
58ad290b9c
1 a modificat fișierele cu 94 adăugiri și 35 ștergeri
  1. 94 35
      src/window1/tabGridView/NewTabButton.vue

+ 94 - 35
src/window1/tabGridView/NewTabButton.vue

@@ -169,7 +169,12 @@
     </template>
   </Modal>
 
-  <component :is="modal1Component" v-model:open="modal1Open" :model-data="selectDatas" @refresh-data="refresh" />
+  <component
+    :is="modal1Component"
+    v-model:open="modal1Open"
+    :model-data="selectDatas"
+    @refresh-data="refresh"
+  />
 </template>
 
 <script setup>
@@ -300,9 +305,13 @@ const refresh = () => {
   emit('refreshDatas', false);
 };
 
-watch(()=>props.selectModelDatas,newV => {
-  selectDatas.value = newV;
-},{immediate:true,deep:true});
+watch(
+  () => props.selectModelDatas,
+  newV => {
+    selectDatas.value = newV;
+  },
+  { immediate: true, deep: true },
+);
 
 /**
  * 导出确认
@@ -595,13 +604,22 @@ const openRemoteComponentModule = async function (tabButton) {
 //跳转或执行流程
 const execute = async function (tabButton) {
   tabButtonModel.value = tabButton;
-  if (tabButton.customerWindowNo != undefined && tabButton.customerWindowNo != '') {
+  if (
+    tabButton.customerWindowNo != undefined &&
+    tabButton.customerWindowNo != ''
+  ) {
     CustomerWindowResource.uniqueByNo(tabButton.customerWindowNo).then(
       successData => {
         tabButton.customerWindowRouteUrl = successData.routeUrl;
-        if(tabButton.customerWindowNo == '20221101_151823'){
-          localStorage.setItem('AssetInstance_ComplexFilterParams',JSON.stringify(props.complexFilterParams));
-          localStorage.setItem('AssetInstance_SimpleFilterParams', props.simpleFilterParams);
+        if (tabButton.customerWindowNo == '20221101_151823') {
+          localStorage.setItem(
+            'AssetInstance_ComplexFilterParams',
+            JSON.stringify(props.complexFilterParams),
+          );
+          localStorage.setItem(
+            'AssetInstance_SimpleFilterParams',
+            props.simpleFilterParams,
+          );
         }
         //跳转到tabButton.routeUrl
         if (props.viewType == 'Form' || props.viewType == 'EditForm') {
@@ -616,15 +634,18 @@ const execute = async function (tabButton) {
     );
   } else if (
     tabButton.processReportNo != undefined &&
-        tabButton.processReportNo != ''
-  ) {        
+    tabButton.processReportNo != ''
+  ) {
     // 判断流程报表是否有参数
     // 如果有参数则直接跳转到流程和报表的界面。
-    if (tabButton.routerRedirect == undefined || tabButton.routerRedirect == false) {
-      titleModal.value = true;      
-      if(tabButton.tipsTitle == undefined || tabButton.tipsTitle.length == 0){
+    if (
+      tabButton.routerRedirect == undefined ||
+      tabButton.routerRedirect == false
+    ) {
+      titleModal.value = true;
+      if (tabButton.tipsTitle == undefined || tabButton.tipsTitle.length == 0) {
         executeProcess();
-      }else{
+      } else {
         titleModal.value = true;
       }
     } else {
@@ -662,22 +683,43 @@ const execute = async function (tabButton) {
                   if (recordIds != null && recordIds.length > 0) {
                     recordIds = recordIds.substring(0, recordIds.length - 1);
                   } else {
-                    Notify.error(proxy.$t('lang.Notify.error'), proxy.$t('lang.tabButton.describe3'), true);
+                    Notify.error(
+                      proxy.$t('lang.Notify.error'),
+                      proxy.$t('lang.tabButton.describe3'),
+                      true,
+                    );
                     return;
                   }
-                  htmlWindowUrl = htmlWindowUrl.replace('{RecordIds}', recordIds);
+                  htmlWindowUrl = htmlWindowUrl.replace(
+                    '{RecordIds}',
+                    recordIds,
+                  );
                 } else {
                   var recordId = props.modelData.id;
-                  htmlWindowUrl = htmlWindowUrl.replace('{RecordIds}', recordId);
+                  htmlWindowUrl = htmlWindowUrl.replace(
+                    '{RecordIds}',
+                    recordId,
+                  );
                 }
               } else if (tempResult == '{Token}') {
-                htmlWindowUrl = htmlWindowUrl.replace('{Token}', Common.getToken());
+                htmlWindowUrl = htmlWindowUrl.replace(
+                  '{Token}',
+                  Common.getToken(),
+                );
               } else {
                 if (props.selectedModelDatas.length == 0) {
-                  Notify.error(proxy.$t('lang.Notify.error'), proxy.$t('lang.tabButton.describe3'), true);
+                  Notify.error(
+                    proxy.$t('lang.Notify.error'),
+                    proxy.$t('lang.tabButton.describe3'),
+                    true,
+                  );
                   return;
                 } else if (props.selectedModelDatas.length > 1) {
-                  Notify.error(proxy.$t('lang.Notify.error'), proxy.$t('lang.tabButton.describe2'), true);
+                  Notify.error(
+                    proxy.$t('lang.Notify.error'),
+                    proxy.$t('lang.tabButton.describe2'),
+                    true,
+                  );
                   return;
                 }
                 var tempResult1 = tempResult.replace('{', '').replace('}', '');
@@ -728,9 +770,7 @@ const switchFormRoute = async function (tabButton) {
     routeDate.path = routeDate.path + '/' + uuid;
   }
 
-  const frameUrl = Common.getRedirectUrl(
-    '#' + routeDate.path,
-  );
+  const frameUrl = Common.getRedirectUrl('#' + routeDate.path);
 
   // 供子页面iframe调用,修改modelData,(举例:生单界面修改参数)。
   // window.modelDataChanged = modelDataChanged;
@@ -740,11 +780,27 @@ const switchFormRoute = async function (tabButton) {
   // console.log(modelData1);
   // localStorage.setItem(props.uuid + '#GenerateDocumentTool', modelData1);
 
-  var iWidth = 1280;//弹出窗口的宽度;
+  var iWidth = 1280; //弹出窗口的宽度;
   var iHeight = 720; //弹出窗口的高度;
-  var iTop = (window.screen.availHeight-30-iHeight)/2;//获得窗口的垂直位置;
-  var iLeft = (window.screen.availWidth-10-iWidth)/2; //获得窗口的水平位置;
-  window.open(frameUrl,'_blank','height='+iHeight+',innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
+  var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //获得窗口的垂直位置;
+  var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置;
+  window.open(
+    frameUrl,
+    '_blank',
+    'height=' +
+      iHeight +
+      ',innerHeight=' +
+      iHeight +
+      ',width=' +
+      iWidth +
+      ',innerWidth=' +
+      iWidth +
+      ',top=' +
+      iTop +
+      ',left=' +
+      iLeft +
+      ',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no',
+  );
   // window.open(frameUrl);
 };
 // 执行流程
@@ -761,7 +817,10 @@ const executeProcess = async function () {
   }
   // props.loading=true;
 
-  ProcessReportResource.runProcessByIds(tabButtonModel.value.processReportNo, ids).then(
+  ProcessReportResource.runProcessByIds(
+    tabButtonModel.value.processReportNo,
+    ids,
+  ).then(
     successData => {
       modal.value = true;
       // _self.loading=false;
@@ -772,15 +831,15 @@ const executeProcess = async function () {
         processReportResult.value.reportResults.length > 0
       ) {
         processReportResult.value.reportResults.forEach(function (item, index) {
-          if(item.reportDefinitionType!=='ExcelReport'){
-            item.previewIndex=1;
-          }else{
-            item.previewIndex=2;
+          if (item.reportDefinitionType !== 'ExcelReport') {
+            item.previewIndex = 1;
+          } else {
+            item.previewIndex = 2;
           }
           if (index == 0) {
-            item.showPreview=true;
+            item.showPreview = true;
           } else {
-            item.showPreview=false;
+            item.showPreview = false;
           }
         });
       }
@@ -794,7 +853,7 @@ const executeProcess = async function () {
   // }
 };
 //关闭表头按钮提示框
-const titleModalClose = async function (){
+const titleModalClose = async function () {
   titleModal.value = false;
 };
 </script>