gaoshp
2024-10-06 5c9aeaacfcfef6143754494528d9025df9ed223c
update
已修改4个文件
51 ■■■■ 文件已修改
src/views/console/workstation/CollDialog.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/workstation/Dialog.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/workstation/index.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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(() => {
            }
            })
        },
        //显示
src/views/console/workstation/Dialog.vue
@@ -323,9 +323,10 @@
                Object.keys(this.form).forEach(key => {
                    this.form[key] = params[key]
                })
                if (this.form.calendarCode) this.form.calendarCodeWaiting = this.form.calendarCodeWaiting || this.form.calendarCode
                this.$HTTP.get(`/api/blade-cps/workstation/get?workstationId=${params.id}`).then(res => {
                    this.form = res?.data
                    if (this.form.calendarCode && !this.form.calendarCodeWaiting) this.form.calendarCodeWaiting = this.form.calendarCode
                    this.$HTTP.get(`/api/blade-cps/workstation-workbench/listWorkbench?workstationId=${params.id}`).then(res => {
                        this.form.workbenchVOList = res?.data?.workstationList || []
                    })
src/views/console/workstation/index.vue
@@ -149,8 +149,11 @@
                                                                type="primary" size="small">保存</el-button> -->
                                                            <!-- <el-button text type="primary" size="small"
                                                                @click="editDMP">修改DMP配置</el-button> -->
                                                            <el-button style="margin-left: auto;" @click="getExport"
                                                                text type="primary" size="small">导出</el-button>
                                                            <el-button @click="editCollection" text type="primary"
                                                                size="small">数据点编辑</el-button>
                                                        </el-header>
                                                        <el-main>
                                                            <!-- <el-table :data="list" height="200px">
@@ -461,6 +464,16 @@
        this.queryList()
    },
    methods: {
        // 数据点导出
        getExport() {
            this.$HTTP.get(`/api/blade-cps/workstation/export-dp?` + this.$TOOL.qsStringify({
                workstationId: this.previewData.id
            })).then(res => {
                if (res.code == 200) {
                    window.open(res.data.link)
                }
            })
        },
        // 数据点编辑
        editCollection() {
            this.$refs.CollDialog.open('edit', this.previewData)
@@ -619,7 +632,7 @@
                return
            }
            console.log(data, '>>>>>>>>>>>')
            this.$HTTP.get(`/api/blade-cps/workstation/listDmpVariablesByMachineId?machineId=${data.machineId}`).then(res => {
            data.machineId && this.$HTTP.get(`/api/blade-cps/workstation/listDmpVariablesByMachineId?machineId=${data.machineId}`).then(res => {
                this.list = res?.data
                // Object.keys(this.basic).forEach(key => {
                //     this.basic[key] = res?.data?.[key] || '-'
vue.config.js
@@ -1,7 +1,7 @@
/*
 * @Date: 2024-03-23 09:49:06
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-05 17:23:49
 * @LastEditTime: 2024-10-06 10:17:18
 * @FilePath: /cps-web/vue.config.js
 */
const { defineConfig } = require('@vue/cli-service')
@@ -46,6 +46,14 @@
                    '^/api': '/'
                }
            },
            '/api/blade-cps/workstation/export-dp': {
                target: 'http://120.46.212.231:4102',
                // ws: true,
                changeOrigin: true,
                pathRewrite: {
                    '^/api': '/'
                }
            },
            '/api': {
                target: process.env.VUE_APP_API_BASEURL,
                ws: true,