Commit a1be223b authored by yyh's avatar yyh

删除模板一级字段弹出确认弹框

parent 48418ef9
......@@ -56,15 +56,29 @@ export default class Add extends Vue {
s_image_url: this.baseInfo.imgUrl,
});
}
private confirm() {
this.employ();
}
private employ() {
this.commitTemplate().then((res: any) => {
private async confirm() {
try {
const res = await this.commitTemplate();
this.$dialog.confirm({
title: '提示',
message: '近保存还是去存证',
confirmButtonText: '立即存证',
cancelButtonText: '仅保存',
}).then(() => {
this.$router.push({name: 'ProofDetail', query: {templateId: res.id}});
}).catch( (err: any) => {
this.$toast(err);
}).catch(() => {
this.$router.push({path: '/'});
});
} catch (err) {
this.$toast(err);
}
}
private async employ() {
try {
const res = await this.commitTemplate();
} catch (err) {
this.$toast(err);
}
}
}
</script>
......@@ -186,10 +186,18 @@ export default class Add extends Vue {
const word = parentIndex !== -1 ? this.words[parentIndex] : null;
this.preAddWord({ wordType, word }, 'after');
}
private delWord() {
private async delWord() {
const { index, parentIndex } = this.currentAction;
const tempWords = parentIndex === -1 ? this.words : this.words[parentIndex].data;
tempWords.splice(index, 1);
if (parentIndex === -1 && this.words[index].data.length > 0) {
await this.$dialog.confirm({
title: '提示',
message: '该内容下包含多条字段,确定要删除吗',
confirmButtonText: '确定',
cancelButtonText: '取消',
});
}
return tempWords.splice(index, 1);
}
private confirmWordType({type = DataType.Input, options}: any) {
this.wordType = type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment