From e5cda0c4c1607bd390a88caf0ecc1e71e89c7bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LI-CCONG=5C=E6=9D=8E=E8=81=AA=E8=81=AA?= <1441652193@qq.com> Date: Thu, 16 Nov 2023 08:33:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E4=BC=AA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../echart/bottom/bottomLeftChart/index.vue | 141 ++++- .../echart/bottom/bottomRightChart/index.vue | 196 ++++-- .../echart/center/centerChartRate/index.vue | 2 +- yuhong-ui/src/utils/requestConfig.js | 3 +- yuhong-ui/src/views/bottomRight.vue | 215 ++++--- yuhong-ui/src/views/center.vue | 40 +- yuhong-ui/src/views/centerLeft1.vue | 575 ++++++++++++------ yuhong-ui/src/views/centerRight1.vue | 4 +- yuhong-ui/src/views/index.vue | 15 +- 9 files changed, 793 insertions(+), 398 deletions(-) diff --git a/yuhong-ui/src/components/echart/bottom/bottomLeftChart/index.vue b/yuhong-ui/src/components/echart/bottom/bottomLeftChart/index.vue index 82d542c..e51010a 100644 --- a/yuhong-ui/src/components/echart/bottom/bottomLeftChart/index.vue +++ b/yuhong-ui/src/components/echart/bottom/bottomLeftChart/index.vue @@ -91,25 +91,127 @@ export default { // 根据自己的业务情况修改 setData() { const _this = this - request({ - // 各产品生产数量api路径 - url: '/api/BigScreen/getMonthData', - method: 'get' - }).then(r => { - // debugger - // console.log(r.data.ProductQty) - // if (r) { - // _this.cdata = r.data.ProductQty + // request({ + // // 各产品生产数量api路径 + // url: '/api/BigScreen/getMonthData', + // method: 'get' + // }).then(r => { + // // debugger + // // console.log(r.data.ProductQty) + // // if (r) { + // // _this.cdata = r.data.ProductQty - // } - if (r) { - _this.cdata = r.data.ProductQty - this.cdata.series.forEach(i => { - i.type = 'bar' - i.emphasis = { - focus: 'series' - } - }) + // // } + // if (r) { + // _this.cdata = r.data.ProductQty + // this.cdata.series.forEach(i => { + // i.type = 'bar' + // i.emphasis = { + // focus: 'series' + // } + // }) + // } + // }) + + _this.cdata = { + "xAxis": { + "type": "category", + "data": [ + "11-09", + "11-10", + "11-11", + "11-12", + "11-13", + "11-14", + "11-15" + ] + }, + "series": [ + { + "name": "卫生巾", + "type": "bar", + "data": [ + 617123, + 620893, + 610171, + 609700, + 628225, + 620343, + 290895 + ] + }, + { + "name": "纸尿裤", + "type": "bar", + "data": [ + 240724, + 244698, + 210171, + 209700, + 228818, + 256812, + 213227, + ] + }, + { + "name": "经期裤", + "type": "bar", + "data": [ + 442344, + 445735, + 421467, + 417019, + 431023, + 405409, + 215090, + ] + }, + { + "name": "拉拉裤", + "type": "bar", + "data": [ + 263005, + 241245, + 239953, + 281388, + 226385, + 216700, + 102300, + ] + }, + { + "name": "平面口罩", + "type": "bar", + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + { + "name": "KN95-1", + "type": "bar", + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + } + ] + } + + this.cdata.series.forEach(i => { + i.type = 'bar' + i.emphasis = { + focus: 'series' } }) } @@ -117,5 +219,4 @@ export default { } - + diff --git a/yuhong-ui/src/components/echart/bottom/bottomRightChart/index.vue b/yuhong-ui/src/components/echart/bottom/bottomRightChart/index.vue index 20ec93c..c42ed71 100644 --- a/yuhong-ui/src/components/echart/bottom/bottomRightChart/index.vue +++ b/yuhong-ui/src/components/echart/bottom/bottomRightChart/index.vue @@ -34,77 +34,142 @@ export default { }, mounted() { this.setData() - this.startInterval() + // this.startInterval() }, methods: { // 开启定时器 - startInterval() { - const _this = this - // 应通过接口获取配置时间,暂时写死10s - const time = 80 * 10 * 1000 - if (this.intervalId !== null) { - clearInterval(this.intervalId) - } - this.intervalId = setInterval(() => { - _this.setData() - }, time) - }, + // startInterval() { + // const _this = this + // // 应通过接口获取配置时间,暂时写死10s + // const time = 80 * 10 * 1000 + // if (this.intervalId !== null) { + // clearInterval(this.intervalId) + // } + // this.intervalId = setInterval(() => { + // _this.setData() + // }, time) + // }, // 根据自己的业务情况修改 setData() { const _this = this - request({ - // 各产品生产数量api路径 - url: '/api/BigScreen/getMonthData1', - method: 'get' - }).then((r) => { - // debugger - if (r) { - _this.cdata = r.data.EqmtRate - // console.log('zzzzzzzzzzzzz') - // console.log(this.cdata) - // this.cdata.xAxis.data = [ - // ...this.cdata.xAxis.data, - // "5#", - // "7#", - // "8#", - // "20#", - // "21#", - // ]; - this.cdata.series.forEach((i) => { - // i.data = [...i.data, 0, 0, 0, 0, 0]; - i.data.map((item, index, self) => { - i.data[index] = Math.trunc(item) - }) - i.type = 'bar' - i.markLine = { - focus: 'series' - } - i.label = { - show: true, // 开启显示 - position: 'top', // 在上方显示 - textStyle: { - // 数值样式 - color: 'white', - fontSize: 14 - } - } - var colorList = [] - for (const item of i.data) { - if (item > 85) { - colorList.push('#19BB65') - } else { - colorList.push('red') - } - } - i.itemStyle = { - color: function(params) { - if (params.dataIndex >= colorList.length) { - params.dataIndex = params.dataIndex - colorList.length - } - return colorList[params.dataIndex] - } + // request({ + // // 各产品生产数量api路径 + // url: '/api/BigScreen/getMonthData1', + // method: 'get' + // }).then((r) => { + // // debugger + // if (r) { + // _this.cdata = r.data.EqmtRate + // this.cdata.series.forEach((i) => { + // // i.data = [...i.data, 0, 0, 0, 0, 0]; + // i.data.map((item, index, self) => { + // i.data[index] = Math.trunc(item) + // }) + // i.type = 'bar' + // i.markLine = { + // focus: 'series' + // } + // i.label = { + // show: true, // 开启显示 + // position: 'top', // 在上方显示 + // textStyle: { + // // 数值样式 + // color: 'white', + // fontSize: 14 + // } + // } + // var colorList = [] + // for (const item of i.data) { + // if (item > 85) { + // colorList.push('#19BB65') + // } else { + // colorList.push('red') + // } + // } + // i.itemStyle = { + // color: function(params) { + // if (params.dataIndex >= colorList.length) { + // params.dataIndex = params.dataIndex - colorList.length + // } + // return colorList[params.dataIndex] + // } + // } + // }) + // } + // }) + // + _this.cdata = { + xAxis: { + "type": "category", + "data": [ + "7#", + "13#", + "15#", + "16#", + "17#", + "18#", + "19#", + "21#", + "平面口罩", + "KN95-1", + "KN95-2" + ] + }, + yAxis: { + type: 'value' + }, + series: [ + { + "smooth": true, + "type": "line", + "data": [ + 97.21, + 0, + 0, + 96.75, + 95.91, + 98.22, + 97.67, + 98.17, + 0, + 0, + 0 + ] + } + ] + } + this.cdata.series.forEach((i) => { + i.data.map((item, index, self) => { + i.data[index] = Math.trunc(item) + }) + i.type = 'bar' + i.markLine = { + focus: 'series' + } + i.label = { + show: true, // 开启显示 + position: 'top', // 在上方显示 + textStyle: { + // 数值样式 + color: 'white', + fontSize: 14 + } + } + var colorList = [] + for (const item of i.data) { + if (item > 85) { + colorList.push('#19BB65') + } else { + colorList.push('red') + } + } + i.itemStyle = { + color: function (params) { + if (params.dataIndex >= colorList.length) { + params.dataIndex = params.dataIndex - colorList.length } - }) + return colorList[params.dataIndex] + } } }) } @@ -112,5 +177,4 @@ export default { } - + diff --git a/yuhong-ui/src/components/echart/center/centerChartRate/index.vue b/yuhong-ui/src/components/echart/center/centerChartRate/index.vue index 4db74a7..fd8f9eb 100644 --- a/yuhong-ui/src/components/echart/center/centerChartRate/index.vue +++ b/yuhong-ui/src/components/echart/center/centerChartRate/index.vue @@ -52,7 +52,7 @@ export default { // tips 是会变更的数据,所以进行监听 tips: { handler(newData) { - debugger + // debugger this.options = { series: [ { diff --git a/yuhong-ui/src/utils/requestConfig.js b/yuhong-ui/src/utils/requestConfig.js index bfa9748..e36a815 100644 --- a/yuhong-ui/src/utils/requestConfig.js +++ b/yuhong-ui/src/utils/requestConfig.js @@ -1,7 +1,8 @@ // const devBaseURL = 'http://localhost:5281' // const devBaseURL = 'http://5a35a48943.wicp.vip:40709' // const proBaseURL = 'http://5a35a48943.wicp.vip:40709' -const devBaseURL = 'http://127.0.0.1:9002' +// const devBaseURL = 'http://127.0.0.1:9002' +const devBaseURL = 'http://127.0.0.1:5000' const proBaseURL = 'http://118.195.155.9:9002' export const BASE_URL = process.env.NODE_ENV === 'development' ? devBaseURL : proBaseURL diff --git a/yuhong-ui/src/views/bottomRight.vue b/yuhong-ui/src/views/bottomRight.vue index a3ce048..eec44d5 100644 --- a/yuhong-ui/src/views/bottomRight.vue +++ b/yuhong-ui/src/views/bottomRight.vue @@ -1,20 +1,13 @@