pcm-agents 0.6.62 → 0.6.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components-position-selector_28.cjs.entry.js +6 -8
- package/dist/cjs/components-position-selector_28.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-oCI89hDY.js → index-NR0bG-Uv.js} +3 -3
- package/dist/cjs/{index-oCI89hDY.js.map → index-NR0bG-Uv.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/oem-htws-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-jd-modal.cjs.entry.js +2 -2
- package/dist/cjs/oem-jlpp-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-jlsx-modal.cjs.entry.js +2 -2
- package/dist/cjs/oem-jlzz-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-mnct-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-qgqjl-modal.cjs.entry.js +1 -1
- package/dist/cjs/oem-zygh-modal.cjs.entry.js +1 -1
- package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +2 -2
- package/dist/cjs/pcm-mnms-modal.cjs.entry.js +2 -3
- package/dist/cjs/pcm-mnms-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/pcm-mnms-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/pcm-zygh-v2-modal.cjs.entry.js +1 -1
- package/dist/cjs/{sentry-reporter-BmOwSI2j.js → sentry-reporter-BvQcVVQ_.js} +3 -3
- package/dist/cjs/{sentry-reporter-BmOwSI2j.js.map → sentry-reporter-BvQcVVQ_.js.map} +1 -1
- package/dist/collection/components/oem-mnms-modal/oem-mnms-modal.js +2 -3
- package/dist/collection/components/oem-mnms-modal/oem-mnms-modal.js.map +1 -1
- package/dist/collection/components/pcm-1zhanshi-mnms-modal/pcm-1zhanshi-mnms-modal.js +1 -1
- package/dist/collection/components/pcm-1zhanshi-mnms-modal/pcm-1zhanshi-mnms-modal.js.map +1 -1
- package/dist/collection/components/pcm-jlzz-modal/pcm-jlzz-modal.js +2 -2
- package/dist/collection/components/pcm-jlzz-modal/pcm-jlzz-modal.js.map +1 -1
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +2 -3
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
- package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js +2 -3
- package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js.map +1 -1
- package/dist/components/components-position-selector.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/oem-htws-modal.js +6 -6
- package/dist/components/oem-jd-modal.js +4 -4
- package/dist/components/oem-jlpp-modal.js +8 -8
- package/dist/components/oem-jlsx-modal.js +6 -6
- package/dist/components/oem-jlzz-modal.js +6 -6
- package/dist/components/oem-mnct-modal.js +8 -8
- package/dist/components/oem-mnms-modal.js +10 -11
- package/dist/components/oem-mnms-modal.js.map +1 -1
- package/dist/components/oem-qgqjl-modal.js +8 -8
- package/dist/components/oem-zygh-modal.js +6 -6
- package/dist/components/{p-ZQIpCN-g.js → p-B0in66n7.js} +3 -3
- package/dist/components/{p-ZQIpCN-g.js.map → p-B0in66n7.js.map} +1 -1
- package/dist/components/{p-D4N6bvJF.js → p-C3QG0kk0.js} +4 -4
- package/dist/components/{p-D4N6bvJF.js.map → p-C3QG0kk0.js.map} +1 -1
- package/dist/components/{p-DLAGpFb_.js → p-CNKZCbo_.js} +5 -5
- package/dist/components/{p-DLAGpFb_.js.map → p-CNKZCbo_.js.map} +1 -1
- package/dist/components/{p-bq_oqII4.js → p-CNx58GiW.js} +3 -3
- package/dist/components/{p-bq_oqII4.js.map → p-CNx58GiW.js.map} +1 -1
- package/dist/components/{p-D0Yu-fO8.js → p-DY30qE8x.js} +3 -3
- package/dist/components/{p-D0Yu-fO8.js.map → p-DY30qE8x.js.map} +1 -1
- package/dist/components/{p-Bq2zTnFk.js → p-DeoeSzgS.js} +3 -3
- package/dist/components/{p-Bq2zTnFk.js.map → p-DeoeSzgS.js.map} +1 -1
- package/dist/components/{p-BvRXK_mf.js → p-Dl6ISIDE.js} +3 -3
- package/dist/components/{p-BvRXK_mf.js.map → p-Dl6ISIDE.js.map} +1 -1
- package/dist/components/{p-Dc0jLjwJ.js → p-_ysXxBbt.js} +3 -3
- package/dist/components/{p-Dc0jLjwJ.js.map → p-_ysXxBbt.js.map} +1 -1
- package/dist/components/{p-D0nx0wKX.js → p-ebsIIpQh.js} +3 -3
- package/dist/components/{p-D0nx0wKX.js.map → p-ebsIIpQh.js.map} +1 -1
- package/dist/components/{p-NcgycWbs.js → p-zNL5HFbN.js} +3 -3
- package/dist/components/{p-NcgycWbs.js.map → p-zNL5HFbN.js.map} +1 -1
- package/dist/components/pcm-1zhanshi-mnms-modal.js +6 -6
- package/dist/components/pcm-1zhanshi-mnms-modal.js.map +1 -1
- package/dist/components/pcm-app-chat-modal.js +1 -1
- package/dist/components/pcm-card.js +1 -1
- package/dist/components/pcm-chat-message.js +1 -1
- package/dist/components/pcm-digital-human.js +1 -1
- package/dist/components/pcm-export-records-modal.js +1 -1
- package/dist/components/pcm-hr-chat-modal.js +2 -2
- package/dist/components/pcm-htws-modal.js +7 -7
- package/dist/components/pcm-hyzj-modal.js +4 -4
- package/dist/components/pcm-jd-modal.js +4 -4
- package/dist/components/pcm-jlpp-modal.js +7 -7
- package/dist/components/pcm-jlsx-modal.js +5 -5
- package/dist/components/pcm-jlzz-modal.js +7 -7
- package/dist/components/pcm-mnct-modal.js +4 -4
- package/dist/components/pcm-mnms-modal.js +9 -10
- package/dist/components/pcm-mnms-modal.js.map +1 -1
- package/dist/components/pcm-mnms-zp-modal.js +9 -10
- package/dist/components/pcm-mnms-zp-modal.js.map +1 -1
- package/dist/components/pcm-mobile-input-btn.js +1 -1
- package/dist/components/pcm-mobile-upload-btn.js +1 -1
- package/dist/components/pcm-msbg-modal.js +4 -4
- package/dist/components/pcm-qgqjl-modal.js +7 -7
- package/dist/components/pcm-upload.js +1 -1
- package/dist/components/pcm-virtual-chat-modal.js +1 -1
- package/dist/components/pcm-zsk-chat-modal.js +2 -2
- package/dist/components/pcm-zygh-modal.js +6 -6
- package/dist/components/pcm-zygh-v2-modal.js +6 -6
- package/dist/esm/components-position-selector_28.entry.js +6 -8
- package/dist/esm/components-position-selector_28.entry.js.map +1 -1
- package/dist/esm/{index-CK35lVyu.js → index-DcHaiJdv.js} +3 -3
- package/dist/esm/{index-CK35lVyu.js.map → index-DcHaiJdv.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/oem-htws-modal.entry.js +1 -1
- package/dist/esm/oem-jd-modal.entry.js +2 -2
- package/dist/esm/oem-jlpp-modal.entry.js +1 -1
- package/dist/esm/oem-jlsx-modal.entry.js +2 -2
- package/dist/esm/oem-jlzz-modal.entry.js +1 -1
- package/dist/esm/oem-mnct-modal.entry.js +1 -1
- package/dist/esm/oem-qgqjl-modal.entry.js +1 -1
- package/dist/esm/oem-zygh-modal.entry.js +1 -1
- package/dist/esm/pcm-hr-chat-modal.entry.js +2 -2
- package/dist/esm/pcm-mnms-modal.entry.js +2 -3
- package/dist/esm/pcm-mnms-modal.entry.js.map +1 -1
- package/dist/esm/pcm-zygh-v2-modal.entry.js +1 -1
- package/dist/esm/{sentry-reporter-4lgFL2MJ.js → sentry-reporter-BZ6jaP_d.js} +3 -3
- package/dist/esm/{sentry-reporter-4lgFL2MJ.js.map → sentry-reporter-BZ6jaP_d.js.map} +1 -1
- package/dist/pcm-agents/index.esm.js +1 -1
- package/dist/pcm-agents/{p-f68e45d7.entry.js → p-079c81fd.entry.js} +2 -2
- package/dist/pcm-agents/{p-66df336d.entry.js → p-178f3772.entry.js} +2 -2
- package/dist/pcm-agents/{p-94cd1672.entry.js → p-22e147d9.entry.js} +2 -2
- package/dist/pcm-agents/{p-4f7cce57.entry.js → p-26c3bb94.entry.js} +2 -2
- package/dist/pcm-agents/{p-0c7a4fd3.entry.js → p-285a11db.entry.js} +2 -2
- package/dist/pcm-agents/{p-1f724e43.entry.js → p-359d3474.entry.js} +2 -2
- package/dist/pcm-agents/{p-d63c3394.entry.js → p-4a91a26a.entry.js} +2 -2
- package/dist/pcm-agents/{p-0d795f3f.entry.js → p-6037c915.entry.js} +2 -2
- package/dist/pcm-agents/{p-730afd8d.entry.js → p-7a6267c2.entry.js} +2 -2
- package/dist/pcm-agents/{p-CJrQ18zg.js → p-CBQPOkZb.js} +2 -2
- package/dist/pcm-agents/{p-CJrQ18zg.js.map → p-CBQPOkZb.js.map} +1 -1
- package/dist/pcm-agents/{p-DU3DLNhC.js → p-WTSeW6oH.js} +2 -2
- package/dist/pcm-agents/{p-DU3DLNhC.js.map → p-WTSeW6oH.js.map} +1 -1
- package/dist/pcm-agents/p-ca2fb22a.entry.js +245 -0
- package/dist/pcm-agents/p-ca2fb22a.entry.js.map +1 -0
- package/dist/pcm-agents/{p-86721538.entry.js → p-da967a8c.entry.js} +2 -2
- package/dist/pcm-agents/{p-303078d8.entry.js → p-df3f8c9a.entry.js} +2 -2
- package/dist/pcm-agents/{p-303078d8.entry.js.map → p-df3f8c9a.entry.js.map} +1 -1
- package/dist/pcm-agents/pcm-agents.esm.js +1 -1
- package/dist/pcm-agents/pcm-mnms-modal.entry.esm.js.map +1 -1
- package/dist/types/components/oem-mnms-modal/oem-mnms-modal.d.ts +0 -1
- package/dist/types/components/pcm-jlzz-modal/pcm-jlzz-modal.d.ts +1 -1
- package/dist/types/components/pcm-mnms-modal/pcm-mnms-modal.d.ts +0 -1
- package/dist/types/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.d.ts +0 -1
- package/dist/types/components.d.ts +8 -8
- package/package.json +1 -1
- package/dist/pcm-agents/p-b89a19be.entry.js +0 -245
- package/dist/pcm-agents/p-b89a19be.entry.js.map +0 -1
- /package/dist/pcm-agents/{p-f68e45d7.entry.js.map → p-079c81fd.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-66df336d.entry.js.map → p-178f3772.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-94cd1672.entry.js.map → p-22e147d9.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-4f7cce57.entry.js.map → p-26c3bb94.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-0c7a4fd3.entry.js.map → p-285a11db.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-1f724e43.entry.js.map → p-359d3474.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-d63c3394.entry.js.map → p-4a91a26a.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-0d795f3f.entry.js.map → p-6037c915.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-730afd8d.entry.js.map → p-7a6267c2.entry.js.map} +0 -0
- /package/dist/pcm-agents/{p-86721538.entry.js.map → p-da967a8c.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,g as i,h as s}from"./p-Bq0K-WqZ.js";import{a as o,c as n,u as r,s as a,b as l,d,v as c}from"./p-DU3DLNhC.js";import{S as h}from"./p-CJrQ18zg.js";import"./p-Bs-zO1WZ.js";const p=":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:800px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.placeholder-status p{font-size:16px}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-left div{font-size:16px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;min-height:200px;background:url(https://pcm-resource-1312611446.cos.ap-guangzhou.myqcloud.com/web/sdk/chat_bg.png);background-size:100%}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#999;cursor:pointer;padding:4px 8px;font-size:16px;line-height:1;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f0f0f0;color:#666}.initial-upload{padding:16px;display:flex;flex-direction:column;align-items:center;height:100%}.upload-section{max-width:600px;width:100%;text-align:center}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px}.submit-button:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.category-select,.dimension-select{margin:30px 0}.category-options,.dimension-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.category-button,.dimension-button{padding:12px 16px;border:1px solid #E5E5E5;border-radius:6px;background:white;cursor:pointer;transition:all 0.3s}.category-button:hover,.dimension-button:hover{background:#f5f5f5}.category-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.dimension-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:14px;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:16px;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:16px}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}";const u=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const g=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.someErrorEvent=t(this,"someErrorEvent");this.interviewComplete=t(this,"interviewComplete");this.recordingError=t(this,"recordingError");this.recordingStatusChange=t(this,"recordingStatusChange");this.tokenInvalid=t(this,"tokenInvalid")}modalTitle="金牌HR大赛";token;isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return i(this)}streamComplete;conversationStart;someErrorEvent;selectedFile=null;isUploading=false;uploadedFileInfo=[];aiException=false;defaultQuery="请开始出题";showInitialUpload=true;selectedJobCategory="";jobCategories=["人力资源学生(实习)","人力资源专员","人力资源主管","人力资源经理","人力资源总监"];dimensions=["人力资源规划","招聘与配置","员工关系","培训与开发","薪酬与绩效","组织与人才发展"];selectedDimensions=[];isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=15;videoRef=null;totalQuestions=2;currentQuestionNumber=0;interviewComplete;SCROLL_THRESHOLD=20;maxRecordingTime=120;countdownWarningTime=30;showCountdownWarning=false;toEmail="";callbackUrl="";fullscreen=false;isUploadingVideo=false;requireResume=false;isPlayingAudio=false;audioUrl=null;audioElement=null;recordingError;recordingStatusChange;tokenInvalid;enableVoice=true;enableAudio=true;displayContentStatus=true;isTaskCompleted=false;tokenInvalidListener;isUserScrolling=false;isPageFocused=true;isWindowVisible=true;visibilityChangeListener;blurListener;focusListener;handleTokenChange(e){if(e&&e!==o.getToken()){o.setToken(e)}}componentWillLoad(){if(this.zIndex){n.setItem("modal-zIndex",this.zIndex)}if(this.token){o.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener);this.visibilityChangeListener=()=>{const e=!document.hidden;this.isWindowVisible=e;if(!e){h.captureMessage("用户失去焦点 - 页面隐藏",{action:"visibilityChange",component:"pcm-hr-chat-modal",type:"visibility_hidden",timestamp:Date.now(),isRecording:this.isRecording,currentQuestionNumber:this.currentQuestionNumber,conversationId:this.conversationId})}};this.blurListener=()=>{this.isPageFocused=false;h.captureMessage("用户失去焦点 - 窗口失焦",{action:"windowBlur",component:"pcm-hr-chat-modal",type:"window_blur",timestamp:Date.now(),isRecording:this.isRecording,currentQuestionNumber:this.currentQuestionNumber,conversationId:this.conversationId})};this.focusListener=()=>{this.isPageFocused=true};document.addEventListener("visibilitychange",this.visibilityChangeListener);window.addEventListener("blur",this.blurListener);window.addEventListener("focus",this.focusListener)}handleClose=()=>{this.stopRecording();this.modalClosed.emit()};handleFileChange=async e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};async uploadFile(){if(!this.selectedFile||this.uploadedFileInfo.length>0)return;this.isUploading=true;try{const e=await r(this.selectedFile,{},{tags:["resume"]});if(e){this.uploadedFileInfo=[{cos_key:e.cos_key,file_name:e.file_name,file_size:e.file_size,ext:e.ext}]}}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();this.someErrorEvent.emit({error:e,message:"文件上传失败,请重试"});h.captureError(e,{action:"uploadFile",component:"pcm-hr-chat-modal",title:"文件上传失败"})}finally{this.isUploading=false}}handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=[];const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async sendMessageToAPI(e){this.isLoading=true;let t="";let i="";const s=new Date;const o=`${s.getHours()}:${s.getMinutes().toString().padStart(2,"0")}`;const n=e.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const r=this.messages.length>0?this.messages[this.messages.length-1]:null;if(r&&this.conversationId&&e!=="下一题"){this.saveAnswer(this.conversationId,r.answer,n)}const l=this.currentQuestionNumber>=this.totalQuestions&&e==="下一题";const c={id:`temp-${Date.now()}`,time:o,query:n,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=c;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);if(l){this.messages=[...this.messages,c];this.currentStreamingMessage=null;this.isLoading=false;this.currentQuestionNumber++;this.isTaskCompleted=true;await this.completeInterview();this.interviewComplete.emit({conversation_id:this.conversationId,total_questions:this.totalQuestions});return}const p={response_mode:"streaming",conversation_id:this.conversationId,query:n,bot_id:"3022316191018880"};p.inputs={job_info:this.selectedJobCategory,dimensional_info:this.selectedDimensions.join(","),email:this.toEmail,callback_url:this.callbackUrl,display_content_status:this.displayContentStatus?"1":"0"};if(this.uploadedFileInfo.length>0){const e=this.uploadedFileInfo.map((e=>e.cos_key)).join(",");p.inputs.file_urls=e}await a({url:"/sdk/v1/chat/chat-messages",method:"POST",data:p,onMessage:e=>{if(e.conversation_id&&!this.conversationId){this.conversationId=e.conversation_id;this.conversationStart.emit({conversation_id:e.conversation_id,event:e.event,message_id:e.message_id,id:e.id})}if(e.event==="node_finished"&&e.data.inputs&&e.data.inputs.LLMText){i=e.data.inputs.LLMText}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("异常请重试")){this.currentStreamingMessage.showRetryButton=true;this.aiException=true}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("题号赋值")){this.currentQuestionNumber=e.data.process_data.questions_number-1}if(e.event==="message"){if(e.event==="agent_message"||e.event==="message"){if(e.answer){t+=e.answer;const i={...this.currentStreamingMessage,answer:t,isStreaming:true};this.currentStreamingMessage=i;setTimeout((()=>{this.scrollToBottom()}),200)}}}if(e.event==="message_end"){this.streamComplete.emit({conversation_id:e.conversation_id||"",event:e.event,message_id:e.message_id,id:e.id})}},onError:t=>{console.error("发生错误:",t);this.someErrorEvent.emit({error:t,message:"消息发送失败,请稍后再试"});h.captureError(t,{action:"sendMessageToAPI",component:"pcm-hr-chat-modal",message:e,title:"消息发送失败"});this.messages=[...this.messages,{...c,answer:"抱歉,发生了错误,请稍后再试。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const e=this.currentStreamingMessage;e.isStreaming=false;this.currentStreamingMessage=null;this.messages=[...this.messages,e];if(!this.aiException){if(this.enableAudio&&e&&e.answer){const t=i||e.answer;if(t){const e=await d(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}else if(!this.enableAudio){this.startWaitingToRecord()}}}})}async saveAnswer(e,t,i){try{await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:e,question:t,answer:i}})}catch(t){console.error("保存答案失败:",t);this.someErrorEvent.emit({error:t,message:"保存答案失败,请稍后再试"});h.captureError(t,{action:"saveAnswer",component:"pcm-hr-chat-modal",conversationId:e,title:"保存答案失败"})}}handleScroll=()=>{if(this.isUserScrolling){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!e)return;const{scrollTop:t,scrollHeight:i,clientHeight:s}=e;const o=i-t-s;this.shouldAutoScroll=o<=this.SCROLL_THRESHOLD}};handleTouchStart=()=>{this.isUserScrolling=true};handleTouchEnd=()=>{setTimeout((()=>{this.isUserScrolling=false}),100)};_wheelTimer=null;handleWheel=()=>{this.isUserScrolling=true;if(this._wheelTimer){clearTimeout(this._wheelTimer)}this._wheelTimer=setTimeout((()=>{this.isUserScrolling=false}),150)};scrollToBottom(){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(e&&this.isOpen){e.scrollTop=e.scrollHeight}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;let e=false;try{const t=await l({url:`/sdk/v1/hr_competition/${this.conversationId}`,method:"GET"});if(t.success&&t.data&&t.data.ended==1){e=true}const i=await l({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:"3022316191018880",limit:20}});if(i.success&&i.data){const e=i.data.data||[];const t=e.map((e=>{const t=new Date(e.created_at*1e3);const i=t.getHours().toString().padStart(2,"0");const s=t.getMinutes().toString().padStart(2,"0");const o=`${i}:${s}`;const{inputs:n,...r}=e;return{...r,time:o,isStreaming:false,status:e.status==="error"?"error":"normal"}}));this.messages=t;const s=t.filter((e=>!(e.answer&&(e.answer.includes("请求超时")||e.answer.includes("网络有点拥堵")||e.status==="error"))));this.currentQuestionNumber=s.length>0?s.length:0}}catch(e){console.error("加载历史消息或面试状态失败:",e);this.someErrorEvent.emit({error:e,message:"加载历史消息失败,请刷新重试"});h.captureError(e,{action:"loadHistoryMessages",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"加载历史消息失败"})}finally{this.isLoadingHistory=false;setTimeout((async()=>{this.shouldAutoScroll=true;this.scrollToBottom();if(this.conversationId&&this.messages.length>0&&!e){const e=this.messages[this.messages.length-1];if(e&&e.answer&&this.enableAudio){const t=await d(e.answer);if(this.enableVoice){await this.playAudio(t);this.startWaitingToRecord()}else{this.audioUrl=t}}else if(!this.enableAudio){this.startWaitingToRecord()}else{this.sendMessageToAPI("下一题")}}else if(e){this.currentQuestionNumber++;this.isTaskCompleted=true;setTimeout((()=>{this.interviewComplete.emit()}),100)}}),300)}}async handleIsOpenChange(e){if(e){await c(this.token);if(this.conversationId){this.showInitialUpload=false;await this.loadHistoryMessages()}}}handleJobCategorySelect=e=>{this.selectedJobCategory=e};handleDimensionSelect=e=>{if(this.selectedDimensions.includes(e)){this.selectedDimensions=this.selectedDimensions.filter((t=>t!==e))}else{this.selectedDimensions=[...this.selectedDimensions,e]}};handleInitialSubmit=async()=>{if(this.requireResume&&!this.selectedFile){alert("请上传简历");return}if(!this.selectedJobCategory){alert("请选择职能类别");return}if(this.selectedDimensions.length===0){alert("请至少选择一个关注模块");return}if(this.requireResume){await this.uploadFile();if(this.uploadedFileInfo.length===0){return}}this.showInitialUpload=false;const e=`我是一名${this.selectedJobCategory},请您开始提问`;this.sendMessageToAPI(e)};startWaitingToRecord(){if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=15;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const e=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=e;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(e);const t=this.getSupportedMimeType();let i;try{i=new MediaRecorder(e,{mimeType:t,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){console.warn("指定的MIME类型不受支持,使用默认设置:",t);try{i=new MediaRecorder(e,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){try{i=new MediaRecorder(e)}catch(e){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:e});this.showRecordingUI=false;return}}}this.mediaRecorder=i;const s=[];i.ondataavailable=e=>{if(e.data.size>0){s.push(e.data)}};i.onerror=e=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:e});this.stopRecording()};i.onstop=()=>{try{const e=t||"video/mp4";const i=new Blob(s,{type:e});if(i.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=i;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:i.size,type:i.type}});this.uploadRecordedVideo()}catch(e){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:e});this.showRecordingUI=false;h.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{i.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:i.mimeType}})}catch(e){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:e});this.showRecordingUI=false;h.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"开始录制失败"});return}this.recordingTimer=setInterval((()=>{const e=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-e);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(e){console.error("无法访问摄像头或麦克风:",e);this.showRecordingUI=false;this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:e});h.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"无法访问摄像头或麦克风"})}}setupVideoPreview(e){setTimeout((()=>{const t=this.hostElement.shadowRoot?.querySelector("video");if(t&&e){try{t.srcObject=e;t.play().catch((e=>{console.error("视频播放失败:",e);this.someErrorEvent.emit({error:e,message:"视频播放失败"});h.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"录制视频显示失败"})}))}catch(i){console.warn("设置srcObject失败,尝试替代方法:",i);try{const i=URL.createObjectURL(e);t.src=i;t.onended=()=>{URL.revokeObjectURL(i)}}catch(e){console.error("创建对象URL失败:",e);this.someErrorEvent.emit({error:e,message:"创建对象URL失败"});h.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"创建对象URL失败"})}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const e=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((e=>e.stop()));this.recordingStream=null}this.videoRef=null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const e=this.recordedBlob.type.includes("webm")?"webm":"mp4";const t=`answer.${e}`;const i=new File([this.recordedBlob],t,{type:this.recordedBlob.type});const s=await r(i,{},{tags:["other"]});if(s){await this.saveVideoAnswer(s.cos_key);this.sendMessageToAPI("下一题")}else{throw new Error("视频上传失败")}}catch(e){console.error("视频上传错误:",e);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:e});h.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"视频上传失败"})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(e){if(!this.conversationId)return;try{const t=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!t)return;await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:this.conversationId,question:t.answer,file_url:e}})}catch(e){console.error("保存视频答案失败:",e);this.someErrorEvent.emit({error:e,message:"保存视频答案失败"});h.captureError(e,{action:"saveVideoAnswer",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"保存视频答案失败"})}}async completeInterview(){if(!this.conversationId)return;try{await l({url:`/sdk/v1/hr_competition/${this.conversationId}/end`,method:"POST"})}catch(e){console.error("发送面试完成请求失败:",e);this.someErrorEvent.emit({error:e,message:"发送面试完成请求失败"});h.captureError(e,{action:"completeInterview",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"发送面试完成请求失败"})}}playAudio(e){return new Promise((t=>{this.isPlayingAudio=true;this.audioUrl=e;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=e;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;t()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:"音频播放错误",message:"音频播放错误"});h.captureMessage("音频播放错误",{action:"playAudio",component:"pcm-hr-chat-modal",title:"音频播放错误"});t()};this.audioElement.play().catch((e=>{console.error("音频播放失败:",e);this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:e,message:"音频播放失败"});h.captureError(e,{title:"音频播放失败",action:"playAudio",component:"pcm-hr-chat-modal"});t()}))}))}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.audioElement){this.audioElement.pause();this.audioElement.src="";this.audioElement=null}if(this.audioUrl){URL.revokeObjectURL(this.audioUrl);this.audioUrl=null}if(this.waitingTimer){clearInterval(this.waitingTimer);this.waitingTimer=null}if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}this.stopRecording();if(this.visibilityChangeListener){document.removeEventListener("visibilitychange",this.visibilityChangeListener)}if(this.blurListener){window.removeEventListener("blur",this.blurListener)}if(this.focusListener){window.removeEventListener("focus",this.focusListener)}}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);this.startWaitingToRecord()}};handleRetryRequest=e=>{const t=this.messages.find((t=>t.id===e));if(t){this.aiException=false;const i=this.messages.map((t=>t.id===e?{...t,showRetryButton:false}:t));this.messages=i;this.sendMessageToAPI(t.query)}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const o=()=>s("div",{class:"video-preview"},s("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:e=>{if(e&&this.recordingStream&&!this.videoRef){this.videoRef=e}}}),s("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},s("span",{class:"recording-dot"}),s("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const n=()=>{if(this.isTaskCompleted){return s("div",{class:"placeholder-status"},s("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return s("div",{class:"placeholder-status"},s("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return s("div",{class:"placeholder-status"},s("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return s("div",{class:"placeholder-status"},s("p",null,"请等待题目..."))}if(this.waitingToRecord){return s("div",{class:"placeholder-status"},s("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return s("div",{class:"placeholder-status default-status"},s("p",null,"准备中..."))};return s("div",{class:i,style:e},s("div",{class:t},this.isShowHeader&&s("div",{class:"modal-header"},s("div",{class:"header-left"},this.icon&&s("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),s("div",null,this.modalTitle)),this.isNeedClose&&s("button",{class:"close-button",onClick:this.handleClose},s("span",null,"×"))),this.showInitialUpload?s("div",{class:"initial-upload"},s("div",{class:"upload-section"},this.requireResume&&s(s.Fragment,null,s("h3",null,"开始前,请上传您的简历"),s("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?s("div",{class:"file-item"},s("div",{class:"file-item-content"},s("span",{class:"file-icon"},"📝"),s("span",{class:"file-name"},this.selectedFile.name)),s("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):s("div",{class:"upload-placeholder"},s("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),s("p",{class:"upload-text"},"点击上传简历"),s("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),s("div",{class:"category-select"},s("h3",null,"请选择您的职能类别(单选)"),s("div",{class:"category-options"},this.jobCategories.map((e=>s("button",{class:{"category-button":true,selected:this.selectedJobCategory===e},onClick:()=>this.handleJobCategorySelect(e)},e))))),s("div",{class:"dimension-select"},s("h3",null,"请选择关注的模块(可多选)"),s("div",{class:"dimension-options"},this.dimensions.map((e=>s("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(e)},onClick:()=>this.handleDimensionSelect(e)},e))))),s("button",{class:"submit-button",disabled:this.requireResume&&!this.selectedFile||!this.selectedJobCategory||this.selectedDimensions.length===0||this.requireResume&&this.isUploading,onClick:this.handleInitialSubmit},this.requireResume&&this.isUploading?"上传中...":"开始面试")),this.requireResume&&s("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):s("div",{style:{height:"100%"}},s("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?s("div",{class:"loading-container"},s("div",{class:"loading-spinner"}),s("p",null,"加载历史消息中...")):s("div",null,this.messages.map((e=>s("div",{id:`message_${e.id}`,key:e.id},s("pcm-chat-message",{message:e,onRetryRequest:e=>this.handleRetryRequest(e.detail),showCopyButton:false,showFeedbackButtons:false})))),this.currentStreamingMessage&&s("div",{id:`message_${this.currentStreamingMessage.id}`},s("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&s("div",{class:"empty-state"},s("p",null,"请上传简历开始面试")))),s("div",{class:"recording-section"},s("div",{class:"recording-container"},s("div",{class:"video-area"},this.showRecordingUI?o():s("div",{class:"video-preview placeholder"},n())),s("div",{class:"progress-container"},s("div",{class:"progress-bar-container"},s("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),s("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions)),s("div",{class:"recording-controls"},this.showRecordingUI?s("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):s("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return s("div",{class:"play-audio-container",onClick:this.handlePlayAudio},s("p",null,s("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},s("path",{d:"M8 5v14l11-7z"})),s("span",{style:{verticalAlign:"middle"}},"播放题目")))}return s("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};g.style=p+u;export{g as pcm_hr_chat_modal};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,g as i,h as s}from"./p-Bq0K-WqZ.js";import{a as o,c as n,u as r,s as a,b as l,d,v as c}from"./p-WTSeW6oH.js";import{S as h}from"./p-CBQPOkZb.js";import"./p-Bs-zO1WZ.js";const p=":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:800px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.placeholder-status p{font-size:16px}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-left div{font-size:16px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;min-height:200px;background:url(https://pcm-resource-1312611446.cos.ap-guangzhou.myqcloud.com/web/sdk/chat_bg.png);background-size:100%}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#999;cursor:pointer;padding:4px 8px;font-size:16px;line-height:1;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f0f0f0;color:#666}.initial-upload{padding:16px;display:flex;flex-direction:column;align-items:center;height:100%}.upload-section{max-width:600px;width:100%;text-align:center}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px}.submit-button:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.category-select,.dimension-select{margin:30px 0}.category-options,.dimension-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.category-button,.dimension-button{padding:12px 16px;border:1px solid #E5E5E5;border-radius:6px;background:white;cursor:pointer;transition:all 0.3s}.category-button:hover,.dimension-button:hover{background:#f5f5f5}.category-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.dimension-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;top:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:14px;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:16px;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:16px}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}.progress-container{display:flex;justify-content:space-between;align-items:center;width:100%;max-width:400px;margin-top:10px;padding:0 5px}.progress-bar-container{height:4px;background-color:#E5E5E5;border-radius:2px;overflow:hidden;margin-right:10px;width:75px}.progress-bar{height:100%;background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);border-radius:2px;transition:width 0.3s ease}.progress-text{font-size:14px;color:#666;white-space:nowrap}";const u=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const g=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.someErrorEvent=t(this,"someErrorEvent");this.interviewComplete=t(this,"interviewComplete");this.recordingError=t(this,"recordingError");this.recordingStatusChange=t(this,"recordingStatusChange");this.tokenInvalid=t(this,"tokenInvalid")}modalTitle="金牌HR大赛";token;isOpen=false;messages=[];modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;currentAssistantMessage="";isLoading=false;currentStreamingMessage=null;shouldAutoScroll=true;isLoadingHistory=false;get hostElement(){return i(this)}streamComplete;conversationStart;someErrorEvent;selectedFile=null;isUploading=false;uploadedFileInfo=[];aiException=false;defaultQuery="请开始出题";showInitialUpload=true;selectedJobCategory="";jobCategories=["人力资源学生(实习)","人力资源专员","人力资源主管","人力资源经理","人力资源总监"];dimensions=["人力资源规划","招聘与配置","员工关系","培训与开发","薪酬与绩效","组织与人才发展"];selectedDimensions=[];isRecording=false;recordingStream=null;recordedBlob=null;mediaRecorder=null;recordingTimeLeft=0;showRecordingUI=false;recordingTimer=null;recordingStartTime=0;waitingToRecord=false;waitingTimer=null;waitingTimeLeft=15;videoRef=null;totalQuestions=2;currentQuestionNumber=0;interviewComplete;SCROLL_THRESHOLD=20;maxRecordingTime=120;countdownWarningTime=30;showCountdownWarning=false;toEmail="";callbackUrl="";fullscreen=false;isUploadingVideo=false;requireResume=false;isPlayingAudio=false;audioUrl=null;audioElement=null;recordingError;recordingStatusChange;tokenInvalid;enableVoice=true;enableAudio=true;displayContentStatus=true;isTaskCompleted=false;tokenInvalidListener;isUserScrolling=false;isPageFocused=true;isWindowVisible=true;visibilityChangeListener;blurListener;focusListener;handleTokenChange(e){if(e&&e!==o.getToken()){o.setToken(e)}}componentWillLoad(){if(this.zIndex){n.setItem("modal-zIndex",this.zIndex)}if(this.token){o.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};document.addEventListener("pcm-token-invalid",this.tokenInvalidListener);this.visibilityChangeListener=()=>{const e=!document.hidden;this.isWindowVisible=e;if(!e){h.captureMessage("用户失去焦点 - 页面隐藏",{action:"visibilityChange",component:"pcm-hr-chat-modal",type:"visibility_hidden",timestamp:Date.now(),isRecording:this.isRecording,currentQuestionNumber:this.currentQuestionNumber,conversationId:this.conversationId})}};this.blurListener=()=>{this.isPageFocused=false;h.captureMessage("用户失去焦点 - 窗口失焦",{action:"windowBlur",component:"pcm-hr-chat-modal",type:"window_blur",timestamp:Date.now(),isRecording:this.isRecording,currentQuestionNumber:this.currentQuestionNumber,conversationId:this.conversationId})};this.focusListener=()=>{this.isPageFocused=true};document.addEventListener("visibilitychange",this.visibilityChangeListener);window.addEventListener("blur",this.blurListener);window.addEventListener("focus",this.focusListener)}handleClose=()=>{this.stopRecording();this.modalClosed.emit()};handleFileChange=async e=>{const t=e.target;if(t.files&&t.files.length>0){this.selectedFile=t.files[0]}};async uploadFile(){if(!this.selectedFile||this.uploadedFileInfo.length>0)return;this.isUploading=true;try{const e=await r(this.selectedFile,{},{tags:["resume"]});if(e){this.uploadedFileInfo=[{cos_key:e.cos_key,file_name:e.file_name,file_size:e.file_size,ext:e.ext}]}}catch(e){console.error("文件上传错误:",e);this.clearSelectedFile();this.someErrorEvent.emit({error:e,message:"文件上传失败,请重试"});h.captureError(e,{action:"uploadFile",component:"pcm-hr-chat-modal",title:"文件上传失败"})}finally{this.isUploading=false}}handleUploadClick=()=>{const e=this.hostElement.shadowRoot?.querySelector(".file-input");e?.click()};clearSelectedFile=()=>{this.selectedFile=null;this.uploadedFileInfo=[];const e=this.hostElement.shadowRoot?.querySelector(".file-input");if(e){e.value=""}};async sendMessageToAPI(e){this.isLoading=true;let t="";let i="";const s=new Date;const o=`${s.getHours()}:${s.getMinutes().toString().padStart(2,"0")}`;const n=e.trim()||(this.uploadedFileInfo.length>0?"请分析这个文件":"");const r=this.messages.length>0?this.messages[this.messages.length-1]:null;if(r&&this.conversationId&&e!=="下一题"){this.saveAnswer(this.conversationId,r.answer,n)}const l=this.currentQuestionNumber>=this.totalQuestions&&e==="下一题";const c={id:`temp-${Date.now()}`,time:o,query:n,answer:"",isStreaming:true,conversation_id:this.conversationId,inputs:{},status:"normal",error:null};this.currentStreamingMessage=c;setTimeout((()=>{this.shouldAutoScroll=true;this.scrollToBottom()}),200);if(l){this.messages=[...this.messages,c];this.currentStreamingMessage=null;this.isLoading=false;this.currentQuestionNumber++;this.isTaskCompleted=true;await this.completeInterview();this.interviewComplete.emit({conversation_id:this.conversationId,total_questions:this.totalQuestions});return}const p={response_mode:"streaming",conversation_id:this.conversationId,query:n,bot_id:"3022316191018880"};p.inputs={job_info:this.selectedJobCategory,dimensional_info:this.selectedDimensions.join(","),email:this.toEmail,callback_url:this.callbackUrl,display_content_status:this.displayContentStatus?"1":"0"};if(this.uploadedFileInfo.length>0){const e=this.uploadedFileInfo.map((e=>e.cos_key)).join(",");p.inputs.file_urls=e}await a({url:"/sdk/v1/chat/chat-messages",method:"POST",data:p,onMessage:e=>{if(e.conversation_id&&!this.conversationId){this.conversationId=e.conversation_id;this.conversationStart.emit({conversation_id:e.conversation_id,event:e.event,message_id:e.message_id,id:e.id})}if(e.event==="node_finished"&&e.data.inputs&&e.data.inputs.LLMText){i=e.data.inputs.LLMText}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("异常请重试")){this.currentStreamingMessage.showRetryButton=true;this.aiException=true}if(e.event==="node_finished"&&e.data.title&&e.data.title.includes("题号赋值")){this.currentQuestionNumber=e.data.process_data.questions_number-1}if(e.event==="message"){if(e.event==="agent_message"||e.event==="message"){if(e.answer){t+=e.answer;const i={...this.currentStreamingMessage,answer:t,isStreaming:true};this.currentStreamingMessage=i;setTimeout((()=>{this.scrollToBottom()}),200)}}}if(e.event==="message_end"){this.streamComplete.emit({conversation_id:e.conversation_id||"",event:e.event,message_id:e.message_id,id:e.id})}},onError:t=>{console.error("发生错误:",t);this.someErrorEvent.emit({error:t,message:"消息发送失败,请稍后再试"});h.captureError(t,{action:"sendMessageToAPI",component:"pcm-hr-chat-modal",message:e,title:"消息发送失败"});this.messages=[...this.messages,{...c,answer:"抱歉,发生了错误,请稍后再试。",error:t,isStreaming:false}];this.currentStreamingMessage=null;this.isLoading=false},onComplete:async()=>{this.isLoading=false;const e=this.currentStreamingMessage;e.isStreaming=false;this.currentStreamingMessage=null;this.messages=[...this.messages,e];if(!this.aiException){if(this.enableAudio&&e&&e.answer){const t=i||e.answer;if(t){const e=await d(t);if(this.enableVoice){await this.playAudio(e);this.startWaitingToRecord()}else{this.audioUrl=e}}}else if(!this.enableAudio){this.startWaitingToRecord()}}}})}async saveAnswer(e,t,i){try{await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:e,question:t,answer:i}})}catch(t){console.error("保存答案失败:",t);this.someErrorEvent.emit({error:t,message:"保存答案失败,请稍后再试"});h.captureError(t,{action:"saveAnswer",component:"pcm-hr-chat-modal",conversationId:e,title:"保存答案失败"})}}handleScroll=()=>{if(this.isUserScrolling){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(!e)return;const{scrollTop:t,scrollHeight:i,clientHeight:s}=e;const o=i-t-s;this.shouldAutoScroll=o<=this.SCROLL_THRESHOLD}};handleTouchStart=()=>{this.isUserScrolling=true};handleTouchEnd=()=>{setTimeout((()=>{this.isUserScrolling=false}),100)};_wheelTimer=null;handleWheel=()=>{this.isUserScrolling=true;if(this._wheelTimer){clearTimeout(this._wheelTimer)}this._wheelTimer=setTimeout((()=>{this.isUserScrolling=false}),150)};scrollToBottom(){const e=this.hostElement.shadowRoot?.querySelector(".chat-history");if(e&&this.isOpen){e.scrollTop=e.scrollHeight}}async loadHistoryMessages(){if(!this.conversationId)return;this.isLoadingHistory=true;let e=false;try{const t=await l({url:`/sdk/v1/hr_competition/${this.conversationId}`,method:"GET"});if(t.success&&t.data&&t.data.ended==1){e=true}const i=await l({url:"/sdk/v1/chat/messages",method:"GET",data:{conversation_id:this.conversationId,bot_id:"3022316191018880",limit:20}});if(i.success&&i.data){const e=i.data.data||[];const t=e.map((e=>{const t=new Date(e.created_at*1e3);const i=t.getHours().toString().padStart(2,"0");const s=t.getMinutes().toString().padStart(2,"0");const o=`${i}:${s}`;const{inputs:n,...r}=e;return{...r,time:o,isStreaming:false,status:e.status==="error"?"error":"normal"}}));this.messages=t;const s=t.filter((e=>!(e.answer&&(e.answer.includes("请求超时")||e.answer.includes("网络有点拥堵")||e.status==="error"))));this.currentQuestionNumber=s.length>0?s.length:0}}catch(e){console.error("加载历史消息或面试状态失败:",e);this.someErrorEvent.emit({error:e,message:"加载历史消息失败,请刷新重试"});h.captureError(e,{action:"loadHistoryMessages",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"加载历史消息失败"})}finally{this.isLoadingHistory=false;setTimeout((async()=>{this.shouldAutoScroll=true;this.scrollToBottom();if(this.conversationId&&this.messages.length>0&&!e){const e=this.messages[this.messages.length-1];if(e&&e.answer&&this.enableAudio){const t=await d(e.answer);if(this.enableVoice){await this.playAudio(t);this.startWaitingToRecord()}else{this.audioUrl=t}}else if(!this.enableAudio){this.startWaitingToRecord()}else{this.sendMessageToAPI("下一题")}}else if(e){this.currentQuestionNumber++;this.isTaskCompleted=true;setTimeout((()=>{this.interviewComplete.emit()}),100)}}),300)}}async handleIsOpenChange(e){if(e){await c(this.token);if(this.conversationId){this.showInitialUpload=false;await this.loadHistoryMessages()}}}handleJobCategorySelect=e=>{this.selectedJobCategory=e};handleDimensionSelect=e=>{if(this.selectedDimensions.includes(e)){this.selectedDimensions=this.selectedDimensions.filter((t=>t!==e))}else{this.selectedDimensions=[...this.selectedDimensions,e]}};handleInitialSubmit=async()=>{if(this.requireResume&&!this.selectedFile){alert("请上传简历");return}if(!this.selectedJobCategory){alert("请选择职能类别");return}if(this.selectedDimensions.length===0){alert("请至少选择一个关注模块");return}if(this.requireResume){await this.uploadFile();if(this.uploadedFileInfo.length===0){return}}this.showInitialUpload=false;const e=`我是一名${this.selectedJobCategory},请您开始提问`;this.sendMessageToAPI(e)};startWaitingToRecord(){if(this.waitingTimer){clearInterval(this.waitingTimer)}if(this.recordingTimer){clearInterval(this.recordingTimer)}this.waitingToRecord=true;this.waitingTimeLeft=15;this.waitingTimer=setInterval((()=>{this.waitingTimeLeft--;if(this.waitingTimeLeft<=0){clearInterval(this.waitingTimer);this.waitingTimer=null;this.waitingToRecord=false;this.startRecording()}}),1e3)}async startRecording(){try{const e=await navigator.mediaDevices.getUserMedia({audio:true,video:{width:{ideal:1280},height:{ideal:720},frameRate:{ideal:30}}});this.recordingStream=e;this.showRecordingUI=true;this.showCountdownWarning=false;this.videoRef=null;this.setupVideoPreview(e);const t=this.getSupportedMimeType();let i;try{i=new MediaRecorder(e,{mimeType:t,videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){console.warn("指定的MIME类型不受支持,使用默认设置:",t);try{i=new MediaRecorder(e,{videoBitsPerSecond:8e5,audioBitsPerSecond:64e3})}catch(t){try{i=new MediaRecorder(e)}catch(e){this.recordingError.emit({type:"recorder_creation_failed",message:"无法创建媒体录制器,您的浏览器可能不支持此功能",details:e});this.showRecordingUI=false;return}}}this.mediaRecorder=i;const s=[];i.ondataavailable=e=>{if(e.data.size>0){s.push(e.data)}};i.onerror=e=>{this.recordingError.emit({type:"recording_error",message:"录制过程中发生错误",details:e});this.stopRecording()};i.onstop=()=>{try{const e=t||"video/mp4";const i=new Blob(s,{type:e});if(i.size===0){this.recordingError.emit({type:"empty_recording",message:"录制的视频为空"});this.showRecordingUI=false;return}this.recordedBlob=i;this.recordingStatusChange.emit({status:"stopped",details:{duration:Math.floor((Date.now()-this.recordingStartTime)/1e3),size:i.size,type:i.type}});this.uploadRecordedVideo()}catch(e){this.recordingError.emit({type:"processing_error",message:"处理录制视频时出错",details:e});this.showRecordingUI=false;h.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"处理录制视频时出错"})}};try{i.start();this.isRecording=true;this.recordingStartTime=Date.now();this.recordingTimeLeft=this.maxRecordingTime;this.recordingStatusChange.emit({status:"started",details:{maxDuration:this.maxRecordingTime,mimeType:i.mimeType}})}catch(e){this.recordingError.emit({type:"start_failed",message:"开始录制失败,请检查您的设备权限",details:e});this.showRecordingUI=false;h.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"开始录制失败"});return}this.recordingTimer=setInterval((()=>{const e=Math.floor((Date.now()-this.recordingStartTime)/1e3);this.recordingTimeLeft=Math.max(0,this.maxRecordingTime-e);if(this.recordingTimeLeft<=this.countdownWarningTime&&!this.showCountdownWarning){this.showCountdownWarning=true}if(this.recordingTimeLeft<=0){this.stopRecording()}}),1e3)}catch(e){console.error("无法访问摄像头或麦克风:",e);this.showRecordingUI=false;this.recordingError.emit({type:"media_access_failed",message:"无法访问摄像头或麦克风,请确保已授予权限",details:e});h.captureError(e,{action:"startRecording",component:"pcm-hr-chat-modal",title:"无法访问摄像头或麦克风"})}}setupVideoPreview(e){setTimeout((()=>{const t=this.hostElement.shadowRoot?.querySelector("video");if(t&&e){try{t.srcObject=e;t.play().catch((e=>{console.error("视频播放失败:",e);this.someErrorEvent.emit({error:e,message:"视频播放失败"});h.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"录制视频显示失败"})}))}catch(i){console.warn("设置srcObject失败,尝试替代方法:",i);try{const i=URL.createObjectURL(e);t.src=i;t.onended=()=>{URL.revokeObjectURL(i)}}catch(e){console.error("创建对象URL失败:",e);this.someErrorEvent.emit({error:e,message:"创建对象URL失败"});h.captureError(e,{action:"setupVideoPreview",component:"pcm-hr-chat-modal",title:"创建对象URL失败"})}}}else{console.warn("未找到视频元素或媒体流无效")}}),100)}getSupportedMimeType(){const e=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""}stopRecording(){if(this.mediaRecorder&&this.isRecording){this.mediaRecorder.stop();this.isRecording=false;if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}if(this.recordingStream){this.recordingStream.getTracks().forEach((e=>e.stop()));this.recordingStream=null}this.videoRef=null}}async uploadRecordedVideo(){if(!this.recordedBlob)return;try{this.isUploadingVideo=true;this.showRecordingUI=false;const e=this.recordedBlob.type.includes("webm")?"webm":"mp4";const t=`answer.${e}`;const i=new File([this.recordedBlob],t,{type:this.recordedBlob.type});const s=await r(i,{},{tags:["other"]});if(s){await this.saveVideoAnswer(s.cos_key);this.sendMessageToAPI("下一题")}else{throw new Error("视频上传失败")}}catch(e){console.error("视频上传错误:",e);this.recordingError.emit({type:"upload_failed",message:"视频上传失败",details:e});h.captureError(e,{action:"uploadRecordedVideo",component:"pcm-hr-chat-modal",title:"视频上传失败"})}finally{this.isUploadingVideo=false;this.showRecordingUI=false;this.recordedBlob=null}}async saveVideoAnswer(e){if(!this.conversationId)return;try{const t=this.messages.length>0?this.messages[this.messages.length-1]:null;if(!t)return;await l({url:"/sdk/v1/hr_competition/answer",method:"POST",data:{conversation_id:this.conversationId,question:t.answer,file_url:e}})}catch(e){console.error("保存视频答案失败:",e);this.someErrorEvent.emit({error:e,message:"保存视频答案失败"});h.captureError(e,{action:"saveVideoAnswer",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"保存视频答案失败"})}}async completeInterview(){if(!this.conversationId)return;try{await l({url:`/sdk/v1/hr_competition/${this.conversationId}/end`,method:"POST"})}catch(e){console.error("发送面试完成请求失败:",e);this.someErrorEvent.emit({error:e,message:"发送面试完成请求失败"});h.captureError(e,{action:"completeInterview",component:"pcm-hr-chat-modal",conversationId:this.conversationId,title:"发送面试完成请求失败"})}}playAudio(e){return new Promise((t=>{this.isPlayingAudio=true;this.audioUrl=e;if(!this.audioElement){this.audioElement=new Audio}this.audioElement.src=e;this.audioElement.onended=()=>{this.isPlayingAudio=false;this.audioUrl=null;t()};this.audioElement.onerror=()=>{console.error("音频播放错误");this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:"音频播放错误",message:"音频播放错误"});h.captureMessage("音频播放错误",{action:"playAudio",component:"pcm-hr-chat-modal",title:"音频播放错误"});t()};this.audioElement.play().catch((e=>{console.error("音频播放失败:",e);this.isPlayingAudio=false;this.audioUrl=null;this.someErrorEvent.emit({error:e,message:"音频播放失败"});h.captureError(e,{title:"音频播放失败",action:"playAudio",component:"pcm-hr-chat-modal"});t()}))}))}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.audioElement){this.audioElement.pause();this.audioElement.src="";this.audioElement=null}if(this.audioUrl){URL.revokeObjectURL(this.audioUrl);this.audioUrl=null}if(this.waitingTimer){clearInterval(this.waitingTimer);this.waitingTimer=null}if(this.recordingTimer){clearInterval(this.recordingTimer);this.recordingTimer=null}this.stopRecording();if(this.visibilityChangeListener){document.removeEventListener("visibilitychange",this.visibilityChangeListener)}if(this.blurListener){window.removeEventListener("blur",this.blurListener)}if(this.focusListener){window.removeEventListener("focus",this.focusListener)}}handlePlayAudio=async()=>{if(this.audioUrl){await this.playAudio(this.audioUrl);this.startWaitingToRecord()}};handleRetryRequest=e=>{const t=this.messages.find((t=>t.id===e));if(t){this.aiException=false;const i=this.messages.map((t=>t.id===e?{...t,showRetryButton:false}:t));this.messages=i;this.sendMessageToAPI(t.query)}};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const o=()=>s("div",{class:"video-preview"},s("video",{autoPlay:true,playsInline:true,muted:true,style:{transform:"scaleX(-1)"},ref:e=>{if(e&&this.recordingStream&&!this.videoRef){this.videoRef=e}}}),s("div",{class:{"recording-status":true,warning:this.showCountdownWarning}},s("span",{class:"recording-dot"}),s("span",null,"录制中 ",Math.floor(this.recordingTimeLeft/60),":",(this.recordingTimeLeft%60).toString().padStart(2,"0"),this.showCountdownWarning&&` (即将自动完成)`)));const n=()=>{if(this.isTaskCompleted){return s("div",{class:"placeholder-status"},s("p",null,"面试已完成,感谢您的参与!"))}if(this.isPlayingAudio){return s("div",{class:"placeholder-status"},s("p",null,"正在播放问题,请听完后准备回答..."))}if(this.isUploadingVideo){return s("div",{class:"placeholder-status"},s("p",null,"正在上传视频,请稍候..."))}if(this.isLoading||this.currentStreamingMessage){return s("div",{class:"placeholder-status"},s("p",null,"请等待题目..."))}if(this.waitingToRecord){return s("div",{class:"placeholder-status"},s("p",null,"请准备好,",this.waitingTimeLeft,"秒后将开始录制您的回答..."))}return s("div",{class:"placeholder-status default-status"},s("p",null,"准备中..."))};return s("div",{class:i,style:e},s("div",{class:t},this.isShowHeader&&s("div",{class:"modal-header"},s("div",{class:"header-left"},this.icon&&s("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),s("div",null,this.modalTitle)),this.isNeedClose&&s("button",{class:"close-button",onClick:this.handleClose},s("span",null,"×"))),this.showInitialUpload?s("div",{class:"initial-upload"},s("div",{class:"upload-section"},this.requireResume&&s(s.Fragment,null,s("h3",null,"开始前,请上传您的简历"),s("div",{class:"upload-area",onClick:this.handleUploadClick},this.selectedFile?s("div",{class:"file-item"},s("div",{class:"file-item-content"},s("span",{class:"file-icon"},"📝"),s("span",{class:"file-name"},this.selectedFile.name)),s("button",{class:"remove-file",onClick:e=>{e.stopPropagation();this.clearSelectedFile()}},"×")):s("div",{class:"upload-placeholder"},s("img",{src:"https://pub.pincaimao.com/static/web/images/home/i_upload.png"}),s("p",{class:"upload-text"},"点击上传简历"),s("p",{class:"upload-hint"},"支持 txt、 markdown、 pdf、 docx、 md 格式")))),s("div",{class:"category-select"},s("h3",null,"请选择您的职能类别(单选)"),s("div",{class:"category-options"},this.jobCategories.map((e=>s("button",{class:{"category-button":true,selected:this.selectedJobCategory===e},onClick:()=>this.handleJobCategorySelect(e)},e))))),s("div",{class:"dimension-select"},s("h3",null,"请选择关注的模块(可多选)"),s("div",{class:"dimension-options"},this.dimensions.map((e=>s("button",{class:{"dimension-button":true,selected:this.selectedDimensions.includes(e)},onClick:()=>this.handleDimensionSelect(e)},e))))),s("button",{class:"submit-button",disabled:this.requireResume&&!this.selectedFile||!this.selectedJobCategory||this.selectedDimensions.length===0||this.requireResume&&this.isUploading,onClick:this.handleInitialSubmit},this.requireResume&&this.isUploading?"上传中...":"开始面试")),this.requireResume&&s("input",{type:"file",class:"file-input",onChange:this.handleFileChange,accept:".pdf,.doc,.docx,.txt"})):s("div",{style:{height:"100%"}},s("div",{class:"chat-history",onScroll:this.handleScroll,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onWheel:this.handleWheel},this.isLoadingHistory?s("div",{class:"loading-container"},s("div",{class:"loading-spinner"}),s("p",null,"加载历史消息中...")):s("div",null,this.messages.map((e=>s("div",{id:`message_${e.id}`,key:e.id},s("pcm-chat-message",{message:e,onRetryRequest:e=>this.handleRetryRequest(e.detail),showCopyButton:false,showFeedbackButtons:false})))),this.currentStreamingMessage&&s("div",{id:`message_${this.currentStreamingMessage.id}`},s("pcm-chat-message",{message:this.currentStreamingMessage})),this.messages.length===0&&!this.currentStreamingMessage&&s("div",{class:"empty-state"},s("p",null,"请上传简历开始面试")))),s("div",{class:"recording-section"},s("div",{class:"recording-container"},s("div",{class:"video-area"},this.showRecordingUI?o():s("div",{class:"video-preview placeholder"},n())),s("div",{class:"progress-container"},s("div",{class:"progress-bar-container"},s("div",{class:"progress-bar",style:{width:`${Math.max(0,this.currentQuestionNumber-1)/this.totalQuestions*100}%`}})),s("div",{class:"progress-text"},"已完成",Math.max(0,this.currentQuestionNumber-1),"/",this.totalQuestions)),s("div",{class:"recording-controls"},this.showRecordingUI?s("button",{class:"stop-recording-button",onClick:()=>this.stopRecording()},"完成本题回答"):s("div",{class:"waiting-message"},(()=>{if(!this.enableVoice&&this.audioUrl&&!this.isPlayingAudio){return s("div",{class:"play-audio-container",onClick:this.handlePlayAudio},s("p",null,s("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",style:{verticalAlign:"middle",marginRight:"8px"}},s("path",{d:"M8 5v14l11-7z"})),s("span",{style:{verticalAlign:"middle"}},"播放题目")))}return s("button",{class:"stop-recording-button disabled",disabled:true},"完成回答")})())))))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};g.style=p+u;export{g as pcm_hr_chat_modal};
|
|
2
|
+
//# sourceMappingURL=p-079c81fd.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as n,v as r,c as a,e as s,f as l}from"./p-DU3DLNhC.js";import{E as d}from"./p-C0FYX2-Z.js";import{M as p}from"./p-DXVhHj6-.js";const c=".input-mode-toggle{display:flex;align-items:center;margin-bottom:16px}.input-mode-toggle span{color:#333;margin-right:12px}.toggle-button{display:flex;align-items:center;background:none;border:none;color:#2E6EDF;cursor:pointer;font-size:14px;padding:4px 8px}.toggle-button svg{margin-right:4px}.free-input{width:100%}.textarea-container{margin-bottom:16px}.textarea-container label{display:block;margin-bottom:8px;font-weight:500;color:#333}.textarea-container textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;resize:vertical;background-color:#f9f9f9;min-height:150px;width:100%;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.textarea-container textarea:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.required{color:#f56c6c}.input-guide{background-color:#f5f7fa;border-radius:4px;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.guide-title{font-weight:500;color:#333;margin-bottom:8px}.guide-content{color:#666;font-size:13px;max-width:100%;word-wrap:break-word}.guide-content div{margin-bottom:4px}.phone-input{width:calc(100% - 16px);padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.phone-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.verification-code-container{display:flex;gap:8px;align-items:center}.verification-code-input{flex:1;padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.verification-code-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.send-code-button{padding:8px 16px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:14px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;min-width:100px}.send-code-button:hover:not(:disabled){background-color:#40a9ff}.send-code-button:disabled{background-color:rgba(0, 0, 0, 0.04);color:rgba(0, 0, 0, 0.25);cursor:not-allowed}";const h='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}';const u=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const x=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="劳动合同卫士";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始分析";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="drawer";isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return i(this)}isSubmitting=false;phoneNumber="";verificationCode="";isSendingCode=false;countdown=0;isVerifyingCode=false;tokenInvalidListener;removeErrorListener;pcmUploadRef;countdownTimer=null;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.isSubmitting=false;this.uploadedFileInfo=null;this.phoneNumber="";this.verificationCode="";this.isSendingCode=false;this.isVerifyingCode=false;this.countdown=0;if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}else{await r(this.token);if(this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){a.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=d.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}handleClose=()=>{this.modalClosed.emit()};handlePhoneNumberChange=e=>{const t=e.target;this.phoneNumber=t.value};handleVerificationCodeChange=e=>{const t=e.target;this.verificationCode=t.value};startCountdown=()=>{this.countdown=60;if(this.countdownTimer){clearInterval(this.countdownTimer)}this.countdownTimer=setInterval((()=>{this.countdown--;if(this.countdown<=0){if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}}),1e3)};handleSendCode=async()=>{if(!this.phoneNumber.trim()){p.error("请输入手机号");return}const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){p.error("请输入正确的手机号");return}this.isSendingCode=true;try{const e=await s(this.phoneNumber.trim(),0);if(e.success){p.success("验证码已发送");this.startCountdown()}else{p.error(e.message||"发送验证码失败")}}catch(e){p.error("发送验证码失败")}finally{this.isSendingCode=false}};handleStartInterview=async()=>{if(!this.customInputs?.file_url&&!this.uploadedFileInfo){p.info("请上传合同文件");return}if(this.phoneNumber.trim()){const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){p.error("请输入正确的手机号");return}if(!this.verificationCode.trim()){p.error("请输入验证码");return}this.isVerifyingCode=true;try{const e=await l(this.phoneNumber.trim(),this.verificationCode.trim(),0);if(!e.success){p.error(e.message||"验证码错误");this.isVerifyingCode=false;return}}catch(e){p.error("验证码校验失败");this.isVerifyingCode=false;return}this.isVerifyingCode=false}if(await(this.pcmUploadRef?.getIsUploading?.())){p.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return o("div",{class:i,style:e},o("div",{class:t},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle)),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),!this.showChatModal&&!this.conversationId&&o("div",{class:"input-container"},o("div",{class:"resume-upload-section"},o("label",null,"上传合同"),o("pcm-upload",{ref:e=>this.pcmUploadRef=e,maxFileSize:25*1024*1024,multiple:false,mobileUploadAble:true,uploadText:"点击上传合同",acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["other"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设文件",file_size:0,ext:""}]:undefined,disabled:!!this.customInputs?.file_url,onUploadChange:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),o("div",{class:"jd-input-section"},o("label",null,"手机号(选填,填写后结果将通过短信发送)"),o("input",{type:"tel",class:"phone-input",placeholder:"请输入手机号",maxLength:11,value:this.phoneNumber,onInput:this.handlePhoneNumberChange})),this.phoneNumber.trim().length===11&&o("div",{class:"jd-input-section"},o("label",null,"验证码"),o("div",{class:"verification-code-container"},o("input",{type:"text",class:"verification-code-input",placeholder:"请输入验证码",maxLength:6,value:this.verificationCode,onInput:this.handleVerificationCodeChange}),o("button",{class:"send-code-button",disabled:this.isSendingCode||this.countdown>0||!this.phoneNumber.trim(),onClick:this.handleSendCode},this.isSendingCode?"发送中...":this.countdown>0?`${this.countdown}秒`:"发送验证码"))),o("button",{class:"submit-button",disabled:!this.customInputs?.file_url&&!this.uploadedFileInfo||this.isUploading||this.isSubmitting||this.isVerifyingCode,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isVerifyingCode?"验证中...":this.isSubmitting?"处理中...":"开始分析"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018882",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,phone:this.phoneNumber.trim()||undefined},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};x.style=c+(h+u);export{x as oem_htws_modal};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as n,v as r,c as a,e as s,f as l}from"./p-WTSeW6oH.js";import{E as d}from"./p-C0FYX2-Z.js";import{M as p}from"./p-DXVhHj6-.js";const c=".input-mode-toggle{display:flex;align-items:center;margin-bottom:16px}.input-mode-toggle span{color:#333;margin-right:12px}.toggle-button{display:flex;align-items:center;background:none;border:none;color:#2E6EDF;cursor:pointer;font-size:14px;padding:4px 8px}.toggle-button svg{margin-right:4px}.free-input{width:100%}.textarea-container{margin-bottom:16px}.textarea-container label{display:block;margin-bottom:8px;font-weight:500;color:#333}.textarea-container textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;resize:vertical;background-color:#f9f9f9;min-height:150px;width:100%;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.textarea-container textarea:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.required{color:#f56c6c}.input-guide{background-color:#f5f7fa;border-radius:4px;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.guide-title{font-weight:500;color:#333;margin-bottom:8px}.guide-content{color:#666;font-size:13px;max-width:100%;word-wrap:break-word}.guide-content div{margin-bottom:4px}.phone-input{width:calc(100% - 16px);padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.phone-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.verification-code-container{display:flex;gap:8px;align-items:center}.verification-code-input{flex:1;padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.verification-code-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.send-code-button{padding:8px 16px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:14px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;min-width:100px}.send-code-button:hover:not(:disabled){background-color:#40a9ff}.send-code-button:disabled{background-color:rgba(0, 0, 0, 0.04);color:rgba(0, 0, 0, 0.25);cursor:not-allowed}";const h='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}';const u=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const x=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="劳动合同卫士";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始分析";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="drawer";isUploading=false;uploadedFileInfo=null;showChatModal=false;get hostElement(){return i(this)}isSubmitting=false;phoneNumber="";verificationCode="";isSendingCode=false;countdown=0;isVerifyingCode=false;tokenInvalidListener;removeErrorListener;pcmUploadRef;countdownTimer=null;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.isSubmitting=false;this.uploadedFileInfo=null;this.phoneNumber="";this.verificationCode="";this.isSendingCode=false;this.isVerifyingCode=false;this.countdown=0;if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}else{await r(this.token);if(this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){a.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=d.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}handleClose=()=>{this.modalClosed.emit()};handlePhoneNumberChange=e=>{const t=e.target;this.phoneNumber=t.value};handleVerificationCodeChange=e=>{const t=e.target;this.verificationCode=t.value};startCountdown=()=>{this.countdown=60;if(this.countdownTimer){clearInterval(this.countdownTimer)}this.countdownTimer=setInterval((()=>{this.countdown--;if(this.countdown<=0){if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}}),1e3)};handleSendCode=async()=>{if(!this.phoneNumber.trim()){p.error("请输入手机号");return}const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){p.error("请输入正确的手机号");return}this.isSendingCode=true;try{const e=await s(this.phoneNumber.trim(),0);if(e.success){p.success("验证码已发送");this.startCountdown()}else{p.error(e.message||"发送验证码失败")}}catch(e){p.error("发送验证码失败")}finally{this.isSendingCode=false}};handleStartInterview=async()=>{if(!this.customInputs?.file_url&&!this.uploadedFileInfo){p.info("请上传合同文件");return}if(this.phoneNumber.trim()){const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){p.error("请输入正确的手机号");return}if(!this.verificationCode.trim()){p.error("请输入验证码");return}this.isVerifyingCode=true;try{const e=await l(this.phoneNumber.trim(),this.verificationCode.trim(),0);if(!e.success){p.error(e.message||"验证码错误");this.isVerifyingCode=false;return}}catch(e){p.error("验证码校验失败");this.isVerifyingCode=false;return}this.isVerifyingCode=false}if(await(this.pcmUploadRef?.getIsUploading?.())){p.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return o("div",{class:i,style:e},o("div",{class:t},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle)),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),!this.showChatModal&&!this.conversationId&&o("div",{class:"input-container"},o("div",{class:"resume-upload-section"},o("label",null,"上传合同"),o("pcm-upload",{ref:e=>this.pcmUploadRef=e,maxFileSize:25*1024*1024,multiple:false,mobileUploadAble:true,uploadText:"点击上传合同",acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["other"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设文件",file_size:0,ext:""}]:undefined,disabled:!!this.customInputs?.file_url,onUploadChange:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),o("div",{class:"jd-input-section"},o("label",null,"手机号(选填,填写后结果将通过短信发送)"),o("input",{type:"tel",class:"phone-input",placeholder:"请输入手机号",maxLength:11,value:this.phoneNumber,onInput:this.handlePhoneNumberChange})),this.phoneNumber.trim().length===11&&o("div",{class:"jd-input-section"},o("label",null,"验证码"),o("div",{class:"verification-code-container"},o("input",{type:"text",class:"verification-code-input",placeholder:"请输入验证码",maxLength:6,value:this.verificationCode,onInput:this.handleVerificationCodeChange}),o("button",{class:"send-code-button",disabled:this.isSendingCode||this.countdown>0||!this.phoneNumber.trim(),onClick:this.handleSendCode},this.isSendingCode?"发送中...":this.countdown>0?`${this.countdown}秒`:"发送验证码"))),o("button",{class:"submit-button",disabled:!this.customInputs?.file_url&&!this.uploadedFileInfo||this.isUploading||this.isSubmitting||this.isVerifyingCode,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isVerifyingCode?"验证中...":this.isSubmitting?"处理中...":"开始分析"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018882",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,phone:this.phoneNumber.trim()||undefined},interviewMode:"text"}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};x.style=c+(h+u);export{x as oem_htws_modal};
|
|
2
|
+
//# sourceMappingURL=p-178f3772.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as n,v as a,c as r,b as s}from"./p-DU3DLNhC.js";import{E as l}from"./p-C0FYX2-Z.js";import{S as d}from"./p-CJrQ18zg.js";import"./p-Bs-zO1WZ.js";const c=".input-mode-toggle{display:flex;align-items:center;margin-bottom:16px}.input-mode-toggle span{color:#333;margin-right:12px}.toggle-button{display:flex;align-items:center;background:none;border:none;color:#2E6EDF;cursor:pointer;font-size:14px;padding:4px 8px}.toggle-button svg{margin-right:4px}.toggle-button:disabled{opacity:0.5;cursor:not-allowed}.structured-input{width:100%}.job-name-input{margin-bottom:20px}.job-name-input label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-name-input input{width:95%;padding:10px 12px;border:1px solid #ddd;border-radius:4px;font-size:14px;background-color:#f9f9f9}.job-name-input input:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.required{color:#f56c6c}.button-container{display:flex;justify-content:center;margin-top:24px;gap:12px;max-width:100%;box-sizing:border-box;flex-wrap:wrap}.next-button{background-color:#2E6EDF;color:white}.next-button:hover{background-color:#2457b8}.next-button:disabled{background-color:#a0c0e8;cursor:not-allowed}.prev-button{background-color:#f0f0f0 !important;color:#333 !important}.prev-button:hover{background-color:#e0e0e0}.tag-selection{width:100%}.tag-selection-content{width:100%}.section-title{font-weight:600;color:#333;margin-bottom:12px;font-size:16px}.ai-tags-section,.basic-tags-section{margin-bottom:24px}.tag-group{margin-bottom:16px}.tag-title{color:#555;margin-bottom:8px;font-weight:500}.tag-container{display:flex;flex-wrap:wrap;gap:8px;max-width:100%;box-sizing:border-box}.tag{display:inline-flex;align-items:center;padding:6px 12px;border-radius:4px;background-color:#f5f5f5;border:1px solid #e0e0e0;color:#333;font-size:13px;cursor:pointer;transition:all 0.2s;max-width:100%;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tag:hover{background-color:#e8e8e8}.tag-selected{background-color:#e6f0ff;border-color:#2E6EDF;color:#2E6EDF}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 0;background-color:#f9f9f9;border-radius:8px;margin:20px 0;max-width:100%;box-sizing:border-box}.loading-spinner{width:40px;height:40px;border:3px solid rgba(46, 110, 223, 0.2);border-radius:50%;border-top-color:#2E6EDF;animation:spin 1s linear infinite;margin-bottom:16px}@keyframes spin{to{transform:rotate(360deg)}}.loading-text{text-align:center;color:#333;font-weight:500}.loading-subtext{color:#888;font-size:14px;margin-top:4px}.free-input{width:100%}.textarea-container{margin-bottom:16px}.textarea-container label{display:block;margin-bottom:8px;font-weight:500;color:#333}.textarea-container textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;resize:vertical;background-color:#f9f9f9;min-height:150px;width:100%;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.textarea-container textarea:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.input-guide{background-color:#f5f7fa;border-radius:4px;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.guide-title{font-weight:500;color:#333;margin-bottom:8px}.guide-content{color:#666;font-size:13px;max-width:100%;word-wrap:break-word}.guide-content div{margin-bottom:4px}@media (max-width: 768px){.tag-container{gap:7px}.tag{padding:4px 8px;font-size:12px}}@media (max-width: 480px){.button-container{flex-direction:column;align-items:center}.next-button,.prev-button,.submit-button{width:100%;margin-bottom:8px}.tag{max-width:calc(50% - 8px)}}.tag-selection,.tag-selection-content,.ai-tags-section,.basic-tags-section,.structured-input,.free-input{max-width:100%;box-sizing:border-box}";const p='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}';const h=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){t(this,i);this.modalClosed=e(this,"modalClosed");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="职位生成";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请帮我生成职位信息";fullscreen=false;customInputs={};showWorkspaceHistory=false;showSaveJdButton=false;saveJdButtonText="保存职位";streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";showChatModal=false;get hostElement(){return i(this)}inputMode="structured";step="input";jobName="";freeInputText="";isLoading=false;isSubmitting=false;tagGroups=[];shuffledTagGroups=[];selectedAITags={};selectedTags={salary:"",benefits:[],education:""};tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.showChatModal=false;this.jobDescription="";this.jobName="";this.freeInputText="";this.step="input";this.inputMode="structured";this.tagGroups=[];this.shuffledTagGroups=[];this.selectedAITags={};this.selectedTags={salary:"",benefits:[],education:""}}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info;this.inputMode="free";this.freeInputText=this.customInputs.job_info}await a(this.token);if(this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}salaryRanges=[{text:"3k-5k",value:"3k_5k"},{text:"5k-8k",value:"5k_8k"},{text:"8k-12k",value:"8k_12k"},{text:"12k-15k",value:"12k_15k"},{text:"15k-20k",value:"15k_20k"},{text:"20k以上",value:"above_20k"}];benefits=[{text:"五险一金",value:"五险一金"},{text:"年终奖",value:"年终奖"},{text:"带薪年假",value:"带薪年假"},{text:"加班补贴",value:"加班补贴"},{text:"餐补",value:"餐补"},{text:"交通补贴",value:"交通补贴"},{text:"节日福利",value:"节日福利"},{text:"团队建设",value:"团队建设"}];educationRequirements=[{text:"大专",value:"大专"},{text:"本科",value:"本科"},{text:"硕士",value:"硕士"},{text:"博士",value:"博士"},{text:"学历不限",value:"学历不限"}];handleClose=()=>{this.modalClosed.emit()};handleToggleInput=()=>{this.inputMode=this.inputMode==="structured"?"free":"structured"};handleJobNameChange=t=>{const e=t.target;this.jobName=e.value};handleFreeInputChange=t=>{const e=t.target;this.freeInputText=e.value};handleNextStep=async()=>{if(!this.jobName.trim()){alert("请输入职位名称");return}this.step="review";await this.handlePositionAnalysis(this.jobName)};handlePrevStep=()=>{this.step="input"};async handlePositionAnalysis(t){if(!t.trim())return;this.isLoading=true;try{const e=await s({url:"/sdk/v1/chat/workflow/block-run",method:"POST",data:{inputs:{input_info:t},bot_id:"59322522667307008",workflow_code:"generate_jd_tags"}});if(e.success&&e.data?.data.outputs?.text){try{let t=e.data.data.outputs.text.trim();const i=t.match(/```json\s*([\s\S]*?)\s*```/);if(i){t=i[1].trim()}const o=JSON.parse(t);this.tagGroups=o.tagGroup||[];const n={};const a=(o.tagGroup||[]).map((t=>{const e=[...t.defaultTags||[],...t.optionalTags||[]];for(let t=e.length-1;t>0;t--){const i=Math.floor(Math.random()*(t+1));[e[t],e[i]]=[e[i],e[t]]}if(t.defaultTags&&t.defaultTags.length>0){n[t.dimensionName]=[...t.defaultTags]}return{dimensionName:t.dimensionName,tags:e}}));this.shuffledTagGroups=a;this.selectedAITags=n}catch(t){d.captureError(t,{action:"handlePositionAnalysis",component:"oem-jd-modal",title:"解析前置标签时错误"});l.emitError({error:t,message:"解析前置标签时错误"})}}}catch(t){console.error("工作流运行错误:",t)}finally{this.isLoading=false}}handleTagClick=(t,e)=>{if(t==="benefits"){const t=[...this.selectedTags.benefits];const i=t.includes(e)?t.filter((t=>t!==e)):[...t,e];this.selectedTags={...this.selectedTags,benefits:i}}else{this.selectedTags={...this.selectedTags,[t]:this.selectedTags[t]===e?"":e}}};handleAITagClick=(t,e)=>{const i=this.selectedAITags[t]||[];const o=i.includes(e)?i.filter((t=>t!==e)):[...i,e];this.selectedAITags={...this.selectedAITags,[t]:o}};handleSubmitStructured=async()=>{this.isSubmitting=true;try{let t="";if(this.selectedTags.salary){const e=this.salaryRanges.find((t=>t.value===this.selectedTags.salary));if(e){t=e.text}}const e=this.selectedTags.benefits.join("、");let i="";if(this.selectedTags.education){const t=this.educationRequirements.find((t=>t.value===this.selectedTags.education));if(t){i=t.text}}let o=`职位名称:${this.jobName}\n`;if(t){o+=`薪资范围:${t}\n`}if(e){o+=`福利待遇:${e}\n`}if(i){o+=`学历要求:${i}\n`}Object.entries(this.selectedAITags).forEach((([t,e])=>{if(e.length>0){o+=`${t}:${e.join("、")}\n`}}));this.showChatModal=true;this.jobDescription=o}catch(t){console.error("提交结构化数据时出错:",t);d.captureError(t,{action:"handleSubmitStructured",component:"oem-jd-modal",title:"提交数据时出错"});l.emitError({error:t,message:"提交数据时出错,请重试"})}finally{this.isSubmitting=false}};handleSubmitFree=async()=>{if(!this.freeInputText.trim()){alert("请输入职位需求信息");return}this.isSubmitting=true;try{this.jobDescription=this.freeInputText;this.showChatModal=true}catch(t){console.error("提交自由输入数据时出错:",t);d.captureError(t,{action:"handleSubmitFree",component:"oem-jd-modal",title:"提交数据时出错"});l.emitError({error:t,message:"提交数据时出错,请重试"})}finally{this.isSubmitting=false}};jobDescription="";renderTagGroup(t,e,i){return o("div",{class:"tag-group"},o("div",{class:"tag-title"},t),o("div",{class:"tag-container"},e.map((t=>{const e=i==="benefits"?this.selectedTags.benefits.includes(t.value):this.selectedTags[i]===t.value;return o("div",{class:{tag:true,"tag-selected":e},onClick:()=>this.handleTagClick(i,t.value)},t.text)}))))}renderAITagGroups(){return o("div",{class:"ai-tag-groups"},this.shuffledTagGroups.map((t=>o("div",{class:"tag-group"},o("div",{class:"tag-title"},t.dimensionName),o("div",{class:"tag-container"},t.tags.map((e=>{const i=(this.selectedAITags[t.dimensionName]||[]).includes(e);return o("div",{class:{tag:true,"tag-selected":i},onClick:()=>this.handleAITagClick(t.dimensionName,e)},e)})))))))}renderLoadingState(){return o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("div",{class:"loading-text"},o("div",null,"AI 正在分析职位信息"),o("div",{class:"loading-subtext"},"请稍候...")))}render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return o("div",{class:i,style:t},o("div",{class:e},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle)),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),!this.showChatModal&&!this.conversationId&&true&&o("div",{class:"input-container"},o("div",{class:"input-mode-toggle"},o("span",null,"职位需求信息"),o("button",{class:"toggle-button",onClick:this.handleToggleInput,disabled:this.isLoading},o("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor"},o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})),"切换输入")),this.inputMode==="structured"&&o("div",{class:"structured-input"},this.step==="input"&&o("div",{class:"job-name-input"},o("label",{htmlFor:"job-name"},"职位名称 ",o("span",{class:"required"},"*")),o("input",{id:"job-name",type:"text",placeholder:"请输入职位名称",value:this.jobName,onInput:this.handleJobNameChange,disabled:this.isLoading}),o("div",{class:"button-container"},o("button",{class:"submit-button next-button",onClick:this.handleNextStep,disabled:!this.jobName.trim()||this.isLoading},"下一步"))),this.step==="review"&&o("div",{class:"tag-selection"},this.isLoading?this.renderLoadingState():o("div",{class:"tag-selection-content"},this.tagGroups.length>0&&o("div",{class:"ai-tags-section"},o("div",{class:"section-title"},"AI 推荐标签"),this.renderAITagGroups()),this.tagGroups.length>0&&o("div",{class:"basic-tags-section"},this.renderTagGroup("月薪范围",this.salaryRanges,"salary"),this.renderTagGroup("福利待遇",this.benefits,"benefits"),this.renderTagGroup("学历要求",this.educationRequirements,"education")),o("div",{class:"button-container"},o("button",{class:"submit-button prev-button",onClick:this.handlePrevStep},"上一步"),o("button",{class:"submit-button",onClick:this.handleSubmitStructured,disabled:this.isSubmitting},this.isSubmitting?"处理中...":"生成JD"))))),this.inputMode==="free"&&o("div",{class:"free-input"},o("div",{class:"textarea-container"},o("label",{htmlFor:"free-input-text"},"JD信息 ",o("span",{class:"required"},"*")),o("textarea",{id:"free-input-text",placeholder:"请按照下方提示格式输入职位需求信息",rows:8,value:this.freeInputText,onInput:this.handleFreeInputChange})),o("div",{class:"input-guide"},o("div",{class:"guide-title"},"输入格式参考:"),o("div",{class:"guide-content"},o("div",null,"• 职位名称 - 明确定义职位的名称"),o("div",null,"• 薪资范围 - 明确该岗位的月薪或年薪"),o("div",null,"• 福利待遇 - 该职位的福利待遇,如:五险一金、年休假、下午茶等"),o("div",null,"• 工作职责 - 描述工作内容"),o("div",null,"• 任职资格 - 包括学历、经验和技术要求"),o("div",null,"• 工作地点与性质 - 全职/兼职、远程/办公室"))),o("div",{class:"button-container"},o("button",{class:"submit-button",onClick:this.handleSubmitFree,disabled:!this.freeInputText.trim()||this.isSubmitting},this.isSubmitting?"处理中...":"生成JD"))),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018873",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,customInputs:{...this.customInputs,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text",showSaveJdButton:this.showSaveJdButton,saveJdButtonText:this.saveJdButtonText}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=c+(p+h);export{u as oem_jd_modal};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as n,v as a,c as r,b as s}from"./p-WTSeW6oH.js";import{E as l}from"./p-C0FYX2-Z.js";import{S as d}from"./p-CBQPOkZb.js";import"./p-Bs-zO1WZ.js";const c=".input-mode-toggle{display:flex;align-items:center;margin-bottom:16px}.input-mode-toggle span{color:#333;margin-right:12px}.toggle-button{display:flex;align-items:center;background:none;border:none;color:#2E6EDF;cursor:pointer;font-size:14px;padding:4px 8px}.toggle-button svg{margin-right:4px}.toggle-button:disabled{opacity:0.5;cursor:not-allowed}.structured-input{width:100%}.job-name-input{margin-bottom:20px}.job-name-input label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-name-input input{width:95%;padding:10px 12px;border:1px solid #ddd;border-radius:4px;font-size:14px;background-color:#f9f9f9}.job-name-input input:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.required{color:#f56c6c}.button-container{display:flex;justify-content:center;margin-top:24px;gap:12px;max-width:100%;box-sizing:border-box;flex-wrap:wrap}.next-button{background-color:#2E6EDF;color:white}.next-button:hover{background-color:#2457b8}.next-button:disabled{background-color:#a0c0e8;cursor:not-allowed}.prev-button{background-color:#f0f0f0 !important;color:#333 !important}.prev-button:hover{background-color:#e0e0e0}.tag-selection{width:100%}.tag-selection-content{width:100%}.section-title{font-weight:600;color:#333;margin-bottom:12px;font-size:16px}.ai-tags-section,.basic-tags-section{margin-bottom:24px}.tag-group{margin-bottom:16px}.tag-title{color:#555;margin-bottom:8px;font-weight:500}.tag-container{display:flex;flex-wrap:wrap;gap:8px;max-width:100%;box-sizing:border-box}.tag{display:inline-flex;align-items:center;padding:6px 12px;border-radius:4px;background-color:#f5f5f5;border:1px solid #e0e0e0;color:#333;font-size:13px;cursor:pointer;transition:all 0.2s;max-width:100%;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tag:hover{background-color:#e8e8e8}.tag-selected{background-color:#e6f0ff;border-color:#2E6EDF;color:#2E6EDF}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 0;background-color:#f9f9f9;border-radius:8px;margin:20px 0;max-width:100%;box-sizing:border-box}.loading-spinner{width:40px;height:40px;border:3px solid rgba(46, 110, 223, 0.2);border-radius:50%;border-top-color:#2E6EDF;animation:spin 1s linear infinite;margin-bottom:16px}@keyframes spin{to{transform:rotate(360deg)}}.loading-text{text-align:center;color:#333;font-weight:500}.loading-subtext{color:#888;font-size:14px;margin-top:4px}.free-input{width:100%}.textarea-container{margin-bottom:16px}.textarea-container label{display:block;margin-bottom:8px;font-weight:500;color:#333}.textarea-container textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;resize:vertical;background-color:#f9f9f9;min-height:150px;width:100%;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.textarea-container textarea:focus{outline:none;border-color:#2E6EDF;box-shadow:0 0 0 2px rgba(46, 110, 223, 0.2)}.input-guide{background-color:#f5f7fa;border-radius:4px;padding:12px 16px;margin-bottom:20px;max-width:100%;box-sizing:border-box;word-wrap:break-word}.guide-title{font-weight:500;color:#333;margin-bottom:8px}.guide-content{color:#666;font-size:13px;max-width:100%;word-wrap:break-word}.guide-content div{margin-bottom:4px}@media (max-width: 768px){.tag-container{gap:7px}.tag{padding:4px 8px;font-size:12px}}@media (max-width: 480px){.button-container{flex-direction:column;align-items:center}.next-button,.prev-button,.submit-button{width:100%;margin-bottom:8px}.tag{max-width:calc(50% - 8px)}}.tag-selection,.tag-selection-content,.ai-tags-section,.basic-tags-section,.structured-input,.free-input{max-width:100%;box-sizing:border-box}";const p='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}';const h=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){t(this,i);this.modalClosed=e(this,"modalClosed");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="职位生成";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请帮我生成职位信息";fullscreen=false;customInputs={};showWorkspaceHistory=false;showSaveJdButton=false;saveJdButtonText="保存职位";streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";showChatModal=false;get hostElement(){return i(this)}inputMode="structured";step="input";jobName="";freeInputText="";isLoading=false;isSubmitting=false;tagGroups=[];shuffledTagGroups=[];selectedAITags={};selectedTags={salary:"",benefits:[],education:""};tokenInvalidListener;removeErrorListener;handleTokenChange(t){if(t&&t!==n.getToken()){n.setToken(t)}}async handleIsOpenChange(t){if(!t){this.showChatModal=false;this.jobDescription="";this.jobName="";this.freeInputText="";this.step="input";this.inputMode="structured";this.tagGroups=[];this.shuffledTagGroups=[];this.selectedAITags={};this.selectedTags={salary:"",benefits:[],education:""}}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info;this.inputMode="free";this.freeInputText=this.customInputs.job_info}await a(this.token);if(this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}}salaryRanges=[{text:"3k-5k",value:"3k_5k"},{text:"5k-8k",value:"5k_8k"},{text:"8k-12k",value:"8k_12k"},{text:"12k-15k",value:"12k_15k"},{text:"15k-20k",value:"15k_20k"},{text:"20k以上",value:"above_20k"}];benefits=[{text:"五险一金",value:"五险一金"},{text:"年终奖",value:"年终奖"},{text:"带薪年假",value:"带薪年假"},{text:"加班补贴",value:"加班补贴"},{text:"餐补",value:"餐补"},{text:"交通补贴",value:"交通补贴"},{text:"节日福利",value:"节日福利"},{text:"团队建设",value:"团队建设"}];educationRequirements=[{text:"大专",value:"大专"},{text:"本科",value:"本科"},{text:"硕士",value:"硕士"},{text:"博士",value:"博士"},{text:"学历不限",value:"学历不限"}];handleClose=()=>{this.modalClosed.emit()};handleToggleInput=()=>{this.inputMode=this.inputMode==="structured"?"free":"structured"};handleJobNameChange=t=>{const e=t.target;this.jobName=e.value};handleFreeInputChange=t=>{const e=t.target;this.freeInputText=e.value};handleNextStep=async()=>{if(!this.jobName.trim()){alert("请输入职位名称");return}this.step="review";await this.handlePositionAnalysis(this.jobName)};handlePrevStep=()=>{this.step="input"};async handlePositionAnalysis(t){if(!t.trim())return;this.isLoading=true;try{const e=await s({url:"/sdk/v1/chat/workflow/block-run",method:"POST",data:{inputs:{input_info:t},bot_id:"59322522667307008",workflow_code:"generate_jd_tags"}});if(e.success&&e.data?.data.outputs?.text){try{let t=e.data.data.outputs.text.trim();const i=t.match(/```json\s*([\s\S]*?)\s*```/);if(i){t=i[1].trim()}const o=JSON.parse(t);this.tagGroups=o.tagGroup||[];const n={};const a=(o.tagGroup||[]).map((t=>{const e=[...t.defaultTags||[],...t.optionalTags||[]];for(let t=e.length-1;t>0;t--){const i=Math.floor(Math.random()*(t+1));[e[t],e[i]]=[e[i],e[t]]}if(t.defaultTags&&t.defaultTags.length>0){n[t.dimensionName]=[...t.defaultTags]}return{dimensionName:t.dimensionName,tags:e}}));this.shuffledTagGroups=a;this.selectedAITags=n}catch(t){d.captureError(t,{action:"handlePositionAnalysis",component:"oem-jd-modal",title:"解析前置标签时错误"});l.emitError({error:t,message:"解析前置标签时错误"})}}}catch(t){console.error("工作流运行错误:",t)}finally{this.isLoading=false}}handleTagClick=(t,e)=>{if(t==="benefits"){const t=[...this.selectedTags.benefits];const i=t.includes(e)?t.filter((t=>t!==e)):[...t,e];this.selectedTags={...this.selectedTags,benefits:i}}else{this.selectedTags={...this.selectedTags,[t]:this.selectedTags[t]===e?"":e}}};handleAITagClick=(t,e)=>{const i=this.selectedAITags[t]||[];const o=i.includes(e)?i.filter((t=>t!==e)):[...i,e];this.selectedAITags={...this.selectedAITags,[t]:o}};handleSubmitStructured=async()=>{this.isSubmitting=true;try{let t="";if(this.selectedTags.salary){const e=this.salaryRanges.find((t=>t.value===this.selectedTags.salary));if(e){t=e.text}}const e=this.selectedTags.benefits.join("、");let i="";if(this.selectedTags.education){const t=this.educationRequirements.find((t=>t.value===this.selectedTags.education));if(t){i=t.text}}let o=`职位名称:${this.jobName}\n`;if(t){o+=`薪资范围:${t}\n`}if(e){o+=`福利待遇:${e}\n`}if(i){o+=`学历要求:${i}\n`}Object.entries(this.selectedAITags).forEach((([t,e])=>{if(e.length>0){o+=`${t}:${e.join("、")}\n`}}));this.showChatModal=true;this.jobDescription=o}catch(t){console.error("提交结构化数据时出错:",t);d.captureError(t,{action:"handleSubmitStructured",component:"oem-jd-modal",title:"提交数据时出错"});l.emitError({error:t,message:"提交数据时出错,请重试"})}finally{this.isSubmitting=false}};handleSubmitFree=async()=>{if(!this.freeInputText.trim()){alert("请输入职位需求信息");return}this.isSubmitting=true;try{this.jobDescription=this.freeInputText;this.showChatModal=true}catch(t){console.error("提交自由输入数据时出错:",t);d.captureError(t,{action:"handleSubmitFree",component:"oem-jd-modal",title:"提交数据时出错"});l.emitError({error:t,message:"提交数据时出错,请重试"})}finally{this.isSubmitting=false}};jobDescription="";renderTagGroup(t,e,i){return o("div",{class:"tag-group"},o("div",{class:"tag-title"},t),o("div",{class:"tag-container"},e.map((t=>{const e=i==="benefits"?this.selectedTags.benefits.includes(t.value):this.selectedTags[i]===t.value;return o("div",{class:{tag:true,"tag-selected":e},onClick:()=>this.handleTagClick(i,t.value)},t.text)}))))}renderAITagGroups(){return o("div",{class:"ai-tag-groups"},this.shuffledTagGroups.map((t=>o("div",{class:"tag-group"},o("div",{class:"tag-title"},t.dimensionName),o("div",{class:"tag-container"},t.tags.map((e=>{const i=(this.selectedAITags[t.dimensionName]||[]).includes(e);return o("div",{class:{tag:true,"tag-selected":i},onClick:()=>this.handleAITagClick(t.dimensionName,e)},e)})))))))}renderLoadingState(){return o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("div",{class:"loading-text"},o("div",null,"AI 正在分析职位信息"),o("div",{class:"loading-subtext"},"请稍候...")))}render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;return o("div",{class:i,style:t},o("div",{class:e},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle)),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),!this.showChatModal&&!this.conversationId&&true&&o("div",{class:"input-container"},o("div",{class:"input-mode-toggle"},o("span",null,"职位需求信息"),o("button",{class:"toggle-button",onClick:this.handleToggleInput,disabled:this.isLoading},o("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor"},o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})),"切换输入")),this.inputMode==="structured"&&o("div",{class:"structured-input"},this.step==="input"&&o("div",{class:"job-name-input"},o("label",{htmlFor:"job-name"},"职位名称 ",o("span",{class:"required"},"*")),o("input",{id:"job-name",type:"text",placeholder:"请输入职位名称",value:this.jobName,onInput:this.handleJobNameChange,disabled:this.isLoading}),o("div",{class:"button-container"},o("button",{class:"submit-button next-button",onClick:this.handleNextStep,disabled:!this.jobName.trim()||this.isLoading},"下一步"))),this.step==="review"&&o("div",{class:"tag-selection"},this.isLoading?this.renderLoadingState():o("div",{class:"tag-selection-content"},this.tagGroups.length>0&&o("div",{class:"ai-tags-section"},o("div",{class:"section-title"},"AI 推荐标签"),this.renderAITagGroups()),this.tagGroups.length>0&&o("div",{class:"basic-tags-section"},this.renderTagGroup("月薪范围",this.salaryRanges,"salary"),this.renderTagGroup("福利待遇",this.benefits,"benefits"),this.renderTagGroup("学历要求",this.educationRequirements,"education")),o("div",{class:"button-container"},o("button",{class:"submit-button prev-button",onClick:this.handlePrevStep},"上一步"),o("button",{class:"submit-button",onClick:this.handleSubmitStructured,disabled:this.isSubmitting},this.isSubmitting?"处理中...":"生成JD"))))),this.inputMode==="free"&&o("div",{class:"free-input"},o("div",{class:"textarea-container"},o("label",{htmlFor:"free-input-text"},"JD信息 ",o("span",{class:"required"},"*")),o("textarea",{id:"free-input-text",placeholder:"请按照下方提示格式输入职位需求信息",rows:8,value:this.freeInputText,onInput:this.handleFreeInputChange})),o("div",{class:"input-guide"},o("div",{class:"guide-title"},"输入格式参考:"),o("div",{class:"guide-content"},o("div",null,"• 职位名称 - 明确定义职位的名称"),o("div",null,"• 薪资范围 - 明确该岗位的月薪或年薪"),o("div",null,"• 福利待遇 - 该职位的福利待遇,如:五险一金、年休假、下午茶等"),o("div",null,"• 工作职责 - 描述工作内容"),o("div",null,"• 任职资格 - 包括学历、经验和技术要求"),o("div",null,"• 工作地点与性质 - 全职/兼职、远程/办公室"))),o("div",{class:"button-container"},o("button",{class:"submit-button",onClick:this.handleSubmitFree,disabled:!this.freeInputText.trim()||this.isSubmitting},this.isSubmitting?"处理中...":"生成JD"))),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018873",conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,customInputs:{...this.customInputs,job_info:this.customInputs?.job_info||this.jobDescription},interviewMode:"text",showSaveJdButton:this.showSaveJdButton,saveJdButtonText:this.saveJdButtonText}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=c+(p+h);export{u as oem_jd_modal};
|
|
2
|
+
//# sourceMappingURL=p-22e147d9.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as n,v as s,c as r,e as a,f as l}from"./p-DU3DLNhC.js";import{E as d}from"./p-C0FYX2-Z.js";import{M as p}from"./p-DXVhHj6-.js";const c='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}';const h=".plan-type-section{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}.plan-type-section label{font-weight:600;color:#333;margin-bottom:8px}.plan-type-options{display:flex;gap:15px;flex-wrap:wrap}.plan-type-option{flex:1;min-width:120px;border:1px solid #e8e8e8;border-radius:8px;padding:15px;cursor:pointer;display:flex;flex-direction:column;align-items:center;transition:all 0.3s}.plan-type-option:hover{border-color:#1890ff;background-color:#f0f7ff}.plan-type-option.selected{border-color:#1890ff;background-color:#e6f7ff;box-shadow:0 2px 8px rgba(24, 144, 255, 0.2)}.option-icon{font-size:24px;margin-bottom:8px}.option-label{font-size:14px;font-weight:500;color:#333}.resume-upload-section{display:flex;flex-direction:column;gap:8px}.resume-upload-section label{font-weight:600;color:#333;margin-bottom:8px}.dynamic-form-section{margin-top:20px;margin-bottom:20px}.form-fields{display:flex;flex-direction:column;gap:16px}.form-field{display:flex;flex-direction:column;gap:8px}.form-field label{font-weight:600;color:#333;font-size:14px}.form-input{padding:10px 12px;border:1px solid #d9d9d9;border-radius:4px;font-size:14px;transition:all 0.3s;outline:none}.form-input:hover{border-color:#40a9ff}.form-input:focus{border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.1)}.form-input::placeholder{color:#bfbfbf}.form-hint{font-size:12px;color:#8c8c8c;line-height:1.5;margin-top:-8px;padding:8px 12px;background-color:#f5f5f5;border-radius:4px;border-left:3px solid #1890ff}.phone-input{width:calc(100% - 16px);padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.phone-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.verification-code-container{display:flex;gap:8px;align-items:center}.verification-code-input{flex:1;padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.verification-code-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.send-code-button{padding:8px 16px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:14px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;min-width:100px}.send-code-button:hover:not(:disabled){background-color:#40a9ff}.send-code-button:disabled{background-color:rgba(0, 0, 0, 0.04);color:rgba(0, 0, 0, 0.25);cursor:not-allowed}";const f=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.planningComplete=t(this,"planningComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="职业规划助手";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始规划";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;planningComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";isUploading=false;uploadedFileInfo=null;showChatModal=false;isSubmitting=false;selectedPlanType="晋升路径";targetPosition="";industryName="";jobPosition="";timePeriod="";phoneNumber="";verificationCode="";isSendingCode=false;countdown=0;isVerifyingCode=false;get hostElement(){return i(this)}tokenInvalidListener;removeErrorListener;pcmUploadRef;countdownTimer=null;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.isSubmitting=false;this.uploadedFileInfo=null;this.phoneNumber="";this.verificationCode="";this.isSendingCode=false;this.isVerifyingCode=false;this.countdown=0;if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}else{if(this.customInputs&&this.customInputs.type){const e=this.customInputs.type;if(e==="转型建议"||e==="晋升路径"){this.selectedPlanType=e}}await s(this.token);if(this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=d.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}handleClose=()=>{this.modalClosed.emit()};handlePlanTypeChange=e=>{this.selectedPlanType=e;this.targetPosition="";this.industryName="";this.jobPosition="";this.timePeriod=""};handlePhoneNumberChange=e=>{const t=e.target;this.phoneNumber=t.value};handleVerificationCodeChange=e=>{const t=e.target;this.verificationCode=t.value};startCountdown=()=>{this.countdown=60;if(this.countdownTimer){clearInterval(this.countdownTimer)}this.countdownTimer=setInterval((()=>{this.countdown--;if(this.countdown<=0){if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}}),1e3)};handleSendCode=async()=>{if(!this.phoneNumber.trim()){p.error("请输入手机号");return}const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){p.error("请输入正确的手机号");return}this.isSendingCode=true;try{const e=await a(this.phoneNumber.trim(),0);if(e.success){p.success("验证码已发送");this.startCountdown()}else{p.error(e.message||"发送验证码失败")}}catch(e){p.error("发送验证码失败")}finally{this.isSendingCode=false}};handleStartPlanning=async()=>{if(!this.customInputs?.file_url&&!this.uploadedFileInfo){p.info("请上传简历");return}if(this.phoneNumber.trim()){const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){p.error("请输入正确的手机号");return}if(!this.verificationCode.trim()){p.error("请输入验证码");return}this.isVerifyingCode=true;try{const e=await l(this.phoneNumber.trim(),this.verificationCode.trim(),0);if(!e.success){p.error(e.message||"验证码错误");this.isVerifyingCode=false;return}}catch(e){p.error("验证码校验失败");this.isVerifyingCode=false;return}this.isVerifyingCode=false}if(await(this.pcmUploadRef?.getIsUploading?.())){p.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};handlePlanningComplete=e=>{this.planningComplete.emit({...e.detail,type:this.selectedPlanType})};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const s=Boolean(this.customInputs&&this.customInputs.file_url);return o("div",{class:i,style:e},o("div",{class:t},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle)),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),!this.showChatModal&&!this.conversationId&&o("div",{class:"input-container"},o("div",{class:"plan-type-section"},o("label",null,"选择建议类型"),o("div",{class:"plan-type-options"},o("div",{class:`plan-type-option ${this.selectedPlanType==="晋升路径"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("晋升路径")},o("div",{class:"option-icon"},"🚀"),o("div",{class:"option-label"},"晋升路径")),o("div",{class:`plan-type-option ${this.selectedPlanType==="转型建议"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("转型建议")},o("div",{class:"option-icon"},"🔄"),o("div",{class:"option-label"},"转型建议")))),o("div",{class:"dynamic-form-section"},this.selectedPlanType==="转型建议"&&o("div",{class:"form-fields"},o("div",{class:"form-field"},o("label",null,"感兴趣的行业"),o("input",{type:"text",class:"form-input",placeholder:"请输入您感兴趣的行业",value:this.industryName,onInput:e=>this.industryName=e.target.value})),o("div",{class:"form-field"},o("label",null,"感兴趣的职位"),o("input",{type:"text",class:"form-input",placeholder:"请输入您感兴趣的职位",value:this.jobPosition,onInput:e=>this.jobPosition=e.target.value})),o("div",{class:"form-hint"},"为确保职业规划报告的准确性,推荐您至少填写其中一项"),o("div",{class:"form-field"},o("label",null,"期望转型时间"),o("input",{type:"text",class:"form-input",placeholder:"请输入您期望的转型时间",value:this.timePeriod,onInput:e=>this.timePeriod=e.target.value}))),this.selectedPlanType==="晋升路径"&&o("div",{class:"form-fields"},o("div",{class:"form-field"},o("label",null,"晋升目标岗位"),o("input",{type:"text",class:"form-input",placeholder:"请输入您的晋升目标岗位",value:this.targetPosition,onInput:e=>this.targetPosition=e.target.value})),o("div",{class:"form-hint"},"为确保职业规划报告的准确性,建议您填写晋升目标岗位名称"))),o("div",{class:"resume-upload-section"},o("label",null,"上传简历"),o("pcm-upload",{ref:e=>this.pcmUploadRef=e,maxFileSize:15*1024*1024,multiple:false,mobileUploadAble:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设简历",file_size:0,ext:""}]:undefined,disabled:s,onUploadChange:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),o("div",{class:"jd-input-section"},o("label",null,"手机号(选填,填写后结果将通过短信发送)"),o("input",{type:"tel",class:"phone-input",placeholder:"请输入手机号",maxLength:11,value:this.phoneNumber,onInput:this.handlePhoneNumberChange})),this.phoneNumber.trim().length===11&&o("div",{class:"jd-input-section"},o("label",null,"验证码"),o("div",{class:"verification-code-container"},o("input",{type:"text",class:"verification-code-input",placeholder:"请输入验证码",maxLength:6,value:this.verificationCode,onInput:this.handleVerificationCodeChange}),o("button",{class:"send-code-button",disabled:this.isSendingCode||this.countdown>0||!this.phoneNumber.trim(),onClick:this.handleSendCode},this.isSendingCode?"发送中...":this.countdown>0?`${this.countdown}秒`:"发送验证码"))),o("button",{class:"submit-button",disabled:!s&&!this.uploadedFileInfo||this.isUploading||this.isSubmitting||this.isVerifyingCode,onClick:this.handleStartPlanning},this.isUploading?"上传中...":this.isVerifyingCode?"验证中...":this.isSubmitting?"处理中...":"开始规划"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018898",fullscreen:this.fullscreen,conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,type:this.selectedPlanType,phone:this.phoneNumber.trim()||undefined,...this.industryName?{industry_name:this.industryName}:{},...this.targetPosition||this.jobPosition?{target_position:this.targetPosition||this.jobPosition}:{},...this.timePeriod?{time_period:this.timePeriod}:{}},interviewMode:"text",onInterviewComplete:this.handlePlanningComplete}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=c+(h+f);export{u as oem_zygh_modal};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as n,v as s,c as r,e as a,f as l}from"./p-WTSeW6oH.js";import{E as d}from"./p-C0FYX2-Z.js";import{M as p}from"./p-DXVhHj6-.js";const c='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:calc(100% - 10px)}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}';const h=".plan-type-section{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}.plan-type-section label{font-weight:600;color:#333;margin-bottom:8px}.plan-type-options{display:flex;gap:15px;flex-wrap:wrap}.plan-type-option{flex:1;min-width:120px;border:1px solid #e8e8e8;border-radius:8px;padding:15px;cursor:pointer;display:flex;flex-direction:column;align-items:center;transition:all 0.3s}.plan-type-option:hover{border-color:#1890ff;background-color:#f0f7ff}.plan-type-option.selected{border-color:#1890ff;background-color:#e6f7ff;box-shadow:0 2px 8px rgba(24, 144, 255, 0.2)}.option-icon{font-size:24px;margin-bottom:8px}.option-label{font-size:14px;font-weight:500;color:#333}.resume-upload-section{display:flex;flex-direction:column;gap:8px}.resume-upload-section label{font-weight:600;color:#333;margin-bottom:8px}.dynamic-form-section{margin-top:20px;margin-bottom:20px}.form-fields{display:flex;flex-direction:column;gap:16px}.form-field{display:flex;flex-direction:column;gap:8px}.form-field label{font-weight:600;color:#333;font-size:14px}.form-input{padding:10px 12px;border:1px solid #d9d9d9;border-radius:4px;font-size:14px;transition:all 0.3s;outline:none}.form-input:hover{border-color:#40a9ff}.form-input:focus{border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.1)}.form-input::placeholder{color:#bfbfbf}.form-hint{font-size:12px;color:#8c8c8c;line-height:1.5;margin-top:-8px;padding:8px 12px;background-color:#f5f5f5;border-radius:4px;border-left:3px solid #1890ff}.phone-input{width:calc(100% - 16px);padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.phone-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.verification-code-container{display:flex;gap:8px;align-items:center}.verification-code-input{flex:1;padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.verification-code-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.send-code-button{padding:8px 16px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:14px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;min-width:100px}.send-code-button:hover:not(:disabled){background-color:#40a9ff}.send-code-button:disabled{background-color:rgba(0, 0, 0, 0.04);color:rgba(0, 0, 0, 0.25);cursor:not-allowed}";const f=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.planningComplete=t(this,"planningComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent")}modalTitle="职业规划助手";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始规划";fullscreen=false;customInputs={};showWorkspaceHistory=false;uploadSuccess;streamComplete;conversationStart;planningComplete;tokenInvalid;someErrorEvent;filePreviewMode="window";isUploading=false;uploadedFileInfo=null;showChatModal=false;isSubmitting=false;selectedPlanType="晋升路径";targetPosition="";industryName="";jobPosition="";timePeriod="";phoneNumber="";verificationCode="";isSendingCode=false;countdown=0;isVerifyingCode=false;get hostElement(){return i(this)}tokenInvalidListener;removeErrorListener;pcmUploadRef;countdownTimer=null;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){this.showChatModal=false;this.isSubmitting=false;this.uploadedFileInfo=null;this.phoneNumber="";this.verificationCode="";this.isSendingCode=false;this.isVerifyingCode=false;this.countdown=0;if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}else{if(this.customInputs&&this.customInputs.type){const e=this.customInputs.type;if(e==="转型建议"||e==="晋升路径"){this.selectedPlanType=e}}await s(this.token);if(this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=d.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}handleClose=()=>{this.modalClosed.emit()};handlePlanTypeChange=e=>{this.selectedPlanType=e;this.targetPosition="";this.industryName="";this.jobPosition="";this.timePeriod=""};handlePhoneNumberChange=e=>{const t=e.target;this.phoneNumber=t.value};handleVerificationCodeChange=e=>{const t=e.target;this.verificationCode=t.value};startCountdown=()=>{this.countdown=60;if(this.countdownTimer){clearInterval(this.countdownTimer)}this.countdownTimer=setInterval((()=>{this.countdown--;if(this.countdown<=0){if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}}),1e3)};handleSendCode=async()=>{if(!this.phoneNumber.trim()){p.error("请输入手机号");return}const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){p.error("请输入正确的手机号");return}this.isSendingCode=true;try{const e=await a(this.phoneNumber.trim(),0);if(e.success){p.success("验证码已发送");this.startCountdown()}else{p.error(e.message||"发送验证码失败")}}catch(e){p.error("发送验证码失败")}finally{this.isSendingCode=false}};handleStartPlanning=async()=>{if(!this.customInputs?.file_url&&!this.uploadedFileInfo){p.info("请上传简历");return}if(this.phoneNumber.trim()){const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){p.error("请输入正确的手机号");return}if(!this.verificationCode.trim()){p.error("请输入验证码");return}this.isVerifyingCode=true;try{const e=await l(this.phoneNumber.trim(),this.verificationCode.trim(),0);if(!e.success){p.error(e.message||"验证码错误");this.isVerifyingCode=false;return}}catch(e){p.error("验证码校验失败");this.isVerifyingCode=false;return}this.isVerifyingCode=false}if(await(this.pcmUploadRef?.getIsUploading?.())){p.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};handlePlanningComplete=e=>{this.planningComplete.emit({...e.detail,type:this.selectedPlanType})};render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const s=Boolean(this.customInputs&&this.customInputs.file_url);return o("div",{class:i,style:e},o("div",{class:t},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle)),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),!this.showChatModal&&!this.conversationId&&o("div",{class:"input-container"},o("div",{class:"plan-type-section"},o("label",null,"选择建议类型"),o("div",{class:"plan-type-options"},o("div",{class:`plan-type-option ${this.selectedPlanType==="晋升路径"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("晋升路径")},o("div",{class:"option-icon"},"🚀"),o("div",{class:"option-label"},"晋升路径")),o("div",{class:`plan-type-option ${this.selectedPlanType==="转型建议"?"selected":""}`,onClick:()=>this.handlePlanTypeChange("转型建议")},o("div",{class:"option-icon"},"🔄"),o("div",{class:"option-label"},"转型建议")))),o("div",{class:"dynamic-form-section"},this.selectedPlanType==="转型建议"&&o("div",{class:"form-fields"},o("div",{class:"form-field"},o("label",null,"感兴趣的行业"),o("input",{type:"text",class:"form-input",placeholder:"请输入您感兴趣的行业",value:this.industryName,onInput:e=>this.industryName=e.target.value})),o("div",{class:"form-field"},o("label",null,"感兴趣的职位"),o("input",{type:"text",class:"form-input",placeholder:"请输入您感兴趣的职位",value:this.jobPosition,onInput:e=>this.jobPosition=e.target.value})),o("div",{class:"form-hint"},"为确保职业规划报告的准确性,推荐您至少填写其中一项"),o("div",{class:"form-field"},o("label",null,"期望转型时间"),o("input",{type:"text",class:"form-input",placeholder:"请输入您期望的转型时间",value:this.timePeriod,onInput:e=>this.timePeriod=e.target.value}))),this.selectedPlanType==="晋升路径"&&o("div",{class:"form-fields"},o("div",{class:"form-field"},o("label",null,"晋升目标岗位"),o("input",{type:"text",class:"form-input",placeholder:"请输入您的晋升目标岗位",value:this.targetPosition,onInput:e=>this.targetPosition=e.target.value})),o("div",{class:"form-hint"},"为确保职业规划报告的准确性,建议您填写晋升目标岗位名称"))),o("div",{class:"resume-upload-section"},o("label",null,"上传简历"),o("pcm-upload",{ref:e=>this.pcmUploadRef=e,maxFileSize:15*1024*1024,multiple:false,mobileUploadAble:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设简历",file_size:0,ext:""}]:undefined,disabled:s,onUploadChange:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),o("div",{class:"jd-input-section"},o("label",null,"手机号(选填,填写后结果将通过短信发送)"),o("input",{type:"tel",class:"phone-input",placeholder:"请输入手机号",maxLength:11,value:this.phoneNumber,onInput:this.handlePhoneNumberChange})),this.phoneNumber.trim().length===11&&o("div",{class:"jd-input-section"},o("label",null,"验证码"),o("div",{class:"verification-code-container"},o("input",{type:"text",class:"verification-code-input",placeholder:"请输入验证码",maxLength:6,value:this.verificationCode,onInput:this.handleVerificationCodeChange}),o("button",{class:"send-code-button",disabled:this.isSendingCode||this.countdown>0||!this.phoneNumber.trim(),onClick:this.handleSendCode},this.isSendingCode?"发送中...":this.countdown>0?`${this.countdown}秒`:"发送验证码"))),o("button",{class:"submit-button",disabled:!s&&!this.uploadedFileInfo||this.isUploading||this.isSubmitting||this.isVerifyingCode,onClick:this.handleStartPlanning},this.isUploading?"上传中...":this.isVerifyingCode?"验证中...":this.isSubmitting?"处理中...":"开始规划"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018898",fullscreen:this.fullscreen,conversationId:this.conversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,type:this.selectedPlanType,phone:this.phoneNumber.trim()||undefined,...this.industryName?{industry_name:this.industryName}:{},...this.targetPosition||this.jobPosition?{target_position:this.targetPosition||this.jobPosition}:{},...this.timePeriod?{time_period:this.timePeriod}:{}},interviewMode:"text",onInterviewComplete:this.handlePlanningComplete}))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=c+(h+f);export{u as oem_zygh_modal};
|
|
2
|
+
//# sourceMappingURL=p-26c3bb94.entry.js.map
|