From 75875b31351cdbaf5d6ff5fe977d09765c71175f Mon Sep 17 00:00:00 2001 From: ccc Date: Fri, 25 Mar 2022 08:46:38 +0800 Subject: [PATCH] update --- .../CenterBottomChartsComponets.vue | 84 ++----------------- .../ChartsComponents/LeftBottomChart.vue | 4 +- src/utils/config.js | 5 +- src/utils/websocket_service.js | 6 +- .../FacilityManagement/FacilityLists.vue | 9 +- src/views/MainPage.vue | 2 +- src/views/SystemSetting/RoleManagement.vue | 2 +- vue.config.js | 5 +- 8 files changed, 25 insertions(+), 92 deletions(-) diff --git a/src/components/ChartsComponents/CenterBottomChartsComponets.vue b/src/components/ChartsComponents/CenterBottomChartsComponets.vue index 843c338..d01ac0c 100644 --- a/src/components/ChartsComponents/CenterBottomChartsComponets.vue +++ b/src/components/ChartsComponents/CenterBottomChartsComponets.vue @@ -3,36 +3,15 @@
- - -
-

-

- -
@@ -59,15 +38,15 @@ box-sizing: border-box; " > - + /> { - return { data: item['data'] } - }) - const pNode = document.querySelector( - '#item0c8d4c81-9b92-11ec-b6db-9f277d23970e p' - ) - pNode.innerHTML = data[0].data - if (/\ \;/.test(data[0].data) || /\
{ @@ -100,7 +100,7 @@ export default { const codeFooter = '\nreturn option; \n }' // 拿到可见的配置项代码 进行拼接 const code0 = - "option = {\n title: {\n // text: '报警总次数周分析',\n subtext: 'Fake Data'\n },\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'cross'\n }\n },\n toolbox: {\n show: true,\n feature: {\n saveAsImage: {}\n }\n },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n // prettier-ignore\n data: ['1月15日','1月16日','1月17日','1月18日','1月19日','1月20日','1月21日']\n },\n yAxis: {\n type: 'value',\n axisLabel: {\n formatter: '{value} 次'\n },\n axisPointer: {\n snap: true\n }\n },\n visualMap: {\n show: false,\n dimension: 0,\n pieces: [\n {\n lte: 6,\n color: 'green'\n },\n {\n gt: 6,\n lte: 8,\n color: 'green'\n },\n {\n gt: 8,\n lte: 14,\n color: 'green'\n },\n {\n gt: 14,\n lte: 17,\n color: 'green'\n },\n {\n gt: 17,\n color: 'green'\n }\n ]\n },\n series: [\n {\n name: '报警总次数',\n type: 'line',\n smooth: true,\n // prettier-ignore\n data: [20,18,30,34,15,18,25],\n }\n ]\n};" + "option = {\n title: {\n // text: '报警总次数分析',\n subtext: 'Fake Data'\n },\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'cross'\n }\n },\n toolbox: {\n show: true,\n feature: {\n saveAsImage: {}\n }\n },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n // prettier-ignore\n data: ['1月15日','1月16日','1月17日','1月18日','1月19日','1月20日','1月21日']\n },\n yAxis: {\n type: 'value',\n axisLabel: {\n formatter: '{value} 次'\n },\n axisPointer: {\n snap: true\n }\n },\n visualMap: {\n show: false,\n dimension: 0,\n pieces: [\n {\n lte: 6,\n color: 'green'\n },\n {\n gt: 6,\n lte: 8,\n color: 'green'\n },\n {\n gt: 8,\n lte: 14,\n color: 'green'\n },\n {\n gt: 14,\n lte: 17,\n color: 'green'\n },\n {\n gt: 17,\n color: 'green'\n }\n ]\n },\n series: [\n {\n name: '报警总次数',\n type: 'line',\n smooth: true,\n // prettier-ignore\n data: [20,18,30,34,15,18,25],\n }\n ]\n};" const code = codeHeader + code0 + codeFooter const codeFunction = { init: eval('(' + code + ')') } const option = codeFunction.init(echarts, this.myChart, this.chartDom) diff --git a/src/utils/config.js b/src/utils/config.js index 54449ce..4744ed0 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -1,2 +1,3 @@ -const baseUrl = '192.168.0.110:2011/' -export default baseUrl +module.exports = { + baseUrl: '192.168.1.102:2011' +} diff --git a/src/utils/websocket_service.js b/src/utils/websocket_service.js index 6ab6af3..5df5d0c 100644 --- a/src/utils/websocket_service.js +++ b/src/utils/websocket_service.js @@ -1,6 +1,6 @@ // import store from '../store' -import baseUrl from '@/utils/config' +import { baseUrl } from '@/utils/config' import { Message } from 'element-ui' export default class SocketService { /* 单例模式 */ @@ -11,7 +11,6 @@ static get Instance() { } return this.instance } - // 和服务端连接的socket对象 ws = null // 存储回调函数 @@ -33,8 +32,7 @@ connect() { /* if (!Window.WebSocket) { return console.log('您的浏览器不支持WebSocket') } */ - // this.ws = new WebSocket('ws://localhost:2000/WebSocket/1') // Websocket ip+端口 - this.ws = new WebSocket(`ws://${baseUrl}WebSocket/1`) // Websocket ip+端口 + this.ws = new WebSocket(`ws://${baseUrl}/WebSocket/1`) // Websocket ip+端口 // 连接成功 this.ws.onopen = () => { Message.success('WebSocket连接成功') diff --git a/src/views/FacilityManagement/FacilityLists.vue b/src/views/FacilityManagement/FacilityLists.vue index faf48a6..4917964 100644 --- a/src/views/FacilityManagement/FacilityLists.vue +++ b/src/views/FacilityManagement/FacilityLists.vue @@ -526,7 +526,8 @@ export default { }, methods: { // 数据获取 - getData() {}, + getData() { + }, // 分页 change(val) { this.pager.currenPage = val @@ -562,7 +563,8 @@ export default { } }, // 确认编辑设备信息(弹框内) - handleModify() {}, + handleModify() { + }, // 查看设备操作信息 seeInfo() { this.titleOfDialog = '查看设备操作' @@ -576,7 +578,8 @@ export default { this.operationDialogVisible = true }, // 确认编辑设备操作 - modifyEquipmentOperation() {} + modifyEquipmentOperation() { + } } } diff --git a/src/views/MainPage.vue b/src/views/MainPage.vue index 9b014c1..90d749e 100644 --- a/src/views/MainPage.vue +++ b/src/views/MainPage.vue @@ -804,7 +804,7 @@ export default { } } // 指定文字的数据 - let data = [{ data: '自定义' }] + let data = [{ data: '上个月' }] // 映射 data = data.map((item) => { diff --git a/src/views/SystemSetting/RoleManagement.vue b/src/views/SystemSetting/RoleManagement.vue index f17521e..dac27df 100644 --- a/src/views/SystemSetting/RoleManagement.vue +++ b/src/views/SystemSetting/RoleManagement.vue @@ -291,7 +291,7 @@ export default { } const res = await getRoleData(query) if (res.code === 200) { - this.pager.pageSize = JSON.parse(JSON.stringify(res.data.result.totalPage)) * 10 + this.pager.totalPage = JSON.parse(JSON.stringify(res.data.result.totalPage)) * 10 this.tableData = res.data.result.tableData } this.loading = false diff --git a/vue.config.js b/vue.config.js index 3f3a0d8..f10ae64 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,3 +1,4 @@ +const { baseUrl } = require('./src/utils/config') module.exports = { lintOnSave: false, publicPath: '/', @@ -15,9 +16,7 @@ module.exports = { // proxy: 'http://localhost:8080' // 配置跨域处理,只有一个代理 proxy: { // 配置多个代理 '/api': { - // target: 'http://192.168.0.110:2011/', // 数据请求接口 - // target: 'http://192.168.31.231:2011/', // 数据请求接口 - target: 'http://10.168.14.235:2011/', // 数据请求接口 + target: `http://${baseUrl}/`, // 数据请求接口 changeOrigin: true, ws: true, // websocket支持 secure: false, -- Gitee