You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/03/24 11:40:17 UTC

[incubator-linkis] 06/07: fix: fix udf page cannot open & rm useless cods

This is an automated email from the ASF dual-hosted git repository.

peacewong pushed a commit to branch dev-1.1.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git

commit 92a2d96c6b0204e57d23b9767fb494e9841e3f7d
Author: ryanlei <ry...@webank.com>
AuthorDate: Thu Mar 17 17:27:35 2022 +0800

    fix: fix udf page cannot open & rm useless cods
---
 web/package.json                               |  5 +----
 web/src/apps/URM/module/udfManagement/index.js | 21 +++++++++++++++++++++
 web/src/apps/URM/router.js                     |  6 +++---
 web/src/common/service/mixin.js                | 17 +----------------
 web/src/components/consoleComponent/result.vue |  7 -------
 web/src/dynamic-apps.js                        | 25 +++++++------------------
 web/src/main.js                                |  4 ++--
 web/vue.config.js                              |  3 +--
 8 files changed, 36 insertions(+), 52 deletions(-)

diff --git a/web/package.json b/web/package.json
index bd8c6a6..2da21e5 100644
--- a/web/package.json
+++ b/web/package.json
@@ -7,8 +7,7 @@
         "build": "vue-cli-service build",
         "lint": "vue-cli-service lint --no-fix",
         "fix": "eslint --ext .js,.vue src --fix",
-        "precommit": "lint-staged",
-        "postinstall": "patch-package"
+        "precommit": "lint-staged"
     },
     "husky": {
         "hooks": {
@@ -39,7 +38,6 @@
         "moment": "2.29.1",
         "monaco-editor": "0.19.3",
         "object-to-formdata": "^4.2.2",
-        "pinyin": "2.9.1",
         "qs": "6.9.4",
         "reconnecting-websocket": "4.4.0",
         "sql-formatter": "2.3.3",
@@ -67,7 +65,6 @@
         "material-design-icons": "^3.0.1",
         "monaco-editor-webpack-plugin": "1.8.2",
         "node-sass": "4.14.1",
-        "patch-package": "6.2.2",
         "sass-loader": "7.3.1",
         "svg-sprite-loader": "5.0.0",
         "vue-cli-plugin-mockjs": "0.1.3",
diff --git a/web/src/apps/URM/module/udfManagement/index.js b/web/src/apps/URM/module/udfManagement/index.js
new file mode 100644
index 0000000..35a1575
--- /dev/null
+++ b/web/src/apps/URM/module/udfManagement/index.js
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default {
+  name: 'UdfManagemet',
+  component: () => import('./index.vue'),
+};
diff --git a/web/src/apps/URM/router.js b/web/src/apps/URM/router.js
index 225382e..8e0e80b 100644
--- a/web/src/apps/URM/router.js
+++ b/web/src/apps/URM/router.js
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,7 +38,7 @@ export default [
       publicPage: true,
     },
     children: [{
-      name: 'udfFunctionManage',
+      name: 'udfManagement',
       path: 'udfManagement',
       component: () =>
         import('./module/udfManagement/index.vue'),
diff --git a/web/src/common/service/mixin.js b/web/src/common/service/mixin.js
index fa53e85..397fe1b 100644
--- a/web/src/common/service/mixin.js
+++ b/web/src/common/service/mixin.js
@@ -26,22 +26,7 @@ export default {
       SUPPORTED_LANG_MODES,
     };
   },
-  beforeRouteLeave(to, from, next) {
-    if (typeof this.beforeLeaveHook === 'function') {
-      let hookRes = this.beforeLeaveHook();
-      if (hookRes === false) {
-        next(false);
-      } else if (hookRes && hookRes.then) {
-        hookRes.then((flag) => {
-          next(flag);
-        });
-      } else {
-        next(true);
-      }
-    } else {
-      next(true);
-    }
-  },
+  
   created: function () {},
   mounted: function () {},
   beforeDestroy: function () {},
diff --git a/web/src/components/consoleComponent/result.vue b/web/src/components/consoleComponent/result.vue
index 6274439..9085288 100644
--- a/web/src/components/consoleComponent/result.vue
+++ b/web/src/components/consoleComponent/result.vue
@@ -169,7 +169,6 @@ import WeToolbar from './toolbar.vue';
 import elementResizeEvent from '@/common/helper/elementResizeEvent';
 import resultSetList from './resultSetList.vue';
 import filter from './filter.vue';
-import pinyin from 'pinyin';
 import dataWrangler from './dataWrangler.vue';
 import mixin from '@/common/service/mixin';
 /**
@@ -413,12 +412,6 @@ export default {
       if (charB === undefined || charB === null || charB === '' || charB === ' ' || charB === ' ') {
         return 1;
       }
-      if (!this.notChinese(charA)) {
-        charA = pinyin(charA)[0][0];
-      }
-      if (!this.notChinese(charB)) {
-        charB = pinyin(charB)[0][0];
-      }
       return charA.localeCompare(charB);
     },
     notChinese(char) {
diff --git a/web/src/dynamic-apps.js b/web/src/dynamic-apps.js
index 2600dc0..c239104 100644
--- a/web/src/dynamic-apps.js
+++ b/web/src/dynamic-apps.js
@@ -5,16 +5,16 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 import { merge } from 'lodash'
 import routes, { subAppRoutes } from "./dss/router"
 // 根据module参数配置要打包的应用,生成的虚拟模块
@@ -23,11 +23,7 @@ const apps = require('dynamic-modules')
 // length ===1 为单个子应用独立运行,否则为dss,包含多个子应用
 let subRoutes = subAppRoutes
 const appsRoutes = Object.values(apps.appsRoutes)
-if (apps.modules.length === 1) {
-  if (appsRoutes[0].subAppRoutes) {
-    subRoutes = appsRoutes[0].subAppRoutes
-  }
-}
+
 /**
  * * 工作流子应用:workflows和scriptis一起打包
  * * npm run build --module=scriptis,workflows --micro_module=workflows
@@ -39,24 +35,17 @@ if (apps.microModule) {
   if (apps.appsRoutes[apps.microModule].subAppRoutes) {
     subRoutes = apps.appsRoutes[apps.microModule].subAppRoutes
   }
-    
-  if (apps.microModule === 'workflows') {
-    subRoutes.redirect =  '/process'
-  }
 
 }
 if (appsRoutes) {
   appsRoutes.forEach(route => {
-    if (apps.microModule === 'apiServices' && route.apiServicesRoutes) {
-      subRoutes.children = subRoutes.children.concat(route.apiServicesRoutes)
-    } else {
-      subRoutes.children = subRoutes.children.concat(route.default)
-    }
+    subRoutes.children = subRoutes.children.concat(route.default)
   });
 }
 
 routes.unshift(subRoutes)
 
+console.log(routes)
 // 公共国际化
 const i18n = {
   'en': require('./common/i18n/en.json'),
@@ -74,4 +63,4 @@ export {
   routes,
   i18n,
   apps
-}
\ No newline at end of file
+}
diff --git a/web/src/main.js b/web/src/main.js
index 6819cc6..1eaf535 100644
--- a/web/src/main.js
+++ b/web/src/main.js
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/web/vue.config.js b/web/vue.config.js
index a609fc8..b2ad8df 100644
--- a/web/vue.config.js
+++ b/web/vue.config.js
@@ -18,7 +18,6 @@
 
 // vue.config.js
 const path = require('path')
-const fs = require('fs')
 const FileManagerPlugin = require('filemanager-webpack-plugin');
 const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
 // const CspHtmlWebpackPlugin = require('csp-html-webpack-plugin');
@@ -26,7 +25,7 @@ const VirtualModulesPlugin = require('webpack-virtual-modules');
 const apps = require('./src/config.json')
 
 const getVersion = () => {
-    return  process.env.VUE_APP_VERSION
+  return  process.env.VUE_APP_VERSION
 }
 
 // 指定module打包, 不指定则打包全部子应用

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org