pcm-agents 0.3.0 → 0.3.2
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/LICENSE +21 -21
- package/dist/cjs/index-BFPEnLbS.js +195 -0
- package/dist/cjs/index-BFPEnLbS.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/my-component.cjs.entry.js +2 -2
- package/dist/cjs/my-component.cjs.entry.js.map +1 -1
- package/dist/cjs/my-component.entry.cjs.js.map +1 -1
- package/dist/cjs/pcm-agents.cjs.js +1 -1
- package/dist/cjs/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.cjs.js.map +1 -0
- package/dist/cjs/pcm-app-chat-modal_7.cjs.entry.js +6560 -0
- package/dist/cjs/pcm-app-chat-modal_7.cjs.entry.js.map +1 -0
- package/dist/cjs/pcm-chat-modal.cjs.entry.js +17 -32
- package/dist/cjs/pcm-chat-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/pcm-chat-modal.entry.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/my-component/my-component.css +3 -3
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +2 -1
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +137 -159
- package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.css +66 -12
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.js +106 -13
- package/dist/collection/components/pcm-chat-message/pcm-chat-message.js.map +1 -1
- package/dist/collection/components/pcm-chat-modal/pcm-chat-modal.js +39 -34
- package/dist/collection/components/pcm-chat-modal/pcm-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +76 -105
- package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.css +162 -0
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.js +616 -0
- package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.js.map +1 -0
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.css +0 -79
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +133 -81
- package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
- package/dist/collection/components/pcm-video-chat-modal/pcm-video-chat-modal.js +77 -101
- package/dist/collection/components/pcm-video-chat-modal/pcm-video-chat-modal.js.map +1 -1
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.css +273 -0
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js +613 -0
- package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js.map +1 -0
- package/dist/collection/global/global.css +324 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/interfaces/chat.js.map +1 -1
- package/dist/collection/utils/utils.js +54 -113
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.js +1298 -11280
- package/dist/components/index.js.map +1 -1
- package/dist/components/my-component.js +2 -3
- package/dist/components/my-component.js.map +1 -1
- package/dist/components/{p-C4l_DOnx.js → p-BctfuDvG.js} +106 -147
- package/dist/components/p-BctfuDvG.js.map +1 -0
- package/dist/components/{p-D0s1Q-3O.js → p-LkDC0SN2.js} +343 -16
- package/dist/components/p-LkDC0SN2.js.map +1 -0
- package/dist/components/pcm-app-chat-modal.js +1 -1
- package/dist/components/pcm-chat-message.js +1 -1
- package/dist/components/pcm-chat-modal.js +19 -34
- package/dist/components/pcm-chat-modal.js.map +1 -1
- package/dist/components/pcm-hr-chat-modal.js +70 -100
- package/dist/components/pcm-hr-chat-modal.js.map +1 -1
- package/dist/components/pcm-jlpx-modal.d.ts +11 -0
- package/dist/components/pcm-jlpx-modal.js +339 -0
- package/dist/components/pcm-jlpx-modal.js.map +1 -0
- package/dist/components/pcm-mnms-modal.js +109 -57
- package/dist/components/pcm-mnms-modal.js.map +1 -1
- package/dist/components/pcm-video-chat-modal.js +74 -99
- package/dist/components/pcm-video-chat-modal.js.map +1 -1
- package/dist/components/pcm-zygh-modal.d.ts +11 -0
- package/dist/components/pcm-zygh-modal.js +330 -0
- package/dist/components/pcm-zygh-modal.js.map +1 -0
- package/dist/esm/index-nVjZGfA8.js +189 -0
- package/dist/esm/index-nVjZGfA8.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/my-component.entry.js +2 -2
- package/dist/esm/my-component.entry.js.map +1 -1
- package/dist/esm/pcm-agents.js +1 -1
- package/dist/esm/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.js.map +1 -0
- package/dist/esm/pcm-app-chat-modal_7.entry.js +6552 -0
- package/dist/esm/pcm-app-chat-modal_7.entry.js.map +1 -0
- package/dist/esm/pcm-chat-modal.entry.js +17 -32
- package/dist/esm/pcm-chat-modal.entry.js.map +1 -1
- package/dist/pcm-agents/index.esm.js +1 -1
- package/dist/pcm-agents/my-component.entry.esm.js.map +1 -1
- package/dist/pcm-agents/p-55417392.entry.js +2 -0
- package/dist/pcm-agents/p-55417392.entry.js.map +1 -0
- package/dist/pcm-agents/p-a698b59f.entry.js +2 -0
- package/dist/pcm-agents/p-a698b59f.entry.js.map +1 -0
- package/dist/pcm-agents/p-f3ca99b4.entry.js +2 -0
- package/dist/pcm-agents/p-f3ca99b4.entry.js.map +1 -0
- package/dist/pcm-agents/p-nVjZGfA8.js +2 -0
- package/dist/pcm-agents/p-nVjZGfA8.js.map +1 -0
- package/dist/pcm-agents/pcm-agents.esm.js +1 -1
- package/dist/pcm-agents/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.esm.js.map +1 -0
- package/dist/pcm-agents/pcm-chat-modal.entry.esm.js.map +1 -1
- package/dist/types/components/pcm-app-chat-modal/pcm-app-chat-modal.d.ts +13 -8
- package/dist/types/components/pcm-chat-message/pcm-chat-message.d.ts +5 -0
- package/dist/types/components/pcm-chat-modal/pcm-chat-modal.d.ts +8 -8
- package/dist/types/components/pcm-hr-chat-modal/pcm-hr-chat-modal.d.ts +6 -12
- package/dist/types/components/pcm-jlpx-modal/pcm-jlpx-modal.d.ts +113 -0
- package/dist/types/components/pcm-mnms-modal/pcm-mnms-modal.d.ts +19 -20
- package/dist/types/components/pcm-video-chat-modal/pcm-video-chat-modal.d.ts +4 -4
- package/dist/types/components/pcm-zygh-modal/pcm-zygh-modal.d.ts +117 -0
- package/dist/types/components.d.ts +429 -80
- package/dist/types/interfaces/chat.d.ts +0 -4
- package/dist/types/utils/utils.d.ts +29 -83
- package/package.json +61 -60
- package/readme.md +307 -307
- package/dist/cjs/index-DfIUl99H.js +0 -11413
- package/dist/cjs/index-DfIUl99H.js.map +0 -1
- package/dist/cjs/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/pcm-app-chat-modal_3.cjs.entry.js +0 -3734
- package/dist/cjs/pcm-app-chat-modal_3.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +0 -1078
- package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-hr-chat-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/pcm-video-chat-modal.cjs.entry.js +0 -927
- package/dist/cjs/pcm-video-chat-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/pcm-video-chat-modal.entry.cjs.js.map +0 -1
- package/dist/components/p-C4l_DOnx.js.map +0 -1
- package/dist/components/p-CgDy4pJp.js +0 -1244
- package/dist/components/p-CgDy4pJp.js.map +0 -1
- package/dist/components/p-D0s1Q-3O.js.map +0 -1
- package/dist/esm/index-B2EtEi7v.js +0 -11409
- package/dist/esm/index-B2EtEi7v.js.map +0 -1
- package/dist/esm/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.js.map +0 -1
- package/dist/esm/pcm-app-chat-modal_3.entry.js +0 -3730
- package/dist/esm/pcm-app-chat-modal_3.entry.js.map +0 -1
- package/dist/esm/pcm-hr-chat-modal.entry.js +0 -1076
- package/dist/esm/pcm-hr-chat-modal.entry.js.map +0 -1
- package/dist/esm/pcm-video-chat-modal.entry.js +0 -925
- package/dist/esm/pcm-video-chat-modal.entry.js.map +0 -1
- package/dist/pcm-agents/p-0ddd5c47.entry.js +0 -2
- package/dist/pcm-agents/p-0ddd5c47.entry.js.map +0 -1
- package/dist/pcm-agents/p-5f624943.entry.js +0 -2
- package/dist/pcm-agents/p-5f624943.entry.js.map +0 -1
- package/dist/pcm-agents/p-6c07f155.entry.js +0 -2
- package/dist/pcm-agents/p-6c07f155.entry.js.map +0 -1
- package/dist/pcm-agents/p-9a1fb6ca.entry.js +0 -2
- package/dist/pcm-agents/p-9a1fb6ca.entry.js.map +0 -1
- package/dist/pcm-agents/p-B2EtEi7v.js +0 -146
- package/dist/pcm-agents/p-B2EtEi7v.js.map +0 -1
- package/dist/pcm-agents/p-e21bc169.entry.js +0 -2
- package/dist/pcm-agents/p-e21bc169.entry.js.map +0 -1
- package/dist/pcm-agents/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.esm.js.map +0 -1
- package/dist/pcm-agents/pcm-hr-chat-modal.entry.esm.js.map +0 -1
- package/dist/pcm-agents/pcm-video-chat-modal.entry.esm.js.map +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent, h } from './
|
|
2
|
-
import { d as defineCustomElement$3 } from './p-
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, u as uploadFileToBackend, a as sendHttpRequest, h } from './index.js';
|
|
2
|
+
import { d as defineCustomElement$3 } from './p-BctfuDvG.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-LkDC0SN2.js';
|
|
4
4
|
|
|
5
|
-
const pcmMnmsModalCss = ":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:500px;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.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}.pc-layout{width:80%;max-width:500px;min-width:320px}.mobile-layout{width:100%;height:100%;border-radius:0}@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);margin-top:40px;height:calc(100% - 40px);max-height:calc(100% - 40px);border-radius:16px 16px 0 0}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}}.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-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-container{padding:30px 20px;display:flex;flex-direction:column;align-items:center;text-align:center;height:calc(100% - 60px);transition:opacity 0.5s ease-out}.upload-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333}.
|
|
5
|
+
const pcmMnmsModalCss = ":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:500px;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.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}.pc-layout{width:80%;max-width:500px;min-width:320px}.mobile-layout{width:100%;height:100%;border-radius:0}@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);margin-top:40px;height:calc(100% - 40px);max-height:calc(100% - 40px);border-radius:16px 16px 0 0}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}}.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-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-container{padding:30px 20px;display:flex;flex-direction:column;align-items:center;text-align:center;height:calc(100% - 60px);transition:opacity 0.5s ease-out}.upload-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333}.submit-button{max-width:400px}.file-input{display:none}.transitioning{position:relative;overflow:hidden}.fade-out{opacity:0.7;transition:opacity 0.5s ease-out}.transition-container{margin-top:20px;width:100%}.progress-bar{width:100%;height:6px;background-color:#f0f0f0;border-radius:3px;overflow:hidden;margin-bottom:10px}.progress-fill{height:100%;background-color:#4285f4;transition:width 0.3s ease-out}.upload-container.fade-out{opacity:0;transform:translateY(-20px);transition:opacity 0.3s ease, transform 0.3s ease}.chat-modal-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column}.modal-container{position:relative;overflow:hidden}";
|
|
6
|
+
|
|
7
|
+
const globalCss = ".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;z-index:1000;overflow-y:auto;padding:20px}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7)}.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:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.pc-layout{width:80%;max-width:500px;min-width:320px}.mobile-layout{width:100%;height:100%;border-radius:0}@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);margin-top:40px;height:calc(100% - 40px);max-height:calc(100% - 40px);border-radius:16px 16px 0 0}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}}.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-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{border:2px dashed #ddd;border-radius:8px;cursor:pointer;transition:all 0.3s ease;margin-bottom:20px;width:100%}.upload-area:hover{border-color:#1890ff;background-color:rgba(24, 144, 255, 0.05)}.upload-placeholder{display:flex;flex-direction:column;align-items:center;color:#666}.upload-placeholder svg{color:#1890ff;margin-bottom:8px}.upload-placeholder p{margin:4px 0}.upload-hint{font-size:0.8rem;color:#999;margin-top:0.5rem}.file-info{display:flex;align-items:center;justify-content:space-between;padding:8px;background:#f9f9f9;border:1px solid #e8e8e8;border-radius:4px}.file-info span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 30px)}.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}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);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:100%;border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.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;align-items:center}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333;align-self:flex-start}.submit-button{margin-top:10px;padding:10px 30px;background:#1890ff;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:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.chat-modal-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column}";
|
|
6
8
|
|
|
7
9
|
const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
8
10
|
constructor() {
|
|
@@ -14,15 +16,16 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
14
16
|
this.streamComplete = createEvent(this, "streamComplete");
|
|
15
17
|
this.conversationStart = createEvent(this, "conversationStart");
|
|
16
18
|
this.interviewComplete = createEvent(this, "interviewComplete");
|
|
19
|
+
this.apiKeyInvalid = createEvent(this, "apiKeyInvalid");
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* 模态框标题
|
|
20
23
|
*/
|
|
21
|
-
modalTitle = '
|
|
24
|
+
modalTitle = '模拟面试';
|
|
22
25
|
/**
|
|
23
26
|
* API鉴权密钥
|
|
24
27
|
*/
|
|
25
|
-
|
|
28
|
+
token = '';
|
|
26
29
|
/**
|
|
27
30
|
* 是否显示聊天模态框
|
|
28
31
|
*/
|
|
@@ -48,7 +51,7 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
48
51
|
*/
|
|
49
52
|
isNeedClose = true;
|
|
50
53
|
/**
|
|
51
|
-
* 会话ID
|
|
54
|
+
* 会话ID,传入继续对话,否则创建新会话
|
|
52
55
|
*/
|
|
53
56
|
conversationId;
|
|
54
57
|
/**
|
|
@@ -56,15 +59,11 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
56
59
|
*/
|
|
57
60
|
defaultQuery = '';
|
|
58
61
|
/**
|
|
59
|
-
*
|
|
62
|
+
* 是否以全屏模式打开,移动端建议设置为true
|
|
60
63
|
*/
|
|
61
64
|
fullscreen = false;
|
|
62
65
|
/**
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
isMobile = false;
|
|
66
|
-
/**
|
|
67
|
-
* 自定义输入参数
|
|
66
|
+
* 自定义输入参数,传入job_info时,会隐藏JD输入区域
|
|
68
67
|
*/
|
|
69
68
|
customInputs = {};
|
|
70
69
|
/**
|
|
@@ -83,6 +82,10 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
83
82
|
* 当聊天完成时触发
|
|
84
83
|
*/
|
|
85
84
|
interviewComplete;
|
|
85
|
+
/**
|
|
86
|
+
* API密钥验证失败事件
|
|
87
|
+
*/
|
|
88
|
+
apiKeyInvalid;
|
|
86
89
|
selectedFile = null;
|
|
87
90
|
isUploading = false;
|
|
88
91
|
uploadedFileInfo = null;
|
|
@@ -91,6 +94,8 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
91
94
|
isTransitioning = false;
|
|
92
95
|
transitionTimer = null;
|
|
93
96
|
get hostElement() { return this; }
|
|
97
|
+
jobDescription = '';
|
|
98
|
+
isSubmitting = false;
|
|
94
99
|
handleClose = () => {
|
|
95
100
|
this.isOpen = false;
|
|
96
101
|
this.modalClosed.emit();
|
|
@@ -118,29 +123,12 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
118
123
|
return;
|
|
119
124
|
this.isUploading = true;
|
|
120
125
|
try {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
method: 'POST',
|
|
125
|
-
headers: {
|
|
126
|
-
'authorization': 'Bearer ' + this.apiKey
|
|
127
|
-
},
|
|
128
|
-
body: formData
|
|
126
|
+
// 使用 uploadFileToBackend 工具函数上传文件
|
|
127
|
+
const result = await uploadFileToBackend(this.selectedFile, {
|
|
128
|
+
'authorization': 'Bearer ' + this.token
|
|
129
129
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
throw new Error(result.message || '文件上传失败');
|
|
133
|
-
}
|
|
134
|
-
if (result) {
|
|
135
|
-
this.uploadedFileInfo = {
|
|
136
|
-
cos_key: result.cos_key,
|
|
137
|
-
filename: result.filename,
|
|
138
|
-
ext: result.ext,
|
|
139
|
-
presigned_url: result.presigned_url
|
|
140
|
-
};
|
|
141
|
-
// 触发上传成功事件
|
|
142
|
-
this.uploadSuccess.emit(this.uploadedFileInfo);
|
|
143
|
-
}
|
|
130
|
+
this.uploadedFileInfo = result;
|
|
131
|
+
this.uploadSuccess.emit(result);
|
|
144
132
|
}
|
|
145
133
|
catch (error) {
|
|
146
134
|
console.error('文件上传错误:', error);
|
|
@@ -151,39 +139,73 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
151
139
|
this.isUploading = false;
|
|
152
140
|
}
|
|
153
141
|
}
|
|
142
|
+
handleJobDescriptionChange = (event) => {
|
|
143
|
+
const textarea = event.target;
|
|
144
|
+
this.jobDescription = textarea.value;
|
|
145
|
+
};
|
|
154
146
|
handleStartInterview = async () => {
|
|
155
147
|
if (!this.selectedFile) {
|
|
156
148
|
alert('请上传简历');
|
|
157
149
|
return;
|
|
158
150
|
}
|
|
159
|
-
//
|
|
160
|
-
if (!this.
|
|
161
|
-
|
|
151
|
+
// 如果没有预设的job_info,则需要检查用户输入
|
|
152
|
+
if (!this.customInputs?.job_info && !this.jobDescription.trim()) {
|
|
153
|
+
alert('请输入职位描述');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
this.isSubmitting = true;
|
|
157
|
+
try {
|
|
158
|
+
// 如果还没上传,先上传文件
|
|
162
159
|
if (!this.uploadedFileInfo) {
|
|
163
|
-
|
|
160
|
+
await this.uploadFile();
|
|
161
|
+
if (!this.uploadedFileInfo) {
|
|
162
|
+
this.isSubmitting = false;
|
|
163
|
+
return; // 上传失败
|
|
164
|
+
}
|
|
164
165
|
}
|
|
166
|
+
// 使用预设的job_info或用户输入的jobDescription
|
|
167
|
+
const jobInfo = this.customInputs?.job_info || this.jobDescription;
|
|
168
|
+
console.log('传递的customInputs:', {
|
|
169
|
+
...this.customInputs,
|
|
170
|
+
file_url: this.uploadedFileInfo.cos_key,
|
|
171
|
+
job_info: jobInfo
|
|
172
|
+
});
|
|
173
|
+
// 直接显示聊天模态框
|
|
174
|
+
this.showChatModal = true;
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
console.error('开始面试时出错:', error);
|
|
178
|
+
alert('开始面试时出错,请重试');
|
|
179
|
+
}
|
|
180
|
+
finally {
|
|
181
|
+
this.isSubmitting = false;
|
|
165
182
|
}
|
|
166
|
-
console.log('传递的customInputs:', {
|
|
167
|
-
...this.customInputs,
|
|
168
|
-
file_url: this.uploadedFileInfo.cos_key
|
|
169
|
-
});
|
|
170
|
-
// 直接显示聊天模态框,不使用过渡动画
|
|
171
|
-
this.showChatModal = true;
|
|
172
183
|
};
|
|
173
184
|
handleIsOpenChange(newValue) {
|
|
174
185
|
if (!newValue) {
|
|
175
186
|
// 重置状态
|
|
176
187
|
this.clearSelectedFile();
|
|
177
188
|
this.showChatModal = false;
|
|
189
|
+
this.jobDescription = '';
|
|
178
190
|
// 清除可能存在的计时器
|
|
179
191
|
if (this.transitionTimer) {
|
|
180
192
|
clearTimeout(this.transitionTimer);
|
|
181
193
|
this.transitionTimer = null;
|
|
182
194
|
}
|
|
183
195
|
}
|
|
184
|
-
else
|
|
185
|
-
//
|
|
186
|
-
this.
|
|
196
|
+
else {
|
|
197
|
+
// 当模态框打开时,验证API密钥
|
|
198
|
+
this.verifyApiKey();
|
|
199
|
+
if (this.conversationId) {
|
|
200
|
+
// 如果有会话ID,直接显示聊天模态框
|
|
201
|
+
this.showChatModal = true;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
componentWillLoad() {
|
|
206
|
+
// 检查 customInputs 中是否有 job_info
|
|
207
|
+
if (this.customInputs && this.customInputs.job_info) {
|
|
208
|
+
this.jobDescription = this.customInputs.job_info;
|
|
187
209
|
}
|
|
188
210
|
}
|
|
189
211
|
// 处理流式输出完成事件
|
|
@@ -199,6 +221,33 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
199
221
|
handleInterviewComplete = (event) => {
|
|
200
222
|
this.interviewComplete.emit(event.detail);
|
|
201
223
|
};
|
|
224
|
+
/**
|
|
225
|
+
* 验证API密钥
|
|
226
|
+
*/
|
|
227
|
+
async verifyApiKey() {
|
|
228
|
+
if (!this.token) {
|
|
229
|
+
this.apiKeyInvalid.emit();
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
try {
|
|
233
|
+
const response = await sendHttpRequest({
|
|
234
|
+
url: '/sdk/v1/user',
|
|
235
|
+
method: 'GET',
|
|
236
|
+
headers: {
|
|
237
|
+
'Authorization': `Bearer ${this.token}`
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
if (!response.success) {
|
|
241
|
+
throw new Error(response.message || 'API密钥验证失败');
|
|
242
|
+
}
|
|
243
|
+
// 验证成功,继续正常流程
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
console.error('API密钥验证错误:', error);
|
|
247
|
+
// 通知父组件API密钥无效
|
|
248
|
+
this.apiKeyInvalid.emit();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
202
251
|
render() {
|
|
203
252
|
if (!this.isOpen)
|
|
204
253
|
return null;
|
|
@@ -209,8 +258,7 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
209
258
|
const containerClass = {
|
|
210
259
|
'modal-container': true,
|
|
211
260
|
'fullscreen': this.fullscreen,
|
|
212
|
-
'pc-layout':
|
|
213
|
-
'mobile-layout': this.isMobile
|
|
261
|
+
'pc-layout': true,
|
|
214
262
|
};
|
|
215
263
|
const overlayClass = {
|
|
216
264
|
'modal-overlay': true,
|
|
@@ -220,21 +268,24 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
220
268
|
if (this.conversationId && !this.showChatModal) {
|
|
221
269
|
this.showChatModal = true;
|
|
222
270
|
}
|
|
223
|
-
|
|
271
|
+
// 修正这里的逻辑,确保当 customInputs.job_info 存在时,hideJdInput 为 true
|
|
272
|
+
const hideJdInput = Boolean(this.customInputs && this.customInputs.job_info);
|
|
273
|
+
return (h("div", { class: overlayClass, style: modalStyle }, h("div", { class: containerClass }, this.isShowHeader && (h("div", { class: "modal-header" }, h("div", { class: "header-left" }, this.icon && h("img", { src: this.icon, class: "header-icon", alt: "\u5E94\u7528\u56FE\u6807" }), h("div", null, this.modalTitle)), this.isNeedClose && (h("button", { class: "close-button", onClick: this.handleClose }, h("span", null, "\u00D7"))))), !this.showChatModal && !this.conversationId && (h("div", { class: "input-container" }, !hideJdInput && (h("div", { class: "jd-input-section" }, h("label", { htmlFor: "job-description" }, "\u8BF7\u8F93\u5165\u804C\u4F4D\u63CF\u8FF0 (JD)"), h("textarea", { id: "job-description", class: "job-description-textarea", placeholder: "\u8BF7\u8F93\u5165\u804C\u4F4D\u63CF\u8FF0\uFF0C\u5305\u62EC\u804C\u8D23\u3001\u8981\u6C42\u7B49\u4FE1\u606F...", rows: 6, value: this.jobDescription, onInput: this.handleJobDescriptionChange }))), h("div", { class: "resume-upload-section" }, h("label", null, "\u4E0A\u4F20\u7B80\u5386"), h("div", { class: "upload-area", onClick: this.handleUploadClick }, this.selectedFile ? (h("div", { class: "file-info" }, h("span", null, this.selectedFile.name), h("button", { class: "remove-file", onClick: (e) => {
|
|
224
274
|
e.stopPropagation();
|
|
225
275
|
this.clearSelectedFile();
|
|
226
|
-
} }, "\u00D7"))) : (h("div", { class: "upload-placeholder" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", width: "48", height: "48" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M12 4v16m0-16l-4 4m4-4l4 4" })), h("p", null, "\u70B9\u51FB\u4E0A\u4F20\u7B80\u5386"), h("p", { class: "upload-hint" }, "\u652F\u6301 txt\
|
|
276
|
+
} }, "\u00D7"))) : (h("div", { class: "upload-placeholder" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", width: "48", height: "48" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M12 4v16m0-16l-4 4m4-4l4 4" })), h("p", null, "\u70B9\u51FB\u4E0A\u4F20\u7B80\u5386"), h("p", { class: "upload-hint" }, "\u652F\u6301 txt\u3001markdown\u3001pdf\u3001docx\u3001md \u683C\u5F0F"))))), h("button", { class: "submit-button", disabled: !this.selectedFile || (!hideJdInput && !this.jobDescription.trim()) || this.isUploading || this.isSubmitting, onClick: this.handleStartInterview }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始分析'), h("input", { type: "file", class: "file-input", onChange: this.handleFileChange, accept: ".pdf,.doc,.docx,.txt,.md" }))), this.showChatModal && (h("div", { class: "chat-modal-container" }, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, token: this.token, isShowHeader: this.isShowHeader, isNeedClose: this.isShowHeader, zIndex: this.zIndex, fullscreen: this.fullscreen, botId: "3022316191018884", conversationId: this.conversationId, defaultQuery: this.defaultQuery, enableVoice: false, customInputs: this.conversationId ? undefined : {
|
|
227
277
|
...this.customInputs,
|
|
228
|
-
file_url: this.uploadedFileInfo?.cos_key
|
|
278
|
+
file_url: this.uploadedFileInfo?.cos_key,
|
|
279
|
+
job_info: this.customInputs?.job_info || this.jobDescription
|
|
229
280
|
}, interviewMode: "text", onModalClosed: this.handleClose, onStreamComplete: this.handleStreamComplete, onConversationStart: this.handleConversationStart, onInterviewComplete: this.handleInterviewComplete }))))));
|
|
230
281
|
}
|
|
231
282
|
static get watchers() { return {
|
|
232
283
|
"isOpen": ["handleIsOpenChange"]
|
|
233
284
|
}; }
|
|
234
|
-
static get style() { return pcmMnmsModalCss; }
|
|
285
|
+
static get style() { return pcmMnmsModalCss + globalCss; }
|
|
235
286
|
}, [1, "pcm-mnms-modal", {
|
|
236
287
|
"modalTitle": [1, "modal-title"],
|
|
237
|
-
"
|
|
288
|
+
"token": [1],
|
|
238
289
|
"isOpen": [1028, "is-open"],
|
|
239
290
|
"icon": [1],
|
|
240
291
|
"zIndex": [2, "z-index"],
|
|
@@ -243,14 +294,15 @@ const MnmsModal = /*@__PURE__*/ proxyCustomElement(class MnmsModal extends H {
|
|
|
243
294
|
"conversationId": [1025, "conversation-id"],
|
|
244
295
|
"defaultQuery": [1, "default-query"],
|
|
245
296
|
"fullscreen": [4],
|
|
246
|
-
"isMobile": [4, "is-mobile"],
|
|
247
297
|
"customInputs": [16],
|
|
248
298
|
"selectedFile": [32],
|
|
249
299
|
"isUploading": [32],
|
|
250
300
|
"uploadedFileInfo": [32],
|
|
251
301
|
"showChatModal": [32],
|
|
252
302
|
"isTransitioning": [32],
|
|
253
|
-
"transitionTimer": [32]
|
|
303
|
+
"transitionTimer": [32],
|
|
304
|
+
"jobDescription": [32],
|
|
305
|
+
"isSubmitting": [32]
|
|
254
306
|
}, undefined, {
|
|
255
307
|
"isOpen": ["handleIsOpenChange"]
|
|
256
308
|
}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pcm-mnms-modal.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,6rHAA6rH;;MCOxsH,SAAS,iBAAAA,kBAAA,CAAA,MAAA,SAAA,SAAAC,CAAA,CAAA;;;;;;;;;;;AAClB;;AAEG;IACK,UAAU,GAAW,MAAM;AAEnC;;AAEG;IAC6B,MAAM,GAAW,EAAE;AAEnD;;AAEG;IACsB,MAAM,GAAY,KAAK;AAEhD;;AAEG;AACM,IAAA,WAAW;AAEpB;;AAEG;AACK,IAAA,IAAI;AAEZ;;AAEG;IACK,MAAM,GAAY,IAAI;AAE9B;;AAEG;IACK,YAAY,GAAY,IAAI;AAEpC;;AAEG;IACK,WAAW,GAAY,IAAI;AAEnC;;AAEG;AACsB,IAAA,cAAc;AAEvC;;AAEG;IACK,YAAY,GAAW,EAAE;AAEjC;;AAEG;IACK,UAAU,GAAY,KAAK;AAEnC;;AAEG;IACK,QAAQ,GAAY,KAAK;AAEjC;;AAEG;IACK,YAAY,GAA2B,EAAE;AAEjD;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],"sources":["src/components/pcm-mnms-modal/pcm-mnms-modal.css?tag=pcm-mnms-modal&encapsulation=shadow","src/components/pcm-mnms-modal/pcm-mnms-modal.tsx"],"sourcesContent":[":host {\r\n display: block;\r\n}\r\n\r\n.modal-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n overflow-y: auto;\r\n padding: 20px;\r\n z-index: 1000;\r\n}\r\n\r\n/* 全屏模式下取消 padding */\r\n.fullscreen-overlay {\r\n padding: 0;\r\n}\r\n\r\n.modal-container {\r\n background: white;\r\n border-radius: 8px;\r\n width: 100%;\r\n max-width: 500px;\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n margin: auto;\r\n transition: all 0.3s ease-out;\r\n overflow: hidden;\r\n}\r\n\r\n/* 全屏模式样式 */\r\n.modal-container.fullscreen {\r\n width: 100vw;\r\n max-width: none;\r\n height: 100%;\r\n border-radius: 0;\r\n margin: 0;\r\n display: flex;\r\n flex-direction: column;\r\n height: 100vh;\r\n max-height: 100vh;\r\n}\r\n\r\n/* PC端布局 */\r\n.pc-layout {\r\n width: 80%;\r\n max-width: 500px;\r\n min-width: 320px;\r\n}\r\n\r\n/* 移动端布局 */\r\n.mobile-layout {\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 0;\r\n}\r\n\r\n/* 响应式布局 */\r\n@media screen and (max-width: 768px) {\r\n .pc-layout {\r\n width: 95%;\r\n }\r\n\r\n .modal-overlay {\r\n padding: 0;\r\n }\r\n\r\n .modal-container.fullscreen {\r\n /* 支持 iOS Safari */\r\n height: -webkit-fill-available;\r\n max-height: -webkit-fill-available;\r\n /* 确保内容不会被顶部状态栏和底部工具栏遮挡 */\r\n padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);\r\n margin-top: 40px;\r\n height: calc(100% - 40px);\r\n max-height: calc(100% - 40px);\r\n border-radius: 16px 16px 0 0;\r\n }\r\n\r\n .modal-container.mobile-layout {\r\n width: 100%;\r\n height: 100vh;\r\n max-height: 100vh;\r\n min-height: 100vh;\r\n border-radius: 0;\r\n margin: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n}\r\n\r\n.modal-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 4px 16px;\r\n height: 50px;\r\n border-bottom: 1px solid #e8e8e8;\r\n flex-shrink: 0; /* 防止头部被压缩 */\r\n}\r\n\r\n.header-left {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n}\r\n\r\n.header-icon {\r\n width: 24px;\r\n height: 24px;\r\n}\r\n\r\n.close-button {\r\n background: transparent;\r\n border: none;\r\n cursor: pointer;\r\n padding: 8px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n border-radius: 4px;\r\n}\r\n\r\n.close-button:hover {\r\n background-color: rgba(0, 0, 0, 0.04);\r\n}\r\n\r\n.close-button span {\r\n font-size: 24px;\r\n line-height: 1;\r\n color: #999;\r\n}\r\n\r\n.close-button:hover span {\r\n color: #666;\r\n}\r\n\r\n.upload-container {\r\n padding: 30px 20px;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n text-align: center;\r\n height: calc(100% - 60px); /* 减去header高度 */\r\n transition: opacity 0.5s ease-out;\r\n}\r\n\r\n.upload-container h3 {\r\n margin-top: 0;\r\n margin-bottom: 20px;\r\n font-size: 18px;\r\n color: #333;\r\n}\r\n\r\n.upload-area {\r\n border: 2px dashed #ddd;\r\n border-radius: 8px;\r\n width: 100%;\r\n max-width: 400px;\r\n cursor: pointer;\r\n transition: all 0.3s ease;\r\n margin-bottom: 20px;\r\n}\r\n\r\n.upload-area:hover {\r\n border-color: #1890ff;\r\n background-color: rgba(24, 144, 255, 0.05);\r\n}\r\n\r\n.upload-placeholder {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n color: #666;\r\n}\r\n\r\n.upload-hint {\r\n font-size: 0.8rem;\r\n color: #999;\r\n margin-top: 0.5rem;\r\n}\r\n\r\n.file-info {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n padding: 8px;\r\n background: #f9f9f9;\r\n border: 1px solid #e8e8e8;\r\n border-radius: 4px;\r\n}\r\n\r\n.file-info span {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n max-width: calc(100% - 30px);\r\n}\r\n\r\n.remove-file {\r\n background: transparent;\r\n border: none;\r\n color: #999;\r\n cursor: pointer;\r\n padding: 4px 8px;\r\n font-size: 16px;\r\n line-height: 1;\r\n border-radius: 4px;\r\n transition: all 0.2s;\r\n}\r\n\r\n.remove-file:hover {\r\n background-color: #f0f0f0;\r\n color: #666;\r\n}\r\n\r\n.submit-button {\r\n margin-top: 10px;\r\n padding: 10px 30px;\r\n background: #1890ff;\r\n color: white;\r\n border: none;\r\n border-radius: 4px;\r\n font-size: 16px;\r\n cursor: pointer;\r\n transition: all 0.3s ease;\r\n width: 100%;\r\n max-width: 400px;\r\n}\r\n\r\n.submit-button:disabled {\r\n background: #ccc;\r\n cursor: not-allowed;\r\n}\r\n\r\n.submit-button:hover:not(:disabled) {\r\n background: #40a9ff;\r\n}\r\n\r\n.file-input {\r\n display: none;\r\n}\r\n\r\n.transitioning {\r\n position: relative;\r\n overflow: hidden;\r\n}\r\n\r\n.fade-out {\r\n opacity: 0.7;\r\n transition: opacity 0.5s ease-out;\r\n}\r\n\r\n.transition-container {\r\n margin-top: 20px;\r\n width: 100%;\r\n}\r\n\r\n.progress-bar {\r\n width: 100%;\r\n height: 6px;\r\n background-color: #f0f0f0;\r\n border-radius: 3px;\r\n overflow: hidden;\r\n margin-bottom: 10px;\r\n}\r\n\r\n.progress-fill {\r\n height: 100%;\r\n background-color: #4285f4;\r\n transition: width 0.3s ease-out;\r\n}\r\n\r\n/* 淡出动画 */\r\n.upload-container.fade-out {\r\n opacity: 0;\r\n transform: translateY(-20px);\r\n transition: opacity 0.3s ease, transform 0.3s ease;\r\n}\r\n\r\n/* 淡入动画 */\r\n.chat-modal-container {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n/* 确保容器有相对定位,以便绝对定位的子元素能够正确定位 */\r\n.modal-container {\r\n position: relative;\r\n overflow: hidden;\r\n} ","import { Component, Prop, h, State, Element, Event, EventEmitter, Watch } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'pcm-mnms-modal',\r\n styleUrl: 'pcm-mnms-modal.css',\r\n shadow: true,\r\n})\r\nexport class MnmsModal {\r\n /**\r\n * 模态框标题\r\n */\r\n @Prop() modalTitle: string = '在线客服';\r\n\r\n /**\r\n * API鉴权密钥\r\n */\r\n @Prop({ attribute: 'api-key' }) apiKey: string = '';\r\n\r\n /**\r\n * 是否显示聊天模态框\r\n */\r\n @Prop({ mutable: true }) isOpen: boolean = false;\r\n\r\n /**\r\n * 当点击模态框关闭时触发\r\n */\r\n @Event() modalClosed: EventEmitter<void>;\r\n\r\n /**\r\n * 应用图标URL\r\n */\r\n @Prop() icon?: string;\r\n\r\n /**\r\n * 聊天框的页面层级\r\n */\r\n @Prop() zIndex?: number = 1000;\r\n\r\n /**\r\n * 是否展示顶部标题栏\r\n */\r\n @Prop() isShowHeader: boolean = true;\r\n\r\n /**\r\n * 是否展示右上角的关闭按钮\r\n */\r\n @Prop() isNeedClose: boolean = true;\r\n\r\n /**\r\n * 会话ID\r\n */\r\n @Prop({ mutable: true }) conversationId?: string;\r\n\r\n /**\r\n * 默认查询文本\r\n */\r\n @Prop() defaultQuery: string = '';\r\n\r\n /**\r\n * 是否以全屏模式打开\r\n */\r\n @Prop() fullscreen: boolean = false;\r\n\r\n /**\r\n * 是否为移动端布局\r\n */\r\n @Prop() isMobile: boolean = false;\r\n\r\n /**\r\n * 自定义输入参数\r\n */\r\n @Prop() customInputs: { [key: string]: any } = {};\r\n\r\n /**\r\n * 上传成功事件\r\n */\r\n @Event() uploadSuccess: EventEmitter<{\r\n cos_key: string;\r\n filename: string;\r\n ext: string;\r\n presigned_url: string;\r\n }>;\r\n\r\n /**\r\n * 流式输出完成事件\r\n */\r\n @Event() streamComplete: EventEmitter<{\r\n conversation_id: string;\r\n event: string;\r\n message_id: string;\r\n id: string;\r\n }>;\r\n\r\n /**\r\n * 新会话开始的回调,只会在一轮对话开始时触发一次\r\n */\r\n @Event() conversationStart: EventEmitter<{\r\n conversation_id: string;\r\n event: string;\r\n message_id: string;\r\n id: string;\r\n }>;\r\n\r\n /**\r\n * 当聊天完成时触发\r\n */\r\n @Event() interviewComplete: EventEmitter<{\r\n conversation_id: string;\r\n total_questions: number;\r\n }>;\r\n\r\n\r\n @State() selectedFile: File | null = null;\r\n @State() isUploading: boolean = false;\r\n @State() uploadedFileInfo: { cos_key: string, filename: string, ext: string, presigned_url: string } | null = null;\r\n @State() showChatModal: boolean = false;\r\n\r\n // 添加新的状态来控制过渡动画\r\n @State() isTransitioning: boolean = false;\r\n @State() transitionTimer: any = null;\r\n\r\n // 使用 @Element 装饰器获取组件的 host 元素\r\n @Element() hostElement: HTMLElement;\r\n\r\n private handleClose = () => {\r\n this.isOpen = false;\r\n this.modalClosed.emit();\r\n };\r\n\r\n private handleFileChange = (event: Event) => {\r\n const input = event.target as HTMLInputElement;\r\n if (input.files && input.files.length > 0) {\r\n this.selectedFile = input.files[0];\r\n }\r\n };\r\n\r\n private handleUploadClick = () => {\r\n const fileInput = this.hostElement.shadowRoot?.querySelector('.file-input') as HTMLInputElement;\r\n fileInput?.click();\r\n };\r\n\r\n private clearSelectedFile = () => {\r\n this.selectedFile = null;\r\n this.uploadedFileInfo = null;\r\n const fileInput = this.hostElement.shadowRoot?.querySelector('.file-input') as HTMLInputElement;\r\n if (fileInput) {\r\n fileInput.value = '';\r\n }\r\n };\r\n\r\n private async uploadFile() {\r\n if (!this.selectedFile) return;\r\n\r\n this.isUploading = true;\r\n\r\n try {\r\n const formData = new FormData();\r\n formData.append('file', this.selectedFile);\r\n\r\n const response = await fetch('https://pcm_api.ylzhaopin.com/external/v1/files/upload', {\r\n method: 'POST',\r\n headers: {\r\n 'authorization': 'Bearer ' + this.apiKey\r\n },\r\n body: formData\r\n });\r\n\r\n const result = await response.json();\r\n if (!response.ok) {\r\n throw new Error(result.message || '文件上传失败');\r\n }\r\n\r\n if (result) {\r\n this.uploadedFileInfo = {\r\n cos_key: result.cos_key,\r\n filename: result.filename,\r\n ext: result.ext,\r\n presigned_url: result.presigned_url\r\n };\r\n\r\n // 触发上传成功事件\r\n this.uploadSuccess.emit(this.uploadedFileInfo);\r\n }\r\n } catch (error) {\r\n console.error('文件上传错误:', error);\r\n this.clearSelectedFile();\r\n alert(error instanceof Error ? error.message : '文件上传失败,请重试');\r\n } finally {\r\n this.isUploading = false;\r\n }\r\n }\r\n\r\n private handleStartInterview = async () => {\r\n if (!this.selectedFile) {\r\n alert('请上传简历');\r\n return;\r\n }\r\n\r\n // 如果还没上传,先上传文件\r\n if (!this.uploadedFileInfo) {\r\n await this.uploadFile();\r\n if (!this.uploadedFileInfo) {\r\n return; // 上传失败\r\n }\r\n }\r\n\r\n console.log('传递的customInputs:', {\r\n ...this.customInputs,\r\n file_url: this.uploadedFileInfo.cos_key\r\n });\r\n\r\n // 直接显示聊天模态框,不使用过渡动画\r\n this.showChatModal = true;\r\n };\r\n\r\n @Watch('isOpen')\r\n handleIsOpenChange(newValue: boolean) {\r\n if (!newValue) {\r\n // 重置状态\r\n this.clearSelectedFile();\r\n this.showChatModal = false;\r\n \r\n // 清除可能存在的计时器\r\n if (this.transitionTimer) {\r\n clearTimeout(this.transitionTimer);\r\n this.transitionTimer = null;\r\n }\r\n } else if (this.conversationId) {\r\n // 如果有会话ID,直接显示聊天模态框\r\n this.showChatModal = true;\r\n }\r\n }\r\n\r\n // 处理流式输出完成事件\r\n private handleStreamComplete = (event: CustomEvent) => {\r\n // 将事件转发出去\r\n this.streamComplete.emit(event.detail);\r\n };\r\n\r\n // 处理会话开始事件\r\n private handleConversationStart = (event: CustomEvent) => {\r\n this.conversationStart.emit(event.detail);\r\n };\r\n\r\n // 处理面试完成事件\r\n private handleInterviewComplete = (event: CustomEvent) => {\r\n this.interviewComplete.emit(event.detail);\r\n };\r\n\r\n\r\n render() {\r\n if (!this.isOpen) return null;\r\n\r\n const modalStyle = {\r\n zIndex: String(this.zIndex)\r\n };\r\n\r\n console.log('showChatModal:', this.showChatModal);\r\n\r\n const containerClass = {\r\n 'modal-container': true,\r\n 'fullscreen': this.fullscreen,\r\n 'pc-layout': !this.isMobile,\r\n 'mobile-layout': this.isMobile\r\n };\r\n \r\n const overlayClass = {\r\n 'modal-overlay': true,\r\n 'fullscreen-overlay': this.fullscreen\r\n };\r\n\r\n // 检查是否有会话ID,如果有则直接显示聊天模态框\r\n if (this.conversationId && !this.showChatModal) {\r\n this.showChatModal = true;\r\n }\r\n\r\n return (\r\n <div class={overlayClass} style={modalStyle}>\r\n <div class={containerClass}>\r\n {this.isShowHeader && (\r\n <div class=\"modal-header\">\r\n <div class=\"header-left\">\r\n {this.icon && <img src={this.icon} class=\"header-icon\" alt=\"应用图标\" />}\r\n <div>{this.modalTitle}</div>\r\n </div>\r\n {this.isNeedClose && (\r\n <button class=\"close-button\" onClick={this.handleClose}>\r\n <span>×</span>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* 上传界面 - 仅在不显示聊天模态框且没有会话ID时显示 */}\r\n {!this.showChatModal && !this.conversationId && (\r\n <div class=\"upload-container\">\r\n <h3>开始前,请上传您的简历</h3>\r\n <div class=\"upload-area\" onClick={this.handleUploadClick}>\r\n {this.selectedFile ? (\r\n <div class=\"file-info\">\r\n <span>{this.selectedFile.name}</span>\r\n <button class=\"remove-file\" onClick={(e) => {\r\n e.stopPropagation();\r\n this.clearSelectedFile();\r\n }}>×</button>\r\n </div>\r\n ) : (\r\n <div class=\"upload-placeholder\">\r\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" width=\"48\" height=\"48\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 4v16m0-16l-4 4m4-4l4 4\" />\r\n </svg>\r\n <p>点击上传简历</p>\r\n <p class=\"upload-hint\">支持 txt、 markdown、 pdf、 docx、 md 格式</p>\r\n </div>\r\n )}\r\n </div>\r\n\r\n <button\r\n class=\"submit-button\"\r\n disabled={!this.selectedFile || this.isUploading}\r\n onClick={this.handleStartInterview}\r\n >\r\n {this.isUploading ? '上传中...' : '开始面试'}\r\n </button>\r\n\r\n <input\r\n type=\"file\"\r\n class=\"file-input\"\r\n onChange={this.handleFileChange}\r\n accept=\".pdf,.doc,.docx,.txt,.md\"\r\n />\r\n </div>\r\n )}\r\n\r\n {/* 聊天界面 - 在显示聊天模态框时显示 */}\r\n {this.showChatModal && (\r\n <div class=\"chat-modal-container\">\r\n <pcm-app-chat-modal\r\n isOpen={true}\r\n modalTitle={this.modalTitle}\r\n icon={this.icon}\r\n apiKey={this.apiKey}\r\n isShowHeader={this.isShowHeader} // 不显示内部的标题栏,因为外部已有\r\n isNeedClose={this.isShowHeader} // 不显示内部的关闭按钮,因为外部已有\r\n zIndex={this.zIndex}\r\n fullscreen={this.fullscreen}\r\n conversationId={this.conversationId}\r\n defaultQuery={this.defaultQuery}\r\n enableVoice={false}\r\n customInputs={this.conversationId ? undefined : {\r\n ...this.customInputs,\r\n file_url: this.uploadedFileInfo?.cos_key\r\n }}\r\n interviewMode=\"text\"\r\n onModalClosed={this.handleClose}\r\n onStreamComplete={this.handleStreamComplete}\r\n onConversationStart={this.handleConversationStart}\r\n onInterviewComplete={this.handleInterviewComplete}\r\n ></pcm-app-chat-modal>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n} "],"version":3}
|
|
1
|
+
{"file":"pcm-mnms-modal.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,+mFAA+mF;;ACAvoF,MAAM,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ow","src/global/global.css?tag=pcm-mnms-modal&encapsulation=shadow","src/components/pcm-mnms-modal/pcm-mnms-modal.tsx"],"sourcesContent":[":host {\r\n display: block;\r\n}\r\n\r\n.modal-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n overflow-y: auto;\r\n padding: 20px;\r\n z-index: 1000;\r\n}\r\n\r\n/* 全屏模式下取消 padding */\r\n.fullscreen-overlay {\r\n padding: 0;\r\n}\r\n\r\n.modal-container {\r\n background: white;\r\n border-radius: 8px;\r\n width: 100%;\r\n max-width: 500px;\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n margin: auto;\r\n transition: all 0.3s ease-out;\r\n overflow: hidden;\r\n}\r\n\r\n/* 全屏模式样式 */\r\n.modal-container.fullscreen {\r\n width: 100vw;\r\n max-width: none;\r\n height: 100%;\r\n border-radius: 0;\r\n margin: 0;\r\n display: flex;\r\n flex-direction: column;\r\n height: 100vh;\r\n max-height: 100vh;\r\n}\r\n\r\n/* PC端布局 */\r\n.pc-layout {\r\n width: 80%;\r\n max-width: 500px;\r\n min-width: 320px;\r\n}\r\n\r\n/* 移动端布局 */\r\n.mobile-layout {\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 0;\r\n}\r\n\r\n/* 响应式布局 */\r\n@media screen and (max-width: 768px) {\r\n .pc-layout {\r\n width: 95%;\r\n }\r\n\r\n .modal-overlay {\r\n padding: 0;\r\n }\r\n\r\n .modal-container.fullscreen {\r\n /* 支持 iOS Safari */\r\n height: -webkit-fill-available;\r\n max-height: -webkit-fill-available;\r\n /* 确保内容不会被顶部状态栏和底部工具栏遮挡 */\r\n padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);\r\n margin-top: 40px;\r\n height: calc(100% - 40px);\r\n max-height: calc(100% - 40px);\r\n border-radius: 16px 16px 0 0;\r\n }\r\n\r\n .modal-container.mobile-layout {\r\n width: 100%;\r\n height: 100vh;\r\n max-height: 100vh;\r\n min-height: 100vh;\r\n border-radius: 0;\r\n margin: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n}\r\n\r\n.modal-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 4px 16px;\r\n height: 50px;\r\n border-bottom: 1px solid #e8e8e8;\r\n flex-shrink: 0; /* 防止头部被压缩 */\r\n}\r\n\r\n.header-left {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n}\r\n\r\n.header-icon {\r\n width: 24px;\r\n height: 24px;\r\n}\r\n\r\n.close-button {\r\n background: transparent;\r\n border: none;\r\n cursor: pointer;\r\n padding: 8px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n border-radius: 4px;\r\n}\r\n\r\n.close-button:hover {\r\n background-color: rgba(0, 0, 0, 0.04);\r\n}\r\n\r\n.close-button span {\r\n font-size: 24px;\r\n line-height: 1;\r\n color: #999;\r\n}\r\n\r\n.close-button:hover span {\r\n color: #666;\r\n}\r\n\r\n.upload-container {\r\n padding: 30px 20px;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n text-align: center;\r\n height: calc(100% - 60px); /* 减去header高度 */\r\n transition: opacity 0.5s ease-out;\r\n}\r\n\r\n.upload-container h3 {\r\n margin-top: 0;\r\n margin-bottom: 20px;\r\n font-size: 18px;\r\n color: #333;\r\n}\r\n\r\n\r\n.submit-button {\r\n max-width: 400px;\r\n}\r\n\r\n\r\n.file-input {\r\n display: none;\r\n}\r\n\r\n.transitioning {\r\n position: relative;\r\n overflow: hidden;\r\n}\r\n\r\n.fade-out {\r\n opacity: 0.7;\r\n transition: opacity 0.5s ease-out;\r\n}\r\n\r\n.transition-container {\r\n margin-top: 20px;\r\n width: 100%;\r\n}\r\n\r\n.progress-bar {\r\n width: 100%;\r\n height: 6px;\r\n background-color: #f0f0f0;\r\n border-radius: 3px;\r\n overflow: hidden;\r\n margin-bottom: 10px;\r\n}\r\n\r\n.progress-fill {\r\n height: 100%;\r\n background-color: #4285f4;\r\n transition: width 0.3s ease-out;\r\n}\r\n\r\n/* 淡出动画 */\r\n.upload-container.fade-out {\r\n opacity: 0;\r\n transform: translateY(-20px);\r\n transition: opacity 0.3s ease, transform 0.3s ease;\r\n}\r\n\r\n/* 淡入动画 */\r\n.chat-modal-container {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n/* 确保容器有相对定位,以便绝对定位的子元素能够正确定位 */\r\n.modal-container {\r\n position: relative;\r\n overflow: hidden;\r\n} ","/* 模态框基础样式 */\r\n.modal-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 1000;\r\n overflow-y: auto;\r\n padding: 20px;\r\n}\r\n\r\n/* 全屏模式下取消 padding */\r\n.fullscreen-overlay {\r\n padding: 0;\r\n background-color: rgba(0, 0, 0, 0.7);\r\n}\r\n\r\n.modal-container {\r\n background-color: #fff;\r\n border-radius: 8px;\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n margin: auto;\r\n transition: all 0.3s ease-out;\r\n overflow: hidden;\r\n}\r\n\r\n/* 全屏模式样式 */\r\n.modal-container.fullscreen {\r\n width: 100vw;\r\n max-width: none;\r\n height: 100%;\r\n border-radius: 0;\r\n margin: 0;\r\n display: flex;\r\n flex-direction: column;\r\n height: 100vh;\r\n max-height: 100vh;\r\n}\r\n\r\n/* PC端布局 */\r\n.pc-layout {\r\n width: 80%;\r\n max-width: 500px;\r\n min-width: 320px;\r\n}\r\n\r\n/* 移动端布局 */\r\n.mobile-layout {\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 0;\r\n}\r\n\r\n/* 响应式布局 */\r\n@media screen and (max-width: 768px) {\r\n .pc-layout {\r\n width: 95%;\r\n }\r\n\r\n .modal-overlay {\r\n padding: 0;\r\n }\r\n\r\n .modal-container.fullscreen {\r\n /* 支持 iOS Safari */\r\n height: -webkit-fill-available;\r\n max-height: -webkit-fill-available;\r\n /* 确保内容不会被顶部状态栏和底部工具栏遮挡 */\r\n padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);\r\n margin-top: 40px;\r\n height: calc(100% - 40px);\r\n max-height: calc(100% - 40px);\r\n border-radius: 16px 16px 0 0;\r\n }\r\n\r\n .modal-container.mobile-layout {\r\n width: 100%;\r\n height: 100vh;\r\n max-height: 100vh;\r\n min-height: 100vh;\r\n border-radius: 0;\r\n margin: 0;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n}\r\n\r\n/* 模态框头部样式 */\r\n.modal-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 4px 16px;\r\n height: 50px;\r\n border-bottom: 1px solid #e8e8e8;\r\n flex-shrink: 0;\r\n}\r\n\r\n.header-left {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n}\r\n\r\n.header-icon {\r\n width: 24px;\r\n height: 24px;\r\n}\r\n\r\n.close-button {\r\n background: transparent;\r\n border: none;\r\n cursor: pointer;\r\n padding: 8px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n border-radius: 4px;\r\n}\r\n\r\n.close-button:hover {\r\n background-color: rgba(0, 0, 0, 0.04);\r\n}\r\n\r\n.close-button span {\r\n font-size: 24px;\r\n line-height: 1;\r\n color: #999;\r\n}\r\n\r\n.close-button:hover span {\r\n color: #666;\r\n}\r\n\r\n\r\n/* 文件上传区域通用样式 */\r\n.upload-area {\r\n border: 2px dashed #ddd;\r\n border-radius: 8px;\r\n cursor: pointer;\r\n transition: all 0.3s ease;\r\n margin-bottom: 20px;\r\n width: 100%;\r\n}\r\n\r\n.upload-area:hover {\r\n border-color: #1890ff;\r\n background-color: rgba(24, 144, 255, 0.05);\r\n}\r\n\r\n\r\n.upload-placeholder {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n color: #666;\r\n}\r\n\r\n.upload-placeholder svg {\r\n color: #1890ff;\r\n margin-bottom: 8px;\r\n}\r\n\r\n.upload-placeholder p {\r\n margin: 4px 0;\r\n}\r\n\r\n.upload-hint {\r\n font-size: 0.8rem;\r\n color: #999;\r\n margin-top: 0.5rem;\r\n}\r\n\r\n.file-info {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n padding: 8px;\r\n background: #f9f9f9;\r\n border: 1px solid #e8e8e8;\r\n border-radius: 4px;\r\n}\r\n\r\n.file-info span {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n max-width: calc(100% - 30px);\r\n}\r\n\r\n.remove-file {\r\n background: transparent;\r\n border: none;\r\n color: #999;\r\n cursor: pointer;\r\n padding: 4px 8px;\r\n font-size: 16px;\r\n line-height: 1;\r\n border-radius: 4px;\r\n transition: all 0.2s;\r\n}\r\n\r\n.remove-file:hover {\r\n background-color: #f0f0f0;\r\n color: #666;\r\n}\r\n\r\n.file-input {\r\n display: none;\r\n}\r\n\r\n\r\n\r\n/* 输入容器样式 */\r\n.input-container {\r\n padding: 20px;\r\n display: flex;\r\n flex-direction: column;\r\n height: calc(100% - 50px);\r\n /* 减去header高度 */\r\n overflow-y: auto;\r\n}\r\n\r\n.input-container h3 {\r\n margin-top: 0;\r\n margin-bottom: 20px;\r\n font-size: 18px;\r\n color: #333;\r\n text-align: center;\r\n}\r\n\r\n/* JD输入区域样式 */\r\n.jd-input-section {\r\n margin-bottom: 20px;\r\n}\r\n\r\n.jd-input-section label {\r\n display: block;\r\n margin-bottom: 8px;\r\n font-weight: 500;\r\n color: #333;\r\n}\r\n\r\n.job-description-textarea {\r\n width: 100%;\r\n border: 1px solid #ddd;\r\n border-radius: 4px;\r\n resize: vertical;\r\n font-family: inherit;\r\n font-size: 14px;\r\n line-height: 1.5;\r\n transition: border-color 0.3s;\r\n}\r\n\r\n.job-description-textarea:focus {\r\n outline: none;\r\n border-color: #1890ff;\r\n box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);\r\n}\r\n\r\n/* 简历上传区域样式 */\r\n.resume-upload-section {\r\n margin-bottom: 20px;\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n}\r\n\r\n.resume-upload-section label {\r\n display: block;\r\n margin-bottom: 8px;\r\n font-weight: 500;\r\n color: #333;\r\n align-self: flex-start;\r\n}\r\n\r\n\r\n/* 提交按钮通用样式 */\r\n.submit-button {\r\n margin-top: 10px;\r\n padding: 10px 30px;\r\n background: #1890ff;\r\n color: white;\r\n border: none;\r\n border-radius: 4px;\r\n font-size: 16px;\r\n cursor: pointer;\r\n transition: all 0.3s ease;\r\n width: 100%;\r\n max-width: 400px;\r\n align-self: center;\r\n /* 确保按钮居中 */\r\n}\r\n\r\n.submit-button:disabled {\r\n background: #ccc;\r\n cursor: not-allowed;\r\n}\r\n\r\n.submit-button:hover:not(:disabled) {\r\n background: #40a9ff;\r\n}\r\n\r\n/* 聊天模态框容器 */\r\n.chat-modal-container {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: column;\r\n}","import { Component, Prop, h, State, Element, Event, EventEmitter, Watch } from '@stencil/core';\r\nimport { uploadFileToBackend, FileUploadResponse, sendHttpRequest } from '../../utils/utils';\r\n\r\n@Component({\r\n tag: 'pcm-mnms-modal',\r\n styleUrls: ['pcm-mnms-modal.css', '../../global/global.css'],\r\n shadow: true,\r\n})\r\nexport class MnmsModal {\r\n /**\r\n * 模态框标题\r\n */\r\n @Prop() modalTitle: string = '模拟面试';\r\n\r\n /**\r\n * API鉴权密钥\r\n */\r\n @Prop({ attribute: 'token' }) token: string = '';\r\n\r\n /**\r\n * 是否显示聊天模态框\r\n */\r\n @Prop({ mutable: true }) isOpen: boolean = false;\r\n\r\n /**\r\n * 当点击模态框关闭时触发\r\n */\r\n @Event() modalClosed: EventEmitter<void>;\r\n\r\n /**\r\n * 应用图标URL\r\n */\r\n @Prop() icon?: string;\r\n\r\n /**\r\n * 聊天框的页面层级\r\n */\r\n @Prop() zIndex?: number = 1000;\r\n\r\n /**\r\n * 是否展示顶部标题栏\r\n */\r\n @Prop() isShowHeader: boolean = true;\r\n\r\n /**\r\n * 是否展示右上角的关闭按钮\r\n */\r\n @Prop() isNeedClose: boolean = true;\r\n\r\n /**\r\n * 会话ID,传入继续对话,否则创建新会话\r\n */\r\n @Prop({ mutable: true }) conversationId?: string;\r\n\r\n /**\r\n * 默认查询文本\r\n */\r\n @Prop() defaultQuery: string = '';\r\n\r\n /**\r\n * 是否以全屏模式打开,移动端建议设置为true\r\n */\r\n @Prop() fullscreen: boolean = false;\r\n\r\n /**\r\n * 自定义输入参数,传入job_info时,会隐藏JD输入区域\r\n */\r\n @Prop() customInputs: { [key: string]: any } = {};\r\n\r\n /**\r\n * 上传成功事件\r\n */\r\n @Event() uploadSuccess: EventEmitter<FileUploadResponse>;\r\n\r\n /**\r\n * 流式输出完成事件\r\n */\r\n @Event() streamComplete: EventEmitter<{\r\n conversation_id: string;\r\n event: string;\r\n message_id: string;\r\n id: string;\r\n }>;\r\n\r\n /**\r\n * 新会话开始的回调,只会在一轮对话开始时触发一次\r\n */\r\n @Event() conversationStart: EventEmitter<{\r\n conversation_id: string;\r\n event: string;\r\n message_id: string;\r\n id: string;\r\n }>;\r\n\r\n /**\r\n * 当聊天完成时触发\r\n */\r\n @Event() interviewComplete: EventEmitter<{\r\n conversation_id: string;\r\n total_questions: number;\r\n }>;\r\n\r\n /**\r\n * API密钥验证失败事件\r\n */\r\n @Event() apiKeyInvalid: EventEmitter<void>;\r\n\r\n @State() selectedFile: File | null = null;\r\n @State() isUploading: boolean = false;\r\n @State() uploadedFileInfo: FileUploadResponse | null = null;\r\n @State() showChatModal: boolean = false;\r\n\r\n // 添加新的状态来控制过渡动画\r\n @State() isTransitioning: boolean = false;\r\n @State() transitionTimer: any = null;\r\n\r\n // 使用 @Element 装饰器获取组件的 host 元素\r\n @Element() hostElement: HTMLElement;\r\n\r\n @State() jobDescription: string = '';\r\n @State() isSubmitting: boolean = false;\r\n\r\n private handleClose = () => {\r\n this.isOpen = false;\r\n this.modalClosed.emit();\r\n };\r\n\r\n private handleFileChange = (event: Event) => {\r\n const input = event.target as HTMLInputElement;\r\n if (input.files && input.files.length > 0) {\r\n this.selectedFile = input.files[0];\r\n }\r\n };\r\n\r\n private handleUploadClick = () => {\r\n const fileInput = this.hostElement.shadowRoot?.querySelector('.file-input') as HTMLInputElement;\r\n fileInput?.click();\r\n };\r\n\r\n private clearSelectedFile = () => {\r\n this.selectedFile = null;\r\n this.uploadedFileInfo = null;\r\n const fileInput = this.hostElement.shadowRoot?.querySelector('.file-input') as HTMLInputElement;\r\n if (fileInput) {\r\n fileInput.value = '';\r\n }\r\n };\r\n\r\n private async uploadFile() {\r\n if (!this.selectedFile) return;\r\n\r\n this.isUploading = true;\r\n\r\n try {\r\n // 使用 uploadFileToBackend 工具函数上传文件\r\n const result = await uploadFileToBackend(this.selectedFile, {\r\n 'authorization': 'Bearer ' + this.token\r\n });\r\n\r\n this.uploadedFileInfo = result;\r\n this.uploadSuccess.emit(result);\r\n } catch (error) {\r\n console.error('文件上传错误:', error);\r\n this.clearSelectedFile();\r\n alert(error instanceof Error ? error.message : '文件上传失败,请重试');\r\n } finally {\r\n this.isUploading = false;\r\n }\r\n }\r\n\r\n private handleJobDescriptionChange = (event: Event) => {\r\n const textarea = event.target as HTMLTextAreaElement;\r\n this.jobDescription = textarea.value;\r\n };\r\n\r\n private handleStartInterview = async () => {\r\n if (!this.selectedFile) {\r\n alert('请上传简历');\r\n return;\r\n }\r\n\r\n // 如果没有预设的job_info,则需要检查用户输入\r\n if (!this.customInputs?.job_info && !this.jobDescription.trim()) {\r\n alert('请输入职位描述');\r\n return;\r\n }\r\n\r\n this.isSubmitting = true;\r\n\r\n try {\r\n // 如果还没上传,先上传文件\r\n if (!this.uploadedFileInfo) {\r\n await this.uploadFile();\r\n if (!this.uploadedFileInfo) {\r\n this.isSubmitting = false;\r\n return; // 上传失败\r\n }\r\n }\r\n\r\n // 使用预设的job_info或用户输入的jobDescription\r\n const jobInfo = this.customInputs?.job_info || this.jobDescription;\r\n\r\n console.log('传递的customInputs:', {\r\n ...this.customInputs,\r\n file_url: this.uploadedFileInfo.cos_key,\r\n job_info: jobInfo\r\n });\r\n\r\n // 直接显示聊天模态框\r\n this.showChatModal = true;\r\n } catch (error) {\r\n console.error('开始面试时出错:', error);\r\n alert('开始面试时出错,请重试');\r\n } finally {\r\n this.isSubmitting = false;\r\n }\r\n };\r\n\r\n @Watch('isOpen')\r\n handleIsOpenChange(newValue: boolean) {\r\n if (!newValue) {\r\n // 重置状态\r\n this.clearSelectedFile();\r\n this.showChatModal = false;\r\n this.jobDescription = '';\r\n\r\n // 清除可能存在的计时器\r\n if (this.transitionTimer) {\r\n clearTimeout(this.transitionTimer);\r\n this.transitionTimer = null;\r\n }\r\n } else {\r\n // 当模态框打开时,验证API密钥\r\n this.verifyApiKey();\r\n \r\n if (this.conversationId) {\r\n // 如果有会话ID,直接显示聊天模态框\r\n this.showChatModal = true;\r\n }\r\n }\r\n }\r\n\r\n componentWillLoad() {\r\n // 检查 customInputs 中是否有 job_info\r\n if (this.customInputs && this.customInputs.job_info) {\r\n this.jobDescription = this.customInputs.job_info;\r\n }\r\n }\r\n\r\n // 处理流式输出完成事件\r\n private handleStreamComplete = (event: CustomEvent) => {\r\n // 将事件转发出去\r\n this.streamComplete.emit(event.detail);\r\n };\r\n\r\n // 处理会话开始事件\r\n private handleConversationStart = (event: CustomEvent) => {\r\n this.conversationStart.emit(event.detail);\r\n };\r\n\r\n // 处理面试完成事件\r\n private handleInterviewComplete = (event: CustomEvent) => {\r\n this.interviewComplete.emit(event.detail);\r\n };\r\n\r\n /**\r\n * 验证API密钥\r\n */\r\n private async verifyApiKey() {\r\n if (!this.token) {\r\n this.apiKeyInvalid.emit();\r\n return;\r\n }\r\n \r\n try {\r\n const response = await sendHttpRequest({\r\n url: '/sdk/v1/user',\r\n method: 'GET',\r\n headers: {\r\n 'Authorization': `Bearer ${this.token}`\r\n }\r\n });\r\n\r\n if (!response.success) {\r\n throw new Error(response.message || 'API密钥验证失败');\r\n }\r\n \r\n // 验证成功,继续正常流程\r\n } catch (error) {\r\n console.error('API密钥验证错误:', error);\r\n // 通知父组件API密钥无效\r\n this.apiKeyInvalid.emit();\r\n }\r\n }\r\n\r\n render() {\r\n if (!this.isOpen) return null;\r\n\r\n const modalStyle = {\r\n zIndex: String(this.zIndex)\r\n };\r\n\r\n console.log('showChatModal:', this.showChatModal);\r\n\r\n const containerClass = {\r\n 'modal-container': true,\r\n 'fullscreen': this.fullscreen,\r\n 'pc-layout': true,\r\n };\r\n\r\n const overlayClass = {\r\n 'modal-overlay': true,\r\n 'fullscreen-overlay': this.fullscreen\r\n };\r\n\r\n // 检查是否有会话ID,如果有则直接显示聊天模态框\r\n if (this.conversationId && !this.showChatModal) {\r\n this.showChatModal = true;\r\n }\r\n\r\n // 修正这里的逻辑,确保当 customInputs.job_info 存在时,hideJdInput 为 true\r\n const hideJdInput = Boolean(this.customInputs && this.customInputs.job_info);\r\n\r\n return (\r\n <div class={overlayClass} style={modalStyle}>\r\n <div class={containerClass}>\r\n {this.isShowHeader && (\r\n <div class=\"modal-header\">\r\n <div class=\"header-left\">\r\n {this.icon && <img src={this.icon} class=\"header-icon\" alt=\"应用图标\" />}\r\n <div>{this.modalTitle}</div>\r\n </div>\r\n {this.isNeedClose && (\r\n <button class=\"close-button\" onClick={this.handleClose}>\r\n <span>×</span>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n\r\n {/* 上传界面 - 仅在不显示聊天模态框且没有会话ID时显示 */}\r\n {!this.showChatModal && !this.conversationId && (\r\n <div class=\"input-container\">\r\n {/* JD输入区域 - 仅在没有customInputs.job_info时显示 */}\r\n {!hideJdInput && (\r\n <div class=\"jd-input-section\">\r\n <label htmlFor=\"job-description\">请输入职位描述 (JD)</label>\r\n <textarea \r\n id=\"job-description\"\r\n class=\"job-description-textarea\"\r\n placeholder=\"请输入职位描述,包括职责、要求等信息...\"\r\n rows={6}\r\n value={this.jobDescription}\r\n onInput={this.handleJobDescriptionChange}\r\n ></textarea>\r\n </div>\r\n )}\r\n \r\n {/* 简历上传区域 */}\r\n <div class=\"resume-upload-section\">\r\n <label>上传简历</label>\r\n <div class=\"upload-area\" onClick={this.handleUploadClick}>\r\n {this.selectedFile ? (\r\n <div class=\"file-info\">\r\n <span>{this.selectedFile.name}</span>\r\n <button class=\"remove-file\" onClick={(e) => {\r\n e.stopPropagation();\r\n this.clearSelectedFile();\r\n }}>×</button>\r\n </div>\r\n ) : (\r\n <div class=\"upload-placeholder\">\r\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" width=\"48\" height=\"48\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 4v16m0-16l-4 4m4-4l4 4\" />\r\n </svg>\r\n <p>点击上传简历</p>\r\n <p class=\"upload-hint\">支持 txt、markdown、pdf、docx、md 格式</p>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n\r\n <button\r\n class=\"submit-button\"\r\n disabled={!this.selectedFile || (!hideJdInput && !this.jobDescription.trim()) || this.isUploading || this.isSubmitting}\r\n onClick={this.handleStartInterview}\r\n >\r\n {this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始分析'}\r\n </button>\r\n\r\n <input\r\n type=\"file\"\r\n class=\"file-input\"\r\n onChange={this.handleFileChange}\r\n accept=\".pdf,.doc,.docx,.txt,.md\"\r\n />\r\n </div>\r\n )}\r\n\r\n {/* 聊天界面 - 在显示聊天模态框时显示 */}\r\n {this.showChatModal && (\r\n <div class=\"chat-modal-container\">\r\n <pcm-app-chat-modal\r\n isOpen={true}\r\n modalTitle={this.modalTitle}\r\n icon={this.icon}\r\n token={this.token}\r\n isShowHeader={this.isShowHeader} // 不显示内部的标题栏,因为外部已有\r\n isNeedClose={this.isShowHeader} // 不显示内部的关闭按钮,因为外部已有\r\n zIndex={this.zIndex}\r\n fullscreen={this.fullscreen}\r\n botId=\"3022316191018884\"\r\n conversationId={this.conversationId}\r\n defaultQuery={this.defaultQuery}\r\n enableVoice={false}\r\n customInputs={this.conversationId ? undefined : {\r\n ...this.customInputs,\r\n file_url: this.uploadedFileInfo?.cos_key,\r\n job_info: this.customInputs?.job_info || this.jobDescription\r\n }}\r\n interviewMode=\"text\"\r\n onModalClosed={this.handleClose}\r\n onStreamComplete={this.handleStreamComplete}\r\n onConversationStart={this.handleConversationStart}\r\n onInterviewComplete={this.handleInterviewComplete}\r\n ></pcm-app-chat-modal>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n} "],"version":3}
|