diff --git a/.env.dev b/.env.dev index 542371b..fa9c3c6 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: zhp # @Date: 2024-04-28 13:42:51 - # @LastEditTime: 2024-05-21 08:36:39 + # @LastEditTime: 2024-05-29 11:03:03 # @LastEditors: zhp # @Description: ### @@ -14,7 +14,7 @@ VUE_APP_TITLE = 芋道管理系统 # 芋道管理系统/开发环境 VUE_APP_BASE_API = 'http://192.168.1.61:48080' # VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' -# + # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/api/produceData/index.js b/src/api/produceData/index.js index 4c6cabd..5637adc 100644 --- a/src/api/produceData/index.js +++ b/src/api/produceData/index.js @@ -1,8 +1,8 @@ /* * @Author: zhp * @Date: 2024-05-07 08:54:59 - * @LastEditTime: 2024-05-14 15:43:50 - * @LastEditors: zhp + * @LastEditTime: 2024-05-20 14:56:56 + * @LastEditors: DY * @Description: */ import request from '@/utils/request' @@ -16,26 +16,99 @@ export function getProduceDataPage(data) { }) } -export function getProduceDataDetail(data){ +export function getProduceDataDetail(id){ return request({ - url: '/ip/prod-output/get=' + id, - method: 'get', - query: data + url: '/ip/prod-output/get?id=' + id, + method: 'get' }) } -// export function cockpitDataMonitor(data) { -// return request({ -// url: '/ip/prod-output/cockpitDataMonitor', -// method: 'post', -// data: data -// }) -// } - -export function cockpitDataMonitor(query) { +// 导出生产数据 +export function exportOutPutExcel(data) { return request({ - url: 'https://restapi.amap.com/v3/weather/weatherInfo?key=95bdbdc1c387a170105f84cd416c4c9f&city=110108', - method: 'get', - query: query + url: '/ip/prod-output/output-export-excel', + method: 'post', + data: data, + responseType: 'blob' + }) +} + +// 获取生产管理生产目标管理碲化镉工厂分页 +export function prodTargetDiPage(data) { + return request({ + url: '/ip/prod-target/prodTargetDiPage', + method: 'post', + data: data + }) +} + +// 获取生产管理生产目标管理铜铟镓硒工厂分页 +export function prodTargetToPage(data) { + return request({ + url: '/ip/prod-target/prodTargetToPage', + method: 'post', + data: data + }) +} + +// 创建生产目标 +export function createProduce(data) { + return request({ + url: '/ip/prod-target/create', + method: 'post', + data: data + }) +} + +// 获得生产目标 +export function getProduceTargetDetail(id){ + return request({ + url: '/ip/prod-target/get?id=' + id, + method: 'get' + }) +} + +// 修改生产目标 +export function updateProduceTarget(data) { + return request({ + url: '/ip/prod-target/update', + method: 'put', + data: data + }) +} + +// 导出碲化镉生产目标数据 +export function exportDiTargetExcel(data) { + return request({ + url: '/ip/prod-target/di-target-export-excel', + method: 'post', + data: data, + responseType: 'blob' + }) +} + +// 导出铜铟镓硒生产目标数据 +export function exportToTargetExcel(data) { + return request({ + url: '/ip/prod-target/to-target-export-excel', + method: 'post', + data: data, + responseType: 'blob' + }) +} + +// 删除生产目标 +export function delTarget(id) { + return request({ + url: '/ip/prod-target/delete?id=' + id, + method: 'delete' + }) +} + +export function cockpitDataMonitor(data) { + return request({ + url: '/ip/prod-output/cockpitDataMonitor', + method: 'post', + data: data }) } diff --git a/src/assets/icons/svg/orgTreeIcon.svg b/src/assets/icons/svg/orgTreeIcon.svg new file mode 100644 index 0000000..247a5ae --- /dev/null +++ b/src/assets/icons/svg/orgTreeIcon.svg @@ -0,0 +1,14 @@ + + + 菜单 + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/svg/orgTreeIcon2.svg b/src/assets/icons/svg/orgTreeIcon2.svg new file mode 100644 index 0000000..a43bd80 --- /dev/null +++ b/src/assets/icons/svg/orgTreeIcon2.svg @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/src/assets/images/homeindex/page-title-two.png b/src/assets/images/homeindex/page-title-two.png new file mode 100644 index 0000000..76a121e Binary files /dev/null and b/src/assets/images/homeindex/page-title-two.png differ diff --git a/src/assets/images/homeindex/page-title.png b/src/assets/images/homeindex/page-title.png new file mode 100644 index 0000000..f2e2024 Binary files /dev/null and b/src/assets/images/homeindex/page-title.png differ diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 11d9c3d..f3c0b35 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -123,7 +123,7 @@ aside { //main-container全局样式 .app-container { - padding: 16px; + // padding: 16px; } .components-container { diff --git a/src/components/ButtonNav/index.vue b/src/components/ButtonNav/index.vue index 7b6147f..feefbab 100644 --- a/src/components/ButtonNav/index.vue +++ b/src/components/ButtonNav/index.vue @@ -82,6 +82,8 @@ export default { border: none; background: #fff; border-radius: 8px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; padding: 20px; color: #888; letter-spacing: 2px; diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 44fc12f..1845d89 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -17,20 +17,20 @@ diff --git a/src/views/copilot/components/FactoryDataHeader.vue b/src/views/copilot/components/FactoryDataHeader.vue index cafa9bb..4d477d9 100644 --- a/src/views/copilot/components/FactoryDataHeader.vue +++ b/src/views/copilot/components/FactoryDataHeader.vue @@ -1,39 +1,30 @@ + + diff --git a/src/views/copilot/components/ftoBarChartBase.vue b/src/views/copilot/components/ftoBarChartBase.vue new file mode 100644 index 0000000..0515ee9 --- /dev/null +++ b/src/views/copilot/components/ftoBarChartBase.vue @@ -0,0 +1,298 @@ + + + + + + + + diff --git a/src/views/copilot/components/gasBarChartBase.vue b/src/views/copilot/components/gasBarChartBase.vue index b9ec720..99a2771 100644 --- a/src/views/copilot/components/gasBarChartBase.vue +++ b/src/views/copilot/components/gasBarChartBase.vue @@ -1,7 +1,7 @@ @@ -191,7 +191,7 @@ export default { console.log(this.width) } else { console.log('ryf') - this.watch = 100 + '%' + this.width = 100 + '%' this.canvasReset() } }, @@ -201,7 +201,7 @@ export default { this.width = 97 + '%' this.canvasReset() } else if (val === false && this.isOpen === false) { - this.watch = 100 + '%' + this.width = 100 + '%' this.canvasReset() } // this.actualOptions.series.map((item) => { diff --git a/src/views/copilot/container.vue b/src/views/copilot/container.vue index 7dcde36..9441df5 100644 --- a/src/views/copilot/container.vue +++ b/src/views/copilot/container.vue @@ -8,9 +8,10 @@ @@ -27,6 +27,10 @@ export default { type: String, default: "日", }, + than: { + type: String, + default: "同比", + }, }, computed: { cities() { diff --git a/src/views/copilot/efficiency/components/TransformRate.vue b/src/views/copilot/efficiency/components/TransformRate.vue index 715f4a4..c51ff79 100644 --- a/src/views/copilot/efficiency/components/TransformRate.vue +++ b/src/views/copilot/efficiency/components/TransformRate.vue @@ -16,7 +16,7 @@ diff --git a/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue b/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue index dfc1be2..afc81e0 100644 --- a/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue +++ b/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue @@ -1,17 +1,17 @@ @@ -171,6 +171,41 @@ export default { }, data: [], // this.series[1].data, }, + { + name: "", // "2024年目标值", + type: "line", + lineStyle: { + color: "#f3c000", + }, + itemStyle: { + color: "#f3c000", + }, + areaStyle: { + color: { + type: "linear", + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { + offset: 0, + color: "#f3c000", // 0% 处的颜色 + }, + { + offset: 0.55, + color: "#f3c00033", + }, + { + offset: 1, + color: "transparent", // 100% 处的颜色 + }, + ], + global: false, // 缺省为 false + }, + }, + data: [], // this.series[0].data, + }, ], }, }; @@ -182,13 +217,7 @@ export default { }, watch: { isOpen(val) { - if (val === true) { - this.width = '100%-128px' - this.canvasReset() - } else { - this.watch = 100 + '%' - this.canvasReset() - } + this.canvasReset() }, /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ isFullscreen(val) { @@ -198,24 +227,47 @@ export default { this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; - this.initChart(this.actualOptions); + // if (val === false && this.isOpen === true) { + // console.log(val) + // this.width = 97 + '%' + // this.canvasReset() + // } else if (val === false && this.isOpen === false) { + // this.width = 100 + '%' + // this.canvasReset() + // } + // this.actualOptions.series.map((item) => { + // item.barWidth = val ? 18 : 12; + // }); + // this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; + // this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; + // this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; + this.initChart(this.actualOptions) + this.canvasReset() }, series(val) { if (!val) { this.initChart(this.options); return; } - console.log(val) + // console.log('val', val) const actualOptions = JSON.parse(JSON.stringify(this.options)) + console.log(actualOptions) actualOptions.series[0].data = val[0].data; actualOptions.series[0].name = val[0].name; - actualOptions.series[1].data = val?.[1]?.data || []; - actualOptions.series[1].name = val?.[1]?.name || ""; + actualOptions.series[1].data = val?.[1]?.data; + actualOptions.series[1].name = val?.[1]?.name; + actualOptions.series[2].data = val?.[2]?.data || []; + actualOptions.series[2].name = val?.[2]?.name || ""; this.actualOptions = actualOptions; this.initChart(actualOptions); }, }, mounted() { + // if (screenfull.isEnabled) { + // screenfull.on("change", () => { + // this.isFullscreen = screenfull.isFullscreen; + // }); + // } // if (screenfull.isEnabled) { // screenfull.on("change", () => { // this.isFullscreen = screenfull.isFullscreen; @@ -243,7 +295,7 @@ export default { if (this.chart) { this.chart.dispose(); } - this.chart = echarts.init(this.$refs.chart); + this.chart = echarts.init(this.$refs.oeeChart); this.chart.setOption(this.actualOptions); }, }, @@ -263,7 +315,7 @@ export default { .legend-item { position: relative; // font-size: 12px; - margin-right: 0.67vw; + margin-right: 1.3vw; &::before { content: ""; @@ -275,7 +327,34 @@ export default { margin-right: 0.22vw; } } + .legend-item:nth-child(3):before { + // width: 12px; + // height: 2px; + width: 1vw; + height: 0.1064vw; + background-color: #f3c000; + position: absolute; + top: 50%; + // left: -16px; + left: -0.951vw; + transform: translateY(-50%); + } + .legend-item:nth-child(3):after { + background-color: #f3c000; + content: ""; + display: inline-block; + position: absolute; + // width: 6px; + // height: 6px; + width: 0.3191vw; + height: 0.3191vw; + border-radius: 100%; + top: 50%; + left: -0.851vw; + // left: -16px; + transform: translateY(-50%) translateX(50%); + } .legend-item:nth-child(1):before { background-color: #12f7f1; } diff --git a/src/views/copilot/efficiency/components/sub/bar/BarChartChipTrans.vue b/src/views/copilot/efficiency/components/sub/bar/BarChartChipTrans.vue new file mode 100644 index 0000000..feca5bc --- /dev/null +++ b/src/views/copilot/efficiency/components/sub/bar/BarChartChipTrans.vue @@ -0,0 +1,366 @@ + + + + + + diff --git a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue index f4b1592..6fd5e31 100644 --- a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue @@ -13,7 +13,7 @@
-
+
{{ lgd.value }} {{ lgd.label }} @@ -46,6 +46,10 @@ export default { type: String, default: "日", }, + than: { + type: String, + default: '同比', + } }, data() { return { @@ -103,21 +107,72 @@ export default { return t; }, legend() { - const year = new Date().getFullYear(); + let items = []; + var day1 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + //今天的时间 + // var day2 = new Date(); + // day2.setTime(day2.getTime()); + // var s2 = (day2.getMonth() + 1) + "月" + day2.getDate() + '日'; + const today = new Date().getDate(); + // let yesterday = new Date().getDate() -1; const month = new Date().getMonth() + 1; - return [ - { - label: - this.period == "月" - ? `${year - 1}年${month}月良率` - : `${year - 1}年良率`, - value: isNaN((this.valueTuple[0] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[0] * 100).toFixed(0) + "%" - }, - { - label: this.period == "月" ? `${month}月良率` : `${year}年良率`, - value: isNaN((this.valueTuple[1] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[1] * 100).toFixed(0) + "%" - }, - ]; + const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; + const year = new Date().getFullYear(); + if (this.period === '日' && this.than === '同比') { + items = [ + { label: `${month}月${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, + { label: `去年${month}月${today}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, + ]; + } else if (this.period === '日' && this.than === '环比') { + items = [ + { label: `${month}月${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, + { label: `${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, + ]; + } else if (this.period === '周' && this.than === '同比') { + items = [ + { label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, + { label: `去年本周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, + ]; + } else if (this.period === '周' && this.than === '环比') { + items = [ + { label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, + { label: `上周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, + ]; + } else if (this.period === '月' && this.than === '同比') { + items = [ + { label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, + { label: `去年${month}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, + { label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" }, + ]; + } else if (this.period === '月' && this.than === '环比') { + items = [ + { label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, + { label: `${lastMonth}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, + { label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" }, + ]; + } else { + items = [ + { label: `${year}年良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, + { label: `${year - 1}年良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, + { label: `${year}年目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" }, + ]; + } + return items + // [ + // { + // label: + // this.period == "月" + // ? `${year - 1}年${month}月良率` + // : `${year - 1}年良率`, + // value: isNaN((this.valueTuple[0] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[0] * 100).toFixed(0) + "%" + // }, + // { + // label: this.period == "月" ? `${month}月良率` : `${year}年良率`, + // value: isNaN((this.valueTuple[1] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[1] * 100).toFixed(0) + "%" + // }, + // ]; }, }, mounted() { @@ -163,7 +218,9 @@ export default { // width: 290px; align-self: stretch; // flex: 1 1 auto; - // padding: 0 10%; + align-items: center; + // margin:0 auto; + // padding: 0 10%;; /* margin: 10%; */ /* min-width: 300px; */ height: 200px; diff --git a/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue b/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue index 6586f16..8692f01 100644 --- a/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue +++ b/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue @@ -6,7 +6,7 @@ --> @@ -20,52 +20,25 @@ export default { type: Number, default: 0, }, - target: { - type: Number, - default: 0, - }, - goodNumber: { - type: Number, - default:0 - }, - componentYield: { - type: Number, - default:0 - }, - period: { - type: String, - default:'日', - }, + // total: { + // type: Number, + // default: 0, + // }, title: { type: String, default: "", }, - city: { - type: String, - default:"" - } }, data() { - return { - number: 0, - titleYear:'', - }; + return {}; }, computed: { dataRate() { - if ((this.period === '年' || this.period === '月') && this.target != 0) { - // console.log(this.componentYield) - this.titleYear = this.title + ' ' + `${(this.target * 100).toFixed(0)}%` - } else { - this.titleYear = this.title - } - this.number = this.value == 0 - ? "-" - : `${(this.value * 100).toFixed(0)}%` - // console.log(this.period) return this.value == 0 ? "-" - : this.value >1 ? 100 + '%' :`${(this.value * 100).toFixed(0)}%` + : this.value > 1 + ? 100 + '%' + : `${(parseFloat(this.value)).toFixed(0)}%`; }, }, methods: {}, @@ -95,7 +68,7 @@ export default { color: #fff; position: absolute; bottom: -200%; - right: 10px; + right: 0; font-size: 12px; } @@ -104,6 +77,7 @@ export default { color: #11eae3; } } + &:nth-child(2) { &:after { color: #0e65fd; @@ -116,17 +90,20 @@ export default { height: 100%; width: 0; border-radius: 4px; + background: linear-gradient(to right, + #004c5e11 10%, + #004c5e, + #0ac0c0, + #11eae3); } &:first-child { .progress-bar__rate { - background: linear-gradient( - to right, - #004c5e11 10%, - #004c5e, - #0ac0c0, - #11eae3 - ); + background: linear-gradient(to right, + #004c5e11 10%, + #004c5e, + #0ac0c0, + #11eae3); } } diff --git a/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue index 83e07be..4f9f3ba 100644 --- a/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue @@ -1,7 +1,7 @@ @@ -11,28 +11,30 @@
- +
- +
- - + + +
- - + + +
@@ -52,7 +54,11 @@ export default { period: { type: String, default: "日", - } + }, + than: { + type: String, + default: "同比", + }, }, data() { return { @@ -60,44 +66,65 @@ export default { }; }, computed: { - title() { - switch (this.period) { - case "日": - return "今日" - case "周": - return "本周" - case "月": - const year = new Date().getFullYear(); - const month = new Date().getMonth() + 1; - return `${year - 1}年${month}月累计` - case "年": { - const year = new Date().getFullYear(); - // return [ - return `${year - 1}年累计` - // ]; - } - default: - return "今日" + titlePre() { + console.log(this.city); + var day1 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + const today = new Date().getDate(); + const month = new Date().getMonth() + 1; + const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; + const year = new Date().getFullYear(); + if (this.period === '日' && this.than === '同比') { + return `去年${month}月${today}日` + } else if (this.period === '日' && this.than === '环比') { + return `${yesterday}日` + } else if (this.period === '周' && this.than === '同比') { + return `去年本周` + } else if (this.period === '周' && this.than === '环比') { + return `上周` + } else if (this.period === '月' && this.than === '同比') { + return `去年${month}月` + } else if (this.period === '月' && this.than === '环比') { + return `${lastMonth}月` + } else { + return `${year - 1}年` } }, - titleEnd() { - switch (this.period) { - // case "日": - // return "今日" - // case "周": - // return "本周" - case "月": - const year = new Date().getFullYear(); - const month = new Date().getMonth() + 1; - return `${year}年${month}月目标` - case "年": { - const year = new Date().getFullYear(); - // return [ - return `${year}年目标` - // ]; - } + title() { + var day1 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + const today = new Date().getDate(); + const month = new Date().getMonth() + 1; + const year = new Date().getFullYear(); + if (this.period === '日' && this.than === '同比') { + return `${month}月${today}日` + } else if (this.period === '日' && this.than === '环比') { + return `${month}月${today}日` + } else if (this.period === '周' && this.than === '同比') { + return `本周` + } else if (this.period === '周' && this.than === '环比') { + return `本周` + } else if (this.period === '月' && this.than === '同比') { + return `${month}月` + } else if (this.period === '月' && this.than === '环比') { + return `${month}月` + } else { + return `${year}年` } - } + }, + titleTarget() { + var day1 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + const today = new Date().getDate(); + const month = new Date().getMonth() + 1; + const year = new Date().getFullYear(); + if (this.period === '月') { + return `${month}月目标` + } else if (this.period === '年') { + return `${year}年目标` + } + }, }, }; diff --git a/src/views/copilot/efficiency/index.vue b/src/views/copilot/efficiency/index.vue index badefb1..bd16da8 100644 --- a/src/views/copilot/efficiency/index.vue +++ b/src/views/copilot/efficiency/index.vue @@ -1,7 +1,7 @@ @@ -9,16 +9,16 @@ @@ -44,25 +44,45 @@ export default { type: String, default: "日", }, + than: { + type: String, + default: "同比", + }, }, data() { - return {}; + return { + chipOeeRate: {}, + transformRate:{} + }; }, watch: { period: { handler(val) { - val && this.fetchData(val); + val && this.fetchData(val,this.than); + }, + immediate: true, + }, + than: { + handler(val) { + console.log(val) + val && this.fetchData(this.period, val); }, immediate: true, }, }, methods: { - fetchData(period = "日") { + fetchData(period = "日",than) { console.log(`效率驾驶舱,获取${period}数据`); this.$store.dispatch("copilot/initCopilot", { period, source: "efficiency", - }); + than + }).then(() => { + this.$nextTick(() => { + this.chipOeeRate = this.$store.getters.copilot.efficiency.chipOeeRate + this.transformRate = this.$store.getters.copilot.efficiency.transformRate + }) + }) }, }, }; diff --git a/src/views/copilot/efficiency/options/double-ring-chart-options.js b/src/views/copilot/efficiency/options/double-ring-chart-options.js index 743f820..bbd6d65 100644 --- a/src/views/copilot/efficiency/options/double-ring-chart-options.js +++ b/src/views/copilot/efficiency/options/double-ring-chart-options.js @@ -6,7 +6,7 @@ export default ({ targetSum, }) => ({ grid: { - left: 0, + left: '50%', right: 0, bottom: 0, top: 0, diff --git a/src/views/copilot/efficiencyContainer.vue b/src/views/copilot/efficiencyContainer.vue index b89cc11..f514c03 100644 --- a/src/views/copilot/efficiencyContainer.vue +++ b/src/views/copilot/efficiencyContainer.vue @@ -1,18 +1,19 @@ @@ -27,18 +28,22 @@ export default { name: "CopilotContainer", components: { CopilotHeaderVue, - // YieldCopilot, - // EnergyCopilot, EfficiencyCopilot, }, data() { return { + than:'同比', page: "效率", period: "日", currentsStyles: '', }; }, methods: { + updateThan(val) { + console.log(val); + this.than = val; + // this.getMes(); + }, updateActive(val, oldVal) { console.log(val) if (val === '效率') { @@ -109,7 +114,7 @@ export default { height: calc(100% + 38px); } .other { - height: calc(100% + 240px); + height: calc(100% + 490px); } .copilot-footer { /** position: absolute; diff --git a/src/views/copilot/factoryData/bbIndex.vue b/src/views/copilot/factoryData/bbIndex.vue new file mode 100644 index 0000000..f6a004f --- /dev/null +++ b/src/views/copilot/factoryData/bbIndex.vue @@ -0,0 +1,143 @@ + + + + diff --git a/src/views/copilot/factoryData/cdIndex.vue b/src/views/copilot/factoryData/cdIndex.vue new file mode 100644 index 0000000..ba91a47 --- /dev/null +++ b/src/views/copilot/factoryData/cdIndex.vue @@ -0,0 +1,143 @@ + + + + diff --git a/src/views/copilot/factoryData/components/BarChartBase.vue b/src/views/copilot/factoryData/components/BarChartBase.vue new file mode 100644 index 0000000..926077c --- /dev/null +++ b/src/views/copilot/factoryData/components/BarChartBase.vue @@ -0,0 +1,399 @@ + + + diff --git a/src/views/copilot/factoryData/components/ChipOee.vue b/src/views/copilot/factoryData/components/ChipOee.vue new file mode 100644 index 0000000..f015b2d --- /dev/null +++ b/src/views/copilot/factoryData/components/ChipOee.vue @@ -0,0 +1,282 @@ + + + + + + + diff --git a/src/views/copilot/factoryData/components/Energy.vue b/src/views/copilot/factoryData/components/Energy.vue index 5339644..fd6841c 100644 --- a/src/views/copilot/factoryData/components/Energy.vue +++ b/src/views/copilot/factoryData/components/Energy.vue @@ -18,19 +18,11 @@ import * as echarts from "echarts"; export default { name: "Energy", props: { - vHeight: { - type: Number, - default: 34, - }, legend: { type: Array, required: true, }, - xAxis: { - type: Array, - required: true, - }, - series: { + energyCockpits: { type: Array, required: true, }, @@ -43,11 +35,10 @@ export default { options: { color: ["#FFD160", "#2760FF", "#12FFF5"], grid: { - left: "3%", - right: "4%", - bottom: "0", + left: "7%", + right: "7%", + bottom: "8%", top: "15%", - containLabel: true, }, tooltip: { trigger: "axis", @@ -65,7 +56,7 @@ export default { color: "rgba(255, 255, 255, 0.7)", fontSize: 12, }, - data: this.xAxis, + data: [], }, yAxis: [ { @@ -190,6 +181,11 @@ export default { }, }; }, + computed: { + isOpen() { + return this.$store.getters.sidebar.opened; + }, + }, watch: { /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ // isFullscreen(val) { @@ -216,6 +212,12 @@ export default { // this.actualOptions = actualOptions; // this.initOptions(actualOptions); // }, + energyCockpits() { + this.initChart(); + }, + isOpen(val) { + this.canvasReset(); + }, }, mounted() { // if (screenfull.isEnabled) { @@ -241,17 +243,60 @@ export default { }, 500)(); }, initChart() { + let energyxAxis = []; + let n = 0; + let seriesArr = [ + { + name: "水", + energyType: 1, + data: [], + }, + { + name: "电", + energyType: 2, + data: [], + }, + { + name: "气", + energyType: 3, + data: [], + }, + ]; + if (this.energyCockpits.length > 0) { + let dataArr = this.energyCockpits.map((item) => { + return item.groupName; + }); + energyxAxis = Array.from(new Set(dataArr)); + n = energyxAxis.length; + seriesArr[0].data = Array.from({ length: n }, () => 0); + seriesArr[1].data = Array.from({ length: n }, () => 0); + seriesArr[2].data = Array.from({ length: n }, () => 0); + for (let i = 0; i < this.energyCockpits.length; i++) { + for (let j = 0; j < energyxAxis.length; j++) { + if (this.energyCockpits[i].groupName === energyxAxis[j]) { + if (this.energyCockpits[i].energyType === 1) { + seriesArr[0].data[j] = this.energyCockpits[i].totalEnergyValue; + } else if (this.energyCockpits[i].energyType === 2) { + seriesArr[1].data[j] = this.energyCockpits[i].totalEnergyValue; + } else if (this.energyCockpits[i].energyType === 3) { + seriesArr[2].data[j] = this.energyCockpits[i].totalEnergyValue; + } + } + } + } + } if (this.chart) { this.chart.dispose(); } this.chart = echarts.init(document.getElementById("factoryEnergyChart")); const actualOptions = JSON.parse(JSON.stringify(this.options)); - actualOptions.series[0].data = this.series[0].data; - actualOptions.series[0].name = this.series[0].name; - actualOptions.series[1].data = this.series[1].data; - actualOptions.series[1].name = this.series[1].name; - actualOptions.series[2].data = this.series[2].data; - actualOptions.series[2].name = this.series[2].name; + actualOptions.xAxis.data = energyxAxis; + actualOptions.series[0].data = seriesArr[0].data; + actualOptions.series[0].name = seriesArr[0].name; + actualOptions.series[1].data = seriesArr[1].data; + actualOptions.series[1].name = seriesArr[1].name; + actualOptions.series[2].data = seriesArr[2].data; + actualOptions.series[2].name = seriesArr[2].name; this.actualOptions = actualOptions; this.chart.setOption(actualOptions); }, diff --git a/src/views/copilot/factoryData/components/Order.vue b/src/views/copilot/factoryData/components/Order.vue index 5515fe4..fa4d22c 100644 --- a/src/views/copilot/factoryData/components/Order.vue +++ b/src/views/copilot/factoryData/components/Order.vue @@ -1,77 +1,189 @@ + diff --git a/src/views/copilot/factoryData/components/ProdMonitor.vue b/src/views/copilot/factoryData/components/ProdMonitor.vue index 432648b..a5b486d 100644 --- a/src/views/copilot/factoryData/components/ProdMonitor.vue +++ b/src/views/copilot/factoryData/components/ProdMonitor.vue @@ -1,272 +1,395 @@ diff --git a/src/views/copilot/factoryData/components/ProdMonitorOld.vue b/src/views/copilot/factoryData/components/ProdMonitorOld.vue new file mode 100644 index 0000000..086d896 --- /dev/null +++ b/src/views/copilot/factoryData/components/ProdMonitorOld.vue @@ -0,0 +1,342 @@ + + + + diff --git a/src/views/copilot/factoryData/components/Store.vue b/src/views/copilot/factoryData/components/Store.vue index 5b169ff..f12ec1c 100644 --- a/src/views/copilot/factoryData/components/Store.vue +++ b/src/views/copilot/factoryData/components/Store.vue @@ -7,17 +7,14 @@ import * as echarts from "echarts"; export default { name: "Store", props: { - vHeight: { - type: Number, - default: 34, - }, - xAxis: { - type: Array, + stock: { + type: Object, required: true, }, - series: { - type: Array, - required: true, + }, + computed: { + isOpen() { + return this.$store.getters.sidebar.opened; }, }, data() { @@ -27,11 +24,10 @@ export default { chart: "", options: { grid: { - left: "3%", + left: "8%", right: "1%", - bottom: "0", - top: "10%", - containLabel: true, + bottom: "8%", + top: "15%", }, tooltip: {}, xAxis: { @@ -47,7 +43,7 @@ export default { color: "rgba(255, 255, 255, 0.7)", fontSize: 12, }, - data: this.xAxis, + data: [], }, yAxis: { name: "单位/片", @@ -116,18 +112,11 @@ export default { }; }, watch: { - series(val) { - if (!val) { - this.initOptions(this.options); - return; - } - const actualOptions = JSON.parse(JSON.stringify(this.options)); - actualOptions.series[0].data = val[0].data; - actualOptions.series[0].name = val[0].name; - actualOptions.series[1].data = val[1].data; - actualOptions.series[1].name = val[1].name; - this.actualOptions = actualOptions; - this.initOptions(actualOptions); + stock(val) { + this.initChart(); + }, + isOpen(val) { + this.canvasReset(); }, }, mounted() { @@ -154,13 +143,20 @@ export default { }, 500)(); }, initChart() { + let xAxis = Object.keys(this.stock) || []; + let data = []; + if (xAxis.length > 0) { + data = xAxis.map((item) => { + return this.stock[item].total; + }); + } if (this.chart) { this.chart.dispose(); } this.chart = echarts.init(document.getElementById("factoryStoreChart")); const actualOptions = JSON.parse(JSON.stringify(this.options)); - actualOptions.series[0].data = this.series[0].data; - actualOptions.series[0].name = this.series[0].name; + actualOptions.xAxis.data = xAxis; + actualOptions.series[0].data = data; this.actualOptions = actualOptions; this.chart.setOption(actualOptions); }, diff --git a/src/views/copilot/factoryData/hdIndex.vue b/src/views/copilot/factoryData/hdIndex.vue new file mode 100644 index 0000000..0857563 --- /dev/null +++ b/src/views/copilot/factoryData/hdIndex.vue @@ -0,0 +1,143 @@ + + + + diff --git a/src/views/copilot/factoryData/index.vue b/src/views/copilot/factoryData/index.vue index c0c0d1d..573346c 100644 --- a/src/views/copilot/factoryData/index.vue +++ b/src/views/copilot/factoryData/index.vue @@ -1,33 +1,25 @@