|
@@ -89,7 +89,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Develop btns -->
|
|
<!-- Develop btns -->
|
|
- <card-config-prop-edit></card-config-prop-edit>
|
|
|
|
|
|
+ <!-- <card-config-prop-edit></card-config-prop-edit> -->
|
|
</div>
|
|
</div>
|
|
<!-- <br /><br /> -->
|
|
<!-- <br /><br /> -->
|
|
<!-- <el-button @click="initCard">新建页面</el-button> -->
|
|
<!-- <el-button @click="initCard">新建页面</el-button> -->
|
|
@@ -258,8 +258,8 @@ import {
|
|
ELEMENT_LIST,
|
|
ELEMENT_LIST,
|
|
TOPIC_LIST
|
|
TOPIC_LIST
|
|
} from "../elementModel";
|
|
} from "../elementModel";
|
|
-import { transformField, getAOrBSystem } from "../enumerate";
|
|
|
|
-import CardConfigPropEdit from "../components/CardConfigPropEdit";
|
|
|
|
|
|
+import { transformField, getAOrBSystem, CARD_VERSION } from "../enumerate";
|
|
|
|
+// import CardConfigPropEdit from "../components/CardConfigPropEdit";
|
|
import TopicElementEdit from "../components/TopicElementEdit";
|
|
import TopicElementEdit from "../components/TopicElementEdit";
|
|
import TopicElementPreview from "../components/TopicElementPreview";
|
|
import TopicElementPreview from "../components/TopicElementPreview";
|
|
import PagePropEdit from "../components/PagePropEdit";
|
|
import PagePropEdit from "../components/PagePropEdit";
|
|
@@ -273,7 +273,7 @@ import TopicSelectDialog from "../components/TopicSelectDialog";
|
|
export default {
|
|
export default {
|
|
name: "card-design",
|
|
name: "card-design",
|
|
components: {
|
|
components: {
|
|
- CardConfigPropEdit,
|
|
|
|
|
|
+ // CardConfigPropEdit,
|
|
TopicElementEdit,
|
|
TopicElementEdit,
|
|
TopicElementPreview,
|
|
TopicElementPreview,
|
|
PagePropEdit,
|
|
PagePropEdit,
|
|
@@ -286,7 +286,6 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- defaultCardId: 1,
|
|
|
|
cardId: this.$route.params.cardId || this.$ls.get("cardId"),
|
|
cardId: this.$route.params.cardId || this.$ls.get("cardId"),
|
|
cardDetailId: this.$ls.get("cardDetailId"),
|
|
cardDetailId: this.$ls.get("cardDetailId"),
|
|
prepareTcPCard: this.$ls.get("prepareTcPCard", {}),
|
|
prepareTcPCard: this.$ls.get("prepareTcPCard", {}),
|
|
@@ -297,7 +296,7 @@ export default {
|
|
columnWidth: 0,
|
|
columnWidth: 0,
|
|
cardPreviewUrl: "",
|
|
cardPreviewUrl: "",
|
|
isSubmit: false,
|
|
isSubmit: false,
|
|
- canSave: true
|
|
|
|
|
|
+ canSave: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -406,7 +405,7 @@ export default {
|
|
};
|
|
};
|
|
if (aOrBSystem !== null) config.aOrBSystem = aOrBSystem;
|
|
if (aOrBSystem !== null) config.aOrBSystem = aOrBSystem;
|
|
config.aOrB = !!config["aOrBSystem"];
|
|
config.aOrB = !!config["aOrBSystem"];
|
|
- this.setCardConfig(data);
|
|
|
|
|
|
+ this.setCardConfig(config);
|
|
},
|
|
},
|
|
addNewTopic(item) {
|
|
addNewTopic(item) {
|
|
let element = getElementModel(item.type);
|
|
let element = getElementModel(item.type);
|
|
@@ -553,10 +552,21 @@ export default {
|
|
|
|
|
|
return true;
|
|
return true;
|
|
},
|
|
},
|
|
|
|
+ getModel() {
|
|
|
|
+ return JSON.stringify(
|
|
|
|
+ {
|
|
|
|
+ version: CARD_VERSION,
|
|
|
|
+ cardConfig: this.cardConfig,
|
|
|
|
+ paperParams: this.paperParams,
|
|
|
|
+ pages: this.pages
|
|
|
|
+ },
|
|
|
|
+ (k, v) => (k.startsWith("_") ? undefined : v)
|
|
|
|
+ );
|
|
|
|
+ },
|
|
async save() {
|
|
async save() {
|
|
if (!this.checkCardValid()) return;
|
|
if (!this.checkCardValid()) return;
|
|
|
|
|
|
- const result = await saveCard(this.getCardData());
|
|
|
|
|
|
+ const result = await saveCard(this.getCardData("", this.getModel()));
|
|
this.cardDetailId = result.cardDetailId;
|
|
this.cardDetailId = result.cardDetailId;
|
|
this.cardId = result.cardId;
|
|
this.cardId = result.cardId;
|
|
this.$ls.set("cardDetailId", this.cardDetailId);
|
|
this.$ls.set("cardDetailId", this.cardDetailId);
|