<template>
    <div class="u-detail">
        <el-form ref="ruleForm" label-width="120px" label-suffix=":">
            <dg-row :gutter="20">
                <dg-col :span="12">
                    <el-form-item label="方案名称">
                        <div class="u-detail__text">{{ sizeForm.name }}</div>
                    </el-form-item>
                </dg-col>
            </dg-row>
            <dg-row :gutter="20">
                <dg-col :span="12">
                    <el-form-item label="方案状态">
                        <div class="u-detail__text" v-translate="{ code: 'DM_APPLY_STATUS' }">{{ sizeForm.state }}</div>
                    </el-form-item>
                </dg-col>
            </dg-row>
            <dg-row :gutter="20">
                <dg-col :span="12">
                    <el-form-item label="创建时间">
                        <div class="u-detail__text">{{ sizeForm.createTime }}</div>
                    </el-form-item>
                </dg-col>
            </dg-row>
            <dg-row :gutter="20">
                <dg-col :span="12">
                    <el-form-item label="检测规则">
                        <div v-if="sizeForm.type === 'JQBYTJBWZFX'">
                            <p>
                                鉴权时，必要条件不完整。
                            </p>
                            <div>
                                鉴权类型：
                                <dg-radio-group
                                    v-model="sizeForm.authType"
                                    enum="AuthenticationNecessaryParamEnum"
                                    @change="setNecessaryParams"
                                    call-off
                                ></dg-radio-group>
                            </div>
                            <div class="form-inline">
                                <label>必要参数：</label>
                                <dg-checkbox-group
                                    v-model="sizeForm.necessaryParams"
                                    enum="AuthenticationTypeEnum"
                                    disabled
                                ></dg-checkbox-group>
                            </div>
                        </div>
                    </el-form-item>
                </dg-col>
            </dg-row>
            <dg-row :gutter="20">
                <dg-col :span="24">
                    <el-form-item label="风险内容">
                        <div class="u-detail__text">{{ sizeForm.contentFormat }}</div>
                    </el-form-item>
                </dg-col>
            </dg-row>
            <dg-row :gutter="20">
                <dg-col :span="24">
                    <el-form-item label="规则说明">
                        <div class="u-detail__text">{{ sizeForm.ruleExplain }}</div>
                    </el-form-item>
                </dg-col>
            </dg-row>
            <dg-row :gutter="20">
                <dg-col :span="24">
                    <el-form-item label="处理意见">
                        <div class="u-detail__text">{{ sizeForm.handleOpinion }}</div>
                    </el-form-item>
                </dg-col>
            </dg-row>
            <div class="dg-layer-demo" v-footer>
                <dg-button @click="handleClose">取消</dg-button>
            </div>
        </el-form>
    </div>
</template>

<script>
export default {
    name: "auth-risk-detail",
    props: {
        sizeForm: {
            type: Object,
            required: true
        }
    },
    data() {
        return {};
    },
    methods: {
        handleClose() {
            this.$emit("close");
        }
    },
    created() {
        const that = this;
        const { sizeForm } = that;
        // let str = "";
        // policeMsgApi
        //     .businessDetail({
        //         codeDicId: "DM_POLICE_BUSINESS",
        //         columnName: "police_type_id",
        //         columnValue: sizeForm.policeCategory ? sizeForm.policeCategory : "01"
        //     })
        //     .then(res => {
        //         if (sizeForm.policeBusiness) {
        //             if (res && res.length > 0) {
        //                 res.forEach(item => {
        //                     if (sizeForm.policeBusiness.indexOf(item.value) !== -1) {
        //                         str += item.label + ",";
        //                     }
        //                 });
        //                 str = str.slice(0, str.length - 1);
        //             }
        //             that.policeBusinessLabel = str;
        //         }
        //     });
    }
};
</script>

<style lang="scss">
.u-detail {
    .el-form-item {
        margin-bottom: 10px;
    }
}
</style>
