|
@@ -45,6 +45,7 @@ export default {
|
|
cardType: "CUSTOM",
|
|
cardType: "CUSTOM",
|
|
cardCreateMethod: "STANDARD",
|
|
cardCreateMethod: "STANDARD",
|
|
cardContent: {},
|
|
cardContent: {},
|
|
|
|
+ cardName: "", // 题卡自定义名称
|
|
cardPreviewUrl: "",
|
|
cardPreviewUrl: "",
|
|
canSave: false,
|
|
canSave: false,
|
|
dataReady: false
|
|
dataReady: false
|
|
@@ -93,6 +94,7 @@ export default {
|
|
cardConfig,
|
|
cardConfig,
|
|
paperParams: {}
|
|
paperParams: {}
|
|
};
|
|
};
|
|
|
|
+ this.cardName = "";
|
|
}
|
|
}
|
|
this.dataReady = true;
|
|
this.dataReady = true;
|
|
},
|
|
},
|
|
@@ -112,6 +114,7 @@ export default {
|
|
// 可能存在题卡内容没有记录的情况
|
|
// 可能存在题卡内容没有记录的情况
|
|
if (detData.content) {
|
|
if (detData.content) {
|
|
this.cardContent = JSON.parse(detData.content);
|
|
this.cardContent = JSON.parse(detData.content);
|
|
|
|
+ this.cardName = detData.title;
|
|
} else {
|
|
} else {
|
|
let cardConfig = await this.getCardConfig();
|
|
let cardConfig = await this.getCardConfig();
|
|
// 没有题卡内容时,直接创建新的内容
|
|
// 没有题卡内容时,直接创建新的内容
|
|
@@ -123,6 +126,7 @@ export default {
|
|
cardConfig,
|
|
cardConfig,
|
|
paperParams: {}
|
|
paperParams: {}
|
|
};
|
|
};
|
|
|
|
+ this.cardName = "";
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async getCardConfig() {
|
|
async getCardConfig() {
|
|
@@ -184,7 +188,8 @@ export default {
|
|
getCardInfo(data) {
|
|
getCardInfo(data) {
|
|
let cardInfo = {
|
|
let cardInfo = {
|
|
...data,
|
|
...data,
|
|
- ...this.prepareTcPCard
|
|
|
|
|
|
+ ...this.prepareTcPCard,
|
|
|
|
+ title: this.cardName
|
|
};
|
|
};
|
|
if (this.cardId) cardInfo.id = this.cardId;
|
|
if (this.cardId) cardInfo.id = this.cardId;
|
|
return cardInfo;
|
|
return cardInfo;
|
|
@@ -218,10 +223,19 @@ export default {
|
|
this.$message.success("保存成功!");
|
|
this.$message.success("保存成功!");
|
|
},
|
|
},
|
|
async toSubmit(cardData) {
|
|
async toSubmit(cardData) {
|
|
- const res = await this.$confirm("确定要提交当前题卡吗?", "提示", {
|
|
|
|
- type: "warning"
|
|
|
|
|
|
+ const res = await this.$prompt("确定要提交当前题卡吗?", "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ showInput: true,
|
|
|
|
+ inputPlaceholder: "请输入题卡名称",
|
|
|
|
+ inputValue: this.cardName,
|
|
|
|
+ inputValidator: val => {
|
|
|
|
+ if (!val) return "请输入题卡名称!";
|
|
|
|
+ if (val.length > 50) return "题卡名称不得超过50个字符!";
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
- if (res !== "confirm") return;
|
|
|
|
|
|
+ if (!res || res.action !== "confirm") return;
|
|
|
|
+ this.cardName = res.value;
|
|
|
|
|
|
this.$refs.CardDesign.loading();
|
|
this.$refs.CardDesign.loading();
|
|
window.cardData = {
|
|
window.cardData = {
|
|
@@ -261,6 +275,7 @@ export default {
|
|
this.$refs.CardDesign.unloading();
|
|
this.$refs.CardDesign.unloading();
|
|
window.cardData = null;
|
|
window.cardData = null;
|
|
if (result) {
|
|
if (result) {
|
|
|
|
+ this.cardName = "";
|
|
this.cardId = result;
|
|
this.cardId = result;
|
|
this.$ls.set("cardId", this.cardId);
|
|
this.$ls.set("cardId", this.cardId);
|
|
this.canSave = false;
|
|
this.canSave = false;
|