| | |
| | | </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) |
| | |
| | | emits: ['success', 'closed'], |
| | | data() { |
| | | return { |
| | | userResult: true, |
| | | groupResult: true, |
| | | postResult: true, |
| | | appType: "", |
| | | userResult: false, |
| | | groupResult: false, |
| | | postResult: false, |
| | | isShowWrite: true, |
| | | addOssForm: { |
| | | wxCorpId: "", |
| | |
| | | }, |
| | | 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; |
| | |
| | | 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'}); |