😎1、增加作业触发器运行日志清空 2、增加强制修改密码框退出

This commit is contained in:
zuohuaijun 2025-01-08 22:38:31 +08:00
parent cd66255bd2
commit 13876cd372
13 changed files with 197 additions and 31 deletions

View File

@ -356,4 +356,15 @@ public class SysJobService : IDynamicApiController, ITransient
.OrderByDescending(u => u.Id)
.ToPagedListAsync(input.Page, input.PageSize);
}
/// <summary>
/// 清空作业触发器运行记录 🔖
/// </summary>
/// <returns></returns>
[ApiDescriptionSettings(Name = "ClearJobTriggerRecord"), HttpPost]
[DisplayName("清空作业触发器运行记录")]
public void ClearJobTriggerRecord()
{
_sysJobTriggerRecordRep.AsSugarClient().DbMaintenance.TruncateTable<SysJobTriggerRecord>();
}
}

View File

@ -225,6 +225,49 @@ export const SysJobApiAxiosParamCreator = function (configuration?: Configuratio
options: localVarRequestOptions,
};
},
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysJobClearJobTriggerRecordPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysJob/clearJobTriggerRecord`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary
@ -1080,6 +1123,19 @@ export const SysJobApiFp = function(configuration?: Configuration) {
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysJobClearJobTriggerRecordPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysJobApiAxiosParamCreator(configuration).apiSysJobClearJobTriggerRecordPost(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary
@ -1361,6 +1417,15 @@ export const SysJobApiFactory = function (configuration?: Configuration, basePat
async apiSysJobCancelSleepPost(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysJobApiFp(configuration).apiSysJobCancelSleepPost(options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysJobClearJobTriggerRecordPost(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysJobApiFp(configuration).apiSysJobClearJobTriggerRecordPost(options).then((request) => request(axios, basePath));
},
/**
*
* @summary
@ -1579,6 +1644,16 @@ export class SysJobApi extends BaseAPI {
public async apiSysJobCancelSleepPost(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysJobApiFp(this.configuration).apiSysJobCancelSleepPost(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysJobApi
*/
public async apiSysJobClearJobTriggerRecordPost(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysJobApiFp(this.configuration).apiSysJobClearJobTriggerRecordPost(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary

View File

@ -86,6 +86,14 @@ export interface AddNoticeInput {
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof AddNoticeInput
*/
tenantId?: number | null;
/**
*
*

View File

@ -76,7 +76,7 @@ export interface SysJobTriggerRecord {
status?: TriggerStatus;
/**
*
*
*
* @type {string}
* @memberof SysJobTriggerRecord
@ -84,7 +84,7 @@ export interface SysJobTriggerRecord {
result?: string | null;
/**
*
*
*
* @type {number}
* @memberof SysJobTriggerRecord

View File

@ -86,6 +86,14 @@ export interface SysNotice {
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof SysNotice
*/
tenantId?: number | null;
/**
*
*

View File

@ -86,6 +86,14 @@ export interface UpdateNoticeInput {
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof UpdateNoticeInput
*/
tenantId?: number | null;
/**
*
*

View File

@ -76,7 +76,7 @@
<el-dropdown-item :icon="Avatar" command="/system/userCenter">{{ $t('message.user.dropdown2') }}</el-dropdown-item>
<el-dropdown-item :icon="Loading" command="clearCache">{{ $t('message.user.dropdown3') }}</el-dropdown-item>
<el-dropdown-item :icon="Lock" divided command="lockScreen">{{ $t('message.layout.threeIsLockScreen') }}</el-dropdown-item>
<el-dropdown-item :icon="CircleCloseFilled" divided command="logOut">{{ $t('message.user.dropdown5') }}</el-dropdown-item>
<el-dropdown-item :icon="CircleCloseFilled" divided command="logut">{{ $t('message.user.dropdown5') }}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>

View File

@ -216,7 +216,9 @@
</template>
<el-card class="full-table" shadow="hover">
<vxe-grid ref="xGridRecord" class="xGrid-style" v-bind="optionsRecord" v-on="gridEventsRecord">
<template #toolbar_buttons></template>
<template #toolbar_buttons>
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClearJobTriggerRecord"> 清空 </el-button>
</template>
<template #toolbar_tools> </template>
<template #empty>
<el-empty :image-size="200" />
@ -569,13 +571,13 @@ const optionsRecord = useVxeTable<SysJobTriggerRecord>(
}
);
// api
// api-
const handleQueryRecordApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
const params = Object.assign(state.recordPageParam, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageJobTriggerRecordInput;
return getAPI(SysJobApi).apiSysJobPageJobTriggerRecordPost(params);
};
//
// -
const handleQueryRecord = async () => {
await xGridRecord.value?.commitProxy('query');
};
@ -591,6 +593,23 @@ const gridEventsRecord: VxeGridListeners<SysJobTriggerRecord> = {
state.recordPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
},
};
//
const handleClearJobTriggerRecord = async () => {
ElMessageBox.confirm(`确定要清空日志?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
optionsRecord.loading = true;
await getAPI(SysJobApi).apiSysJobClearJobTriggerRecordPost();
optionsRecord.loading = false;
ElMessage.success('清空成功');
await handleQueryRecord();
})
.catch(() => {});
};
</script>
<style>

View File

@ -118,7 +118,7 @@
<script lang="ts" setup name="sysLogEx">
import { onMounted, reactive, ref } from 'vue';
import { ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
@ -252,11 +252,19 @@ const gridEvents: VxeGridListeners<SysLogEx> = {
//
const handleClear = async () => {
ElMessageBox.confirm(`确定要清空日志?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
options.loading = true;
await getAPI(SysLogExApi).apiSysLogExClearPost();
options.loading = false;
ElMessage.success('清空成功');
await handleQuery();
})
.catch(() => {});
};
//

View File

@ -83,7 +83,7 @@
<script lang="ts" setup name="sysLogMsg">
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
@ -292,11 +292,19 @@ const gridEvents: VxeGridListeners<SysLogMsg> = {
//
const handleClear = async () => {
ElMessageBox.confirm(`确定要清空日志?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
options.loading = true;
await getAPI(SysLogMsgApi).apiSysLogMsgClearPost();
options.loading = false;
ElMessage.success('清空成功');
await handleQuery();
})
.catch(() => {});
};
//

View File

@ -114,7 +114,7 @@
<script lang="ts" setup name="sysLogOp">
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
@ -335,11 +335,19 @@ const gridEvents: VxeGridListeners<SysLogOp> = {
//
const handleClear = async () => {
ElMessageBox.confirm(`确定要清空日志?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
options.loading = true;
await getAPI(SysLogOpApi).apiSysLogOpClearPost();
options.loading = false;
ElMessage.success('清空成功');
await handleQuery();
})
.catch(() => {});
};
//

View File

@ -83,7 +83,7 @@
<script lang="ts" setup name="sysLogVis">
import { onMounted, reactive, ref, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
@ -285,11 +285,19 @@ const gridEvents: VxeGridListeners<SysLogVis> = {
//
const handleClear = async () => {
ElMessageBox.confirm(`确定要清空日志?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
options.loading = true;
await getAPI(SysLogVisApi).apiSysLogVisClearPost();
options.loading = false;
ElMessage.success('清空成功');
await handleQuery();
})
.catch(() => {});
};
// 访

View File

@ -32,7 +32,7 @@
</el-form>
<template #footer>
<span class="dialog-footer">
<!-- <el-button @click="cancel"> </el-button> -->
<el-button type="danger" plain @click="logout">退 </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template>
@ -94,6 +94,11 @@ const validatePassword = (_rule: any, value: any, callback: any) => {
}
};
// 退
const logout = () => {
clearAccessTokens();
};
//
defineExpose({ openDialog });
</script>