gaoshp
2024-10-06 5c9aeaacfcfef6143754494528d9025df9ed223c
src/views/console/workstation/CollDialog.vue
@@ -2,7 +2,7 @@
    <el-dialog title="数据点" v-model="visible" :width="'80%'" destroy-on-close @closed="$emit('closed')">
        <p style="margin-bottom: 14px;">
            <span style="margin-right: 8px;">类型</span>
            <el-select v-model="type" placeholder="Select" size="small" style="width: 240px" @change="changeType">
            <el-select v-model="type" placeholder="类型" size="small" style="width: 240px" @change="changeType">
                <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
            </el-select>
        </p>
@@ -81,18 +81,27 @@
    },
    methods: {
        changeType(val) {
            this.$confirm(`切换类型将删除所有已配置数据点`, '提示', {
                type: 'warning'
            }).then(() => {
            if (this.tabledata.length > 0) {
                this.$confirm(`切换类型将删除所有已配置数据点`, '提示', {
                    type: 'warning'
                }).then(() => {
                    try {
                        this.cols = JSON.parse(this.typeList.find(v => v.id === val).dpHeadFull)
                        this.tabledata = []
                    } catch (error) {
                        this.cols = []
                    }
                }).catch(() => {
                })
            } else {
                try {
                    this.cols = JSON.parse(this.typeList.find(v => v.id === val).dpHeadFull)
                    this.table = []
                } catch (error) {
                    this.cols = []
                }
            }).catch(() => {
            }
            })
        },
        //显示