229 lines
5.8 KiB
Vue
229 lines
5.8 KiB
Vue
<template>
|
|
<Page>
|
|
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
|
<ElFormItem label="调度 Id">
|
|
<ElInput
|
|
v-model="searchForm.scheduleId"
|
|
placeholder="调度 Id"/>
|
|
</ElFormItem>
|
|
<ElFormItem label="日志等级">
|
|
<ElInput
|
|
v-model="searchForm.logLevel"
|
|
placeholder="日志等级"/>
|
|
</ElFormItem>
|
|
<ElFormItem label="日志时间">
|
|
<ElInput
|
|
v-model="searchForm.logTime"
|
|
placeholder="日志时间"/>
|
|
</ElFormItem>
|
|
<ElFormItem label="位置">
|
|
<ElInput
|
|
v-model="searchForm.place"
|
|
placeholder="位置"/>
|
|
</ElFormItem>
|
|
<ElFormItem label="行号">
|
|
<ElInput
|
|
v-model="searchForm.line"
|
|
placeholder="行号"/>
|
|
</ElFormItem>
|
|
<ElFormItem label="日志信息">
|
|
<ElInput
|
|
v-model="searchForm.msg"
|
|
placeholder="日志信息"/>
|
|
</ElFormItem>
|
|
<ElFormItem label="错误信息">
|
|
<ElInput
|
|
v-model="searchForm.err"
|
|
placeholder="错误信息"/>
|
|
</ElFormItem>
|
|
<ElFormItem>
|
|
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
|
|
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset">重置</ElButton>
|
|
</ElFormItem>
|
|
</ElForm>
|
|
<div class="tool-bar">
|
|
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler">新建</ElButton>
|
|
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
|
|
</div>
|
|
<ElTable v-loading="searching" :data="tableData"
|
|
cell-class-name="table-cell"
|
|
class="table-list"
|
|
empty-text="暂无数据"
|
|
header-row-class-name="table-header"
|
|
row-key="id">
|
|
<ElTableColumn label="调度 Id" prop="scheduleId"/>
|
|
|
|
<ElTableColumn label="日志等级" prop="logLevel"/>
|
|
|
|
<ElTableColumn label="日志时间" prop="logTime"/>
|
|
|
|
<ElTableColumn label="位置" prop="place"/>
|
|
|
|
<ElTableColumn label="行号" prop="line"/>
|
|
|
|
<ElTableColumn label="日志信息" prop="msg"/>
|
|
|
|
<ElTableColumn label="错误信息" prop="err"/>
|
|
|
|
<ElTableColumn label="操作" width="180">
|
|
<template #default="scope">
|
|
<div class="action-btn">
|
|
<el-popconfirm
|
|
cancel-button-text="否"
|
|
cancel-button-type="primary"
|
|
confirm-button-text="是"
|
|
confirm-button-type="danger"
|
|
placement="top"
|
|
title="是否删除当前数据?"
|
|
width="180"
|
|
@confirm="delHandler(scope)">
|
|
<template #reference>
|
|
<ElButton :loading="deling" text type="danger">删除</ElButton>
|
|
</template>
|
|
</el-popconfirm>
|
|
<ElButton text type="primary" @click="modifyHandler(scope)">修改</ElButton>
|
|
</div>
|
|
</template>
|
|
</ElTableColumn>
|
|
</ElTable>
|
|
<ElPagination
|
|
:page-size="pagination.size"
|
|
:pager-count="pagination.pages"
|
|
:total="pagination.total"
|
|
class="pagination"
|
|
layout="prev, pager, next"
|
|
@change="pageChangeHandler"/>
|
|
<Task_execute_logForm ref="task_execute_logForm" @edit-succ="paging"/>
|
|
</Page>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import executeLogApi from './execute-log-api.ts'
|
|
import Page from '@/components/page/Page.vue'
|
|
import { elIcons } from '@/common/element/element.ts'
|
|
import Task_execute_logForm from '@/pages/sys/task/execute-log/ExecutelogForm.vue'
|
|
|
|
const tableData = ref<Task_execute_logTypes.SearchTask_execute_logResult[]>([])
|
|
const searchForm = reactive<Task_execute_logTypes.SearchTask_execute_logParam>({
|
|
current: 1,
|
|
size: 20,
|
|
})
|
|
const searching = ref(false)
|
|
const deling = ref(false)
|
|
const showSearchForm = ref(true)
|
|
const task_execute_logFormIns = useTemplateRef<InstanceType<typeof Task_execute_logForm>>('task_execute_logForm')
|
|
const pagination = reactive<G.Pagination>({
|
|
total: 0,
|
|
pages: 0,
|
|
current: 1,
|
|
size: 1,
|
|
})
|
|
|
|
function pageChangeHandler(currentPage: number, pageSize: number) {
|
|
searchForm.current = currentPage
|
|
searchForm.size = pageSize
|
|
paging()
|
|
}
|
|
|
|
function showDialog(data?: Task_execute_logTypes.SearchTask_execute_logResult) {
|
|
task_execute_logFormIns.value?.open(data)
|
|
}
|
|
|
|
function delHandler({row}: { row: Task_execute_logTypes.SearchTask_execute_logResult }) {
|
|
deling.value = true
|
|
executeLogApi.del([ row.id! ])
|
|
.then(() => {
|
|
ElMessage.success('删除成功')
|
|
paging()
|
|
})
|
|
.finally(() => {
|
|
deling.value = false
|
|
})
|
|
}
|
|
|
|
function modifyHandler({row}: { row: Task_execute_logTypes.SearchTask_execute_logResult }) {
|
|
showDialog(row)
|
|
}
|
|
|
|
function addHandler() {
|
|
showDialog()
|
|
}
|
|
|
|
function reset() {
|
|
Object.assign(searchForm, {})
|
|
paging()
|
|
}
|
|
|
|
function paging() {
|
|
searching.value = true
|
|
executeLogApi.paging(searchForm)
|
|
.then(res => {
|
|
tableData.value = res.data?.records ?? []
|
|
})
|
|
.finally(() => {
|
|
searching.value = false
|
|
})
|
|
}
|
|
|
|
onMounted(() => {
|
|
paging()
|
|
})
|
|
</script>
|
|
<style lang="stylus" scoped>
|
|
.table-list {
|
|
flex 1;
|
|
width 100%
|
|
|
|
:deep(.table-header) {
|
|
color #454C59
|
|
|
|
th {
|
|
background-color #EDF1F7
|
|
font-weight 500
|
|
position relative
|
|
|
|
& > div {
|
|
display flex
|
|
gap 5px
|
|
align-items center
|
|
}
|
|
|
|
&:not(:first-child) > div::before {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 1px;
|
|
width: 1px;
|
|
background-color: #D3D7DE;
|
|
transform: translateY(-50%);
|
|
content: "";
|
|
height 50%
|
|
}
|
|
}
|
|
}
|
|
|
|
:deep(.table-cell) {
|
|
color #2F3540
|
|
}
|
|
|
|
.action-btn {
|
|
width 100%
|
|
display flex
|
|
flex-wrap wrap
|
|
|
|
& > button {
|
|
margin 0
|
|
}
|
|
}
|
|
}
|
|
|
|
.tool-bar {
|
|
display flex
|
|
justify-content space-between
|
|
margin 0 0 20px 0
|
|
}
|
|
|
|
.pagination {
|
|
justify-content: end;
|
|
margin: 8px;
|
|
}
|
|
</style>
|