From e2fdfe540eaf160dc7d063c60667041edcc64e86 Mon Sep 17 00:00:00 2001 From: gaoshp <291585735@qq.com> Date: 星期二, 05 十一月 2024 22:55:14 +0800 Subject: [PATCH] 处理显示名称 --- src/views/mdc/processParam/index.vue | 88 ++++++++++++++++++++++--------------------- 1 files changed, 45 insertions(+), 43 deletions(-) diff --git a/src/views/mdc/processParam/index.vue b/src/views/mdc/processParam/index.vue index a7e8ac5..bdd3267 100644 --- a/src/views/mdc/processParam/index.vue +++ b/src/views/mdc/processParam/index.vue @@ -1,7 +1,7 @@ <!-- * @Date: 2024-04-09 22:11:21 * @LastEditors: gaoshp - * @LastEditTime: 2024-10-09 20:29:41 + * @LastEditTime: 2024-11-05 22:55:01 * @FilePath: /cps-web/src/views/mdc/processParam/index.vue 瀹炴椂鐪嬫澘 --> @@ -12,7 +12,7 @@ <el-aside width="300px" style="height: 100%;"> <el-container> <el-main class="nopadding"> - <el-row style="margin-top: 14px;"> + <el-row style="margin: 8px;font-size: 14px;"> 宸ヤ綅 </el-row> <MYTree v-model="treeChecked" @loaded="query"></MYTree> @@ -31,16 +31,16 @@ start-placeholder="" end-placeholder="" :disabled-date="disabledDate" @calendar-change="change" /> </el-col> - <el-col :span="2" style='text-align: right;'> + <!-- <el-col :span="2" style='text-align: right;'> <el-button type="primary" @click="exportExcel">瀵煎嚭</el-button> - </el-col> + </el-col> --> </el-row> <TimeLine v-model="timeRange" ref="timeLine"></TimeLine> <el-collapse v-model="activeList"> - <el-collapse-item :title="item.description" :name="index" v-for="(item, index) in list" + <el-collapse-item :title="item.dpLabel" :name="index" v-for="(item, index) in list" :key="index"> <div - v-if="(['DeviceStatus', 'ProcessProgram'].includes(item.name) && item?.dayCharts?.series?.length > 1) || (!['DeviceStatus', 'ProcessProgram'].includes(item.name) && item?.dayCharts?.series?.length > 0) && activeList.indexOf(index) > -1"> + v-if="(item.paramChartType == 'distribute' && item?.dayCharts?.series?.length > 1) || (item.paramChartType !== 'distribute' && item?.dayCharts?.series?.length > 0) && activeList.indexOf(index) > -1"> <div> <el-button size="small" @click="viewData(item)">鏌ョ湅鏁版嵁</el-button> </div> @@ -150,7 +150,7 @@ }, save() { console.log(this.checkedCities) - this.$HTTP.post(`/api/blade-mdc/process-parameter/excel/export`, { + this.$HTTP.post(`/api/mdc/process-parameter/excel/export`, { collectItem: this.list.filter(v => this.checkedCities.includes(v.id)), endTime: this.timeRange.endTime, startTime: this.timeRange.startTime, @@ -172,28 +172,19 @@ this.visible = true }, init() { - this.$HTTP.get('/api/blade-mdc/process-parameter').then(res => { + this.$HTTP.get('/api/mdc/process-parameter').then(res => { if (res.code === 200) { this.legend = res.data } }) }, viewData(item) { - let data = { - FeedOverride: '杩涚粰鍊嶇巼', - FeedSpeed: '杩涚粰閫熷害', - SpindleOverride: '涓昏酱鍊嶇巼', - SpindleSpeed: '涓昏酱杞��', - Output: '浜ч噺', - ProcessProgram: '绋嬪簭鍚�', - DeviceStatus: '璁惧鐘舵��', - } - this.drawerName = data[item.name] + this.drawerName = item.dpLabel - this.$HTTP.post('/api/blade-mdc/process-parameter/item?current=1&size=1500', { + this.$HTTP.post('/api/mdc/process-parameter/item?current=1&size=1500', { endTime: this.timeRange.endTime, startTime: this.timeRange.startTime, - item: item.name, + item: item.dpName, methodEnum: "HOUR", workstationId: this.treeChecked.toString(), workstationName: '' @@ -220,18 +211,18 @@ }, query() { if (!this.treeChecked.toString()) return - console.log(this.treeChecked.toString(), '>>>>>>>>>/') this.$refs?.timeLine?.init({ dates: this.time, workstationId: this.treeChecked.toString() }) this.list = [] - this.$HTTP.get('/api/blade-mdc/process-parameter/param', { workstationId: this.treeChecked.toString() }).then(res => { + this.$HTTP.get('/api/mdc/process-parameter/params', { workstationId: this.treeChecked.toString() }).then(res => { if (res.code === 200) { - console.log('jkjkjkjkj', this.list) this.list = res.data.map(v => { + let name = v.isProcessParam ? 'ProcessProgram' : v.dpName return { ...v, + name: name, height: ['ProcessProgram', 'DeviceStatus'].includes(v.name) ? '100px' : '200px' } }) @@ -245,31 +236,38 @@ }) }, queryChart1(item) { - let index = this.list.findIndex(item => item.name === 'DeviceStatus') + let index = this.list.findIndex(item => item.dpName === 'DeviceStatus') this.list[index] = Object.assign({ ...this.list[index], dayCharts: {} }) - this.$HTTP.post('/api/blade-mdc/process-parameter/chart/dmp-item', { + let params = { ...item } + try { + delete params.name + delete params.height + } catch (err) { console.error(err) } + this.$HTTP.post('/api/mdc/process-parameter/chart/dmp-item', { methodEnum: "HOUR", startTime: this.timeRange.startTime, endTime: this.timeRange.endTime, workstationId: this.treeChecked.toString(), workstationName: '', - dmpDTO: { + dpDTO: { id: this.treeChecked.toString(), - dmpDeviced: item.dmpDeviceId, - name: item.name, - description: item.description, - dataType: item.dataType, - wcsDataType: item.wcsDataType, - processParameter: item.processParameter + // name: item.name, + ...params + // dmpDeviced: item.dmpDeviceId, + // description: item.description, + // dataType: item.dataType, + // wcsDataType: item.wcsDataType, + // processParameter: item.processParameter } }).then(res => { - if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) { - this.setDeviceStatusOptions(res.data, item.name) + // if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) { + if (item.paramChartType === 'distribute') { + this.setDeviceStatusOptions(res.data, item.dpName) } else { - this.setLineOptions(res.data.data, item.name) + this.setLineOptions(res.data.data, item.dpName) } }) }, @@ -307,13 +305,13 @@ }, } if (yAxisData?.length == 0) { - let index = this.list.findIndex(item => item.name === myname) + let index = this.list.findIndex(item => item.dpName === myname) this.list[index] = Object.assign({ ...this.list[index], dayCharts: {} }) } else { - let index = this.list.findIndex(item => item.name === myname) + let index = this.list.findIndex(item => item.dpName === myname) this.list[index] = Object.assign({ ...this.list[index], dayCharts @@ -335,10 +333,14 @@ let series = data.data.map((item, i) => { let current = Math.abs(moment(start).diff(moment(item.time))) start = item.time - let name = i === 0 ? '' : data.data[i - 1].name - if (myname === 'ProcessProgram') { + let name = i === 0 ? '' : data.data[i - 1].value + // if (myname === 'ProcessProgram') { + try { + name = item.value.slice(-50) + } catch (err) { name = item.value } + // } // let color = !name ? 'transparent' : data.data[i - 1].color return { name, @@ -363,7 +365,7 @@ tooltip: { show: true, trigger: 'item', - position: 'top', + // position: 'top', triggerOn: 'click', formatter: (value, ticket) => { // console.log('----------1111') @@ -373,7 +375,7 @@ // return current.format('HH:mm') // return value if (i == 0 || current === 0) return '' - return `${name}:鏃舵${moment(data.data[i - 1].time).format('HH:mm')}-${moment(item.time).format('HH:mm')}` + return `${name}:鏃舵${moment(data.data[i - 1].time).format('HH:mm:ss')}-${moment(item.time).format('HH:mm:ss')}` } }, } @@ -412,12 +414,12 @@ }, }, } - console.log(dayCharts, '>>>>>>>???') - let index = this.list.findIndex(item => item.name === myname) + let index = this.list.findIndex(item => item.dpName === myname) this.list[index] = Object.assign({ ...this.list[index], dayCharts }) + console.log(this.list, '>>>>>>>>>>>>>>>>>>>>>>111') }, change(e) { this.timeStart = e[0] || moment().format('YYYY-MM-DD') -- Gitblit v1.9.3