<template>
    <div class="add-edit-dialog-container">
        <el-dialog
            :title="title"
            :visible.sync="visible"
            width="600px"
            :before-close="close"
            :close-on-click-modal="false"
        >
            <el-form :model="formData" ref="formData" label-width="90px">
                <el-form-item label="标题:">
                    <span>{{ formData.title }}</span>
                </el-form-item>
                <el-form-item label="专家:">
                    <span>{{ formData.userName }}</span>
                </el-form-item>
                <el-form-item label="品牌:">
                    <span>{{ formData.brandName }}</span>
                </el-form-item>
                <el-form-item label="问题现象:">
                    <span>{{ formData.expression }}</span>
                </el-form-item>
                <el-form-item label="解决方法:">
                    <span>{{ formData.solution }}</span>
                </el-form-item>
                <el-form-item label="图片:">
                    <span @click="imgOpen(formData.imgs)">
                    <el-image
                        v-for="(item, i) in formData.imgs"
                        :key="i"
                        :src="item | pathPipe"
                        style="width:100px;height:100px;cursor:pointer;"
                        class="images"
                    ></el-image>
                    </span>
                </el-form-item>
                <el-form-item prop="statuz" label="启用状态" min-width="110px;">
                    <el-switch
                        v-model="formData.statuz"
                        disabled
                        active-text="是"
                        inactive-text="否"
                        :active-value="1"
                        :inactive-value="0"
                    ></el-switch>
                </el-form-item>
                <el-form-item prop="lockFlag" label="是否打赏" min-width="110px;">
                    <el-switch
                        v-model="formData.lockFlag"
                        disabled
                        active-text="是"
                        inactive-text="否"
                        :active-value="1"
                        :inactive-value="0"
                    ></el-switch>
                </el-form-item>
                <el-form-item label="审核状态:">
                    <div>
                        <span class="warn" v-show="formData.examineFlag === 0">未审核</span>
                        <span class="success" v-show="formData.examineFlag === 1">审核通过</span>
                        <span class="danger" v-show="formData.examineFlag === 2">已驳回</span>
                    </div>
                </el-form-item>
                <el-form-item label="驳回原因:" v-show="formData.examineFlag === 2">
                    <span>{{ formData.notExamineReason }}</span>
                </el-form-item>
            </el-form>
        </el-dialog>
    </div>
</template>
<script>
export default {
    data() {
        return {
            type: null,
            title: '详情',
            submitBtndisabled: false,
            formData: {},
            visible: false,
        };
    },
    methods: {
        open(data) {
            this.formData = { ...data };
            this.formData.imgs = this.formData.imgs;
            this.visible = true;
            console.log(data, 'da');
        },
        close() {
            this.formData = {};
            this.visible = false;
        },
        imgOpen(imgs) {
            window.open(imgs);
        },
    },
};
</script>
<style lang="stylus" scoped>
.add-edit-dialog-container {
    ::v-deep .el-form-item {
        margin-bottom: 0;
    }

    .images {
        margin-right: 5px;
    }
}
</style>
