发布至竞赛调整

This commit is contained in:
fan 2024-03-07 10:15:41 +08:00
parent b0ad026724
commit 89c417ae41

View File

@ -270,10 +270,24 @@ export default {
}).then(suc => {
if (!row.id || !suc.value) { return; }
publishContextSence({dafitid: +row.id, name: suc.value}).then(res => {
publishContextSence({dafitid: +row.id, name: suc.value, forcePublish: false}).then(res => {
this.$message.success('发布至竞赛成功!');
}).catch(err => {
this.$message.error(`发布至竞赛失败!,${err.message}`);
if (err.code == 12000) {
this.$confirm('已有名称重复场景,是否继续发布,继续发布将强行覆盖重复实训?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
publishContextSence({dafitid: +row.id, name: suc.value, forcePublish: true}).then(res => {
this.$message.success('发布至竞赛成功!');
}).catch(() => {
this.$message.error(`发布至竞赛失败!,${err.message}`);
});
}).catch(e => {});
} else {
this.$message.error(`发布至竞赛失败!,${err.message}`);
}
});
});
},