From 74c0adbc46fd4c95511d23fea8f7b1058063010b Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 5 May 2023 14:17:25 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85-?= =?UTF-8?q?=E7=AA=91=E8=BD=A6=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 4 +- .../components/tabs/carDetail.vue | 24 ++- .../components/tabs/configs/chart.js | 70 ++++++++ .../components/tabs/configs/tableProps.js | 26 +++ .../components/tabs/temperatureDialog.vue | 164 ++++++++++++++++++ 5 files changed, 285 insertions(+), 3 deletions(-) create mode 100644 src/views/modules/pms/finishedOrder/components/tabs/configs/chart.js create mode 100644 src/views/modules/pms/finishedOrder/components/tabs/configs/tableProps.js create mode 100644 src/views/modules/pms/finishedOrder/components/tabs/temperatureDialog.vue diff --git a/public/index.html b/public/index.html index 78aa5e3..8cd3f34 100644 --- a/public/index.html +++ b/public/index.html @@ -38,9 +38,9 @@ <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% } %> diff --git a/src/views/modules/pms/finishedOrder/components/tabs/carDetail.vue b/src/views/modules/pms/finishedOrder/components/tabs/carDetail.vue index 116923e..932dd38 100644 --- a/src/views/modules/pms/finishedOrder/components/tabs/carDetail.vue +++ b/src/views/modules/pms/finishedOrder/components/tabs/carDetail.vue @@ -24,6 +24,13 @@ :dialog-visible.sync="carPayloadDialogVisible" :configs="carPayloadDialogConfigs" /> + + + @@ -32,11 +39,12 @@ import BaseListTable from "@/components/BaseListTable.vue"; import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; // import StateSelect from '@/components/StateSelect.vue'; import { timeFilter, dictFilter } from "@/utils/filters"; +import TemperatureDialog from "./temperatureDialog.vue"; import DialogCarPayload from "@/components/DialogCarPayload.vue"; export default { name: "CarDetailTag", - components: { BaseListTable, DialogCarPayload }, + components: { BaseListTable, DialogCarPayload, TemperatureDialog }, props: { orderId: { type: String, @@ -67,6 +75,7 @@ export default { width: 90, subcomponent: TableOperaionComponent, options: [ + { name: "temperature", label: "烧制温度", icon: "odometer", color: '#ff4d00' }, { name: "to-car-payload", label: "装载详情", icon: "shopping-cart-full" }, // or el-icon-box // { name: "delete", label: "删除", icon: "delete", emitFull: true, promptField: "code" }, ], @@ -99,6 +108,7 @@ export default { ], }, }, + temperatureDialogVisible: false, }; }, watch: { @@ -178,10 +188,22 @@ export default { case "to-car-payload": { // open dialog instead of redirect to a new page this.openCarPayloadDialog(data); + break; + } + case "temperature": { + this.openTemperatureDialog(data); + break; } } }, + openTemperatureDialog(id) { + this.temperatureDialogVisible = true; + this.$nextTick(() => { + this.$refs["temperature-dialog"].init(id); + }); + }, + openCarPayloadDialog(id) { this.carPayloadDialogVisible = true; this.$nextTick(() => { diff --git a/src/views/modules/pms/finishedOrder/components/tabs/configs/chart.js b/src/views/modules/pms/finishedOrder/components/tabs/configs/chart.js new file mode 100644 index 0000000..b1a2683 --- /dev/null +++ b/src/views/modules/pms/finishedOrder/components/tabs/configs/chart.js @@ -0,0 +1,70 @@ +const colors = { + line: '#555' +} + +export default (x_data, y_data) => ({ + title: { + text: "窑车温度", + }, + grid: { + show: true, + top: 96, + left: 52, + right: 32, + bottom: 24, + }, + xAxis: { + type: "category", + data: Array(65) + .fill(1) + .map((val, index) => { + return val + index; + }), + axisLine: { + lineStyle: { + color: colors.line + }, + }, + }, + yAxis: { + type: "value", + name: "温度", + nameTextStyle: { + fontSize: 18, + align: "right", + verticalAlign: "bottom", + lineHeight: 36, + padding: 10, + }, + axisLine: { + show: true, + lineStyle: { + color: colors.line, + }, + }, + axisLabel: { + formatter: '{value} ℃' + }, + splitLine: { + lineStyle: { + color: '#ddd' + } + }, + }, + tooltip: { + trigger: 'axis', + formatter: '位置 ({b}) {c} ℃' + }, + dataZoom: { + type: 'inside' + }, + series: [ + { + data: y_data, + // data: Array(65) + // .fill(1) + // .map((val) => Math.floor(Math.random() * 1000)), + type: "line", + }, + ], +}) \ No newline at end of file diff --git a/src/views/modules/pms/finishedOrder/components/tabs/configs/tableProps.js b/src/views/modules/pms/finishedOrder/components/tabs/configs/tableProps.js new file mode 100644 index 0000000..311ee92 --- /dev/null +++ b/src/views/modules/pms/finishedOrder/components/tabs/configs/tableProps.js @@ -0,0 +1,26 @@ +import { timeFilter } from '@/utils/filters' + +export default [ + // { type: 'index', label: '序号' }, + // { prop: "createTime", label: "添加时间", filter: timeFilter }, + // { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent + // { prop: "stateDictValue", label: "温度", subcomponent: StateSelect }, + { width: 60, prop: "code", label: "位置" }, + { width: 60, prop: "temp1", label: "温度" }, + { width: 80, prop: "press1", label: "窑内压力" }, + { width: 80, prop: "press2", label: "车下压力" }, + { prop: "createTime", label: "时间", filter: timeFilter }, + // { prop: "endTime", label: "结束时间", filter: timeFilter }, + // { + // prop: "operations", + // name: "操作", + // fixed: "right", + // width: 150, + // subcomponent: TableOperaionComponent, + // options: [ + // { name: "temperature", label: "烧制温度", }, + // { name: "to-car-payload", label: "装载详情", icon: 'document' }, + // { name: "delete", label: "删除", icon: 'delete', emitFull: true, promptField: 'code' } + // ], + // }, +]; \ No newline at end of file diff --git a/src/views/modules/pms/finishedOrder/components/tabs/temperatureDialog.vue b/src/views/modules/pms/finishedOrder/components/tabs/temperatureDialog.vue new file mode 100644 index 0000000..919c800 --- /dev/null +++ b/src/views/modules/pms/finishedOrder/components/tabs/temperatureDialog.vue @@ -0,0 +1,164 @@ + + + + +