add the logic to query JobInfoChangeLog

This commit is contained in:
geekgeekrun
2024-10-08 11:35:02 +08:00
parent 78425c25d6
commit 3be9752e07
4 changed files with 34 additions and 2 deletions

View File

@@ -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)
})

View File

@@ -85,3 +85,11 @@ export const getJobLibrary = async ({ pageNo, pageSize }: Partial<PageReq> = {})
})
return res
}
export const getJobHistoryByEncryptId = async (encryptJobId) => {
const res = await createWorkerPromise({
type: 'getJobHistoryByEncryptId',
encryptJobId
})
return res
}

View File

@@ -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<JobInfoChangeLog[]> {
const jobInfoChangeLogRepository = dataSource!.getRepository(JobInfoChangeLog)!
const data = await measureExecutionTime(
jobInfoChangeLogRepository.find({
where: {
encryptJobId
}
})
)
return data
}
}

View File

@@ -38,7 +38,7 @@
link
type="primary"
size="small"
@click="handleViewJobSnapshotButtonClick(row)"
@click="handleViewJobHistoryButtonClick(row.encryptJobId)"
>变更记录</ElButton
>
<ElButton
@@ -145,6 +145,13 @@ async function handleViewJobOnlineButtonClick(encryptJobId: string) {
url: `https://www.zhipin.com/job_detail/${encryptJobId}.html`
})
}
async function handleViewJobHistoryButtonClick(encryptJobId: string) {
const historyList = await electron.ipcRenderer.invoke(
'get-job-history-by-encrypt-id',
encryptJobId
)
void historyList
}
</script>
<style scoped lang="scss">