|
@@ -55,10 +55,11 @@ import { getPageInitElements } from "../pageModel";
|
|
import { buildCardFromPaperSimpleStruct } from "../autoBuild/simplePaperCard";
|
|
import { buildCardFromPaperSimpleStruct } from "../autoBuild/simplePaperCard";
|
|
import { saveCard } from "../api";
|
|
import { saveCard } from "../api";
|
|
import { getCardHeadModel } from "../elementModel";
|
|
import { getCardHeadModel } from "../elementModel";
|
|
|
|
+import CardHeadSample from "../elements/card-head/CardHead";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "CardBuild",
|
|
name: "CardBuild",
|
|
- components: { CardView, TopicElementPreview },
|
|
|
|
|
|
+ components: { CardView, TopicElementPreview, CardHeadSample },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
cardId: "",
|
|
cardId: "",
|
|
@@ -74,7 +75,13 @@ export default {
|
|
]),
|
|
]),
|
|
cardHeadSampleData() {
|
|
cardHeadSampleData() {
|
|
if (!this.cardConfig["pageSize"]) return;
|
|
if (!this.cardConfig["pageSize"]) return;
|
|
- const data = getCardHeadModel(this.cardConfig);
|
|
|
|
|
|
+ const { templateInfo } = this.cardConfig;
|
|
|
|
+ let cardheadData = templateInfo.elements.find(
|
|
|
|
+ (item) => item.type === "CARD_HEAD"
|
|
|
|
+ );
|
|
|
|
+ cardheadData = cardheadData || {};
|
|
|
|
+ cardheadData = { ...this.cardConfig, ...cardheadData };
|
|
|
|
+ const data = getCardHeadModel(cardheadData);
|
|
data.isSimple = true;
|
|
data.isSimple = true;
|
|
return data;
|
|
return data;
|
|
},
|
|
},
|