master
parent
14c09a2470
commit
7023d632ff
|
|
@ -0,0 +1,228 @@
|
|||
<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 Task_execute_logApi from '@/pages/sys/task_execute_log/task_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/Task_execute_logForm.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
|
||||
Task_execute_logApi.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
|
||||
Task_execute_logApi.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>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
width="25vw">
|
||||
<ElForm :model="task_execute_logFormData"
|
||||
class="sys_task_execute_log-form"
|
||||
label-width="auto">
|
||||
<ElFormItem label="调度 Id">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.scheduleId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="调度 Id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志等级">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.logLevel"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="日志等级"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志时间">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.logTime"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="日志时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="位置">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.place"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="位置"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="行号">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.line"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="行号"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志信息">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.msg"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="日志信息"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="错误信息">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.err"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="错误信息"/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||
<ElButton v-if="status !== 'view'" :loading="submiting" type="primary" @click="submitHandler">提交</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import Task_execute_logApi from '@/pages/sys/task_execute_log/task_execute_log-api.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const emits = defineEmits([ 'editSucc' ])
|
||||
const showDialog = ref(false)
|
||||
const submiting = ref(false)
|
||||
const status = ref<'add' | 'view' | 'modify'>('add')
|
||||
const task_execute_logFormData = reactive<Task_execute_logTypes.SearchTask_execute_logResult>({})
|
||||
|
||||
function submitHandler() {
|
||||
if (status.value === 'view') return
|
||||
submiting.value = true
|
||||
if (task_execute_logFormData.id != null) {
|
||||
Task_execute_logApi.modify(task_execute_logFormData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
} else {
|
||||
Task_execute_logApi.add(task_execute_logFormData)
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: Task_execute_logTypes.SearchTask_execute_logResult = {}) {
|
||||
showDialog.value = true
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = 'modify'
|
||||
Task_execute_logApi.detail(data.id!)
|
||||
.then(res => {
|
||||
Object.assign(task_execute_logFormData, res.data)
|
||||
})
|
||||
} else {
|
||||
status.value = 'add'
|
||||
Object.assign(task_execute_logFormData, {})
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.sys_task_execute_log-form {
|
||||
padding 20px
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import {
|
||||
get,
|
||||
post,
|
||||
} from '@/common/utils/http-util.ts'
|
||||
|
||||
export default {
|
||||
paging(data: Task_execute_logTypes.SearchTask_execute_logParam) {
|
||||
return get<G.PageResult<Task_execute_logTypes.SearchTask_execute_logResult>>('/sys_task_execute_log/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<Task_execute_logTypes.SearchTask_execute_logResult>('/sys_task_execute_log/detail', {id})
|
||||
},
|
||||
add(data: Task_execute_logTypes.AddTask_execute_logParam) {
|
||||
return post('/sys_task_execute_log/add', data)
|
||||
},
|
||||
modify(data: Task_execute_logTypes.ModifyTask_execute_logParam) {
|
||||
return post('/sys_task_execute_log/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/sys_task_execute_log/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
export {}
|
||||
declare global {
|
||||
namespace Task_execute_logTypes {
|
||||
interface SearchTask_execute_logParam extends G.PageParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 调度 Id
|
||||
scheduleId?: string
|
||||
// 日志等级
|
||||
logLevel?: string
|
||||
// 日志时间
|
||||
logTime?: string
|
||||
// 位置
|
||||
place?: string
|
||||
// 行号
|
||||
line?: number
|
||||
// 日志信息
|
||||
msg?: string
|
||||
// 错误信息
|
||||
err?: string
|
||||
}
|
||||
|
||||
interface SearchTask_execute_logResult {
|
||||
// Id
|
||||
id?: string
|
||||
// 调度 Id
|
||||
scheduleId?: string
|
||||
// 日志等级
|
||||
logLevel?: string
|
||||
// 日志时间
|
||||
logTime?: string
|
||||
// 位置
|
||||
place?: string
|
||||
// 行号
|
||||
line?: number
|
||||
// 日志信息
|
||||
msg?: string
|
||||
// 错误信息
|
||||
err?: string
|
||||
}
|
||||
|
||||
interface AddTask_execute_logParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 调度 Id
|
||||
scheduleId?: string
|
||||
// 日志等级
|
||||
logLevel?: string
|
||||
// 日志时间
|
||||
logTime?: string
|
||||
// 位置
|
||||
place?: string
|
||||
// 行号
|
||||
line?: number
|
||||
// 日志信息
|
||||
msg?: string
|
||||
// 错误信息
|
||||
err?: string
|
||||
}
|
||||
|
||||
interface ModifyTask_execute_logParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 调度 Id
|
||||
scheduleId?: string
|
||||
// 日志等级
|
||||
logLevel?: string
|
||||
// 日志时间
|
||||
logTime?: string
|
||||
// 位置
|
||||
place?: string
|
||||
// 行号
|
||||
line?: number
|
||||
// 日志信息
|
||||
msg?: string
|
||||
// 错误信息
|
||||
err?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default {
|
||||
component: () => import('@/pages/sys/task_execute_log/Task_execute_log.vue'),
|
||||
} as RouterTypes.RouteConfig
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
<template>
|
||||
<Page>
|
||||
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||
<ElFormItem label="任务 Id">
|
||||
<ElInput
|
||||
v-model="searchForm.taskId"
|
||||
placeholder="任务 Id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务名称">
|
||||
<ElInput
|
||||
v-model="searchForm.taskName"
|
||||
placeholder="任务名称"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务执行函数">
|
||||
<ElInput
|
||||
v-model="searchForm.fn"
|
||||
placeholder="任务执行函数"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="调度方式">
|
||||
<ElInput
|
||||
v-model="searchForm.scheduleType"
|
||||
placeholder="调度方式"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="调度配置">
|
||||
<ElInput
|
||||
v-model="searchForm.scheduleConf"
|
||||
placeholder="调度配置"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="调度时间">
|
||||
<ElInput
|
||||
v-model="searchForm.scheduleTime"
|
||||
placeholder="调度时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务开始时间">
|
||||
<ElInput
|
||||
v-model="searchForm.startTime"
|
||||
placeholder="任务开始时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务结束时间">
|
||||
<ElInput
|
||||
v-model="searchForm.endTime"
|
||||
placeholder="任务结束时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务状态">
|
||||
<ElInput
|
||||
v-model="searchForm.taskStatus"
|
||||
placeholder="任务状态"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="是否为内内置任务">
|
||||
<ElInput
|
||||
v-model="searchForm.builtin"
|
||||
placeholder="是否为内内置任务"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="本次调度是否为手动触发">
|
||||
<ElInput
|
||||
v-model="searchForm.manually"
|
||||
placeholder="本次调度是否为手动触发"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="备注">
|
||||
<ElInput
|
||||
v-model="searchForm.memo"
|
||||
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="taskId"/>
|
||||
|
||||
<ElTableColumn label="任务名称" prop="taskName"/>
|
||||
|
||||
<ElTableColumn label="任务执行函数" prop="fn"/>
|
||||
|
||||
<ElTableColumn label="调度方式" prop="scheduleType"/>
|
||||
|
||||
<ElTableColumn label="调度配置" prop="scheduleConf"/>
|
||||
|
||||
<ElTableColumn label="调度时间" prop="scheduleTime"/>
|
||||
|
||||
<ElTableColumn label="任务开始时间" prop="startTime"/>
|
||||
|
||||
<ElTableColumn label="任务结束时间" prop="endTime"/>
|
||||
|
||||
<ElTableColumn label="任务状态" prop="taskStatus"/>
|
||||
|
||||
<ElTableColumn label="是否为内内置任务" prop="builtin"/>
|
||||
|
||||
<ElTableColumn label="本次调度是否为手动触发" prop="manually"/>
|
||||
|
||||
<ElTableColumn label="备注" prop="memo"/>
|
||||
|
||||
<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_schedule_recodeForm ref="task_schedule_recodeForm" @edit-succ="paging"/>
|
||||
</Page>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import Task_schedule_recodeApi from '@/pages/sys/task_schedule_recode/task_schedule_recode-api.ts'
|
||||
import Page from '@/components/page/Page.vue'
|
||||
import { elIcons } from '@/common/element/element.ts'
|
||||
import Task_schedule_recodeForm from '@/pages/sys/task_schedule_recode/Task_schedule_recodeForm.vue'
|
||||
|
||||
const tableData = ref<Task_schedule_recodeTypes.SearchTask_schedule_recodeResult[]>([])
|
||||
const searchForm = reactive<Task_schedule_recodeTypes.SearchTask_schedule_recodeParam>({
|
||||
current: 1,
|
||||
size: 20,
|
||||
})
|
||||
const searching = ref(false)
|
||||
const deling = ref(false)
|
||||
const showSearchForm = ref(true)
|
||||
const task_schedule_recodeFormIns = useTemplateRef<InstanceType<typeof Task_schedule_recodeForm>>('task_schedule_recodeForm')
|
||||
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_schedule_recodeTypes.SearchTask_schedule_recodeResult) {
|
||||
task_schedule_recodeFormIns.value?.open(data)
|
||||
}
|
||||
|
||||
function delHandler({row}: { row: Task_schedule_recodeTypes.SearchTask_schedule_recodeResult }) {
|
||||
deling.value = true
|
||||
Task_schedule_recodeApi.del([ row.id! ])
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
paging()
|
||||
})
|
||||
.finally(() => {
|
||||
deling.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function modifyHandler({row}: { row: Task_schedule_recodeTypes.SearchTask_schedule_recodeResult }) {
|
||||
showDialog(row)
|
||||
}
|
||||
|
||||
function addHandler() {
|
||||
showDialog()
|
||||
}
|
||||
|
||||
function reset() {
|
||||
Object.assign(searchForm, {})
|
||||
paging()
|
||||
}
|
||||
|
||||
function paging() {
|
||||
searching.value = true
|
||||
Task_schedule_recodeApi.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>
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
width="25vw">
|
||||
<ElForm :model="task_schedule_recodeFormData"
|
||||
class="sys_task_schedule_recode-form"
|
||||
label-width="auto">
|
||||
<ElFormItem label="任务 Id">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.taskId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务 Id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务名称">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.taskName"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务名称"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务执行函数">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.fn"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务执行函数"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="调度方式">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.scheduleType"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="调度方式"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="调度配置">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.scheduleConf"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="调度配置"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="调度时间">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.scheduleTime"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="调度时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务开始时间">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.startTime"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务开始时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务结束时间">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.endTime"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务结束时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务状态">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.taskStatus"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务状态"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="是否为内内置任务">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.builtin"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="是否为内内置任务"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="本次调度是否为手动触发">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.manually"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="本次调度是否为手动触发"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="备注">
|
||||
<ElInput
|
||||
v-model="task_schedule_recodeFormData.memo"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="备注"/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||
<ElButton v-if="status !== 'view'" :loading="submiting" type="primary" @click="submitHandler">提交</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import Task_schedule_recodeApi from '@/pages/sys/task_schedule_recode/task_schedule_recode-api.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const emits = defineEmits([ 'editSucc' ])
|
||||
const showDialog = ref(false)
|
||||
const submiting = ref(false)
|
||||
const status = ref<'add' | 'view' | 'modify'>('add')
|
||||
const task_schedule_recodeFormData = reactive<Task_schedule_recodeTypes.SearchTask_schedule_recodeResult>({})
|
||||
|
||||
function submitHandler() {
|
||||
if (status.value === 'view') return
|
||||
submiting.value = true
|
||||
if (task_schedule_recodeFormData.id != null) {
|
||||
Task_schedule_recodeApi.modify(task_schedule_recodeFormData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
} else {
|
||||
Task_schedule_recodeApi.add(task_schedule_recodeFormData)
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: Task_schedule_recodeTypes.SearchTask_schedule_recodeResult = {}) {
|
||||
showDialog.value = true
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = 'modify'
|
||||
Task_schedule_recodeApi.detail(data.id!)
|
||||
.then(res => {
|
||||
Object.assign(task_schedule_recodeFormData, res.data)
|
||||
})
|
||||
} else {
|
||||
status.value = 'add'
|
||||
Object.assign(task_schedule_recodeFormData, {})
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.sys_task_schedule_recode-form {
|
||||
padding 20px
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default {
|
||||
component: () => import('@/pages/sys/task_schedule_recode/Task_schedule_recode.vue'),
|
||||
} as RouterTypes.RouteConfig
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import {
|
||||
get,
|
||||
post,
|
||||
} from '@/common/utils/http-util.ts'
|
||||
|
||||
export default {
|
||||
paging(data: Task_schedule_recodeTypes.SearchTask_schedule_recodeParam) {
|
||||
return get<G.PageResult<Task_schedule_recodeTypes.SearchTask_schedule_recodeResult>>('/sys_task_schedule_recode/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<Task_schedule_recodeTypes.SearchTask_schedule_recodeResult>('/sys_task_schedule_recode/detail', {id})
|
||||
},
|
||||
add(data: Task_schedule_recodeTypes.AddTask_schedule_recodeParam) {
|
||||
return post('/sys_task_schedule_recode/add', data)
|
||||
},
|
||||
modify(data: Task_schedule_recodeTypes.ModifyTask_schedule_recodeParam) {
|
||||
return post('/sys_task_schedule_recode/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/sys_task_schedule_recode/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
export {}
|
||||
declare global {
|
||||
namespace Task_schedule_recodeTypes {
|
||||
interface SearchTask_schedule_recodeParam extends G.PageParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 任务 Id
|
||||
taskId?: string
|
||||
// 任务名称
|
||||
taskName?: string
|
||||
// 任务执行函数
|
||||
fn?: string
|
||||
// 调度方式
|
||||
scheduleType?: string
|
||||
// 调度配置
|
||||
scheduleConf?: string
|
||||
// 调度时间
|
||||
scheduleTime?: string
|
||||
// 任务开始时间
|
||||
startTime?: string
|
||||
// 任务结束时间
|
||||
endTime?: string
|
||||
// 任务状态
|
||||
taskStatus?: string
|
||||
// 是否为内内置任务
|
||||
builtin?: boolean
|
||||
// 本次调度是否为手动触发
|
||||
manually?: boolean
|
||||
// 备注
|
||||
memo?: string
|
||||
}
|
||||
|
||||
interface SearchTask_schedule_recodeResult {
|
||||
// Id
|
||||
id?: string
|
||||
// 任务 Id
|
||||
taskId?: string
|
||||
// 任务名称
|
||||
taskName?: string
|
||||
// 任务执行函数
|
||||
fn?: string
|
||||
// 调度方式
|
||||
scheduleType?: string
|
||||
// 调度配置
|
||||
scheduleConf?: string
|
||||
// 调度时间
|
||||
scheduleTime?: string
|
||||
// 任务开始时间
|
||||
startTime?: string
|
||||
// 任务结束时间
|
||||
endTime?: string
|
||||
// 任务状态
|
||||
taskStatus?: string
|
||||
// 是否为内内置任务
|
||||
builtin?: boolean
|
||||
// 本次调度是否为手动触发
|
||||
manually?: boolean
|
||||
// 备注
|
||||
memo?: string
|
||||
}
|
||||
|
||||
interface AddTask_schedule_recodeParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 任务 Id
|
||||
taskId?: string
|
||||
// 任务名称
|
||||
taskName?: string
|
||||
// 任务执行函数
|
||||
fn?: string
|
||||
// 调度方式
|
||||
scheduleType?: string
|
||||
// 调度配置
|
||||
scheduleConf?: string
|
||||
// 调度时间
|
||||
scheduleTime?: string
|
||||
// 任务开始时间
|
||||
startTime?: string
|
||||
// 任务结束时间
|
||||
endTime?: string
|
||||
// 任务状态
|
||||
taskStatus?: string
|
||||
// 是否为内内置任务
|
||||
builtin?: boolean
|
||||
// 本次调度是否为手动触发
|
||||
manually?: boolean
|
||||
// 备注
|
||||
memo?: string
|
||||
}
|
||||
|
||||
interface ModifyTask_schedule_recodeParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 任务 Id
|
||||
taskId?: string
|
||||
// 任务名称
|
||||
taskName?: string
|
||||
// 任务执行函数
|
||||
fn?: string
|
||||
// 调度方式
|
||||
scheduleType?: string
|
||||
// 调度配置
|
||||
scheduleConf?: string
|
||||
// 调度时间
|
||||
scheduleTime?: string
|
||||
// 任务开始时间
|
||||
startTime?: string
|
||||
// 任务结束时间
|
||||
endTime?: string
|
||||
// 任务状态
|
||||
taskStatus?: string
|
||||
// 是否为内内置任务
|
||||
builtin?: boolean
|
||||
// 本次调度是否为手动触发
|
||||
manually?: boolean
|
||||
// 备注
|
||||
memo?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +1,45 @@
|
|||
<template>
|
||||
<Page>
|
||||
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||
<ElFormItem label="调度 Id">
|
||||
<ElFormItem label="任务名称">
|
||||
<ElInput
|
||||
v-model="searchForm.scheduleId"
|
||||
placeholder="调度 Id"/>
|
||||
v-model="searchForm.taskName"
|
||||
placeholder="任务名称"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务执行函数">
|
||||
<ElInput
|
||||
v-model="searchForm.fn"
|
||||
placeholder="任务执行函数"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志等级">
|
||||
<ElInput
|
||||
v-model="searchForm.logLevel"
|
||||
placeholder="日志等级"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志时间">
|
||||
<ElFormItem label="调度方式">
|
||||
<ElInput
|
||||
v-model="searchForm.logTime"
|
||||
placeholder="日志时间"/>
|
||||
v-model="searchForm.scheduleType"
|
||||
placeholder="调度方式"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="位置">
|
||||
<ElFormItem label="调度配置">
|
||||
<ElInput
|
||||
v-model="searchForm.place"
|
||||
placeholder="位置"/>
|
||||
v-model="searchForm.scheduleConf"
|
||||
placeholder="调度配置"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="行号">
|
||||
<ElFormItem label="临界时间">
|
||||
<ElInput
|
||||
v-model="searchForm.line"
|
||||
placeholder="行号"/>
|
||||
v-model="searchForm.criticalTiming"
|
||||
placeholder="临界时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志信息">
|
||||
<ElFormItem label="是否禁用">
|
||||
<ElInput
|
||||
v-model="searchForm.msg"
|
||||
placeholder="日志信息"/>
|
||||
v-model="searchForm.disabled"
|
||||
placeholder="是否禁用"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="错误信息">
|
||||
<ElFormItem label="备注">
|
||||
<ElInput
|
||||
v-model="searchForm.err"
|
||||
placeholder="错误信息"/>
|
||||
v-model="searchForm.memo"
|
||||
placeholder="备注"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem>
|
||||
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
|
||||
|
|
@ -51,28 +56,30 @@
|
|||
empty-text="暂无数据"
|
||||
header-row-class-name="table-header"
|
||||
row-key="id">
|
||||
<ElTableColumn label="调度 Id" prop="scheduleId"/>
|
||||
<ElTableColumn label="任务名称" prop="taskName"/>
|
||||
|
||||
<ElTableColumn label="任务执行函数" prop="fn"/>
|
||||
|
||||
<ElTableColumn label="日志等级" prop="logLevel"/>
|
||||
|
||||
<ElTableColumn label="日志时间" prop="logTime"/>
|
||||
<ElTableColumn label="调度方式" prop="scheduleType"/>
|
||||
|
||||
<ElTableColumn label="位置" prop="place"/>
|
||||
<ElTableColumn label="调度配置" prop="scheduleConf"/>
|
||||
|
||||
<ElTableColumn label="行号" prop="line"/>
|
||||
<ElTableColumn label="临界时间" prop="criticalTiming"/>
|
||||
|
||||
<ElTableColumn label="日志信息" prop="msg"/>
|
||||
<ElTableColumn label="是否禁用" prop="disabled"/>
|
||||
|
||||
<ElTableColumn label="错误信息" prop="err"/>
|
||||
<ElTableColumn label="备注" prop="memo"/>
|
||||
|
||||
<ElTableColumn label="操作" width="180">
|
||||
<template #default="scope">
|
||||
<div class="action-btn">
|
||||
<el-popconfirm
|
||||
cancel-button-text="否"
|
||||
cancel-button-type="primary"
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
confirm-button-type="danger"
|
||||
confirm-button-text="是"
|
||||
placement="top"
|
||||
title="是否删除当前数据?"
|
||||
width="180"
|
||||
|
|
@ -87,50 +94,49 @@
|
|||
</ElTableColumn>
|
||||
</ElTable>
|
||||
<ElPagination
|
||||
class="pagination"
|
||||
layout="prev, pager, next"
|
||||
: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"/>
|
||||
<TaskForm ref="taskForm" @edit-succ="paging"/>
|
||||
</Page>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import Task_execute_logApi from '@/pages/sys/task_execute_log/task_execute_log-api.ts'
|
||||
import TaskApi from '@/pages/sys/task/task-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/Task_execute_logForm.vue'
|
||||
import TaskForm from '@/pages/sys/task/TaskForm.vue'
|
||||
|
||||
const tableData = ref<Task_execute_logTypes.SearchTask_execute_logResult[]>([])
|
||||
const searchForm = reactive<Task_execute_logTypes.SearchTask_execute_logParam>({
|
||||
const tableData = ref<TaskTypes.SearchTaskResult[]>([])
|
||||
const searchForm = reactive<TaskTypes.SearchTaskParam>({
|
||||
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 taskFormIns = useTemplateRef<InstanceType<typeof TaskForm>>('taskForm')
|
||||
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 showDialog(data?: TaskTypes.SearchTaskResult) {
|
||||
taskFormIns.value?.open(data)
|
||||
}
|
||||
|
||||
function delHandler({row}: { row: Task_execute_logTypes.SearchTask_execute_logResult }) {
|
||||
function delHandler({row}: { row: TaskTypes.SearchTaskResult }) {
|
||||
deling.value = true
|
||||
Task_execute_logApi.del([ row.id! ])
|
||||
TaskApi.del([ row.id! ])
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
paging()
|
||||
|
|
@ -140,22 +146,19 @@ function delHandler({row}: { row: Task_execute_logTypes.SearchTask_execute_logRe
|
|||
})
|
||||
}
|
||||
|
||||
function modifyHandler({row}: { row: Task_execute_logTypes.SearchTask_execute_logResult }) {
|
||||
function modifyHandler({row}: { row: TaskTypes.SearchTaskResult }) {
|
||||
showDialog(row)
|
||||
}
|
||||
|
||||
function addHandler() {
|
||||
showDialog()
|
||||
}
|
||||
|
||||
function reset() {
|
||||
Object.assign(searchForm, {})
|
||||
paging()
|
||||
}
|
||||
|
||||
function paging() {
|
||||
searching.value = true
|
||||
Task_execute_logApi.paging(searchForm)
|
||||
TaskApi.paging(searchForm)
|
||||
.then(res => {
|
||||
tableData.value = res.data?.records ?? []
|
||||
})
|
||||
|
|
@ -163,7 +166,6 @@ function paging() {
|
|||
searching.value = false
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
paging()
|
||||
})
|
||||
|
|
@ -172,21 +174,17 @@ onMounted(() => {
|
|||
.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%;
|
||||
|
|
@ -199,28 +197,23 @@ onMounted(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
: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;
|
||||
|
|
|
|||
|
|
@ -3,50 +3,56 @@
|
|||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
width="25vw">
|
||||
<ElForm :model="task_execute_logFormData"
|
||||
class="sys_task_execute_log-form"
|
||||
<ElForm :model="taskFormData"
|
||||
class="sys_task-form"
|
||||
label-width="auto">
|
||||
<ElFormItem label="调度 Id">
|
||||
<ElFormItem label="任务名称">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.scheduleId"
|
||||
v-model="taskFormData.taskName"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="调度 Id"/>
|
||||
placeholder="任务名称"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务执行函数">
|
||||
<ElInput
|
||||
v-model="taskFormData.fn"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务执行函数"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志等级">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.logLevel"
|
||||
v-model="taskFormData.logLevel"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="日志等级"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志时间">
|
||||
<ElFormItem label="调度方式">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.logTime"
|
||||
v-model="taskFormData.scheduleType"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="日志时间"/>
|
||||
placeholder="调度方式"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="位置">
|
||||
<ElFormItem label="调度配置">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.place"
|
||||
v-model="taskFormData.scheduleConf"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="位置"/>
|
||||
placeholder="调度配置"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="行号">
|
||||
<ElFormItem label="临界时间">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.line"
|
||||
v-model="taskFormData.criticalTiming"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="行号"/>
|
||||
placeholder="临界时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志信息">
|
||||
<ElFormItem label="是否禁用">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.msg"
|
||||
v-model="taskFormData.disabled"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="日志信息"/>
|
||||
placeholder="是否禁用"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="错误信息">
|
||||
<ElFormItem label="备注">
|
||||
<ElInput
|
||||
v-model="task_execute_logFormData.err"
|
||||
v-model="taskFormData.memo"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="错误信息"/>
|
||||
placeholder="备注"/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
|
|
@ -56,7 +62,7 @@
|
|||
</ElDialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import Task_execute_logApi from '@/pages/sys/task_execute_log/task_execute_log-api.ts'
|
||||
import TaskApi from '@/pages/sys/task/task-api.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
|
|
@ -64,13 +70,12 @@ const emits = defineEmits([ 'editSucc' ])
|
|||
const showDialog = ref(false)
|
||||
const submiting = ref(false)
|
||||
const status = ref<'add' | 'view' | 'modify'>('add')
|
||||
const task_execute_logFormData = reactive<Task_execute_logTypes.SearchTask_execute_logResult>({})
|
||||
|
||||
const taskFormData = reactive<TaskTypes.SearchTaskResult>({})
|
||||
function submitHandler() {
|
||||
if (status.value === 'view') return
|
||||
submiting.value = true
|
||||
if (task_execute_logFormData.id != null) {
|
||||
Task_execute_logApi.modify(task_execute_logFormData)
|
||||
if (taskFormData.id != null) {
|
||||
TaskApi.modify(taskFormData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
emits('editSucc')
|
||||
|
|
@ -80,7 +85,7 @@ function submitHandler() {
|
|||
submiting.value = false
|
||||
})
|
||||
} else {
|
||||
Task_execute_logApi.add(task_execute_logFormData)
|
||||
TaskApi.add(taskFormData)
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功')
|
||||
emits('editSucc')
|
||||
|
|
@ -91,25 +96,24 @@ function submitHandler() {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: Task_execute_logTypes.SearchTask_execute_logResult = {}) {
|
||||
open(data: TaskTypes.SearchTaskResult = {}) {
|
||||
showDialog.value = true
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = 'modify'
|
||||
Task_execute_logApi.detail(data.id!)
|
||||
TaskApi.detail(data.id!)
|
||||
.then(res => {
|
||||
Object.assign(task_execute_logFormData, res.data)
|
||||
Object.assign(taskFormData, res.data)
|
||||
})
|
||||
} else {
|
||||
status.value = 'add'
|
||||
Object.assign(task_execute_logFormData, {})
|
||||
Object.assign(taskFormData, {})
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.sys_task_execute_log-form {
|
||||
.sys_task-form {
|
||||
padding 20px
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
export default {
|
||||
component: () => import('@/pages/sys/task_execute_log/Task_execute_log.vue'),
|
||||
component: () => import('@/pages/sys/task/Task.vue'),
|
||||
} as RouterTypes.RouteConfig
|
||||
|
|
|
|||
|
|
@ -4,19 +4,19 @@ import {
|
|||
} from '@/common/utils/http-util.ts'
|
||||
|
||||
export default {
|
||||
paging(data: Task_execute_logTypes.SearchTask_execute_logParam) {
|
||||
return get<G.PageResult<Task_execute_logTypes.SearchTask_execute_logResult>>('/sys_task_execute_log/paging', data)
|
||||
paging(data: TaskTypes.SearchTaskParam) {
|
||||
return get<G.PageResult<TaskTypes.SearchTaskResult>>('/sys_task/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<Task_execute_logTypes.SearchTask_execute_logResult>('/sys_task_execute_log/detail', {id})
|
||||
return get<TaskTypes.SearchTaskResult>('/sys_task/detail', {id})
|
||||
},
|
||||
add(data: Task_execute_logTypes.AddTask_execute_logParam) {
|
||||
return post('/sys_task_execute_log/add', data)
|
||||
add(data: TaskTypes.AddTaskParam) {
|
||||
return post('/sys_task/add', data)
|
||||
},
|
||||
modify(data: Task_execute_logTypes.ModifyTask_execute_logParam) {
|
||||
return post('/sys_task_execute_log/modify', data)
|
||||
modify(data: TaskTypes.ModifyTaskParam) {
|
||||
return post('/sys_task/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/sys_task_execute_log/del', ids)
|
||||
return post('/sys_task/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,80 +1,88 @@
|
|||
export {}
|
||||
declare global {
|
||||
namespace Task_execute_logTypes {
|
||||
interface SearchTask_execute_logParam extends G.PageParam {
|
||||
namespace TaskTypes {
|
||||
interface SearchTaskParam extends G.PageParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 调度 Id
|
||||
scheduleId?: string
|
||||
// 任务名称
|
||||
taskName?: string
|
||||
// 任务执行函数
|
||||
fn?: string
|
||||
// 日志等级
|
||||
logLevel?: string
|
||||
// 日志时间
|
||||
logTime?: string
|
||||
// 位置
|
||||
place?: string
|
||||
// 行号
|
||||
line?: number
|
||||
// 日志信息
|
||||
msg?: string
|
||||
// 错误信息
|
||||
err?: string
|
||||
// 调度方式
|
||||
scheduleType?: string
|
||||
// 调度配置
|
||||
scheduleConf?: string
|
||||
// 临界时间
|
||||
criticalTiming?: string
|
||||
// 是否禁用
|
||||
disabled?: boolean
|
||||
// 备注
|
||||
memo?: string
|
||||
}
|
||||
|
||||
interface SearchTask_execute_logResult {
|
||||
interface SearchTaskResult {
|
||||
// Id
|
||||
id?: string
|
||||
// 调度 Id
|
||||
scheduleId?: string
|
||||
// 任务名称
|
||||
taskName?: string
|
||||
// 任务执行函数
|
||||
fn?: string
|
||||
// 日志等级
|
||||
logLevel?: string
|
||||
// 日志时间
|
||||
logTime?: string
|
||||
// 位置
|
||||
place?: string
|
||||
// 行号
|
||||
line?: number
|
||||
// 日志信息
|
||||
msg?: string
|
||||
// 错误信息
|
||||
err?: string
|
||||
// 调度方式
|
||||
scheduleType?: string
|
||||
// 调度配置
|
||||
scheduleConf?: string
|
||||
// 临界时间
|
||||
criticalTiming?: string
|
||||
// 是否禁用
|
||||
disabled?: boolean
|
||||
// 备注
|
||||
memo?: string
|
||||
}
|
||||
|
||||
interface AddTask_execute_logParam {
|
||||
interface AddTaskParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 调度 Id
|
||||
scheduleId?: string
|
||||
// 任务名称
|
||||
taskName?: string
|
||||
// 任务执行函数
|
||||
fn?: string
|
||||
// 日志等级
|
||||
logLevel?: string
|
||||
// 日志时间
|
||||
logTime?: string
|
||||
// 位置
|
||||
place?: string
|
||||
// 行号
|
||||
line?: number
|
||||
// 日志信息
|
||||
msg?: string
|
||||
// 错误信息
|
||||
err?: string
|
||||
// 调度方式
|
||||
scheduleType?: string
|
||||
// 调度配置
|
||||
scheduleConf?: string
|
||||
// 临界时间
|
||||
criticalTiming?: string
|
||||
// 是否禁用
|
||||
disabled?: boolean
|
||||
// 备注
|
||||
memo?: string
|
||||
}
|
||||
|
||||
interface ModifyTask_execute_logParam {
|
||||
interface ModifyTaskParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 调度 Id
|
||||
scheduleId?: string
|
||||
// 任务名称
|
||||
taskName?: string
|
||||
// 任务执行函数
|
||||
fn?: string
|
||||
// 日志等级
|
||||
logLevel?: string
|
||||
// 日志时间
|
||||
logTime?: string
|
||||
// 位置
|
||||
place?: string
|
||||
// 行号
|
||||
line?: number
|
||||
// 日志信息
|
||||
msg?: string
|
||||
// 错误信息
|
||||
err?: string
|
||||
// 调度方式
|
||||
scheduleType?: string
|
||||
// 调度配置
|
||||
scheduleConf?: string
|
||||
// 临界时间
|
||||
criticalTiming?: string
|
||||
// 是否禁用
|
||||
disabled?: boolean
|
||||
// 备注
|
||||
memo?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue