协会、活动测试整改

This commit is contained in:
2026-10-30 19:02:48 +08:00
parent 2a305a3f23
commit ceec8eb095
23 changed files with 466 additions and 172 deletions
File diff suppressed because one or more lines are too long
@@ -380,7 +380,7 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="setDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSetActivityUser" v-loading="settingLoading">确定</el-button>
<el-button type="primary" :disabled="settingLoading" @click="doSetActivityUser">确定</el-button>
</span>
</el-dialog>
@@ -646,7 +646,7 @@ module.exports = {
doSearch(showFullLoading = false) {
this.tableKey = new Date().getTime()
this.pageForm.pageNumber = 1
this.pageData(showFullLoading === true)
return this.pageData(showFullLoading === true)
},
async pageData(showFullLoading = false) {
this.tableLoading = true
@@ -679,43 +679,74 @@ module.exports = {
}
}
},
async doSetActivityUser() {
const valid = await this.$refs.setForm.validate()
if (!valid) {
doSetActivityUser() {
// 方法级状态保护与整页遮罩共同阻止慢请求期间的重复确认。
if (this.settingLoading) {
return
}
if (this.formData.groupType !== 2 && this.tableData.length === 0) {
this.$message.warning("请先指定筛选条件!")
return
}
const confirm = await this.$confirm("是否将符合搜索条件的用户设为活动人员?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
this.settingLoading = true
const pageForm = this.normalizePageForm(this.pageForm)
Object.assign(pageForm, this.formData)
const resp = await $.post("/platform/activity/basic/scope/doSetActivityUser", {
data: JSON.stringify(pageForm)
})
if (resp.code === 0) {
this.setDialogVisible = false
await this.getActivityGroup()
this.doSearch()
this.$message.success(resp.msg)
this.formData = this.getDefaultFormData()
} else {
this.$message.error(resp.msg)
this.$refs.setForm.validate((valid) => {
if (!valid) {
return
}
this.settingLoading = false
this.$emit("update:group_id", resp.data)
this.$emit("group_change")
}
if (this.formData.groupType !== 2 && this.tableData.length === 0) {
this.$message.warning("请先指定筛选条件!")
return
}
this.$confirm("是否将符合搜索条件的用户设为活动人员?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
if (this.settingLoading) {
return
}
this.settingLoading = true
const loading = this.$loading({
lock: true,
text: "正在设置活动人员,请稍候...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.65)"
})
const pageForm = this.normalizePageForm(this.pageForm)
Object.assign(pageForm, this.formData)
$.post("/platform/activity/basic/scope/doSetActivityUser", {
data: JSON.stringify(pageForm)
}).then((resp) => {
if (resp.code !== 0) {
// 将后端业务错误转入统一失败分支,直接展示接口返回的真实原因。
throw new Error(resp.msg || "设置活动人员失败")
}
this.setDialogVisible = false
// 设置成功后等待分组和人员列表刷新完成,再解除整页操作锁定。
return this.getActivityGroup()
.then(() => this.doSearch())
.then(() => {
this.$message.success(resp.msg)
this.formData = this.getDefaultFormData()
this.$emit("update:group_id", resp.data)
this.$emit("group_change")
})
}).then(null, (error) => {
// 兼容业务错误、权限异常和网络异常,避免请求失败后页面持续加载。
const response = error && error.responseJSON ? error.responseJSON : null
const errorMessage = response && response.msg
? response.msg
: error && error.message
? error.message
: "设置活动人员失败"
this.$message.error(errorMessage)
}).always(() => {
this.settingLoading = false
loading.close()
})
})
})
},
async getActivityGroup() {
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
@@ -52,6 +52,7 @@ module.exports = {
*/
init() {
this.signatureAddress = origin + "/platform/signature/scanPcCode?id=" + this.id
console.log(this.signatureAddress)
return this.$axios.post("/platform/signature/get")
.then((res) => {
if (this._isBeingDestroyed || this._isDestroyed) {