<template>
    <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
        <detail-list title="" :col="2">
                                                                        <detail-list-item term="设备Id"><a @click="sbIdhandleDetail">{{ model.sbId }}</a></detail-list-item>
                                                                                                            <detail-list-item term="类型">{{ BaseTool.Object.getField(this.typeMap,model.type) }}</detail-list-item>
                                                                                                            <detail-list-item term="状态">{{ BaseTool.Object.getField(this.statusMap,model.status) }}</detail-list-item>
                                                        </detail-list>

        <template slot="footer">
            <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
        </template>
    </a-card>
</template>

<script>
    import DetailList from '@/components/tools/DetailList'
    const DetailListItem = DetailList.Item

    export default {
        name: 'SbInfoStopDetailDetail',
        components: {
            DetailList,
            DetailListItem
        },
        data () {
            return {
                confirmLoading: false,
                mdl: {},
                modalTitle: null,
                visible: false,
                // 下拉框map
                                                                                                                                                                            typeMap: {},
                                                                                                                                        statusMap: {},
                                                                            model: {
                                                                        'sbId': null,
                                                                                                'type': null,
                                                                                                'status': null,
                                                            }
            }
        },
        created () {
            // 下拉框map
            
                                                                                                                                        this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STOP_DETAIL_)
                                                                                                            this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STOP_DETAIL_)
                                                        },
        methods: {
            base (record) {
                this.visible = true
                this.modalTitle = '详情'
                this.model = record
            },
            handleCancel () {
                this.visible = false
                this.confirmLoading = false
            }
                                                                        ,
                                                    sbIdhandleDetail () {
                            const text = this.$router.resolve({
                                name: sbInfo,
                                query: { id: this.model.sbId }
                            })
                            // 打开一个新的页面
                            window.open(text.href, '_blank')
                        }
                                                                                                                                                                                        }
    }
</script>
