mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-12 19:39:51 +08:00
add the logic to query JobInfoChangeLog
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user