Преглед изворни кода

CustomerWindowResource/uniqueByNo 优化。

YangZhiJie пре 1 година
родитељ
комит
cbd0c158b9

+ 4 - 3
src/client/MenuNode.vue

@@ -166,11 +166,12 @@ export default {
         });
       } else if (nodeType == 'Customer') {
         CustomerWindowResource.uniqueByNo(_self.model.customerWindowNo).then(successData => {
-          if (successData != null) {
-            // var url = "/desktop/" + data.routeUrl;
+          if (successData.errorCode == 0) {
             _self.$router.push({
-              path: successData.routeUrl,
+              path: successData.data.routeUrl,
             });
+          } else {
+            Notify.error(_self.$t('lang.Notify.error'), successData.errorMessage, true);
           }
         }, errorData => {
           Common.processException(errorData);

+ 15 - 10
src/window/tabView/TabButton.vue

@@ -423,17 +423,22 @@ export default {
       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(_self.complexFilterParams));
-              localStorage.setItem('AssetInstance_SimpleFilterParams', _self.simpleFilterParams);
-            }
-            //跳转到tabButton.routeUrl
-            if (this.viewType == 'Form' || this.viewType == 'EditForm') {
-              this.switchFormRoute(tabButton);
-            } else if (this.viewType == 'Grid') {
-              this.switchFormRoute(tabButton);
+            if (successData.errorCode == 0) {
+              tabButton.customerWindowRouteUrl = successData.data.routeUrl;
+              if(tabButton.customerWindowNo == '20221101_151823'){
+                localStorage.setItem('AssetInstance_ComplexFilterParams',JSON.stringify(_self.complexFilterParams));
+                localStorage.setItem('AssetInstance_SimpleFilterParams', _self.simpleFilterParams);
+              }
+              //跳转到tabButton.routeUrl
+              if (this.viewType == 'Form' || this.viewType == 'EditForm') {
+                this.switchFormRoute(tabButton);
+              } else if (this.viewType == 'Grid') {
+                this.switchFormRoute(tabButton);
+              }
+            }else{
+              Notify.error(_self.$t('lang.Notify.error'), successData.errorMessage, true);
             }
+            
           },
           errorData => {
             Common.processException(errorData);

+ 11 - 6
src/window1/tabGridView/CellTextItem.vue

@@ -651,13 +651,18 @@ export default {
       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(_self.complexFilterParams));
-              localStorage.setItem('AssetInstance_SimpleFilterParams', _self.simpleFilterParams);
+            if (successData.errorCode == 0) {
+              tabButton.customerWindowRouteUrl = successData.data.routeUrl;
+              if (tabButton.customerWindowNo == '20221101_151823') {
+                localStorage.setItem('AssetInstance_ComplexFilterParams', JSON.stringify(_self.complexFilterParams));
+                localStorage.setItem('AssetInstance_SimpleFilterParams', _self.simpleFilterParams);
+              }
+              //跳转到tabButton.routeUrl
+              _self.switchFormRoute(tabButton);
+            }else{
+              Notify.error(_self.$t('lang.Notify.error'), successData.errorMessage, true);
             }
-            //跳转到tabButton.routeUrl
-            _self.switchFormRoute(tabButton);
+            
           },
           errorData => {
             Common.processException(errorData);

+ 22 - 16
src/window1/tabGridView/NewTabButton.vue

@@ -596,23 +596,29 @@ const execute = async function (tabButton) {
   ) {
     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,
-          );
-        }
-        //跳转到tabButton.routeUrl
-        if (props.viewType == 'Form' || props.viewType == 'EditForm') {
-          switchFormRoute(tabButton);
-        } else if (props.viewType == 'Grid') {
-          switchFormRoute(tabButton);
+        if (successData.errorCode == 0) {
+          tabButton.customerWindowRouteUrl = successData.data.routeUrl;
+          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') {
+            switchFormRoute(tabButton);
+          } else if (props.viewType == 'Grid') {
+            switchFormRoute(tabButton);
+          }
+        }else{
+          Notify.error(_self.$t('lang.Notify.error'), successData.errorMessage, true);
         }
+
+        
       },
       errorData => {
         Common.processException(errorData);

+ 21 - 16
src/window1/tabView/TabButton.vue

@@ -477,23 +477,28 @@ export default {
       ) {
         CustomerWindowResource.uniqueByNo(tabButton.customerWindowNo).then(
           successData => {
-            tabButton.customerWindowRouteUrl = successData.routeUrl;
-            if (tabButton.customerWindowNo == '20221101_151823') {
-              localStorage.setItem(
-                'AssetInstance_ComplexFilterParams',
-                JSON.stringify(_self.complexFilterParams),
-              );
-              localStorage.setItem(
-                'AssetInstance_SimpleFilterParams',
-                _self.simpleFilterParams,
-              );
-            }
-            //跳转到tabButton.routeUrl
-            if (this.viewType == 'Form' || this.viewType == 'EditForm') {
-              this.switchFormRoute(tabButton);
-            } else if (this.viewType == 'Grid') {
-              this.switchFormRoute(tabButton);
+            if (successData.errorCode == 0) {
+              tabButton.customerWindowRouteUrl = successData.data.routeUrl;
+              if (tabButton.customerWindowNo == '20221101_151823') {
+                localStorage.setItem(
+                  'AssetInstance_ComplexFilterParams',
+                  JSON.stringify(_self.complexFilterParams),
+                );
+                localStorage.setItem(
+                  'AssetInstance_SimpleFilterParams',
+                  _self.simpleFilterParams,
+                );
+              }
+              //跳转到tabButton.routeUrl
+              if (this.viewType == 'Form' || this.viewType == 'EditForm') {
+                this.switchFormRoute(tabButton);
+              } else if (this.viewType == 'Grid') {
+                this.switchFormRoute(tabButton);
+              }
+            }else{
+              Notify.error(_self.$t('lang.Notify.error'), successData.errorMessage, true);
             }
+
           },
           errorData => {
             Common.processException(errorData);

+ 20 - 10
src/window1/tabView/TabButton1.vue

@@ -421,18 +421,28 @@ export default {
     execute: function (tabButton) {
       var _self = this;
       if (tabButton.customerWindowNo != undefined && tabButton.customerWindowNo != '') {
+        if (successData.errorCode == 0) {
+
+        }else{
+          Notify.error(_self.$t('lang.Notify.error'), successData.errorMessage, true);
+        }
+
         CustomerWindowResource.uniqueByNo(tabButton.customerWindowNo).then(
           successData => {
-            tabButton.customerWindowRouteUrl = successData.routeUrl;
-            if(tabButton.customerWindowNo == '20221101_151823'){
-              localStorage.setItem('AssetInstance_ComplexFilterParams',JSON.stringify(_self.complexFilterParams));
-              localStorage.setItem('AssetInstance_SimpleFilterParams', _self.simpleFilterParams);
-            }
-            //跳转到tabButton.routeUrl
-            if (this.viewType == 'Form' || this.viewType == 'EditForm') {
-              this.switchFormRoute(tabButton);
-            } else if (this.viewType == 'Grid') {
-              this.switchFormRoute(tabButton);
+            if (successData.errorCode == 0) {
+              tabButton.customerWindowRouteUrl = successData.data.routeUrl;
+              if(tabButton.customerWindowNo == '20221101_151823'){
+                localStorage.setItem('AssetInstance_ComplexFilterParams',JSON.stringify(_self.complexFilterParams));
+                localStorage.setItem('AssetInstance_SimpleFilterParams', _self.simpleFilterParams);
+              }
+              //跳转到tabButton.routeUrl
+              if (this.viewType == 'Form' || this.viewType == 'EditForm') {
+                this.switchFormRoute(tabButton);
+              } else if (this.viewType == 'Grid') {
+                this.switchFormRoute(tabButton);
+              }
+            }else{
+              Notify.error(_self.$t('lang.Notify.error'), successData.errorMessage, true);
             }
           },
           errorData => {