Просмотр исходного кода

1、实现关闭页面询问的功能

周兴 2 лет назад
Родитель
Сommit
404fc39aa6

+ 2 - 2
.env.dev

@@ -1,11 +1,11 @@
 NODE_ENV = 'development'
 VUE_APP_BUILD_TYPE='dev'
 VUE_APP_SERVER_URL='http://localhost:6001'
-VUE_APP_UPLOAD_URL='http://localhost:6001/mdm-server/file/upload'
+VUE_APP_UPLOAD_URL='http://localhost:6001/basic-server/file/upload'
 VUE_APP_EXPORT_URL='http://localhost:5000/'
 VUE_APP_EXPORT_SQL_URL='http://s.dev01.dkiboss.com:6010/custom-report-sql.sql'
 VUE_APP_LOGS_URL='https://ibossmp.dongkesoft.com:7050/logs'
-VUE_APP_IMG_URL='http://localhost:5000'
+VUE_APP_IMG_URL='https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/'
 VUE_APP_HG_IMG_URL='https://haip-dev.oss-cn-shenzhen.aliyuncs.com/'
 VUE_APP_WEBSOCKET_URL='ws://localhost:1015/websocket/'
 VUE_APP_LOGIN_PAGE_NAME=["login"]

+ 6 - 5
src/components/main/components/tags-nav/tags-nav.vue

@@ -160,12 +160,13 @@ export default {
      */
     handleTagsOption(type) {
       if (type.includes('all')) {
-        // 关闭所有,除了home
-        let res = this.list.filter(item => item.name === this.$config.homeName)
+        console.log('bdd',this.list)
+        // 关闭所有,除了home 有提示信息的页面不关
+        let res = this.list.filter(item => item.name === this.$config.homeName || item.meta.closeQuestion)
         this.$emit('on-close', res, 'all')
       } else if (type.includes('others')) {
         // 关闭除当前页和home页的其他页
-        let res = this.list.filter(item => routeEqual(this.currentRightRouteObj, item) || item.name === this.$config.homeName)
+        let res = this.list.filter(item => routeEqual(this.currentRightRouteObj, item) || item.name === this.$config.homeName ||item.meta.closeQuestion)
         this.$emit('on-close', res, 'others', this.currentRightRouteObj)
         setTimeout(() => {
           this.getTagElementByRoute(this.currentRightRouteObj)
@@ -178,7 +179,7 @@ export default {
         // 关闭左侧除当前页和home页的其他页
         this.list.forEach(item => {
           //首页需要放进去
-          if (item.name === this.$config.homeName) {
+          if (item.name === this.$config.homeName || item.meta.closeQuestion) {
             list.push(item.name);
             res.push(item);
           }
@@ -204,7 +205,7 @@ export default {
         // 关闭左侧除当前页和home页的其他页
         this.list.forEach(item => {
           //从当前页进行记录
-          if (flag) {
+          if (flag || item.meta.closeQuestion) {
             list.push(item.name);
             res.push(item);
           }

+ 30 - 5
src/components/main/main.vue

@@ -263,6 +263,31 @@ export default {
      * @date   : 2022/4/2 21:02
      */
     handleCloseTag(res, type, route) {
+      // 如果当前页面需要是关闭提示,需要给出question询问
+      if (type === undefined && this.$route.meta && this.$route.meta.closeQuestion) {
+        this.$IBMessage({
+            content: this.$t('Q_002', {'param': this.$v('close')}),
+            title: this.$t('systemQuestion')
+          },
+          {
+            ok: () => {
+              // 执行关闭,页面跳转操作
+              this._turnToPage(res, type, route);
+            },
+            cancel:()=>{
+            }
+          })
+      } else {
+        // 执行关闭,页面跳转操作
+        this._turnToPage(res, type, route);
+      }
+    },
+    /**
+     * @desc   : 执行跳转页面
+     * @author : 周兴
+     * @date   : 2023/7/14 17:09
+     */
+    _turnToPage(res, type, route) {
       //关闭当前
       if (type === undefined) {
         if (routeEqual(this.$route, route)) {
@@ -350,9 +375,9 @@ export default {
       if (event.keyCode === 122) {
         event.returnValue = false;
         this.enterFullScreen(); //这里方的是触发全屏的方法
-      }else if(event.keyCode === 13){
+      } else if (event.keyCode === 13) {
         // 如果是多行文本不用拦截
-        if(event.target.type != 'textarea'){
+        if (event.target.type != 'textarea') {
           event.returnValue = false;
         }
       }
@@ -405,10 +430,10 @@ export default {
       this.setBreadCrumb(newRoute)
       this.setTagNavList(getNewTagList(this.tagNavList, newRoute))
     },
-    maxFlag(n,o){
+    maxFlag(n, o) {
       // 如果最小化时记录
-      if(!n){
-        localSave('restore','restore')
+      if (!n) {
+        localSave('restore', 'restore')
       }
     }
   },

+ 3 - 2
src/libs/tools/user-tools.js

@@ -281,8 +281,9 @@ function _setMenuItem(item) {
     parentPath: item.parentPath,
     menuUuid:item.menuUuid,
     levelCode:item.levelCode,
-    // 默认空值 需要缓存  如果不需要混存 数据库的menuTags:{"notCache": true}
-    notCache: item.menuTags == undefined?false:JSON.parse(item.menuTags.value).notCache,
+    // 是否需要关闭询问
+    closeQuestion:item.menuTags == undefined?false:JSON.parse(item.menuTags.value).closeQuestion,
+    notCache: true,
     appCode:item.appCode
   }
   return item;

+ 25 - 0
src/mixins/form.js

@@ -237,6 +237,31 @@ export const formMixin = {
      * @date   : 2022/6/21 19:18
      */
     close(nextRoute) {
+      // 判断页面是否需要关闭提示
+      if (this.$route.meta && this.$route.meta.closeQuestion) {
+        this.$IBMessage({
+            content: this.$t('Q_002', {'param': this.$v('close')}),
+            title: this.$t('systemQuestion')
+          },
+          {
+            ok: () => {
+              // 执行关闭
+              this._close(nextRoute);
+            },
+            cancel:()=>{
+            }
+          })
+      }else{
+        // 执行关闭
+        this._close(nextRoute);
+      }
+    },
+    /**
+     * @desc   : 执行关闭窗体
+     * @author : 周兴
+     * @date   : 2023/7/14 17:33
+     */
+    _close(nextRoute){
       this.editKeys = [];
       this.formData = {};
       this.closeTag(this.$route);

+ 0 - 1
src/mixins/index.js

@@ -118,7 +118,6 @@ export const indexMixin = {
       if (!routeUrl || !routeUrl.key) {
         return;
       }
-      console.log('bbb',isMustChooseFlag)
       let name = routeUrl.key
       let url = routeUrl.url
       let chooseKeys = tableRef ? this.$refs[tableRef]?.batchKeys : []