From 5c9aeaacfcfef6143754494528d9025df9ed223c Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期日, 06 十月 2024 10:30:12 +0800
Subject: [PATCH] update

---
 src/views/console/workstation/index.vue      |   15 ++++++++++++++-
 vue.config.js                                |   10 +++++++++-
 src/views/console/workstation/CollDialog.vue |   23 ++++++++++++++++-------
 src/views/console/workstation/Dialog.vue     |    3 ++-
 4 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/src/views/console/workstation/CollDialog.vue b/src/views/console/workstation/CollDialog.vue
index 01f827b..e62bc6f 100644
--- a/src/views/console/workstation/CollDialog.vue
+++ b/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(() => {
+            }
 
-            })
 
         },
         //鏄剧ず
diff --git a/src/views/console/workstation/Dialog.vue b/src/views/console/workstation/Dialog.vue
index 3520765..1c6de53 100644
--- a/src/views/console/workstation/Dialog.vue
+++ b/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 || []
                     })
diff --git a/src/views/console/workstation/index.vue b/src/views/console/workstation/index.vue
index eb35a5f..a2148c6 100644
--- a/src/views/console/workstation/index.vue
+++ b/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] || '-'
diff --git a/vue.config.js b/vue.config.js
index 8d8506e..3c4ebea 100644
--- a/vue.config.js
+++ b/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,

--
Gitblit v1.9.3