<template>
    <div>
        <el-form label-position="top" :model="data" v-loading="loading" ref="form">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="登录账号">
                        <el-input v-model="value.userid" readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="用户名称">
                        <el-input v-model="value.username" readonly></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="服务器地址">
                        <el-input v-model="value.svrip" readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="服务器名称">
                        <el-input v-model="value.svrname" readonly></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="处理代码">
                        <el-input v-model="value.respcode" readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="处理描述">
                        <el-input v-model="value.respdesc" readonly></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="请求者地址">
                        <el-input v-model="value.reqip" readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="登录类型">
                        <el-input v-model="value.logtype" readonly></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="操作开始时间">
                        <el-input v-model="actsta" readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="操作结束时间">
                        <el-input v-model="actend" readonly></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-form-item label="请求终端类型">
                <el-input v-model="value.devtype" type="textarea" :rows="3" readonly></el-input>
            </el-form-item>
        </el-form>
    </div>
</template>
<script>

export default {
    props: {
        value: Object
    },
    mounted() {
        this.fmt();
    },
    computed: {
        actsta() {
            return this.simpleFormatterDate(this.value.actsta);
        },
        actend() {
            return this.simpleFormatterDate(this.value.actend);
        },
    },
    methods: {
        fmt() {
            this.value.logtype = this.loginFormat(this.value.logtype);
        },
        //登录类型
        loginFormat(par) {
            let stat = "";
            if (this.sysCode.loginType === undefined) {
                this.refresh();
            }
            this.sysCode.loginType.forEach(val => {
                if (par === val.value) {
                    stat = val.label;
                }
            });
            return stat;
        },
        refresh() {
            this.$store.dispatch("base/refreshSysCode", "loginType");
        }
    }
};
</script>
<style lang="scss" scoped>
</style>
