gaoshp
2024-11-03 dcc4992bd51e9ee4a97099cd3a15085f7e247f23
src/views/mdc/processParam/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-09 22:11:21
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-28 19:51:45
 * @LastEditTime: 2024-11-03 20:10:01
 * @FilePath: /cps-web/src/views/mdc/processParam/index.vue
 实时看板
-->
@@ -37,10 +37,10 @@
                        </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>
@@ -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,7 +172,7 @@
            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
                }
@@ -181,10 +181,10 @@
        viewData(item) {
            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: ''
@@ -217,7 +217,7 @@
                workstationId: this.treeChecked.toString()
            })
            this.list = []
            this.$HTTP.get('/api/blade-mdc/process-parameter/params', { 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 => {
@@ -248,7 +248,7 @@
                delete params.name
                delete params.height
            } catch (err) { console.error(err) }
            this.$HTTP.post('/api/blade-mdc/process-parameter/chart/dmp-item', {
            this.$HTTP.post('/api/mdc/process-parameter/chart/dmp-item', {
                methodEnum: "HOUR",
                startTime: this.timeRange.startTime,
                endTime: this.timeRange.endTime,
@@ -267,10 +267,11 @@
            }).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)
                }
                console.log(this.list, '>>>>>>>>>>//////1')
            })
        },
        setLineOptions(data, myname) {
@@ -307,13 +308,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
@@ -336,9 +337,9 @@
                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') {
                    name = item.value
                }
                // if (myname === 'ProcessProgram') {
                name = item.value
                // }
                // let color = !name ? 'transparent' : data.data[i - 1].color
                return {
                    name,
@@ -363,7 +364,7 @@
                    tooltip: {
                        show: true,
                        trigger: 'item',
                        position: 'top',
                        // position: 'top',
                        triggerOn: 'click',
                        formatter: (value, ticket) => {
                            // console.log('----------1111')
@@ -413,7 +414,7 @@
                },
            }
            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