@billtaofbj/questionnaire 1.1.0 → 1.2.0

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/index.es.js CHANGED
@@ -446,13 +446,13 @@ var ce = (e, t) => {
446
446
  }, Pe = {
447
447
  key: 1,
448
448
  class: "empty-state"
449
- }, V = {
449
+ }, Fe = {
450
450
  key: 2,
451
451
  class: "version-list"
452
- }, H = {
452
+ }, V = {
453
453
  key: 0,
454
454
  class: "current-version"
455
- }, U = { class: "current-version-header" }, Fe = { class: "version-number" }, W = ["onClick"], G = { class: "version-number" }, K = { class: "version-user" }, q = { class: "panel-footer" }, Ie = /*#__PURE__*/ ce({
455
+ }, H = { class: "current-version-header" }, U = { class: "version-number" }, Ie = ["onClick"], W = { class: "version-number" }, G = { class: "version-user" }, K = { class: "panel-footer" }, Le = /*#__PURE__*/ ce({
456
456
  __name: "VersionHistoryPanel",
457
457
  props: {
458
458
  modelValue: {
@@ -503,7 +503,7 @@ var ce = (e, t) => {
503
503
  size: "420px",
504
504
  "before-close": A
505
505
  }, {
506
- footer: w(() => [a("div", q, [s(_, {
506
+ footer: w(() => [a("div", K, [s(_, {
507
507
  type: "primary",
508
508
  disabled: !E.value,
509
509
  loading: D.value,
@@ -521,13 +521,13 @@ var ce = (e, t) => {
521
521
  }, {
522
522
  default: w(() => [s(S(j))]),
523
523
  _: 1
524
- }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", V, [O.value ? (g(), i("div", H, [a("div", U, [s(u, {
524
+ }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", Fe, [O.value ? (g(), i("div", V, [a("div", H, [s(u, {
525
525
  type: "success",
526
526
  size: "small"
527
527
  }, {
528
528
  default: w(() => [...c[3] ||= [o("当前版本", -1)]]),
529
529
  _: 1
530
- }), a("span", Fe, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(h, null, {
530
+ }), a("span", U, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(h, null, {
531
531
  default: w(() => [(g(!0), i(e, null, y(S(p), (e) => (g(), n(f, {
532
532
  key: e.id,
533
533
  timestamp: ne(e.created_at),
@@ -538,7 +538,7 @@ var ce = (e, t) => {
538
538
  default: w(() => [a("div", {
539
539
  class: d(["version-item", { active: E.value?.id === e.id }]),
540
540
  onClick: (t) => ee(e)
541
- }, [a("span", G, "版本号:v" + x(e.version_number), 1), a("span", K, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, W)]),
541
+ }, [a("span", W, "版本号:v" + x(e.version_number), 1), a("span", G, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Ie)]),
542
542
  _: 2
543
543
  }, 1032, [
544
544
  "timestamp",
@@ -554,7 +554,7 @@ var ce = (e, t) => {
554
554
  }, [["__scopeId", "data-v-87924b7c"]]);
555
555
  //#endregion
556
556
  //#region ../../src/composables/useChat.js
557
- function Le() {
557
+ function Re() {
558
558
  let e = v([]), t = v(!1), n = v(!1), r = v([]), i = v({
559
559
  id: "",
560
560
  name: "",
@@ -701,76 +701,187 @@ function Le() {
701
701
  };
702
702
  }
703
703
  //#endregion
704
+ //#region ../../src/composables/useAiApi.js
705
+ var q = [
706
+ "我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?",
707
+ "这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。",
708
+ "根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。",
709
+ "流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。",
710
+ "我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?",
711
+ "建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。",
712
+ "这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。",
713
+ "我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。"
714
+ ];
715
+ function J() {
716
+ return q[Math.floor(Math.random() * q.length)];
717
+ }
718
+ async function Y(e, t, n) {
719
+ let r = { "Content-Type": "application/json" };
720
+ e.apiKey && (r.Authorization = `Bearer ${e.apiKey}`);
721
+ let i = await fetch(e.url, {
722
+ method: "POST",
723
+ headers: r,
724
+ body: JSON.stringify({
725
+ model: e.model || "gpt-4o-mini",
726
+ messages: t,
727
+ temperature: e.temperature ?? .7,
728
+ max_tokens: e.maxTokens ?? 4096
729
+ }),
730
+ signal: n
731
+ });
732
+ if (!i.ok) {
733
+ let e = await i.text().catch(() => "");
734
+ throw Error(`AI API error ${i.status}: ${e}`);
735
+ }
736
+ return (await i.json()).choices?.[0]?.message?.content || "";
737
+ }
738
+ function ze(e) {
739
+ let t = v(!1), n = null, r = () => {
740
+ let t = typeof e == "function" ? e() : e;
741
+ return !!(t && t.url);
742
+ }, i = () => typeof e == "function" ? e() : e || {};
743
+ return {
744
+ loading: t,
745
+ isAvailable: r,
746
+ chat: async (e, r = []) => {
747
+ let a = i();
748
+ if (!a.url) return J();
749
+ t.value = !0, n && n.abort(), n = new AbortController();
750
+ try {
751
+ return await Y(a, [
752
+ {
753
+ role: "system",
754
+ content: a.chatPrompt || "你是一个有帮助的AI助手,擅长文档编辑和流程设计。请简洁回答用户问题。"
755
+ },
756
+ ...r.map((e) => ({
757
+ role: e.role === "ai" ? "assistant" : "user",
758
+ content: e.content
759
+ })),
760
+ {
761
+ role: "user",
762
+ content: e
763
+ }
764
+ ], n.signal);
765
+ } catch (e) {
766
+ return e.name === "AbortError" ? "" : (console.warn("[useAiApi] Chat error, falling back to mock:", e), J());
767
+ } finally {
768
+ t.value = !1;
769
+ }
770
+ },
771
+ generate: async (e, r) => {
772
+ let a = i();
773
+ if (!a.url) return {
774
+ success: !1,
775
+ message: "AI生成功能开发中,敬请期待..."
776
+ };
777
+ t.value = !0, n && n.abort(), n = new AbortController();
778
+ try {
779
+ let t = await Y(a, [{
780
+ role: "system",
781
+ content: a.generatePrompt || `你是一个专业的${r || "流程图"}生成助手。根据用户的描述,生成对应的JSON数据结构。只返回JSON,不要包含其他文字或markdown代码块标记。`
782
+ }, {
783
+ role: "user",
784
+ content: e
785
+ }], n.signal), i = null;
786
+ try {
787
+ let e = t.replace(/^```(?:json)?\s*/i, "").replace(/\s*```$/i, "").trim();
788
+ i = JSON.parse(e);
789
+ } catch {
790
+ i = null;
791
+ }
792
+ return {
793
+ success: !0,
794
+ content: t,
795
+ parsed: i
796
+ };
797
+ } catch (e) {
798
+ return e.name === "AbortError" ? {
799
+ success: !1,
800
+ message: "已取消"
801
+ } : (console.warn("[useAiApi] Generate error:", e), {
802
+ success: !1,
803
+ message: `AI生成失败: ${e.message}`
804
+ });
805
+ } finally {
806
+ t.value = !1;
807
+ }
808
+ },
809
+ abort: () => {
810
+ n &&= (n.abort(), null);
811
+ }
812
+ };
813
+ }
814
+ //#endregion
704
815
  //#region ../../src/views/QuestionnaireEditor.vue
705
- var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "header-left" }, Ve = { class: "header-right" }, He = { class: "editor-main" }, Ue = {
816
+ var Be = { class: "q-editor" }, Ve = { class: "editor-header" }, He = { class: "header-left" }, Ue = { class: "header-right" }, We = { class: "editor-main" }, Ge = {
706
817
  class: "q-canvas",
707
818
  ref: "canvasRef"
708
- }, We = { class: "q-header-top" }, Ge = { class: "q-header-settings-panel" }, Ke = { class: "q-settings-section" }, qe = { class: "q-settings-row" }, Je = { class: "q-settings-row" }, Ye = { class: "q-settings-row" }, Xe = { class: "q-settings-row" }, Ze = { class: "q-settings-row" }, Qe = { class: "q-settings-row" }, $e = { class: "q-settings-row" }, et = { class: "q-settings-row" }, tt = { class: "q-settings-row" }, nt = { class: "q-settings-row" }, rt = { class: "q-settings-row" }, it = { class: "q-settings-row" }, at = { class: "q-settings-row" }, ot = { class: "q-settings-row" }, st = { class: "q-header-settings" }, ct = { class: "q-pass-score" }, lt = { class: "q-total-score" }, ut = { class: "q-show-score" }, dt = {
819
+ }, Ke = { class: "q-header-top" }, qe = { class: "q-header-settings-panel" }, Je = { class: "q-settings-section" }, Ye = { class: "q-settings-row" }, Xe = { class: "q-settings-row" }, Ze = { class: "q-settings-row" }, Qe = { class: "q-settings-row" }, $e = { class: "q-settings-row" }, et = { class: "q-settings-row" }, tt = { class: "q-settings-row" }, nt = { class: "q-settings-row" }, rt = { class: "q-settings-row" }, it = { class: "q-settings-row" }, at = { class: "q-settings-row" }, ot = { class: "q-settings-row" }, st = { class: "q-settings-row" }, ct = { class: "q-settings-row" }, lt = { class: "q-header-settings" }, ut = { class: "q-pass-score" }, dt = { class: "q-total-score" }, ft = { class: "q-show-score" }, pt = {
709
820
  class: "q-questions",
710
821
  ref: "questionsRef"
711
- }, ft = [
822
+ }, mt = [
712
823
  "onClick",
713
824
  "onDragstart",
714
825
  "onDragover",
715
826
  "onDrop"
716
- ], pt = { class: "q-card-toolbar" }, mt = { class: "q-card-header" }, ht = { class: "q-num" }, gt = { class: "q-card-actions" }, _t = { class: "q-card-body" }, vt = { class: "q-desc-row" }, yt = { class: "q-image-row" }, bt = {
827
+ ], ht = { class: "q-card-toolbar" }, gt = { class: "q-card-header" }, _t = { class: "q-num" }, vt = { class: "q-card-actions" }, yt = { class: "q-card-body" }, bt = { class: "q-desc-row" }, xt = { class: "q-image-row" }, St = {
717
828
  key: 0,
718
829
  class: "q-image-preview"
719
- }, xt = ["src"], St = {
830
+ }, Ct = ["src"], wt = {
720
831
  key: 0,
721
832
  class: "q-options-area"
722
- }, Ct = {
833
+ }, Tt = {
723
834
  key: 1,
724
835
  class: "q-options-area"
725
- }, wt = {
836
+ }, Et = {
726
837
  key: 2,
727
838
  class: "q-options-area"
728
- }, Tt = {
839
+ }, Dt = {
729
840
  key: 3,
730
841
  class: "q-options-area"
731
- }, Et = {
842
+ }, Ot = {
732
843
  key: 4,
733
844
  class: "q-options-area"
734
- }, Dt = { class: "rating-config" }, Ot = { class: "rating-preview" }, kt = ["onClick"], At = {
845
+ }, kt = { class: "rating-config" }, At = { class: "rating-preview" }, jt = ["onClick"], Mt = {
735
846
  key: 5,
736
847
  class: "q-options-area"
737
- }, jt = { class: "scale-config" }, Mt = { class: "scale-preview" }, Nt = { class: "label" }, Pt = {
848
+ }, Nt = { class: "scale-config" }, Pt = { class: "scale-preview" }, Ft = { class: "label" }, It = {
738
849
  key: 6,
739
850
  class: "q-options-area"
740
- }, Ft = { class: "matrix-config" }, It = { class: "matrix-rows" }, Lt = { class: "matrix-cols" }, Rt = {
851
+ }, Lt = { class: "matrix-config" }, Rt = { class: "matrix-rows" }, zt = { class: "matrix-cols" }, Bt = {
741
852
  key: 0,
742
853
  class: "matrix-preview"
743
- }, zt = { class: "matrix-table" }, Bt = {
854
+ }, Vt = { class: "matrix-table" }, Ht = {
744
855
  key: 7,
745
856
  class: "q-options-area"
746
- }, Vt = { class: "q-skip-config" }, Ht = { class: "skip-header" }, Ut = { class: "skip-row" }, Wt = {
857
+ }, Ut = { class: "q-skip-config" }, Wt = { class: "skip-header" }, Gt = { class: "skip-row" }, Kt = {
747
858
  key: 0,
748
859
  class: "skip-rules"
749
- }, Gt = { class: "opt-name" }, Kt = { class: "q-score-config" }, qt = { class: "score-header" }, Jt = { class: "score-row" }, Yt = {
860
+ }, qt = { class: "opt-name" }, Jt = { class: "q-score-config" }, Yt = { class: "score-header" }, Xt = { class: "score-row" }, Zt = {
750
861
  key: 0,
751
862
  class: "score-options"
752
- }, Xt = { class: "opt-name" }, Zt = {
863
+ }, Qt = { class: "opt-name" }, $t = {
753
864
  key: 1,
754
865
  class: "score-row"
755
- }, Qt = {
866
+ }, en = {
756
867
  key: 2,
757
868
  class: "score-row"
758
- }, $t = { class: "q-scoring-guide" }, en = { class: "scoring-guide-header" }, tn = { class: "scoring-guide-item" }, nn = { class: "scoring-guide-item" }, rn = {
869
+ }, tn = { class: "q-scoring-guide" }, nn = { class: "scoring-guide-header" }, rn = { class: "scoring-guide-item" }, an = { class: "scoring-guide-item" }, on = {
759
870
  key: 0,
760
871
  class: "scoring-guide-error"
761
- }, an = { class: "q-add-bottom" }, on = { class: "q-add-trigger" }, sn = { class: "ai-generate-content" }, cn = { class: "ai-gen-form-item" }, ln = { class: "ai-gen-type" }, un = { class: "ai-gen-form-item" }, dn = { class: "ai-gen-form-item" }, fn = { class: "ai-analysis-content" }, pn = {
872
+ }, sn = { class: "q-add-bottom" }, cn = { class: "q-add-trigger" }, ln = { class: "ai-generate-content" }, un = { class: "ai-gen-form-item" }, dn = { class: "ai-gen-type" }, fn = { class: "ai-gen-form-item" }, pn = { class: "ai-gen-form-item" }, mn = { class: "ai-analysis-content" }, hn = {
762
873
  key: 0,
763
874
  class: "ai-loading"
764
- }, mn = {
875
+ }, gn = {
765
876
  key: 1,
766
877
  class: "ai-result"
767
- }, hn = { class: "ai-result-header" }, gn = ["innerHTML"], _n = {
878
+ }, _n = { class: "ai-result-header" }, vn = ["innerHTML"], yn = {
768
879
  key: 2,
769
880
  class: "ai-placeholder"
770
- }, vn = { class: "distribute-content" }, yn = { class: "distribute-input" }, bn = { class: "distribute-actions" }, xn = {
881
+ }, bn = { class: "distribute-content" }, xn = { class: "distribute-input" }, Sn = { class: "distribute-actions" }, Cn = {
771
882
  key: 0,
772
883
  class: "distribute-results"
773
- }, Sn = { class: "results-header" }, Cn = "questionnaire", J = /*#__PURE__*/ ce({
884
+ }, wn = { class: "results-header" }, Tn = "questionnaire", X = /*#__PURE__*/ ce({
774
885
  __name: "QuestionnaireEditor",
775
886
  props: {
776
887
  docId: {
@@ -800,6 +911,10 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
800
911
  uiConfig: {
801
912
  type: Object,
802
913
  default: () => ({})
914
+ },
915
+ aiApi: {
916
+ type: [String, Object],
917
+ default: null
803
918
  }
804
919
  },
805
920
  setup(c) {
@@ -826,7 +941,7 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
826
941
  descFontStyle: "normal",
827
942
  descFontSize: 14,
828
943
  descColor: "#606266"
829
- }), pe = v(!1), me = v(""), he = v([]), ge = v(!1), _e = v(!1), ve = v(""), ye = v(!1), B = Le(), be = v(!1), { saveVersion: xe } = je(), Se = v(!1), Ce = v(!1), we = v(""), Te = v([]), Ee = v(-1), De = v(""), ke = v(null), Ae = (e) => ({
944
+ }), pe = v(!1), me = v(""), he = v([]), ge = v(!1), _e = v(!1), ve = v(""), ye = v(!1), B = Re(), be = ze(() => h.aiApi), xe = v(!1), { saveVersion: Se } = je(), Ce = v(!1), we = v(!1), Te = v(""), Ee = v([]), De = v(-1), ke = v(""), Ae = v(null), Me = (e) => ({
830
945
  text: "文本题",
831
946
  radio: "单选题",
832
947
  checkbox: "多选题",
@@ -835,12 +950,12 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
835
950
  scale: "量表题",
836
951
  matrix: "矩阵题",
837
952
  image: "图片题"
838
- })[e] || e, Me = t(() => I.value.reduce((e, t) => e + (t.score || 0), 0)), Ne = 0, Pe = () => {
839
- Ne = I.value.reduce((e, t) => {
953
+ })[e] || e, Ne = t(() => I.value.reduce((e, t) => e + (t.score || 0), 0)), Pe = 0, Fe = () => {
954
+ Pe = I.value.reduce((e, t) => {
840
955
  let n = parseInt(t.id?.replace("q-", "") || "0");
841
956
  return n > e ? n : e;
842
957
  }, 0);
843
- }, V = v(!1), H = v(!1), U = v(!1), Fe = v([]), W = null, G = null, K = null, q = null, J = null, wn = null, Tn = null, Y = !1, X = !1, Z = !1, En = null, Q = () => JSON.stringify({
958
+ }, V = v(!1), H = v(!1), U = v(!1), Ie = v([]), W = null, G = null, K = null, q = null, J = null, Y = null, X = null, Z = !1, En = !1, Q = !1, Dn = null, On = () => JSON.stringify({
844
959
  title: j.value,
845
960
  description: M.value,
846
961
  questions: I.value.map((e) => {
@@ -848,7 +963,7 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
848
963
  return n;
849
964
  }),
850
965
  status: P.value
851
- }), Dn = () => {
966
+ }), kn = () => {
852
967
  if (!R.value || G) return;
853
968
  W = new ne.Doc(), G = new re({
854
969
  url: h.wsUrl || `ws://${window.location.hostname || "localhost"}:1234`,
@@ -857,44 +972,44 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
857
972
  connect: !1,
858
973
  reconnect: !1,
859
974
  onConnect: () => {
860
- On();
975
+ An();
861
976
  },
862
977
  onClose: () => {},
863
978
  onSynced: ({ state: e }) => {
864
- Y = !0, !K?.toString() && !q?.toString() && (!J?.toArray() || J.length === 0) ? Fn() : In(), Tn = Q();
979
+ Z = !0, !K?.toString() && !q?.toString() && (!J?.toArray() || J.length === 0) ? Ln() : Rn(), X = On();
865
980
  }
866
- }), K = W.getText("title"), q = W.getText("description"), J = W.getArray("questions"), wn = W.getMap("meta");
981
+ }), K = W.getText("title"), q = W.getText("description"), J = W.getArray("questions"), Y = W.getMap("meta");
867
982
  let e = W.getMap("_meta");
868
983
  e.observe((t) => {
869
984
  t.keysChanged.has("_closed") && (U.value = e.get("_closed") === !0, U.value && (V.value = !1, G?.disconnect(), k.warning("协作已被创建者关闭")));
870
985
  }), K.observe(() => {
871
- Y && !X && !Z && In();
986
+ Z && !En && !Q && Rn();
872
987
  }), q.observe(() => {
873
- Y && !X && !Z && In();
988
+ Z && !En && !Q && Rn();
874
989
  }), J.observe(() => {
875
- Y && !X && !Z && In();
876
- }), wn.observe(() => {
877
- Y && !X && !Z && In();
990
+ Z && !En && !Q && Rn();
991
+ }), Y.observe(() => {
992
+ Z && !En && !Q && Rn();
878
993
  }), G.awareness.on("change", () => {
879
- Fe.value = Array.from(G.awareness.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
994
+ Ie.value = Array.from(G.awareness.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
880
995
  clientId: e,
881
996
  ...t.user
882
997
  }));
883
998
  });
884
- }, On = () => {
885
- kn(), En = setInterval(() => {
999
+ }, An = () => {
1000
+ jn(), Dn = setInterval(() => {
886
1001
  if (G?.connection?.ws?.readyState === WebSocket.CLOSED) try {
887
1002
  G.connect();
888
1003
  } catch {}
889
1004
  }, 3e4);
890
- }, kn = () => {
891
- En &&= (clearInterval(En), null);
892
- }, An = async () => {
893
- if (!R.value && (await wr(), !R.value)) {
1005
+ }, jn = () => {
1006
+ Dn &&= (clearInterval(Dn), null);
1007
+ }, Mn = async () => {
1008
+ if (!R.value && (await Er(), !R.value)) {
894
1009
  k.warning("请先保存问卷后再开启协作");
895
1010
  return;
896
1011
  }
897
- if (G || Dn(), G) {
1012
+ if (G || kn(), G) {
898
1013
  U.value = !1, V.value = !0;
899
1014
  try {
900
1015
  await fetch(`/api/questionnaires/${R.value}`, {
@@ -912,18 +1027,18 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
912
1027
  }), B.setCollabContext({
913
1028
  ydoc: W,
914
1029
  provider: G,
915
- onlineUsers: Fe
1030
+ onlineUsers: Ie
916
1031
  }), B.setCurrentUser({
917
1032
  id: G.awareness.clientID,
918
1033
  name: e,
919
1034
  color: t
920
1035
  }), G.connect(), setTimeout(() => {
921
- Y && !K?.toString() && !q?.toString() && (!J?.toArray() || J.length === 0) && (Fn(), Tn = Q());
1036
+ Z && !K?.toString() && !q?.toString() && (!J?.toArray() || J.length === 0) && (Ln(), X = On());
922
1037
  }, 1e3), k.success("协作已开启");
923
1038
  }
924
- }, jn = () => {
1039
+ }, Nn = () => {
925
1040
  G && (G.disconnect(), V.value = !1, k.info("协作已关闭"));
926
- }, Mn = async () => {
1041
+ }, Pn = async () => {
927
1042
  U.value = !0;
928
1043
  let e = W?.getMap("_meta");
929
1044
  if (e && W.transact(() => {
@@ -937,11 +1052,11 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
937
1052
  } catch (e) {
938
1053
  console.warn("Failed to persist collab_closed:", e);
939
1054
  }
940
- jn();
941
- }, Nn = () => {
942
- V.value ? Mn() : An();
943
- }, Pn = async () => {
944
- if (R.value && !H.value && (G || Dn(), G)) {
1055
+ Nn();
1056
+ }, Fn = () => {
1057
+ V.value ? Pn() : Mn();
1058
+ }, In = async () => {
1059
+ if (R.value && !H.value && (G || kn(), G)) {
945
1060
  U.value = !1, V.value = !0, H.value = !0;
946
1061
  try {
947
1062
  await fetch(`/api/questionnaires/${R.value}`, {
@@ -957,38 +1072,38 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
957
1072
  }), B.setCollabContext({
958
1073
  ydoc: W,
959
1074
  provider: G,
960
- onlineUsers: Fe
1075
+ onlineUsers: Ie
961
1076
  }), B.setCurrentUser({
962
1077
  id: G.awareness.clientID,
963
1078
  name: e,
964
1079
  color: t
965
1080
  }), G.connect(), setTimeout(() => {
966
- Y && (!K?.toString() && !q?.toString() && (!J?.toArray() || J.length === 0) || (In(), Tn = Q()));
1081
+ Z && (!K?.toString() && !q?.toString() && (!J?.toArray() || J.length === 0) || (Rn(), X = On()));
967
1082
  }, 1e3);
968
1083
  }
969
- }, Fn = () => {
970
- !W || !Y || (Z = !0, W.transact(() => {
1084
+ }, Ln = () => {
1085
+ !W || !Z || (Q = !0, W.transact(() => {
971
1086
  K.toString() !== j.value && (K.delete(0, K.length), K.insert(0, j.value)), q.toString() !== M.value && (q.delete(0, q.length), q.insert(0, M.value));
972
1087
  let e = I.value.map((e) => {
973
1088
  let { _preview: t, ...n } = e;
974
1089
  return n;
975
1090
  });
976
- JSON.stringify(e) !== JSON.stringify(J.toArray()) && (J.delete(0, J.length), J.push(e)), wn.set("status", P.value), wn.set("updatedAt", (/* @__PURE__ */ new Date()).toISOString());
977
- }), Z = !1);
1091
+ JSON.stringify(e) !== JSON.stringify(J.toArray()) && (J.delete(0, J.length), J.push(e)), Y.set("status", P.value), Y.set("updatedAt", (/* @__PURE__ */ new Date()).toISOString());
1092
+ }), Q = !1);
978
1093
  }, $ = () => {
979
1094
  if (!V.value) return;
980
- let e = Q();
981
- e !== Tn && (Tn = e, Fn());
982
- }, In = () => {
983
- if (!W || !Y || !K?.toString() && !q?.toString() && (!J?.toArray() || J.length === 0)) return;
1095
+ let e = On();
1096
+ e !== X && (X = e, Ln());
1097
+ }, Rn = () => {
1098
+ if (!W || !Z || !K?.toString() && !q?.toString() && (!J?.toArray() || J.length === 0)) return;
984
1099
  let e = JSON.stringify({
985
1100
  title: K?.toString() || "",
986
1101
  description: q?.toString() || "",
987
1102
  questions: J?.toArray() || [],
988
- status: wn?.get("status") || "draft"
1103
+ status: Y?.get("status") || "draft"
989
1104
  });
990
- if (e === Tn) return;
991
- Tn = e, X = !0;
1105
+ if (e === X) return;
1106
+ X = e, En = !0;
992
1107
  let t = K?.toString();
993
1108
  t !== void 0 && (j.value = t);
994
1109
  let n = q?.toString();
@@ -997,19 +1112,19 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
997
1112
  r && (I.value = r.map((e) => ({
998
1113
  ...e,
999
1114
  _preview: 0
1000
- })), Pe());
1001
- let i = wn?.get("status");
1002
- i && (P.value = i), X = !1;
1003
- }, Ln = null, Rn = () => {
1004
- X || (Ln && clearTimeout(Ln), Ln = setTimeout(() => {
1115
+ })), Fe());
1116
+ let i = Y?.get("status");
1117
+ i && (P.value = i), En = !1;
1118
+ }, zn = null, Bn = () => {
1119
+ En || (zn && clearTimeout(zn), zn = setTimeout(() => {
1005
1120
  $();
1006
1121
  }, 100));
1007
1122
  };
1008
- C(j, Rn), C(M, Rn), C(I, Rn, { deep: !0 });
1009
- let zn = (e) => {
1010
- Ne++;
1123
+ C(j, Bn), C(M, Bn), C(I, Bn, { deep: !0 });
1124
+ let Vn = (e) => {
1125
+ Pe++;
1011
1126
  let t = {
1012
- id: `q-${Ne}`,
1127
+ id: `q-${Pe}`,
1013
1128
  type: e,
1014
1129
  title: "",
1015
1130
  description: "",
@@ -1061,19 +1176,19 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
1061
1176
  ...t,
1062
1177
  imageQuestionText: ""
1063
1178
  } : t;
1064
- }, Bn = (e) => {
1065
- I.value.push(zn(e)), de.value = !1, V.value && $();
1066
- }, Vn = (e) => {
1179
+ }, Hn = (e) => {
1180
+ I.value.push(Vn(e)), de.value = !1, V.value && $();
1181
+ }, Un = (e) => {
1067
1182
  te.confirm("确定删除该题目?", "提示", { type: "warning" }).then(() => {
1068
1183
  I.value.splice(e, 1), V.value && $();
1069
1184
  }).catch(() => {});
1070
- }, Hn = (e, t) => {
1185
+ }, Wn = (e, t) => {
1071
1186
  let n = I.value, r = e + t;
1072
1187
  r < 0 || r >= n.length || ([n[e], n[r]] = [n[r], n[e]], V.value && $());
1073
- }, Un = (e) => {
1188
+ }, Gn = (e) => {
1074
1189
  let t = e.options.length;
1075
1190
  e.options.push(`选项${t + 1}`), e.optionSkipTo ||= {}, e.optionSkipTo[t] = "", e.optionScore ||= {}, e.optionScore[t] = 0, V.value && $();
1076
- }, Wn = (e, t) => {
1191
+ }, Kn = (e, t) => {
1077
1192
  e.options.splice(t, 1);
1078
1193
  let n = {}, r = {};
1079
1194
  Object.entries(e.optionSkipTo || {}).forEach(([e, r]) => {
@@ -1083,20 +1198,20 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
1083
1198
  let i = parseInt(e);
1084
1199
  i < t ? r[i] = n : i > t && (r[i - 1] = n);
1085
1200
  }), e.optionSkipTo = n, e.optionScore = r, V.value && $();
1086
- }, Gn = (e, t) => {
1201
+ }, qn = (e, t) => {
1087
1202
  let n = new FileReader();
1088
1203
  return n.onload = (t) => {
1089
1204
  e.image = t.target.result, V.value && $();
1090
1205
  }, n.readAsDataURL(t), !1;
1091
- }, Kn = (e, t) => {
1206
+ }, Jn = (e, t) => {
1092
1207
  L.value = e, t.dataTransfer.effectAllowed = "move";
1093
- }, qn = (e, t) => {
1208
+ }, Yn = (e, t) => {
1094
1209
  t.dataTransfer.dropEffect = "move";
1095
- }, Jn = (e, t) => {
1210
+ }, Xn = (e, t) => {
1096
1211
  if (t?.preventDefault(), L.value === null || L.value === e) return;
1097
1212
  let n = I.value, r = n.splice(L.value, 1)[0];
1098
1213
  n.splice(e, 0, r), L.value = null, V.value && $();
1099
- }, Yn = () => JSON.stringify({
1214
+ }, Zn = () => JSON.stringify({
1100
1215
  title: j.value,
1101
1216
  description: M.value,
1102
1217
  author: N.value,
@@ -1105,41 +1220,41 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
1105
1220
  endTime: ae.value,
1106
1221
  passScore: ce.value,
1107
1222
  showScore: le.value,
1108
- totalScore: Me.value,
1223
+ totalScore: Ne.value,
1109
1224
  questions: I.value.map((e) => {
1110
1225
  let { _preview: t, ...n } = e;
1111
1226
  return n;
1112
1227
  })
1113
- }), Xn = (e) => {
1228
+ }), Qn = (e) => {
1114
1229
  try {
1115
1230
  let t = JSON.parse(e);
1116
- j.value = t.title || "新建问卷", M.value = t.description || "", P.value = t.status || "draft", F.value = t.beginTime ? new Date(t.beginTime) : null, ae.value = t.endTime ? new Date(t.endTime) : null, ce.value = t.passScore || 0, le.value = t.showScore !== !1, I.value = (t.questions || []).map((e) => (e._preview = 0, e)), Pe();
1231
+ j.value = t.title || "新建问卷", M.value = t.description || "", P.value = t.status || "draft", F.value = t.beginTime ? new Date(t.beginTime) : null, ae.value = t.endTime ? new Date(t.endTime) : null, ce.value = t.passScore || 0, le.value = t.showScore !== !1, I.value = (t.questions || []).map((e) => (e._preview = 0, e)), Fe();
1117
1232
  } catch (e) {
1118
1233
  console.error("Failed to parse questionnaire config", e);
1119
1234
  }
1120
- }, Zn = () => {
1121
- let e = Yn(), t = new Blob([e], { type: "application/json" }), n = URL.createObjectURL(t), r = document.createElement("a");
1235
+ }, $n = () => {
1236
+ let e = Zn(), t = new Blob([e], { type: "application/json" }), n = URL.createObjectURL(t), r = document.createElement("a");
1122
1237
  r.href = n, r.download = `${j.value || "问卷"}.json`, r.click(), URL.revokeObjectURL(n), k.success("JSON已导出");
1123
- }, Qn = () => {
1238
+ }, er = () => {
1124
1239
  fe.value?.click();
1125
- }, $n = (e) => {
1240
+ }, tr = (e) => {
1126
1241
  let t = e.target.files?.[0];
1127
1242
  if (!t) return;
1128
1243
  let n = new FileReader();
1129
1244
  n.onload = (e) => {
1130
1245
  try {
1131
- Xn(e.target.result), k.success("JSON导入成功"), V.value && $();
1246
+ Qn(e.target.result), k.success("JSON导入成功"), V.value && $();
1132
1247
  } catch {
1133
1248
  k.error("JSON格式错误");
1134
1249
  }
1135
1250
  }, n.readAsText(t), e.target.value = "";
1136
- }, er = async (e) => {
1251
+ }, nr = async (e) => {
1137
1252
  if (!R.value) {
1138
1253
  k.warning("请先保存问卷");
1139
1254
  return;
1140
1255
  }
1141
1256
  if (e === "standalone") {
1142
- tr();
1257
+ rr();
1143
1258
  return;
1144
1259
  }
1145
1260
  try {
@@ -1150,10 +1265,10 @@ var Re = { class: "q-editor" }, ze = { class: "editor-header" }, Be = { class: "
1150
1265
  } catch (e) {
1151
1266
  k.error("导出失败: " + e.message);
1152
1267
  }
1153
- }, tr = () => {
1154
- let e = JSON.parse(Yn()), t = nr(e), n = new Blob([t], { type: "text/html" }), r = URL.createObjectURL(n), i = document.createElement("a");
1268
+ }, rr = () => {
1269
+ let e = JSON.parse(Zn()), t = ir(e), n = new Blob([t], { type: "text/html" }), r = URL.createObjectURL(n), i = document.createElement("a");
1155
1270
  i.href = r, i.download = `${e.title || "问卷"}.html`, i.click(), URL.revokeObjectURL(r), k.success("独立HTML表单已导出");
1156
- }, nr = (e) => {
1271
+ }, ir = (e) => {
1157
1272
  let t = `<div class="question" style="background:#f0f9ff; border-radius:6px; padding:16px; margin-bottom:16px;">
1158
1273
  <p class="q-title" style="color:#409eff;">您的邮箱 <span style="color:red">*</span></p>
1159
1274
  <p class="desc">请填写您的邮箱地址,用于追踪反馈来源</p>
@@ -1281,7 +1396,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1281
1396
  <\/script>
1282
1397
  </body>
1283
1398
  </html>`;
1284
- }, rr = async () => {
1399
+ }, ar = async () => {
1285
1400
  if (!R.value) return;
1286
1401
  let e = `${window.location.origin}/questionnaire-editor/${R.value}?collab=1`;
1287
1402
  try {
@@ -1289,7 +1404,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1289
1404
  } catch {
1290
1405
  k.info(`协作编辑链接: ${e}`);
1291
1406
  }
1292
- }, ir = async () => {
1407
+ }, or = async () => {
1293
1408
  if (!R.value) return;
1294
1409
  let e = prompt("请输入填写者邮箱(用于追踪反馈来源):");
1295
1410
  if (e === null) return;
@@ -1299,7 +1414,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1299
1414
  } catch {
1300
1415
  k.info(`填写链接: ${n}`);
1301
1416
  }
1302
- }, ar = (e) => e.split(/[\n,;,;\s]+/).map((e) => e.trim().toLowerCase()).filter((e) => e && e.includes("@") && e.includes(".")), or = (e) => {
1417
+ }, sr = (e) => e.split(/[\n,;,;\s]+/).map((e) => e.trim().toLowerCase()).filter((e) => e && e.includes("@") && e.includes(".")), cr = (e) => {
1303
1418
  let t = new FileReader();
1304
1419
  return t.onload = (e) => {
1305
1420
  try {
@@ -1309,15 +1424,15 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1309
1424
  let r = (e.split(/[,\t]/)[0] || "").trim().toLowerCase();
1310
1425
  r && r.includes("@") && r.includes(".") && n.push(r);
1311
1426
  }), n.length > 0) {
1312
- let e = ar(me.value);
1427
+ let e = sr(me.value);
1313
1428
  me.value = [.../* @__PURE__ */ new Set([...e, ...n])].join("\n"), k.success(`导入了 ${n.length} 个邮箱`);
1314
1429
  } else k.warning("未找到有效邮箱");
1315
1430
  } catch {
1316
1431
  k.error("文件解析失败");
1317
1432
  }
1318
1433
  }, t.readAsText(e), !1;
1319
- }, sr = () => {
1320
- let e = ar(me.value);
1434
+ }, lr = () => {
1435
+ let e = sr(me.value);
1321
1436
  if (e.length === 0) {
1322
1437
  k.warning("请先输入至少一个邮箱");
1323
1438
  return;
@@ -1334,40 +1449,40 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1334
1449
  token: t
1335
1450
  };
1336
1451
  }), k.success(`已生成 ${e.length} 条唯一链接`);
1337
- }, cr = async (e) => {
1452
+ }, ur = async (e) => {
1338
1453
  try {
1339
1454
  await navigator.clipboard.writeText(e), k.success("已复制");
1340
1455
  } catch {
1341
1456
  k.info(e);
1342
1457
  }
1343
- }, lr = () => {
1458
+ }, dr = () => {
1344
1459
  if (he.value.length === 0) return;
1345
1460
  let e = "邮箱,问卷链接,Token\n" + he.value.map((e) => `${e.email},${e.url},${e.token}`).join("\n"), t = new Blob([e], { type: "text/csv;charset=utf-8" }), n = URL.createObjectURL(t), r = document.createElement("a");
1346
1461
  r.href = n, r.download = `${j.value || "问卷"}_分发列表.csv`, r.click(), URL.revokeObjectURL(n), k.success("已下载分发列表");
1347
- }, ur = () => {
1462
+ }, fr = () => {
1348
1463
  R.value && u.push(`/questionnaire-stats/${R.value}`);
1349
- }, dr = () => {
1464
+ }, pr = () => {
1350
1465
  R.value && u.push(`/questionnaire-responses/${R.value}`);
1351
- }, fr = (e) => {
1352
- Ee.value = e, De.value = I.value[e].type, we.value = "", Te.value = [], Se.value = !0;
1353
- }, pr = (e, t) => {
1354
- Te.value = t;
1355
- }, mr = async () => {
1356
- if (!we.value.trim()) {
1466
+ }, mr = (e) => {
1467
+ De.value = e, ke.value = I.value[e].type, Te.value = "", Ee.value = [], Ce.value = !0;
1468
+ }, hr = (e, t) => {
1469
+ Ee.value = t;
1470
+ }, gr = async () => {
1471
+ if (!Te.value.trim()) {
1357
1472
  k.warning("请输入生成要求");
1358
1473
  return;
1359
1474
  }
1360
- Ce.value = !0;
1475
+ we.value = !0;
1361
1476
  try {
1362
1477
  await new Promise((e) => setTimeout(e, 1500));
1363
- let e = De.value, t = we.value, n = hr(e, t), r = I.value[Ee.value];
1364
- r && (r.title = n.title, r.referenceAnswer = n.referenceAnswer, r.scoringCriteria = n.scoringCriteria, n.options && r.options && (r.options = n.options), n.placeholder !== void 0 && (r.placeholder = n.placeholder), n.description && (r.description = n.description)), Se.value = !1, k.success("题目已生成");
1478
+ let e = ke.value, t = Te.value, n = _r(e, t), r = I.value[De.value];
1479
+ r && (r.title = n.title, r.referenceAnswer = n.referenceAnswer, r.scoringCriteria = n.scoringCriteria, n.options && r.options && (r.options = n.options), n.placeholder !== void 0 && (r.placeholder = n.placeholder), n.description && (r.description = n.description)), Ce.value = !1, k.success("题目已生成");
1365
1480
  } catch (e) {
1366
1481
  k.error("生成失败: " + e.message);
1367
1482
  } finally {
1368
- Ce.value = !1;
1483
+ we.value = !1;
1369
1484
  }
1370
- }, hr = (e, t) => {
1485
+ }, _r = (e, t) => {
1371
1486
  let n = {
1372
1487
  text: {
1373
1488
  title: "请简述JavaScript中let和const的区别",
@@ -1438,9 +1553,9 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1438
1553
  }
1439
1554
  };
1440
1555
  return n[e] || n.text;
1441
- }, gr = () => {
1556
+ }, vr = () => {
1442
1557
  ge.value = !0, ve.value = "";
1443
- }, _r = async () => {
1558
+ }, yr = async () => {
1444
1559
  _e.value = !0, ve.value = "";
1445
1560
  try {
1446
1561
  let e = await fetch(`/api/questionnaires/responses/${R.value}`);
@@ -1461,13 +1576,13 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1461
1576
  responses: t.responses || [],
1462
1577
  totalResponses: t.total || 0
1463
1578
  };
1464
- await new Promise((e) => setTimeout(e, 2e3)), ve.value = vr(n);
1579
+ await new Promise((e) => setTimeout(e, 2e3)), ve.value = br(n);
1465
1580
  } catch (e) {
1466
1581
  k.error("分析失败: " + e.message);
1467
1582
  } finally {
1468
1583
  _e.value = !1;
1469
1584
  }
1470
- }, vr = (e) => {
1585
+ }, br = (e) => {
1471
1586
  let { questionnaire: t, responses: n, totalResponses: r } = e, i = t.questions.map((e) => {
1472
1587
  let t = n.map((t) => {
1473
1588
  try {
@@ -1535,7 +1650,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1535
1650
  if (a += `
1536
1651
  <div style="background: #fff; border: 1px solid #ebeef5; border-radius: 8px; padding: 15px; margin: 10px 0;">
1537
1652
  <h4 style="color: #303133; margin-bottom: 10px;">${t + 1}. ${n.title || "未命名题目"}</h4>
1538
- <p style="color: #909399; font-size: 12px; margin-bottom: 10px;">类型:${yr(n.type)} | 回答数:${r.total}</p>
1653
+ <p style="color: #909399; font-size: 12px; margin-bottom: 10px;">类型:${xr(n.type)} | 回答数:${r.total}</p>
1539
1654
  `, n.type === "radio" || n.type === "select" || n.type === "checkbox") {
1540
1655
  if (r.options) {
1541
1656
  a += "<div style=\"margin-top: 10px;\">";
@@ -1576,7 +1691,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1576
1691
  </div>
1577
1692
  </div>
1578
1693
  `, a;
1579
- }, yr = (e) => ({
1694
+ }, xr = (e) => ({
1580
1695
  text: "文本题",
1581
1696
  radio: "单选题",
1582
1697
  checkbox: "多选题",
@@ -1585,7 +1700,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1585
1700
  scale: "量表题",
1586
1701
  matrix: "矩阵题",
1587
1702
  image: "图片题"
1588
- })[e] || e, br = () => {
1703
+ })[e] || e, Sr = () => {
1589
1704
  if (!ve.value) return;
1590
1705
  let e = `<!DOCTYPE html>
1591
1706
  <html lang="zh-CN">
@@ -1612,30 +1727,30 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1612
1727
  </body>
1613
1728
  </html>`, t = new Blob([e], { type: "text/html;charset=utf-8" }), n = URL.createObjectURL(t), r = document.createElement("a");
1614
1729
  r.href = n, r.download = `${j.value || "问卷"}_AI分析报告.html`, r.click(), URL.revokeObjectURL(n), k.success("AI分析报告已下载");
1615
- }, xr = async () => {
1730
+ }, Cr = async () => {
1616
1731
  if (D.value) {
1617
1732
  R.value = Number(D.value);
1618
1733
  try {
1619
1734
  let e;
1620
- e = typeof h.loadApi == "function" ? (await h.loadApi(D.value)).data : h.loadApi ? (await A.get(`${h.loadApi}/${D.value}`)).data : (await ie.value.get(D.value)).data, j.value = e.title, M.value = e.description || "", N.value = e.author || h.user?.name || "", P.value = e.status || "draft", F.value = e.begin_time ? new Date(e.begin_time) : null, ae.value = e.end_time ? new Date(e.end_time) : null, e.collab_closed && (U.value = !0), e.config && Xn(e.config);
1735
+ e = typeof h.loadApi == "function" ? (await h.loadApi(D.value)).data : h.loadApi ? (await A.get(`${h.loadApi}/${D.value}`)).data : (await ie.value.get(D.value)).data, j.value = e.title, M.value = e.description || "", N.value = e.author || h.user?.name || "", P.value = e.status || "draft", F.value = e.begin_time ? new Date(e.begin_time) : null, ae.value = e.end_time ? new Date(e.end_time) : null, e.collab_closed && (U.value = !0), e.config && Qn(e.config);
1621
1736
  } catch (e) {
1622
1737
  k.error("加载问卷失败: " + e.message);
1623
1738
  }
1624
1739
  }
1625
- }, Sr = () => {
1740
+ }, wr = () => {
1626
1741
  if (!R.value) {
1627
1742
  k.warning("请先保存问卷");
1628
1743
  return;
1629
1744
  }
1630
- be.value = !0;
1631
- }, Cr = (e) => {
1745
+ xe.value = !0;
1746
+ }, Tr = (e) => {
1632
1747
  try {
1633
1748
  let t = JSON.parse(e);
1634
1749
  t.title && (j.value = t.title), t.description && (M.value = t.description), t.author && (N.value = t.author), t.questions && (I.value = t.questions), t.settings && t.settings.showScore !== void 0 && (le.value = t.settings.showScore);
1635
1750
  } catch (e) {
1636
1751
  console.error("Version apply error:", e);
1637
1752
  }
1638
- }, wr = async () => {
1753
+ }, Er = async () => {
1639
1754
  if (H.value) {
1640
1755
  let e = W?.getMap("_meta");
1641
1756
  if (U.value || e?.get("_closed") === !0) {
@@ -1651,7 +1766,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1651
1766
  title: j.value,
1652
1767
  description: M.value,
1653
1768
  author: N.value || h.user?.name || "user",
1654
- config: Yn(),
1769
+ config: Zn(),
1655
1770
  status: P.value,
1656
1771
  begin_time: F.value,
1657
1772
  end_time: ae.value,
@@ -1672,7 +1787,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1672
1787
  let t = await ie.value.create(e);
1673
1788
  R.value = t.data.id, h.docId || u.replace(`/questionnaire-editor/${t.data.id}`);
1674
1789
  }
1675
- k.success("保存成功"), xe({
1790
+ k.success("保存成功"), Se({
1676
1791
  documentId: R.value,
1677
1792
  docType: "questionnaire",
1678
1793
  content: JSON.stringify({
@@ -1688,46 +1803,39 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1688
1803
  } catch (e) {
1689
1804
  k.error("保存失败: " + (e.message || e));
1690
1805
  }
1691
- }, Tr = () => u.push("/"), Er = [
1692
- "我可以帮您设计问卷结构、优化题目表述,或者提供调查方案建议。请问有什么需要帮助的?",
1693
- "这份问卷的结构很合理。建议检查题目顺序是否符合逻辑,是否从易到难排列。",
1694
- "根据问卷主题,我建议添加一些开放式问题,收集更详细的用户反馈。",
1695
- "我可以帮您检查问卷中是否存在引导性问题或歧义表述。需要我逐题分析吗?",
1696
- "建议为每个题目添加选项\"其他\"和\"不确定\",提高数据的完整性。",
1697
- "问卷的题量适中。如果题目较多,建议分页展示,减少受访者的疲劳感。",
1698
- "我可以帮您分析问卷的逻辑跳转设置是否合理,确保不同分支的题目正确显示。",
1699
- "建议在问卷开头添加简短的说明文字,告知受访者问卷的目的和预计填写时间。"
1700
- ], Dr = async (e, t = {}) => {
1701
- let n = R.value ? `${Cn}-${R.value}` : null;
1806
+ }, Dr = () => u.push("/"), Or = async (e, t = {}) => {
1807
+ let n = R.value ? `${Tn}-${R.value}` : null;
1702
1808
  await B.sendMessage(e, {
1703
1809
  ...t,
1704
1810
  roomId: n
1705
1811
  });
1706
1812
  let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = B.collabUsers.value.filter((e) => e.name !== B.currentUser.value.name);
1707
- (!r || i || a.length === 0) && (B.loading.value = !0, setTimeout(() => {
1708
- B.sendAiMessage(Er[Math.floor(Math.random() * Er.length)], n), B.loading.value = !1;
1709
- }, 800 + Math.random() * 1200));
1710
- }, Or = () => {
1711
- let e = R.value ? `${Cn}-${R.value}` : null;
1813
+ if (!r || i || a.length === 0) {
1814
+ B.loading.value = !0;
1815
+ let t = await be.chat(e, B.messages.value);
1816
+ B.sendAiMessage(t, n), B.loading.value = !1;
1817
+ }
1818
+ }, kr = () => {
1819
+ let e = R.value ? `${Tn}-${R.value}` : null;
1712
1820
  B.clearMessages(e);
1713
1821
  };
1714
1822
  return m(() => {
1715
- xr().then(() => {
1823
+ Cr().then(() => {
1716
1824
  if (R.value) {
1717
- Dn();
1825
+ kn();
1718
1826
  let e = new URLSearchParams(window.location.search);
1719
- e.get("collab") === "1" && Pn(), e.get("ai") === "1" && (ge.value = !0);
1827
+ e.get("collab") === "1" && In(), e.get("ai") === "1" && (ge.value = !0);
1720
1828
  }
1721
1829
  });
1722
1830
  }), p(() => {
1723
- kn(), G && (G.disconnect(), G.destroy()), W && W.destroy();
1831
+ jn(), G && (G.disconnect(), G.destroy()), W && W.destroy();
1724
1832
  }), (t, c) => {
1725
- let l = b("ArrowLeft"), u = b("el-icon"), p = b("el-button"), m = b("el-input"), h = b("el-option"), _ = b("el-select"), v = b("el-date-picker"), C = b("el-divider"), D = b("Download"), O = b("Upload"), ee = b("Printer"), k = b("ArrowDown"), te = b("el-dropdown-item"), A = b("el-dropdown-menu"), ne = b("el-dropdown"), re = b("Share"), ie = b("Link"), oe = b("Promotion"), se = b("Message"), L = b("Cpu"), xe = b("DataAnalysis"), Ee = b("List"), je = b("Monitor"), Ne = b("Check"), Pe = b("Clock"), U = b("Setting"), Fe = b("el-color-picker"), W = b("el-slider"), G = b("el-radio-button"), K = b("el-radio-group"), q = b("el-popover"), Le = b("el-input-number"), Cn = b("el-switch"), J = b("Delete"), wn = b("Top"), Tn = b("Bottom"), Y = b("PictureFilled"), X = b("el-upload"), Z = b("Close"), En = b("el-radio"), Q = b("Plus"), Dn = b("el-checkbox"), On = b("el-tag"), kn = b("StarFilled"), An = b("Switch"), jn = b("ArrowRight"), Mn = b("Trophy"), Pn = b("Document"), Fn = b("Edit"), $ = b("Select"), In = b("Finished"), Ln = b("Histogram"), Rn = b("Grid"), zn = b("el-dialog"), Yn = b("Loading"), Xn = b("el-table-column"), tr = b("el-link"), nr = b("el-table");
1833
+ let l = b("ArrowLeft"), u = b("el-icon"), p = b("el-button"), m = b("el-input"), h = b("el-option"), _ = b("el-select"), v = b("el-date-picker"), C = b("el-divider"), D = b("Download"), O = b("Upload"), ee = b("Printer"), k = b("ArrowDown"), te = b("el-dropdown-item"), A = b("el-dropdown-menu"), ne = b("el-dropdown"), re = b("Share"), ie = b("Link"), oe = b("Promotion"), se = b("Message"), L = b("Cpu"), be = b("DataAnalysis"), Se = b("List"), De = b("Monitor"), je = b("Check"), Pe = b("Clock"), Fe = b("Setting"), U = b("el-color-picker"), Ie = b("el-slider"), W = b("el-radio-button"), G = b("el-radio-group"), K = b("el-popover"), Re = b("el-input-number"), q = b("el-switch"), J = b("Delete"), Y = b("Top"), ze = b("Bottom"), Tn = b("PictureFilled"), X = b("el-upload"), Z = b("Close"), En = b("el-radio"), Q = b("Plus"), Dn = b("el-checkbox"), On = b("el-tag"), kn = b("StarFilled"), An = b("Switch"), jn = b("ArrowRight"), Mn = b("Trophy"), Nn = b("Document"), Pn = b("Edit"), In = b("Select"), Ln = b("Finished"), $ = b("Histogram"), Rn = b("Grid"), zn = b("el-dialog"), Bn = b("Loading"), Vn = b("el-table-column"), Zn = b("el-link"), Qn = b("el-table");
1726
1834
  return g(), i(e, null, [
1727
- a("div", Re, [a("div", ze, [a("div", Be, [
1835
+ a("div", Be, [a("div", Ve, [a("div", He, [
1728
1836
  T.value.backButton === "hide" ? r("", !0) : (g(), n(p, {
1729
1837
  key: 0,
1730
- onClick: Tr,
1838
+ onClick: Dr,
1731
1839
  size: "small",
1732
1840
  circle: "",
1733
1841
  disabled: T.value.backButton === "disable"
@@ -1756,7 +1864,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1756
1864
  style: { width: "140px" },
1757
1865
  disabled: !T.value.authorEditable
1758
1866
  }, null, 8, ["modelValue", "disabled"])
1759
- ]), a("div", Ve, [
1867
+ ]), a("div", Ue, [
1760
1868
  H.value ? r("", !0) : (g(), n(_, {
1761
1869
  key: 0,
1762
1870
  modelValue: P.value,
@@ -1802,7 +1910,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1802
1910
  H.value ? r("", !0) : (g(), n(p, {
1803
1911
  key: 3,
1804
1912
  size: "small",
1805
- onClick: Zn,
1913
+ onClick: $n,
1806
1914
  title: "导出JSON"
1807
1915
  }, {
1808
1916
  default: w(() => [s(u, null, {
@@ -1814,7 +1922,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1814
1922
  H.value ? r("", !0) : (g(), n(p, {
1815
1923
  key: 4,
1816
1924
  size: "small",
1817
- onClick: Qn,
1925
+ onClick: er,
1818
1926
  title: "导入JSON"
1819
1927
  }, {
1820
1928
  default: w(() => [s(u, null, {
@@ -1829,7 +1937,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1829
1937
  type: "file",
1830
1938
  accept: ".json",
1831
1939
  style: { display: "none" },
1832
- onChange: $n
1940
+ onChange: tr
1833
1941
  }, null, 544),
1834
1942
  H.value ? r("", !0) : (g(), n(C, {
1835
1943
  key: 5,
@@ -1838,7 +1946,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1838
1946
  H.value ? r("", !0) : (g(), n(ne, {
1839
1947
  key: 6,
1840
1948
  trigger: "click",
1841
- onCommand: er
1949
+ onCommand: nr
1842
1950
  }, {
1843
1951
  dropdown: w(() => [s(A, null, {
1844
1952
  default: w(() => [
@@ -1885,7 +1993,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1885
1993
  key: 8,
1886
1994
  size: "small",
1887
1995
  type: V.value ? "success" : "default",
1888
- onClick: Nn
1996
+ onClick: Fn
1889
1997
  }, {
1890
1998
  default: w(() => [s(u, null, {
1891
1999
  default: w(() => [s(re)]),
@@ -1897,7 +2005,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1897
2005
  key: 9,
1898
2006
  size: "small",
1899
2007
  circle: "",
1900
- onClick: rr,
2008
+ onClick: ar,
1901
2009
  title: "分享协作编辑链接"
1902
2010
  }, {
1903
2011
  default: w(() => [s(u, null, {
@@ -1910,7 +2018,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1910
2018
  key: 10,
1911
2019
  size: "small",
1912
2020
  circle: "",
1913
- onClick: ir,
2021
+ onClick: or,
1914
2022
  title: "分享填写链接"
1915
2023
  }, {
1916
2024
  default: w(() => [s(u, null, {
@@ -1935,7 +2043,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1935
2043
  R.value && !H.value ? (g(), n(p, {
1936
2044
  key: 12,
1937
2045
  size: "small",
1938
- onClick: gr,
2046
+ onClick: vr,
1939
2047
  title: "AI分析"
1940
2048
  }, {
1941
2049
  default: w(() => [s(u, null, {
@@ -1947,11 +2055,11 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1947
2055
  R.value && !H.value ? (g(), n(p, {
1948
2056
  key: 13,
1949
2057
  size: "small",
1950
- onClick: ur,
2058
+ onClick: fr,
1951
2059
  title: "查看统计"
1952
2060
  }, {
1953
2061
  default: w(() => [s(u, null, {
1954
- default: w(() => [s(xe)]),
2062
+ default: w(() => [s(be)]),
1955
2063
  _: 1
1956
2064
  })]),
1957
2065
  _: 1
@@ -1959,11 +2067,11 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1959
2067
  R.value && !H.value ? (g(), n(p, {
1960
2068
  key: 14,
1961
2069
  size: "small",
1962
- onClick: dr,
2070
+ onClick: pr,
1963
2071
  title: "反馈列表"
1964
2072
  }, {
1965
2073
  default: w(() => [s(u, null, {
1966
- default: w(() => [s(Ee)]),
2074
+ default: w(() => [s(Se)]),
1967
2075
  _: 1
1968
2076
  })]),
1969
2077
  _: 1
@@ -1976,7 +2084,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1976
2084
  title: "AI助手"
1977
2085
  }, {
1978
2086
  default: w(() => [s(u, null, {
1979
- default: w(() => [s(je)]),
2087
+ default: w(() => [s(De)]),
1980
2088
  _: 1
1981
2089
  })]),
1982
2090
  _: 1
@@ -1984,10 +2092,10 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1984
2092
  s(p, {
1985
2093
  size: "small",
1986
2094
  type: "primary",
1987
- onClick: wr
2095
+ onClick: Er
1988
2096
  }, {
1989
2097
  default: w(() => [s(u, null, {
1990
- default: w(() => [s(Ne)]),
2098
+ default: w(() => [s(je)]),
1991
2099
  _: 1
1992
2100
  }), c[53] ||= o(" 保存", -1)]),
1993
2101
  _: 1
@@ -1997,7 +2105,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
1997
2105
  size: "small",
1998
2106
  circle: "",
1999
2107
  title: "更新履历",
2000
- onClick: Sr
2108
+ onClick: wr
2001
2109
  }, {
2002
2110
  default: w(() => [s(u, null, {
2003
2111
  default: w(() => [s(Pe)]),
@@ -2005,7 +2113,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2005
2113
  })]),
2006
2114
  _: 1
2007
2115
  })) : r("", !0)
2008
- ])]), a("div", He, [a("div", Ue, [
2116
+ ])]), a("div", We, [a("div", Ge, [
2009
2117
  a("div", {
2010
2118
  class: "q-header-card",
2011
2119
  style: f({
@@ -2026,12 +2134,12 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2026
2134
  "--desc-color": z.descColor
2027
2135
  })
2028
2136
  }, [
2029
- a("div", We, [s(m, {
2137
+ a("div", Ke, [s(m, {
2030
2138
  modelValue: j.value,
2031
2139
  "onUpdate:modelValue": c[7] ||= (e) => j.value = e,
2032
2140
  placeholder: "请输入问卷标题",
2033
2141
  class: "q-title-input"
2034
- }, null, 8, ["modelValue"]), s(q, {
2142
+ }, null, 8, ["modelValue"]), s(K, {
2035
2143
  placement: "right",
2036
2144
  width: 320,
2037
2145
  trigger: "click"
@@ -2042,18 +2150,18 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2042
2150
  class: "q-header-setting-btn"
2043
2151
  }, {
2044
2152
  default: w(() => [s(u, null, {
2045
- default: w(() => [s(U)]),
2153
+ default: w(() => [s(Fe)]),
2046
2154
  _: 1
2047
2155
  })]),
2048
2156
  _: 1
2049
2157
  })]),
2050
- default: w(() => [a("div", Ge, [
2051
- a("div", Ke, [c[54] ||= a("span", { class: "q-settings-label" }, "背景颜色", -1), s(Fe, {
2158
+ default: w(() => [a("div", qe, [
2159
+ a("div", Je, [c[54] ||= a("span", { class: "q-settings-label" }, "背景颜色", -1), s(U, {
2052
2160
  modelValue: z.backgroundColor,
2053
2161
  "onUpdate:modelValue": c[8] ||= (e) => z.backgroundColor = e,
2054
2162
  size: "small"
2055
2163
  }, null, 8, ["modelValue"])]),
2056
- a("div", qe, [c[55] ||= a("span", { class: "q-settings-label" }, "字体", -1), s(_, {
2164
+ a("div", Ye, [c[55] ||= a("span", { class: "q-settings-label" }, "字体", -1), s(_, {
2057
2165
  modelValue: z.headerFont,
2058
2166
  "onUpdate:modelValue": c[9] ||= (e) => z.headerFont = e,
2059
2167
  size: "small",
@@ -2091,7 +2199,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2091
2199
  ]),
2092
2200
  _: 1
2093
2201
  }, 8, ["modelValue"])]),
2094
- a("div", Je, [c[56] ||= a("span", { class: "q-settings-label" }, "字号", -1), s(W, {
2202
+ a("div", Xe, [c[56] ||= a("span", { class: "q-settings-label" }, "字号", -1), s(Ie, {
2095
2203
  modelValue: z.headerFontSize,
2096
2204
  "onUpdate:modelValue": c[10] ||= (e) => z.headerFontSize = e,
2097
2205
  min: 10,
@@ -2100,49 +2208,49 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2100
2208
  "show-input": "",
2101
2209
  size: "small"
2102
2210
  }, null, 8, ["modelValue"])]),
2103
- a("div", Ye, [c[59] ||= a("span", { class: "q-settings-label" }, "样式", -1), s(K, {
2211
+ a("div", Ze, [c[59] ||= a("span", { class: "q-settings-label" }, "样式", -1), s(G, {
2104
2212
  modelValue: z.headerFontStyle,
2105
2213
  "onUpdate:modelValue": c[11] ||= (e) => z.headerFontStyle = e,
2106
2214
  size: "small"
2107
2215
  }, {
2108
- default: w(() => [s(G, { value: "normal" }, {
2216
+ default: w(() => [s(W, { value: "normal" }, {
2109
2217
  default: w(() => [...c[57] ||= [o("常规", -1)]]),
2110
2218
  _: 1
2111
- }), s(G, { value: "italic" }, {
2219
+ }), s(W, { value: "italic" }, {
2112
2220
  default: w(() => [...c[58] ||= [o("斜体", -1)]]),
2113
2221
  _: 1
2114
2222
  })]),
2115
2223
  _: 1
2116
2224
  }, 8, ["modelValue"])]),
2117
- a("div", Xe, [c[60] ||= a("span", { class: "q-settings-label" }, "颜色", -1), s(Fe, {
2225
+ a("div", Qe, [c[60] ||= a("span", { class: "q-settings-label" }, "颜色", -1), s(U, {
2118
2226
  modelValue: z.headerColor,
2119
2227
  "onUpdate:modelValue": c[12] ||= (e) => z.headerColor = e,
2120
2228
  size: "small"
2121
2229
  }, null, 8, ["modelValue"])]),
2122
2230
  s(C),
2123
2231
  c[81] ||= a("div", { class: "q-settings-section-title" }, "标题样式", -1),
2124
- a("div", Ze, [c[64] ||= a("span", { class: "q-settings-label" }, "对齐", -1), s(K, {
2232
+ a("div", $e, [c[64] ||= a("span", { class: "q-settings-label" }, "对齐", -1), s(G, {
2125
2233
  modelValue: z.titleAlign,
2126
2234
  "onUpdate:modelValue": c[13] ||= (e) => z.titleAlign = e,
2127
2235
  size: "small"
2128
2236
  }, {
2129
2237
  default: w(() => [
2130
- s(G, { value: "left" }, {
2238
+ s(W, { value: "left" }, {
2131
2239
  default: w(() => [...c[61] ||= [o("左", -1)]]),
2132
2240
  _: 1
2133
2241
  }),
2134
- s(G, { value: "center" }, {
2242
+ s(W, { value: "center" }, {
2135
2243
  default: w(() => [...c[62] ||= [o("中", -1)]]),
2136
2244
  _: 1
2137
2245
  }),
2138
- s(G, { value: "right" }, {
2246
+ s(W, { value: "right" }, {
2139
2247
  default: w(() => [...c[63] ||= [o("右", -1)]]),
2140
2248
  _: 1
2141
2249
  })
2142
2250
  ]),
2143
2251
  _: 1
2144
2252
  }, 8, ["modelValue"])]),
2145
- a("div", Qe, [c[65] ||= a("span", { class: "q-settings-label" }, "字体", -1), s(_, {
2253
+ a("div", et, [c[65] ||= a("span", { class: "q-settings-label" }, "字体", -1), s(_, {
2146
2254
  modelValue: z.titleFont,
2147
2255
  "onUpdate:modelValue": c[14] ||= (e) => z.titleFont = e,
2148
2256
  size: "small",
@@ -2180,21 +2288,21 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2180
2288
  ]),
2181
2289
  _: 1
2182
2290
  }, 8, ["modelValue"])]),
2183
- a("div", $e, [c[68] ||= a("span", { class: "q-settings-label" }, "样式", -1), s(K, {
2291
+ a("div", tt, [c[68] ||= a("span", { class: "q-settings-label" }, "样式", -1), s(G, {
2184
2292
  modelValue: z.titleFontStyle,
2185
2293
  "onUpdate:modelValue": c[15] ||= (e) => z.titleFontStyle = e,
2186
2294
  size: "small"
2187
2295
  }, {
2188
- default: w(() => [s(G, { value: "normal" }, {
2296
+ default: w(() => [s(W, { value: "normal" }, {
2189
2297
  default: w(() => [...c[66] ||= [o("常规", -1)]]),
2190
2298
  _: 1
2191
- }), s(G, { value: "italic" }, {
2299
+ }), s(W, { value: "italic" }, {
2192
2300
  default: w(() => [...c[67] ||= [o("斜体", -1)]]),
2193
2301
  _: 1
2194
2302
  })]),
2195
2303
  _: 1
2196
2304
  }, 8, ["modelValue"])]),
2197
- a("div", et, [c[69] ||= a("span", { class: "q-settings-label" }, "字号", -1), s(W, {
2305
+ a("div", nt, [c[69] ||= a("span", { class: "q-settings-label" }, "字号", -1), s(Ie, {
2198
2306
  modelValue: z.titleFontSize,
2199
2307
  "onUpdate:modelValue": c[16] ||= (e) => z.titleFontSize = e,
2200
2308
  min: 12,
@@ -2203,35 +2311,35 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2203
2311
  "show-input": "",
2204
2312
  size: "small"
2205
2313
  }, null, 8, ["modelValue"])]),
2206
- a("div", tt, [c[70] ||= a("span", { class: "q-settings-label" }, "颜色", -1), s(Fe, {
2314
+ a("div", rt, [c[70] ||= a("span", { class: "q-settings-label" }, "颜色", -1), s(U, {
2207
2315
  modelValue: z.titleColor,
2208
2316
  "onUpdate:modelValue": c[17] ||= (e) => z.titleColor = e,
2209
2317
  size: "small"
2210
2318
  }, null, 8, ["modelValue"])]),
2211
2319
  s(C),
2212
2320
  c[82] ||= a("div", { class: "q-settings-section-title" }, "说明样式", -1),
2213
- a("div", nt, [c[74] ||= a("span", { class: "q-settings-label" }, "对齐", -1), s(K, {
2321
+ a("div", it, [c[74] ||= a("span", { class: "q-settings-label" }, "对齐", -1), s(G, {
2214
2322
  modelValue: z.descAlign,
2215
2323
  "onUpdate:modelValue": c[18] ||= (e) => z.descAlign = e,
2216
2324
  size: "small"
2217
2325
  }, {
2218
2326
  default: w(() => [
2219
- s(G, { value: "left" }, {
2327
+ s(W, { value: "left" }, {
2220
2328
  default: w(() => [...c[71] ||= [o("左", -1)]]),
2221
2329
  _: 1
2222
2330
  }),
2223
- s(G, { value: "center" }, {
2331
+ s(W, { value: "center" }, {
2224
2332
  default: w(() => [...c[72] ||= [o("中", -1)]]),
2225
2333
  _: 1
2226
2334
  }),
2227
- s(G, { value: "right" }, {
2335
+ s(W, { value: "right" }, {
2228
2336
  default: w(() => [...c[73] ||= [o("右", -1)]]),
2229
2337
  _: 1
2230
2338
  })
2231
2339
  ]),
2232
2340
  _: 1
2233
2341
  }, 8, ["modelValue"])]),
2234
- a("div", rt, [c[75] ||= a("span", { class: "q-settings-label" }, "字体", -1), s(_, {
2342
+ a("div", at, [c[75] ||= a("span", { class: "q-settings-label" }, "字体", -1), s(_, {
2235
2343
  modelValue: z.descFont,
2236
2344
  "onUpdate:modelValue": c[19] ||= (e) => z.descFont = e,
2237
2345
  size: "small",
@@ -2269,21 +2377,21 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2269
2377
  ]),
2270
2378
  _: 1
2271
2379
  }, 8, ["modelValue"])]),
2272
- a("div", it, [c[78] ||= a("span", { class: "q-settings-label" }, "样式", -1), s(K, {
2380
+ a("div", ot, [c[78] ||= a("span", { class: "q-settings-label" }, "样式", -1), s(G, {
2273
2381
  modelValue: z.descFontStyle,
2274
2382
  "onUpdate:modelValue": c[20] ||= (e) => z.descFontStyle = e,
2275
2383
  size: "small"
2276
2384
  }, {
2277
- default: w(() => [s(G, { value: "normal" }, {
2385
+ default: w(() => [s(W, { value: "normal" }, {
2278
2386
  default: w(() => [...c[76] ||= [o("常规", -1)]]),
2279
2387
  _: 1
2280
- }), s(G, { value: "italic" }, {
2388
+ }), s(W, { value: "italic" }, {
2281
2389
  default: w(() => [...c[77] ||= [o("斜体", -1)]]),
2282
2390
  _: 1
2283
2391
  })]),
2284
2392
  _: 1
2285
2393
  }, 8, ["modelValue"])]),
2286
- a("div", at, [c[79] ||= a("span", { class: "q-settings-label" }, "字号", -1), s(W, {
2394
+ a("div", st, [c[79] ||= a("span", { class: "q-settings-label" }, "字号", -1), s(Ie, {
2287
2395
  modelValue: z.descFontSize,
2288
2396
  "onUpdate:modelValue": c[21] ||= (e) => z.descFontSize = e,
2289
2397
  min: 10,
@@ -2292,7 +2400,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2292
2400
  "show-input": "",
2293
2401
  size: "small"
2294
2402
  }, null, 8, ["modelValue"])]),
2295
- a("div", ot, [c[80] ||= a("span", { class: "q-settings-label" }, "颜色", -1), s(Fe, {
2403
+ a("div", ct, [c[80] ||= a("span", { class: "q-settings-label" }, "颜色", -1), s(U, {
2296
2404
  modelValue: z.descColor,
2297
2405
  "onUpdate:modelValue": c[22] ||= (e) => z.descColor = e,
2298
2406
  size: "small"
@@ -2308,18 +2416,18 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2308
2416
  placeholder: "问卷说明(选填)",
2309
2417
  class: "q-desc-input"
2310
2418
  }, null, 8, ["modelValue"]),
2311
- a("div", st, [a("div", ct, [
2419
+ a("div", lt, [a("div", ut, [
2312
2420
  c[83] ||= a("span", null, "及格分:", -1),
2313
- s(Le, {
2421
+ s(Re, {
2314
2422
  modelValue: ce.value,
2315
2423
  "onUpdate:modelValue": c[24] ||= (e) => ce.value = e,
2316
2424
  min: 0,
2317
2425
  size: "small"
2318
2426
  }, null, 8, ["modelValue"]),
2319
- a("span", lt, "总分:" + x(Me.value) + "分", 1)
2320
- ]), a("div", ut, [
2427
+ a("span", dt, "总分:" + x(Ne.value) + "分", 1)
2428
+ ]), a("div", ft, [
2321
2429
  c[84] ||= a("span", null, "立刻给出评分:", -1),
2322
- s(Cn, {
2430
+ s(q, {
2323
2431
  modelValue: le.value,
2324
2432
  "onUpdate:modelValue": c[25] ||= (e) => le.value = e,
2325
2433
  size: "small",
@@ -2329,19 +2437,19 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2329
2437
  c[85] ||= a("span", { class: "q-show-score-tip" }, "(选\"否\"则提交时不显示得分)", -1)
2330
2438
  ])])
2331
2439
  ], 4),
2332
- a("div", dt, [(g(!0), i(e, null, y(I.value, (t, l) => (g(), i("div", {
2440
+ a("div", pt, [(g(!0), i(e, null, y(I.value, (t, l) => (g(), i("div", {
2333
2441
  key: t.id,
2334
2442
  class: d(["q-card", { active: ue.value === t.id }]),
2335
2443
  onClick: (e) => ue.value = t.id,
2336
2444
  draggable: "true",
2337
- onDragstart: (e) => Kn(l, e),
2338
- onDragover: E((e) => qn(l, e), ["prevent"]),
2339
- onDrop: (e) => Jn(l, e)
2445
+ onDragstart: (e) => Jn(l, e),
2446
+ onDragover: E((e) => Yn(l, e), ["prevent"]),
2447
+ onDrop: (e) => Xn(l, e)
2340
2448
  }, [
2341
- a("div", pt, [s(p, {
2449
+ a("div", ht, [s(p, {
2342
2450
  size: "small",
2343
2451
  circle: "",
2344
- onClick: E((e) => fr(l), ["stop"]),
2452
+ onClick: E((e) => mr(l), ["stop"]),
2345
2453
  title: "AI生成题目",
2346
2454
  class: "ai-gen-btn"
2347
2455
  }, {
@@ -2354,7 +2462,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2354
2462
  size: "small",
2355
2463
  circle: "",
2356
2464
  type: "danger",
2357
- onClick: E((e) => Vn(l), ["stop"]),
2465
+ onClick: E((e) => Un(l), ["stop"]),
2358
2466
  title: "删除"
2359
2467
  }, {
2360
2468
  default: w(() => [s(u, null, {
@@ -2363,8 +2471,8 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2363
2471
  })]),
2364
2472
  _: 1
2365
2473
  }, 8, ["onClick"])]),
2366
- a("div", mt, [
2367
- a("span", ht, x(l + 1) + ".", 1),
2474
+ a("div", gt, [
2475
+ a("span", _t, x(l + 1) + ".", 1),
2368
2476
  s(m, {
2369
2477
  modelValue: t.title,
2370
2478
  "onUpdate:modelValue": (e) => t.title = e,
@@ -2372,16 +2480,16 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2372
2480
  size: "small",
2373
2481
  class: "q-title"
2374
2482
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
2375
- a("div", gt, [
2483
+ a("div", vt, [
2376
2484
  s(p, {
2377
2485
  size: "small",
2378
2486
  circle: "",
2379
- onClick: E((e) => Hn(l, -1), ["stop"]),
2487
+ onClick: E((e) => Wn(l, -1), ["stop"]),
2380
2488
  disabled: l === 0,
2381
2489
  title: "上移"
2382
2490
  }, {
2383
2491
  default: w(() => [s(u, null, {
2384
- default: w(() => [s(wn)]),
2492
+ default: w(() => [s(Y)]),
2385
2493
  _: 1
2386
2494
  })]),
2387
2495
  _: 1
@@ -2389,17 +2497,17 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2389
2497
  s(p, {
2390
2498
  size: "small",
2391
2499
  circle: "",
2392
- onClick: E((e) => Hn(l, 1), ["stop"]),
2500
+ onClick: E((e) => Wn(l, 1), ["stop"]),
2393
2501
  disabled: l === I.value.length - 1,
2394
2502
  title: "下移"
2395
2503
  }, {
2396
2504
  default: w(() => [s(u, null, {
2397
- default: w(() => [s(Tn)]),
2505
+ default: w(() => [s(ze)]),
2398
2506
  _: 1
2399
2507
  })]),
2400
2508
  _: 1
2401
2509
  }, 8, ["onClick", "disabled"]),
2402
- s(Cn, {
2510
+ s(q, {
2403
2511
  modelValue: t.required,
2404
2512
  "onUpdate:modelValue": (e) => t.required = e,
2405
2513
  size: "small",
@@ -2409,16 +2517,16 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2409
2517
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
2410
2518
  ])
2411
2519
  ]),
2412
- a("div", _t, [
2413
- a("div", vt, [s(m, {
2520
+ a("div", yt, [
2521
+ a("div", bt, [s(m, {
2414
2522
  modelValue: t.description,
2415
2523
  "onUpdate:modelValue": (e) => t.description = e,
2416
2524
  placeholder: "题目说明(选填)",
2417
2525
  size: "small"
2418
2526
  }, null, 8, ["modelValue", "onUpdate:modelValue"])]),
2419
- a("div", yt, [s(X, {
2527
+ a("div", xt, [s(X, {
2420
2528
  "show-file-list": !1,
2421
- "before-upload": (e) => Gn(t, e),
2529
+ "before-upload": (e) => qn(t, e),
2422
2530
  accept: "image/*",
2423
2531
  class: "q-img-upload"
2424
2532
  }, {
@@ -2427,13 +2535,13 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2427
2535
  circle: ""
2428
2536
  }, {
2429
2537
  default: w(() => [s(u, null, {
2430
- default: w(() => [s(Y)]),
2538
+ default: w(() => [s(Tn)]),
2431
2539
  _: 1
2432
2540
  })]),
2433
2541
  _: 1
2434
2542
  })]),
2435
2543
  _: 1
2436
- }, 8, ["before-upload"]), t.image ? (g(), i("div", bt, [a("img", { src: t.image }, null, 8, xt), s(p, {
2544
+ }, 8, ["before-upload"]), t.image ? (g(), i("div", St, [a("img", { src: t.image }, null, 8, Ct), s(p, {
2437
2545
  size: "small",
2438
2546
  circle: "",
2439
2547
  type: "danger",
@@ -2446,7 +2554,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2446
2554
  })]),
2447
2555
  _: 1
2448
2556
  }, 8, ["onClick"])])) : r("", !0)]),
2449
- t.type === "text" ? (g(), i("div", St, [s(m, {
2557
+ t.type === "text" ? (g(), i("div", wt, [s(m, {
2450
2558
  modelValue: t.placeholder,
2451
2559
  "onUpdate:modelValue": (e) => t.placeholder = e,
2452
2560
  placeholder: "回答提示文字",
@@ -2469,7 +2577,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2469
2577
  })]),
2470
2578
  _: 1
2471
2579
  }, 8, ["modelValue", "onUpdate:modelValue"])])) : r("", !0),
2472
- t.type === "radio" ? (g(), i("div", Ct, [(g(!0), i(e, null, y(t.options, (e, n) => (g(), i("div", {
2580
+ t.type === "radio" ? (g(), i("div", Tt, [(g(!0), i(e, null, y(t.options, (e, n) => (g(), i("div", {
2473
2581
  key: n,
2474
2582
  class: "q-option-item"
2475
2583
  }, [
@@ -2488,7 +2596,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2488
2596
  size: "small",
2489
2597
  circle: "",
2490
2598
  type: "danger",
2491
- onClick: (e) => Wn(t, n)
2599
+ onClick: (e) => Kn(t, n)
2492
2600
  }, {
2493
2601
  default: w(() => [s(u, null, {
2494
2602
  default: w(() => [s(Z)]),
@@ -2498,7 +2606,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2498
2606
  }, 8, ["onClick"])
2499
2607
  ]))), 128)), s(p, {
2500
2608
  size: "small",
2501
- onClick: (e) => Un(t)
2609
+ onClick: (e) => Gn(t)
2502
2610
  }, {
2503
2611
  default: w(() => [s(u, null, {
2504
2612
  default: w(() => [s(Q)]),
@@ -2506,7 +2614,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2506
2614
  }), c[86] ||= o(" 添加选项", -1)]),
2507
2615
  _: 1
2508
2616
  }, 8, ["onClick"])])) : r("", !0),
2509
- t.type === "checkbox" ? (g(), i("div", wt, [(g(!0), i(e, null, y(t.options, (e, n) => (g(), i("div", {
2617
+ t.type === "checkbox" ? (g(), i("div", Et, [(g(!0), i(e, null, y(t.options, (e, n) => (g(), i("div", {
2510
2618
  key: n,
2511
2619
  class: "q-option-item"
2512
2620
  }, [
@@ -2522,7 +2630,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2522
2630
  size: "small",
2523
2631
  circle: "",
2524
2632
  type: "danger",
2525
- onClick: (e) => Wn(t, n)
2633
+ onClick: (e) => Kn(t, n)
2526
2634
  }, {
2527
2635
  default: w(() => [s(u, null, {
2528
2636
  default: w(() => [s(Z)]),
@@ -2532,7 +2640,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2532
2640
  }, 8, ["onClick"])
2533
2641
  ]))), 128)), s(p, {
2534
2642
  size: "small",
2535
- onClick: (e) => Un(t)
2643
+ onClick: (e) => Gn(t)
2536
2644
  }, {
2537
2645
  default: w(() => [s(u, null, {
2538
2646
  default: w(() => [s(Q)]),
@@ -2540,7 +2648,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2540
2648
  }), c[87] ||= o(" 添加选项", -1)]),
2541
2649
  _: 1
2542
2650
  }, 8, ["onClick"])])) : r("", !0),
2543
- t.type === "select" ? (g(), i("div", Tt, [(g(!0), i(e, null, y(t.options, (e, n) => (g(), i("div", {
2651
+ t.type === "select" ? (g(), i("div", Dt, [(g(!0), i(e, null, y(t.options, (e, n) => (g(), i("div", {
2544
2652
  key: n,
2545
2653
  class: "q-option-item"
2546
2654
  }, [
@@ -2562,7 +2670,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2562
2670
  size: "small",
2563
2671
  circle: "",
2564
2672
  type: "danger",
2565
- onClick: (e) => Wn(t, n)
2673
+ onClick: (e) => Kn(t, n)
2566
2674
  }, {
2567
2675
  default: w(() => [s(u, null, {
2568
2676
  default: w(() => [s(Z)]),
@@ -2572,7 +2680,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2572
2680
  }, 8, ["onClick"])
2573
2681
  ]))), 128)), s(p, {
2574
2682
  size: "small",
2575
- onClick: (e) => Un(t)
2683
+ onClick: (e) => Gn(t)
2576
2684
  }, {
2577
2685
  default: w(() => [s(u, null, {
2578
2686
  default: w(() => [s(Q)]),
@@ -2580,9 +2688,9 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2580
2688
  }), c[88] ||= o(" 添加选项", -1)]),
2581
2689
  _: 1
2582
2690
  }, 8, ["onClick"])])) : r("", !0),
2583
- t.type === "rating" ? (g(), i("div", Et, [a("div", Dt, [
2691
+ t.type === "rating" ? (g(), i("div", Ot, [a("div", kt, [
2584
2692
  c[91] ||= a("span", null, "最大分值:", -1),
2585
- s(Le, {
2693
+ s(Re, {
2586
2694
  modelValue: t.maxRating,
2587
2695
  "onUpdate:modelValue": (e) => t.maxRating = e,
2588
2696
  min: 3,
@@ -2590,21 +2698,21 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2590
2698
  size: "small"
2591
2699
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
2592
2700
  c[92] ||= a("span", { style: { "margin-left": "16px" } }, "图标:", -1),
2593
- s(K, {
2701
+ s(G, {
2594
2702
  modelValue: t.ratingIcon,
2595
2703
  "onUpdate:modelValue": (e) => t.ratingIcon = e,
2596
2704
  size: "small"
2597
2705
  }, {
2598
- default: w(() => [s(G, { label: "star" }, {
2706
+ default: w(() => [s(W, { label: "star" }, {
2599
2707
  default: w(() => [...c[89] ||= [o("星形", -1)]]),
2600
2708
  _: 1
2601
- }), s(G, { label: "heart" }, {
2709
+ }), s(W, { label: "heart" }, {
2602
2710
  default: w(() => [...c[90] ||= [o("心形", -1)]]),
2603
2711
  _: 1
2604
2712
  })]),
2605
2713
  _: 1
2606
2714
  }, 8, ["modelValue", "onUpdate:modelValue"])
2607
- ]), a("div", Ot, [(g(!0), i(e, null, y(t.maxRating || 5, (e) => (g(), i("span", {
2715
+ ]), a("div", At, [(g(!0), i(e, null, y(t.maxRating || 5, (e) => (g(), i("span", {
2608
2716
  key: e,
2609
2717
  class: "rating-icon",
2610
2718
  onClick: (n) => t._preview = e
@@ -2614,8 +2722,8 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2614
2722
  }, {
2615
2723
  default: w(() => [s(kn)]),
2616
2724
  _: 1
2617
- }, 8, ["class"])], 8, kt))), 128))])])) : r("", !0),
2618
- t.type === "scale" ? (g(), i("div", At, [a("div", jt, [
2725
+ }, 8, ["class"])], 8, jt))), 128))])])) : r("", !0),
2726
+ t.type === "scale" ? (g(), i("div", Mt, [a("div", Nt, [
2619
2727
  s(m, {
2620
2728
  modelValue: t.scaleMinLabel,
2621
2729
  "onUpdate:modelValue": (e) => t.scaleMinLabel = e,
@@ -2632,18 +2740,18 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2632
2740
  style: { width: "120px" }
2633
2741
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
2634
2742
  c[94] ||= a("span", { style: { "margin-left": "12px" } }, "刻度数:", -1),
2635
- s(Le, {
2743
+ s(Re, {
2636
2744
  modelValue: t.scaleCount,
2637
2745
  "onUpdate:modelValue": (e) => t.scaleCount = e,
2638
2746
  min: 5,
2639
2747
  max: 10,
2640
2748
  size: "small"
2641
2749
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
2642
- ]), a("div", Mt, [(g(!0), i(e, null, y(t.scaleCount || 7, (e) => (g(), i("div", {
2750
+ ]), a("div", Pt, [(g(!0), i(e, null, y(t.scaleCount || 7, (e) => (g(), i("div", {
2643
2751
  key: e,
2644
2752
  class: "scale-dot"
2645
- }, [c[95] ||= a("div", { class: "dot" }, null, -1), a("span", Nt, x(e), 1)]))), 128))])])) : r("", !0),
2646
- t.type === "matrix" ? (g(), i("div", Pt, [a("div", Ft, [a("div", It, [
2753
+ }, [c[95] ||= a("div", { class: "dot" }, null, -1), a("span", Ft, x(e), 1)]))), 128))])])) : r("", !0),
2754
+ t.type === "matrix" ? (g(), i("div", It, [a("div", Lt, [a("div", Rt, [
2647
2755
  c[97] ||= a("span", { class: "label" }, "行标题:", -1),
2648
2756
  (g(!0), i(e, null, y(t.matrixRows, (e, n) => (g(), i("div", {
2649
2757
  key: n,
@@ -2676,7 +2784,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2676
2784
  }), c[96] ||= o(" 添加行", -1)]),
2677
2785
  _: 1
2678
2786
  }, 8, ["onClick"])
2679
- ]), a("div", Lt, [
2787
+ ]), a("div", zt, [
2680
2788
  c[99] ||= a("span", { class: "label" }, "列标题:", -1),
2681
2789
  (g(!0), i(e, null, y(t.matrixCols, (e, n) => (g(), i("div", {
2682
2790
  key: n,
@@ -2709,19 +2817,19 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2709
2817
  }), c[98] ||= o(" 添加列", -1)]),
2710
2818
  _: 1
2711
2819
  }, 8, ["onClick"])
2712
- ])]), t.matrixRows.length && t.matrixCols.length ? (g(), i("div", Rt, [a("table", zt, [a("thead", null, [a("tr", null, [c[100] ||= a("th", null, null, -1), (g(!0), i(e, null, y(t.matrixCols, (e, t) => (g(), i("th", { key: t }, x(e || `列${t + 1}`), 1))), 128))])]), a("tbody", null, [(g(!0), i(e, null, y(t.matrixRows, (n, r) => (g(), i("tr", { key: r }, [a("td", null, x(n || `行${r + 1}`), 1), (g(!0), i(e, null, y(t.matrixCols, (e, t) => (g(), i("td", { key: t }, [s(En, { disabled: "" })]))), 128))]))), 128))])])])) : r("", !0)])) : r("", !0),
2713
- t.type === "image" ? (g(), i("div", Bt, [s(m, {
2820
+ ])]), t.matrixRows.length && t.matrixCols.length ? (g(), i("div", Bt, [a("table", Vt, [a("thead", null, [a("tr", null, [c[100] ||= a("th", null, null, -1), (g(!0), i(e, null, y(t.matrixCols, (e, t) => (g(), i("th", { key: t }, x(e || `列${t + 1}`), 1))), 128))])]), a("tbody", null, [(g(!0), i(e, null, y(t.matrixRows, (n, r) => (g(), i("tr", { key: r }, [a("td", null, x(n || `行${r + 1}`), 1), (g(!0), i(e, null, y(t.matrixCols, (e, t) => (g(), i("td", { key: t }, [s(En, { disabled: "" })]))), 128))]))), 128))])])])) : r("", !0)])) : r("", !0),
2821
+ t.type === "image" ? (g(), i("div", Ht, [s(m, {
2714
2822
  modelValue: t.imageQuestionText,
2715
2823
  "onUpdate:modelValue": (e) => t.imageQuestionText = e,
2716
2824
  placeholder: "请输入图片相关说明文字",
2717
2825
  size: "small"
2718
2826
  }, null, 8, ["modelValue", "onUpdate:modelValue"])])) : r("", !0),
2719
- a("div", Vt, [
2720
- a("div", Ht, [s(u, null, {
2827
+ a("div", Ut, [
2828
+ a("div", Wt, [s(u, null, {
2721
2829
  default: w(() => [s(An)]),
2722
2830
  _: 1
2723
2831
  }), c[101] ||= a("span", null, "跳转逻辑", -1)]),
2724
- a("div", Ut, [c[102] ||= a("span", { class: "skip-label" }, "默认跳转:", -1), s(_, {
2832
+ a("div", Gt, [c[102] ||= a("span", { class: "skip-label" }, "默认跳转:", -1), s(_, {
2725
2833
  modelValue: t.skipTo,
2726
2834
  "onUpdate:modelValue": (e) => t.skipTo = e,
2727
2835
  size: "small",
@@ -2750,11 +2858,11 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2750
2858
  "radio",
2751
2859
  "checkbox",
2752
2860
  "select"
2753
- ].includes(t.type) ? (g(), i("div", Wt, [c[103] ||= a("div", { class: "skip-rules-title" }, "按选项跳转:", -1), (g(!0), i(e, null, y(t.options || [], (r, o) => (g(), i("div", {
2861
+ ].includes(t.type) ? (g(), i("div", Kt, [c[103] ||= a("div", { class: "skip-rules-title" }, "按选项跳转:", -1), (g(!0), i(e, null, y(t.options || [], (r, o) => (g(), i("div", {
2754
2862
  key: o,
2755
2863
  class: "skip-rule-row"
2756
2864
  }, [
2757
- a("span", Gt, x(r), 1),
2865
+ a("span", qt, x(r), 1),
2758
2866
  s(u, null, {
2759
2867
  default: w(() => [s(jn)]),
2760
2868
  _: 1
@@ -2786,12 +2894,12 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2786
2894
  }, 8, ["modelValue", "onUpdate:modelValue"])
2787
2895
  ]))), 128))])) : r("", !0)
2788
2896
  ]),
2789
- a("div", Kt, [
2790
- a("div", qt, [s(u, null, {
2897
+ a("div", Jt, [
2898
+ a("div", Yt, [s(u, null, {
2791
2899
  default: w(() => [s(Mn)]),
2792
2900
  _: 1
2793
2901
  }), c[104] ||= a("span", null, "计分设置", -1)]),
2794
- a("div", Jt, [c[105] ||= a("span", { class: "score-label" }, "本题分值:", -1), s(Le, {
2902
+ a("div", Xt, [c[105] ||= a("span", { class: "score-label" }, "本题分值:", -1), s(Re, {
2795
2903
  modelValue: t.score,
2796
2904
  "onUpdate:modelValue": (e) => t.score = e,
2797
2905
  min: 0,
@@ -2802,10 +2910,10 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2802
2910
  "radio",
2803
2911
  "checkbox",
2804
2912
  "select"
2805
- ].includes(t.type) ? (g(), i("div", Yt, [c[106] ||= a("div", { class: "score-options-title" }, "各选项分值(-1表示不计分):", -1), (g(!0), i(e, null, y(t.options || [], (e, n) => (g(), i("div", {
2913
+ ].includes(t.type) ? (g(), i("div", Zt, [c[106] ||= a("div", { class: "score-options-title" }, "各选项分值(-1表示不计分):", -1), (g(!0), i(e, null, y(t.options || [], (e, n) => (g(), i("div", {
2806
2914
  key: n,
2807
2915
  class: "score-option-row"
2808
- }, [a("span", Xt, x(e), 1), s(Le, {
2916
+ }, [a("span", Qt, x(e), 1), s(Re, {
2809
2917
  modelValue: t.optionScore[n],
2810
2918
  "onUpdate:modelValue": (e) => t.optionScore[n] = e,
2811
2919
  min: -1,
@@ -2813,14 +2921,14 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2813
2921
  size: "small",
2814
2922
  style: { width: "120px" }
2815
2923
  }, null, 8, ["modelValue", "onUpdate:modelValue"])]))), 128))])) : r("", !0),
2816
- t.type === "rating" ? (g(), i("div", Zt, [c[107] ||= a("span", { class: "score-label" }, "评分即得分:", -1), s(Cn, {
2924
+ t.type === "rating" ? (g(), i("div", $t, [c[107] ||= a("span", { class: "score-label" }, "评分即得分:", -1), s(q, {
2817
2925
  modelValue: t.ratingAsScore,
2818
2926
  "onUpdate:modelValue": (e) => t.ratingAsScore = e,
2819
2927
  size: "small",
2820
2928
  "active-text": "是",
2821
2929
  "inactive-text": "否"
2822
2930
  }, null, 8, ["modelValue", "onUpdate:modelValue"])])) : r("", !0),
2823
- t.type === "scale" ? (g(), i("div", Qt, [c[108] ||= a("span", { class: "score-label" }, "量表即得分:", -1), s(Cn, {
2931
+ t.type === "scale" ? (g(), i("div", en, [c[108] ||= a("span", { class: "score-label" }, "量表即得分:", -1), s(q, {
2824
2932
  modelValue: t.scaleAsScore,
2825
2933
  "onUpdate:modelValue": (e) => t.scaleAsScore = e,
2826
2934
  size: "small",
@@ -2828,16 +2936,16 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2828
2936
  "inactive-text": "否"
2829
2937
  }, null, 8, ["modelValue", "onUpdate:modelValue"])])) : r("", !0)
2830
2938
  ]),
2831
- a("div", $t, [
2832
- a("div", en, [
2939
+ a("div", tn, [
2940
+ a("div", nn, [
2833
2941
  s(u, null, {
2834
- default: w(() => [s(Pn)]),
2942
+ default: w(() => [s(Nn)]),
2835
2943
  _: 1
2836
2944
  }),
2837
2945
  c[109] ||= a("span", null, "评分说明", -1),
2838
2946
  c[110] ||= a("span", { class: "required-mark" }, "*", -1)
2839
2947
  ]),
2840
- a("div", tn, [c[111] ||= a("label", { class: "scoring-guide-label" }, "参考答案", -1), s(m, {
2948
+ a("div", rn, [c[111] ||= a("label", { class: "scoring-guide-label" }, "参考答案", -1), s(m, {
2841
2949
  modelValue: t.referenceAnswer,
2842
2950
  "onUpdate:modelValue": (e) => t.referenceAnswer = e,
2843
2951
  type: "textarea",
@@ -2849,7 +2957,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2849
2957
  "onUpdate:modelValue",
2850
2958
  "class"
2851
2959
  ])]),
2852
- a("div", nn, [c[112] ||= a("label", { class: "scoring-guide-label" }, "评分标准说明", -1), s(m, {
2960
+ a("div", an, [c[112] ||= a("label", { class: "scoring-guide-label" }, "评分标准说明", -1), s(m, {
2853
2961
  modelValue: t.scoringCriteria,
2854
2962
  "onUpdate:modelValue": (e) => t.scoringCriteria = e,
2855
2963
  type: "textarea",
@@ -2861,11 +2969,11 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2861
2969
  "onUpdate:modelValue",
2862
2970
  "class"
2863
2971
  ])]),
2864
- !t.referenceAnswer || !t.scoringCriteria ? (g(), i("div", rn, "参考答案和评分标准说明均为必填项")) : r("", !0)
2972
+ !t.referenceAnswer || !t.scoringCriteria ? (g(), i("div", on, "参考答案和评分标准说明均为必填项")) : r("", !0)
2865
2973
  ])
2866
2974
  ])
2867
- ], 42, ft))), 128))], 512),
2868
- a("div", an, [a("div", on, [
2975
+ ], 42, mt))), 128))], 512),
2976
+ a("div", sn, [a("div", cn, [
2869
2977
  s(p, {
2870
2978
  type: "primary",
2871
2979
  plain: "",
@@ -2888,49 +2996,49 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2888
2996
  }, [
2889
2997
  a("div", {
2890
2998
  class: "menu-item",
2891
- onClick: c[29] ||= (e) => Bn("text")
2999
+ onClick: c[29] ||= (e) => Hn("text")
2892
3000
  }, [s(u, null, {
2893
- default: w(() => [s(Fn)]),
3001
+ default: w(() => [s(Pn)]),
2894
3002
  _: 1
2895
3003
  }), c[114] ||= o(" 文本题", -1)]),
2896
3004
  a("div", {
2897
3005
  class: "menu-item",
2898
- onClick: c[30] ||= (e) => Bn("radio")
3006
+ onClick: c[30] ||= (e) => Hn("radio")
2899
3007
  }, [s(u, null, {
2900
- default: w(() => [s($)]),
3008
+ default: w(() => [s(In)]),
2901
3009
  _: 1
2902
3010
  }), c[115] ||= o(" 单选题", -1)]),
2903
3011
  a("div", {
2904
3012
  class: "menu-item",
2905
- onClick: c[31] ||= (e) => Bn("checkbox")
3013
+ onClick: c[31] ||= (e) => Hn("checkbox")
2906
3014
  }, [s(u, null, {
2907
- default: w(() => [s(In)]),
3015
+ default: w(() => [s(Ln)]),
2908
3016
  _: 1
2909
3017
  }), c[116] ||= o(" 多选题", -1)]),
2910
3018
  a("div", {
2911
3019
  class: "menu-item",
2912
- onClick: c[32] ||= (e) => Bn("select")
3020
+ onClick: c[32] ||= (e) => Hn("select")
2913
3021
  }, [s(u, null, {
2914
3022
  default: w(() => [s(k)]),
2915
3023
  _: 1
2916
3024
  }), c[117] ||= o(" 下拉题", -1)]),
2917
3025
  a("div", {
2918
3026
  class: "menu-item",
2919
- onClick: c[33] ||= (e) => Bn("rating")
3027
+ onClick: c[33] ||= (e) => Hn("rating")
2920
3028
  }, [s(u, null, {
2921
3029
  default: w(() => [s(kn)]),
2922
3030
  _: 1
2923
3031
  }), c[118] ||= o(" 评分题", -1)]),
2924
3032
  a("div", {
2925
3033
  class: "menu-item",
2926
- onClick: c[34] ||= (e) => Bn("scale")
3034
+ onClick: c[34] ||= (e) => Hn("scale")
2927
3035
  }, [s(u, null, {
2928
- default: w(() => [s(Ln)]),
3036
+ default: w(() => [s($)]),
2929
3037
  _: 1
2930
3038
  }), c[119] ||= o(" 量表题", -1)]),
2931
3039
  a("div", {
2932
3040
  class: "menu-item",
2933
- onClick: c[35] ||= (e) => Bn("matrix")
3041
+ onClick: c[35] ||= (e) => Hn("matrix")
2934
3042
  }, [s(u, null, {
2935
3043
  default: w(() => [s(Rn)]),
2936
3044
  _: 1
@@ -2939,19 +3047,19 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2939
3047
  ])])
2940
3048
  ], 512)])]),
2941
3049
  s(zn, {
2942
- modelValue: Se.value,
2943
- "onUpdate:modelValue": c[38] ||= (e) => Se.value = e,
3050
+ modelValue: Ce.value,
3051
+ "onUpdate:modelValue": c[38] ||= (e) => Ce.value = e,
2944
3052
  title: "AI生成题目",
2945
3053
  width: "600px",
2946
3054
  top: "10vh"
2947
3055
  }, {
2948
- footer: w(() => [s(p, { onClick: c[37] ||= (e) => Se.value = !1 }, {
3056
+ footer: w(() => [s(p, { onClick: c[37] ||= (e) => Ce.value = !1 }, {
2949
3057
  default: w(() => [...c[126] ||= [o("取消", -1)]]),
2950
3058
  _: 1
2951
3059
  }), s(p, {
2952
3060
  type: "primary",
2953
- onClick: mr,
2954
- loading: Ce.value
3061
+ onClick: gr,
3062
+ loading: we.value
2955
3063
  }, {
2956
3064
  default: w(() => [s(u, null, {
2957
3065
  default: w(() => [s(L)]),
@@ -2959,21 +3067,21 @@ document.getElementById('qform').addEventListener('submit', function(e) {
2959
3067
  }), c[127] ||= o(" 生成题目 ", -1)]),
2960
3068
  _: 1
2961
3069
  }, 8, ["loading"])]),
2962
- default: w(() => [a("div", sn, [
2963
- a("div", cn, [a("label", null, [c[121] ||= o("当前题型:", -1), a("span", ln, x(Ae(De.value)), 1)])]),
2964
- a("div", un, [c[122] ||= a("label", null, "请输入生成要求:", -1), s(m, {
2965
- modelValue: we.value,
2966
- "onUpdate:modelValue": c[36] ||= (e) => we.value = e,
3070
+ default: w(() => [a("div", ln, [
3071
+ a("div", un, [a("label", null, [c[121] ||= o("当前题型:", -1), a("span", dn, x(Me(ke.value)), 1)])]),
3072
+ a("div", fn, [c[122] ||= a("label", null, "请输入生成要求:", -1), s(m, {
3073
+ modelValue: Te.value,
3074
+ "onUpdate:modelValue": c[36] ||= (e) => Te.value = e,
2967
3075
  type: "textarea",
2968
3076
  rows: 4,
2969
3077
  placeholder: "例如:请生成一道关于JavaScript基础的单选题,考察变量声明的概念"
2970
3078
  }, null, 8, ["modelValue"])]),
2971
- a("div", dn, [c[125] ||= a("label", null, "上传参考附件(可选):", -1), s(X, {
3079
+ a("div", pn, [c[125] ||= a("label", null, "上传参考附件(可选):", -1), s(X, {
2972
3080
  ref_key: "aiGenUploadRef",
2973
- ref: ke,
3081
+ ref: Ae,
2974
3082
  "auto-upload": !1,
2975
- "on-change": pr,
2976
- "file-list": Te.value,
3083
+ "on-change": hr,
3084
+ "file-list": Ee.value,
2977
3085
  accept: ".txt,.pdf,.doc,.docx,.md",
2978
3086
  limit: 5
2979
3087
  }, {
@@ -3005,7 +3113,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3005
3113
  _: 1
3006
3114
  }), s(p, {
3007
3115
  type: "primary",
3008
- onClick: _r,
3116
+ onClick: yr,
3009
3117
  loading: _e.value
3010
3118
  }, {
3011
3119
  default: w(() => [s(u, null, {
@@ -3014,16 +3122,16 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3014
3122
  }), c[133] ||= o(" 开始分析 ", -1)]),
3015
3123
  _: 1
3016
3124
  }, 8, ["loading"])]),
3017
- default: w(() => [a("div", fn, [_e.value ? (g(), i("div", pn, [s(u, {
3125
+ default: w(() => [a("div", mn, [_e.value ? (g(), i("div", hn, [s(u, {
3018
3126
  class: "is-loading",
3019
3127
  size: 40
3020
3128
  }, {
3021
- default: w(() => [s(Yn)]),
3129
+ default: w(() => [s(Bn)]),
3022
3130
  _: 1
3023
- }), c[128] ||= a("p", null, "正在分析问卷数据...", -1)])) : ve.value ? (g(), i("div", mn, [a("div", hn, [c[130] ||= a("h3", null, "分析结果", -1), s(p, {
3131
+ }), c[128] ||= a("p", null, "正在分析问卷数据...", -1)])) : ve.value ? (g(), i("div", gn, [a("div", _n, [c[130] ||= a("h3", null, "分析结果", -1), s(p, {
3024
3132
  size: "small",
3025
3133
  type: "primary",
3026
- onClick: br
3134
+ onClick: Sr
3027
3135
  }, {
3028
3136
  default: w(() => [s(u, null, {
3029
3137
  default: w(() => [s(D)]),
@@ -3033,7 +3141,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3033
3141
  })]), a("div", {
3034
3142
  class: "ai-result-content",
3035
3143
  innerHTML: ve.value
3036
- }, null, 8, gn)])) : (g(), i("div", _n, [...c[131] ||= [a("p", null, "点击\"开始分析\"按钮,AI将对问卷数据进行智能分析", -1)]]))])]),
3144
+ }, null, 8, vn)])) : (g(), i("div", yn, [...c[131] ||= [a("p", null, "点击\"开始分析\"按钮,AI将对问卷数据进行智能分析", -1)]]))])]),
3037
3145
  _: 1
3038
3146
  }, 8, ["modelValue"]),
3039
3147
  s(zn, {
@@ -3043,18 +3151,18 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3043
3151
  width: "680px",
3044
3152
  top: "5vh"
3045
3153
  }, {
3046
- default: w(() => [a("div", vn, [
3154
+ default: w(() => [a("div", bn, [
3047
3155
  c[138] ||= a("p", { class: "distribute-desc" }, "输入邮箱地址,系统将为每个邮箱生成唯一填写链接。支持手动输入或导入Excel。", -1),
3048
- a("div", yn, [s(m, {
3156
+ a("div", xn, [s(m, {
3049
3157
  modelValue: me.value,
3050
3158
  "onUpdate:modelValue": c[41] ||= (e) => me.value = e,
3051
3159
  type: "textarea",
3052
3160
  rows: 6,
3053
3161
  placeholder: "请输入邮箱地址,每行一个,支持逗号分隔\n例:\nuser1@example.com\nuser2@example.com"
3054
3162
  }, null, 8, ["modelValue"])]),
3055
- a("div", bn, [s(X, {
3163
+ a("div", Sn, [s(X, {
3056
3164
  "show-file-list": !1,
3057
- "before-upload": or,
3165
+ "before-upload": cr,
3058
3166
  accept: ".xlsx,.xls,.csv"
3059
3167
  }, {
3060
3168
  default: w(() => [s(p, { size: "small" }, {
@@ -3068,7 +3176,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3068
3176
  }), s(p, {
3069
3177
  size: "small",
3070
3178
  type: "primary",
3071
- onClick: sr
3179
+ onClick: lr
3072
3180
  }, {
3073
3181
  default: w(() => [s(u, null, {
3074
3182
  default: w(() => [s(ie)]),
@@ -3076,43 +3184,43 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3076
3184
  }), c[135] ||= o(" 生成链接 ", -1)]),
3077
3185
  _: 1
3078
3186
  })]),
3079
- he.value.length > 0 ? (g(), i("div", xn, [a("div", Sn, [a("span", null, "已生成 " + x(he.value.length) + " 条链接", 1), s(p, {
3187
+ he.value.length > 0 ? (g(), i("div", Cn, [a("div", wn, [a("span", null, "已生成 " + x(he.value.length) + " 条链接", 1), s(p, {
3080
3188
  size: "small",
3081
3189
  type: "success",
3082
- onClick: lr
3190
+ onClick: dr
3083
3191
  }, {
3084
3192
  default: w(() => [s(u, null, {
3085
3193
  default: w(() => [s(D)]),
3086
3194
  _: 1
3087
3195
  }), c[136] ||= o(" 下载Excel ", -1)]),
3088
3196
  _: 1
3089
- })]), s(nr, {
3197
+ })]), s(Qn, {
3090
3198
  data: he.value,
3091
3199
  size: "small",
3092
3200
  "max-height": "300",
3093
3201
  stripe: ""
3094
3202
  }, {
3095
3203
  default: w(() => [
3096
- s(Xn, {
3204
+ s(Vn, {
3097
3205
  prop: "email",
3098
3206
  label: "邮箱",
3099
3207
  "min-width": "200"
3100
3208
  }),
3101
- s(Xn, {
3209
+ s(Vn, {
3102
3210
  label: "填写链接",
3103
3211
  "min-width": "300"
3104
3212
  }, {
3105
- default: w(({ row: e }) => [s(tr, {
3213
+ default: w(({ row: e }) => [s(Zn, {
3106
3214
  type: "primary",
3107
3215
  underline: !1,
3108
- onClick: (t) => cr(e.url)
3216
+ onClick: (t) => ur(e.url)
3109
3217
  }, {
3110
3218
  default: w(() => [o(x(e.url), 1)]),
3111
3219
  _: 2
3112
3220
  }, 1032, ["onClick"])]),
3113
3221
  _: 1
3114
3222
  }),
3115
- s(Xn, {
3223
+ s(Vn, {
3116
3224
  label: "操作",
3117
3225
  width: "70",
3118
3226
  align: "center"
@@ -3121,7 +3229,7 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3121
3229
  size: "small",
3122
3230
  type: "primary",
3123
3231
  link: "",
3124
- onClick: (t) => cr(e.url)
3232
+ onClick: (t) => ur(e.url)
3125
3233
  }, {
3126
3234
  default: w(() => [...c[137] ||= [o("复制", -1)]]),
3127
3235
  _: 1
@@ -3142,11 +3250,11 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3142
3250
  "collab-users": S(B).collabUsers.value,
3143
3251
  "current-user": S(B).currentUser.value,
3144
3252
  "is-owner": !H.value,
3145
- onSend: Dr,
3253
+ onSend: Or,
3146
3254
  onClose: c[43] ||= (e) => ye.value = !1,
3147
3255
  "unread-mention": S(B).unreadMention.value,
3148
3256
  onClearUnread: c[44] ||= (e) => S(B).clearUnreadMention(),
3149
- onClear: Or
3257
+ onClear: kr
3150
3258
  }, null, 8, [
3151
3259
  "visible",
3152
3260
  "messages",
@@ -3157,16 +3265,16 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3157
3265
  "is-owner",
3158
3266
  "unread-mention"
3159
3267
  ]),
3160
- s(Ie, {
3161
- modelValue: be.value,
3162
- "onUpdate:modelValue": c[45] ||= (e) => be.value = e,
3268
+ s(Le, {
3269
+ modelValue: xe.value,
3270
+ "onUpdate:modelValue": c[45] ||= (e) => xe.value = e,
3163
3271
  "document-id": R.value,
3164
- onApply: Cr
3272
+ onApply: Tr
3165
3273
  }, null, 8, ["modelValue", "document-id"])
3166
3274
  ], 64);
3167
3275
  };
3168
3276
  }
3169
- }, [["__scopeId", "data-v-6c804f8a"]]), wn = c({
3277
+ }, [["__scopeId", "data-v-927591ce"]]), Z = c({
3170
3278
  name: "YourCompanyQuestionnaire",
3171
3279
  props: {
3172
3280
  docId: {
@@ -3201,6 +3309,10 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3201
3309
  type: Object,
3202
3310
  default: () => ({})
3203
3311
  },
3312
+ aiApi: {
3313
+ type: [String, Object],
3314
+ default: null
3315
+ },
3204
3316
  roomId: {
3205
3317
  type: String,
3206
3318
  default: ""
@@ -3210,8 +3322,8 @@ document.getElementById('qform').addEventListener('submit', function(e) {
3210
3322
  return () => l("div", {
3211
3323
  class: "yourcompany-questionnaire-wrapper",
3212
3324
  style: "position:relative"
3213
- }, [l(J, { ...e }), l(D)]);
3325
+ }, [l(X, { ...e }), l(D)]);
3214
3326
  }
3215
3327
  });
3216
3328
  //#endregion
3217
- export { wn as default };
3329
+ export { Z as default };