From 6b467188a7175e0f5bdb4bb25da5a8ee064d2b4c Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期四, 10 十月 2024 12:44:33 +0800
Subject: [PATCH] 1

---
 src/views/console/soam/addOss.vue |   88 +++++++++++++++++++++++++++++++++++++------
 1 files changed, 75 insertions(+), 13 deletions(-)

diff --git a/src/views/console/soam/addOss.vue b/src/views/console/soam/addOss.vue
index 60b0b3c..b0b4326 100644
--- a/src/views/console/soam/addOss.vue
+++ b/src/views/console/soam/addOss.vue
@@ -61,14 +61,15 @@
 			</p>
 		</div>
 		<template #footer>
-			<el-button @click="visible=false" >鍙� 娑�</el-button>
-			<el-button v-if="mode!='show' && isShowWrite" type="primary" :loading="isSaveing" @click="ossSubmit()">淇� 瀛�</el-button>
+			<el-button @click="visible=false" >鍏抽棴</el-button>
+			<el-button v-if="mode!='show' && isShowWrite" type="primary" :loading="isSaveing" @click="ossSubmit()">淇濆瓨</el-button>
 		</template>
 	</el-dialog>
 </template>
 
 <script>
-	import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+	import UpToEnterprise from '@/views/userCenter/user/upToEnterprise.vue'
+import * as ElementPlusIconsVue from '@element-plus/icons-vue'
 	let icons = []
 	for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
 	    icons.push(key)
@@ -77,9 +78,10 @@
 		emits: ['success', 'closed'],
 		data() {
 			return {
-				userResult: true,
-				groupResult: true,
-				postResult: true,
+				appType: "",
+				userResult: false,
+				groupResult: false,
+				postResult: false,
 				isShowWrite: true,
 				addOssForm: {
 					wxCorpId: "",
@@ -130,18 +132,79 @@
 		},
 		methods: {
 			//鏄剧ず
-			open(mode='add'){
+			open(type,data,status,mode='add'){
+				this.appType = type;
 				this.mode = mode;
 				this.visible = true;
+				if(status == 'updata') {  //鍚屾鏉ョ殑
+					this.mode = "end";
+					this.isShowWrite = false;
+					this.userResult = data.userResult;
+					this.groupResult = data.groupResult;
+					this.postResult = data.postResult;
+				}
+				if(status == 'add') {  //鏂板鎴栫紪杈�
+					data.forEach(item=> {
+						if(item.appType == type){
+							// 闇�瑕佽繑鏄惧彲鏀惧紑
+							// if(type == 1) {
+							// 	this.addOssForm = {
+							// 		wxCorpId: item.wxCorpId,
+							// 		wxAgentId: item.wxAgentId,
+							// 		wxAppSecret: item.wxAppSecret,
+							// 		wxBookSecret: item.wxBookSecret,
+							// 		wxCallbackToken: item.wxCallbackToken,
+							// 		wxAesKey: item.wxAesKey,
+							// 		wxDomain: item.wxDomain
+							// 	}
+							// }
+							// if(type == 2) {
+							// 	this.addOssForm = {
+							// 		wxCorpId: item.dingCorpId,
+							// 		wxAgentId: item.dingAgentId,
+							// 		wxAppSecret: item.dingAppKey,
+							// 		wxBookSecret: item.dingAppSecret,
+							// 		wxCallbackToken: item.dingCallbackToken,
+							// 		wxAesKey: item.dingAesKey,
+							// 		wxDomain: item.dingDomain
+							// 	}
+							// }
+						}
+					})
+					this.isShowWrite = true;
+				}
 				return this
 			},
 			//琛ㄥ崟鎻愪氦鏂规硶
 			ossSubmit(){
-				var obj = Object.assign({},this.addOssForm);
-				obj.appType = 1;
-				obj.id = "1787499893602787330";
-				obj.domain = obj.wxDomain;
-				obj.wxid = "1787499893602787330";
+				var obj = {};
+				obj.appType = this.appType;
+				if(obj.appType == 1) {
+					obj.domain = this.addOssForm.wxDomain;
+					obj.wxAesKey = this.addOssForm.wxAesKey;
+					obj.wxAgentId = this.addOssForm.wxAgentId;
+					obj.wxAppSecret = this.addOssForm.wxAppSecret;
+					obj.wxBookSecret = this.addOssForm.wxBookSecret;
+					obj.wxCallbackToken = this.addOssForm.wxCallbackToken;
+					obj.wxCorpId = this.addOssForm.wxCorpId;
+					obj.wxDomain = this.addOssForm.wxDomain;
+					obj.domain = obj.wxDomain;
+					obj.wxid = "1788050081081860097";
+					obj.id = "1788050081081860097";
+				}
+				if(obj.appType == 2) {
+					obj.domain = this.addOssForm.wxDomain;
+					obj.dingAesKey = this.addOssForm.wxAesKey;
+					obj.dingAgentId = this.addOssForm.wxAgentId;
+					obj.dingAppKey = this.addOssForm.wxAppSecret;
+					obj.dingAppSecret = this.addOssForm.wxBookSecret;
+					obj.dingCallbackToken = this.addOssForm.wxCallbackToken;
+					obj.dingCorpId = this.addOssForm.wxCorpId;
+					obj.dingDomain = this.addOssForm.wxDomain;
+					obj.domain = this.addOssForm.wxDomain;
+					obj.dingid = "1787499893602787330";
+					obj.id = "1787499893602787330";
+				}
 				this.$refs.dialogForm.validate(async (valid) => {
 					if (valid) {
 						this.isSaveing = true;
@@ -154,7 +217,6 @@
 								this.groupResult = res.data.groupResult;
 								this.postResult = res.data.postResult;
 								this.$emit('success', this.addOssForm, this.mode);
-								//this.visible = false;
 								this.$message.success("鎿嶄綔鎴愬姛");
 							}else {
 								this.$alert(res.message, "鎻愮ず", {type: 'error'});

--
Gitblit v1.9.3