Browse Source

更新页面全局弹窗的功能

oyq28 3 years ago
parent
commit
032b263457
3 changed files with 135 additions and 143 deletions
  1. 120 118
      imcs-ui/package.json
  2. 14 25
      imcs-ui/src/layout/index.vue
  3. 1 0
      imcs-ui/src/main.js

+ 120 - 118
imcs-ui/package.json

@@ -1,118 +1,120 @@
-{
-  "name": "zuihou-ui",
-  "version": "1.0.0",
-  "description": "zuihou-admin-cloud 前端项目",
-  "author": "zuihou",
-  "license": "Apache 2.0",
-  "scripts": {
-    "dev": "vue-cli-service serve",
-    "build:prod": "vue-cli-service build",
-    "build:boot": "vue-cli-service build --mode boot",
-    "build:docker": "vue-cli-service build --mode docker",
-    "build:stage": "vue-cli-service build --mode staging",
-    "preview": "node build/index.js --preview",
-    "lint": "eslint --ext .js,.vue src",
-    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
-    "new": "plop"
-  },
-  "keywords": [
-    "vue",
-    "admin",
-    "dashboard",
-    "element-ui",
-    "management-system"
-  ],
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/zuihou/zuihou-ui"
-  },
-  "bugs": {
-    "url": "https://github.com/zuihou/zuihou-ui/issues"
-  },
-  "dependencies": {
-    "@riophae/vue-treeselect": "0.0.38",
-    "axios": "^0.21.4",
-    "chromedriver": "^79.0.0",
-    "clipboard": "2.0.4",
-    "codemirror": "^5.64.0",
-    "driver.js": "0.9.5",
-    "dropzone": "5.5.1",
-    "echarts": "^5.2.2",
-    "element-ui": "2.15.6",
-    "file-saver": "2.0.1",
-    "fuse.js": "3.4.4",
-    "jsbarcode": "^3.11.3",
-    "jsonlint": "1.6.3",
-    "jszip": "^3.7.1",
-    "moment": "^2.29.1",
-    "normalize.css": "7.0.0",
-    "nprogress": "0.2.0",
-    "path-to-regexp": "2.4.0",
-    "screenfull": "4.2.0",
-    "showdown": "^1.9.1",
-    "sortablejs": "1.8.4",
-    "spark-md5": "^3.0.1",
-    "tui-editor": "1.3.3",
-    "vue": "2.6.10",
-    "vue-count-to": "^1.0.13",
-    "vue-echarts": "^6.0.0-rc.5",
-    "vue-i18n": "7.3.2",
-    "vue-lazyload": "^1.3.3",
-    "vue-print-nb": "^1.6.0",
-    "vue-progressbar": "^0.7.5",
-    "vue-router": "3.0.2",
-    "vue-seamless-scroll": "^1.1.23",
-    "vue-simple-uploader": "^0.7.4",
-    "vue-splitpane": "1.0.4",
-    "vuedraggable": "2.20.0",
-    "vuescroll": "^4.17.3",
-    "vuex": "3.1.0",
-    "xlsx": "^0.17.4"
-  },
-  "devDependencies": {
-    "@babel/core": "7.0.0",
-    "@babel/register": "7.0.0",
-    "@vue/cli-plugin-babel": "3.5.3",
-    "@vue/cli-plugin-eslint": "3.5.1",
-    "@vue/cli-plugin-unit-jest": "^3.9.0",
-    "@vue/cli-service": "3.5.3",
-    "@vue/test-utils": "1.0.0-beta.29",
-    "autoprefixer": "^9.5.1",
-    "babel-core": "7.0.0-bridge.0",
-    "babel-eslint": "10.0.1",
-    "babel-jest": "23.6.0",
-    "chalk": "2.4.2",
-    "chokidar": "2.1.5",
-    "compression-webpack-plugin": "^1.1.12",
-    "connect": "3.6.6",
-    "eslint": "5.15.3",
-    "eslint-plugin-vue": "5.2.2",
-    "html-webpack-plugin": "3.2.0",
-    "husky": "1.3.1",
-    "less": "^3.13.1",
-    "less-loader": "^5.0.0",
-    "lint-staged": "8.1.5",
-    "mockjs": "1.0.1-beta3",
-    "node-sass": "^4.14.1",
-    "sass-loader": "^7.1.0",
-    "plop": "2.3.0",
-    "pug": "^3.0.2",
-    "pug-plain-loader": "^1.1.0",
-    "qs": "^6.10.2",
-    "runjs": "^4.3.2",
-    "script-ext-html-webpack-plugin": "2.1.3",
-    "script-loader": "0.7.2",
-    "serve-static": "^1.13.2",
-    "svg-sprite-loader": "4.1.3",
-    "svgo": "1.2.0",
-    "vue-template-compiler": "2.6.10"
-  },
-  "engines": {
-    "node": ">=8.9",
-    "npm": ">= 3.0.0"
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions"
-  ]
-}
+{
+  "name": "zuihou-ui",
+  "version": "1.0.0",
+  "description": "zuihou-admin-cloud 前端项目",
+  "author": "zuihou",
+  "license": "Apache 2.0",
+  "scripts": {
+    "dev": "vue-cli-service serve",
+    "build:prod": "vue-cli-service build",
+    "build:boot": "vue-cli-service build --mode boot",
+    "build:docker": "vue-cli-service build --mode docker",
+    "build:stage": "vue-cli-service build --mode staging",
+    "preview": "node build/index.js --preview",
+    "lint": "eslint --ext .js,.vue src",
+    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
+    "new": "plop"
+  },
+  "keywords": [
+    "vue",
+    "admin",
+    "dashboard",
+    "element-ui",
+    "management-system"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/zuihou/zuihou-ui"
+  },
+  "bugs": {
+    "url": "https://github.com/zuihou/zuihou-ui/issues"
+  },
+  "dependencies": {
+    "@kugatsu/vuenotification": "^1.1.4",
+    "@riophae/vue-treeselect": "0.0.38",
+    "axios": "^0.21.4",
+    "chromedriver": "^79.0.0",
+    "clipboard": "2.0.4",
+    "codemirror": "^5.64.0",
+    "driver.js": "0.9.5",
+    "dropzone": "5.5.1",
+    "echarts": "^5.2.2",
+    "element-ui": "2.15.6",
+    "file-saver": "2.0.1",
+    "fuse.js": "3.4.4",
+    "gsap": "^3.10.2",
+    "jsbarcode": "^3.11.3",
+    "jsonlint": "1.6.3",
+    "jszip": "^3.7.1",
+    "moment": "^2.29.1",
+    "normalize.css": "7.0.0",
+    "nprogress": "0.2.0",
+    "path-to-regexp": "2.4.0",
+    "screenfull": "4.2.0",
+    "showdown": "^1.9.1",
+    "sortablejs": "1.8.4",
+    "spark-md5": "^3.0.1",
+    "tui-editor": "1.3.3",
+    "vue": "2.6.10",
+    "vue-count-to": "^1.0.13",
+    "vue-echarts": "^6.0.0-rc.5",
+    "vue-i18n": "7.3.2",
+    "vue-lazyload": "^1.3.3",
+    "vue-print-nb": "^1.6.0",
+    "vue-progressbar": "^0.7.5",
+    "vue-router": "3.0.2",
+    "vue-seamless-scroll": "^1.1.23",
+    "vue-simple-uploader": "^0.7.4",
+    "vue-splitpane": "1.0.4",
+    "vuedraggable": "2.20.0",
+    "vuescroll": "^4.17.3",
+    "vuex": "3.1.0",
+    "xlsx": "^0.17.4"
+  },
+  "devDependencies": {
+    "@babel/core": "7.0.0",
+    "@babel/register": "7.0.0",
+    "@vue/cli-plugin-babel": "3.5.3",
+    "@vue/cli-plugin-eslint": "3.5.1",
+    "@vue/cli-plugin-unit-jest": "^3.9.0",
+    "@vue/cli-service": "3.5.3",
+    "@vue/test-utils": "1.0.0-beta.29",
+    "autoprefixer": "^9.5.1",
+    "babel-core": "7.0.0-bridge.0",
+    "babel-eslint": "10.0.1",
+    "babel-jest": "23.6.0",
+    "chalk": "2.4.2",
+    "chokidar": "2.1.5",
+    "compression-webpack-plugin": "^1.1.12",
+    "connect": "3.6.6",
+    "eslint": "5.15.3",
+    "eslint-plugin-vue": "5.2.2",
+    "html-webpack-plugin": "3.2.0",
+    "husky": "1.3.1",
+    "less": "^3.13.1",
+    "less-loader": "^5.0.0",
+    "lint-staged": "8.1.5",
+    "mockjs": "1.0.1-beta3",
+    "node-sass": "^4.14.1",
+    "sass-loader": "^7.1.0",
+    "plop": "2.3.0",
+    "pug": "^3.0.2",
+    "pug-plain-loader": "^1.1.0",
+    "qs": "^6.10.2",
+    "runjs": "^4.3.2",
+    "script-ext-html-webpack-plugin": "2.1.3",
+    "script-loader": "0.7.2",
+    "serve-static": "^1.13.2",
+    "svg-sprite-loader": "4.1.3",
+    "svgo": "1.2.0",
+    "vue-template-compiler": "2.6.10"
+  },
+  "engines": {
+    "node": ">=8.9",
+    "npm": ">= 3.0.0"
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions"
+  ]
+}

+ 14 - 25
imcs-ui/src/layout/index.vue

@@ -54,7 +54,10 @@ export default {
         withoutAnimation: this.sidebar.withoutAnimation,
         withoutAnimation: this.sidebar.withoutAnimation,
         mobile: this.device === 'mobile'
         mobile: this.device === 'mobile'
       }
       }
-    }
+    },
+    websocketMsg() {
+	      return this.$store.getters.STAFF_UPDATE.msg
+	  },
   },
   },
   watch: {
   watch: {
 	  	websocketMsg(curVal, oldVal) {
 	  	websocketMsg(curVal, oldVal) {
@@ -63,39 +66,26 @@ export default {
 	    }
 	    }
 	},
 	},
   mounted() {
   mounted() {
-    // 判断长连接,是否已经开启
+    // 判断长连接,是否已经开启      
 	  	if(this.$store.state.websocket.websock == null){
 	  	if(this.$store.state.websocket.websock == null){
 	  		// 页面刚进入时开启长连接
 	  		// 页面刚进入时开启长连接
-    		this.$store.dispatch('STAFF_WEBSOCKET')			
-	  	}
-      this.$nextTick(()=> {
-        //let obj = JSON.parse(this.$store.getters.STAFF_UPDATE.msg);
-        //this.openMessageTips(obj);
-      });
+    		this.$store.dispatch('STAFF_WEBSOCKET')	        
+	  	}      
   },
   },
-  // 销毁
-	destroyed() {
-	    this.websocketClose()
-	},
   methods: {
   methods: {
     handleClickOutside() {
     handleClickOutside() {
       this.$store.commit('setting/closeSidebar', { withoutAnimation: false })
       this.$store.commit('setting/closeSidebar', { withoutAnimation: false })
     },
     },
-    websocketMsg() {		  
-	      return this.$store.getters.STAFF_UPDATE.msg
-	  },
-    openMessageTips(data){      //排除数字大屏
-      
+    openMessageTips(data){      //排除数字大屏         
       if(this.$route.fullPath.indexOf("/largeScreen/twoDatasModel")<0){
       if(this.$route.fullPath.indexOf("/largeScreen/twoDatasModel")<0){
         console.log("接收websocket的推送信息 == ", data)        
         console.log("接收websocket的推送信息 == ", data)        
-        if(data!=null && data.type == 'PUSH_TYPE_DATA_SCREEN'){
+        if(data!=null && data.type == 'PUSH_TYPE_DATA_SCREEN'){          
           this.$nextTick(()=> {
           this.$nextTick(()=> {
-              let datas = data.data.warnMap.warnData.records
-              let that = this
-              datas.map((data)=>{
+              let datas = data.data.warnMap.warnData.records              
+              datas.forEach((data)=>{
                   let msg = data.feedback ? data.feedback : " 响应超时 ";
                   let msg = data.feedback ? data.feedback : " 响应超时 ";
-                  let content = "["+ data.resourceName +"] "+data.procedureName+"("+data.instructionName+")" + msg;
-                  this.$notification.error(content, { timer: 10, title:"异常警报", showCloseIcn:true });
+                  let content = "["+ data.resourceName +"] "+ data.procedureName +"("+data.instructionName+")" + msg;
+                  this.$notification.error(content, { infiniteTimer: false, timer:60, title:"异常警报", showCloseIcn:true });
               })
               })
           });
           });
         }
         }
@@ -111,8 +101,7 @@ export default {
 	    },
 	    },
 	  	// websocket信息变更
 	  	// websocket信息变更
 	  onmessage() {
 	  onmessage() {
-	      this.$store.getters.STAFF_UPDATE.websock.onmessage = function(evt) {
-	        console.log(evt)
+	      this.$store.getters.STAFF_UPDATE.websock.onmessage = function(evt) {	       
 		     	console.log("websocket获取数据==="+evt)
 		     	console.log("websocket获取数据==="+evt)
 	      }
 	      }
 	  },
 	  },

+ 1 - 0
imcs-ui/src/main.js

@@ -25,6 +25,7 @@ import uploader from 'vue-simple-uploader'
 import VueLazyload from 'vue-lazyload'
 import VueLazyload from 'vue-lazyload'
 // 日期格式化
 // 日期格式化
 import $moment from 'moment' //引入文件
 import $moment from 'moment' //引入文件
+$moment.suppressDeprecationWarnings = true;
 Vue.use($moment);//赋值使用。this.$moment()
 Vue.use($moment);//赋值使用。this.$moment()
 
 
 // 打印
 // 打印