"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cheerio = require("cheerio");
const Base_1 = require("../Base");
class PageHeader extends Base_1.default {
    constructor(data, storage) {
        super(storage);
        this.name = 'PageHeader';
        this.components = [];
        this.type = 'inline';
        this.previewType = 0;
        this.labelValue = '详情页面';
        this.config = {};
        const { params } = data;
        this.config = {
            label: '详情页面'
        };
        this.$fragment = cheerio.load(`
        <el-page-header content="">
          <edit-text-box
            slot="content"
            :clearClass="true" 
            uuid="${this.uuid}">
            ${this.config.label}
          </edit-text-box>
        </el-page-header>
      `, {
            xmlMode: true,
            decodeEntities: false
        });
    }
    setLabel(labelValue) {
        this.labelValue = labelValue;
    }
    insertEditText(params) {
        this.config.label = params.value;
    }
    setPreview() {
        const type = this.storage.get('preview_view_status') || 0;
        if (type === 0) {
            this.$fragment = cheerio.load(`
        <el-page-header content="">
          <edit-text-box 
            slot="content"
            :clearClass="true" 
            uuid="${this.uuid}">
            ${this.config.label}
          </edit-text-box>
        </el-page-header>
        `, {
                xmlMode: true,
                decodeEntities: false
            });
        }
        else {
            this.$fragment = cheerio.load(` <el-page-header content="${this.labelValue}">
          </el-page-header>
        `, {
                xmlMode: true,
                decodeEntities: false
            });
        }
    }
}
exports.default = PageHeader;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbGliL2FkYXB0ZXItdnVlL21vZHVsZXMvYm94L1BhZ2VIZWFkZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSxtQ0FBbUM7QUFDbkMsa0NBQTJCO0FBRTNCLE1BQXFCLFVBQVcsU0FBUSxjQUFJO0lBUzFDLFlBQWEsSUFBUyxFQUFFLE9BQVk7UUFDbEMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFBO1FBVGhCLFNBQUksR0FBV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