<template>
    <div class="add-edit-dialog-container">
        <el-dialog
            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.expertName }}</span>
                </el-form-item>
                <el-form-item label="评论人:">
                    <span>{{ formData.userName }}</span>
                </el-form-item>
                <el-form-item label="头像:">
                    <span @click="imgOpen(formData.userUrl)"><el-image :src="formData.userUrl | pathPipe" style="width:100px;height:100px;cursor:pointer;"></el-image></span>
                </el-form-item>
                <el-form-item label="评论内容:">
                    <span>{{ formData.comment }}</span>
                </el-form-item>
                <el-form-item label="问题描述:">
                    <span>{{ formData.expression }}</span>
                </el-form-item>
                <el-form-item label="评论时间:">
                    <span>{{ formData.createTime | formatTimePipe }}</span>
                </el-form-item>
                <el-form-item label="是否屏蔽:">
                    <el-switch
                        v-model="formData.statuz"
                        disabled
                        active-text="是"
                        inactive-text="否"
                        :active-value="1"
                        :inactive-value="0"
                    ></el-switch>
                </el-form-item>
            </el-form>
        </el-dialog>
    </div>
</template>
<script>
export default {
    data() {
        return {
            formData: {},
            visible: false,
        };
    },
    methods: {
        open(data) {
            this.formData = Object.assign({}, data);
            this.visible = true;
        },
        close() {
            this.formData = {};
            this.visible = false;
        },
        imgOpen(userUrl) {
            window.open(userUrl);
        }
    },
};
</script>
<style lang="stylus" scoped>
.add-edit-dialog-container {
    ::v-deep .el-form-item {
        margin-bottom: 0;
    }

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