moreDialog.vue 3.99 KB
<template>
    <a-modal  title="查看更多"
    v-if='isVisible'
    v-model:visible="isVisible"
    width="1200px"
    height='90%'
    class="detail-modal">
        <a-form :model="queryForm" layout="inline" :label-col="{ style: { width: '80px' } }">
            <a-form-item label="前" style="padding: 5px 0">
                <a-input-number v-model:value="queryForm.content_front" placeholder="请输入" style="width: 180px" :min="1" :max="20" />
            </a-form-item>
            <a-form-item label="后" style="padding: 5px 0">
                <a-input-number v-model:value="queryForm.content_after" placeholder="请输入" style="width: 180px" :min="1" :max="20" />
            </a-form-item>
            <a-form-item style="padding: 5px 0">
                <a-button type="primary" @click="confirmSearch" :loading="isLoading">查询</a-button>
            </a-form-item>
        </a-form>
        <a-table :dataSource="dataList" v-loading="isLoading" :columns="columns" :pagination="false">
        </a-table>
    </a-modal>
</template>

<script>
import {reactive, ref, toRaw} from 'vue'
import moment from 'moment'
import SystemLogApi from '@/views/SystemLog/SystemLog.js'
import {isArray} from '@/PublicUtil/Judgment'
import {filterEmptyValueInObject, formatDate, formatTime} from '@/PublicUtil/PublicUtil'
import {PlusOutlined} from '@ant-design/icons-vue'

const columns = [
    {
        title: '序号',
        dataIndex: 'index',
        align: 'center',
        width: 100
    },
    {
        title: 'apptype',
        dataIndex: 'apptype',
        align: 'center',
        width: 120
    },
    {
        title: '服务名称',
        dataIndex: 'appname',
        align: 'center',
         width: 120
    },
    {
        title: '服务等级',
        dataIndex: 'level',
        align: 'center',
        width: 120
    },
    {
        title: '时间',
        dataIndex: 'time',
        align: 'center',
    },
    {
        title: '线程号',
        dataIndex: 'thread',
        align: 'center',
    },
    {
        title: '日志位置',
        dataIndex: 'location',
        align: 'center',
    },
    {
        title: '日志内容',
        dataIndex: 'content',
        align: 'center',
    },
    {
        title: '日志标识',
        dataIndex: 'id',
        align: 'center',
    }
]

export default {
    components: {
        PlusOutlined,
        VNodes: (_, {attrs}) => {
            return attrs.vnodes
        },
    },
    setup() {
        // scalar
        const isLoading = ref(false)
        const isSuspended = ref(false)
        // sequence
        const dataList = ref([])
        const isVisible = ref(false)
        const queryForm = reactive(
            {
                apptype:'store',
                appname: 'process',
                level: 'info',
                content_like: '',
                date: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD'),
                startTime: moment('00:00:00', 'HH:mm:ss'),
                endTime: moment('23:59:59', 'HH:mm:ss'),
                content_front:10,
                content_after:10,
            }
        )

        const confirmSearch = function(){
            isLoading.value = true
            // SystemLogApi.getLogLimits(data).then(
            //     (r) => {
            //         isLoading.value = false
            //         r.forEach((item,index)=>{
            //             item.index = index+1
            //         })
            //         dataList.value = r
            //     }
            // )
        }
        const initDialog = function() {
            // confirmSearch()
            isVisible.value = true;
        }
        return {
            // scalar
            isLoading,
            isVisible,
            // sequence
            dataList,
            queryForm,
            columns,
            // function
            confirmSearch,
            initDialog
        }
    }
}
</script>

<style lang="less" scoped>
    .success {
        color: #26ff29;
    }
    
    .failed {
        color: red;
    }
</style>