From fec8589136b17b75f66fa7aa6fb2ac53843b6d20 Mon Sep 17 00:00:00 2001 From: hzz Date: Mon, 22 Apr 2024 16:58:28 +0800 Subject: [PATCH] update --- src/http/Exhibition/Germany/index.ts | 4 + src/locales/lang/en.ts | 14 ++- src/locales/lang/zh.ts | 13 +++ src/store/module/GermanyExhibition.ts | 65 +++++++++++--- src/utils/devSever.ts | 6 +- src/views/Exhibition/Germany/child.vue | 62 ++++++------- .../Germany/components/DynamicChart.vue | 10 +-- .../Germany/components/PercentChart.vue | 27 +++++- .../Exhibition/Germany/components/header2.vue | 1 + src/views/Exhibition/Germany/index.vue | 65 +++++++++----- src/views/Exhibition/Germany/loop.vue | 87 +++++++++++++++---- 11 files changed, 259 insertions(+), 95 deletions(-) diff --git a/src/http/Exhibition/Germany/index.ts b/src/http/Exhibition/Germany/index.ts index d585917..2a5c0ef 100644 --- a/src/http/Exhibition/Germany/index.ts +++ b/src/http/Exhibition/Germany/index.ts @@ -10,3 +10,7 @@ export function dDeviceList(){ export function dDeviceOutput(label:string){ return get('/screen/cisma/dDeviceOutput?s='+label) } +//获取设备在线状态、设备列表 +export function standardTimeD(){ + return get('/screen/cisma/standardTimeD') +} diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index 7dec559..4558c1b 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -347,7 +347,19 @@ export default { "稼动率说明": "Utilization rate (actual working time/actual boot time)", "已完成":"Completed", "未完成":"Uncompleted", - + "工作速度":"Working Speed", + "产品合格率":"Product qualified rate", + "维保信息":"Maintenance", + "件":"Piece", + "日期":"Date", + "工作人员":"Operator", + "操作员编号":"Operator ID", + "完成":"Completed", + "通知":"Notice", + "轮播已开启":"Carousel has been turned on", + "轮播已关闭":"Carousel has been turned off", + "加工时长":"Processing Time", + "合格率":"Qualified Rate", }, "default":{ '年': 'Year', diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index 04448a9..93ca342 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -345,6 +345,19 @@ export default { "稼动率说明":"稼动率:实际工作时间/设备开机时间", "已完成":"已完成", "未完成":"未完成", + "工作速度":"工作速度", + "产品合格率":"产品合格率", + "维保信息":"维保信息", + '件':'件', + "日期":"日期", + "工作人员":"工作人员", + "操作员编号":"操作员编号", + "完成":"完成", + "合格率":"合格率", + "通知":"通知", + "轮播已开启":"轮播已开启", + "轮播已关闭":"轮播已关闭", + "加工时长":"加工时长", }, "default":{ '年': '年', diff --git a/src/store/module/GermanyExhibition.ts b/src/store/module/GermanyExhibition.ts index f507b95..4be0380 100644 --- a/src/store/module/GermanyExhibition.ts +++ b/src/store/module/GermanyExhibition.ts @@ -8,26 +8,67 @@ * 版权信息 : 2023 by ${再登软件}, All Rights Reserved. */ import { defineStore } from "pinia"; -import {Names} from '@/store/storeName' -export const useGermanyExhibition = defineStore(Names.GermanyExhibition,{ - state:()=>{ - return{ - cfytj:{}, - gyfrj:{}, - lq:{} +import { Names } from '@/store/storeName' +export const useGermanyExhibition = defineStore(Names.GermanyExhibition, { + state: () => { + return { + cfytj: { + "id": "5f4000d0-bb4d-11ee-bf45-cf357b830191", + "label": "1171210", + "name": "冲缝一体机", + "brokenLineCount": null, + "currentCount": null, + "workTime": "0.0", + "patternCount": null, + "activation": "0.0", + "planProduction": 100, + "production": 0, + "fileName": null, + "workingState": 0, + "speed": 0, + }, + gyfrj: { + "id": "8263ab70-bb4d-11ee-bf45-cf357b830191", + "name": "工业缝纫机", + "label": "RP2401009", + "activation": "0.2", + "workTime": "0.06", + "planProduction": 100, + "production": 0, + "in2Count": 2, + "in3Count": 4, + "in4Count": 15, + "consumption": 0, + "workingState": 0, + "speed": 0, + }, + lq: { + "id": "78f01000-b8c9-11ee-bf45-cf357b830191", + "label": "104019564", + "name": "立切机180双喷机", + "brokenLineCount": null, + "currentCount": null, + "workTime": "0.0", + "patternCount": null, + "activation": "0.0", + "planProduction": 0, + "production": 0, + "fileName": null, + "workingState": 0 + } } }, - getters:{ + getters: { }, - actions:{ - set_cfytj(data:any){ + actions: { + set_cfytj(data: any) { this.cfytj = data }, - set_gyfrj(data:any){ + set_gyfrj(data: any) { this.gyfrj = data }, - set_lq(data:any){ + set_lq(data: any) { this.lq = data } } diff --git a/src/utils/devSever.ts b/src/utils/devSever.ts index d29f9e2..4ff6b42 100644 --- a/src/utils/devSever.ts +++ b/src/utils/devSever.ts @@ -8,9 +8,9 @@ * 版权信息 : 2023 by ${再登软件}, All Rights Reserved. */ -// export const development={xhr:process.env.VUE_APP_BASE_API,ws:"ws://192.168.3.97:9018/",imgxhr:process.env.VUE_APP_BASE_API+"/image/"} -export const development={xhr:process.env.VUE_APP_BASE_API,ws:"ws://192.168.1.128:9018/",imgxhr:process.env.VUE_APP_BASE_API} -export const production={xhr:process.env.VUE_APP_BASE_API,ws:"ws://192.168.1.128:9018/",imgxhr:process.env.VUE_APP_BASE_API} +// export const development={xhr:process.env.VUE_APP_BASE_API,ws:"ws://192.168.1.128:9018/",imgxhr:process.env.VUE_APP_BASE_API+"/image/"} +export const development={xhr:process.env.VUE_APP_BASE_API,ws:"ws://8.130.165.100:9018/",imgxhr:process.env.VUE_APP_BASE_API} +export const production={xhr:process.env.VUE_APP_BASE_API,ws:"ws://8.130.165.100:9018/",imgxhr:process.env.VUE_APP_BASE_API} //拼接图片url路径 export function imgurlAddXhr(img){ let src=null diff --git a/src/views/Exhibition/Germany/child.vue b/src/views/Exhibition/Germany/child.vue index de21dac..6291969 100644 --- a/src/views/Exhibition/Germany/child.vue +++ b/src/views/Exhibition/Germany/child.vue @@ -10,26 +10,26 @@
-
- +
- +
- +
{{ dev_list.speed }} @@ -39,12 +39,12 @@
- - + +
- +
@@ -83,6 +83,7 @@ const GermanyExhibition = useGermanyExhibition(); const props = defineProps<{ modelValue: any; label: string; + rxData: any; }>(); // 设备信息 let dev_list = computed(()=>{ @@ -102,7 +103,7 @@ let device_data = computed(() => { if (props.label == '1171210') { dev_data = GermanyExhibition.cfytj dev_arr = [ - { key: "加工时长", value: "23min" }, + { key: proxy.tLang('messages', '加工时长'), value: dev_data.workTime + 'min' }, { key: proxy.tLang('messages', '花样总针数'), value: dev_data.patternCount }, { key: proxy.tLang('messages', '当前针数'), value: dev_data.currentCount }, { key: proxy.tLang('messages', '花样名称'), value: dev_data.fileName }, @@ -124,9 +125,9 @@ let device_data = computed(() => { let object_data = [ { key: proxy.tLang('messages', 'DevName'), value: dev_data.name, value_style: { fontSize: "20px" } }, { key: proxy.tLang('messages', 'RackNum'), value: dev_data.label }, - { key: "稼动率", value: dev_data.activation + "%" }, + { key: proxy.tLang('messages',"UtilizationRate"), value: dev_data.activation + "%" }, { key: proxy.tLang('messages', 'DevStatus'), value: dev_data.workingState }, - { key: "工作人员", value: "张--" }, + { key: proxy.tLang('messages',"工作人员"), value: "1001" }, ]; object_data.push(...dev_arr) return object_data; @@ -139,28 +140,23 @@ let getImgSrc = computed(() => { }; return imgSrc[props.label]; }); +let xData = ref(["2024-04-16", "2024-04-17", "2024-04-18", "2024-04-19", "2024-04-20", "2024-04-21", "2024-04-22",]); -function init() { - dDeviceOutput(props.label).then((res) => { - console.log(res); - }); -} // 获取产出进度echarts数据 -let xData = ref(["2024-04-15", "2024-04-16", "2024-04-17", "2024-04-18", "2024-04-19", "2024-04-20", "2024-04-21",]); let seriesData = ref([ { - name: "实际产量", + name: proxy.tLang('default',"实际产量"), type: "bar", tooltip: { valueFormatter: function (value) { - return value + " 件"; + return value + " " + proxy.tLang('messages',"件"); }, }, data: [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6], }, { - name: "产出进度", + name: proxy.tLang('messages',"产出进度"), type: "line", yAxisIndex: 1, tooltip: { @@ -168,15 +164,23 @@ let seriesData = ref([ return value + " %"; }, }, - data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3], + data: [2.0, 2.2, 3.3, 15.5, 17.3, 50.2, 90.3], }, ]); +function init() { + if (props.label == GermanyExhibition.lq.label) { + return; + } + dDeviceOutput(props.label).then((res:any) => { + xData.value = res.data.time.reverse(); + seriesData.value[0].data = res.data.output.reverse(); + seriesData.value[1].data = res.data.outputRate.reverse(); + }); +} -// 转速 -let speed = ref(2000); let config = ref({ - header: ["序号", "类型", "日期", "状态", "操作员编号"], //, '故障率' + header: [proxy.tLang('default',"序号"), proxy.tLang('messages',"type"), proxy.tLang('messages',"日期"), proxy.tLang('default',"状态"), proxy.tLang('messages',"操作员编号")], //, '故障率' headerBGC: "transparent", oddRowBGC: "transparent", evenRowBGC: "transparent", @@ -186,12 +190,12 @@ let config = ref({ rowNum: 5, waitTime: 3000, data: [ - [1, "保养", "2024-02-10", "完成", "1001"], - [2, "机头保养", "2024-03-14", "完成", "1002"], - [3, "电机保养", "2024-03-25", "完成", "1003"], - [4, "保养", "2024-04-05", "完成", "1001"], - [5, "机头保养", "2024-04-08", "完成", "1002"], - [6, "维护", "2024-04-15", "完成", "1001"], + [1, "保养", "2024-02-10", proxy.tLang('messages',"完成"), "1001"], + [2, "机头保养", "2024-03-14", proxy.tLang('messages',"完成"), "1002"], + [3, "电机保养", "2024-03-25", proxy.tLang('messages',"完成"), "1003"], + [4, "保养", "2024-04-05", proxy.tLang('messages',"完成"), "1001"], + [5, "机头保养", "2024-04-08", proxy.tLang('messages',"完成"), "1002"], + [6, "维护", "2024-04-15", proxy.tLang('messages',"完成"), "1001"], ], }); diff --git a/src/views/Exhibition/Germany/components/DynamicChart.vue b/src/views/Exhibition/Germany/components/DynamicChart.vue index 7470da5..e84bbe9 100644 --- a/src/views/Exhibition/Germany/components/DynamicChart.vue +++ b/src/views/Exhibition/Germany/components/DynamicChart.vue @@ -14,7 +14,6 @@ import { ref, getCurrentInstance, onMounted, watch } from "vue"; import { useI18n } from "vue-i18n"; let { t } = useI18n(); - const prop = defineProps({ xData: { type: Array, @@ -43,7 +42,7 @@ const setCharts = () => { }, }, legend: { - data: ["实际产量", "产出进度"], + data: [proxy.tLang('default','实际产量'), proxy.tLang('messages','产出进度')], textStyle: { color: "#AEEEFA", }, @@ -64,7 +63,7 @@ const setCharts = () => { yAxis: [ { type: "value", - name: "实际产量", + name: proxy.tLang('default','实际产量'), nameTextStyle: { color: "#AEEEFA", fontSize: 12, @@ -84,7 +83,7 @@ const setCharts = () => { }, { type: "value", - name: "产出进度", + name: proxy.tLang('messages','产出进度'), nameTextStyle: { color: "#AEEEFA", fontSize: 12, @@ -96,8 +95,7 @@ const setCharts = () => { }, }, min: 0, - max: 25, - interval: 5, + max: 100, axisLabel: { formatter: "{value} %", fontSize: 12, diff --git a/src/views/Exhibition/Germany/components/PercentChart.vue b/src/views/Exhibition/Germany/components/PercentChart.vue index cee7d86..882ebaa 100644 --- a/src/views/Exhibition/Germany/components/PercentChart.vue +++ b/src/views/Exhibition/Germany/components/PercentChart.vue @@ -13,6 +13,12 @@ import { ref, getCurrentInstance, onMounted, watch } from "vue"; let PChartRef = ref(null); const { proxy } = getCurrentInstance() as any; +const prop = defineProps({ + xData: { + type: Array, + default: [], + }, +}); let charts = null; const setCharts = () => { charts = proxy.$echarts.init(PChartRef.value, "dark"); @@ -20,7 +26,7 @@ const setCharts = () => { backgroundColor: "transparent", xAxis: { type: "category", - data: ["03-05", "03-06", "03-07", " 03-08", "03-09", "03-10", "03-10"], + data: prop.xData, axisLabel: { fontSize: 12, color: "#AEEEFA", @@ -29,7 +35,7 @@ const setCharts = () => { yAxis: { type: "value", - name: "合格率", + name: proxy.tLang('messages',"合格率"), nameTextStyle: { color: "#AEEEFA", fontSize: 12, @@ -51,8 +57,8 @@ const setCharts = () => { }, series: [ { - name: "合格率", - data: [50, 98, 80, 60, 95, 70, 85, 86, 78, 85, 75], + name: proxy.tLang('messages',"合格率"), + data: [50, 98, 80, 60, 95, 70], type: "line", smooth: true, }, @@ -60,6 +66,19 @@ const setCharts = () => { }; charts.setOption(option); }; + +watch( + () => prop.xData, + (newVal, oldVal) => { + charts.setOption({ + xAxis: { + type: "category", + data: prop.xData, + }, + }); + }, + { deep: true } +); onMounted(() => { setCharts(); }); diff --git a/src/views/Exhibition/Germany/components/header2.vue b/src/views/Exhibition/Germany/components/header2.vue index 6826050..3e195c2 100644 --- a/src/views/Exhibition/Germany/components/header2.vue +++ b/src/views/Exhibition/Germany/components/header2.vue @@ -158,6 +158,7 @@ let AbnormalDataFun = () => { } } }; +document.title = props.title; let noClickAbnormalDataFun = () => { //该函数执行优先级高于AbnormalDataFun // 判断弹窗是否打开如果打开并且我点击了非弹窗位置则ctrl为true否则为false diff --git a/src/views/Exhibition/Germany/index.vue b/src/views/Exhibition/Germany/index.vue index 44275c9..20bfa82 100644 --- a/src/views/Exhibition/Germany/index.vue +++ b/src/views/Exhibition/Germany/index.vue @@ -2,44 +2,44 @@
- +
- +
{{ props.label }} - +
- +
- +
- +
- +
@@ -49,24 +49,24 @@
-
{{tLang('default','工作')}}
+
{{ tLang('default', '工作') }}
-
{{tLang('default','待机')}}
+
{{ tLang('default', '待机') }}
-
{{tLang('default','停机')}}
+
{{ tLang('default', '停机') }}
diff --git a/src/views/Exhibition/Germany/loop.vue b/src/views/Exhibition/Germany/loop.vue index a1bdc50..92af642 100644 --- a/src/views/Exhibition/Germany/loop.vue +++ b/src/views/Exhibition/Germany/loop.vue @@ -1,9 +1,10 @@