From 3d19ecb41ad826617d76761b040f99ddb0a9e6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 21 Dec 2023 09:49:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/data.json | 42 + src/api/board/getData.js | 8 + src/api/board/liner.js | 7 - src/api/board/mixData.js | 24 + src/store/modules/permission.js | 3 - src/views/base/customData/boardIndex.vue | 2 +- src/views/board/caseShell/index2.vue | 961 +++++++------- src/views/board/foaming/index.vue | 1494 +++++++++++++++------- src/views/board/liner/index.vue | 818 ++++++------ 9 files changed, 2084 insertions(+), 1275 deletions(-) delete mode 100644 src/api/board/liner.js create mode 100644 src/api/board/mixData.js diff --git a/public/data.json b/public/data.json index 7c6cbe5..f4466ed 100644 --- a/public/data.json +++ b/public/data.json @@ -353,6 +353,48 @@ "value17": "100", "value18": "100", "value19": "100" + }, + { + "value1": "11", + "value2": "A-06", + "value3": "生产中", + "value4": "1000", + "value5": "1000%", + "value6": "100%", + "value7": "100", + "value8": "100", + "value9": "100", + "value10": "100", + "value11": "100", + "value12": "100", + "value13": "100", + "value14": "100", + "value15": "100", + "value16": "100", + "value17": "100", + "value18": "100", + "value19": "100" + }, + { + "value1": "12", + "value2": "A-06", + "value3": "生产中", + "value4": "1000", + "value5": "1000%", + "value6": "100%", + "value7": "100", + "value8": "100", + "value9": "100", + "value10": "100", + "value11": "100", + "value12": "100", + "value13": "100", + "value14": "100", + "value15": "100", + "value16": "100", + "value17": "100", + "value18": "100", + "value19": "100" } ], "table31": [ diff --git a/src/api/board/getData.js b/src/api/board/getData.js index 144cbc1..20e849e 100644 --- a/src/api/board/getData.js +++ b/src/api/board/getData.js @@ -16,3 +16,11 @@ export function generalInterfaceList(query) { data: query }) } + +export function getSimulateData(query) { + return request({ + url: '/base/customData/list', + method: 'get', + params: {customType: 1, ...query} + }) +} diff --git a/src/api/board/liner.js b/src/api/board/liner.js deleted file mode 100644 index d70de41..0000000 --- a/src/api/board/liner.js +++ /dev/null @@ -1,7 +0,0 @@ -import request from '@/utils/request' - - - - - - diff --git a/src/api/board/mixData.js b/src/api/board/mixData.js new file mode 100644 index 0000000..8a7c1a5 --- /dev/null +++ b/src/api/board/mixData.js @@ -0,0 +1,24 @@ +import {generalInterfaceList, getSimulateData} from '@/api/board/getData' + +export function mixData(params) { + getSimulateData({customCode: params?.e || ''}).then(val => { + if (val.rows.length > 0 && val.rows[0].isFlag === 0) { + let data = JSON.parse(val.rows[0].customData); + (params?.f || (() => { + }))(data) + } else { + generalInterfaceList({ + method: params?.i || '' + }).then(val2 => { + (params?.f || (() => { + }))(val2) + }) + } + }) + +} + + + + + diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 15f7ad0..f0be3b8 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -40,8 +40,6 @@ const permission = { const rdata = JSON.parse(JSON.stringify(res.data)) const sidebarRoutes = filterAsyncRouter(sdata) const rewriteRoutes = filterAsyncRouter(rdata, false, true) - console.log('sidebarRoutes',sidebarRoutes) - console.log('rewriteRoutes',rewriteRoutes) const asyncRoutes = filterDynamicRoutes(dynamicRoutes); rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) router.addRoutes(asyncRoutes); @@ -88,7 +86,6 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { } return true }) - console.log('data',data) return data } diff --git a/src/views/base/customData/boardIndex.vue b/src/views/base/customData/boardIndex.vue index 2ce49b1..807a358 100644 --- a/src/views/base/customData/boardIndex.vue +++ b/src/views/base/customData/boardIndex.vue @@ -138,7 +138,7 @@ - + diff --git a/src/views/board/caseShell/index2.vue b/src/views/board/caseShell/index2.vue index a63aa1b..4efd51f 100644 --- a/src/views/board/caseShell/index2.vue +++ b/src/views/board/caseShell/index2.vue @@ -4,7 +4,7 @@
{{ team }}
{{ planNum }}
{{ practicalNum }}
-
{{ differenceValue }}
+
{{ practicalNum - planNum }}
{{ i }} @@ -81,6 +81,9 @@ import vueSeamlessScroll from "vue-seamless-scroll"; import Chart from "../../../components/board/Chart"; import * as echarts from 'echarts' import {getData} from "@/api/board/getData"; +import {mixData} from "@/api/board/mixData"; + +const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { components: { @@ -90,11 +93,11 @@ export default { name: "Liner", data() { return { - linerNum: 50, - caseNum: 44, - meter: 30, - frontNum: 100, - laterNum: 100, + linerNum: 0, + caseNum: 0, + meter: 0, + frontNum: 0, + laterNum: 0, title: [ '生产计划', '小时产量统计', @@ -124,10 +127,9 @@ export default { left: 68.5 }, ], - team: '白班', - planNum: 1000, - practicalNum: 1000, - differenceValue: 1000, + team: '', + planNum: 0, + practicalNum: 0, scrollTableOption: { step: 0.5, // 数值越大速度滚动越快 limitMoveNum: 9999999999999, // 开始无缝滚动的数据量 this.dataList.length @@ -139,480 +141,569 @@ export default { waitTime: 0, }, scrollTableData: [], - - } - }, - mounted() { - const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 - getData().then(e => { - this.scrollTableData = e.caseShell2.table1 - this.$refs.chart1.setData({ - tooltip: { - trigger: "axis", - axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: "shadow", // 默认为直线,可选为:'line' | 'shadow' - }, - }, - grid: { - left: "0", - right: "4%", - bottom: "0", - top: 20, - containLabel: true, + RequestDataSet: [ + { + e: 'xkqhb-01', + i: "", + f: (e) => { + this.team = e + } }, - legend: { - data: e.caseShell2.ImportAndExportStatistics.y.map(val => val.name), - right: 'center', - top: 0, - textStyle: { - color: "#fff", - }, - itemWidth: 12, - itemHeight: 10, - // itemGap: 35 + { + e: 'xkqhb-02', + i: "", + f: (e) => { + this.planNum = e + } }, - xAxis: { - type: "category", - data: e.caseShell2.ImportAndExportStatistics.x, - axisLine: { - lineStyle: { - color: "white", - }, - }, - axisLabel: { - // interval: 0, - // rotate: 40, - textStyle: { - fontFamily: "Microsoft YaHei", - }, - }, + { + e: 'xkqhb-03', + i: "", + f: (e) => { + this.practicalNum = e + } }, - - yAxis: { - type: "value", - axisLine: { - show: false, - lineStyle: { - color: "white", - }, - }, - splitLine: { - show: false, - }, - axisLabel: {}, + { + e: 'xkqhb-04', + i: "", + f: (e) => { + this.scrollTableData = e + } }, - series: [ - { - name: e.caseShell2.ImportAndExportStatistics.y[0].name, - type: "bar", - barWidth: "30%", - barMaxWidth: 50, - label: { - normal: { - show: true, - position: "top", + { + e: 'xkqhb-05', + i: "", + f: (e) => { + this.$refs.chart1.setData({ + tooltip: { + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + }, + }, + grid: { + left: "0", + right: "4%", + bottom: "0", + top: 20, + containLabel: true, + }, + legend: { + data: e.y.map(val => val.name), + right: 'center', + top: 0, textStyle: { - color: "#a8aab0", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.75 * vw, + color: "#fff", }, + itemWidth: 12, + itemHeight: 10, + // itemGap: 35 }, - }, - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#39ffff", + xAxis: { + type: "category", + data: e.x, + axisLine: { + lineStyle: { + color: "white", }, - { - offset: 1, - color: "#5affa6", + }, + axisLabel: { + // interval: 0, + // rotate: 40, + textStyle: { + fontFamily: "Microsoft YaHei", }, - ]), + }, }, - }, - data: e.caseShell2.ImportAndExportStatistics.y[0].data, - }, - { - name: e.caseShell2.ImportAndExportStatistics.y[1].name, - type: "bar", - barWidth: "30%", - barMaxWidth: 50, - label: { - normal: { - show: true, - position: "top", - textStyle: { - color: "#a8aab0", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.75 * vw, + + yAxis: { + type: "value", + axisLine: { + show: false, + lineStyle: { + color: "white", + }, + }, + splitLine: { + show: false, }, + axisLabel: {}, }, - }, - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#4adfff", + series: [ + { + name: e.y[0].name, + type: "bar", + barWidth: "30%", + barMaxWidth: 50, + label: { + normal: { + show: true, + position: "top", + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 0.75 * vw, + }, + }, }, - { - offset: 1, - color: "#3d7aff", + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "#39ffff", + }, + { + offset: 1, + color: "#5affa6", + }, + ]), + }, }, - ]), - }, - }, - data: e.caseShell2.ImportAndExportStatistics.y[1].data, - }, - ], - }) - this.$refs.chart2.setData({ - tooltip: { - trigger: "axis", - axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: "shadow", // 默认为直线,可选为:'line' | 'shadow' - }, - }, - grid: { - left: "0", - right: "4%", - bottom: "0", - top: 20, - containLabel: true, - }, - legend: { - data: e.chart2.y.map(val => val.name), - right: 'center', - top: 0, - textStyle: { - color: "#fff", - }, - itemWidth: 12, - itemHeight: 10, - // itemGap: 35 - }, - xAxis: { - type: "category", - data: e.chart2.x, - axisLine: { - lineStyle: { - color: "white", - }, - }, - axisLabel: { - // interval: 0, - // rotate: 40, - textStyle: { - fontFamily: "Microsoft YaHei", - }, - }, + data: e.y[0].data, + }, + { + name: e.y[1].name, + type: "bar", + barWidth: "30%", + barMaxWidth: 50, + label: { + normal: { + show: true, + position: "top", + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 0.75 * vw, + }, + }, + }, + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "#4adfff", + }, + { + offset: 1, + color: "#3d7aff", + }, + ]), + }, + }, + data: e.y[1].data, + }, + ], + }) + } }, - - yAxis: { - type: "value", - axisLine: { - show: false, - lineStyle: { - color: "white", - }, - }, - splitLine: { - show: false, - }, - axisLabel: {}, + { + e: 'xkqhb-06', + i: "", + f: (e) => { + this.meter = e + } }, - series: [ - { - name: e.chart2.y[0].name, - type: "bar", - barWidth: "30%", - barMaxWidth: 50, - label: { - normal: { - show: true, - position: "top", + { + e: 'xkqhb-07', + i: "SCADA_INV_STATS_01('')", + f: (e) => { + this.$refs.chart2.setData({ + tooltip: { + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + }, + }, + grid: { + left: "0", + right: "4%", + bottom: "0", + top: 20, + containLabel: true, + }, + legend: { + data: e.y.map(val => val.name), + right: 'center', + top: 0, textStyle: { - color: "#a8aab0", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.75 * vw, + color: "#fff", }, + itemWidth: 12, + itemHeight: 10, + // itemGap: 35 }, - }, - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#0bca98", + xAxis: { + type: "category", + data: e.x, + axisLine: { + lineStyle: { + color: "white", }, - { - offset: 1, - color: "#16a144", + }, + axisLabel: { + // interval: 0, + // rotate: 40, + textStyle: { + fontFamily: "Microsoft YaHei", }, - ]), + }, }, - }, - data: e.chart2.y[0].data, - }, - { - name: e.chart2.y[1].name, - type: "bar", - barWidth: "30%", - barMaxWidth: 50, - label: { - normal: { - show: true, - position: "top", - textStyle: { - color: "#a8aab0", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.75 * vw, + + yAxis: { + type: "value", + axisLine: { + show: false, + lineStyle: { + color: "white", + }, + }, + splitLine: { + show: false, }, + axisLabel: {}, }, - }, - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#0f8ad7", + series: [ + { + name: e.y[0].name, + type: "bar", + barWidth: "30%", + barMaxWidth: 50, + label: { + normal: { + show: true, + position: "top", + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 0.75 * vw, + }, + }, }, - { - offset: 1, - color: "#0b30d9", + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "#0bca98", + }, + { + offset: 1, + color: "#16a144", + }, + ]), + }, }, - ]), - }, - }, - data: e.chart2.y[1].data, - }, - ], - }) - this.$refs.chart3.setData({ - tooltip: { - trigger: "axis", - axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: "shadow", // 默认为直线,可选为:'line' | 'shadow' - }, - }, - grid: { - left: "0", - right: "4%", - bottom: "0", - top: 20, - containLabel: true, - }, - legend: { - data: e.caseShell2.chart2.y.map(val => val.name), - right: 'center', - top: 0, - textStyle: { - color: "#fff", - }, - itemWidth: 12, - itemHeight: 10, - // itemGap: 35 + data: e.y[0].data, + }, + { + name: e.y[1].name, + type: "bar", + barWidth: "30%", + barMaxWidth: 50, + label: { + normal: { + show: true, + position: "top", + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 0.75 * vw, + }, + }, + }, + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "#0f8ad7", + }, + { + offset: 1, + color: "#0b30d9", + }, + ]), + }, + }, + data: e.y[1].data, + }, + ], + }) + } }, - xAxis: { - type: "category", - data: e.caseShell2.chart2.x, - axisLine: { - lineStyle: { - color: "white", - }, - }, - axisLabel: { - // interval: 0, - // rotate: 40, - textStyle: { - fontFamily: "Microsoft YaHei", - }, - }, + { + e: 'xkqhb-08', + i: "", + f: (e) => { + this.linerNum = e + } }, - - yAxis: { - type: "value", - axisLine: { - show: false, - lineStyle: { - color: "white", - }, - }, - splitLine: { - show: false, - }, - axisLabel: {}, + { + e: 'xkqhb-09', + i: "", + f: (e) => { + this.caseNum = e + } }, - series: [ - { - name: e.caseShell2.chart2.y[0].name, - type: "bar", - barWidth: "30%", - barMaxWidth: 50, - label: { - normal: { - show: true, - position: "top", + { + e: 'xkqhb-10', + i: "", + f: (e) => { + this.$refs.chart3.setData({ + tooltip: { + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + }, + }, + grid: { + left: "0", + right: "4%", + bottom: "0", + top: 20, + containLabel: true, + }, + legend: { + data: e.y.map(val => val.name), + right: 'center', + top: 0, textStyle: { - color: "#a8aab0", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.75 * vw, + color: "#fff", }, + itemWidth: 12, + itemHeight: 10, + // itemGap: 35 }, - }, - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#0bca98", + xAxis: { + type: "category", + data: e.x, + axisLine: { + lineStyle: { + color: "white", }, - { - offset: 1, - color: "#16a144", + }, + axisLabel: { + // interval: 0, + // rotate: 40, + textStyle: { + fontFamily: "Microsoft YaHei", }, - ]), + }, }, - }, - data: e.caseShell2.chart2.y[0].data, - }, - { - name: e.caseShell2.chart2.y[1].name, - type: "bar", - barWidth: "30%", - barMaxWidth: 50, - label: { - normal: { - show: true, - position: "top", - textStyle: { - color: "#a8aab0", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.75 * vw, + + yAxis: { + type: "value", + axisLine: { + show: false, + lineStyle: { + color: "white", + }, + }, + splitLine: { + show: false, }, + axisLabel: {}, }, - }, - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#0f8ad7", + series: [ + { + name: e.y[0].name, + type: "bar", + barWidth: "30%", + barMaxWidth: 50, + label: { + normal: { + show: true, + position: "top", + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 0.75 * vw, + }, + }, }, - { - offset: 1, - color: "#0b30d9", + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "#0bca98", + }, + { + offset: 1, + color: "#16a144", + }, + ]), + }, }, - ]), - }, - }, - data: e.caseShell2.chart2.y[1].data, - }, - ], - }) - this.$refs.chart4.setData({ - legend: { - data: ['运行中夹具数量'], - right: 'center', - top: 0, - textStyle: { - color: "#fff", - }, - itemWidth: 12, - itemHeight: 10, - // itemGap: 35 - }, - tooltip: { - trigger: "axis", - axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: "shadow", // 默认为直线,可选为:'line' | 'shadow' - }, - }, - grid: { - left: "0", - right: "4%", - bottom: "0", - top: 20, - containLabel: true, + data: e.y[0].data, + }, + { + name: e.y[1].name, + type: "bar", + barWidth: "30%", + barMaxWidth: 50, + label: { + normal: { + show: true, + position: "top", + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 0.75 * vw, + }, + }, + }, + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "#0f8ad7", + }, + { + offset: 1, + color: "#0b30d9", + }, + ]), + }, + }, + data: e.y[1].data, + }, + ], + }) + } }, - xAxis: { - type: "category", - data: e.liner.foamFixtureState.x, - axisLine: { - lineStyle: { - color: "white", - }, - }, - axisLabel: { - // interval: 0, - // rotate: 40, - textStyle: { - fontFamily: "Microsoft YaHei", - }, - }, + { + e: 'xkqhb-11', + i: "", + f: (e) => { + this.frontNum = e + } }, - - yAxis: { - type: "value", - axisLine: { - show: false, - lineStyle: { - color: "white", - }, - }, - splitLine: { - show: false, - }, - axisLabel: {}, + { + e: 'xkqhb-12', + i: "", + f: (e) => { + this.laterNum = e + } }, - series: [ - { - name: e.liner.foamFixtureState.y.name, - type: "bar", - barWidth: '30%', - barMaxWidth: 50, - label: { - normal: { - show: true, - position: "top", + { + e: 'xkqhb-13', + i: "", + f: (e) => { + this.$refs.chart4.setData({ + legend: { + data: ['运行中夹具数量'], + right: 'center', + top: 0, textStyle: { - color: "#a8aab0", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.75 * vw, + color: "#fff", + }, + itemWidth: 12, + itemHeight: 10, + // itemGap: 35 + }, + tooltip: { + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' }, }, - }, - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#4adfff", + grid: { + left: "0", + right: "4%", + bottom: "0", + top: 20, + containLabel: true, + }, + xAxis: { + type: "category", + data: e.x, + axisLine: { + lineStyle: { + color: "white", }, - { - offset: 1, - color: "#3d7aff", + }, + axisLabel: { + // interval: 0, + // rotate: 40, + textStyle: { + fontFamily: "Microsoft YaHei", }, - ]), + }, }, - }, - data: e.liner.foamFixtureState.y.data, + + yAxis: { + type: "value", + axisLine: { + show: false, + lineStyle: { + color: "white", + }, + }, + splitLine: { + show: false, + }, + axisLabel: {}, + }, + series: [ + { + name: e.y.name, + type: "bar", + barWidth: '30%', + barMaxWidth: 50, + label: { + normal: { + show: true, + position: "top", + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 0.75 * vw, + }, + }, + }, + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "#4adfff", + }, + { + offset: 1, + color: "#3d7aff", + }, + ]), + }, + }, + data: e.y.data, + } + ] + }) + this.laterNum = e } - ] - }) + }, + ] + + } + }, + mounted() { + this.RequestDataSet.forEach(val => { + mixData(val) }) }, methods: {} diff --git a/src/views/board/foaming/index.vue b/src/views/board/foaming/index.vue index a928d8c..4fd76d1 100644 --- a/src/views/board/foaming/index.vue +++ b/src/views/board/foaming/index.vue @@ -1,9 +1,16 @@