gaoshp
2024-10-05 87b13f5c6a8a633a3f029f2b752749df40646c03
src/views/console/workstation/CollDialog.vue
@@ -95,26 +95,27 @@
            return this
        },
        getDetailList(params) {
            this.$HTTP.get(`/api/smart-collect/tpl/typelist`, {}, { params }).then(res => {
                this.typeList = res.data || [];
                // return res
            }).finally(() => {
                this.$HTTP.get(`/api/blade-cps/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => {
                    // res.data.records = res?.data?.records.map(v => {
                    //     return {
                    //         ...v,
                    //         statusName: v.status ? '启用' : '禁用'
                    //     }
                    // })
                    this.type = res.data.type
                    this.tabledata = res.data.dpConfig || [];
                    // return res
                })
                this.getList(params)
            })
        },
        getList(params) {
            this.$HTTP.get(`/api/blade-cps/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => {
                // res.data.records = res?.data?.records.map(v => {
                //     return {
                //         ...v,
                //         statusName: v.status ? '启用' : '禁用'
                //     }
                // })
                this.type = res.data.type
                this.tabledata = res.data.dpConfig || [];
                // return res
            })
        },
        //表单提交方法
        submit() {
@@ -123,6 +124,12 @@
                dpConfig: JSON.stringify(this.tabledata),
                workstationId: this.params.id,
                type: this.type
            }).then(res => {
                if (res.code === 200) {
                    this.getList({
                        workstationId: this.params.id,
                    })
                }
            })
        },