diff --git a/src/Utils/helper.ts b/src/Utils/helper.ts index 0a0adc5..57ac44c 100644 --- a/src/Utils/helper.ts +++ b/src/Utils/helper.ts @@ -557,4 +557,18 @@ export default class helper { return textStatus; }; + // 设备类型(Homegrown 国产炉 Import 进口炉) + static getEquipmentType = (val: any) => { + let text = ''; + switch (val) { + case 'Homegrown': + text = '国产炉'; + break; + case 'Import': + text = '进口炉'; + break; + } + return text; + }; + } diff --git a/src/pages/device/components/devicePointDialog.vue b/src/pages/device/components/devicePointDialog.vue index b94912d..3b1f068 100644 --- a/src/pages/device/components/devicePointDialog.vue +++ b/src/pages/device/components/devicePointDialog.vue @@ -65,12 +65,12 @@ + :loading="loading" :columns="columns" v-model:pagination="pagination" + :table-style="{ height: '500px' }" @request="onRequest" flat bordered> {{ props.rowIndex + 1 - }} + }} {{ props.row.deviceCode }} @@ -79,8 +79,10 @@ }} {{ props.row.equipmentCode }} {{ props.row.equipmentName }} - {{ props.row.equipmentType }} - {{ helper.getActionType(props.row.actionType) }} + {{ helper.getEquipmentType(props.row.equipmentType) + }} + {{ helper.getActionType(props.row.actionType) + }} {{ props.row.pointCode }} @@ -177,9 +179,8 @@ const pagination = ref(new Pagination(new DeivcePointSearchEntity())); //公共变量 const deviceInfo = ref(); const equipmentTypeList = ref([ - { label: 'Ionbond', value: 'Ionbond' }, - { label: 'Balzers', value: 'Balzers' }, - { label: 'CemeCon', value: 'CemeCon' }, + { label: '国产炉', value: 'Homegrown' }, + { label: '进口炉', value: 'Import' } ]) const activatedList = ref([ { label: '启用', value: true }, diff --git a/src/pages/device/components/equipmentDialog.vue b/src/pages/device/components/equipmentDialog.vue index d835ea0..0ceddac 100644 --- a/src/pages/device/components/equipmentDialog.vue +++ b/src/pages/device/components/equipmentDialog.vue @@ -35,8 +35,8 @@ - + {{ props.rowIndex + 1 - }} + }} {{ props.row.equipmentCode }} {{ props.row.equipmentName }} - {{ props.row.equipmentType }} + {{ helper.getEquipmentType(props.row.equipmentType) + }} - @@ -84,9 +85,8 @@ const emit = defineEmits(['refresh']); const isAlarmFlag = ref(false); const equipmentTypeList = ref([ - { label: 'Ionbond', value: 'Ionbond' }, - { label: 'Balzers', value: 'Balzers' }, - { label: 'CemeCon', value: 'CemeCon' }, + { label: '国产炉', value: 'Homegrown' }, + { label: '进口炉', value: 'Import' } ]) const activatedList = ref([ @@ -95,9 +95,8 @@ const activatedList = ref([ ]) const remarkList = ref([ - { label: 'Ionbond', value: 'Ionbond' }, - { label: 'Balzers', value: 'Balzers' }, - { label: 'CemeCon', value: 'CemeCon' } + { label: '第一', value: '第一' }, + { label: '第二', value: '第二' } ]) const modelList = ref([ diff --git a/src/pages/equipment/index.vue b/src/pages/equipment/index.vue index d79e4c1..407b747 100644 --- a/src/pages/equipment/index.vue +++ b/src/pages/equipment/index.vue @@ -49,7 +49,7 @@ {{ props.rowIndex + 1 - }} + }} {{ props.row.equipmentCode }} @@ -57,7 +57,7 @@ props.row.equipmentName }} {{ - props.row.equipmentType + helper.getEquipmentType(props.row.equipmentType) }} - {{ props.row.remark }} + {{ props.row.remark + }} - + 编辑这条数据 @@ -121,9 +123,8 @@ import helper from 'src/Utils/helper'; //公共 const equipmentTypeList = ref([ - { label: 'Ionbond', value: 'Ionbond' }, - { label: 'Balzers', value: 'Balzers' }, - { label: 'CemeCon', value: 'CemeCon' }, + { label: '国产炉', value: 'Homegrown' }, + { label: '进口炉', value: 'Import' } ]) const activatedList = ref([ { label: '启用', value: true }, diff --git a/src/pages/screen/screen1/index.vue b/src/pages/screen/screen1/index.vue index f7ea567..50e5dd6 100644 --- a/src/pages/screen/screen1/index.vue +++ b/src/pages/screen/screen1/index.vue @@ -105,7 +105,7 @@ }} - --> + --> @@ -116,16 +116,16 @@ - + {{ index + 1 }} {{ item.equipmentCode - }} + }} {{ item.equipmentName - }} + }} @@ -257,23 +257,19 @@ const getEquipmentAlarmList = () => { // 设备运行状态总览 const EquipmentStateView = () => { let All: any = []; - let Balzers: any = []; - let CemeCon: any = []; - let Ionbond: any = []; + let Homegrown: any = []; + let Import: any = []; // 获取设备总览 equipmentRecordApi.getEquipmentStateView().then((res: any) => { res.forEach((item: any) => { if (item.equipmentType == 'All') { All.push(item.run, item.stop, item.alarm); - } else if (item.equipmentType == 'Balzers') { - Balzers.push(item.run, item.stop, item.alarm); + } else if (item.equipmentType == 'Homegrown') { + Homegrown.push(item.run, item.stop, item.alarm); } - else if (item.equipmentType == 'CemeCon') { - CemeCon.push(item.run, item.stop, item.alarm); - } - else if (item.equipmentType == 'Ionbond') { - Ionbond.push(item.run, item.stop, item.alarm); + else if (item.equipmentType == 'Import') { + Import.push(item.run, item.stop, item.alarm); } }); @@ -297,7 +293,7 @@ const EquipmentStateView = () => { } }, { - subtext: 'Balzers', + subtext: '国产炉', left: '75%', top: '45%', textAlign: 'center', @@ -308,7 +304,7 @@ const EquipmentStateView = () => { } }, { - subtext: 'CemeCon', + subtext: '进口炉', left: '25%', top: '90%', textAlign: 'center', @@ -317,17 +313,6 @@ const EquipmentStateView = () => { fontSize: 18, fontWeight: 'bold' } - }, - { - subtext: 'Ionbond', - left: '75%', - top: '90%', - textAlign: 'center', - subtextStyle: { - color: '#000', - fontSize: 18, - fontWeight: 'bold' - } } ], legend: { @@ -344,16 +329,14 @@ const EquipmentStateView = () => { }, dataset: { source: { - // product: ['All', 'Balzers', 'CemeCon', 'Ionbond'], + // product: ['All', 'Homegrown', 'Import'], product: ['运行', '停机', '报警'], All, - Balzers, - CemeCon, - Ionbond, + Homegrown, + Import, // All: [11, 21, 31], - // Balzers: [41, 51, 61], - // CemeCon: [71, 81, 91], - // Ionbond: [10, 11, 12] + // Homegrown: [41, 51, 61], + // Import: [71, 81, 91] } }, series: [ @@ -384,7 +367,7 @@ const EquipmentStateView = () => { center: ['75%', '28%'], encode: { itemName: 'product', - value: 'Balzers' + value: 'Homegrown' }, label: { normal: { @@ -403,7 +386,7 @@ const EquipmentStateView = () => { center: ['25%', '73%'], encode: { itemName: 'product', - value: 'CemeCon' + value: 'Import' }, label: { normal: { @@ -415,25 +398,6 @@ const EquipmentStateView = () => { // formatter: '{@[3]} 台 \n {d} %' } } - }, - { - type: 'pie', - radius: '38%', - center: ['75%', '73%'], - encode: { - itemName: 'product', - value: 'Ionbond' - }, - label: { - normal: { - fontSize: '16px', - color: '#fff', - show: true, - position: 'inside', // 在内部显示,outseide 是在外部显示 - formatter: '{@[4]} 台' - // formatter: '{@[4]} 台 \n {d} %' - } - } } ] }; @@ -787,42 +751,12 @@ const EquipmentRecordOEEMonthTotal = () => { // 月度开炉次数统计 const EquipmentRecordFurnaceMonthTotal = () => { - let Balzers: any = []; - let CemeCon: any = []; - let Ionbond: any = []; let month: any = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; let result: Array = []; // 获取设备记录开炉次数月统计 equipmentRecordApi.getEquipmentRecordFurnaceMonthTotal().then((res: any) => { - // month.forEach((m: any) => { - // res.forEach((item: any) => { - // if (item.totalMonth == m) { - // if (item.equipmentType == 'Balzers') { - // Balzers.push(item.furnaceNum); - // } - // if (item.equipmentType == 'CemeCon') { - // CemeCon.push(item.furnaceNum); - // } - // if (item.equipmentType == 'Ionbond') { - // Ionbond.push(item.furnaceNum); - // } - // } else { - // if (item.equipmentType == 'Balzers') { - // Balzers.push(0); - // } - // if (item.equipmentType == 'CemeCon') { - // CemeCon.push(0); - // } - // if (item.equipmentType == 'Ionbond') { - // Ionbond.push(0); - // } - // } - // }) - // }) - - // let grouped_data = lodash.groupBy(res, 'totalMonth'); - // console.log(grouped_data); + debugger var obj = {}, newArr = []; res.forEach(function (item, suffix) { @@ -844,15 +778,13 @@ const EquipmentRecordFurnaceMonthTotal = () => { newArr.forEach((item: any) => { let CemeCon = item.filter(c => { - return c.equipmentType == 'CemeCon' + return c.equipmentType == 'Homegrown' }) - let Balzers = item.filter(b => { return b.equipmentType == 'Balzers' }) - let Ionbond = item.filter(i => { return i.equipmentType == 'Ionbond' }) + let Balzers = item.filter(b => { return b.equipmentType == 'Import' }) result.push({ product: item[0].totalMonth + '月', - CemeCon: CemeCon[0].furnaceNum, - Balzers: Balzers[0].furnaceNum, - Ionbond: Ionbond[0].furnaceNum, + Homegrown: CemeCon[0].furnaceNum, + Import: Balzers[0].furnaceNum, }) }) @@ -876,7 +808,7 @@ const EquipmentRecordFurnaceMonthTotal = () => { // left: 0, right: '2%', top: 1, - data: ['Balzers', 'CemeCon', 'Ionbond'] + data: ['Homegrown', 'Import'] }, // grid: { // top: '5%', @@ -934,33 +866,13 @@ const EquipmentRecordFurnaceMonthTotal = () => { } }, dataset: { - dimensions: ['product', 'Balzers', 'CemeCon', 'Ionbond'], + dimensions: ['product', 'Homegrown', 'Import'], source: result }, series: [ { - name: 'Balzers', - type: 'bar', - // data: Balzers, - itemStyle: { - normal: { - label: { - color: '#000', - position: 'top', //在上方显示 - show: true // 在折线拐点上显示数据 - }, - } - }, - tooltip: { - valueFormatter: function (value: any) { - return value + ' 次'; - } - } - }, - { - name: 'CemeCon', + name: 'Homegrown', type: 'bar', - // data: CemeCon, itemStyle: { normal: { label: { @@ -977,9 +889,8 @@ const EquipmentRecordFurnaceMonthTotal = () => { } }, { - name: 'Ionbond', + name: 'Import', type: 'bar', - // data: Ionbond, itemStyle: { normal: { label: { diff --git a/src/pages/screen/screen2/index.vue b/src/pages/screen/screen2/index.vue index f1fe268..6aeca46 100644 --- a/src/pages/screen/screen2/index.vue +++ b/src/pages/screen/screen2/index.vue @@ -75,7 +75,7 @@ {{ props.row.equipmentName }} {{ - props.row.equipmentType }} + helper.getEquipmentType(props.row.equipmentType) }} { index + 1, item.equipmentCode, item.equipmentName, - item.equipmentType, + helper.getEquipmentType(item.equipmentType), helper.getEquipmentState(item.state).text, item.startTime, item.endTime, diff --git a/src/pages/screen/screen3/index.vue b/src/pages/screen/screen3/index.vue index b3d95fa..d8c43a8 100644 --- a/src/pages/screen/screen3/index.vue +++ b/src/pages/screen/screen3/index.vue @@ -20,13 +20,13 @@ {{ props.row.total }} - --> + --> - + - - + + @@ -49,31 +49,25 @@ - + + 第一 + - + - + + :flat="item.id == ''" style="height:70px;background-color: #73cb9b;"> - {{ item.equipmentName }} - + - - - 查看设备详情 - - + @@ -81,21 +75,21 @@ - + + 过道 + - + - - - + + - + - + {{ item.equipmentName }} @@ -114,46 +108,12 @@ - + + 第二 + + - @@ -204,10 +164,9 @@ import { useScreenStore } from 'src/stores/useScreenStore' // ]) const screenStore = useScreenStore(); -const BalzersList = ref(); +const guodao = ref(11); +const list1 = ref(); const list2 = ref(); -const list3 = ref(); -const list4 = ref(); const equipmentSearchEntity = ref(new EquipmentSearchEntity()); let equipmentListTimer: NodeJS.Timer | null = null; // 设备列表 @@ -228,8 +187,6 @@ onBeforeUnmount(() => { const EquipmentList = () => { let Coating1 = [] as any let Coating2 = [] as any - let Coating3 = [] as any - let BalzersCoating = [] as any let templateJSON = { id: '', equipmentCode: null, @@ -244,21 +201,17 @@ const EquipmentList = () => { // 设备状态,运行:Run,待机:Stop,报警:Alarm equipmentApi.getEquipmentList(equipmentSearchEntity.value).then((res: any) => { res.forEach((item: any) => { - if (item.remark == '第一涂层室') { + if (item.remark == '第一') { Coating1.push(item); - } else if (item.remark == 'CemeCon') { + } else if (item.remark == '第二') { Coating2.push(item); - } else if (item.remark == 'Ionbond') { - Coating3.push(item); - } else if (item.remark == 'Balzers') { - BalzersCoating.push(item); } }); - // 第一涂层室 + // 第一 Coating1.sort((a: any, b: any) => a.ordrNo - b.ordrNo); let Coating1Val = [] as any - for (let i = 1; i <= 14; i++) { + for (let i = 1; i <= 22; i++) { for (let j = 0; j < Coating1.length; j++) { if (Coating1[j].ordrNo == i) { Coating1Val.push(Coating1[j]) @@ -270,16 +223,12 @@ const EquipmentList = () => { } } } - // var obj4 = JSON.parse(JSON.stringify(screen3_4)); //由JSON字符串转换为JSON对象 - // obj4.splice(0, 0, templateJSON); - // obj4.splice(4, 0, templateJSON); - // obj4.splice(10, 0, templateJSON, templateJSON); - list4.value = Coating1Val //obj4 + list1.value = Coating1Val //obj4 - // 第二涂层室 + // 第二 Coating2.sort((a: any, b: any) => a.ordrNo - b.ordrNo); let Coating2Val = [] as any - for (let i = 1; i <= 18; i++) { + for (let i = 1; i <= 22; i++) { for (let j = 0; j < Coating2.length; j++) { if (Coating2[j].ordrNo == i) { Coating2Val.push(Coating2[j]) @@ -299,54 +248,12 @@ const EquipmentList = () => { // obj3.splice(7, 0, templateJSON); // obj3.splice(10, 0, templateJSON); // obj3.splice(11, 0, templateJSON); - list3.value = Coating2Val //obj3 - - - // 第三涂层室 - Coating3.sort((a: any, b: any) => a.ordrNo - b.ordrNo); - let Coating3Val = [] as any - for (let i = 1; i <= 9; i++) { - for (let j = 0; j < Coating3.length; j++) { - if (Coating3[j].ordrNo == i) { - Coating3Val.push(Coating3[j]) - Coating3.splice(j, 1); - break - } else { - Coating3Val.push(templateJSON) - break - } - } + debugger + for (let i = 1; Coating2Val.length < 22; i++) { + debugger + Coating2Val.push(templateJSON) } - - // var obj2 = JSON.parse(JSON.stringify(screen3_2)); //由JSON字符串转换为JSON对象 - // obj2.splice(1, 0, templateJSON); - // obj2.splice(2, 0, templateJSON); - // obj2.splice(5, 0, templateJSON, templateJSON, templateJSON); - // obj2.splice(9, 0, templateJSON, templateJSON); - // obj2.splice(11, 0, templateJSON); - list2.value = Coating3Val //obj2 - - // 第四涂层室 Balzers - BalzersCoating.sort((a: any, b: any) => a.ordrNo - b.ordrNo); - let BalzersCoatingVal = [] as any - for (let i = 1; i <= 27; i++) { - for (let j = 0; j < BalzersCoating.length; j++) { - if (BalzersCoating[j].ordrNo == i) { - BalzersCoatingVal.push(BalzersCoating[j]) - BalzersCoating.splice(j, 1); - break - } else { - BalzersCoatingVal.push(templateJSON) - break - } - } - } - - // var obj1 = JSON.parse(JSON.stringify(screen3_1)); //由JSON字符串转换为JSON对象 - // obj1.splice(0, 0, templateJSON, templateJSON); - // obj1.splice(3, 0, templateJSON); - // obj1.splice(5, 0, templateJSON); - BalzersList.value = BalzersCoatingVal // obj1 + list2.value = Coating2Val //obj3 }) } diff --git a/src/pages/screen/screen4/index.vue b/src/pages/screen/screen4/index.vue index e7d3666..3107db1 100644 --- a/src/pages/screen/screen4/index.vue +++ b/src/pages/screen/screen4/index.vue @@ -77,11 +77,11 @@ {{ props.row.equipmentName }} {{ - props.row.equipmentType - }} + helper.getEquipmentType(props.row.equipmentType) + }} {{ props.row.furnaceNum - }} + }} {{ props.row.totalRunningTime }} {{ @@ -101,6 +101,7 @@