gaoshp
2024-10-27 4e8158fce49ac2fffc496277b91af5003c5498d5
Merge branch 'releaseFeature' into releaseProcess
已修改3个文件
已添加1个文件
342 ■■■■■ 文件已修改
src/views/console/workstation/CollDialog.vue 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/workstation/CollTable.vue 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/workstation/addOptions.js 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/processParam/index.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/workstation/CollDialog.vue
@@ -38,9 +38,9 @@
                </template>
                <template #default="scope">
                    <el-select :disabled="!scope.row.status" v-model="scope.row[item.prop]"
                        @change="change($event, scope.row, scope.$index, item)" placeholder="" size="small"
                        v-if="item.type === 'option'">
                    <el-select :disabled="!scope.row.status || (item.disabledFn && item.disabledFn(scope.row))"
                        v-model="scope.row[item.prop]" @change="change($event, scope.row, scope.$index, item)"
                        placeholder="" size="small" v-if="item.type === 'option'">
                        <el-option v-for="item in item.options" :key="item.value || item" :label="(item?.label || item)"
                            :value="(item.value || item)" />
                    </el-select>
@@ -62,9 +62,11 @@
</template>
<script>
import addOptions from './addOptions'
export default {
    name: 'CollDialog',
    emits: ['success', 'closed'],
    mixins: [addOptions],
    props: {
        option: {
            type: Object
@@ -99,10 +101,12 @@
                const label = options.find(v => v.value === e).label
                this.tabledata[index].dpLabel = label
                this.tabledata[index].dpName = e
                this.tabledata[index].paramChartType = 'distribute'
            } else if (prop === 'dpCategory' && e === 'Other') {
                this.tabledata[index].dpLabel = ''
                this.tabledata[index].dpName = ''
            }
            // ç‚¹ä½åˆ†ç±»ä¸ºéžå…¶ä»–æ—¶ è¿‡ç¨‹å‚数展示方式为分布图
        },
        changeType(val) {
            if (this.tabledata.length > 0) {
@@ -111,7 +115,7 @@
                }).then(() => {
                    try {
                        this.cols = JSON.parse(this.typeList.find(v => v.id === val).dpHeadFull)
                        this.addOptions()
                        this.addOptions(this.cols)
                        this.tabledata = []
                    } catch (error) {
                        this.cols = []
@@ -122,7 +126,7 @@
            } else {
                try {
                    this.cols = JSON.parse(this.typeList.find(v => v.id === val).dpHeadFull)
                    this.addOptions()
                    this.addOptions(this.cols)
                } catch (error) {
                    this.cols = []
@@ -162,64 +166,64 @@
            })
        },
        addOptions() {
            if (this.cols.filter(v => v.prop === 'isProcessParam').length === 0) {
                this.cols.unshift(
                    {
                        label: "过程参数",
                        prop: "isProcessParam",
                        isRequired: true,
                        type: 'boolean',
                    }
                )
            }
            if (this.cols.filter(v => v.prop === 'dpLabel').length === 0) {
                this.cols.unshift(
                    {
                        label: "显示名称",
                        prop: "dpLabel",
                        isRequired: true,
                    }
                )
            }
            if (this.cols.filter(v => v.prop === 'dpCategory').length === 0) {
                this.cols.unshift(
                    {
                        label: "点位分类",
                        prop: "dpCategory",
                        isRequired: true,
                        type: 'option',
                        options: [{
                            label: '程序名',
                            value: 'ProgName'
                        }, {
                            label: '程序内容',
                            value: 'ProgContent'
                        }, {
                            label: '刀具号',
                            value: 'ToolNo'
                        }, {
                            label: '状态',
                            value: 'DeviceStatus'
                        }, {
                            label: '产量',
                            value: 'Output'
                        }, {
                            label: '告警',
                            value: 'Alarm'
                        }, {
                            label: '其他',
                            value: 'Other'
                        }]
                    }
                )
            }
        },
        // addOptions() {
        //     if (this.cols.filter(v => v.prop === 'isProcessParam').length === 0) {
        //         this.cols.unshift(
        //             {
        //                 label: "过程参数",
        //                 prop: "isProcessParam",
        //                 isRequired: true,
        //                 type: 'boolean',
        //             }
        //         )
        //     }
        //     if (this.cols.filter(v => v.prop === 'dpLabel').length === 0) {
        //         this.cols.unshift(
        //             {
        //                 label: "显示名称",
        //                 prop: "dpLabel",
        //                 isRequired: true,
        //             }
        //         )
        //     }
        //     if (this.cols.filter(v => v.prop === 'dpCategory').length === 0) {
        //         this.cols.unshift(
        //             {
        //                 label: "点位分类",
        //                 prop: "dpCategory",
        //                 isRequired: true,
        //                 type: 'option',
        //                 options: [{
        //                     label: '程序名',
        //                     value: 'ProgName'
        //                 }, {
        //                     label: '程序内容',
        //                     value: 'ProgContent'
        //                 }, {
        //                     label: '刀具号',
        //                     value: 'ToolNo'
        //                 }, {
        //                     label: '状态',
        //                     value: 'DeviceStatus'
        //                 }, {
        //                     label: '产量',
        //                     value: 'Output'
        //                 }, {
        //                     label: '告警',
        //                     value: 'Alarm'
        //                 }, {
        //                     label: '其他',
        //                     value: 'Other'
        //                 }]
        //             }
        //         )
        //     }
        // },
        getList(params) {
            this.$HTTP.get(`/api/blade-cps/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => {
                try {
                    this.cols = JSON.parse(res.data.dpHead)
                    this.addOptions()
                    this.addOptions(this.cols)
                } catch (error) {
                    this.cols = []
                }
@@ -238,6 +242,7 @@
            })
        },
        table_edit(row) {
            console.log('bianji', row)
            row.status = '1'
        },
        del(index) {
src/views/console/workstation/CollTable.vue
@@ -1,8 +1,8 @@
<!--
 * @Date: 2024-10-05 09:51:45
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-16 23:41:34
 * @FilePath: /avue-data/Users/mache/Documents/demo/cps-web/src/views/console/workstation/CollTable.vue
 * @LastEditTime: 2024-10-27 14:03:19
 * @FilePath: /cps-web/src/views/console/workstation/CollTable.vue
-->
<template>
    <div>
@@ -35,8 +35,9 @@
</template>
<script>
import addOptions from './addOptions'
export default {
    mixins: [addOptions],
    props: {
        info: {
            type: Object,
@@ -72,57 +73,58 @@
            this.$HTTP.get(`/api/blade-cps/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => {
                try {
                    this.cols = JSON.parse(res.data.dpHead)
                    if (this.cols.filter(v => v.prop === 'isProcessParam').length === 0) {
                        this.cols.unshift(
                            {
                                label: "过程参数",
                                prop: "isProcessParam",
                                isRequired: true,
                                type: 'boolean',
                            }
                        )
                    }
                    if (this.cols.filter(v => v.prop === 'dpLabel').length === 0) {
                        this.cols.unshift(
                            {
                                label: "显示名称",
                                prop: "dpLabel",
                                isRequired: true,
                            }
                        )
                    }
                    if (this.cols.filter(v => v.prop === 'dpCategory').length === 0) {
                        this.cols.unshift(
                            {
                                label: "点位分类",
                                prop: "dpCategory",
                                isRequired: true,
                                type: 'option',
                                options: [{
                                    label: '程序名',
                                    value: 'ProgName'
                                }, {
                                    label: '程序内容',
                                    value: 'ProgContent'
                                }, {
                                    label: '刀具号',
                                    value: 'ToolNo'
                                }, {
                                    label: '状态',
                                    value: 'DeviceStatus'
                                }, {
                                    label: '产量',
                                    value: 'Output'
                                }, {
                                    label: '告警',
                                    value: 'Alarm'
                                }, {
                                    label: '其他',
                                    value: 'Other'
                                }]
                            }
                        )
                    }
                    this.addOptions(this.cols)
                    // if (this.cols.filter(v => v.prop === 'isProcessParam').length === 0) {
                    //     this.cols.unshift(
                    //         {
                    //             label: "过程参数",
                    //             prop: "isProcessParam",
                    //             isRequired: true,
                    //             type: 'boolean',
                    //         }
                    //     )
                    // }
                    // if (this.cols.filter(v => v.prop === 'dpLabel').length === 0) {
                    //     this.cols.unshift(
                    //         {
                    //             label: "显示名称",
                    //             prop: "dpLabel",
                    //             isRequired: true,
                    //         }
                    //     )
                    // }
                    // if (this.cols.filter(v => v.prop === 'dpCategory').length === 0) {
                    //     this.cols.unshift(
                    //         {
                    //             label: "点位分类",
                    //             prop: "dpCategory",
                    //             isRequired: true,
                    //             type: 'option',
                    //             options: [{
                    //                 label: '程序名',
                    //                 value: 'ProgName'
                    //             }, {
                    //                 label: '程序内容',
                    //                 value: 'ProgContent'
                    //             }, {
                    //                 label: '刀具号',
                    //                 value: 'ToolNo'
                    //             }, {
                    //                 label: '状态',
                    //                 value: 'DeviceStatus'
                    //             }, {
                    //                 label: '产量',
                    //                 value: 'Output'
                    //             }, {
                    //                 label: '告警',
                    //                 value: 'Alarm'
                    //             }, {
                    //                 label: '其他',
                    //                 value: 'Other'
                    //             }]
                    //         }
                    //     )
                    // }
                } catch (error) {
                    this.cols = []
                }
src/views/console/workstation/addOptions.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,85 @@
export default {
    methods: {
        addOptions(cols) {
            if (cols.filter(v => v.prop === 'paramChartType').length === 0) {
                cols.unshift(
                    {
                        label: "过程参数展示方式",
                        prop: "paramChartType",
                        isRequired: true,
                        isRequiredFn: row => {
                            return row.isProcessParam
                        },
                        type: 'option',
                        options: [{
                            label: '曲线图',
                            value: 'line'
                        }, {
                            label: '分布图',
                            value: 'distribute'
                        }],
                        disabledFn: row => {
                            console.log(row, '>>>>>>>')
                            if (row.dpCategory !== "Other") {
                                return true
                            } else {
                                return false
                            }
                        }
                    }
                )
            }
            if (cols.filter(v => v.prop === 'isProcessParam').length === 0) {
                cols.unshift(
                    {
                        label: "过程参数",
                        prop: "isProcessParam",
                        isRequired: true,
                        type: 'boolean',
                    }
                )
            }
            if (cols.filter(v => v.prop === 'dpLabel').length === 0) {
                cols.unshift(
                    {
                        label: "显示名称",
                        prop: "dpLabel",
                        isRequired: true,
                    }
                )
            }
            if (cols.filter(v => v.prop === 'dpCategory').length === 0) {
                cols.unshift(
                    {
                        label: "点位分类",
                        prop: "dpCategory",
                        isRequired: true,
                        type: 'option',
                        options: [{
                            label: '程序名',
                            value: 'ProgName'
                        }, {
                            label: '程序内容',
                            value: 'ProgContent'
                        }, {
                            label: '刀具号',
                            value: 'ToolNo'
                        }, {
                            label: '状态',
                            value: 'DeviceStatus'
                        }, {
                            label: '产量',
                            value: 'Output'
                        }, {
                            label: '告警',
                            value: 'Alarm'
                        }, {
                            label: '其他',
                            value: 'Other'
                        }]
                    }
                )
            }
        },
    }
}
src/views/mdc/processParam/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-09 22:11:21
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-22 22:30:19
 * @LastEditTime: 2024-10-27 14:55:20
 * @FilePath: /cps-web/src/views/mdc/processParam/index.vue
 å®žæ—¶çœ‹æ¿
-->
@@ -37,7 +37,7 @@
                        </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.deLabel" :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">
@@ -179,16 +179,7 @@
            })
        },
        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', {
                endTime: this.timeRange.endTime,
@@ -226,12 +217,14 @@
                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/blade-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,7 +238,7 @@
            })
        },
        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: {}
@@ -266,7 +259,8 @@
                    processParameter: item.processParameter
                }
            }).then(res => {
                if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) {
                // if (['DeviceStatus', 'ProcessProgram'].includes(item.name)) {
                if (item.paramChartType === 'distribute') {
                    this.setDeviceStatusOptions(res.data, item.name)
                } else {
                    this.setLineOptions(res.data.data, item.name)