mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-04 23:17:39 +08:00
add the logic to query JobInfoChangeLog
This commit is contained in:
@@ -21,7 +21,8 @@ import {
|
|||||||
getAutoStartChatRecord,
|
getAutoStartChatRecord,
|
||||||
getBossLibrary,
|
getBossLibrary,
|
||||||
getCompanyLibrary,
|
getCompanyLibrary,
|
||||||
getJobLibrary
|
getJobLibrary,
|
||||||
|
getJobHistoryByEncryptId
|
||||||
} from '../utils/db/index'
|
} from '../utils/db/index'
|
||||||
import { PageReq } from '../../../../common/types/pagination'
|
import { PageReq } from '../../../../common/types/pagination'
|
||||||
import { pipeWriteRegardlessError } from '../../utils/pipe'
|
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', () => {
|
ipcMain.handle('exit-app-immediately', () => {
|
||||||
app.exit(0)
|
app.exit(0)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -85,3 +85,11 @@ export const getJobLibrary = async ({ pageNo, pageSize }: Partial<PageReq> = {})
|
|||||||
})
|
})
|
||||||
return res
|
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 { VBossLibrary } from '@geekgeekrun/sqlite-plugin/dist/entity/VBossLibrary'
|
||||||
import { measureExecutionTime } from '../../../../../../common/utils/performance'
|
import { measureExecutionTime } from '../../../../../../common/utils/performance'
|
||||||
import { PageReq, PagedRes } from '../../../../../../common/types/pagination'
|
import { PageReq, PagedRes } from '../../../../../../common/types/pagination'
|
||||||
|
import { JobInfoChangeLog } from '@geekgeekrun/sqlite-plugin/dist/entity/JobInfoChangeLog'
|
||||||
|
|
||||||
const dbInitPromise = initDb(getPublicDbFilePath())
|
const dbInitPromise = initDb(getPublicDbFilePath())
|
||||||
let dataSource: DataSource | null = null
|
let dataSource: DataSource | null = null
|
||||||
@@ -120,6 +121,17 @@ const payloadHandler = {
|
|||||||
pageNo,
|
pageNo,
|
||||||
totalItemCount
|
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
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleViewJobSnapshotButtonClick(row)"
|
@click="handleViewJobHistoryButtonClick(row.encryptJobId)"
|
||||||
>变更记录</ElButton
|
>变更记录</ElButton
|
||||||
>
|
>
|
||||||
<ElButton
|
<ElButton
|
||||||
@@ -145,6 +145,13 @@ async function handleViewJobOnlineButtonClick(encryptJobId: string) {
|
|||||||
url: `https://www.zhipin.com/job_detail/${encryptJobId}.html`
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
Reference in New Issue
Block a user