| | |
| | | <!-- |
| | | * @Date: 2024-04-09 22:11:21 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-10-28 19:51:45 |
| | | * @LastEditTime: 2024-11-05 22:55:01 |
| | | * @FilePath: /cps-web/src/views/mdc/processParam/index.vue |
| | | 实时看板 |
| | | --> |
| | |
| | | </el-row> |
| | | <TimeLine v-model="timeRange" ref="timeLine"></TimeLine> |
| | | <el-collapse v-model="activeList"> |
| | | <el-collapse-item :title="item.deLabel" :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> |
| | |
| | | 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: '' |
| | |
| | | }, |
| | | 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/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 { |
| | |
| | | }).then(res => { |
| | | // if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) { |
| | | if (item.paramChartType === 'distribute') { |
| | | this.setDeviceStatusOptions(res.data, item.name) |
| | | this.setDeviceStatusOptions(res.data, item.dpName) |
| | | } else { |
| | | this.setLineOptions(res.data.data, item.name) |
| | | this.setLineOptions(res.data.data, item.dpName) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | } |
| | | 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 |
| | |
| | | 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, |
| | |
| | | tooltip: { |
| | | show: true, |
| | | trigger: 'item', |
| | | position: 'top', |
| | | // position: 'top', |
| | | triggerOn: 'click', |
| | | formatter: (value, ticket) => { |
| | | // console.log('----------1111') |
| | |
| | | // 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')}` |
| | | } |
| | | }, |
| | | } |
| | |
| | | }, |
| | | }, |
| | | } |
| | | 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') |