diff --git a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts index b725427..3c14118 100644 --- a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts +++ b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts @@ -21,7 +21,8 @@ import { getAutoStartChatRecord, getBossLibrary, getCompanyLibrary, - getJobLibrary + getJobLibrary, + getJobHistoryByEncryptId } from '../utils/db/index' import { PageReq } from '../../../../common/types/pagination' import { pipeWriteRegardlessError } from '../../utils/pipe' @@ -349,6 +350,10 @@ export default function initIpc() { ) }) + ipcMain.handle('get-job-history-by-encrypt-id', async (_, encryptJobId) => { + return await getJobHistoryByEncryptId(encryptJobId) + }) + ipcMain.handle('exit-app-immediately', () => { app.exit(0) }) diff --git a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/utils/db/index.ts b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/utils/db/index.ts index 6de3718..f1fb74b 100644 --- a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/utils/db/index.ts +++ b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/utils/db/index.ts @@ -85,3 +85,11 @@ export const getJobLibrary = async ({ pageNo, pageSize }: Partial = {}) }) return res } + +export const getJobHistoryByEncryptId = async (encryptJobId) => { + const res = await createWorkerPromise({ + type: 'getJobHistoryByEncryptId', + encryptJobId + }) + return res +} diff --git a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/utils/db/worker/index.ts b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/utils/db/worker/index.ts index f77d875..916de5d 100644 --- a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/utils/db/worker/index.ts +++ b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/utils/db/worker/index.ts @@ -9,6 +9,7 @@ import { VCompanyLibrary } from '@geekgeekrun/sqlite-plugin/dist/entity/VCompany import { VBossLibrary } from '@geekgeekrun/sqlite-plugin/dist/entity/VBossLibrary' import { measureExecutionTime } from '../../../../../../common/utils/performance' import { PageReq, PagedRes } from '../../../../../../common/types/pagination' +import { JobInfoChangeLog } from '@geekgeekrun/sqlite-plugin/dist/entity/JobInfoChangeLog' const dbInitPromise = initDb(getPublicDbFilePath()) let dataSource: DataSource | null = null @@ -120,6 +121,17 @@ const payloadHandler = { pageNo, totalItemCount } + }, + async getJobHistoryByEncryptId({ encryptJobId }): Promise { + const jobInfoChangeLogRepository = dataSource!.getRepository(JobInfoChangeLog)! + const data = await measureExecutionTime( + jobInfoChangeLogRepository.find({ + where: { + encryptJobId + } + }) + ) + return data } } diff --git a/packages/ui/src/renderer/src/page/Configuration/JobLibrary.vue b/packages/ui/src/renderer/src/page/Configuration/JobLibrary.vue index 413f799..f34c608 100644 --- a/packages/ui/src/renderer/src/page/Configuration/JobLibrary.vue +++ b/packages/ui/src/renderer/src/page/Configuration/JobLibrary.vue @@ -38,7 +38,7 @@ link type="primary" size="small" - @click="handleViewJobSnapshotButtonClick(row)" + @click="handleViewJobHistoryButtonClick(row.encryptJobId)" >变更记录