page: 📄 任务调度日志页面
This commit is contained in:
parent
b92e61ed5e
commit
3a7bebc330
|
@ -1,5 +1,5 @@
|
||||||
# 平台本地运行端口号
|
# 平台本地运行端口号
|
||||||
VITE_PORT=7000
|
VITE_PORT=80
|
||||||
|
|
||||||
# 预发布环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数")
|
# 预发布环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数")
|
||||||
VITE_ROUTER_HISTORY="hash"
|
VITE_ROUTER_HISTORY="hash"
|
||||||
|
@ -8,7 +8,7 @@ VITE_ROUTER_HISTORY="hash"
|
||||||
VITE_BASE_API=/admin
|
VITE_BASE_API=/admin
|
||||||
|
|
||||||
# 跨域代理地址
|
# 跨域代理地址
|
||||||
VITE_APP_URL=http://localhost:7070
|
VITE_APP_URL=http://localhost:8000
|
||||||
|
|
||||||
# mock地址
|
# mock地址
|
||||||
VITE_MOCK_BASE_API=/mock
|
VITE_MOCK_BASE_API=/mock
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
# Docker配置详情
|
# Docker配置详情
|
||||||
|
|
||||||

|
如果想更改端口号,前面的对外访问的端口号,后面是容器也就是服务本身端口号
|
||||||
|

|
||||||
|
|
||||||
|
项目本身端口号
|
||||||
|

|
|
@ -1,3 +1,6 @@
|
||||||
|
/**
|
||||||
|
* * 自动创建权限内容
|
||||||
|
*/
|
||||||
(async function requestPath() {
|
(async function requestPath() {
|
||||||
// 获取基础paths对象
|
// 获取基础paths对象
|
||||||
const response = await fetch('http://localhost:7070/v3/api-docs/admin%E7%AE%A1%E7%90%86%E5%91%98%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82', { method: 'GET' });
|
const response = await fetch('http://localhost:7070/v3/api-docs/admin%E7%AE%A1%E7%90%86%E5%91%98%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82', { method: 'GET' });
|
|
@ -16,8 +16,7 @@ server {
|
||||||
|
|
||||||
# 后端跨域请求
|
# 后端跨域请求
|
||||||
location ~/admin/ {
|
location ~/admin/ {
|
||||||
#proxy_pass http://z-bunny.cn:7070;
|
proxy_pass http://172.17.0.1:8000;
|
||||||
proxy_pass http://172.17.0.1:7070;
|
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
|
@ -6,29 +6,34 @@ export const fetchGetMenusList = (data?: any) => {
|
||||||
return http.request<BaseResult<any>>('get', `router/getMenusList`, { params: data });
|
return http.request<BaseResult<any>>('get', `router/getMenusList`, { params: data });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据路由id获取所有角色
|
||||||
|
*/
|
||||||
|
export const fetchGetRoleListByRouterId = data => {
|
||||||
|
return http.request<BaseResult<any>>('get', `routerRole/getRoleListByRouterId`, { params: data });
|
||||||
|
};
|
||||||
|
|
||||||
/** 菜单管理-添加菜单 */
|
/** 菜单管理-添加菜单 */
|
||||||
export const fetchAddMenu = (data?: any) => {
|
export const fetchAddMenu = (data?: any) => {
|
||||||
return http.request<BaseResult<any>>('post', `router/addMenu`, { data });
|
return http.request<BaseResult<any>>('post', `router/addMenu`, { data });
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 菜单管理-更新菜单 */
|
|
||||||
export const fetchUpdateMenu = (data?: any) => {
|
|
||||||
return http.request<BaseResult<any>>('put', `router/updateMenu`, { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 菜单管理-删除菜单 */
|
|
||||||
export const fetchDeletedMenuByIds = (data?: any) => {
|
|
||||||
return http.request<BaseResult<any>>('delete', `router/deletedMenuByIds`, { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 菜单管理-为菜单分配角色 */
|
/** 菜单管理-为菜单分配角色 */
|
||||||
export const fetchAssignRolesToRouter = (data: any) => {
|
export const fetchAssignRolesToRouter = (data: any) => {
|
||||||
return http.request<BaseResult<any>>('post', `routerRole/assignRolesToRouter`, { data });
|
return http.request<BaseResult<any>>('post', `routerRole/assignRolesToRouter`, { data });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/** 菜单管理-更新菜单 */
|
||||||
* 根据路由id获取所有角色
|
export const fetchUpdateMenu = (data?: any) => {
|
||||||
*/
|
return http.request<BaseResult<any>>('put', `router/updateMenu`, { data });
|
||||||
export const fetchGetRoleListByRouterId = data => {
|
};
|
||||||
return http.request<BaseResult<any>>('get', `routerRole/getRoleListByRouterId`, { params: data });
|
|
||||||
|
/** 菜单管理-快速更新菜单排序 */
|
||||||
|
export const fetchUpdateMenuByIdWithRank = (data?: any) => {
|
||||||
|
return http.request<BaseResult<any>>('put', `router/updateMenuByIdWithRank`, { data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 菜单管理-删除菜单 */
|
||||||
|
export const fetchDeletedMenuByIds = (data?: any) => {
|
||||||
|
return http.request<BaseResult<any>>('delete', `router/deletedMenuByIds`, { data });
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { http } from '@/api/service/request';
|
||||||
|
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||||
|
|
||||||
|
/** 调度任务执行日志---获取调度任务执行日志列表 */
|
||||||
|
export const fetchGetQuartzExecuteLogList = (data: any) => {
|
||||||
|
return http.request<BaseResult<ResultTable>>('get', `quartzExecuteLog/getQuartzExecuteLogList/${data.currentPage}/${data.pageSize}`, { params: data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 调度任务执行日志---添加调度任务执行日志 */
|
||||||
|
export const fetchAddQuartzExecuteLog = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('post', 'quartzExecuteLog/addQuartzExecuteLog', { data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 调度任务执行日志---更新调度任务执行日志 */
|
||||||
|
export const fetchUpdateQuartzExecuteLog = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('put', 'quartzExecuteLog/updateQuartzExecuteLog', { data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 调度任务执行日志---删除调度任务执行日志 */
|
||||||
|
export const fetchDeleteQuartzExecuteLog = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('delete', 'quartzExecuteLog/deleteQuartzExecuteLog', { data });
|
||||||
|
};
|
|
@ -0,0 +1,77 @@
|
||||||
|
import { defineStore } from 'pinia';
|
||||||
|
import { fetchAddQuartzExecuteLog, fetchDeleteQuartzExecuteLog, fetchGetQuartzExecuteLogList, fetchUpdateQuartzExecuteLog } from '@/api/v1/quartzExecuteLog';
|
||||||
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
|
import { storeMessage } from '@/utils/message';
|
||||||
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调度任务执行日志 Store
|
||||||
|
*/
|
||||||
|
export const useQuartzExecuteLogStore = defineStore('quartzExecuteLogStore', {
|
||||||
|
state() {
|
||||||
|
return {
|
||||||
|
// 调度任务执行日志列表
|
||||||
|
datalist: [],
|
||||||
|
// 查询表单
|
||||||
|
form: {
|
||||||
|
// 任务名称
|
||||||
|
jobName: undefined,
|
||||||
|
// 任务分组
|
||||||
|
jobGroup: undefined,
|
||||||
|
// 执行任务类名
|
||||||
|
jobClassName: undefined,
|
||||||
|
// 执行任务core表达式
|
||||||
|
cronExpression: undefined,
|
||||||
|
// 触发器名称
|
||||||
|
triggerName: undefined,
|
||||||
|
// 结束时间
|
||||||
|
endTime: undefined,
|
||||||
|
},
|
||||||
|
// 分页查询结果
|
||||||
|
pagination: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 150,
|
||||||
|
total: 100,
|
||||||
|
pageSizes,
|
||||||
|
},
|
||||||
|
// 加载
|
||||||
|
loading: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
getters: {},
|
||||||
|
actions: {
|
||||||
|
/** 获取调度任务执行日志 */
|
||||||
|
async getQuartzExecuteLogList() {
|
||||||
|
// 整理请求参数
|
||||||
|
const data = { ...this.pagination, ...this.form };
|
||||||
|
delete data.pageSizes;
|
||||||
|
delete data.total;
|
||||||
|
delete data.background;
|
||||||
|
|
||||||
|
// 获取调度任务执行日志列表
|
||||||
|
const result = await fetchGetQuartzExecuteLogList(data);
|
||||||
|
|
||||||
|
// 公共页面函数hook
|
||||||
|
const pagination = storePagination.bind(this);
|
||||||
|
return pagination(result);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 添加调度任务执行日志 */
|
||||||
|
async addQuartzExecuteLog(data: any) {
|
||||||
|
const result = await fetchAddQuartzExecuteLog(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 修改调度任务执行日志 */
|
||||||
|
async updateQuartzExecuteLog(data: any) {
|
||||||
|
const result = await fetchUpdateQuartzExecuteLog(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 删除调度任务执行日志 */
|
||||||
|
async deleteQuartzExecuteLog(data: any) {
|
||||||
|
const result = await fetchDeleteQuartzExecuteLog(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,7 +1,7 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { handleTree } from '@/utils/tree';
|
import { handleTree } from '@/utils/tree';
|
||||||
import { fetchAddMenu, fetchAssignRolesToRouter, fetchDeletedMenuByIds, fetchGetMenusList, fetchGetRoleListByRouterId, fetchUpdateMenu } from '@/api/v1/menu';
|
import { fetchAddMenu, fetchAssignRolesToRouter, fetchDeletedMenuByIds, fetchGetMenusList, fetchGetRoleListByRouterId, fetchUpdateMenu, fetchUpdateMenuByIdWithRank } from '@/api/v1/menu';
|
||||||
import { isAllEmpty } from '@pureadmin/utils';
|
import { isAllEmpty } from '@pureadmin/utils';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
|
|
||||||
|
@ -42,6 +42,12 @@ export const userMenuStore = defineStore('menuStore', {
|
||||||
return storeMessage(result);
|
return storeMessage(result);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 快速更新菜单排序 */
|
||||||
|
async updateMenuByIdWithRank(data: object) {
|
||||||
|
const result = await fetchUpdateMenuByIdWithRank(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
|
||||||
/** 删除菜单 */
|
/** 删除菜单 */
|
||||||
async deletedMenuByIds(data: object) {
|
async deletedMenuByIds(data: object) {
|
||||||
const result = await fetchDeletedMenuByIds(data);
|
const result = await fetchDeletedMenuByIds(data);
|
||||||
|
|
|
@ -0,0 +1,138 @@
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import { columns } from '@/views/scheduler/quartzExecuteLog/utils/columns';
|
||||||
|
import PureTableBar from '@/components/TableBar/src/bar';
|
||||||
|
import PureTable from '@pureadmin/table';
|
||||||
|
import { deleteIds, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/scheduler/quartzExecuteLog/utils/hooks';
|
||||||
|
import Delete from '@iconify-icons/ep/delete';
|
||||||
|
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||||
|
import Refresh from '@iconify-icons/ep/refresh';
|
||||||
|
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||||
|
import { $t } from '@/plugins/i18n';
|
||||||
|
import { useQuartzExecuteLogStore } from '@/store/scheduler/quartzExecuteLog';
|
||||||
|
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||||
|
import { FormInstance } from 'element-plus';
|
||||||
|
|
||||||
|
const tableRef = ref();
|
||||||
|
const formRef = ref();
|
||||||
|
const quartzExecuteLogStore = useQuartzExecuteLogStore();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 当前页改变时
|
||||||
|
*/
|
||||||
|
const onCurrentPageChange = async (value: number) => {
|
||||||
|
quartzExecuteLogStore.pagination.currentPage = value;
|
||||||
|
await onSearch();
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 当分页发生变化
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
const onPageSizeChange = async (value: number) => {
|
||||||
|
quartzExecuteLogStore.pagination.pageSize = value;
|
||||||
|
await onSearch();
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 选择多行
|
||||||
|
* @param rows
|
||||||
|
*/
|
||||||
|
const onSelectionChange = (rows: Array<any>) => {
|
||||||
|
deleteIds.value = rows.map((row: any) => row.id);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置表单
|
||||||
|
* @param formEl
|
||||||
|
*/
|
||||||
|
const resetForm = async (formEl: FormInstance | undefined) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
await onSearch();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
onSearch();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="main">
|
||||||
|
<el-form ref="formRef" :inline="true" :model="quartzExecuteLogStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_jobName')" prop="jobName">
|
||||||
|
<el-input v-model="quartzExecuteLogStore.form.jobName" :placeholder="`${$t('input')}${$t('quartzExecuteLog_jobName')}`" class="!w-[180px]" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_jobGroup')" prop="jobGroup">
|
||||||
|
<el-input v-model="quartzExecuteLogStore.form.jobGroup" :placeholder="`${$t('input')}${$t('quartzExecuteLog_jobGroup')}`" class="!w-[180px]" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_jobClassName')" prop="jobClassName">
|
||||||
|
<el-input v-model="quartzExecuteLogStore.form.jobClassName" :placeholder="`${$t('input')}${$t('quartzExecuteLog_jobClassName')}`" class="!w-[180px]" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_cronExpression')" prop="cronExpression">
|
||||||
|
<el-input v-model="quartzExecuteLogStore.form.cronExpression" :placeholder="`${$t('input')}${$t('quartzExecuteLog_cronExpression')}`" class="!w-[180px]" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_triggerName')" prop="triggerName">
|
||||||
|
<el-input v-model="quartzExecuteLogStore.form.triggerName" :placeholder="`${$t('input')}${$t('quartzExecuteLog_triggerName')}`" class="!w-[180px]" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_endTime')" prop="endTime">
|
||||||
|
<el-input v-model="quartzExecuteLogStore.form.endTime" :placeholder="`${$t('input')}${$t('quartzExecuteLog_endTime')}`" class="!w-[180px]" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button :icon="useRenderIcon('ri:search-line')" :loading="quartzExecuteLogStore.loading" type="primary" @click="onSearch"> {{ $t('search') }} </el-button>
|
||||||
|
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<PureTableBar :columns="columns" title="调度任务执行日志" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||||
|
<template #buttons>
|
||||||
|
<!-- 批量删除按钮 -->
|
||||||
|
<el-button v-show="deleteIds.length > 0" :icon="useRenderIcon(Delete)" type="danger" @click="onDeleteBatch">
|
||||||
|
{{ $t('delete_batches') }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot="{ size, dynamicColumns }">
|
||||||
|
<pure-table
|
||||||
|
ref="tableRef"
|
||||||
|
:adaptiveConfig="{ offsetBottom: 96 }"
|
||||||
|
:columns="dynamicColumns"
|
||||||
|
:data="quartzExecuteLogStore.datalist"
|
||||||
|
:header-cell-style="{ background: 'var(--el-fill-color-light)', color: 'var(--el-text-color-primary)' }"
|
||||||
|
:loading="quartzExecuteLogStore.loading"
|
||||||
|
:pagination="quartzExecuteLogStore.pagination"
|
||||||
|
:size="size"
|
||||||
|
adaptive
|
||||||
|
align-whole="center"
|
||||||
|
border
|
||||||
|
highlight-current-row
|
||||||
|
row-key="id"
|
||||||
|
showOverflowTooltip
|
||||||
|
table-layout="auto"
|
||||||
|
@page-size-change="onPageSizeChange"
|
||||||
|
@selection-change="onSelectionChange"
|
||||||
|
@page-current-change="onCurrentPageChange"
|
||||||
|
>
|
||||||
|
<template #createUser="{ row }">
|
||||||
|
<el-button link type="primary" @click="selectUserinfo(row.createUser)">{{ $t('table.createUser') }} </el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #updateUser="{ row }">
|
||||||
|
<el-button link type="primary" @click="selectUserinfo(row.updateUser)">{{ $t('table.updateUser') }} </el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #operation="{ row }">
|
||||||
|
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)"> {{ $t('modify') }} </el-button>
|
||||||
|
<el-popconfirm :title="`${$t('delete')}${row.jobName}?`" @confirm="onDelete(row)">
|
||||||
|
<template #reference>
|
||||||
|
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||||
|
{{ $t('delete') }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</pure-table>
|
||||||
|
</template>
|
||||||
|
</PureTableBar>
|
||||||
|
</div>
|
||||||
|
</template>
|
|
@ -0,0 +1,77 @@
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { FormInstance } from 'element-plus';
|
||||||
|
import { rules } from '@/views/scheduler/quartzExecuteLog/utils/columns';
|
||||||
|
import { FormProps } from '@/views/scheduler/quartzExecuteLog/utils/types';
|
||||||
|
import { $t } from '@/plugins/i18n';
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<FormProps>(), {
|
||||||
|
formInline: () => ({
|
||||||
|
// 任务名称
|
||||||
|
jobName: undefined,
|
||||||
|
// 任务分组
|
||||||
|
jobGroup: undefined,
|
||||||
|
// 执行任务类名
|
||||||
|
jobClassName: undefined,
|
||||||
|
// 执行任务core表达式
|
||||||
|
cronExpression: undefined,
|
||||||
|
// 触发器名称
|
||||||
|
triggerName: undefined,
|
||||||
|
// 执行结果
|
||||||
|
executeResult: undefined,
|
||||||
|
// 执行时间
|
||||||
|
duration: undefined,
|
||||||
|
// 结束时间
|
||||||
|
endTime: undefined,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const form = ref(props.formInline);
|
||||||
|
|
||||||
|
defineExpose({ formRef });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
||||||
|
// 任务名称
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_jobName')" prop="jobName">
|
||||||
|
<el-input v-model="form.jobName" :placeholder="$t('input') + $t('quartzExecuteLog_jobName')" autocomplete="off" type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
// 任务分组
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_jobGroup')" prop="jobGroup">
|
||||||
|
<el-input v-model="form.jobGroup" :placeholder="$t('input') + $t('quartzExecuteLog_jobGroup')" autocomplete="off" type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
// 执行任务类名
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_jobClassName')" prop="jobClassName">
|
||||||
|
<el-input v-model="form.jobClassName" :placeholder="$t('input') + $t('quartzExecuteLog_jobClassName')" autocomplete="off" type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
// 执行任务core表达式
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_cronExpression')" prop="cronExpression">
|
||||||
|
<el-input v-model="form.cronExpression" :placeholder="$t('input') + $t('quartzExecuteLog_cronExpression')" autocomplete="off" type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
// 触发器名称
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_triggerName')" prop="triggerName">
|
||||||
|
<el-input v-model="form.triggerName" :placeholder="$t('input') + $t('quartzExecuteLog_triggerName')" autocomplete="off" type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
// 执行结果
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_executeResult')" prop="executeResult">
|
||||||
|
<el-input v-model="form.executeResult" :placeholder="$t('input') + $t('quartzExecuteLog_executeResult')" autocomplete="off" type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
// 执行时间
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_duration')" prop="duration">
|
||||||
|
<el-input v-model="form.duration" :placeholder="$t('input') + $t('quartzExecuteLog_duration')" autocomplete="off" type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
// 结束时间
|
||||||
|
<el-form-item :label="$t('quartzExecuteLog_endTime')" prop="endTime">
|
||||||
|
<el-input v-model="form.endTime" :placeholder="$t('input') + $t('quartzExecuteLog_endTime')" autocomplete="off" type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
|
@ -0,0 +1,61 @@
|
||||||
|
import { reactive } from 'vue';
|
||||||
|
import { $t } from '@/plugins/i18n';
|
||||||
|
|
||||||
|
// 表格列
|
||||||
|
export const columns: TableColumnList = [
|
||||||
|
{ type: 'selection', align: 'left' },
|
||||||
|
{ type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 },
|
||||||
|
// 任务名称
|
||||||
|
{ label: $t('quartzExecuteLog_jobName'), prop: 'jobName' },
|
||||||
|
// 任务分组
|
||||||
|
{ label: $t('quartzExecuteLog_jobGroup'), prop: 'jobGroup' },
|
||||||
|
// 执行任务类名
|
||||||
|
{ label: $t('quartzExecuteLog_jobClassName'), prop: 'jobClassName' },
|
||||||
|
// 执行任务core表达式
|
||||||
|
{ label: $t('quartzExecuteLog_cronExpression'), prop: 'cronExpression' },
|
||||||
|
// 触发器名称
|
||||||
|
{ label: $t('quartzExecuteLog_triggerName'), prop: 'triggerName' },
|
||||||
|
// 执行结果
|
||||||
|
{ label: $t('quartzExecuteLog_executeResult'), prop: 'executeResult', width: 210 },
|
||||||
|
// 执行时间
|
||||||
|
{ label: $t('quartzExecuteLog_duration'), prop: 'duration' },
|
||||||
|
// 结束时间
|
||||||
|
{ label: $t('quartzExecuteLog_endTime'), prop: 'endTime' },
|
||||||
|
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
||||||
|
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
|
||||||
|
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 90 },
|
||||||
|
{ label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 90 },
|
||||||
|
{ label: $t('table.operation'), fixed: 'right', width: 210, slot: 'operation' },
|
||||||
|
];
|
||||||
|
|
||||||
|
// 添加规则
|
||||||
|
export const rules = reactive({
|
||||||
|
// 任务名称
|
||||||
|
jobName: [{ required: true, message: `${$t('input')}${$t('quartzExecuteLog_jobName')}`, trigger: 'blur' }],
|
||||||
|
// 任务分组
|
||||||
|
jobGroup: [{ required: true, message: `${$t('input')}${$t('quartzExecuteLog_jobGroup')}`, trigger: 'blur' }],
|
||||||
|
// 执行任务类名
|
||||||
|
jobClassName: [{ required: true, message: `${$t('input')}${$t('quartzExecuteLog_jobClassName')}`, trigger: 'blur' }],
|
||||||
|
// 执行任务core表达式
|
||||||
|
cronExpression: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: `${$t('input')}${$t('quartzExecuteLog_cronExpression')}`,
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 触发器名称
|
||||||
|
triggerName: [{ required: true, message: `${$t('input')}${$t('quartzExecuteLog_triggerName')}`, trigger: 'blur' }],
|
||||||
|
// 执行结果
|
||||||
|
executeResult: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: `${$t('input')}${$t('quartzExecuteLog_executeResult')}`,
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 执行时间
|
||||||
|
duration: [{ required: true, message: `${$t('input')}${$t('quartzExecuteLog_duration')}`, trigger: 'blur' }],
|
||||||
|
// 结束时间
|
||||||
|
endTime: [{ required: true, message: `${$t('input')}${$t('quartzExecuteLog_endTime')}`, trigger: 'blur' }],
|
||||||
|
});
|
|
@ -0,0 +1,99 @@
|
||||||
|
import { addDialog } from '@/components/BaseDialog/index';
|
||||||
|
import QuartzExecuteLogDialog from '@/views/scheduler/quartzExecuteLog/quartz-execute-log-dialog.vue';
|
||||||
|
import { useQuartzExecuteLogStore } from '@/store/scheduler/quartzExecuteLog';
|
||||||
|
import { h, ref } from 'vue';
|
||||||
|
import { messageBox } from '@/utils/message';
|
||||||
|
import type { FormItemProps } from '@/views/scheduler/quartzExecuteLog/utils/types';
|
||||||
|
import { $t } from '@/plugins/i18n';
|
||||||
|
|
||||||
|
export const formRef = ref();
|
||||||
|
// 删除ids
|
||||||
|
export const deleteIds = ref([]);
|
||||||
|
const quartzExecuteLogStore = useQuartzExecuteLogStore();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 搜索初始化调度任务执行日志
|
||||||
|
*/
|
||||||
|
export async function onSearch() {
|
||||||
|
quartzExecuteLogStore.loading = true;
|
||||||
|
await quartzExecuteLogStore.getQuartzExecuteLogList();
|
||||||
|
quartzExecuteLogStore.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 更新调度任务执行日志
|
||||||
|
* @param row
|
||||||
|
*/
|
||||||
|
export function onUpdate(row: any) {
|
||||||
|
addDialog({
|
||||||
|
title: `${$t('modify')}${$t('quartzExecuteLog')}`,
|
||||||
|
width: '30%',
|
||||||
|
props: {
|
||||||
|
formInline: {
|
||||||
|
jobName: row.jobName,
|
||||||
|
jobGroup: row.jobGroup,
|
||||||
|
jobClassName: row.jobClassName,
|
||||||
|
cronExpression: row.cronExpression,
|
||||||
|
triggerName: row.triggerName,
|
||||||
|
executeResult: row.executeResult,
|
||||||
|
duration: row.duration,
|
||||||
|
endTime: row.endTime,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
draggable: true,
|
||||||
|
fullscreenIcon: true,
|
||||||
|
closeOnClickModal: false,
|
||||||
|
contentRenderer: () => h(QuartzExecuteLogDialog, { ref: formRef }),
|
||||||
|
beforeSure: (done, { options }) => {
|
||||||
|
const form = options.props.formInline as FormItemProps;
|
||||||
|
formRef.value.formRef.validate(async (valid: any) => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
const result = await quartzExecuteLogStore.updateQuartzExecuteLog({ ...form, id: row.id });
|
||||||
|
if (!result) return;
|
||||||
|
done();
|
||||||
|
await onSearch();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 删除调度任务执行日志
|
||||||
|
*/
|
||||||
|
export const onDelete = async (row: any) => {
|
||||||
|
const id = row.id;
|
||||||
|
|
||||||
|
// 是否确认删除
|
||||||
|
const result = await messageBox({
|
||||||
|
title: $t('confirm_delete'),
|
||||||
|
showMessage: false,
|
||||||
|
confirmMessage: undefined,
|
||||||
|
cancelMessage: $t('cancel_delete'),
|
||||||
|
});
|
||||||
|
if (!result) return;
|
||||||
|
|
||||||
|
// 删除数据
|
||||||
|
await quartzExecuteLogStore.deleteQuartzExecuteLog([id]);
|
||||||
|
await onSearch();
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*/
|
||||||
|
export const onDeleteBatch = async () => {
|
||||||
|
const ids = deleteIds.value;
|
||||||
|
|
||||||
|
// 是否确认删除
|
||||||
|
const result = await messageBox({
|
||||||
|
title: $t('confirm_delete'),
|
||||||
|
showMessage: false,
|
||||||
|
confirmMessage: undefined,
|
||||||
|
cancelMessage: $t('cancel_delete'),
|
||||||
|
});
|
||||||
|
if (!result) return;
|
||||||
|
|
||||||
|
// 删除数据
|
||||||
|
await quartzExecuteLogStore.deleteQuartzExecuteLog(ids);
|
||||||
|
await onSearch();
|
||||||
|
};
|
|
@ -0,0 +1,24 @@
|
||||||
|
// 添加或者修改表单元素
|
||||||
|
export interface FormItemProps {
|
||||||
|
// 任务名称
|
||||||
|
jobName: string;
|
||||||
|
// 任务分组
|
||||||
|
jobGroup: string;
|
||||||
|
// 执行任务类名
|
||||||
|
jobClassName: string;
|
||||||
|
// 执行任务core表达式
|
||||||
|
cronExpression: string;
|
||||||
|
// 触发器名称
|
||||||
|
triggerName: string;
|
||||||
|
// 执行结果
|
||||||
|
executeResult: any;
|
||||||
|
// 执行时间
|
||||||
|
duration: number;
|
||||||
|
// 结束时间
|
||||||
|
endTime: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加或修改表单Props
|
||||||
|
export interface FormProps {
|
||||||
|
formInline: FormItemProps;
|
||||||
|
}
|
|
@ -10,7 +10,7 @@ import EditPen from '@iconify-icons/ep/edit-pen';
|
||||||
import Refresh from '@iconify-icons/ep/refresh';
|
import Refresh from '@iconify-icons/ep/refresh';
|
||||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { useSchedulersStore } from '@/store/monitor/schedulers';
|
import { useSchedulersStore } from '@/store/scheduler/schedulers';
|
||||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import { FormInstance } from 'element-plus';
|
||||||
import { rules } from '@/views/scheduler/schedulers/utils/columns';
|
import { rules } from '@/views/scheduler/schedulers/utils/columns';
|
||||||
import { FormProps } from '@/views/scheduler/schedulers/utils/types';
|
import { FormProps } from '@/views/scheduler/schedulers/utils/types';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { useSchedulersGroupStore } from '@/store/monitor/schedulersGroup';
|
import { useSchedulersGroupStore } from '@/store/scheduler/schedulersGroup';
|
||||||
import { useSchedulersStore } from '@/store/monitor/schedulers';
|
import { useSchedulersStore } from '@/store/scheduler/schedulers';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<FormProps>(), {
|
const props = withDefaults(defineProps<FormProps>(), {
|
||||||
formInline: () => ({
|
formInline: () => ({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { addDialog } from '@/components/BaseDialog/index';
|
import { addDialog } from '@/components/BaseDialog/index';
|
||||||
import SchedulersDialog from '@/views/scheduler/schedulers/schedulers-dialog.vue';
|
import SchedulersDialog from '@/views/scheduler/schedulers/schedulers-dialog.vue';
|
||||||
import { useSchedulersStore } from '@/store/monitor/schedulers';
|
import { useSchedulersStore } from '@/store/scheduler/schedulers';
|
||||||
import { h, ref } from 'vue';
|
import { h, ref } from 'vue';
|
||||||
import { messageBox } from '@/utils/message';
|
import { messageBox } from '@/utils/message';
|
||||||
import type { FormItemProps } from '@/views/scheduler/schedulers/utils/types';
|
import type { FormItemProps } from '@/views/scheduler/schedulers/utils/types';
|
||||||
|
|
|
@ -10,7 +10,7 @@ import EditPen from '@iconify-icons/ep/edit-pen';
|
||||||
import Refresh from '@iconify-icons/ep/refresh';
|
import Refresh from '@iconify-icons/ep/refresh';
|
||||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { useSchedulersGroupStore } from '@/store/monitor/schedulersGroup';
|
import { useSchedulersGroupStore } from '@/store/scheduler/schedulersGroup';
|
||||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { addDialog } from '@/components/BaseDialog/index';
|
import { addDialog } from '@/components/BaseDialog/index';
|
||||||
import SchedulersGroupDialog from '@/views/scheduler/schedulersGroup/schedulers-group-dialog.vue';
|
import SchedulersGroupDialog from '@/views/scheduler/schedulersGroup/schedulers-group-dialog.vue';
|
||||||
import { useSchedulersGroupStore } from '@/store/monitor/schedulersGroup';
|
import { useSchedulersGroupStore } from '@/store/scheduler/schedulersGroup';
|
||||||
import { h, ref } from 'vue';
|
import { h, ref } from 'vue';
|
||||||
import { messageBox } from '@/utils/message';
|
import { messageBox } from '@/utils/message';
|
||||||
import type { FormItemProps } from '@/views/scheduler/schedulersGroup/utils/types';
|
import type { FormItemProps } from '@/views/scheduler/schedulersGroup/utils/types';
|
||||||
|
|
|
@ -6,7 +6,7 @@ import Delete from '@iconify-icons/ep/delete';
|
||||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||||
import Refresh from '@iconify-icons/ep/refresh';
|
import Refresh from '@iconify-icons/ep/refresh';
|
||||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||||
import { assignRolesToRouter, handleDelete, onAdd, onchangeVisible, onSearch, onUpdate, switchLoadMap } from '@/views/system/menu/utils/hooks';
|
import { assignRolesToRouter, handleDelete, onAdd, onChangeMenuRank, onchangeVisible, onSearch, onUpdate, switchLoadMap } from '@/views/system/menu/utils/hooks';
|
||||||
import PureTable from '@pureadmin/table';
|
import PureTable from '@pureadmin/table';
|
||||||
import { columns } from '@/views/system/menu/utils/columns';
|
import { columns } from '@/views/system/menu/utils/columns';
|
||||||
import { userMenuStore } from '@/store/system/menu';
|
import { userMenuStore } from '@/store/system/menu';
|
||||||
|
@ -85,6 +85,10 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template #rank="{ row }">
|
||||||
|
<el-input v-model="row.rank" :max="9999" :min="1" type="number" @change="onChangeMenuRank(row)" />
|
||||||
|
</template>
|
||||||
|
|
||||||
<template #createUser="{ row }">
|
<template #createUser="{ row }">
|
||||||
<el-button link type="primary" @click="selectUserinfo(row.createUser)">{{ $t('table.createUser') }} </el-button>
|
<el-button link type="primary" @click="selectUserinfo(row.createUser)">{{ $t('table.createUser') }} </el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { h, reactive } from 'vue';
|
import { h, reactive } from 'vue';
|
||||||
import type { FormRules } from 'element-plus';
|
import type { FormRules } from 'element-plus';
|
||||||
|
import { ElTag } from 'element-plus';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { isAllEmpty } from '@pureadmin/utils';
|
import { isAllEmpty } from '@pureadmin/utils';
|
||||||
import { getMenuType } from '@/views/system/menu/utils/hooks';
|
import { getMenuType } from '@/views/system/menu/utils/hooks';
|
||||||
|
@ -26,9 +27,9 @@ export const columns: TableColumnList = [
|
||||||
prop: 'menuType',
|
prop: 'menuType',
|
||||||
width: 100,
|
width: 100,
|
||||||
cellRenderer: ({ row, props }) => (
|
cellRenderer: ({ row, props }) => (
|
||||||
<el-tag size={props.size} type={getMenuType(row.menuType)} effect='plain'>
|
<ElTag size={props.size} type={getMenuType(row.menuType)} effect='plain'>
|
||||||
{getMenuType(row.menuType, true)}
|
{getMenuType(row.menuType, true)}
|
||||||
</el-tag>
|
</ElTag>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ label: '路由路径', prop: 'path' },
|
{ label: '路由路径', prop: 'path' },
|
||||||
|
@ -37,13 +38,13 @@ export const columns: TableColumnList = [
|
||||||
prop: 'component',
|
prop: 'component',
|
||||||
formatter: ({ path, component }) => (isAllEmpty(component) ? path : component),
|
formatter: ({ path, component }) => (isAllEmpty(component) ? path : component),
|
||||||
},
|
},
|
||||||
{ label: '排序', prop: 'rank', width: 100 },
|
{ label: '排序', prop: 'rank', width: 80, slot: 'rank' },
|
||||||
{ label: '隐藏', prop: 'visible', slot: 'visible', width: 100 },
|
{ label: '隐藏', prop: 'visible', slot: 'visible', width: 100 },
|
||||||
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true },
|
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true },
|
||||||
{ label: $t('table.createTime'), prop: 'createTime', sortable: true },
|
{ label: $t('table.createTime'), prop: 'createTime', sortable: true },
|
||||||
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 90 },
|
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 90 },
|
||||||
{ label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 90 },
|
{ label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 90 },
|
||||||
{ label: $t('table.operation'), fixed: 'right', width: 210, slot: 'operation' },
|
{ label: $t('table.operation'), fixed: 'right', width: 230, slot: 'operation' },
|
||||||
];
|
];
|
||||||
|
|
||||||
/** 自定义表单规则校验 */
|
/** 自定义表单规则校验 */
|
||||||
|
|
|
@ -20,7 +20,7 @@ const formRef = ref();
|
||||||
* @param type
|
* @param type
|
||||||
* @param text
|
* @param text
|
||||||
*/
|
*/
|
||||||
export const getMenuType = (type, text = false) => {
|
export const getMenuType = (type: number, text: boolean = false): any => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0:
|
case 0:
|
||||||
return text ? '菜单' : 'primary';
|
return text ? '菜单' : 'primary';
|
||||||
|
@ -199,6 +199,27 @@ export const onchangeVisible = async (row: any, index: number) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 更新菜单排序
|
||||||
|
* @param row
|
||||||
|
*/
|
||||||
|
export const onChangeMenuRank = async (row: any) => {
|
||||||
|
const data = { id: row.id, rank: row.rank };
|
||||||
|
|
||||||
|
// 是否确认修改显示状态
|
||||||
|
const confirm = await messageBox({
|
||||||
|
title: $t('confirm_update_sort'),
|
||||||
|
showMessage: false,
|
||||||
|
confirmMessage: undefined,
|
||||||
|
cancelMessage: $t('cancel'),
|
||||||
|
});
|
||||||
|
|
||||||
|
// 取消修改
|
||||||
|
if (!confirm) return;
|
||||||
|
|
||||||
|
await routerStore.updateMenuByIdWithRank(data);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 为路由分配角色
|
* 为路由分配角色
|
||||||
* @param row
|
* @param row
|
||||||
|
|
Loading…
Reference in New Issue