增加定时任务列表页面
parent
7023d632ff
commit
a40a1c25b4
|
|
@ -1,3 +1,3 @@
|
|||
# 后台服务地址
|
||||
VITE_HTTP_PROXY_TARGET=http://localhost:10086
|
||||
VITE_HTTP_PROXY_TARGET=http://192.168.2.124:10086
|
||||
VITE_WS_PROXY_TARGET=ws://localhost:10086
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-config-provider :button="buttonConfig" size="small">
|
||||
<el-config-provider :button="buttonConfig" >
|
||||
<router-view #="{ Component }">
|
||||
<component :is="Component"/>
|
||||
</router-view>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
// ------
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
import { GlobalComponents } from 'vue'
|
||||
|
||||
export {}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,16 +82,17 @@ function loginSubmitHandler() {
|
|||
class="form-content"
|
||||
@submit.prevent="loginSubmitHandler">
|
||||
<ElFormItem prop="account">
|
||||
<ElInput v-model="loginForm.account" placeholder="请输入账号"/>
|
||||
<ElInput size="large" v-model="loginForm.account" placeholder="请输入账号"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem class="mima-input" prop="secret">
|
||||
<ElInput v-model="loginForm.secret" placeholder="请输入密码" show-password type="password"/>
|
||||
<ElInput size="large" v-model="loginForm.secret" placeholder="请输入密码" show-password type="password"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem>
|
||||
<ElButton
|
||||
:loading="loading"
|
||||
class="denglu-btn"
|
||||
native-type="submit"
|
||||
size="large"
|
||||
type="primary">登录
|
||||
</ElButton>
|
||||
</ElFormItem>
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
export default {
|
||||
component: () => import('@/pages/sys/task_execute_log/Task_execute_log.vue'),
|
||||
} as RouterTypes.RouteConfig
|
||||
|
|
@ -1,225 +1,164 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
width="25vw"
|
||||
>
|
||||
<ElForm :model="menuForm"
|
||||
class="menu-form"
|
||||
label-width="auto">
|
||||
<ElDialog v-model="showDialog" :close-on-click-modal="false" destroy-on-close width="25vw">
|
||||
<ElForm :model="menuForm" class="menu-form" label-width="auto">
|
||||
<ElFormItem label="上级">
|
||||
<ElTreeSelect
|
||||
v-model="menuForm.pid"
|
||||
:data="menuTreeDataSource"
|
||||
:default-expanded-keys="['0']"
|
||||
:disabled="status === 'view'"
|
||||
:render-after-expand="false"
|
||||
check-strictly
|
||||
placeholder="选择上级菜单"
|
||||
/>
|
||||
<ElTreeSelect v-model="menuForm.pid" :data="menuTreeDataSource" :default-expanded-keys="['0']" :disabled="status === 'view'" :render-after-expand="false" check-strictly placeholder="选择上级菜单" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="类型">
|
||||
<ElSelect
|
||||
v-model="menuForm.menuCategory"
|
||||
:data="menuCategoryData"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="选择类型"
|
||||
>
|
||||
<ElOption v-for="menuCategory in menuCategoryData" :key="menuCategory.key" :label="menuCategory.label" :value="menuCategory.key"/>
|
||||
<ElSelect v-model="menuForm.menuCategory" :data="menuCategoryData" :disabled="status === 'view'" placeholder="选择类型">
|
||||
<ElOption v-for="menuCategory in menuCategoryData" :key="menuCategory.key" :label="menuCategory.label" :value="menuCategory.key" />
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem label="名称">
|
||||
<ElInput
|
||||
v-model="menuForm.title"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="名称"
|
||||
/>
|
||||
<ElInput v-model="menuForm.title" :disabled="status === 'view'" placeholder="名称" />
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem
|
||||
v-if="menuForm.menuCategory === MenuCategory.Page || menuForm.menuCategory === MenuCategory.SubPage"
|
||||
:disabled="status === 'view'"
|
||||
label="路由名称">
|
||||
<ElInput v-model="menuForm.routeName" :min="0" placeholder="路由名称"/>
|
||||
<ElFormItem v-if="menuForm.menuCategory === MenuCategory.Page || menuForm.menuCategory === MenuCategory.SubPage" :disabled="status === 'view'" label="路由名称">
|
||||
<ElInput v-model="menuForm.routeName" :min="0" placeholder="路由名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem
|
||||
v-if="menuForm.menuCategory === MenuCategory.Page || menuForm.menuCategory === MenuCategory.SubPage"
|
||||
:disabled="status === 'view'"
|
||||
label="路由地址">
|
||||
<ElInput v-model="menuForm.routePath" :min="0" placeholder="路由地址"/>
|
||||
<ElFormItem v-if="menuForm.menuCategory === MenuCategory.Page || menuForm.menuCategory === MenuCategory.SubPage" :disabled="status === 'view'" label="路由地址">
|
||||
<ElInput v-model="menuForm.routePath" :min="0" placeholder="路由地址" />
|
||||
</ElFormItem>
|
||||
<ElFormItem
|
||||
label="编码">
|
||||
<ElInput v-model="menuForm.sn"
|
||||
:disabled="status === 'view'"
|
||||
:min="0" placeholder="编码"/>
|
||||
<ElFormItem label="编码">
|
||||
<ElInput v-model="menuForm.sn" :disabled="status === 'view'" :min="0" placeholder="编码" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="图标">
|
||||
<ElDropdown closable header="图标列表"
|
||||
placement="bottom"
|
||||
style="width: 100%" trigger="click">
|
||||
<ElInput v-model="menuForm.iconName"
|
||||
placeholder="选择图标"
|
||||
:disabled="status === 'view'"
|
||||
readonly>
|
||||
<ElDropdown closable header="图标列表" placement="bottom" style="width: 100%" trigger="click">
|
||||
<ElInput v-model="menuForm.iconName" placeholder="选择图标" :disabled="status === 'view'" readonly>
|
||||
<template #suffix>
|
||||
<AIcon :name="menuForm.icon!"/>
|
||||
<AIcon :name="menuForm.icon!" />
|
||||
</template>
|
||||
</ElInput>
|
||||
<template #dropdown>
|
||||
<div class="dropdown-table-wrapper">
|
||||
<ElTable
|
||||
ref="dropdownTable"
|
||||
:data="iconTableDataSource"
|
||||
empty-text="暂无数据"
|
||||
highlight-current-row
|
||||
style="width: 324px;"
|
||||
@current-change="currentChangeHandler"
|
||||
>
|
||||
<ElTableColumn label="#" type="index"/>
|
||||
<ElTable ref="dropdownTable" :data="iconTableDataSource" empty-text="暂无数据" highlight-current-row style="width: 324px" @current-change="currentChangeHandler">
|
||||
<ElTableColumn label="#" type="index" />
|
||||
<ElTableColumn label="图标" prop="font_class">
|
||||
<template #default="scope">
|
||||
<AIcon :name="scope?.row?.font_class"/>
|
||||
<AIcon :name="scope?.row?.font_class" />
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="名称" prop="name"/>
|
||||
<ElTableColumn label="名称" prop="name" />
|
||||
</ElTable>
|
||||
<ElPagination
|
||||
:page-size="pagination.size"
|
||||
:total="pagination.total"
|
||||
layout="prev, pager, next"
|
||||
@change="pageChangeHandler"/>
|
||||
<ElPagination :page-size="pagination.size" :total="pagination.total" layout="prev, pager, next" @change="pageChangeHandler" />
|
||||
</div>
|
||||
</template>
|
||||
</ElDropdown>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="排序">
|
||||
<ElInputNumber
|
||||
v-model="menuForm.sort"
|
||||
:disabled="status === 'view'"
|
||||
:min="0"
|
||||
placeholder="排序"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<ElInputNumber v-model="menuForm.sort" :disabled="status === 'view'" :min="0" placeholder="排序" style="width: 100%" />
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||
<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 { ref } from 'vue'
|
||||
import {
|
||||
MenuCategory,
|
||||
MenuCategoryDict,
|
||||
} from '@/common/app/constants.ts'
|
||||
import MenuApi from '@/pages/sys/menus/menu-api.ts'
|
||||
import Colls from '@/common/utils/colls.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import {
|
||||
ElMessage,
|
||||
type TableInstance,
|
||||
} from 'element-plus'
|
||||
import {
|
||||
type IconGlyphs,
|
||||
icons,
|
||||
} from '@/components/a-icon/iconfont.ts'
|
||||
import AIcon from '@/components/a-icon/AIcon.tsx'
|
||||
import { ref } from "vue";
|
||||
import { MenuCategory, MenuCategoryDict } from "@/common/app/constants.ts";
|
||||
import MenuApi from "@/pages/sys/menus/menu-api.ts";
|
||||
import Colls from "@/common/utils/colls.ts";
|
||||
import Strings from "@/common/utils/strings.ts";
|
||||
import { ElMessage, type TableInstance } from "element-plus";
|
||||
import { type IconGlyphs, icons } from "@/components/a-icon/iconfont.ts";
|
||||
import AIcon from "@/components/a-icon/AIcon.tsx";
|
||||
|
||||
const pagination = reactive<G.Pagination>({
|
||||
total: icons.glyphs.length,
|
||||
pages: Math.ceil(icons.glyphs.length / 5),
|
||||
current: 1,
|
||||
size: 5,
|
||||
})
|
||||
});
|
||||
|
||||
function pageChangeHandler(currentPage: number, pageSize: number) {
|
||||
pagination.current = currentPage
|
||||
pagination.size = pageSize
|
||||
pagination.current = currentPage;
|
||||
pagination.size = pageSize;
|
||||
iconTableDataSource.value = icons.glyphs.filter((_, i) => {
|
||||
return i >= (currentPage - 1) * pageSize && i < currentPage * pageSize
|
||||
})
|
||||
return i >= (currentPage - 1) * pageSize && i < currentPage * pageSize;
|
||||
});
|
||||
}
|
||||
|
||||
const dropdownTableIns = useTemplateRef<TableInstance>('dropdownTable')
|
||||
const dropdownTableIns = useTemplateRef<TableInstance>("dropdownTable");
|
||||
|
||||
const menuForm = reactive<MenuTypes.MenuForm>({
|
||||
icon: 'dianzixiaopiao',
|
||||
})
|
||||
let menuForm = reactive<MenuTypes.MenuForm>({
|
||||
icon: "dianzixiaopiao",
|
||||
});
|
||||
|
||||
const iconTableDataSource = ref<IconGlyphs[]>(icons.glyphs.filter((_, i) => {
|
||||
return i >= 0 && i < 5
|
||||
}))
|
||||
const iconTableDataSource = ref<IconGlyphs[]>(
|
||||
icons.glyphs.filter((_, i) => {
|
||||
return i >= 0 && i < 5;
|
||||
})
|
||||
);
|
||||
|
||||
function currentChangeHandler(val?: IconGlyphs) {
|
||||
console.log(val)
|
||||
if (val == null) return
|
||||
menuForm.icon = val.font_class
|
||||
menuForm.iconName = val.name
|
||||
console.log(val);
|
||||
if (val == null) return;
|
||||
menuForm.icon = val.font_class;
|
||||
menuForm.iconName = val.name;
|
||||
}
|
||||
|
||||
const showDialog = ref(false)
|
||||
const submiting = ref(false)
|
||||
const status = ref<'add' | 'view' | 'modify'>('add')
|
||||
const showDialog = ref(false);
|
||||
const submiting = ref(false);
|
||||
const status = ref<"add" | "view" | "modify">("add");
|
||||
|
||||
const menuCategoryData = computed(() => {
|
||||
const data: { key: string, label: string }[] = []
|
||||
const data: { key: string; label: string }[] = [];
|
||||
for (const key in MenuCategoryDict) {
|
||||
data.push({
|
||||
key,
|
||||
label: MenuCategoryDict[key as keyof typeof MenuCategoryDict],
|
||||
})
|
||||
});
|
||||
}
|
||||
return data
|
||||
})
|
||||
return data;
|
||||
});
|
||||
|
||||
const menuTreeDataSource = ref<MenuTypes.SysMenu[]>()
|
||||
const menuTreeDataSource = ref<MenuTypes.SysMenu[]>();
|
||||
|
||||
function submitHandler() {
|
||||
if (status.value === 'view') return
|
||||
submiting.value = true
|
||||
if (status.value === "view") return;
|
||||
submiting.value = true;
|
||||
if (menuForm.id != null) {
|
||||
MenuApi.modify(menuForm)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success("修改成功");
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
submiting.value = false;
|
||||
});
|
||||
} else {
|
||||
MenuApi.add(menuForm)
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功')
|
||||
ElMessage.success("添加成功");
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
submiting.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: MenuTypes.MenuForm = {}) {
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = 'modify'
|
||||
status.value = "modify";
|
||||
Object.assign(menuForm, data);
|
||||
} else {
|
||||
menuForm = {};
|
||||
}
|
||||
Object.assign(menuForm, data)
|
||||
showDialog.value = true
|
||||
dropdownTableIns.value?.setCurrentRow(icons.glyphs.find(it => it.font_class === data.icon))
|
||||
showDialog.value = true;
|
||||
dropdownTableIns.value?.setCurrentRow(icons.glyphs.find((it) => it.font_class === data.icon));
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
MenuApi.list()
|
||||
.then(({data}) => {
|
||||
const nodes = Colls.toTree(data.map(it => ({value: it.id, label: it.title, ...it})))
|
||||
menuTreeDataSource.value = [ {value: '0', label: '顶级菜单', id: '0', pid: '0', children: nodes} ]
|
||||
})
|
||||
})
|
||||
|
||||
MenuApi.list().then(({ data }) => {
|
||||
const nodes = Colls.toTree(data.map((it) => ({ value: it.id, label: it.title, ...it })));
|
||||
menuTreeDataSource.value = [{ value: "0", label: "顶级菜单", id: "0", pid: "0", children: nodes }];
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
export default {
|
||||
component: () => import('@/pages/sys/task_schedule_recode/Task_schedule_recode.vue'),
|
||||
} as RouterTypes.RouteConfig
|
||||
|
|
@ -31,11 +31,11 @@
|
|||
v-model="searchForm.criticalTiming"
|
||||
placeholder="临界时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="是否禁用">
|
||||
<!-- <ElFormItem label="是否禁用">
|
||||
<ElInput
|
||||
v-model="searchForm.disabled"
|
||||
placeholder="是否禁用"/>
|
||||
</ElFormItem>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="备注">
|
||||
<ElInput
|
||||
v-model="searchForm.memo"
|
||||
|
|
@ -60,15 +60,22 @@
|
|||
|
||||
<ElTableColumn label="任务执行函数" prop="fn"/>
|
||||
|
||||
<ElTableColumn label="日志等级" prop="logLevel"/>
|
||||
<ElTableColumn label="日志等级" prop="logLevelTxt"/>
|
||||
|
||||
<ElTableColumn label="调度方式" prop="scheduleType"/>
|
||||
<ElTableColumn label="调度方式" prop="scheduleTypeTxt"/>
|
||||
|
||||
<ElTableColumn label="调度配置" prop="scheduleConf"/>
|
||||
|
||||
<ElTableColumn label="临界时间" prop="criticalTiming"/>
|
||||
|
||||
<ElTableColumn label="是否禁用" prop="disabled"/>
|
||||
<ElTableColumn label="是否禁用" width="180">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
{{ scope.disabled?'是':'否' }}
|
||||
<!-- <ElButton text type="primary" @click="modifyHandler(scope)">修改</ElButton> -->
|
||||
</div>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
|
||||
<ElTableColumn label="备注" prop="memo"/>
|
||||
|
||||
|
|
@ -89,6 +96,7 @@
|
|||
</template>
|
||||
</el-popconfirm>
|
||||
<ElButton text type="primary" @click="modifyHandler(scope)">修改</ElButton>
|
||||
<ElButton text type="primary" @click="showRecode(scope.row.id)">调度记录</ElButton>
|
||||
</div>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
|
|
@ -101,6 +109,7 @@
|
|||
:total="pagination.total"
|
||||
@change="pageChangeHandler"/>
|
||||
<TaskForm ref="taskForm" @edit-succ="paging"/>
|
||||
<SchedulerecodeList ref="schedulerecode"/>
|
||||
</Page>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -108,6 +117,7 @@ import TaskApi from '@/pages/sys/task/task-api.ts'
|
|||
import Page from '@/components/page/Page.vue'
|
||||
import { elIcons } from '@/common/element/element.ts'
|
||||
import TaskForm from '@/pages/sys/task/TaskForm.vue'
|
||||
import SchedulerecodeList from '@/pages/sys/task/schedule-recode/SchedulerecodeList.vue'
|
||||
|
||||
const tableData = ref<TaskTypes.SearchTaskResult[]>([])
|
||||
const searchForm = reactive<TaskTypes.SearchTaskParam>({
|
||||
|
|
@ -118,6 +128,7 @@ const searching = ref(false)
|
|||
const deling = ref(false)
|
||||
const showSearchForm = ref(true)
|
||||
const taskFormIns = useTemplateRef<InstanceType<typeof TaskForm>>('taskForm')
|
||||
const SchedulerecodeListIns = useTemplateRef<InstanceType<typeof SchedulerecodeList>>('schedulerecode')
|
||||
const pagination = reactive<G.Pagination>({
|
||||
total: 0,
|
||||
pages: 0,
|
||||
|
|
@ -166,6 +177,13 @@ function paging() {
|
|||
searching.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function showRecode(id:string) {
|
||||
console.log(id,'idd')
|
||||
SchedulerecodeListIns.value?.open(id)
|
||||
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
paging()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,116 +1,116 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
width="25vw">
|
||||
<ElForm :model="taskFormData"
|
||||
class="sys_task-form"
|
||||
label-width="auto">
|
||||
<ElDialog v-model="showDialog" :close-on-click-modal="false" destroy-on-close width="25vw">
|
||||
<ElForm :model="taskFormData" class="sys_task-form" label-width="auto">
|
||||
<ElFormItem label="任务名称">
|
||||
<ElInput
|
||||
v-model="taskFormData.taskName"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务名称"/>
|
||||
<ElInput v-model="taskFormData.taskName" :disabled="status === 'view'" placeholder="任务名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="任务执行函数">
|
||||
<ElInput
|
||||
v-model="taskFormData.fn"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="任务执行函数"/>
|
||||
<ElInput v-model="taskFormData.fn" :disabled="status === 'view'" placeholder="任务执行函数" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="日志等级">
|
||||
<ElInput
|
||||
v-model="taskFormData.logLevel"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="日志等级"/>
|
||||
<el-select v-model="taskFormData.logLevel" placeholder="请选择日志等级">
|
||||
<el-option v-for="item in logLevelList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<!-- <ElInput v-model="taskFormData.logLevel" :disabled="status === 'view'" placeholder="日志等级" /> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="调度方式">
|
||||
<ElInput
|
||||
v-model="taskFormData.scheduleType"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="调度方式"/>
|
||||
<!-- <ElInput v-model="taskFormData.scheduleType" :disabled="status === 'view'" placeholder="调度方式" /> -->
|
||||
<el-select @change="taskFormData.scheduleConf = ''" v-model="taskFormData.scheduleType" placeholder="请选择调度方式">
|
||||
<el-option v-for="item in scheduleTypeList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="调度配置">
|
||||
<ElInput
|
||||
v-model="taskFormData.scheduleConf"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="调度配置"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="临界时间">
|
||||
<ElInput
|
||||
v-model="taskFormData.criticalTiming"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="临界时间"/>
|
||||
<ElFormItem label="调度配置" v-if="taskFormData.scheduleType != 'Manually'">
|
||||
<ElInput v-model="taskFormData.scheduleConf" :disabled="status === 'view'" placeholder="调度配置" />
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="临界时间">
|
||||
<ElInput v-model="taskFormData.criticalTiming" :disabled="status === 'view'" placeholder="临界时间" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="是否禁用">
|
||||
<ElInput
|
||||
<!-- <ElInput
|
||||
v-model="taskFormData.disabled"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="是否禁用"/>
|
||||
placeholder="是否禁用"/> -->
|
||||
|
||||
<el-switch v-model="taskFormData.disabled" active-text="禁用" inactive-text="启用" />
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem label="备注">
|
||||
<ElInput
|
||||
v-model="taskFormData.memo"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="备注"/>
|
||||
<ElInput v-model="taskFormData.memo" :disabled="status === 'view'" placeholder="备注" />
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||
<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 TaskApi from '@/pages/sys/task/task-api.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TaskApi from "@/pages/sys/task/task-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 taskFormData = reactive<TaskTypes.SearchTaskResult>({})
|
||||
const emits = defineEmits(["editSucc"]);
|
||||
const scheduleTypeList = [
|
||||
{ value: "Manually", label: "手动" },
|
||||
{ value: "Fixed", label: "固定周期" },
|
||||
{ value: "Cron", label: "自定义" },
|
||||
];
|
||||
const logLevelList = [
|
||||
{ value: "DEBUG", label: "调试" },
|
||||
{ value: "INFO", label: "普通" },
|
||||
{ value: "WARN", label: "警告" },
|
||||
{ value: "ERROR", label: "错误" },
|
||||
{ value: "OFF", label: "关闭" },
|
||||
];
|
||||
const showDialog = ref(false);
|
||||
const submiting = ref(false);
|
||||
const status = ref<"add" | "view" | "modify">("add");
|
||||
let taskFormData = reactive<TaskTypes.SearchTaskResult>({});
|
||||
function submitHandler() {
|
||||
if (status.value === 'view') return
|
||||
submiting.value = true
|
||||
if (status.value === "view") return;
|
||||
submiting.value = true;
|
||||
if (taskFormData.id != null) {
|
||||
TaskApi.modify(taskFormData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
ElMessage.success("修改成功");
|
||||
emits("editSucc");
|
||||
showDialog.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
submiting.value = false;
|
||||
});
|
||||
} else {
|
||||
TaskApi.add(taskFormData)
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
ElMessage.success("添加成功");
|
||||
emits("editSucc");
|
||||
showDialog.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
submiting.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
open(data: TaskTypes.SearchTaskResult = {}) {
|
||||
showDialog.value = true
|
||||
showDialog.value = true;
|
||||
console.log(!Strings.isBlank(data.id),'dataa')
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = 'modify'
|
||||
TaskApi.detail(data.id!)
|
||||
.then(res => {
|
||||
Object.assign(taskFormData, res.data)
|
||||
})
|
||||
status.value = "modify";
|
||||
TaskApi.detail(data.id!).then((res) => {
|
||||
Object.assign(taskFormData, res.data);
|
||||
});
|
||||
} else {
|
||||
status.value = 'add'
|
||||
Object.assign(taskFormData, {})
|
||||
status.value = "add";
|
||||
taskFormData = reactive({});
|
||||
// taskFormData = {}
|
||||
// for (const key in taskFormData) {
|
||||
// taskFormData[key] = undefined
|
||||
// // delete taskFormData[key]
|
||||
// }
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
.sys_task-form {
|
||||
|
|
|
|||
|
|
@ -97,10 +97,10 @@
|
|||
</Page>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import Task_execute_logApi from '@/pages/sys/task_execute_log/task_execute_log-api.ts'
|
||||
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/Task_execute_logForm.vue'
|
||||
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>({
|
||||
|
|
@ -130,7 +130,7 @@ function showDialog(data?: Task_execute_logTypes.SearchTask_execute_logResult) {
|
|||
|
||||
function delHandler({row}: { row: Task_execute_logTypes.SearchTask_execute_logResult }) {
|
||||
deling.value = true
|
||||
Task_execute_logApi.del([ row.id! ])
|
||||
executeLogApi.del([ row.id! ])
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
paging()
|
||||
|
|
@ -155,7 +155,7 @@ function reset() {
|
|||
|
||||
function paging() {
|
||||
searching.value = true
|
||||
Task_execute_logApi.paging(searchForm)
|
||||
executeLogApi.paging(searchForm)
|
||||
.then(res => {
|
||||
tableData.value = res.data?.records ?? []
|
||||
})
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</ElDialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import Task_execute_logApi from '@/pages/sys/task_execute_log/task_execute_log-api.ts'
|
||||
import Task_execute_logApi from './execute-log-api.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
|
|
@ -5,18 +5,18 @@ import {
|
|||
|
||||
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)
|
||||
return get<G.PageResult<Task_execute_logTypes.SearchTask_execute_logResult>>('/task_execute_log/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<Task_execute_logTypes.SearchTask_execute_logResult>('/sys_task_execute_log/detail', {id})
|
||||
return get<Task_execute_logTypes.SearchTask_execute_logResult>('/task_execute_log/detail', {id})
|
||||
},
|
||||
add(data: Task_execute_logTypes.AddTask_execute_logParam) {
|
||||
return post('/sys_task_execute_log/add', data)
|
||||
return post('/task_execute_log/add', data)
|
||||
},
|
||||
modify(data: Task_execute_logTypes.ModifyTask_execute_logParam) {
|
||||
return post('/sys_task_execute_log/modify', data)
|
||||
return post('/task_execute_log/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/sys_task_execute_log/del', ids)
|
||||
return post('/task_execute_log/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default {
|
||||
component: () => import("@/pages/sys/task/execute-log/Executelog.vue"),
|
||||
} as RouterTypes.RouteConfig;
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog" :close-on-click-modal="false" destroy-on-close width="75vw">
|
||||
<ElTable :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" width="80" />
|
||||
|
||||
<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">
|
||||
<!-- <ElButton text type="primary" @click="modifyHandler(scope)">修改</ElButton> -->
|
||||
</div>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
<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/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>({});
|
||||
const tableData = ref<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(id: string) {
|
||||
console.log(id, "idd");
|
||||
showDialog.value = true;
|
||||
Task_schedule_recodeApi.paging({ taskId: id }).then((res) => {
|
||||
console.log(res.data);
|
||||
// tableData.value=res.data.list
|
||||
// Object.assign(task_schedule_recodeFormData, res.data)
|
||||
});
|
||||
},
|
||||
});
|
||||
</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/Schedulerecode.vue"),
|
||||
} as RouterTypes.RouteConfig;
|
||||
|
|
@ -5,18 +5,18 @@ import {
|
|||
|
||||
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)
|
||||
return get<G.PageResult<Task_schedule_recodeTypes.SearchTask_schedule_recodeResult>>('/task_schedule_recode/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<Task_schedule_recodeTypes.SearchTask_schedule_recodeResult>('/sys_task_schedule_recode/detail', {id})
|
||||
return get<Task_schedule_recodeTypes.SearchTask_schedule_recodeResult>('/task_schedule_recode/detail', {id})
|
||||
},
|
||||
add(data: Task_schedule_recodeTypes.AddTask_schedule_recodeParam) {
|
||||
return post('/sys_task_schedule_recode/add', data)
|
||||
return post('/task_schedule_recode/add', data)
|
||||
},
|
||||
modify(data: Task_schedule_recodeTypes.ModifyTask_schedule_recodeParam) {
|
||||
return post('/sys_task_schedule_recode/modify', data)
|
||||
return post('/task_schedule_recode/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/sys_task_schedule_recode/del', ids)
|
||||
return post('/task_schedule_recode/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
@ -5,18 +5,18 @@ import {
|
|||
|
||||
export default {
|
||||
paging(data: TaskTypes.SearchTaskParam) {
|
||||
return get<G.PageResult<TaskTypes.SearchTaskResult>>('/sys_task/paging', data)
|
||||
return get<G.PageResult<TaskTypes.SearchTaskResult>>('/task/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<TaskTypes.SearchTaskResult>('/sys_task/detail', {id})
|
||||
return get<TaskTypes.SearchTaskResult>('/task/detail', {id})
|
||||
},
|
||||
add(data: TaskTypes.AddTaskParam) {
|
||||
return post('/sys_task/add', data)
|
||||
return post('/task/add', data)
|
||||
},
|
||||
modify(data: TaskTypes.ModifyTaskParam) {
|
||||
return post('/sys_task/modify', data)
|
||||
return post('/task/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/sys_task/del', ids)
|
||||
return post('/task/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue