提交 9e62397c 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 d7128fba
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<slot></slot> <template v-if="Object.is(renderMode, 'TEXT')">
<span class="view__caption__info">
<slot></slot>
</span>
</template>
<template v-else-if="Object.is(renderMode, 'HEADING1')">
<h1 class="view__caption__info">
<slot></slot>
</h1>
</template>
<template v-else-if="Object.is(renderMode, 'HEADING2')">
<h2 class="view__caption__info">
<slot></slot>
</h2>
</template>
<template v-else-if="Object.is(renderMode, 'HEADING3')">
<h3 class="view__caption__info">
<slot></slot>
</h3>
</template>
<template v-else-if="Object.is(renderMode, 'HEADING4')">
<h4 class="view__caption__info">
<slot></slot>
</h4>
</template>
<template v-else-if="Object.is(renderMode, 'HEADING5')">
<h5 class="view__caption__info">
<slot></slot>
</h5>
</template>
<template v-else-if="Object.is(renderMode, 'HEADING6')">
<h6 class="view__caption__info">
<slot></slot>
</h6>
</template>
<template v-else-if="Object.is(renderMode, 'PARAGRAPH')">
<p class="view__caption__info">
<slot></slot>
</p>
</template>
</div> </div>
</template> </template>
...@@ -9,7 +48,6 @@ import { Vue, Component, Prop } from "vue-property-decorator"; ...@@ -9,7 +48,6 @@ import { Vue, Component, Prop } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppPresetCaption extends Vue { export default class AppPresetCaption extends Vue {
/** /**
* 名称 * 名称
* *
...@@ -44,6 +82,19 @@ export default class AppPresetCaption extends Vue { ...@@ -44,6 +82,19 @@ export default class AppPresetCaption extends Vue {
return this.index ? `${this.name}_${this.index}` : this.name; return this.index ? `${this.name}_${this.index}` : this.name;
} }
/**
* 绘制模式
*
* @type {*}
* @memberof AppPresetCaption
*/
get renderMode() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.renderMode || "TEXT";
}
}
/** /**
* 类名 * 类名
* *
...@@ -58,7 +109,7 @@ export default class AppPresetCaption extends Vue { ...@@ -58,7 +109,7 @@ export default class AppPresetCaption extends Vue {
/** /**
* 当前容器样式 * 当前容器样式
* *
* @memberof AppPresetCaption * @memberof AppPresetCaption
*/ */
get curStyle() { get curStyle() {
......
...@@ -55,6 +55,14 @@ export class PanelFieldModel extends PanelDetailModel { ...@@ -55,6 +55,14 @@ export class PanelFieldModel extends PanelDetailModel {
* @memberof PanelFieldModel * @memberof PanelFieldModel
*/ */
public dataItemName: string | undefined = undefined; public dataItemName: string | undefined = undefined;
/**
* 绘制模式
*
* @private
* @type {('TEXT' | 'HEADING1' | 'HEADING2' | 'HEADING3' | 'HEADING4' | 'HEADING5' | 'HEADING6' | 'PARAGRAPH')}
* @memberof PanelFieldModel
*/
public renderMode: 'TEXT' | 'HEADING1' | 'HEADING2' | 'HEADING3' | 'HEADING4' | 'HEADING5' | 'HEADING6' | 'PARAGRAPH' = 'TEXT';
/** /**
* Creates an instance of PanelFieldModel. * Creates an instance of PanelFieldModel.
...@@ -69,6 +77,7 @@ export class PanelFieldModel extends PanelDetailModel { ...@@ -69,6 +77,7 @@ export class PanelFieldModel extends PanelDetailModel {
this.enableCond = opts.enableCond; this.enableCond = opts.enableCond;
this.fieldState = opts.fieldState; this.fieldState = opts.fieldState;
this.dataItemName = opts.dataItemName; this.dataItemName = opts.dataItemName;
this.renderMode = opts.renderMode;
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册