From 85ee991a84917dc893531d9c0950b596257dced4 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Tue, 23 Jul 2024 18:29:55 +0800 Subject: [PATCH] 1 --- src/api/api.config.js | 3 ++- src/api/store.js | 8 ++++++++ src/views/store/auth.vue | 4 ++-- src/views/store/modules/Commit.vue | 21 +++++++++++++++++++-- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/api/api.config.js b/src/api/api.config.js index f81b20f..96a79aa 100644 --- a/src/api/api.config.js +++ b/src/api/api.config.js @@ -29,7 +29,8 @@ export default { addTotemplate: 'wxwholesaler/addTotemplate', qrcode: 'wxwholesaler/qrcode', commit: 'wxwholesaler/commit', - auditOne: 'wxwholesaler/commitOne', + commitOne: 'wxwholesaler/commitOne', + auditOne: 'wxwholesaler/auditOne', getVersion: 'wxwholesaler/getVersion', auditBeforeCheck: 'wxwholesaler/auditBeforeCheck', audit: 'wxwholesaler/audit', diff --git a/src/api/store.js b/src/api/store.js index 3ed8b0a..f9d4840 100644 --- a/src/api/store.js +++ b/src/api/store.js @@ -45,6 +45,14 @@ export function commit (params) { params }) } + +export function commitOne (params) { + return axios({ + url: api.store.commitOne, + method: 'get', + params + }) +} /** * 获取列表 * @param {*} params diff --git a/src/views/store/auth.vue b/src/views/store/auth.vue index 63f3c6b..d10d11f 100644 --- a/src/views/store/auth.vue +++ b/src/views/store/auth.vue @@ -208,7 +208,7 @@ export default { this.$refs.qrcode.show() }, handleCommit (appid) { - this.$refs.commit.show(appid) + this.$refs.commit.show(appid, 1) }, handleBatchTest () { const appids = this.selectedRowKeys.join(',') @@ -216,7 +216,7 @@ export default { this.$message.error('请选择需要提交的APPID') return false } - this.$refs.commit.show(appids) + this.$refs.commit.show(appids, 0) }, handleBatch () { const appids = this.selectedRowKeys.join(',') diff --git a/src/views/store/modules/Commit.vue b/src/views/store/modules/Commit.vue index 8df1009..9f9ceae 100644 --- a/src/views/store/modules/Commit.vue +++ b/src/views/store/modules/Commit.vue @@ -43,6 +43,7 @@ export default { // modal(对话框)确定按钮 loading confirmLoading: false, templateList: [], + type: 0, // 当前表单元素 form: { template_id: '', @@ -54,7 +55,8 @@ export default { /** * 显示对话框 */ - show (appid) { + show (appid, type) { + this.type = type this.form.appid = appid this.visible = true this.getTemplatelist() @@ -78,7 +80,8 @@ export default { */ handleSubmit (values) { this.confirmLoading = true - Api.commit(this.form) + if (this.type === 0) { + Api.commit(this.form) .then((result) => { // 显示成功提示 this.$message.success(result.message, 1.2) @@ -90,6 +93,20 @@ export default { .finally((result) => { this.confirmLoading = false }) + } else { + Api.commitOne(this.form) + .then((result) => { + // 显示成功提示 + this.$message.success(result.message, 1.2) + // 关闭对话框 + this.handleCancel() + // 通知父端组件提交完成了 + this.$emit('handleSubmit', values) + }) + .finally((result) => { + this.confirmLoading = false + }) + } } } }