1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"version":3,"sources":["webpack:///./src/views/layout/components/alarmList.vue?5331","webpack:///src/views/layout/components/alarmList.vue","webpack:///./src/views/layout/components/alarmList.vue?893c","webpack:///./src/views/layout/components/alarmList.vue","webpack:///./src/api/alarm.js","webpack:///./src/views/layout/components/alarmList.vue?8428"],"names":["render","_vm","this","_h","$createElement","_c","_self","alarmList","length","staticClass","_v","_s","$t","ref","_l","item","index","key","refInFor","getLevel","alarmLevel","deviceName","alarmInfo","_e","staticRenderFns","name","computed","cachedViews","$store","state","tagsView","$route","fullPath","filters","data","nowTime","disArr","mounted","getTipAlarmList","beforeDestroy","clearInterval","methods","val","setAlarmList","msgBox","offsetWidth","box","arr","moveLeft","getMargin","obj","marg","Number","setInterval","startDis","Math","abs","that","outbox","component","getDeptAlarmDetails","request","url","method","params","clearAlarmStatus","alarmId","getAlarmList","updateAlarmReadStatus","getDeviceLogList","getAlarmLevel","getAlarmStatus","getAlarmTypeLevel","getAlarmTypeStatus"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAQF,EAAIM,UAAUC,OAAS,EAAGH,EAAG,MAAM,CAACI,YAAY,mBAAmB,CAACJ,EAAG,MAAM,CAACI,YAAY,QAAQ,CAACJ,EAAG,IAAI,CAACI,YAAY,0BAA0BJ,EAAG,OAAO,CAACJ,EAAIS,GAAGT,EAAIU,GAAGV,EAAIW,GAAG,uBAAuB,SAASP,EAAG,MAAM,CAACQ,IAAI,SAASJ,YAAY,WAAW,CAACJ,EAAG,MAAM,CAACQ,IAAI,MAAMJ,YAAY,QAAQR,EAAIa,GAAIb,EAAa,WAAE,SAASc,EAAKC,GAAO,OAAOX,EAAG,MAAM,CAACY,IAAID,EAAMH,IAAI,OAAOK,UAAS,EAAKT,YAAY,OAAO,CAACJ,EAAG,OAAO,CAACJ,EAAIS,GA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QA,yBAAvBA,kBAIA,WC9HiX,I,wBCQ7WC,EAAY,eACd,EACA3D,EACAwB,GACA,EACA,KACA,WACA,MAIa,aAAAmC,E,6CCnBf,oWAIO,SAASC,EAAoB1B,GAClC,OAAO2B,eAAQ,CACbC,IAAK,gDACLC,OAAQ,MACRC,OAAQ9B,IAIL,SAAS+B,EAAiBC,GAC/B,OAAOL,eAAQ,CACbC,IAAK,gDAAkDI,EACvDH,OAAQ,SAeL,SAASI,EAAajC,GAC3B,OAAO2B,eAAQ,CACbC,IAAK,mCACLC,OAAQ,MACRC,OAAQ9B,IAKL,SAASI,EAAgBJ,GAC9B,OAAO2B,eAAQ,CACbC,IAAK,sCACLC,OAAQ,MACRC,OAAQ9B,IAML,SAASkC,EAAsBlC,GACpC,OAAO2B,eAAQ,CACbC,IAAK,4CACLC,OAAQ,OACRC,OAAQ9B,IAKL,SAASmC,EAAiBnC,GAC/B,OAAO2B,eAAQ,CACbC,IAAK,4CACLC,OAAQ,MACRC,OAAQ9B,IAQL,SAASoC,EAAcpC,GAC5B,OAAO2B,eAAQ,CACbC,IAAK,yCACLC,OAAQ,MACRC,OAAQ9B,IAgBL,SAASqC,EAAerC,GAC7B,OAAO2B,eAAQ,CACbC,IAAK,0CACLC,OAAQ,MACRC,OAAQ9B,IAML,SAASsC,EAAkBtC,GAChC,OAAO2B,eAAQ,CACbC,IAAK,6CACLC,OAAQ,MACRC,OAAQ9B,IAML,SAASuC,EAAmBvC,GACjC,OAAO2B,eAAQ,CACbC,IAAK,8CACLC,OAAQ,MACRC,OAAQ9B,M,2DClHZ","file":"js/chunk-0d87864c.b5cef838.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.alarmList.length > 0)?_c('div',{staticClass:\"alarm-container\"},[_c('div',{staticClass:\"name\"},[_c('i',{staticClass:\"iconfont icon-tongzhi\"}),_c('span',[_vm._v(_vm._s(_vm.$t(\"alarm.notification\"))+\":\")])]),_c('div',{ref:\"msgBox\",staticClass:\"msg-box\"},[_c('div',{ref:\"box\",staticClass:\"list\"},_vm._l((_vm.alarmList),function(item,index){return _c('div',{key:index,ref:\"list\",refInFor:true,staticClass:\"msg\"},[_c('span',[_vm._v(\" [\"+_vm._s(_vm.getLevel(item.alarmLevel))+\"] \"+_vm._s(item.deviceName + \": \" + item.alarmInfo)+\" \")])])}),0)])]):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <div class=\"alarm-container\" v-if=\"alarmList.length > 0\">\r\n <div class=\"name\">\r\n <i class=\"iconfont icon-tongzhi\" />\r\n <span>{{ $t(\"alarm.notification\") }}:</span>\r\n </div>\r\n <div class=\"msg-box\" ref=\"msgBox\">\r\n <div class=\"list\" ref=\"box\">\r\n <div\r\n v-for=\"(item, index) in alarmList\"\r\n :key=\"index\"\r\n class=\"msg\"\r\n ref=\"list\"\r\n >\r\n <span>\r\n [{{ getLevel(item.alarmLevel) }}]\r\n {{ item.deviceName + \": \" + item.alarmInfo }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n<script>\r\nimport { getTipAlarmList } from \"@/api/alarm\"\r\n\r\nexport default {\r\n name: \"AppMain\",\r\n computed: {\r\n cachedViews() {\r\n return this.$store.state.tagsView.cachedViews\r\n },\r\n key() {\r\n return this.$route.fullPath\r\n }\r\n },\r\n filters: {},\r\n data() {\r\n return {\r\n // 定时器标识\r\n nowTime: null,\r\n // 每一个内容的宽度\r\n disArr: [],\r\n alarmList: []\r\n }\r\n },\r\n\r\n mounted() {\r\n getTipAlarmList().then((e) => {\r\n this.alarmList = e.data.alarmList\r\n this.$nextTick(() => {\r\n this.setAlarmList()\r\n })\r\n })\r\n },\r\n beforeDestroy() {\r\n // 页面关闭清除定时器\r\n clearInterval(this.nowTime)\r\n // 清除定时器标识\r\n this.nowTime = null\r\n },\r\n methods: {\r\n getLevel(val) {\r\n // 验证是否为空\r\n if (val == 1) {\r\n return this.$t(\"alarm.leve1\")\r\n } else if (val == 2) {\r\n return this.$t(\"alarm.leve2\")\r\n } else if (val == 3) {\r\n return this.$t(\"alarm.leve3\")\r\n }\r\n },\r\n setAlarmList() {\r\n let item = this.$refs.list\r\n let msgBox = this.$refs.msgBox\r\n let box = this.$refs.box\r\n if (this.alarmList.length == 0) {\r\n return\r\n }\r\n if (msgBox.offsetWidth > box.offsetWidth) {\r\n return\r\n }\r\n let len = this.alarmList.length\r\n let arr = []\r\n // 因为设置的margin值一样,所以取第一个就行。\r\n let margin = this.getMargin(item[0])\r\n for (let i = 0; i < len; i++) {\r\n arr.push(item[i].clientWidth + margin) // 把宽度和 margin 加起来就是每一个元素需要移动的距离\r\n }\r\n this.disArr = arr\r\n this.moveLeft()\r\n },\r\n // 获取margin属性\r\n getMargin(obj) {\r\n let marg = window.getComputedStyle(obj, null)[\"margin-right\"]\r\n marg = marg.replace(\"px\", \"\")\r\n return Number(marg) // 强制转化成数字\r\n },\r\n // 移动的方法\r\n moveLeft() {\r\n let that = this\r\n let outbox = this.$refs.box\r\n // 初始位置\r\n let startDis = 0\r\n this.nowTime = setInterval(function () {\r\n startDis -= 0.5\r\n // console.log('初始化移动:', startDis)\r\n if (Math.abs(startDis) > Math.abs(that.disArr[0])) {\r\n // 每次移动完一个元素的距离,就把这个元素的宽度\r\n that.disArr.push(that.disArr.shift())\r\n // 每次移动完一个元素的距离,就把列表数据的第一项放到最后一项\r\n // console.log('that.alarmList: ', that.alarmList)\r\n // console.log('that.alarmList: ', that.alarmList.shift())\r\n that.alarmList.push(that.alarmList.shift())\r\n startDis = 0\r\n // console.log('移动')\r\n } else {\r\n // console.log('不来不来就不来...')\r\n }\r\n // 每次都让盒子移动指定的距离,在我自己做的项目中,这种字符串拼接的方法并没有生效\r\n // outbox.style = 'transform: translateX3d(' + startDis + 'px)'\r\n // 后面换了es6的模板字符串就可以了\r\n outbox.style = `transform: translateX(${startDis}px)`\r\n // outbox.style = 'transform: translateX(\\' + startDis + \\' px)'\r\n // outbox.style.marginLeft = 'startDis'\r\n // console.log('这里:', startDis)\r\n }, 1000 / 60)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style rel=\"stylesheet/scss\" lang=\"scss\" scoped>\r\n.alarm-container {\r\n font-size: 13px;\r\n font-family: Microsoft YaHei;\r\n font-weight: 400;\r\n color: #ff3936;\r\n height: 24px;\r\n line-height: 24px;\r\n position: absolute;\r\n display: flex;\r\n top: 57px;\r\n left: 810px;\r\n right: 20px;\r\n .name {\r\n font-size: 13px;\r\n font-family: Microsoft YaHei;\r\n font-weight: 400;\r\n color: #fffc7d;\r\n max-width: 150px;\r\n .iconfont {\r\n margin-right: 8px;\r\n }\r\n }\r\n}\r\n\r\n.msg-box {\r\n flex: 1;\r\n overflow: hidden;\r\n height: 28px;\r\n .list {\r\n white-space: nowrap;\r\n display: inline-block;\r\n .msg {\r\n margin-right: 10px;\r\n display: inline-block;\r\n font-size: 13px;\r\n text-indent: 20px;\r\n line-height: 28px;\r\n height: 28px;\r\n }\r\n }\r\n}\r\n</style>\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./alarmList.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./alarmList.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./alarmList.vue?vue&type=template&id=5cace76c&scoped=true&\"\nimport script from \"./alarmList.vue?vue&type=script&lang=js&\"\nexport * from \"./alarmList.vue?vue&type=script&lang=js&\"\nimport style0 from \"./alarmList.vue?vue&type=style&index=0&id=5cace76c&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"5cace76c\",\n null\n \n)\n\nexport default component.exports","import request from \"@/utils/request\";\r\n\r\n\r\n// 根据告警ID获取告警历史记录/告警工单信息\r\nexport function getDeptAlarmDetails(data) {\r\n return request({\r\n url: \"trajectory-service/deptAlarm/getTaskByAlarmId\",\r\n method: \"get\",\r\n params: data,\r\n });\r\n}\r\n// 清除告警状态\r\nexport function clearAlarmStatus(alarmId) {\r\n return request({\r\n url: \"alarm-service/alarm/clearAlarmStatus?alarmId=\" + alarmId,\r\n method: \"post\",\r\n });\r\n}\r\n\r\n\r\n// 获取告警设备类型列表\r\nexport function getAlarmDeviceTypeList() {\r\n return request({\r\n url: \"alarm-service/alarm/getAlarmDeviceTypeList\",\r\n method: \"get\",\r\n });\r\n}\r\n\r\n\r\n// 获取告警列表\r\nexport function getAlarmList(data) {\r\n return request({\r\n url: \"alarm-service/alarm/getAlarmList\",\r\n method: \"get\",\r\n params: data,\r\n });\r\n}\r\n\r\n// 获取提示告警列表\r\nexport function getTipAlarmList(data) {\r\n return request({\r\n url: \"alarm-service/alarm/getTipAlarmList\",\r\n method: \"get\",\r\n params: data,\r\n });\r\n}\r\n\r\n\r\n// 更新告警阅读状态\r\nexport function updateAlarmReadStatus(data) {\r\n return request({\r\n url: \"alarm-service/alarm/updateAlarmReadStatus\",\r\n method: \"post\",\r\n params: data,\r\n });\r\n}\r\n\r\n// 根据筛选条件查询设备操作信息\r\nexport function getDeviceLogList(data) {\r\n return request({\r\n url: 'device-service/deviceLog/getDeviceLogList',\r\n method: 'get',\r\n params: data\r\n })\r\n}\r\n\r\n\r\n\r\n \r\n// 查询故障等级状态-告警等级占比\r\nexport function getAlarmLevel(data) {\r\n return request({\r\n url: 'alarm-service/statistics/getAlarmLevel',\r\n method: 'get',\r\n params: data\r\n })\r\n}\r\n\r\n \r\n// 查询故障等级设备类型状态-告警等级分布\r\nexport function getAlarmLevelType(data) {\r\n return request({\r\n url: 'alarm-service/statistics/getAlarmLevelType',\r\n method: 'get',\r\n params: data\r\n })\r\n}\r\n \r\n\r\n// 查询故障状态-告警状态占比\r\nexport function getAlarmStatus(data) {\r\n return request({\r\n url: 'alarm-service/statistics/getAlarmStatus',\r\n method: 'get',\r\n params: data\r\n })\r\n} \r\n\r\n\r\n// 查询故障设备类型等级状态-设备告警等级分布\r\nexport function getAlarmTypeLevel(data) {\r\n return request({\r\n url: 'alarm-service/statistics/getAlarmTypeLevel',\r\n method: 'get',\r\n params: data\r\n })\r\n}\r\n\r\n\r\n// 查询故障设备类型状态-告警状态分布\r\nexport function getAlarmTypeStatus(data) {\r\n return request({\r\n url: 'alarm-service/statistics/getAlarmTypeStatus',\r\n method: 'get',\r\n params: data\r\n })\r\n}\r\n\r\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./alarmList.vue?vue&type=style&index=0&id=5cace76c&rel=stylesheet%2Fscss&lang=scss&scoped=true&\""],"sourceRoot":""} |