index.vue 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548
  1. <script setup lang="ts">
  2. import { ref, onMounted, computed } from 'vue'
  3. import { message } from 'ant-design-vue'
  4. import type { FormInstance } from 'ant-design-vue'
  5. import { useRoute } from 'vue-router'
  6. import { ElMessage } from 'element-plus'
  7. import { Share, Download, Printer, ArrowUp, User } from '@element-plus/icons-vue'
  8. interface CandidateInfo {
  9. name: string
  10. idNumber: string
  11. phoneNumber: string
  12. score: number
  13. availabilityPeriod: string
  14. onboardingTime: string
  15. suggestedSalary: string
  16. salaryRange:string
  17. dimensions: {
  18. teamwork: string
  19. learningAbility: string
  20. attention: string
  21. workAdaptability: string
  22. serviceAwareness: string
  23. }
  24. dimensionDetails: {
  25. teamwork: string
  26. learningAbility: string
  27. attention: string
  28. workAdaptability: string
  29. serviceAwareness: string
  30. }
  31. duvAnalysis: {
  32. title: string
  33. content: string
  34. score: string
  35. type: 'positive' | 'negative' | 'neutral'
  36. }[]
  37. interviewRecord: {
  38. question: string
  39. answer: string
  40. analysis: string
  41. score: string
  42. videoUrl?: string
  43. thumbnail?: string
  44. question_form?: number
  45. is_correct?: boolean | string
  46. question_image_url?: string
  47. options?: {
  48. id: number
  49. option_text: string
  50. is_correct: boolean
  51. sort: number
  52. }[]
  53. answer_data?: {
  54. text_answer: string
  55. selected_options: number[]
  56. selected_option_details: {
  57. id: number
  58. is_correct: boolean
  59. option_text: string
  60. }[]
  61. }
  62. }[]
  63. videoRecords: {
  64. category: string
  65. videos: {
  66. url: string
  67. thumbnail: string
  68. description: string
  69. }[]
  70. }[]
  71. additionalInfo: {
  72. idVerification: string
  73. phoneVerification: string
  74. leftHandGestures: {
  75. passed: boolean
  76. images: string[]
  77. }
  78. rightHandGestures: {
  79. passed: boolean
  80. images: string[]
  81. }
  82. faceVerification: {
  83. passed: boolean
  84. images: string[]
  85. }
  86. comprehensiveVerification: string
  87. handVerification: string
  88. handBrightness: string
  89. handIntegrity: string
  90. handPoseRecognition: string
  91. }
  92. strengths?: string[]
  93. weaknesses?: string[]
  94. hireRecommendation?: string
  95. hireReason?: string
  96. }
  97. interface UserProfile {
  98. user_info: {
  99. id: number;
  100. name: string;
  101. phone: string;
  102. age: number;
  103. birth_date: string;
  104. gender: number;
  105. gender_name: string;
  106. professional_skills: string | null;
  107. id_card: string;
  108. status: number;
  109. examine: string;
  110. source: string;
  111. create_datetime: string;
  112. update_datetime: string;
  113. };
  114. profile: {
  115. political_status: string;
  116. ethnicity: string;
  117. height: string;
  118. weight: string;
  119. native_place: string;
  120. household_location: string;
  121. current_address: string;
  122. female_status: number;
  123. female_status_name: string;
  124. marital_status: number;
  125. marital_status_name: string;
  126. has_children: boolean;
  127. expected_salary: string;
  128. emergency_contact: string;
  129. emergency_phone: string;
  130. specialties: string;
  131. life_motto: string;
  132. recruitment_source: number;
  133. recruitment_source_name: string;
  134. recruitment_source_detail: string;
  135. };
  136. educations: Array<{
  137. id: number;
  138. education_type: number;
  139. education_type_name: string;
  140. degree: number;
  141. degree_name: string;
  142. start_date: string;
  143. end_date: string;
  144. school_name: string;
  145. major: string;
  146. create_datetime: string;
  147. update_datetime: string;
  148. }>;
  149. family_members: Array<{
  150. id: number;
  151. relation: string;
  152. name: string;
  153. workplace: string;
  154. position: string;
  155. phone: string;
  156. create_datetime: string;
  157. update_datetime: string;
  158. }>;
  159. trainings: Array<{
  160. id: number;
  161. training_name: string;
  162. institution: string;
  163. start_date: string;
  164. end_date: string;
  165. description: string;
  166. certificate: string;
  167. create_datetime: string;
  168. update_datetime: string;
  169. }>;
  170. work_experiences: Array<{
  171. id: number;
  172. company_name: string;
  173. start_date: string;
  174. end_date: string;
  175. department: string;
  176. position: string;
  177. company_size: number;
  178. monthly_salary: string;
  179. supervisor_name: string;
  180. supervisor_phone: string;
  181. job_description: string | null;
  182. achievements: string | null;
  183. resignation_reason: string | null;
  184. create_datetime: string;
  185. update_datetime: string;
  186. }>;
  187. }
  188. // 首先添加类型定义
  189. interface PhotoResult {
  190. url: string;
  191. status: string;
  192. photo_id: number;
  193. detections: any[];
  194. description: string;
  195. photo_index: number;
  196. analysis_model: string;
  197. part_verification: {
  198. explanation: string;
  199. is_correct_part: boolean;
  200. } | null;
  201. analysis_timestamp: string;
  202. overall_assessment: string;
  203. }
  204. interface VisualAnalysisResults {
  205. status: string;
  206. timestamp: string;
  207. total_photos: number;
  208. photo_results: PhotoResult[];
  209. application_id: number;
  210. failed_analyses: number;
  211. successful_analyses: number;
  212. verification_summary: {
  213. correct_parts: number;
  214. total_verified: number;
  215. incorrect_parts: number;
  216. all_parts_correct: boolean;
  217. };
  218. }
  219. // 修改 apiData 的类型定义
  220. interface ApiData {
  221. applicant?: any;
  222. application?: any;
  223. position?: any;
  224. interview_progress?: any[];
  225. posture_photos?: any[];
  226. scoring_summary?: {
  227. total_score_obtained: number;
  228. max_possible_score: number;
  229. answered_scoring_questions_count: number;
  230. scoring_details: any[];
  231. };
  232. required_questions_summary?: {
  233. all_correct: boolean;
  234. failed_questions_details: any[];
  235. };
  236. visual_analysis_results?: VisualAnalysisResults;
  237. }
  238. const candidateInfo = ref<CandidateInfo>({
  239. name: '',
  240. idNumber: '',
  241. phoneNumber: '',
  242. score: 0,
  243. availabilityPeriod: '',
  244. onboardingTime: '',
  245. suggestedSalary: '',
  246. salaryRange: '',
  247. dimensions: {
  248. teamwork: '欠佳',
  249. learningAbility: '优秀',
  250. attention: '欠佳',
  251. workAdaptability: '优秀',
  252. serviceAwareness: '中等'
  253. },
  254. dimensionDetails: {
  255. teamwork: '',
  256. learningAbility: '',
  257. attention: '',
  258. workAdaptability: '',
  259. serviceAwareness: ''
  260. },
  261. duvAnalysis: [
  262. {
  263. title: '',
  264. content: '',
  265. score: '',
  266. type: 'neutral'
  267. },
  268. {
  269. title: '',
  270. content: '',
  271. score: '',
  272. type: 'neutral'
  273. }
  274. ],
  275. interviewRecord: [
  276. {
  277. question: '',
  278. answer: '',
  279. analysis: '',
  280. score: '',
  281. videoUrl: '',
  282. thumbnail: '',
  283. question_form: 0,
  284. is_correct: false,
  285. question_image_url: '',
  286. options: [],
  287. answer_data: {
  288. text_answer: '',
  289. selected_options: [],
  290. selected_option_details: []
  291. }
  292. },
  293. {
  294. question: '',
  295. answer: '',
  296. analysis: '',
  297. score: '',
  298. videoUrl: '',
  299. thumbnail: '',
  300. question_form: 0,
  301. is_correct: false,
  302. question_image_url: '',
  303. options: [],
  304. answer_data: {
  305. text_answer: '',
  306. selected_options: [],
  307. selected_option_details: []
  308. }
  309. }
  310. ],
  311. videoRecords: [
  312. {
  313. category: '服务态度测评',
  314. videos: [
  315. {
  316. url: '',
  317. thumbnail: '',
  318. description: ''
  319. },
  320. {
  321. url: '',
  322. thumbnail: '',
  323. description: ''
  324. }
  325. ]
  326. }
  327. ],
  328. additionalInfo: {
  329. idVerification: '通过',
  330. phoneVerification: '通过',
  331. leftHandGestures: {
  332. passed: true,
  333. images: [
  334. ]
  335. },
  336. rightHandGestures: {
  337. passed: true,
  338. images: [
  339. ]
  340. },
  341. faceVerification: {
  342. passed: true,
  343. images: [
  344. ]
  345. },
  346. comprehensiveVerification: '通过',
  347. handVerification: '通过',
  348. handBrightness: '通过',
  349. handIntegrity: '通过',
  350. handPoseRecognition: '通过'
  351. },
  352. strengths: [],
  353. weaknesses: [],
  354. hireRecommendation: '',
  355. hireReason: ''
  356. })
  357. // 修改 apiData 的声明
  358. const apiData = ref<ApiData | null>(null);
  359. const loading = ref<boolean>(true)
  360. const error = ref<string>('')
  361. const route = useRoute()
  362. const fetchApplicationDetail = async () => {
  363. loading.value = true
  364. try {
  365. // 从Vue Router获取参数
  366. const id = route.query.id as string || '1'
  367. const tenant_id = route.query.tenant_id as string || '1'
  368. const application_id = route.query.application_id as string || '1'
  369. console.log('Route params:', { id, tenant_id, application_id })
  370. // 使用正确的参数调用API
  371. const response = await fetch(`${import.meta.env.VITE_API_URL}/api/job/application_detail?tenant_id=${tenant_id}&application_id=${id || application_id}`)
  372. const result = await response.json()
  373. if (result.code === 2000) {
  374. apiData.value = result.data
  375. console.log(result.data)
  376. updateCandidateInfo(result.data)
  377. } else {
  378. error.value = result.msg || '获取数据失败'
  379. }
  380. } catch (err) {
  381. console.error('获取申请详情失败:', err)
  382. error.value = '获取数据失败,请稍后重试'
  383. } finally {
  384. loading.value = false
  385. }
  386. }
  387. const updateCandidateInfo = (data: any) => {
  388. if (!data) return
  389. const { applicant, application, position, interview_progress, posture_photos } = data
  390. // 更新基本信息
  391. candidateInfo.value.name = applicant?.name || candidateInfo.value.name
  392. candidateInfo.value.phoneNumber = applicant?.phone || candidateInfo.value.phoneNumber
  393. candidateInfo.value.idNumber = applicant?.id_card || candidateInfo.value.idNumber
  394. // 添加薪资相关信息处理
  395. if (position) {
  396. // 如果API返回了薪资范围,使用API数据
  397. if (position.salary_range) {
  398. candidateInfo.value.salaryRange = position.salary_range || '面议'
  399. /* candidateInfo.value.salaryRange.max = position.salary_range || '面议' */
  400. } else {
  401. // 否则使用默认值
  402. candidateInfo.value.salaryRange = '面议'
  403. }
  404. // 根据候选人评分计算建议薪资
  405. if (position.salary_range && typeof position.salary_range === 'string') {
  406. // 尝试从薪资范围字符串中提取最小值和最大值
  407. // 支持多种格式:'5000-8000'、'5,000-8,000'、'5000元-8000元'等
  408. let min = 0, max = 0;
  409. if (position.salary_range.includes('-')) {
  410. // 处理范围格式 (例如 "5000-8000")
  411. const parts = position.salary_range.split('-');
  412. min = parseInt(parts[0].trim().replace(/[^\d]/g, ''), 10);
  413. max = parseInt(parts[1].trim().replace(/[^\d]/g, ''), 10);
  414. } else if (position.salary_range.includes('~')) {
  415. // 处理波浪线格式 (例如 "5000~8000")
  416. const parts = position.salary_range.split('~');
  417. min = parseInt(parts[0].trim().replace(/[^\d]/g, ''), 10);
  418. max = parseInt(parts[1].trim().replace(/[^\d]/g, ''), 10);
  419. } else if (position.salary_range.includes('至')) {
  420. // 处理中文格式 (例如 "5000至8000")
  421. const parts = position.salary_range.split('至');
  422. min = parseInt(parts[0].trim().replace(/[^\d]/g, ''), 10);
  423. max = parseInt(parts[1].trim().replace(/[^\d]/g, ''), 10);
  424. }
  425. // 如果成功解析出最小值和最大值,则根据分数计算建议薪资
  426. if (!isNaN(min) && !isNaN(max) && min > 0 && max > 0 && max > min) {
  427. // 薪资计算逻辑
  428. // 1. 分数低于60分:给予最低薪资
  429. // 2. 分数在60-80分之间:给予中等薪资(最低薪资 + 薪资范围的1/3)
  430. // 3. 分数在80分以上:给予最高薪资
  431. console.log("score",application.comprehensive_score)
  432. const score = application.comprehensive_score;
  433. console.log(score)
  434. let suggested = min; // 默认给最低薪资
  435. if (score >= 80) {
  436. // 80分以上给最高薪资
  437. console.log(max)
  438. suggested = max;
  439. } else if (score >= 60) {
  440. // 60-80分给中等薪资(最低薪资 + 薪资范围的1/3)
  441. suggested = min + Math.floor((max - min) / 3);
  442. }else{
  443. // 低于60分保持最低薪资
  444. suggested = 0;
  445. }
  446. // 格式化薪资显示
  447. if (suggested >= 10000) {
  448. // 如果大于等于10000,显示为"x.x万"
  449. const inWan = (suggested / 10000).toFixed(1);
  450. candidateInfo.value.suggestedSalary = `${inWan}万`;
  451. } else {
  452. // 否则直接显示数字
  453. candidateInfo.value.suggestedSalary = `${suggested}`;
  454. }
  455. } else {
  456. // 如果无法解析薪资范围,则直接使用原始值
  457. candidateInfo.value.suggestedSalary = position.salary_range;
  458. }
  459. } else {
  460. // 如果没有薪资范围信息,设为面议
  461. candidateInfo.value.suggestedSalary = '面议';
  462. }
  463. } else {
  464. // 如果没有职位信息,设置默认值
  465. candidateInfo.value.salaryRange = '面议';
  466. candidateInfo.value.suggestedSalary = '面议';
  467. }
  468. // 更新综合分析
  469. if (application?.comprehensive_analysis) {
  470. // 更新综合评分
  471. if (application.comprehensive_analysis.comprehensive_score !== null &&
  472. application.comprehensive_analysis.comprehensive_score !== undefined) {
  473. candidateInfo.value.score = application.comprehensive_analysis.comprehensive_score
  474. }
  475. // 更新优缺点分析
  476. if (application.comprehensive_analysis.video_analysis_data) {
  477. const videoData = application.comprehensive_analysis.video_analysis_data
  478. // 更新优点
  479. if (videoData.strengths && videoData.strengths.length > 0) {
  480. candidateInfo.value.strengths = videoData.strengths.filter((s: string) =>
  481. s && !s.includes('无法从响应中提取')
  482. )
  483. }
  484. // 更新缺点
  485. if (videoData.weaknesses && videoData.weaknesses.length > 0) {
  486. candidateInfo.value.weaknesses = videoData.weaknesses.filter((w: string) =>
  487. w && !w.includes('无法从响应中提取')
  488. )
  489. }
  490. // 更新录用建议
  491. if (application.comprehensive_analysis.hire_recommendation) {
  492. candidateInfo.value.hireRecommendation = application.comprehensive_analysis.hire_recommendation
  493. }
  494. // 更新录用理由
  495. if (application.comprehensive_analysis.hire_reason) {
  496. candidateInfo.value.hireReason = application.comprehensive_analysis.hire_reason
  497. }
  498. }
  499. }
  500. // 更新能力维度评分
  501. if (application?.ai_capability_scores) {
  502. const dimensionMapping: Record<string, keyof typeof candidateInfo.value.dimensions> = {
  503. '专业性': 'workAdaptability',
  504. '沟通能力': 'teamwork',
  505. '技术匹配度': 'learningAbility',
  506. '解决问题能力': 'attention',
  507. '服务意识': 'serviceAwareness'
  508. }
  509. Object.entries(application.ai_capability_scores).forEach(([key, value]) => {
  510. const mappedKey = dimensionMapping[key]
  511. if (mappedKey && typeof value === 'number') {
  512. let rating = '中等'
  513. if (value >= 80) rating = '优秀'
  514. else if (value < 65) rating = '欠佳'
  515. candidateInfo.value.dimensions[mappedKey] = rating
  516. }
  517. })
  518. } else {
  519. // 如果没有AI能力评分,根据面试题目分析生成维度评分
  520. const dimensionScores: Record<string, number[]> = {
  521. teamwork: [],
  522. learningAbility: [],
  523. attention: [],
  524. workAdaptability: [],
  525. serviceAwareness: []
  526. }
  527. interview_progress?.forEach((q: any) => {
  528. if (q.video_answer && q.video_answer.ai_score) {
  529. // 根据问题类型和内容分配到不同维度
  530. if (q.question_text.includes('团队') || q.question_text.includes('合作')) {
  531. dimensionScores.teamwork.push(q.video_answer.ai_score)
  532. }
  533. if (q.question_text.includes('学习') || q.question_text.includes('技能')) {
  534. dimensionScores.learningAbility.push(q.video_answer.ai_score)
  535. }
  536. if (q.question_text.includes('细致') || q.question_text.includes('严谨') || q.question_text.includes('注意')) {
  537. dimensionScores.attention.push(q.video_answer.ai_score)
  538. }
  539. if (q.question_text.includes('适应') || q.question_text.includes('工作')) {
  540. dimensionScores.workAdaptability.push(q.video_answer.ai_score)
  541. }
  542. if (q.question_text.includes('服务') || q.question_text.includes('客户')) {
  543. dimensionScores.serviceAwareness.push(q.video_answer.ai_score)
  544. }
  545. }
  546. })
  547. // 计算每个维度的平均分并转换为评级
  548. Object.entries(dimensionScores).forEach(([key, scores]) => {
  549. if (scores.length > 0) {
  550. const avgScore = scores.reduce((sum, score) => sum + score, 0) / scores.length
  551. let rating = '中等'
  552. if (avgScore >= 80) rating = '优秀'
  553. else if (avgScore < 65) rating = '欠佳'
  554. candidateInfo.value.dimensions[key as keyof typeof candidateInfo.value.dimensions] = rating
  555. }
  556. })
  557. }
  558. // 更新维度详情
  559. const dimensionDetailsMapping: Record<string, string> = {
  560. teamwork: '候选人在团队协作方面的表现',
  561. learningAbility: '候选人的学习能力和接受新知识的速度',
  562. attention: '候选人对细节的关注程度和工作严谨性',
  563. workAdaptability: '候选人适应工作环境和要求的能力',
  564. serviceAwareness: '候选人的服务意识和客户导向思维'
  565. }
  566. Object.keys(candidateInfo.value.dimensionDetails).forEach(key => {
  567. const dimension = key as keyof typeof candidateInfo.value.dimensionDetails
  568. const rating = candidateInfo.value.dimensions[dimension]
  569. let detail = dimensionDetailsMapping[dimension] || ''
  570. if (rating === '优秀') {
  571. detail += '表现优秀,符合岗位要求。'
  572. } else if (rating === '中等') {
  573. detail += '表现一般,基本符合岗位要求。'
  574. } else {
  575. detail += '表现欠佳,需要进一步提升。'
  576. }
  577. candidateInfo.value.dimensionDetails[dimension] = detail
  578. })
  579. // 更新面试记录
  580. if (interview_progress && interview_progress.length > 0) {
  581. candidateInfo.value.interviewRecord = interview_progress
  582. .filter((q: any) => q.video_answer || q.answer_data)
  583. .map((q: any) => {
  584. const record: InterviewRecord = {
  585. question: q.question_text || '未提供问题',
  586. answer: '',
  587. analysis: '',
  588. score: '',
  589. question_form: q.question_form,
  590. options: q.options,
  591. answer_data: q.answer_data
  592. }
  593. // 处理视频答案
  594. if (q.video_answer) {
  595. record.answer = q.video_answer.transcript || ''
  596. record.analysis = q.video_answer.ai_analysis?.comment || ''
  597. record.score = q.video_answer.ai_score ? `${q.video_answer.ai_score}分` : ''
  598. record.videoUrl = q.video_answer.video_url || ''
  599. }
  600. // 处理选择题答案
  601. if (q.answer_data) {
  602. record.answer = q.answer_data.text_answer || ''
  603. record.is_correct = q.answer_data.selected_option_details?.some((opt: any) => opt.is_correct) || false
  604. }
  605. // 处理图片题
  606. if (q.question_form === 3) {
  607. record.question_image_url = q.question_image_url || ''
  608. }
  609. return record
  610. })
  611. // 按题目类型排序:视频题(0) -> 图片题(3) -> 选择题(1,2,4)
  612. .sort((a, b) => {
  613. // 定义题型优先级
  614. const getPriority = (questionForm: number) => {
  615. if (questionForm === 0) return 0 // 视频题最优先
  616. if (questionForm === 3) return 1 // 图片题次之
  617. return 2 // 其他题型最后
  618. }
  619. return getPriority(a.question_form || 0) - getPriority(b.question_form || 0)
  620. })
  621. }
  622. // 更新DUV分析
  623. if (application?.visual_analysis_results && application.visual_analysis_results.photo_results) {
  624. // 从photo_results中收集所有detections
  625. const allDetections: any[] = []
  626. application.visual_analysis_results.photo_results.forEach((photo: any) => {
  627. if (photo.detections && photo.detections.length > 0) {
  628. photo.detections.forEach((detection: any) => {
  629. allDetections.push({
  630. title: detection.feature || '特征分析',
  631. content: detection.location ?
  632. `在${detection.location}发现${detection.feature}${detection.description ? ',' + detection.description : ''}` :
  633. detection.feature + (detection.description ? ',' + detection.description : ''),
  634. score: detection.confidence >= 0.8 ? '确认' : '疑似',
  635. type: detection.description && detection.description.includes('影响') ? 'negative' : 'neutral'
  636. })
  637. })
  638. }
  639. })
  640. // 如果有检测结果,更新DUV分析
  641. if (allDetections.length > 0) {
  642. candidateInfo.value.duvAnalysis = allDetections
  643. } else {
  644. // 如果没有检测结果,提供默认值
  645. candidateInfo.value.duvAnalysis = [
  646. {
  647. title: '未发现特殊特征',
  648. content: '未在照片中检测到特殊特征',
  649. score: '正常',
  650. type: 'positive'
  651. }
  652. ]
  653. }
  654. } else if (application?.visual_analysis_results && application.visual_analysis_results.detections) {
  655. // 兼容旧版API格式
  656. candidateInfo.value.duvAnalysis = application.visual_analysis_results.detections.map((detection: any) => ({
  657. title: detection.feature || '特征分析',
  658. content: detection.location ? `在${detection.location}发现${detection.feature}` : detection.feature,
  659. score: detection.confidence >= 0.8 ? '确认' : '疑似',
  660. type: 'neutral'
  661. }))
  662. } else {
  663. // 如果没有视觉分析结果,提供默认值
  664. candidateInfo.value.duvAnalysis = [
  665. {
  666. title: '未进行DUV分析',
  667. content: '未提供DUV分析数据',
  668. score: '未知',
  669. type: 'neutral'
  670. }
  671. ]
  672. }
  673. // 更新手势验证和人脸验证图片
  674. if (posture_photos && posture_photos.length > 0) {
  675. const leftHandPhotos = posture_photos.filter((p: any) =>
  676. p.description.includes('left_') || p.description.includes('左手')
  677. ).map((p: any) => p.photo_url)
  678. if (leftHandPhotos.length > 0) {
  679. candidateInfo.value.additionalInfo.leftHandGestures.images = leftHandPhotos
  680. }
  681. const rightHandPhotos = posture_photos.filter((p: any) =>
  682. p.description.includes('right_') || p.description.includes('右手')
  683. ).map((p: any) => p.photo_url)
  684. if (rightHandPhotos.length > 0) {
  685. candidateInfo.value.additionalInfo.rightHandGestures.images = rightHandPhotos
  686. }
  687. const facePhotos = posture_photos.filter((p: any) =>
  688. p.description.includes('面部') ||
  689. (!p.description.includes('left_') &&
  690. !p.description.includes('right_') &&
  691. !p.description.includes('左手') &&
  692. !p.description.includes('右手'))
  693. ).map((p: any) => p.photo_url)
  694. if (facePhotos.length > 0) {
  695. candidateInfo.value.additionalInfo.faceVerification.images = facePhotos
  696. }
  697. }
  698. // 更新视频记录
  699. if (interview_progress && interview_progress.length > 0) {
  700. const videosByCategory: Record<string, any[]> = {}
  701. interview_progress.forEach((q: any) => {
  702. if (q.video_answer && q.video_answer.video_url) {
  703. const category = q.question_type_display || '面试视频'
  704. if (!videosByCategory[category]) {
  705. videosByCategory[category] = []
  706. }
  707. videosByCategory[category].push({
  708. url: q.video_answer.video_url,
  709. thumbnail: '/images/video-placeholder.jpg',
  710. description: q.question_text
  711. })
  712. }
  713. })
  714. candidateInfo.value.videoRecords = Object.entries(videosByCategory).map(([category, videos]) => ({
  715. category,
  716. videos
  717. }))
  718. }
  719. // 更新入职相关信息
  720. candidateInfo.value.availabilityPeriod = '无特殊情况'
  721. candidateInfo.value.onboardingTime = '随时可以入职'
  722. }
  723. onMounted(() => {
  724. console.log('完整URL:', window.location.href)
  725. console.log('路径:', window.location.pathname)
  726. console.log('查询字符串:', window.location.search)
  727. console.log('哈希:', window.location.hash)
  728. fetchApplicationDetail()
  729. // 确保所有主要部分都有正确的ID
  730. setTimeout(() => {
  731. console.log('检查页面ID:');
  732. ['comprehensive-assessment', 'image-analysis', 'answer-records', 'other-info'].forEach(id => {
  733. const element = document.getElementById(id);
  734. console.log(`ID ${id} 存在:`, !!element);
  735. });
  736. }, 1000);
  737. // 添加滚动监听
  738. window.addEventListener('scroll', () => {
  739. const sections = ['comprehensive-assessment', 'image-analysis', 'answer-records', 'other-info'];
  740. // 找到当前在视口中的部分
  741. for (const sectionId of sections) {
  742. const element = document.getElementById(sectionId);
  743. if (element) {
  744. const rect = element.getBoundingClientRect();
  745. if (rect.top <= 150 && rect.bottom >= 150) {
  746. setActiveTab(sectionId);
  747. break;
  748. }
  749. }
  750. }
  751. }, { passive: true });
  752. })
  753. const evaluationScore = ref<number>(0)
  754. const evaluationComments = ref<string>('')
  755. const formRef = ref<FormInstance>()
  756. const handleSubmit = async () => {
  757. try {
  758. await formRef.value?.validate()
  759. message.success('评估已提交')
  760. } catch (error) {
  761. message.error('请完成所有必填项')
  762. }
  763. }
  764. const reportTop = ref<HTMLElement | null>(null)
  765. const scrollToTop = () => {
  766. console.log('尝试滚动到顶部')
  767. // 使用ref引用直接滚动到顶部元素
  768. if (reportTop.value) {
  769. reportTop.value.scrollIntoView({ behavior: 'smooth', block: 'start' })
  770. console.log('使用ref滚动到顶部')
  771. return
  772. }
  773. // 如果ref不可用,尝试通过ID查找元素
  774. const topElement = document.getElementById('report-top')
  775. if (topElement) {
  776. topElement.scrollIntoView({ behavior: 'smooth', block: 'start' })
  777. console.log('使用ID滚动到顶部')
  778. return
  779. }
  780. // 如果以上方法都失败,使用之前的备用方法
  781. // ... 之前的代码 ...
  782. }
  783. const handleShare = () => {
  784. ElMessage.success('分享链接已复制')
  785. }
  786. const handleDownload = async () => {
  787. try {
  788. // 从路由获取参数
  789. const id = route.query.id as string || '1'
  790. const tenant_id = route.query.tenant_id as string || '1'
  791. const application_id = route.query.application_id as string || '1'
  792. // 显示下载开始的提示
  793. ElMessage.success('报告下载中...')
  794. // 调用下载接口
  795. const response = await fetch(`${import.meta.env.VITE_API_URL}/api/system/job/export_application_pdf?application_id=${id || application_id}&tenant_id=${tenant_id}`)
  796. const result = await response.json()
  797. if (result.code === 2000) {
  798. // 下载任务创建成功,提示用户去下载中心查看
  799. ElMessage.success('下载任务已创建,请前往下载中心查看')
  800. } else {
  801. // 处理错误情况
  802. ElMessage.error(result.msg || '下载任务创建失败')
  803. }
  804. } catch (error) {
  805. console.error('创建下载任务失败:', error)
  806. ElMessage.error('创建下载任务失败,请稍后重试')
  807. }
  808. }
  809. // 添加类型定义
  810. const originalButtonDisplay: string[] = []
  811. // 修改打印函数
  812. const handlePrint = () => {
  813. // 保存当前页面滚动位置
  814. const scrollPosition = window.scrollY
  815. // 临时修改样式以确保所有内容都能打印
  816. const originalOverflow = document.body.style.overflow
  817. const originalHeight = document.body.style.height
  818. document.body.style.overflow = 'visible'
  819. document.body.style.height = 'auto'
  820. // 隐藏不需要打印的元素
  821. const buttonsToHide = document.querySelectorAll('.fixed')
  822. buttonsToHide.forEach((button, index) => {
  823. // 添加类型断言
  824. const buttonElement = button as HTMLElement
  825. originalButtonDisplay[index] = buttonElement.style.display
  826. buttonElement.style.display = 'none'
  827. })
  828. // 延迟执行打印,确保样式已应用
  829. setTimeout(() => {
  830. window.print()
  831. // 打印完成后恢复原始样式
  832. document.body.style.overflow = originalOverflow
  833. document.body.style.height = originalHeight
  834. // 恢复隐藏的按钮
  835. buttonsToHide.forEach((button, index) => {
  836. // 添加类型断言
  837. const buttonElement = button as HTMLElement
  838. buttonElement.style.display = originalButtonDisplay[index]
  839. })
  840. // 恢复滚动位置
  841. window.scrollTo(0, scrollPosition)
  842. ElMessage.success('打印完成')
  843. }, 300)
  844. }
  845. // 添加base64编码的内联图片作为fallback
  846. const fallbackImageBase64Ref = ref('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgZmlsbD0iI2VlZWVlZSIvPjxwYXRoIGQ9Ik03NSA2NUExMCAxMCAwIDAgMSA4NSA3NUExMCAxMCAwIDAgMSA3NSA4NUExMCAxMCAwIDAgMSA2NSA3NUExMCAxMCAwIDAgMSA3NSA2NVoiIGZpbGw9IiNhYWFhYWEiLz48cGF0aCBkPSJNMTIwIDEzNUw5MCAxMDVMNjAgMTM1TDYwIDE0MEwxNDAgMTQwTDE0MCAxMzVMMTIwIDExNVoiIGZpbGw9IiNhYWFhYWEiLz48L3N2Zz4=')
  847. // 简化的图片错误处理函数
  848. const handleImageError = (event: Event) => {
  849. const target = event.target as HTMLImageElement
  850. if (target) {
  851. target.src = fallbackImageBase64Ref.value
  852. target.onerror = null // 防止无限循环
  853. }
  854. }
  855. // 修改视频加载和第一帧捕获的函数
  856. const captureVideoFirstFrame = (videoElement: HTMLVideoElement) => {
  857. // 创建一个一次性的事件监听器,在视频可以播放时捕获第一帧
  858. const captureFrame = () => {
  859. try {
  860. // 确保视频已加载足够的数据
  861. if (videoElement.readyState >= 2) {
  862. // 创建canvas元素
  863. const canvas = document.createElement('canvas')
  864. canvas.width = videoElement.videoWidth || 320
  865. canvas.height = videoElement.videoHeight || 240
  866. // 在canvas上绘制视频当前帧
  867. const ctx = canvas.getContext('2d')
  868. if (ctx) {
  869. // 确保视频当前时间设置为开始位置
  870. videoElement.currentTime = 0.1
  871. // 绘制视频帧到canvas
  872. ctx.drawImage(videoElement, 0, 0, canvas.width, canvas.height)
  873. // 将canvas转换为图片URL
  874. const thumbnailUrl = canvas.toDataURL('image/jpeg')
  875. // 设置为视频的poster属性
  876. videoElement.poster = thumbnailUrl
  877. // 清理
  878. videoElement.removeEventListener('loadeddata', captureFrame)
  879. }
  880. }
  881. } catch (error) {
  882. console.error('捕获视频第一帧失败:', error)
  883. // 设置默认缩略图
  884. videoElement.poster = fallbackImageBase64Ref.value
  885. }
  886. }
  887. // 添加事件监听器
  888. videoElement.addEventListener('loadeddata', captureFrame)
  889. // 如果视频已经加载,立即尝试捕获
  890. if (videoElement.readyState >= 2) {
  891. captureFrame()
  892. }
  893. // 添加错误处理
  894. videoElement.addEventListener('error', () => {
  895. console.error('视频加载失败')
  896. videoElement.poster = fallbackImageBase64Ref.value
  897. })
  898. // 设置超时,确保即使视频加载缓慢也能显示默认缩略图
  899. setTimeout(() => {
  900. if (!videoElement.poster || videoElement.poster === '') {
  901. videoElement.poster = fallbackImageBase64Ref.value
  902. }
  903. }, 3000)
  904. }
  905. // 视频加载完成后的处理函数
  906. const handleVideoLoaded = (event: Event) => {
  907. const videoElement = event.target as HTMLVideoElement
  908. if (videoElement) {
  909. // 确保视频已经加载元数据
  910. if (videoElement.readyState >= 1) {
  911. captureVideoFirstFrame(videoElement)
  912. } else {
  913. // 如果元数据尚未加载,添加元数据加载事件
  914. videoElement.addEventListener('loadedmetadata', () => {
  915. captureVideoFirstFrame(videoElement)
  916. })
  917. }
  918. }
  919. }
  920. // 添加视频错误处理函数
  921. const handleVideoError = (event: Event) => {
  922. const videoElement = event.target as HTMLVideoElement
  923. if (videoElement) {
  924. videoElement.poster = fallbackImageBase64Ref.value
  925. console.error('视频加载错误')
  926. }
  927. }
  928. // 修改 DUV 得分解释函数
  929. const getDuvScoreInterpretation = (score: number | undefined): string => {
  930. if (score === undefined) return '未进行心理测评或数据缺失'
  931. if (score <= 20) {
  932. return '心理状态健康,情绪稳定、认知正常。候选人在心理测评中表现出稳定的情绪状态和健康的心理特质,适合岗位要求。'
  933. } else if (score <= 35) {
  934. return '轻微焦虑或负面情绪,仍具备岗位适应力。候选人在某些方面可能存在轻微的心理压力,但总体上仍保持稳定,基本符合岗位要求。'
  935. } else if (score <= 55) {
  936. return '存在一定情绪波动或压力反应。候选人在测评中表现出一定程度的心理压力或情绪波动,建议进一步面谈评估。'
  937. } else if (score <= 70) {
  938. return '心理压力较大,可能影响工作稳定性。候选人在测评中表现出较明显的心理压力或情绪不稳定性,建议慎重录用或考虑调岗。'
  939. } else {
  940. return '可能存在较严重心理或精神问题。候选人在测评中表现出明显的心理或情绪问题,不建议录用。'
  941. }
  942. }
  943. // 更新 DUV 得分显示的 CSS 类判断逻辑
  944. const getDuvScoreClass = (score: number | undefined): string => {
  945. if (score === undefined) return 'text-gray-500'
  946. if (score <= 20) {
  947. return 'text-green-500' // 优秀
  948. } else if (score <= 35) {
  949. return 'text-blue-500' // 良好
  950. } else if (score <= 55) {
  951. return 'text-yellow-500' // 一般
  952. } else if (score <= 70) {
  953. return 'text-orange-500' // 偏差
  954. } else {
  955. return 'text-red-500' // 严重异常
  956. }
  957. }
  958. // 获取 DUV 得分等级
  959. const getDuvScoreLevel = (score: number | undefined): string => {
  960. if (score === undefined) return '未知'
  961. if (score <= 20) {
  962. return '优秀'
  963. } else if (score <= 35) {
  964. return '良好'
  965. } else if (score <= 55) {
  966. return '一般'
  967. } else if (score <= 70) {
  968. return '偏差'
  969. } else {
  970. return '严重异常'
  971. }
  972. }
  973. // 获取录用建议
  974. const getDuvHireRecommendation = (score: number | undefined): string => {
  975. if (score === undefined) return '无法给出建议'
  976. if (score <= 20) {
  977. return '建议优先录取'
  978. } else if (score <= 35) {
  979. return '可考虑录取'
  980. } else if (score <= 55) {
  981. return '建议进一步面谈评估'
  982. } else if (score <= 70) {
  983. return '慎重录用或建议调岗'
  984. } else {
  985. return '不建议录用'
  986. }
  987. }
  988. // 添加安全获取分数值的辅助函数
  989. const getSafeScoreValue = (score: number | undefined): number => {
  990. return score !== undefined ? score : 0
  991. }
  992. const getSafeMaxScoreValue = (maxScore: number | undefined): number => {
  993. return maxScore !== undefined ? maxScore : 210
  994. }
  995. // 用户个人信息状态
  996. const userProfileData = ref<UserProfile | null>(null);
  997. const userProfileDialogVisible = ref(false);
  998. const userProfileLoading = ref(false);
  999. // 获取用户个人信息
  1000. const fetchUserProfile = async () => {
  1001. userProfileLoading.value = true;
  1002. try {
  1003. // 从应用数据中获取用户ID和租户ID
  1004. const userId = apiData.value?.applicant?.id || route.query.user_id || '30';
  1005. const tenantId = route.query.tenant_id || '1';
  1006. const response = await fetch(`${import.meta.env.VITE_API_URL}/api/system/wechat/user/profile/get?user_id=${userId}&tenant_id=${tenantId}`);
  1007. const result = await response.json();
  1008. if (result.code === 2000) {
  1009. userProfileData.value = result.data;
  1010. userProfileDialogVisible.value = true;
  1011. } else {
  1012. ElMessage.error(result.msg || '获取用户信息失败');
  1013. }
  1014. } catch (error) {
  1015. console.error('获取用户个人信息失败:', error);
  1016. ElMessage.error('获取用户信息失败,请稍后重试');
  1017. } finally {
  1018. userProfileLoading.value = false;
  1019. }
  1020. };
  1021. // 格式化日期显示
  1022. const formatDate = (dateString: string | null | undefined): string => {
  1023. if (!dateString) return '未设置';
  1024. try {
  1025. const date = new Date(dateString);
  1026. return date.toLocaleDateString('zh-CN');
  1027. } catch (e) {
  1028. return dateString;
  1029. }
  1030. };
  1031. // 处理查看个人信息按钮点击
  1032. const handleViewProfile = () => {
  1033. fetchUserProfile();
  1034. };
  1035. const handleTabClick = (tab: any) => {
  1036. console.log('点击标签:', tab.props.name);
  1037. // 尝试多种方法找到目标元素
  1038. const targetId = tab.props.name;
  1039. const element = document.getElementById(targetId);
  1040. if (element) {
  1041. // 找到滚动容器 - 可能是document.body, document.documentElement, 或特定容器
  1042. const scrollContainer = document.querySelector('.max-w-4xl') ||
  1043. document.documentElement ||
  1044. document.body;
  1045. // 计算元素相对于滚动容器的位置
  1046. const containerRect = scrollContainer.getBoundingClientRect();
  1047. const elementRect = element.getBoundingClientRect();
  1048. const relativeTop = elementRect.top - containerRect.top;
  1049. // 滚动容器
  1050. if (scrollContainer === document.documentElement || scrollContainer === document.body) {
  1051. window.scrollTo({
  1052. top: window.scrollY + relativeTop - 100, // 减去100px的偏移
  1053. behavior: 'smooth'
  1054. });
  1055. } else {
  1056. scrollContainer.scrollTo({
  1057. top: scrollContainer.scrollTop + relativeTop - 100,
  1058. behavior: 'smooth'
  1059. });
  1060. }
  1061. console.log('执行滚动:', window.scrollY + relativeTop - 100);
  1062. } else {
  1063. console.error('未找到目标元素:', targetId);
  1064. }
  1065. };
  1066. // 添加一个备用的滚动函数,可以通过按钮直接调用
  1067. /* const scrollToSection = (sectionId: string) => {
  1068. console.log('尝试滚动到部分:', sectionId);
  1069. const element = document.getElementById(sectionId);
  1070. if (element) {
  1071. element.scrollIntoView({ behavior: 'smooth', block: 'start' });
  1072. setTimeout(() => {
  1073. window.scrollBy({ top: -100, behavior: 'smooth' });
  1074. }, 100);
  1075. }
  1076. }; */
  1077. // 添加到methods部分或直接在setup中定义
  1078. const setActiveTab = (sectionId: string) => {
  1079. // 移除所有标签的active类
  1080. document.querySelectorAll('.tab-item').forEach(tab => {
  1081. tab.classList.remove('active');
  1082. });
  1083. // 根据sectionId找到对应的标签并添加active类
  1084. const tabMap = {
  1085. 'comprehensive-assessment': 0,
  1086. 'image-analysis': 1,
  1087. 'answer-records': 2,
  1088. 'other-info': 3
  1089. };
  1090. const index = tabMap[sectionId];
  1091. if (index !== undefined) {
  1092. document.querySelectorAll('.tab-item')[index].classList.add('active');
  1093. }
  1094. };
  1095. // 修改scrollToSection函数
  1096. const scrollToSection = (sectionId: string) => {
  1097. console.log('尝试滚动到部分:', sectionId);
  1098. const element = document.getElementById(sectionId);
  1099. if (element) {
  1100. element.scrollIntoView({ behavior: 'smooth', block: 'start' });
  1101. setTimeout(() => {
  1102. window.scrollBy({ top: -100, behavior: 'smooth' });
  1103. setActiveTab(sectionId); // 设置激活的标签
  1104. }, 100);
  1105. }
  1106. };
  1107. // 修改获取手部照片的方法
  1108. const getHandPhotos = (hand: 'left' | 'right'): PhotoResult[] => {
  1109. console.log(apiData.value)
  1110. if (!apiData.value?.application?.visual_analysis_results?.photo_results) {
  1111. console.log('No photo results available');
  1112. return Array(3).fill({
  1113. url: '',
  1114. description: `${hand === 'left' ? '左手' : '右手'}手势`,
  1115. part_verification: null
  1116. });
  1117. }
  1118. const photos = apiData.value.application.visual_analysis_results.photo_results.filter((photo: PhotoResult) => {
  1119. const description = photo.description.toLowerCase();
  1120. const searchTerm = hand === 'left' ? '左手' : '右手';
  1121. const matches = description.includes(searchTerm);
  1122. console.log(`Checking photo ${photo.photo_id}: "${description}" for "${searchTerm}" - ${matches}`);
  1123. return matches;
  1124. });
  1125. console.log(`Found ${photos.length} ${hand} hand photos`);
  1126. // 确保始终返回3张图片的数组
  1127. const result = [...photos];
  1128. while (result.length < 3) {
  1129. result.push({
  1130. url: '',
  1131. status: 'empty',
  1132. photo_id: -result.length,
  1133. detections: [],
  1134. description: `${hand === 'left' ? '左手' : '右手'}手势`,
  1135. photo_index: -result.length,
  1136. analysis_model: '',
  1137. part_verification: null,
  1138. analysis_timestamp: '',
  1139. overall_assessment: ''
  1140. });
  1141. }
  1142. return result;
  1143. };
  1144. // 在script setup部分添加以下函数
  1145. const getScoreLevel = (score: number): string => {
  1146. if (score >= 90) return '优秀';
  1147. if (score >= 80) return '良好';
  1148. if (score >= 70) return '中等';
  1149. if (score >= 60) return '及格';
  1150. return '较差';
  1151. }
  1152. // 添加一个计算属性来获取competency_scores
  1153. const competencyScores = computed(() => {
  1154. return apiData.value?.application?.comprehensive_analysis?.competency_scores || {};
  1155. })
  1156. // 添加一个函数来获取标签的背景色
  1157. const getTagColorClass = (tagName: string): string => {
  1158. const colorMap: Record<string, string> = {
  1159. '沟通表达能力': 'bg-blue-100 text-blue-800',
  1160. '工作经历匹配度': 'bg-green-100 text-green-800',
  1161. '操作技能水平': 'bg-yellow-100 text-yellow-800',
  1162. '质量意识': 'bg-indigo-100 text-indigo-800',
  1163. '安全意识': 'bg-pink-100 text-pink-800',
  1164. '团队协作能力': 'bg-purple-100 text-purple-800',
  1165. '问题解决能力': 'bg-orange-100 text-orange-800',
  1166. '学习能力': 'bg-red-100 text-red-800',
  1167. '初级统筹能力': 'bg-teal-100 text-teal-800'
  1168. };
  1169. return colorMap[tagName] || 'bg-gray-100 text-gray-800';
  1170. }
  1171. </script>
  1172. <template>
  1173. <!-- 修改最外层容器的类,添加背景样式 -->
  1174. <div class="min-h-screen bg-gradient-custom">
  1175. <div class="max-w-4xl mx-auto p-6 relative overflow-y-auto" style="height: 100vh;">
  1176. <!-- 添加顶部锚点 -->
  1177. <div id="report-top" ref="reportTop"></div>
  1178. <!-- 加载状态 -->
  1179. <a-spin :spinning="loading" tip="加载中...">
  1180. <!-- 页面标题 -->
  1181. <div class="bg-[#1d1e3a] text-white p-4 rounded-t-lg">
  1182. <div class="flex justify-between items-center">
  1183. <div class="text-sm">No.{{ apiData?.application?.report_id || candidateInfo.idNumber }}</div>
  1184. <div class="text-sm">{{ apiData?.application?.interview_duration_formatted || new Date().toLocaleString() }}</div>
  1185. </div>
  1186. </div>
  1187. <div v-if="error" class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
  1188. <strong class="font-bold">错误!</strong>
  1189. <span class="block sm:inline">{{ error }}</span>
  1190. </div>
  1191. <div v-else class="bg-white rounded-b-lg shadow-lg p-6">
  1192. <!-- 头部信息 -->
  1193. <div class="flex justify-between items-center mb-8 pb-4 border-b">
  1194. <div class="flex items-center space-x-4">
  1195. <div class="w-20 h-20 bg-gray-200 rounded-lg overflow-hidden">
  1196. <img
  1197. :src="candidateInfo.additionalInfo.faceVerification.images[0]"
  1198. alt="头像"
  1199. class="w-full h-full object-cover"
  1200. @error="handleImageError"
  1201. >
  1202. </div>
  1203. <div>
  1204. <div class="flex items-center gap-2">
  1205. <h1 class="text-2xl font-bold">{{ candidateInfo.name }}</h1>
  1206. <el-button size="small" style="color: #1d1e3a; text-decoration: underline;" type="text" @click="handleViewProfile">
  1207. 个人信息
  1208. </el-button>
  1209. </div>
  1210. <p class="text-gray-600">{{ candidateInfo.phoneNumber }}</p>
  1211. <p v-if="apiData?.position" class="text-gray-500 text-sm">
  1212. 应聘职位: {{ apiData.position.title }} - {{ apiData.position.department }}
  1213. </p>
  1214. </div>
  1215. </div>
  1216. <div class="text-right">
  1217. <div class="text-4xl font-bold text-yellow-500">{{ candidateInfo.score }}<span class="text-base ml-1">分</span></div>
  1218. <div class="text-sm text-yellow-500">
  1219. {{ candidateInfo.score >= 70 ? '推荐 👍' : candidateInfo.score >= 60 ? '待定 🤔' : '不推荐 👎' }}
  1220. </div>
  1221. </div>
  1222. </div>
  1223. <!-- 基本信息 -->
  1224. <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
  1225. <div>
  1226. <label class="text-gray-600">身份证号</label>
  1227. <div>{{ candidateInfo.idNumber }}</div>
  1228. </div>
  1229. <!-- <div>
  1230. <label class="text-gray-600">入职之后,您缺岗的班次时间段是?</label>
  1231. <div>{{ candidateInfo.availabilityPeriod }}</div>
  1232. </div>
  1233. <div>
  1234. <label class="text-gray-600">请问您通过面试之后多久可以入职?</label>
  1235. <div>{{ candidateInfo.onboardingTime }}</div>
  1236. </div> -->
  1237. <div>
  1238. <label class="text-gray-600">薪资范围</label>
  1239. <div>{{ candidateInfo.salaryRange }}</div>
  1240. </div>
  1241. <div>
  1242. <label class="text-gray-600">建议薪资</label>
  1243. <div class="font-semibold text-blue-600">{{ candidateInfo.suggestedSalary }}</div>
  1244. </div>
  1245. </div>
  1246. <!-- 在标签导航下方添加备用导航按钮 -->
  1247. <!-- <div class="backup-navigation mt-4 mb-6 flex flex-wrap gap-2">
  1248. <el-button size="small" @click="scrollToSection('comprehensive-assessment')">
  1249. 综合评估
  1250. </el-button>
  1251. <el-button size="small" @click="scrollToSection('image-analysis')">
  1252. 图片分析
  1253. </el-button>
  1254. <el-button size="small" @click="scrollToSection('answer-records')">
  1255. 回答记录
  1256. </el-button>
  1257. <el-button size="small" @click="scrollToSection('other-info')">
  1258. 其他信息
  1259. </el-button>
  1260. </div> -->
  1261. <!-- 将原来的标签导航移到更上层,并添加固定定位 -->
  1262. <div class="sticky-tabs">
  1263. <div class="custom-tabs">
  1264. <div class="tab-item active" @click="scrollToSection('comprehensive-assessment')">
  1265. <span>综合评估</span>
  1266. </div>
  1267. <div class="tab-item" @click="scrollToSection('image-analysis')">
  1268. <span>图片分析评估</span>
  1269. </div>
  1270. <div class="tab-item" @click="scrollToSection('answer-records')">
  1271. <span>回答记录</span>
  1272. </div>
  1273. <div class="tab-item" @click="scrollToSection('other-info')">
  1274. <span>其他信息</span>
  1275. </div>
  1276. </div>
  1277. </div>
  1278. <!-- 为每个主要章节添加id -->
  1279. <div id="comprehensive-assessment" class="mb-8 pt-4 border-t border-transparent">
  1280. <!-- 1. 综合评估 -->
  1281. <div class="mb-8">
  1282. <h1 class="font-bold mb-6">1. 综合评估</h1>
  1283. <div class="space-y-4">
  1284. <!-- 为每个部分添加 id -->
  1285. <div id="hire-recommendation" class="border-b pb-4">
  1286. <!-- 录用建议部分的现有代码 -->
  1287. <div class=" pb-4" style="font-size: 16px;">
  1288. <div class="flex items-center justify-between mb-2">
  1289. <span class="text-gray-600">录用建议</span>
  1290. <span :class="{
  1291. 'text-green-500': candidateInfo.hireRecommendation?.includes('推荐'),
  1292. 'text-red-500': candidateInfo.hireRecommendation?.includes('不推荐'),
  1293. 'text-yellow-500': !candidateInfo.hireRecommendation?.includes('推荐') && !candidateInfo.hireRecommendation?.includes('不推荐')
  1294. }">{{ candidateInfo.hireRecommendation || '无建议' }}</span>
  1295. </div>
  1296. <p class="text-gray-600 text-sm" style="font-size: 14px;">{{ candidateInfo.hireReason || '无详细说明' }}</p>
  1297. </div>
  1298. </div>
  1299. <!-- 替换原有的评分详情部分 -->
  1300. <div id="red-line" class="border-b pb-4">
  1301. <!-- 红线题检测部分的现有代码 -->
  1302. <div class="flex items-center justify-between mb-2">
  1303. <span class="text-gray-600" style="color: red;">红线题检测结果</span>
  1304. <span :class="{
  1305. 'text-green-500': apiData?.required_questions_summary?.all_correct,
  1306. 'text-red-500': apiData?.required_questions_summary && !apiData.required_questions_summary.all_correct
  1307. }">
  1308. {{ apiData?.required_questions_summary?.all_correct ? '全部正确' : '存在错误,建议不录用' }}
  1309. </span>
  1310. </div>
  1311. <div v-if="apiData?.required_questions_summary && !apiData.required_questions_summary.all_correct"
  1312. class="mt-2 border-l-4 border-red-500 pl-3 bg-red-50 p-2 rounded">
  1313. <p class="text-red-700 font-medium mb-1">未通过的红线题:</p>
  1314. <ul v-if="apiData.required_questions_summary.failed_questions_details.length > 0"
  1315. class="list-disc pl-5 text-gray-600 text-sm">
  1316. <li v-for="(question, index) in apiData.required_questions_summary.failed_questions_details"
  1317. :key="'failed-'+index">
  1318. {{ question.question_text || `问题 ${index + 1}` }}
  1319. </li>
  1320. </ul>
  1321. <p v-else class="text-gray-600 text-sm">未提供详细信息</p>
  1322. </div>
  1323. </div>
  1324. <div id="strengths" v-if="candidateInfo.strengths && candidateInfo.strengths.length > 0" class="border-b pb-4">
  1325. <h3 class="font-semibold mb-2">优点</h3>
  1326. <ul class="list-disc pl-5 text-gray-600 text-sm">
  1327. <li v-for="(strength, index) in candidateInfo.strengths" :key="'strength-'+index">
  1328. {{ strength }}
  1329. </li>
  1330. </ul>
  1331. </div>
  1332. <div id="weaknesses" v-if="candidateInfo.weaknesses && candidateInfo.weaknesses.length > 0" class="border-b pb-4">
  1333. <h3 class="font-semibold mb-2">需改进的地方</h3>
  1334. <ul class="list-disc pl-5 text-gray-600 text-sm">
  1335. <li v-for="(weakness, index) in candidateInfo.weaknesses" :key="'weakness-'+index">
  1336. {{ weakness }}
  1337. </li>
  1338. </ul>
  1339. </div>
  1340. <div id="duv-analysis" class="border-b pb-4">
  1341. <!-- DUV心理测评部分的现有代码 -->
  1342. <div class="flex items-center justify-between mt-4 mb-2">
  1343. <span class="text-gray-600">DUV 心理测评得分</span>
  1344. <span :class="getDuvScoreClass(apiData?.scoring_summary?.total_score_obtained)">
  1345. {{ getSafeScoreValue(apiData?.scoring_summary?.total_score_obtained) }}
  1346. <span class="ml-2 text-sm">({{ getDuvScoreLevel(apiData?.scoring_summary?.total_score_obtained) }})</span>
  1347. </span>
  1348. </div>
  1349. <p class="text-gray-600 text-sm">
  1350. {{ getDuvScoreInterpretation(apiData?.scoring_summary?.total_score_obtained) }}
  1351. </p>
  1352. <p class="text-sm mt-1" :class="getDuvScoreClass(apiData?.scoring_summary?.total_score_obtained)">
  1353. <strong>录用建议:</strong> {{ getDuvHireRecommendation(apiData?.scoring_summary?.total_score_obtained) }}
  1354. </p>
  1355. </div>
  1356. <!-- 替换原有的评分详情部分 -->
  1357. <div id="score-calculation" class="border-b pb-4">
  1358. <div class="rounded-lg space-y-3">
  1359. <!-- 动态渲染competency_scores中的标签 -->
  1360. <div v-for="(score, tagId) in competencyScores"
  1361. :key="tagId"
  1362. class="flex items-start space-x-2"
  1363. style="font-size: 14px;">
  1364. <div :class="[getTagColorClass(score.tag_name), 'px-2 py-1 rounded text-sm whitespace-nowrap']"
  1365. style="font-size: 14px;">
  1366. {{ score.tag_name }}
  1367. </div>
  1368. <div class="flex-1">
  1369. <p class="text-gray-700">
  1370. {{ getScoreLevel(score.normalized_score) }}
  1371. <!-- <span class="text-sm text-gray-500 ml-2">({{ score.normalized_score }}分)</span> -->
  1372. </p>
  1373. </div>
  1374. </div>
  1375. <!-- 人脸一致性 (保留原有的) -->
  1376. <div class="flex items-start space-x-2" style="font-size: 14px;">
  1377. <div style="font-size: 14px;" class="bg-purple-100 text-purple-800 px-2 py-1 rounded text-sm whitespace-nowrap">人脸一致性</div>
  1378. <div class="flex-1">
  1379. <p class="text-gray-700">{{ apiData?.application?.comprehensive_analysis?.score_calculation?.face_consistency_score || '暂无数据' }}</p>
  1380. </div>
  1381. </div>
  1382. </div>
  1383. </div>
  1384. </div>
  1385. </div>
  1386. </div>
  1387. <div id="image-analysis" class="mb-8 pt-4 border-t border-transparent">
  1388. <h2 class=" font-bold mb-6">2. 图片分析评估</h2>
  1389. <div class="space-y-4">
  1390. <div v-for="(item, index) in candidateInfo.duvAnalysis" :key="index" class="border-b pb-4">
  1391. <div class="flex items-center justify-between mb-2">
  1392. <span class="text-gray-600">{{ item.title }}</span>
  1393. <span :class="{
  1394. 'text-green-500': item.type === 'positive',
  1395. 'text-red-500': item.type === 'negative',
  1396. 'text-yellow-500': item.type === 'neutral'
  1397. }">{{ item.score }}</span>
  1398. </div>
  1399. <p class="text-gray-600 text-sm">{{ item.content }}</p>
  1400. </div>
  1401. </div>
  1402. </div>
  1403. <div id="answer-records" class="mb-8 pt-4 border-t border-transparent">
  1404. <h2 class="font-bold mb-6">3. 回答记录</h2>
  1405. <div class="space-y-4">
  1406. <div v-for="(record, index) in candidateInfo.interviewRecord" :key="index" class="bg-gray-50 rounded-lg p-4">
  1407. <!-- 题目标题部分 -->
  1408. <div class="mb-4">
  1409. <div class="flex items-start space-x-2">
  1410. <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-sm">第{{ index + 1 }}题</div>
  1411. <div class="flex-1">
  1412. <h3 class="font-semibold text-gray-800">{{ record.question }}</h3>
  1413. </div>
  1414. </div>
  1415. <!-- 选择题布局 -->
  1416. <div v-if="record.question_form === 1 || record.question_form === 2 || record.question_form === 4" class="mt-4">
  1417. <div class="bg-white p-4 rounded-lg">
  1418. <!-- 显示选项 -->
  1419. <div v-if="record.options && record.options.length > 0" class="space-y-3">
  1420. <div v-for="(option, optIndex) in record.options" :key="optIndex"
  1421. :class="[
  1422. 'p-3 rounded border',
  1423. record.answer_data?.selected_option_details?.some(
  1424. (selected: { id: number }) => selected.id === option.id
  1425. )
  1426. ? 'border-blue-300 bg-blue-50'
  1427. : 'border-gray-200'
  1428. ]">
  1429. <div class="flex items-center justify-between">
  1430. <div class="flex-1">
  1431. <span class="text-gray-700">{{ option.option_text }}</span>
  1432. </div>
  1433. <div class="flex items-center space-x-2">
  1434. <!-- 只在非问卷调查题(question_form !== 4)时显示正确答案和对错状态 -->
  1435. <template v-if="record.question_form !== 4">
  1436. <span v-if="option.is_correct" class="text-green-500">✓ 正确答案</span>
  1437. <span v-if="record.answer_data?.selected_option_details?.some(
  1438. (selected: { id: number }) => selected.id === option.id
  1439. )"
  1440. :class="option.is_correct ? 'text-green-500' : 'text-red-500'">
  1441. {{ option.is_correct ? '(已选 - 正确)' : '(已选 - 错误)' }}
  1442. </span>
  1443. </template>
  1444. <!-- 问卷调查题只显示是否选中 -->
  1445. <template v-else>
  1446. <span v-if="record.answer_data?.selected_option_details?.some(
  1447. (selected: { id: number }) => selected.id === option.id
  1448. )"
  1449. class="text-blue-500">
  1450. (已选)
  1451. </span>
  1452. </template>
  1453. </div>
  1454. </div>
  1455. </div>
  1456. </div>
  1457. <!-- 显示答案状态 -->
  1458. <div class="mt-4 flex justify-between items-center">
  1459. <div class="text-gray-600">
  1460. 候选人: {{ record.answer_data?.selected_option_details?.map(
  1461. (opt: { option_text: string }) => opt.option_text
  1462. ).join(', ') || '未作答' }}
  1463. </div>
  1464. <!-- 只在非问卷调查题时显示对错状态 -->
  1465. <div v-if="record.question_form !== 4">
  1466. <span :class="[
  1467. 'px-3 py-1 rounded-full text-sm',
  1468. record.answer_data?.selected_option_details?.every(
  1469. (opt: { is_correct: boolean }) => opt.is_correct
  1470. )
  1471. ? 'bg-green-100 text-green-800'
  1472. : 'bg-red-100 text-red-800'
  1473. ]">
  1474. {{ record.answer_data?.selected_option_details?.every(
  1475. (opt: { is_correct: boolean }) => opt.is_correct
  1476. ) ? '正确' : '错误' }}
  1477. </span>
  1478. </div>
  1479. </div>
  1480. </div>
  1481. </div>
  1482. <!-- 视频问答题布局 -->
  1483. <div v-else-if="record.question_form === 0" class="mt-4 flex space-x-4">
  1484. <!-- 右侧答案和评分 -->
  1485. <div class="w-2/3">
  1486. <div class="bg-white p-4 rounded-lg">
  1487. <div class="mb-4">
  1488. <div class="flex items-start space-x-2">
  1489. <div class="bg-green-100 text-green-800 px-2 py-1 rounded text-sm">候选人</div>
  1490. <div class="flex-1">
  1491. <p class="text-gray-700">{{ record.answer }}</p>
  1492. </div>
  1493. </div>
  1494. </div>
  1495. <div>
  1496. <div class="flex items-start space-x-2">
  1497. <div class="bg-yellow-100 text-yellow-800 px-2 py-1 rounded text-sm">AI评分</div>
  1498. <div class="flex-1">
  1499. <p class="text-gray-600 m-0">{{ record.analysis }}</p>
  1500. <div class="mt-1 text-blue-500">得分:{{ record.score }}</div>
  1501. </div>
  1502. </div>
  1503. </div>
  1504. </div>
  1505. </div>
  1506. <!-- 左侧视频播放器 -->
  1507. <div class="w-1/3">
  1508. <div class="video-container">
  1509. <video
  1510. class="w-full h-full object-cover rounded-lg"
  1511. controls
  1512. :src="record.videoUrl"
  1513. preload="metadata"
  1514. :poster="fallbackImageBase64Ref"
  1515. @loadeddata="handleVideoLoaded"
  1516. @error="handleVideoError"
  1517. >
  1518. 您的浏览器不支持视频播放。
  1519. </video>
  1520. </div>
  1521. </div>
  1522. </div>
  1523. <!-- 图片题布局 -->
  1524. <div v-else-if="record.question_form === 3" class="mt-4">
  1525. <div class="grid grid-cols-2 gap-4">
  1526. <!-- 左侧图片显示 -->
  1527. <div class="bg-white p-4 rounded-lg">
  1528. <div class="aspect-w-16 aspect-h-9 rounded-lg overflow-hidden bg-gray-100">
  1529. <img
  1530. :src="record.question_image_url"
  1531. alt="题目图片"
  1532. class="w-full h-full object-contain"
  1533. @error="handleImageError"
  1534. >
  1535. </div>
  1536. </div>
  1537. <!-- 右侧选项和答案 -->
  1538. <div class="bg-white p-4 rounded-lg">
  1539. <!-- 显示选项 -->
  1540. <div v-if="record.options && record.options.length > 0" class="space-y-3">
  1541. <div v-for="(option, optIndex) in record.options" :key="optIndex"
  1542. :class="[
  1543. 'p-3 rounded border',
  1544. record.answer_data?.selected_option_details?.some(
  1545. (selected: { id: number }) => selected.id === option.id
  1546. )
  1547. ? 'border-blue-300 bg-blue-50'
  1548. : 'border-gray-200'
  1549. ]">
  1550. <div class="flex items-center justify-between">
  1551. <div class="flex-1">
  1552. <span class="text-gray-700">{{ option.option_text }}</span>
  1553. </div>
  1554. <div class="flex items-center space-x-2">
  1555. <span v-if="option.is_correct" class="text-green-500">✓ 正确答案</span>
  1556. <span v-if="record.answer_data?.selected_option_details?.some(
  1557. (selected: { id: number }) => selected.id === option.id
  1558. )"
  1559. :class="option.is_correct ? 'text-green-500' : 'text-red-500'">
  1560. {{ option.is_correct ? '(已选 - 正确)' : '(已选 - 错误)' }}
  1561. </span>
  1562. </div>
  1563. </div>
  1564. </div>
  1565. </div>
  1566. <!-- 显示答案状态 -->
  1567. <div class="mt-4 flex justify-between items-center">
  1568. <div class="text-gray-600">
  1569. 答案: {{ record.answer_data?.selected_option_details?.map(
  1570. (opt: { option_text: string }) => opt.option_text
  1571. ).join(', ') || '未作答' }}
  1572. </div>
  1573. <div>
  1574. <span :class="[
  1575. 'px-3 py-1 rounded-full text-sm',
  1576. record.answer_data?.selected_option_details?.every(
  1577. (opt: { is_correct: boolean }) => opt.is_correct
  1578. )
  1579. ? 'bg-green-100 text-green-800'
  1580. : 'bg-red-100 text-red-800'
  1581. ]">
  1582. {{ record.answer_data?.selected_option_details?.every(
  1583. (opt: { is_correct: boolean }) => opt.is_correct
  1584. ) ? '正确' : '错误' }}
  1585. </span>
  1586. </div>
  1587. </div>
  1588. </div>
  1589. </div>
  1590. </div>
  1591. </div>
  1592. </div>
  1593. </div>
  1594. </div>
  1595. <div id="other-info" class="mb-8 pt-4 border-t border-transparent">
  1596. <h2 class="font-bold mb-6">4. 其他信息</h2>
  1597. <div class="space-y-6">
  1598. <!-- 验证状态列表 -->
  1599. <div class="space-y-2">
  1600. <div class="flex items-center space-x-2">
  1601. <span class="text-gray-600">身份认证:</span>
  1602. <span class="text-green-500">{{ candidateInfo.additionalInfo.idVerification }}</span>
  1603. </div>
  1604. <div class="flex items-center space-x-2">
  1605. <span class="text-gray-600">手机号实名认证:</span>
  1606. <span class="text-green-500">{{ candidateInfo.additionalInfo.phoneVerification }}</span>
  1607. </div>
  1608. <!-- <div class="flex items-center space-x-2">
  1609. <span class="text-gray-600">综合A类评估:</span>
  1610. <span class="text-green-500">{{ candidateInfo.additionalInfo.comprehensiveVerification }}</span>
  1611. </div>
  1612. <div class="flex items-center space-x-2">
  1613. <span class="text-gray-600">综合B类评估:</span>
  1614. <span class="text-green-500">{{ candidateInfo.additionalInfo.comprehensiveVerification }}</span>
  1615. </div> -->
  1616. </div>
  1617. <!-- 手部综合检测 -->
  1618. <div class="space-y-4">
  1619. <div class="flex items-center space-x-2">
  1620. <span class="text-gray-600">手部综合检测:</span>
  1621. <span class="text-green-500">{{ candidateInfo.additionalInfo.handVerification }}</span>
  1622. </div>
  1623. <!-- 手部检测详细信息 -->
  1624. <!-- <div class="pl-4 space-y-2">
  1625. <div class="flex items-center space-x-2">
  1626. <span class="text-gray-600">手指灵活度:</span>
  1627. <span class="text-green-500">{{ candidateInfo.additionalInfo.handBrightness }}</span>
  1628. </div>
  1629. <div class="flex items-center space-x-2">
  1630. <span class="text-gray-600">手指完整度:</span>
  1631. <span class="text-green-500">{{ candidateInfo.additionalInfo.handIntegrity }}</span>
  1632. </div>
  1633. <div class="flex items-center space-x-2">
  1634. <span class="text-gray-600">手部姿态纹身:</span>
  1635. <span class="text-green-500">{{ candidateInfo.additionalInfo.handPoseRecognition }}</span>
  1636. </div>
  1637. </div> -->
  1638. <!-- 手势验证图片展示 -->
  1639. <div class="grid grid-cols-2 gap-8 mt-4">
  1640. <!-- 左手验证结果 -->
  1641. <div>
  1642. <h4 class="text-gray-600 mb-2">左手手势验证</h4>
  1643. <div class="grid grid-cols-3 gap-2">
  1644. <div v-for="(photo, index) in getHandPhotos('left')"
  1645. :key="index"
  1646. class="relative aspect-square rounded-lg overflow-hidden bg-gray-100"
  1647. :class="{'border-2': photo.part_verification,
  1648. 'border-green-500': photo.part_verification?.is_correct_part,
  1649. 'border-red-500': photo.part_verification && !photo.part_verification.is_correct_part}"
  1650. >
  1651. <!-- 使用 el-tooltip 包裹内容 -->
  1652. <el-tooltip
  1653. v-if="photo.part_verification && !photo.part_verification.is_correct_part"
  1654. :content="photo.part_verification.explanation || '未提供失败原因'"
  1655. placement="top"
  1656. effect="dark"
  1657. :show-after="200"
  1658. >
  1659. <div class="w-full h-full">
  1660. <img :src="photo.url"
  1661. :alt="photo.description"
  1662. class="w-full h-full object-cover"
  1663. @error="handleImageError">
  1664. <!-- 底部状态显示 -->
  1665. <div v-if="photo.part_verification"
  1666. class="absolute bottom-0 left-0 right-0 py-1 px-2 text-xs text-center text-white z-10"
  1667. :class="{
  1668. 'bg-green-500 bg-opacity-90': photo.part_verification.is_correct_part,
  1669. 'bg-red-500 bg-opacity-90': !photo.part_verification.is_correct_part
  1670. }">
  1671. {{ photo.part_verification.is_correct_part ? '通过' : '未通过' }}
  1672. </div>
  1673. </div>
  1674. </el-tooltip>
  1675. <!-- 如果不需要显示tooltip,直接显示图片 -->
  1676. <template v-else>
  1677. <img :src="photo.url"
  1678. :alt="photo.description"
  1679. class="w-full h-full object-cover"
  1680. @error="handleImageError">
  1681. <!-- 底部状态显示 -->
  1682. <div v-if="photo.part_verification"
  1683. class="absolute bottom-0 left-0 right-0 py-1 px-2 text-xs text-center text-white z-10"
  1684. :class="{
  1685. 'bg-green-500 bg-opacity-90': photo.part_verification.is_correct_part,
  1686. 'bg-red-500 bg-opacity-90': !photo.part_verification.is_correct_part
  1687. }">
  1688. {{ photo.part_verification.is_correct_part ? '通过' : '未通过' }}
  1689. </div>
  1690. </template>
  1691. </div>
  1692. </div>
  1693. </div>
  1694. <!-- 右手验证结果 -->
  1695. <div>
  1696. <h4 class="text-gray-600 mb-2">右手手势验证</h4>
  1697. <div class="grid grid-cols-3 gap-2">
  1698. <div v-for="(photo, index) in getHandPhotos('right')"
  1699. :key="index"
  1700. class="relative aspect-square rounded-lg overflow-hidden bg-gray-100"
  1701. :class="{'border-2': photo.part_verification,
  1702. 'border-green-500': photo.part_verification?.is_correct_part,
  1703. 'border-red-500': photo.part_verification && !photo.part_verification.is_correct_part}"
  1704. >
  1705. <!-- 使用 el-tooltip 包裹内容 -->
  1706. <el-tooltip
  1707. v-if="photo.part_verification && !photo.part_verification.is_correct_part"
  1708. :content="photo.part_verification.explanation || '未提供失败原因'"
  1709. placement="top"
  1710. effect="dark"
  1711. :show-after="200"
  1712. >
  1713. <div class="w-full h-full">
  1714. <img :src="photo.url"
  1715. :alt="photo.description"
  1716. class="w-full h-full object-cover"
  1717. @error="handleImageError">
  1718. <!-- 底部状态显示 -->
  1719. <div v-if="photo.part_verification"
  1720. class="absolute bottom-0 left-0 right-0 py-1 px-2 text-xs text-center text-white z-10"
  1721. :class="{
  1722. 'bg-green-500 bg-opacity-90': photo.part_verification.is_correct_part,
  1723. 'bg-red-500 bg-opacity-90': !photo.part_verification.is_correct_part
  1724. }">
  1725. {{ photo.part_verification.is_correct_part ? '通过' : '未通过' }}
  1726. </div>
  1727. </div>
  1728. </el-tooltip>
  1729. <!-- 如果不需要显示tooltip,直接显示图片 -->
  1730. <template v-else>
  1731. <img :src="photo.url"
  1732. :alt="photo.description"
  1733. class="w-full h-full object-cover"
  1734. @error="handleImageError">
  1735. <!-- 底部状态显示 -->
  1736. <div v-if="photo.part_verification"
  1737. class="absolute bottom-0 left-0 right-0 py-1 px-2 text-xs text-center text-white z-10"
  1738. :class="{
  1739. 'bg-green-500 bg-opacity-90': photo.part_verification.is_correct_part,
  1740. 'bg-red-500 bg-opacity-90': !photo.part_verification.is_correct_part
  1741. }">
  1742. {{ photo.part_verification.is_correct_part ? '通过' : '未通过' }}
  1743. </div>
  1744. </template>
  1745. </div>
  1746. </div>
  1747. </div>
  1748. </div>
  1749. </div>
  1750. <!-- 换人检测 -->
  1751. <div>
  1752. <h3 class="font-semibold mb-4">人脸验证: </h3>
  1753. <div class="grid grid-cols-3 md:grid-cols-6 gap-2">
  1754. <div v-for="(image, index) in candidateInfo.additionalInfo.faceVerification.images"
  1755. :key="index"
  1756. class="aspect-square rounded-lg overflow-hidden bg-gray-100">
  1757. <img :src="image"
  1758. alt="人脸验证"
  1759. class="w-full h-full object-cover"
  1760. @error="handleImageError">
  1761. </div>
  1762. </div>
  1763. </div>
  1764. </div>
  1765. </div>
  1766. </div>
  1767. </a-spin>
  1768. <!-- 悬浮按钮 (Element Plus 版本) -->
  1769. <div class="fixed right-8 bottom-24 flex flex-col space-y-4">
  1770. <el-button
  1771. type="primary"
  1772. style="margin-left: 12px;"
  1773. circle
  1774. @click="handleViewProfile"
  1775. >
  1776. <el-icon><User /></el-icon>
  1777. </el-button>
  1778. <el-button
  1779. type="primary"
  1780. style="margin-left: 12px;"
  1781. circle
  1782. @click="handleShare"
  1783. >
  1784. <el-icon><Share /></el-icon>
  1785. </el-button>
  1786. <el-button
  1787. type="primary"
  1788. circle
  1789. @click="handleDownload"
  1790. >
  1791. <el-icon><Download /></el-icon>
  1792. </el-button>
  1793. <el-button
  1794. type="primary"
  1795. circle
  1796. @click="handlePrint"
  1797. >
  1798. <el-icon><Printer /></el-icon>
  1799. </el-button>
  1800. <el-button
  1801. type="primary"
  1802. circle
  1803. @click="scrollToTop"
  1804. >
  1805. <el-icon><ArrowUp /></el-icon>
  1806. </el-button>
  1807. </div>
  1808. </div>
  1809. </div>
  1810. <!-- 用户个人信息弹窗 -->
  1811. <el-dialog
  1812. v-model="userProfileDialogVisible"
  1813. title="个人详细信息"
  1814. width="80%"
  1815. :close-on-click-modal="false"
  1816. class="user-profile-dialog"
  1817. >
  1818. <el-scrollbar height="70vh">
  1819. <el-spin :spinning="userProfileLoading">
  1820. <div v-if="userProfileData" class="user-profile-content">
  1821. <!-- 基本信息 -->
  1822. <div class="profile-section">
  1823. <h3 class="section-title">基本信息</h3>
  1824. <el-descriptions :column="3" border>
  1825. <el-descriptions-item label="姓名">{{ userProfileData.user_info.name }}</el-descriptions-item>
  1826. <el-descriptions-item label="手机号">{{ userProfileData.user_info.phone }}</el-descriptions-item>
  1827. <el-descriptions-item label="年龄">{{ userProfileData.user_info.age }}岁</el-descriptions-item>
  1828. <el-descriptions-item label="出生日期">{{ formatDate(userProfileData.user_info.birth_date) }}</el-descriptions-item>
  1829. <el-descriptions-item label="性别">{{ userProfileData.user_info.gender_name }}</el-descriptions-item>
  1830. <el-descriptions-item label="身份证号">{{ userProfileData.user_info.id_card }}</el-descriptions-item>
  1831. </el-descriptions>
  1832. </div>
  1833. <!-- 个人资料 -->
  1834. <div class="profile-section">
  1835. <h3 class="section-title">个人资料</h3>
  1836. <el-descriptions :column="3" border>
  1837. <el-descriptions-item label="政治面貌">{{ userProfileData.profile.political_status }}</el-descriptions-item>
  1838. <el-descriptions-item label="民族">{{ userProfileData.profile.ethnicity }}</el-descriptions-item>
  1839. <el-descriptions-item label="身高">{{ userProfileData.profile.height }}cm</el-descriptions-item>
  1840. <el-descriptions-item label="体重">{{ userProfileData.profile.weight }}kg</el-descriptions-item>
  1841. <el-descriptions-item label="籍贯">{{ userProfileData.profile.native_place }}</el-descriptions-item>
  1842. <el-descriptions-item label="户口所在地">{{ userProfileData.profile.household_location }}</el-descriptions-item>
  1843. <el-descriptions-item label="现居地址">{{ userProfileData.profile.current_address }}</el-descriptions-item>
  1844. <el-descriptions-item label="婚姻状况">{{ userProfileData.profile.marital_status_name }}</el-descriptions-item>
  1845. <el-descriptions-item label="是否有子女">{{ userProfileData.profile.has_children ? '是' : '否' }}</el-descriptions-item>
  1846. <el-descriptions-item label="期望薪资">{{ userProfileData.profile.expected_salary }}</el-descriptions-item>
  1847. <el-descriptions-item label="紧急联系人">{{ userProfileData.profile.emergency_contact }}</el-descriptions-item>
  1848. <el-descriptions-item label="紧急联系电话">{{ userProfileData.profile.emergency_phone }}</el-descriptions-item>
  1849. <el-descriptions-item label="特长">{{ userProfileData.profile.specialties }}</el-descriptions-item>
  1850. <el-descriptions-item label="人生格言">{{ userProfileData.profile.life_motto }}</el-descriptions-item>
  1851. <el-descriptions-item label="招聘来源">{{ userProfileData.profile.recruitment_source_name }}</el-descriptions-item>
  1852. </el-descriptions>
  1853. </div>
  1854. <!-- 教育经历 -->
  1855. <div class="profile-section" v-if="userProfileData.educations && userProfileData.educations.length > 0">
  1856. <h3 class="section-title">教育经历</h3>
  1857. <div v-for="(edu, index) in userProfileData.educations" :key="`edu-${index}`" class="mb-4">
  1858. <el-descriptions :column="3" border>
  1859. <el-descriptions-item label="学历类型">{{ edu.education_type_name }}</el-descriptions-item>
  1860. <el-descriptions-item label="学历">{{ edu.degree_name }}</el-descriptions-item>
  1861. <el-descriptions-item label="时间段">{{ formatDate(edu.start_date) }} 至 {{ formatDate(edu.end_date) }}</el-descriptions-item>
  1862. <el-descriptions-item label="学校名称">{{ edu.school_name }}</el-descriptions-item>
  1863. <el-descriptions-item label="专业">{{ edu.major }}</el-descriptions-item>
  1864. </el-descriptions>
  1865. </div>
  1866. </div>
  1867. <!-- 工作经历 -->
  1868. <div class="profile-section" v-if="userProfileData.work_experiences && userProfileData.work_experiences.length > 0">
  1869. <h3 class="section-title">工作经历</h3>
  1870. <div v-for="(work, index) in userProfileData.work_experiences" :key="`work-${index}`" class="mb-4">
  1871. <el-descriptions :column="3" border>
  1872. <el-descriptions-item label="公司名称">{{ work.company_name }}</el-descriptions-item>
  1873. <el-descriptions-item label="时间段">{{ formatDate(work.start_date) }} 至 {{ formatDate(work.end_date) }}</el-descriptions-item>
  1874. <el-descriptions-item label="部门">{{ work.department }}</el-descriptions-item>
  1875. <el-descriptions-item label="职位">{{ work.position }}</el-descriptions-item>
  1876. <el-descriptions-item label="公司规模">{{ work.company_size }}人</el-descriptions-item>
  1877. <el-descriptions-item label="月薪">{{ work.monthly_salary }}</el-descriptions-item>
  1878. <el-descriptions-item label="主管姓名">{{ work.supervisor_name }}</el-descriptions-item>
  1879. <el-descriptions-item label="主管电话">{{ work.supervisor_phone }}</el-descriptions-item>
  1880. <el-descriptions-item label="工作描述" :span="3">{{ work.job_description || '无' }}</el-descriptions-item>
  1881. <el-descriptions-item label="工作成就" :span="3">{{ work.achievements || '无' }}</el-descriptions-item>
  1882. <el-descriptions-item label="离职原因" :span="3">{{ work.resignation_reason || '无' }}</el-descriptions-item>
  1883. </el-descriptions>
  1884. </div>
  1885. </div>
  1886. <!-- 培训经历 -->
  1887. <div class="profile-section" v-if="userProfileData.trainings && userProfileData.trainings.length > 0">
  1888. <h3 class="section-title">培训经历</h3>
  1889. <div v-for="(training, index) in userProfileData.trainings" :key="`training-${index}`" class="mb-4">
  1890. <el-descriptions :column="3" border>
  1891. <el-descriptions-item label="培训名称">{{ training.training_name }}</el-descriptions-item>
  1892. <el-descriptions-item label="培训机构">{{ training.institution }}</el-descriptions-item>
  1893. <el-descriptions-item label="时间段">{{ formatDate(training.start_date) }} 至 {{ formatDate(training.end_date) }}</el-descriptions-item>
  1894. <el-descriptions-item label="培训描述" :span="3">{{ training.description }}</el-descriptions-item>
  1895. <el-descriptions-item label="证书">{{ training.certificate }}</el-descriptions-item>
  1896. </el-descriptions>
  1897. </div>
  1898. </div>
  1899. <!-- 家庭成员 -->
  1900. <div class="profile-section" v-if="userProfileData.family_members && userProfileData.family_members.length > 0">
  1901. <h3 class="section-title">家庭成员</h3>
  1902. <div v-for="(member, index) in userProfileData.family_members" :key="`family-${index}`" class="mb-4">
  1903. <el-descriptions :column="3" border>
  1904. <el-descriptions-item label="关系">{{ member.relation }}</el-descriptions-item>
  1905. <el-descriptions-item label="姓名">{{ member.name }}</el-descriptions-item>
  1906. <el-descriptions-item label="联系电话">{{ member.phone }}</el-descriptions-item>
  1907. <el-descriptions-item label="工作单位">{{ member.workplace }}</el-descriptions-item>
  1908. <el-descriptions-item label="职位">{{ member.position }}</el-descriptions-item>
  1909. </el-descriptions>
  1910. </div>
  1911. </div>
  1912. </div>
  1913. <div v-else class="empty-data">
  1914. <el-empty description="暂无个人信息数据"></el-empty>
  1915. </div>
  1916. </el-spin>
  1917. </el-scrollbar>
  1918. <template #footer>
  1919. <span class="dialog-footer">
  1920. <el-button @click="userProfileDialogVisible = false">关闭</el-button>
  1921. </span>
  1922. </template>
  1923. </el-dialog>
  1924. </template>
  1925. <style scoped>
  1926. /* 修改背景渐变样式,使用蓝色小精灵的配色 */
  1927. .bg-gradient-custom {
  1928. background: linear-gradient(180deg, #0066cc 0%, #3399ff 100%);
  1929. min-height: 100vh;
  1930. width: 100%;
  1931. position: relative;
  1932. overflow-y: auto;
  1933. scrollbar-width: none;
  1934. -ms-overflow-style: none;
  1935. }
  1936. /* 修改星星背景效果,使其更符合蓝色主题 */
  1937. .bg-gradient-custom::before {
  1938. content: '';
  1939. position: absolute;
  1940. top: 0;
  1941. left: 0;
  1942. right: 0;
  1943. bottom: 0;
  1944. background-image:
  1945. radial-gradient(2px 2px at 20px 30px, #ffffff30 50%, transparent 100%),
  1946. radial-gradient(2px 2px at 40px 70px, #ffffff30 50%, transparent 100%),
  1947. radial-gradient(2px 2px at 50px 160px, #ffffff30 50%, transparent 100%),
  1948. radial-gradient(2px 2px at 90px 40px, #ffffff30 50%, transparent 100%),
  1949. radial-gradient(2px 2px at 130px 80px, #ffffff30 50%, transparent 100%),
  1950. radial-gradient(2px 2px at 160px 120px, #ffffff30 50%, transparent 100%);
  1951. background-repeat: repeat;
  1952. background-size: 200px 200px;
  1953. opacity: 0.6;
  1954. z-index: 0;
  1955. animation: twinkle 4s infinite alternate;
  1956. }
  1957. /* 添加闪烁动画效果 */
  1958. @keyframes twinkle {
  1959. 0% {
  1960. opacity: 0.4;
  1961. }
  1962. 100% {
  1963. opacity: 0.7;
  1964. }
  1965. }
  1966. /* 修改页面标题区域样式 */
  1967. :deep(.bg-\[#1d1e3a\]) {
  1968. background-color: #004d99 !important; /* 深蓝色标题背景 */
  1969. }
  1970. /* 修改按钮悬浮效果 */
  1971. .el-button--primary {
  1972. background-color: #0066cc !important;
  1973. border-color: #0066cc !important;
  1974. }
  1975. .el-button--primary:hover {
  1976. background-color: #3399ff !important;
  1977. border-color: #3399ff !important;
  1978. transform: scale(1.05);
  1979. transition: all 0.3s ease;
  1980. }
  1981. /* 修改内容区域的样式 */
  1982. .max-w-4xl {
  1983. position: relative;
  1984. overflow-y: visible;
  1985. min-height: 100%;
  1986. z-index: 1;
  1987. scrollbar-width: none;
  1988. -ms-overflow-style: none;
  1989. }
  1990. .max-w-4xl::-webkit-scrollbar {
  1991. display: none;
  1992. }
  1993. .video-container {
  1994. position: relative;
  1995. width: 100%;
  1996. max-width: 240px;
  1997. aspect-ratio: 3/4;
  1998. margin: 0 auto;
  1999. background: #000;
  2000. border-radius: 12px;
  2001. overflow: hidden;
  2002. }
  2003. .ant-form-item {
  2004. margin-bottom: 24px;
  2005. }
  2006. .fixed {
  2007. z-index: 100;
  2008. }
  2009. .ant-btn-circle {
  2010. width: 40px;
  2011. height: 40px;
  2012. padding: 0;
  2013. border-radius: 50%;
  2014. }
  2015. /* 修改滚动相关样式 */
  2016. html, body {
  2017. height: 100%;
  2018. scroll-behavior: smooth;
  2019. overflow-y: auto !important; /* 强制允许垂直滚动 */
  2020. }
  2021. /* 确保主容器可以正常滚动 */
  2022. .max-w-4xl {
  2023. position: relative;
  2024. overflow-y: visible;
  2025. min-height: 100%;
  2026. }
  2027. /* 添加以下样式确保内容可以正常滚动 */
  2028. body {
  2029. margin: 0;
  2030. padding: 0;
  2031. overflow-y: auto !important;
  2032. }
  2033. #app {
  2034. height: auto;
  2035. min-height: 100vh;
  2036. overflow: visible;
  2037. }
  2038. /* 确保滚动容器不会被阻止滚动 */
  2039. .ant-layout,
  2040. .ant-layout-content,
  2041. .el-scrollbar__wrap,
  2042. .el-scrollbar__view {
  2043. overflow-y: auto !important;
  2044. }
  2045. @media (max-width: 768px) {
  2046. .max-w-4xl {
  2047. padding: 1rem;
  2048. }
  2049. .grid-cols-3 {
  2050. grid-template-columns: 1fr;
  2051. }
  2052. .fixed {
  2053. right: 1rem;
  2054. }
  2055. }
  2056. /* 打印样式 */
  2057. @media print {
  2058. /* 打印时隐藏悬浮按钮 */
  2059. .fixed {
  2060. display: none !important;
  2061. }
  2062. /* 确保内容完整显示 */
  2063. .max-w-4xl {
  2064. max-width: 100% !important;
  2065. padding: 0 !important;
  2066. margin: 0 !important;
  2067. }
  2068. /* 调整页面边距 */
  2069. @page {
  2070. margin: 1cm;
  2071. }
  2072. /* 确保背景色和图片打印 */
  2073. * {
  2074. -webkit-print-color-adjust: exact !important;
  2075. color-adjust: exact !important;
  2076. print-color-adjust: exact !important;
  2077. }
  2078. /* 避免视频容器在打印时出现问题 */
  2079. .video-container {
  2080. page-break-inside: avoid;
  2081. break-inside: avoid;
  2082. }
  2083. /* 确保每个主要部分在新页面开始 */
  2084. h2.text-xl {
  2085. page-break-before: always;
  2086. break-before: always;
  2087. }
  2088. /* 第一个标题不需要分页 */
  2089. h2.text-xl:first-of-type {
  2090. page-break-before: avoid;
  2091. break-before: avoid;
  2092. }
  2093. .bg-gradient-custom {
  2094. background: none !important;
  2095. }
  2096. .bg-gradient-custom::before {
  2097. display: none !important;
  2098. }
  2099. }
  2100. /* 确保内容区域可以正常滚动 */
  2101. .max-w-4xl {
  2102. position: relative;
  2103. overflow-y: auto;
  2104. height: 100%;
  2105. padding-bottom: 100px; /* 为底部按钮留出空间 */
  2106. }
  2107. /* 添加用户个人信息弹窗样式 */
  2108. .user-profile-content {
  2109. padding: 0 16px;
  2110. }
  2111. .profile-section {
  2112. margin-bottom: 24px;
  2113. }
  2114. .section-title {
  2115. font-size: 18px;
  2116. font-weight: 600;
  2117. margin-bottom: 16px;
  2118. padding-bottom: 8px;
  2119. border-bottom: 1px solid #ebeef5;
  2120. color: #0066cc;
  2121. }
  2122. :deep(.el-descriptions__label) {
  2123. background-color: #f5f7fa;
  2124. font-weight: 500;
  2125. }
  2126. :deep(.el-descriptions__content) {
  2127. padding: 12px 16px;
  2128. }
  2129. .empty-data {
  2130. padding: 40px 0;
  2131. display: flex;
  2132. justify-content: center;
  2133. }
  2134. /* 确保弹窗内容可以滚动 */
  2135. :deep(.el-dialog__body) {
  2136. padding: 16px 0;
  2137. max-height: 70vh;
  2138. overflow: hidden;
  2139. }
  2140. /* 修改弹窗标题样式 */
  2141. :deep(.el-dialog__header) {
  2142. padding: 16px 20px;
  2143. background-color: #0066cc;
  2144. margin-right: 0;
  2145. }
  2146. :deep(.el-dialog__title) {
  2147. color: white;
  2148. font-weight: 600;
  2149. }
  2150. :deep(.el-dialog__headerbtn .el-dialog__close) {
  2151. color: white;
  2152. }
  2153. /* 修改弹窗底部样式 */
  2154. :deep(.el-dialog__footer) {
  2155. padding: 12px 20px;
  2156. border-top: 1px solid #ebeef5;
  2157. }
  2158. /* 添加标签样式 */
  2159. :deep(.el-tabs__nav-wrap) {
  2160. background-color: white;
  2161. border-radius: 8px;
  2162. padding: 4px;
  2163. }
  2164. :deep(.el-tabs__item) {
  2165. color: #606266;
  2166. font-size: 14px;
  2167. padding: 0 20px;
  2168. height: 36px;
  2169. line-height: 36px;
  2170. transition: all 0.3s;
  2171. }
  2172. :deep(.el-tabs__item.is-active) {
  2173. color: #0066cc;
  2174. font-weight: 500;
  2175. }
  2176. :deep(.el-tabs__active-bar) {
  2177. background-color: #0066cc;
  2178. }
  2179. /* 确保内容区域有足够的滚动空间 */
  2180. .space-y-4 > div {
  2181. scroll-margin-top: 120px; /* 增加滚动边距,避免被固定导航遮挡 */
  2182. }
  2183. /* 主要章节的滚动定位调整 */
  2184. #comprehensive-assessment,
  2185. #image-analysis,
  2186. #answer-records,
  2187. #other-info {
  2188. scroll-margin-top: 120px; /* 增加滚动边距 */
  2189. padding-top: 20px; /* 添加顶部内边距,使内容更清晰可见 */
  2190. border-top: 1px solid transparent; /* 添加透明边框,帮助滚动定位 */
  2191. }
  2192. /* 打印时隐藏固定导航 */
  2193. @media print {
  2194. .sticky-tabs {
  2195. display: none !important;
  2196. }
  2197. }
  2198. /* 确保固定导航不会干扰滚动 */
  2199. .sticky-tabs {
  2200. position: sticky;
  2201. top: -24px;
  2202. z-index: 10;
  2203. background-color: white;
  2204. padding: 10px 0;
  2205. margin-bottom: 20px;
  2206. /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
  2207. }
  2208. /* 自定义标签样式 - 匹配图片中的深色标签 */
  2209. :deep(.custom-tabs) {
  2210. background-color: #1d1e3a;
  2211. border-radius: 0;
  2212. }
  2213. :deep(.custom-tabs .el-tabs__header) {
  2214. margin: 0;
  2215. border: none;
  2216. background-color: #1d1e3a;
  2217. }
  2218. :deep(.custom-tabs .el-tabs__nav) {
  2219. border: none;
  2220. background-color: #1d1e3a;
  2221. }
  2222. :deep(.custom-tabs .el-tabs__item) {
  2223. color: white;
  2224. font-size: 14px;
  2225. padding: 0 20px;
  2226. height: 40px;
  2227. line-height: 40px;
  2228. border: none;
  2229. background-color: transparent;
  2230. }
  2231. :deep(.custom-tabs .el-tabs__item.is-active) {
  2232. color: white;
  2233. font-weight: 500;
  2234. background-color: #4e4e8b;
  2235. }
  2236. :deep(.custom-tabs .el-tabs__item:hover) {
  2237. color: white;
  2238. background-color: #4e4e8b;
  2239. }
  2240. :deep(.custom-tabs .el-tabs__nav-wrap::after) {
  2241. display: none;
  2242. }
  2243. .sticky-tabs {
  2244. position: sticky;
  2245. top: -25px;
  2246. z-index: 10;
  2247. margin-bottom: 20px;
  2248. }
  2249. .custom-tabs {
  2250. display: flex;
  2251. background-color: #1d1e3a;
  2252. width: 100%;
  2253. overflow-x: auto;
  2254. white-space: nowrap;
  2255. border-radius: 5px;
  2256. }
  2257. .tab-item {
  2258. padding: 0 20px;
  2259. height: 40px;
  2260. line-height: 40px;
  2261. color: white;
  2262. font-size: 14px;
  2263. cursor: pointer;
  2264. text-align: center;
  2265. transition: background-color 0.3s;
  2266. width: 25%;
  2267. /* flex: 1; */
  2268. min-width: max-content;
  2269. }
  2270. .tab-item:hover {
  2271. background-color: #4e4e8b;
  2272. }
  2273. .tab-item.active {
  2274. background-color: #4e4e8b;
  2275. font-weight: 500;
  2276. }
  2277. /* 确保在移动设备上也能正常滚动 */
  2278. @media (max-width: 768px) {
  2279. .custom-tabs {
  2280. justify-content: flex-start;
  2281. }
  2282. .tab-item {
  2283. flex: 0 0 auto;
  2284. }
  2285. }
  2286. /* 添加新的样式 */
  2287. .group {
  2288. position: relative;
  2289. }
  2290. .group:hover .group-hover\:opacity-100 {
  2291. opacity: 1;
  2292. }
  2293. .transition-opacity {
  2294. transition: opacity 0.2s ease-in-out;
  2295. }
  2296. </style>