agilebuilder-ui 1.1.65-tmp22 → 1.1.65-tmp24
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.full.min.js +462 -281
- package/dist/style.css +181 -175
- package/es/chat-embed/src/chat-sender.vue.mjs +1 -1
- package/es/chat-embed/src/chat-sender.vue2.mjs +26 -28
- package/es/chat-embed/src/index.vue.mjs +1 -1
- package/es/chat-embed/src/index.vue2.mjs +29 -29
- package/es/department-tree-mobile/src/department-tree-inline-app.vue.mjs +68 -68
- package/es/department-tree-mobile/src/department-tree-service.mjs +20 -18
- package/es/department-tree-mobile/src/dept-result.vue.mjs +12 -11
- package/es/department-user-tree-inline/src/department-user-single-tree-inline.vue.mjs +3 -3
- package/es/department-user-tree-inline/src/department-user-tree-inline.vue.mjs +6 -6
- package/es/department-user-tree-inline/src/department-user-tree-single-service.mjs +1 -1
- package/es/fs-preview/src/fs-preview.vue.mjs +26 -18
- package/es/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue.mjs +1 -1
- package/es/fs-upload-new/src/file-upload-mobile/file-upload-input.vue.mjs +1 -1
- package/es/index.mjs +7 -5
- package/es/src/components/Card/index.mjs +34 -31
- package/es/src/components/Scrollbar/index.vue.mjs +6 -6
- package/es/src/i18n/langs/cn.mjs +1 -1
- package/es/src/i18n/langs/en.mjs +1 -1
- package/es/src/utils/common-util.mjs +47 -39
- package/es/style.css +879 -873
- package/es/super-grid/src/apis.mjs +199 -173
- package/es/super-grid/src/components/mobile-table-card.mjs +53 -53
- package/es/super-grid/src/normal-column-content.vue.mjs +12 -12
- package/es/super-grid/src/normal-column.vue.mjs +4 -5
- package/es/super-grid/src/search-button.vue.mjs +4 -2
- package/es/super-grid/src/search-form-dialog.vue.mjs +22 -11
- package/es/super-grid/src/search-form-item.vue.mjs +5 -5
- package/es/super-grid/src/search-form-mobile.vue.mjs +19 -19
- package/es/super-grid/src/search-form-open.vue.mjs +5 -3
- package/es/super-grid/src/search-form-ordinarySearch.vue.mjs +3 -1
- package/es/super-grid/src/search-form.vue.mjs +19 -13
- package/es/super-grid/src/super-grid.vue.mjs +271 -209
- package/es/super-grid/src/utils.mjs +346 -300
- package/es/utils/organization.mjs +24 -11
- package/lib/chat-embed/src/chat-sender.vue.cjs +1 -1
- package/lib/chat-embed/src/chat-sender.vue2.cjs +44 -46
- package/lib/chat-embed/src/index.vue.cjs +1 -1
- package/lib/chat-embed/src/index.vue2.cjs +14 -14
- package/lib/department-tree-mobile/src/department-tree-inline-app.vue.cjs +58 -58
- package/lib/department-tree-mobile/src/department-tree-service.cjs +10 -8
- package/lib/department-tree-mobile/src/dept-result.vue.cjs +10 -10
- package/lib/department-user-tree-inline/src/department-user-single-tree-inline.vue.cjs +16 -16
- package/lib/department-user-tree-inline/src/department-user-tree-inline.vue.cjs +5 -5
- package/lib/department-user-tree-inline/src/department-user-tree-single-service.cjs +1 -1
- package/lib/fs-preview/src/fs-preview.vue.cjs +13 -5
- package/lib/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue.cjs +1 -1
- package/lib/fs-upload-new/src/file-upload-mobile/file-upload-input.vue.cjs +13 -13
- package/lib/index.cjs +7 -7
- package/lib/src/components/Card/index.cjs +14 -11
- package/lib/src/components/Scrollbar/index.vue.cjs +2 -2
- package/lib/src/i18n/langs/cn.cjs +1 -1
- package/lib/src/i18n/langs/en.cjs +1 -1
- package/lib/src/utils/common-util.cjs +24 -17
- package/lib/style.css +915 -909
- package/lib/super-grid/src/apis.cjs +190 -164
- package/lib/super-grid/src/components/mobile-table-card.cjs +37 -37
- package/lib/super-grid/src/normal-column-content.vue.cjs +2 -2
- package/lib/super-grid/src/normal-column.vue.cjs +10 -11
- package/lib/super-grid/src/search-button.vue.cjs +3 -1
- package/lib/super-grid/src/search-form-dialog.vue.cjs +19 -8
- package/lib/super-grid/src/search-form-item.vue.cjs +2 -2
- package/lib/super-grid/src/search-form-mobile.vue.cjs +7 -7
- package/lib/super-grid/src/search-form-open.vue.cjs +7 -5
- package/lib/super-grid/src/search-form-ordinarySearch.vue.cjs +3 -1
- package/lib/super-grid/src/search-form.vue.cjs +15 -10
- package/lib/super-grid/src/super-grid.vue.cjs +220 -158
- package/lib/super-grid/src/utils.cjs +349 -274
- package/lib/utils/organization.cjs +35 -24
- package/package.json +1 -1
- package/src/components/Card/index.jsx +12 -2
- package/src/components/Scrollbar/index.vue +165 -154
- package/src/i18n/langs/cn.js +10 -2
- package/src/i18n/langs/en.js +10 -2
- package/src/styles/index.scss +9 -2
- package/src/styles/theme/default.scss +18 -13
- package/src/styles/theme/tiffany-blue-mobile/home.scss +44 -1
- package/src/utils/auth-api.js +1 -0
- package/src/utils/common-util.js +13 -0
- package/vite.config.js +0 -45
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./chat-sender.vue2.mjs";
|
|
2
2
|
import "./chat-sender.vue3.mjs";
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const t = r(e, [["__scopeId", "data-v-
|
|
4
|
+
const t = r(e, [["__scopeId", "data-v-6da81be3"]]);
|
|
5
5
|
export {
|
|
6
6
|
t as default
|
|
7
7
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { defineComponent as e, ref as a, onMounted as l, watch as t, resolveComponent as n, resolveDirective as o, openBlock as i, createElementBlock as u, Fragment as s, createBlock as r, withCtx as c, createElementVNode as d, createVNode as m, createTextVNode as p, toDisplayString as f, createCommentVNode as v, unref as g, renderList as h, withDirectives as w, pushScopeId as b, popScopeId as y } from "vue";
|
|
2
2
|
import x from "../../src/store/modules/chat-ai-store.mjs";
|
|
3
|
-
import { Sender as E, Attachments as
|
|
3
|
+
import { Sender as E, Attachments as _, FilesCard as A } from "vue-element-plus-x";
|
|
4
4
|
import { generateFileName as R, downloadJsonFile as I } from "./util/text-file-util.mjs";
|
|
5
5
|
import { getActivePinia as k, createPinia as P, setActivePinia as j } from "pinia";
|
|
6
|
-
import { useI18n as
|
|
6
|
+
import { useI18n as C } from "vue-i18n";
|
|
7
7
|
import { ElMessage as T } from "element-plus";
|
|
8
|
-
import
|
|
8
|
+
import S from "./voice/voice.vue.mjs";
|
|
9
9
|
import { AI_MODELS as D } from "./type.mjs";
|
|
10
10
|
import { getVoiceSetting as N, parseVoiceMsg as V } from "../../src/utils/voice-setting-cache.mjs";
|
|
11
11
|
import { getRelativeBaseUrl as O, isValidDate as M } from "../../src/utils/common-util.mjs";
|
|
12
|
-
import { getToken as
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
const
|
|
12
|
+
import { getToken as $ } from "../../src/utils/auth.mjs";
|
|
13
|
+
const q = { class: "sender-additional-data-tag" }, z = { style: { display: "flex", "align-items": "center", "flex-wrap": "wrap" } }, F = { style: { display: "flex", "align-items": "center", gap: "16px" } }, K = ((e2) => (b("data-v-6da81be3"), e2 = e2(), y(), e2))(() => d("div", { class: "ai-generate-tip" }, "内容由AI生成,仅供参考", -1)), G = e({ __name: "chat-sender", props: { loading: { type: Boolean, default: false } }, emits: ["submit-question", "handle-cancel", "view-json", "change-ai-model", "voice-answer", "command-answer"], setup(e2, { expose: b2, emit: y2 }) {
|
|
14
|
+
C();
|
|
15
|
+
const G2 = [{ label: "流程体系类", value: D.RAGFLOW }, { label: "QMS数据库类", value: D.DATABASE }, { label: "DeepSeek问答", value: D.DEEPSEEK }, { label: "系统交互", value: D.INTERACTION }, { label: "生成PPT", value: D.PPT_GENERATION }];
|
|
16
|
+
let H = null;
|
|
17
|
+
const L = a(false), U = a(""), W = a([]), B = a(""), Q = a("ragflow"), X = a(), J = a(), Y = a(window.$vueApp.config.globalProperties.baseAPI + "/component/ai/upload-file/bailian"), Z = a([]), ee = a(false), ae = a(false);
|
|
18
18
|
function le() {
|
|
19
19
|
try {
|
|
20
|
-
window.parent && window.parent !== window && (window.parent.ChatAiStore =
|
|
20
|
+
window.parent && window.parent !== window && (window.parent.ChatAiStore = H), window.top && window.top !== window && (window.top.ChatAiStore = H), window.ChatAiStore = H;
|
|
21
21
|
} catch (e3) {
|
|
22
22
|
console.error("Failed to initialize ChatAiStore:", e3);
|
|
23
23
|
}
|
|
@@ -27,7 +27,7 @@ const $ = { class: "sender-additional-data-tag" }, q = { style: { display: "flex
|
|
|
27
27
|
!function() {
|
|
28
28
|
try {
|
|
29
29
|
let e3 = k();
|
|
30
|
-
e3 || (e3 = P(), j(e3), window.$vueApp && window.$vueApp.use(e3)),
|
|
30
|
+
e3 || (e3 = P(), j(e3), window.$vueApp && window.$vueApp.use(e3)), H = x();
|
|
31
31
|
} catch (e3) {
|
|
32
32
|
console.error("Failed to initialize Pinia or ChatAiStore:", e3);
|
|
33
33
|
}
|
|
@@ -40,52 +40,50 @@ const $ = { class: "sender-additional-data-tag" }, q = { style: { display: "flex
|
|
|
40
40
|
let oe = {}, ie = {};
|
|
41
41
|
function ue(e3) {
|
|
42
42
|
let a2 = e3;
|
|
43
|
-
null == e3 ? (
|
|
43
|
+
null == e3 ? (B.value, a2 = B.value.trim()) : a2 = e3.trim(), te = a2;
|
|
44
44
|
let l2 = { aiModel: Q.value, question: a2 };
|
|
45
45
|
if (Q.value === D.DEEPSEEK || Q.value === D.PPT_GENERATION) {
|
|
46
|
-
const e4 =
|
|
46
|
+
const e4 = H.getActiveMenu();
|
|
47
47
|
let t2 = "";
|
|
48
48
|
Z.value.length > 0 && (t2 = Z.value.map((e5) => e5.id).join(","));
|
|
49
49
|
let n2 = [];
|
|
50
|
-
Z.value.length > 0 && (n2 = Z.value.map((e5) => ({ fileId: e5.id, name: e5.name }))), Z.value = [], l2 = { aiModel: Q.value, question: a2, fileId: t2, fileInfos: n2, additionalData:
|
|
50
|
+
Z.value.length > 0 && (n2 = Z.value.map((e5) => ({ fileId: e5.id, name: e5.name }))), Z.value = [], l2 = { aiModel: Q.value, question: a2, fileId: t2, fileInfos: n2, additionalData: W.value, additionalDataLabel: U.value, menuName: (e4 == null ? void 0 : e4.menuName) || "" };
|
|
51
51
|
}
|
|
52
|
-
y2("submit-question", l2),
|
|
52
|
+
y2("submit-question", l2), B.value = "", ce();
|
|
53
53
|
}
|
|
54
54
|
function se() {
|
|
55
55
|
y2("handle-cancel");
|
|
56
56
|
}
|
|
57
57
|
function re() {
|
|
58
58
|
var _a;
|
|
59
|
-
const e3 =
|
|
59
|
+
const e3 = H.getActiveMenu(), a2 = H.getActiveMenuPageInfo();
|
|
60
60
|
if ("list" === a2.pageType) {
|
|
61
61
|
const l2 = a2.listRefs[0].ref.getAiChatListData();
|
|
62
|
-
l2 && l2.length > 0 && (
|
|
62
|
+
l2 && l2.length > 0 && (W.value = l2), ((_a = W.value) == null ? void 0 : _a.length) > 0 && (U.value = `已附加【${e3.menuName}】表格数据 (${W.value.length} 条记录)`, L.value = true);
|
|
63
63
|
} else if ("form" === a2.pageType) {
|
|
64
64
|
const l2 = a2.exposeProxy.getFormFormatData();
|
|
65
65
|
a2.subTableRefs && Object.keys(a2.subTableRefs).length > 0 && Object.keys(a2.subTableRefs).forEach((e4) => {
|
|
66
66
|
const t2 = a2.subTableRefs[e4].ref, n2 = t2.getAiChatListData();
|
|
67
67
|
let o2 = e4;
|
|
68
68
|
t2.options.title && (o2 = t2.options.title), l2[o2] = n2;
|
|
69
|
-
}), l2 && (
|
|
69
|
+
}), l2 && (W.value = [l2], U.value = `已附加【${e3.menuName}】表单数据`, L.value = true);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
function ce() {
|
|
73
|
-
|
|
73
|
+
W.value = [], U.value = "", L.value = false;
|
|
74
74
|
}
|
|
75
75
|
function de() {
|
|
76
|
-
y2("view-json",
|
|
76
|
+
y2("view-json", W.value);
|
|
77
77
|
}
|
|
78
78
|
function me() {
|
|
79
79
|
try {
|
|
80
|
-
const e3 =
|
|
81
|
-
I(
|
|
80
|
+
const e3 = H.getActiveMenu(), a2 = R((e3 == null ? void 0 : e3.menuName) || "data");
|
|
81
|
+
I(W.value, a2);
|
|
82
82
|
} catch (e3) {
|
|
83
83
|
console.error("下载失败:", e3);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
function pe(e3) {
|
|
87
|
-
if (e3 === D.DATABASE)
|
|
88
|
-
return T({ message: "QMS数据库类模型正在开发中,敬请期待!", type: "warning" }), void (Q.value = D.RAGFLOW);
|
|
89
87
|
e3 === D.DEEPSEEK && Z.value.length > 0 ? X.value.openHeader() : X.value.closeHeader(), e3 === D.DEEPSEEK || e3 === D.PPT_GENERATION ? (ee.value = true, ae.value = true) : (ee.value = false, ae.value = false, ce()), y2("change-ai-model", e3);
|
|
90
88
|
}
|
|
91
89
|
function fe(e3) {
|
|
@@ -149,12 +147,12 @@ const $ = { class: "sender-additional-data-tag" }, q = { style: { display: "flex
|
|
|
149
147
|
});
|
|
150
148
|
});
|
|
151
149
|
}, newChatSession: function() {
|
|
152
|
-
Q.value === D.DEEPSEEK && (Z.value = []),
|
|
150
|
+
Q.value === D.DEEPSEEK && (Z.value = []), B.value = "";
|
|
153
151
|
} }), (a2, l2) => {
|
|
154
|
-
const t2 = n("Paperclip"), b3 = n("el-icon"), y3 = n("super-icon"), x2 = n("el-tooltip"), R2 = n("el-tag"), I2 = n("el-option"), k2 = n("el-select"), P2 = n("SuperIcon"), j2 = n("el-upload"),
|
|
155
|
-
return i(), u(s, null, [
|
|
152
|
+
const t2 = n("Paperclip"), b3 = n("el-icon"), y3 = n("super-icon"), x2 = n("el-tooltip"), R2 = n("el-tag"), I2 = n("el-option"), k2 = n("el-select"), P2 = n("SuperIcon"), j2 = n("el-upload"), C2 = n("el-divider"), T2 = n("el-button"), D2 = o("loading");
|
|
153
|
+
return i(), u(s, null, [L.value ? (i(), r(R2, { key: 0, type: "primary" }, { default: c(() => [d("div", q, [m(b3, null, { default: c(() => [m(t2)]), _: 1 }), p(" " + f(U.value) + " ", 1), m(x2, { content: "预览" }, { default: c(() => [m(y3, { iconValue: "amb-color-icon-yulan", style: { cursor: "pointer" }, onClick: de })]), _: 1 }), m(x2, { content: "下载" }, { default: c(() => [m(y3, { iconValue: "amb-color-icon-xiazai", style: { cursor: "pointer" }, onClick: me })]), _: 1 }), m(x2, { content: "移除" }, { default: c(() => [m(y3, { iconValue: "amb-color-icon-shanchu", style: { cursor: "pointer" }, onClick: ce })]), _: 1 })])]), _: 1 })) : v("", true), m(g(E), { modelValue: B.value, "onUpdate:modelValue": l2[2] || (l2[2] = (e3) => B.value = e3), variant: "updown", "auto-size": { minRows: 2, maxRows: 5 }, clearable: "", ref_key: "senderRef", ref: X, submitType: "enter", loading: e2.loading, "allow-speech": "", onSubmit: l2[3] || (l2[3] = (e3) => ue()), placeholder: "请您描述问题" }, { header: c(() => [m(g(_), { items: Z.value, drag: "", overflow: "scrollX", "hide-upload": true }, { "file-list": c((e3) => [(i(true), u(s, null, h(e3.items, (e4) => (i(), r(g(A), { key: e4.id, maxWidth: "150px", style: { margin: "10px 5px" }, name: e4.name, percent: e4.percent, uid: e4.id, status: e4.status, "show-del-icon": "", "img-variant": "square", onDelete: he }, null, 8, ["name", "percent", "uid", "status"]))), 128))]), _: 1 }, 8, ["items"])]), prefix: c(() => [d("div", z, [m(k2, { style: { width: "146px", height: "32px" }, plain: "", modelValue: Q.value, "onUpdate:modelValue": l2[0] || (l2[0] = (e3) => Q.value = e3), onChange: pe }, { default: c(() => [(i(), u(s, null, h(G2, (e3) => m(I2, { key: e3.value, label: e3.label, value: e3.value }, null, 8, ["label", "value"])), 64))]), _: 1 }, 8, ["modelValue"])])]), "action-list": c(() => [d("div", F, [ee.value ? (i(), r(x2, { key: 0, content: "上传附件" }, { default: c(() => [m(j2, { ref_key: "uploadRef", ref: J, action: Y.value, multiple: true, headers: { Authorization: g($)() }, accept: ".txt,.docx,.pdf,.xlsx,.epub,.mobi,.md,.csv,.json,.bmp,.png,.jpg,.jpeg,.gif,.pdf", "show-file-list": false, "on-progress": ve, "on-success": ge, "before-upload": fe }, { default: c(() => [m(P2, { iconValue: "amb-icon-fujianshangchuan" })]), _: 1 }, 8, ["action", "headers"])]), _: 1 })) : v("", true), ae.value ? (i(), r(x2, { key: 1, content: "附加页面数据" }, { default: c(() => [m(P2, { onClick: re, iconValue: "amb-icon-fujiabiaogeshu", class: "send-icon" })]), _: 1 })) : v("", true), m(x2, { content: "语音" }, { default: c(() => [m(S, { onUserMessage: ue, class: "send-icon" })]), _: 1 }), m(C2, { direction: "vertical" }), e2.loading ? (i(), r(x2, { key: 2, content: "取消" }, { default: c(() => [w((i(), r(T2, { type: "primary", style: { "border-radius": "10px" }, plain: "", round: "", onClick: se }, { default: c(() => [p(" 取消 ")]), _: 1 })), [[D2, e2.loading]])]), _: 1 })) : (i(), r(T2, { key: 3, style: { "border-radius": "10px" }, disabled: !B.value || !B.value.trim(), plain: "", circle: "", round: "", onClick: l2[1] || (l2[1] = (e3) => ue()) }, { default: c(() => [m(P2, { iconValue: "amb-icon-fasong2" })]), _: 1 }, 8, ["disabled"]))])]), _: 1 }, 8, ["modelValue", "loading"]), K], 64);
|
|
156
154
|
};
|
|
157
155
|
} });
|
|
158
156
|
export {
|
|
159
|
-
|
|
157
|
+
G as default
|
|
160
158
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as e, ref as t, watch as a, onMounted as n, onBeforeUnmount as o, onUnmounted as l, computed as i, nextTick as u, openBlock as r, createElementBlock as s, createElementVNode as c, normalizeStyle as v, unref as d, createVNode as m, Transition as h, withCtx as f, withDirectives as p, normalizeClass as g, Fragment as y, createBlock as w, createCommentVNode as b, toDisplayString as k, createTextVNode as S, renderList as C, vShow as A, pushScopeId as x, popScopeId as P } from "vue";
|
|
2
2
|
import { useI18n as _ } from "vue-i18n";
|
|
3
|
-
import { useXStream as E, BubbleList as j, Thinking as T, XMarkdown as
|
|
3
|
+
import { useXStream as E, BubbleList as j, Thinking as T, XMarkdown as D, Typewriter as N } from "vue-element-plus-x";
|
|
4
4
|
import { useDraggable as I } from "@vueuse/core";
|
|
5
5
|
import { getToken as M } from "../../src/utils/auth.mjs";
|
|
6
6
|
import { defaultMessage as O, createUserMessage as q, createAiMessage as $, getMessageTemplate as R } from "./chat-embed-message.mjs";
|
|
7
|
-
import { AI_MODELS as H, MESSAGE_STATUS as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import { AI_MODELS as H, MESSAGE_STATUS as L } from "./type.mjs";
|
|
8
|
+
import z from "./recommendation-message.vue.mjs";
|
|
9
|
+
import J from "./chat-addition-data.vue.mjs";
|
|
10
10
|
import V from "./chat-bubble-footer.vue.mjs";
|
|
11
11
|
import F from "./chat-ai-answer-tip.vue.mjs";
|
|
12
12
|
import U from "./header.vue.mjs";
|
|
@@ -25,7 +25,7 @@ import { downloadJsonFile as ee, generateFileName as te } from "./util/text-file
|
|
|
25
25
|
import { replaceAiTipTags as ae, parseAnswerContent as ne, extractFilenameFromUrl as oe } from "./util/chat-embed-util.mjs";
|
|
26
26
|
import le from "./util/mcp-utils.mjs";
|
|
27
27
|
import { useRoute as ie } from "vue-router";
|
|
28
|
-
const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { style: { display: "flex", "flex-direction": "row" } }, ve = { class: "chat-embed__main_content" }, de = ["href", "title"], me = ["href", "target"], he = { style: { "font-size": "10px", color: "#999", "text-align": "right" } }, fe = { key: 1, style: { "margin-top": "5px", width: "100%" } }, pe = ((e2) => (x("data-v-
|
|
28
|
+
const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { style: { display: "flex", "flex-direction": "row" } }, ve = { class: "chat-embed__main_content" }, de = ["href", "title"], me = ["href", "target"], he = { style: { "font-size": "10px", color: "#999", "text-align": "right" } }, fe = { key: 1, style: { "margin-top": "5px", width: "100%" } }, pe = ((e2) => (x("data-v-e84e6e12"), e2 = e2(), P(), e2))(() => c("div", { class: "content-container-header" }, "引用文件", -1)), ge = ["onClick"], ye = { style: { display: "none" } }, we = e({ __name: "index", setup(e2) {
|
|
29
29
|
var _a, _b, _c;
|
|
30
30
|
const x2 = function() {
|
|
31
31
|
try {
|
|
@@ -35,7 +35,7 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
35
35
|
return console.error("获取customSystem参数失败"), null;
|
|
36
36
|
}
|
|
37
37
|
}();
|
|
38
|
-
const P2 = t(((_c = (_b = (_a = window.$vueApp) == null ? void 0 : _a.config) == null ? void 0 : _b.globalProperties) == null ? void 0 : _c.enableAiChat) || false), { startStream: we2, cancel: be, data: ke, error: Se, isLoading: Ce } = E(), { t: Ae } = _(), xe = t(), Pe = t(true), _e = t([]), Ee = t({}), je = t(false), Te = t(H.RAGFLOW),
|
|
38
|
+
const P2 = t(((_c = (_b = (_a = window.$vueApp) == null ? void 0 : _a.config) == null ? void 0 : _b.globalProperties) == null ? void 0 : _c.enableAiChat) || false), { startStream: we2, cancel: be, data: ke, error: Se, isLoading: Ce } = E(), { t: Ae } = _(), xe = t(), Pe = t(true), _e = t([]), Ee = t({}), je = t(false), Te = t(H.RAGFLOW), De = t({}), Ne = {}, Ie = t(true), Me = t(null), Oe = t(false), qe = t(false), $e = t(0), Re = t(""), He = t("500px"), Le = t(250), ze = t("https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"), Je = t(false), Ve = t({}), Fe = t(), Ue = t(), We = t(), Be = t(), Ge = t(), Ke = t(false);
|
|
39
39
|
let Qe = null;
|
|
40
40
|
const Xe = t(null), Ye = document.documentElement.clientWidth - 100, Ze = document.documentElement.clientHeight - 100, { x: et, y: tt, style: at } = I(xe, { initialValue: { x: Ye, y: Ze }, preventDefault: true, onStart() {
|
|
41
41
|
Pe.value = true;
|
|
@@ -56,7 +56,7 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
56
56
|
}
|
|
57
57
|
function ot(e3) {
|
|
58
58
|
var _a2;
|
|
59
|
-
Ie.value = true, Te.value = e3, _e.value = [],
|
|
59
|
+
Ie.value = true, Te.value = e3, _e.value = [], Ne[e3] && 0 !== Ne[e3].length ? (_e.value = Ne[e3], (_a2 = Fe.value) == null ? void 0 : _a2.scrollToBottom()) : _e.value.push(O);
|
|
60
60
|
}
|
|
61
61
|
function lt(e3 = Ae("chatEmbed.requestFailed")) {
|
|
62
62
|
_e.value.push(R("ai", e3, false, false)), je.value = false;
|
|
@@ -65,7 +65,7 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
65
65
|
Pe.value && (Oe.value = !Oe.value, dt(), Ge.value.getHistory());
|
|
66
66
|
}
|
|
67
67
|
function ut(e3) {
|
|
68
|
-
return
|
|
68
|
+
return De.value[e3] || (De.value[e3] = Z().replace(/-/g, "")), De.value[e3];
|
|
69
69
|
}
|
|
70
70
|
ot(Te.value), a(He, (e3) => {
|
|
71
71
|
document.documentElement.style.setProperty("--el-bubble-list-max-height", e3);
|
|
@@ -93,10 +93,10 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
93
93
|
try {
|
|
94
94
|
const t2 = JSON.parse(e3.data);
|
|
95
95
|
if (t2.isChunk)
|
|
96
|
-
true === t2.data && Ee.value.content ? (Ee.value.thinkingStatus =
|
|
96
|
+
true === t2.data && Ee.value.content ? (Ee.value.thinkingStatus = L.END, Ee.value.showThinkingContent = true, Ee.value = {}, je.value = false) : st(t2);
|
|
97
97
|
else {
|
|
98
98
|
if (!((_a2 = t2.data) == null ? void 0 : _a2.id) && true !== t2.data)
|
|
99
|
-
return je.value = false, Ee.value && (Ee.value.thinkingStatus =
|
|
99
|
+
return je.value = false, Ee.value && (Ee.value.thinkingStatus = L.END), "";
|
|
100
100
|
if (t2.data.reference && (((_b2 = t2.data.reference.doc_aggs) == null ? void 0 : _b2.length) && (Ee.value.docAggs = t2.data.reference.doc_aggs), ((_c2 = t2.data.reference.chunks) == null ? void 0 : _c2.length) && (Ee.value.referenceChunks = t2.data.reference.chunks)), true === t2.data)
|
|
101
101
|
return function() {
|
|
102
102
|
if (je.value = false, !Ee.value)
|
|
@@ -120,9 +120,9 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
120
120
|
function ct() {
|
|
121
121
|
if (je.value = false, Qe && (Qe.abort(), Qe = null), Ke.value && (be(), Ke.value = false, _e.value.length > 0)) {
|
|
122
122
|
const e3 = _e.value[_e.value.length - 1];
|
|
123
|
-
e3 && "ai" === e3.role && (e3.thinkingStatus =
|
|
123
|
+
e3 && "ai" === e3.role && (e3.thinkingStatus = L.END, e3.content || (e3.content = "回答已取消"));
|
|
124
124
|
}
|
|
125
|
-
Ee.value && Object.keys(Ee.value).length > 0 && (Ee.value.thinkingStatus =
|
|
125
|
+
Ee.value && Object.keys(Ee.value).length > 0 && (Ee.value.thinkingStatus = L.END, Ee.value = {});
|
|
126
126
|
}
|
|
127
127
|
function vt() {
|
|
128
128
|
qe.value = !qe.value, dt();
|
|
@@ -131,7 +131,7 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
131
131
|
let e3 = 100;
|
|
132
132
|
qe.value && (e3 = 100), u(() => {
|
|
133
133
|
var _a2;
|
|
134
|
-
qe.value ? (We.value.style.height = `calc(${e3}vh)`, We.value.style.width = "calc(100vw)", Re.value = "calc(100vw - var(--chat-padding) * 2) * 0.8") : (We.value.style.height = `calc(${e3}vh - var(--chat-padding) * 2)`, We.value.style.width = 460 +
|
|
134
|
+
qe.value ? (We.value.style.height = `calc(${e3}vh)`, We.value.style.width = "calc(100vw)", Re.value = "calc(100vw - var(--chat-padding) * 2) * 0.8") : (We.value.style.height = `calc(${e3}vh - var(--chat-padding) * 2)`, We.value.style.width = 460 + Le.value + "px", Re.value = 0.8 * (460 + Le.value) + "px");
|
|
135
135
|
const t2 = ((_a2 = Ue.value) == null ? void 0 : _a2.offsetHeight) || 80, a2 = window.innerHeight * e3 / 100 - 56 - t2 - 72;
|
|
136
136
|
He.value = a2 + "px";
|
|
137
137
|
});
|
|
@@ -142,10 +142,10 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
142
142
|
!function(e4) {
|
|
143
143
|
if (!e4)
|
|
144
144
|
return;
|
|
145
|
-
ke.value = [], _e.value.push(R("user", e4, true, false)), je.value = true,
|
|
145
|
+
ke.value = [], _e.value.push(R("user", e4, true, false)), je.value = true, De.value[Te.value] ? kt(e4) : async function(e5) {
|
|
146
146
|
try {
|
|
147
147
|
const t2 = await window.$vueApp.config.globalProperties.$http.post(window.$vueApp.config.globalProperties.baseAPI + "/mc/rag-flow/converse-with-chat", { question: e5 });
|
|
148
|
-
|
|
148
|
+
De.value[Te.value] = t2.session_id, kt(e5);
|
|
149
149
|
} catch (e6) {
|
|
150
150
|
console.error("Failed to create session:", e6), lt();
|
|
151
151
|
}
|
|
@@ -218,19 +218,19 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
218
218
|
function pt() {
|
|
219
219
|
var _a2;
|
|
220
220
|
(_a2 = Xe.value) == null ? void 0 : _a2.newChatSession(), _e.value = [], Te.value === H.DEEPSEEK && async function() {
|
|
221
|
-
if (
|
|
221
|
+
if (De.value[Te.value])
|
|
222
222
|
try {
|
|
223
|
-
await window.$vueApp.config.globalProperties.$http.post(window.$vueApp.config.globalProperties.baseAPI + "/component/ai/multiple-fuck/clear/" +
|
|
223
|
+
await window.$vueApp.config.globalProperties.$http.post(window.$vueApp.config.globalProperties.baseAPI + "/component/ai/multiple-fuck/clear/" + De.value[Te.value]);
|
|
224
224
|
} catch (e3) {
|
|
225
225
|
console.error("Failed to clear session:", e3), lt();
|
|
226
226
|
}
|
|
227
|
-
}(), Me.value = null,
|
|
227
|
+
}(), Me.value = null, De.value[Te.value] = null, je.value = false, Ne[Te.value] = [], ot(Te.value);
|
|
228
228
|
}
|
|
229
229
|
function gt(e3) {
|
|
230
|
-
|
|
230
|
+
Ne[Te.value] = JSON.parse(JSON.stringify(_e.value)), ot(e3);
|
|
231
231
|
}
|
|
232
232
|
function yt(e3) {
|
|
233
|
-
Ve.value = e3,
|
|
233
|
+
Ve.value = e3, Je.value = true;
|
|
234
234
|
}
|
|
235
235
|
function wt(e3, t2) {
|
|
236
236
|
try {
|
|
@@ -257,7 +257,7 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
257
257
|
async function kt(e3) {
|
|
258
258
|
try {
|
|
259
259
|
Ke.value = true, Ee.value = $({ question: e3 }, true), Ee.value.messageType = "realtime", _e.value.push(Ee.value), Qe = new AbortController();
|
|
260
|
-
const t2 = M(), a2 = await fetch(window.$vueApp.config.globalProperties.baseAPI + "/mc/rag-flow/converse-with-chat-stream", { method: "POST", headers: { "Content-Type": "text/event-stream", authorization: t2 }, body: JSON.stringify({ question: e3, stream: true, systemCode: x2, session_id:
|
|
260
|
+
const t2 = M(), a2 = await fetch(window.$vueApp.config.globalProperties.baseAPI + "/mc/rag-flow/converse-with-chat-stream", { method: "POST", headers: { "Content-Type": "text/event-stream", authorization: t2 }, body: JSON.stringify({ question: e3, stream: true, systemCode: x2, session_id: De.value[Te.value] }), signal: Qe.signal });
|
|
261
261
|
if (!a2.body)
|
|
262
262
|
throw new Error("No response body");
|
|
263
263
|
await we2({ readableStream: a2.body });
|
|
@@ -274,7 +274,7 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
274
274
|
function Ct(e3) {
|
|
275
275
|
je.value = true, ut(Te.value);
|
|
276
276
|
const t2 = { question: e3.content, aiModel: Te.value };
|
|
277
|
-
if (Ee.value = $(t2, false), _e.value.push(Ee.value), Ee.value.thinkingStatus =
|
|
277
|
+
if (Ee.value = $(t2, false), _e.value.push(Ee.value), Ee.value.thinkingStatus = L.NONE, e3.url) {
|
|
278
278
|
const t3 = e3.command ? e3.command : e3.content;
|
|
279
279
|
Ee.value.link = e3.url, Ee.value.linkTitle = t3, Ee.value.content = e3.content;
|
|
280
280
|
} else
|
|
@@ -282,25 +282,25 @@ const ue = { key: 0 }, re = ["src"], se = { class: "chat-content" }, ce = { styl
|
|
|
282
282
|
Ee.value = {}, je.value = false;
|
|
283
283
|
}
|
|
284
284
|
function At(e3 = false) {
|
|
285
|
-
Ee.value.thinkingStatus =
|
|
285
|
+
Ee.value.thinkingStatus = L.END, Ee.value.showThinkingContent = true, Ee.value.messageType = "history", Ee.value = {}, Ie.value && Ge.value.addCurrentToSessionHistory(De.value[Te.value], _e.value), e3 || (Ie.value = false);
|
|
286
286
|
}
|
|
287
287
|
function xt(e3, t2 = false) {
|
|
288
|
-
Ee.value.content = e3, t2 && (Ee.value.thinkingStatus =
|
|
288
|
+
Ee.value.content = e3, t2 && (Ee.value.thinkingStatus = L.ERROR), At(t2);
|
|
289
289
|
}
|
|
290
290
|
function Pt(e3, t2) {
|
|
291
|
-
Ie.value = false, Me.value = e3,
|
|
291
|
+
Ie.value = false, Me.value = e3, De.value[Te.value] = e3.sessionId, t2.length > 0 && (_e.value = []), u(() => {
|
|
292
292
|
_e.value = t2, u(() => {
|
|
293
293
|
var _a2;
|
|
294
294
|
(_a2 = Fe.value) == null ? void 0 : _a2.scrollToBottom();
|
|
295
295
|
});
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
|
-
return (e3, t2) => P2.value ? (r(), s("div", ue, [c("div", { ref_key: "chatIcon", ref: xe, style: v([d(at), { position: "fixed", cursor: "pointer", "z-index": "100" }]) }, [c("img", { src: d(X), alt: "AI Avatar", onClick: it, style: { width: "50px", height: "50px" } }, null, 8, re)], 4), m(h, { name: "slide-up" }, { default: f(() => [p(c("div", { ref_key: "chatContainerRef", ref: We, class: g(["chat-container", qe.value ? "full-screen" : "small-window"]), style: { display: "flex", flexDirection: "row" } }, [m(Y, { ref_key: "sidebarItemRef", ref: Ge, style: v({ width:
|
|
298
|
+
return (e3, t2) => P2.value ? (r(), s("div", ue, [c("div", { ref_key: "chatIcon", ref: xe, style: v([d(at), { position: "fixed", cursor: "pointer", "z-index": "100" }]) }, [c("img", { src: d(X), alt: "AI Avatar", onClick: it, style: { width: "50px", height: "50px" } }, null, 8, re)], 4), m(h, { name: "slide-up" }, { default: f(() => [p(c("div", { ref_key: "chatContainerRef", ref: We, class: g(["chat-container", qe.value ? "full-screen" : "small-window"]), style: { display: "flex", flexDirection: "row" } }, [m(Y, { ref_key: "sidebarItemRef", ref: Ge, style: v({ width: Le.value + "px" }), onSelectHistoryItem: Pt, onNewChatSession: pt, onUpdateAiHistory: t2[0] || (t2[0] = (e4) => {
|
|
299
299
|
Me.value.value = e4;
|
|
300
|
-
}), dialogFullScreen: qe.value, aiModel: Te.value }, null, 8, ["style", "dialogFullScreen", "aiModel"]), c("div", se, [m(U, { aiAvatar:
|
|
300
|
+
}), dialogFullScreen: qe.value, aiModel: Te.value }, null, 8, ["style", "dialogFullScreen", "aiModel"]), c("div", se, [m(U, { aiAvatar: ze.value, aiModel: Te.value, chatSessionId: De.value, dialogFullScreen: qe.value, aiHistory: Me.value, onExpandDialog: vt, onShowChatDialog: it, onNewChatSession: pt }, null, 8, ["aiAvatar", "aiModel", "chatSessionId", "dialogFullScreen", "aiHistory"]), c("div", ce, [(r(), s("div", { ref_key: "talkMainRef", ref: Be, class: "chat-embed__main", key: $e.value }, [c("div", ve, [m(d(j), { ref_key: "bubbleListRef", ref: Fe, list: _e.value, "max-height": He.value, "is-fog": true }, { avatar: f(({ item: e4 }) => []), content: f(({ item: e4 }) => {
|
|
301
301
|
var _a2;
|
|
302
|
-
return [e4.isRecommend || null === e4.thinkingContent ? b("", true) : (r(), s(y, { key: 0 }, ["failed" !== e4.messageStatus ? (r(), w(d(T), { key: 0, "button-width": "180px", style: { "margin-bottom": "5px" }, modelValue: e4.showThinkingContent, "onUpdate:modelValue": (t3) => e4.showThinkingContent = t3, status: e4.thinkingStatus, "auto-collapse": "", content: e4.thinkingContent, typing: { interval: 20 }, duration: ".3s" }, null, 8, ["modelValue", "onUpdate:modelValue", "status", "content"])) : b("", true)], 64)), e4.link ? (r(), s("a", { key: 1, href: e4.link, title: e4.linkTitle, target: "blank" }, k(e4.content), 9, de)) : e4.content ? (r(), s(y, { key: 2 }, [c("div", { class: g(["ai" === e4.role ? "content-container" : "content-borderless-container", "chat-content-font"]) }, ["ai" !== e4.role || e4.isRecommend ? "user" === e4.role ? (r(), s(y, { key: 1 }, [S(k(e4.content) + " ", 1), ((_a2 = e4.additionalData) == null ? void 0 : _a2.length) > 0 ? (r(), w(
|
|
303
|
-
}), footer: f(({ item: e4 }) => [m(V, { item: e4, onRegenerate: ht }, null, 8, ["item"])]), _: 1 }, 8, ["list", "max-height"]), c("div", ye, k(rt.value), 1)]), c("div", { ref_key: "talkInputRef", ref: Ue, class: "chat-embed__input_container" }, [m(W, { loading: je.value, ref_key: "chatSenderRef", ref: Xe, onSubmitQuestion: mt, onCommandAnswer: Ct, onHandleCancel: ct, onViewJson: yt, onChangeAiModel: gt }, null, 8, ["loading"])], 512)]))])])], 2), [[A, Oe.value]])]), _: 1 }), m(d(B), { modelValue:
|
|
302
|
+
return [e4.isRecommend || null === e4.thinkingContent ? b("", true) : (r(), s(y, { key: 0 }, ["failed" !== e4.messageStatus ? (r(), w(d(T), { key: 0, "button-width": "180px", style: { "margin-bottom": "5px" }, modelValue: e4.showThinkingContent, "onUpdate:modelValue": (t3) => e4.showThinkingContent = t3, status: e4.thinkingStatus, "auto-collapse": "", content: e4.thinkingContent, typing: { interval: 20 }, duration: ".3s" }, null, 8, ["modelValue", "onUpdate:modelValue", "status", "content"])) : b("", true)], 64)), e4.link ? (r(), s("a", { key: 1, href: e4.link, title: e4.linkTitle, target: "blank" }, k(e4.content), 9, de)) : e4.content ? (r(), s(y, { key: 2 }, [c("div", { class: g(["ai" === e4.role ? "content-container" : "content-borderless-container", "chat-content-font"]) }, ["ai" !== e4.role || e4.isRecommend ? "user" === e4.role ? (r(), s(y, { key: 1 }, [S(k(e4.content) + " ", 1), ((_a2 = e4.additionalData) == null ? void 0 : _a2.length) > 0 && e4.additionalDataLabel ? (r(), w(J, { key: 0, item: e4, onViewJson: yt, onDownloadJson: wt }, null, 8, ["item"])) : b("", true)], 64)) : (r(), s(y, { key: 2 }, [S(k(e4.content), 1)], 64)) : (r(), s(y, { key: 0 }, [e4.messageType && "history" !== e4.messageType ? (r(), w(d(N), { key: 1, allowHtml: "", content: e4.content, typing: true, "is-markdown": true, "is-fog": "" }, null, 8, ["content"])) : (r(), w(d(D), { key: 0, markdown: e4.content, allowHtml: true, content: e4.content, typing: { interval: 10 }, "is-markdown": true }, { "amb-ai-tip": f(({ ...t3 }) => [m(F, { item: e4, itemProps: t3, onClickDocAgg: St }, null, 8, ["item", "itemProps"])]), "amb-alink": f(({ ...e5 }) => [c("a", { href: e5.href, target: e5.target }, k(e5.text), 9, me)]), "amb-home-chart": f(({ ...e5 }) => [m(G, { chartProps: e5, class: "chat-chart-container" }, null, 8, ["chartProps"])]), "amb-interaction-data": f(({ ...e5 }) => [m(K, { chartProps: e5, class: "chat-chart-container" }, null, 8, ["chartProps"])]), "amb-auto-chart": f(({ ...e5 }) => [m(Q, { chartProps: e5, class: "chat-chart-container" }, null, 8, ["chartProps"])]), _: 2 }, 1032, ["markdown", "content"]))], 64)), c("div", he, [c("span", null, k(e4.sendTime), 1)])], 2), e4.recommendations && e4.recommendations.length > 0 ? (r(), w(z, { key: 0, item: e4, onClickRecommendation: ft }, null, 8, ["item"])) : b("", true), e4.docAggs && e4.docAggs.length > 0 ? (r(), s("div", fe, [pe, (r(true), s(y, null, C(e4.docAggs, (e5, t3) => (r(), s("div", { onClick: (t4) => St(e5), class: "doc-agg-item" }, k(e5.doc_name), 9, ge))), 256))])) : b("", true)], 64)) : b("", true)];
|
|
303
|
+
}), footer: f(({ item: e4 }) => [m(V, { item: e4, onRegenerate: ht }, null, 8, ["item"])]), _: 1 }, 8, ["list", "max-height"]), c("div", ye, k(rt.value), 1)]), c("div", { ref_key: "talkInputRef", ref: Ue, class: "chat-embed__input_container" }, [m(W, { loading: je.value, ref_key: "chatSenderRef", ref: Xe, onSubmitQuestion: mt, onCommandAnswer: Ct, onHandleCancel: ct, onViewJson: yt, onChangeAiModel: gt }, null, 8, ["loading"])], 512)]))])])], 2), [[A, Oe.value]])]), _: 1 }), m(d(B), { modelValue: Je.value, "onUpdate:modelValue": t2[1] || (t2[1] = (e4) => Je.value = e4), "json-object": Ve.value, "append-to-body": true, title: "预览数据" }, null, 8, ["modelValue", "json-object"])])) : b("", true);
|
|
304
304
|
} });
|
|
305
305
|
export {
|
|
306
306
|
we as default
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import { defineComponent as e, ref as t, onMounted as l, resolveComponent as a, openBlock as n, createElementBlock as s, createVNode as o, withCtx as u, createElementVNode as i, createBlock as r, unref as d, isRef as c, createCommentVNode as m, withKeys as p,
|
|
1
|
+
import { defineComponent as e, ref as t, onMounted as l, resolveComponent as a, openBlock as n, createElementBlock as s, createVNode as o, withCtx as u, createElementVNode as i, createBlock as r, unref as d, isRef as c, createCommentVNode as m, withKeys as p, createTextVNode as f, toDisplayString as h } from "vue";
|
|
2
2
|
import { Search as v, ArrowRight as y, ArrowUpBold as g } from "@element-plus/icons-vue";
|
|
3
3
|
import { initSelectDepts as k, getTenant as I, getTenantChildren as N, checkedDeptDefault as w, loadDepartment as C } from "./department-tree-service.mjs";
|
|
4
|
-
import { resizeScrollTargetHeightUtil as x,
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { ElMessage as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
12
|
-
const
|
|
4
|
+
import { resizeScrollTargetHeightUtil as x, getShowDeptNamePath as T, getDeptNamePath as _ } from "../../utils/organization.mjs";
|
|
5
|
+
import b from "./dept-path.vue.mjs";
|
|
6
|
+
import E from "./dept-result.vue.mjs";
|
|
7
|
+
import { ElMessage as R } from "element-plus";
|
|
8
|
+
import { useI18n as V } from "vue-i18n";
|
|
9
|
+
import D from "../../utils/utils.mjs";
|
|
10
|
+
import S from "../../src/assets/nonemessage.png.mjs";
|
|
11
|
+
const $ = { style: { display: "flex" } }, O = { style: { flex: "0 0 20%", "text-align": "left" } }, j = { style: { flex: "0 0 80%", "text-align": "right" } }, z = { class: "item-row" }, M = { class: "item-label" }, P = { class: "item-description" }, A = ["onClick"], U = { style: { display: "flex" } }, B = { key: 0 }, F = { style: { "padding-left": "10px" } }, J = { key: 1 }, K = { key: 0, style: { color: "#999" } }, q = { class: "button-area" }, H = e({ __name: "department-tree-inline-app", props: { multiple: {}, departmentInfo: {}, selectDepartmentInfo: {}, searchField: {}, separator: {}, limitFilterColumn: {} }, emits: ["close"], setup(e2, { emit: H2 }) {
|
|
12
|
+
const G = e2, { t: L } = V(), Q = t(null);
|
|
13
13
|
t(false);
|
|
14
|
-
let
|
|
14
|
+
let W = t(null), X = t(false), Y = t(null), Z = t([]);
|
|
15
15
|
t([]);
|
|
16
|
-
let
|
|
16
|
+
let ee = t([]);
|
|
17
17
|
t([]);
|
|
18
|
-
let
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
e3 ? N(
|
|
22
|
-
|
|
23
|
-
}) :
|
|
18
|
+
let te = t([]), le = t([]), ae = t(null), ne = t(false), se = t({ userField: "name", searchValue: null, treeType: "DEPARTMENT_TREE", departmentInfo: null });
|
|
19
|
+
function oe() {
|
|
20
|
+
D.canShowOrgTree().then((e3) => {
|
|
21
|
+
e3 ? N(G.departmentInfo, -1, G.limitFilterColumn).then((e4) => {
|
|
22
|
+
Z.value = e4, w(ee.value, le.value);
|
|
23
|
+
}) : Z.value = [];
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function ue(e3, t2, l2) {
|
|
27
|
+
G.multiple && (t2 ? re(e3) : de(e3));
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
!
|
|
29
|
+
function ie(e3, t2, l2, a2) {
|
|
30
|
+
!G.multiple && e3.nodeType && "DEPARTMENT" === e3.nodeType && (ee.value = [e3]);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function re(e3) {
|
|
33
33
|
if (e3.nodeType && "DEPARTMENT" === e3.nodeType) {
|
|
34
|
-
const t2 =
|
|
35
|
-
t2 && 0 !== t2.length ||
|
|
34
|
+
const t2 = ee.value.filter((t3) => t3.nodeId === e3.nodeId);
|
|
35
|
+
t2 && 0 !== t2.length || ee.value.push(JSON.parse(JSON.stringify(e3)));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const t2 =
|
|
40
|
-
|
|
38
|
+
function de(e3) {
|
|
39
|
+
const t2 = ee.value.findIndex((t3) => t3.nodeId === e3.nodeId);
|
|
40
|
+
ee.value.splice(t2, 1), ne.value = false;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
if (
|
|
42
|
+
function ce(e3) {
|
|
43
|
+
if (G.multiple)
|
|
44
44
|
if (e3) {
|
|
45
|
-
const e4 =
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const e4 = Z.value.map((e5) => e5.nodeId);
|
|
46
|
+
Q.value.setCheckedKeys(e4, false), Z.value.forEach((e5) => {
|
|
47
|
+
re(e5);
|
|
48
48
|
});
|
|
49
49
|
} else
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}),
|
|
50
|
+
Z.value.forEach((e4) => {
|
|
51
|
+
de(e4);
|
|
52
|
+
}), Q.value.setCheckedKeys([], false);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function me(e3) {
|
|
55
55
|
C(e3.id).then((e4) => {
|
|
56
|
-
|
|
56
|
+
Z.value = e4, w(ee.value, le.value);
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
t2 ? (
|
|
59
|
+
function pe(e3, t2, l2) {
|
|
60
|
+
t2 ? (te.value = [], oe()) : (te.value.splice(l2 + 1, te.value.length - (l2 + 1)), me(e3));
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
62
|
+
function fe() {
|
|
63
|
+
ae.value.showResult();
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const t2 =
|
|
65
|
+
function he(e3) {
|
|
66
|
+
const t2 = ee.value.filter((t3) => t3.nodeId === e3.nodeId);
|
|
67
67
|
if (t2 && t2.length > 0) {
|
|
68
68
|
const t3 = [];
|
|
69
|
-
|
|
69
|
+
ee.value.forEach((l2) => {
|
|
70
70
|
l2.nodeId !== e3.nodeId && t3.push(l2.nodeId);
|
|
71
|
-
}),
|
|
71
|
+
}), Q.value.setCheckedKeys(t3, true);
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
de(e3);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
if (
|
|
75
|
+
function ve() {
|
|
76
|
+
if (G.multiple) {
|
|
77
77
|
let e3 = { ids: [], names: [], zhNames: [], enNames: [], codes: [], departments: [] };
|
|
78
|
-
|
|
78
|
+
ee.value.forEach((t3) => {
|
|
79
79
|
let l2;
|
|
80
80
|
l2 = null !== t3.data && void 0 !== t3.data ? JSON.parse(t3.data) : t3, function(e4, t4, l3) {
|
|
81
|
-
e4.ids.push(t4.id), e4.codes.push(l3.code), e4.containBranch =
|
|
81
|
+
e4.ids.push(t4.id), e4.codes.push(l3.code), e4.containBranch = X.value, l3.tenantCode = W.value.code, l3.tenantName = W.value.tenantName, e4.departments.push(l3);
|
|
82
82
|
const a2 = l3.showName;
|
|
83
83
|
e4.names.push(a2), e4.zhNames.push(l3.name), e4.enNames.push(l3.enName ? l3.enName : "");
|
|
84
84
|
}(e3, t3, l2);
|
|
85
85
|
});
|
|
86
86
|
let t2 = { ids: [], names: [], zhNames: [], enNames: [], codes: [], departments: [] };
|
|
87
|
-
Object.assign(t2, e3), t2.ids.length > 0 ?
|
|
87
|
+
Object.assign(t2, e3), t2.ids.length > 0 ? H2("close", t2) : R({ message: L("imatrixUIMessage.pleaseSelectDepartment"), type: "warning" });
|
|
88
88
|
} else {
|
|
89
|
-
const e3 =
|
|
90
|
-
t2.tenantName =
|
|
91
|
-
const a2 = { id: e3.id, name: l2, zhName: t2.name, enName: t2.enName, code: t2.code, containBranch:
|
|
92
|
-
|
|
89
|
+
const e3 = ee.value[0], t2 = JSON.parse(e3.data), l2 = e3.showName;
|
|
90
|
+
t2.tenantName = W.value.tenantName, t2.tenantCode = W.value.code;
|
|
91
|
+
const a2 = { id: e3.id, name: l2, zhName: t2.name, enName: t2.enName, code: t2.code, containBranch: X.value, department: t2 };
|
|
92
|
+
H2("close", a2);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
e3 ? (0 === e3.length &&
|
|
98
|
-
})) :
|
|
95
|
+
function ye() {
|
|
96
|
+
se.value.searchValue ? (se.value.searchValue = se.value.searchValue.trim(), se.value.departmentInfo = G.departmentInfo, window.$vueApp.config.globalProperties.$http.post(window.$vueApp.config.globalProperties.baseAPI + "/component/organization-trees/search-depts", se.value).then((e3) => {
|
|
97
|
+
e3 ? (0 === e3.length && R({ message: L("imatrixUIMessage.queryResultIsEmpty"), type: "warning" }), Z.value = e3) : R({ message: L("imatrixUIMessage.queryResultIsEmpty"), type: "warning" });
|
|
98
|
+
})) : oe();
|
|
99
99
|
}
|
|
100
100
|
return l(() => {
|
|
101
|
-
k(
|
|
102
|
-
|
|
101
|
+
k(G.selectDepartmentInfo, -1, G.searchField, G.separator).then((e3) => {
|
|
102
|
+
ee.value = e3, I().then((e4) => {
|
|
103
103
|
const t2 = e4[0].data;
|
|
104
|
-
|
|
104
|
+
W.value = JSON.parse(t2), X.value = e4[0].containBranch, Y.value = e4[0].name, oe();
|
|
105
105
|
});
|
|
106
106
|
}), function() {
|
|
107
107
|
const e3 = document.querySelector(".org-tree");
|
|
@@ -109,13 +109,13 @@ const S = { style: { display: "flex" } }, $ = { style: { flex: "0 0 20%", "text-
|
|
|
109
109
|
t2 = t2 - 110 - 60 - 60 - 60, e3.style.height = t2 + "px", e3.style.minHeight = "300px";
|
|
110
110
|
}();
|
|
111
111
|
}), (e3, t2) => {
|
|
112
|
-
const l2 = a("el-checkbox"), k2 = a("el-icon"), I2 = a("el-input"), N2 = a("el-col"), w2 = a("el-row"), C2 = a("el-card"), x2 = a("el-empty"),
|
|
113
|
-
return n(), s("div", null, [o(C2, { class: "card-content", style: { height: "50px" } }, { default: u(() => [o(w2, { class: "item-row item-row-all" }, { default: u(() => [o(N2, { style: { width: "100%" } }, { default: u(() => [i("div",
|
|
114
|
-
return l3 = t3,
|
|
112
|
+
const l2 = a("el-checkbox"), k2 = a("el-icon"), I2 = a("el-input"), N2 = a("el-col"), w2 = a("el-row"), C2 = a("el-card"), x2 = a("el-empty"), R2 = a("el-tree"), V2 = a("el-button");
|
|
113
|
+
return n(), s("div", null, [o(C2, { class: "card-content", style: { height: "50px" } }, { default: u(() => [o(w2, { class: "item-row item-row-all" }, { default: u(() => [o(N2, { style: { width: "100%" } }, { default: u(() => [i("div", $, [i("div", O, [e3.multiple ? (n(), r(l2, { key: 0, modelValue: d(ne), "onUpdate:modelValue": t2[0] || (t2[0] = (e4) => c(ne) ? ne.value = e4 : ne = e4), label: e3.$t("departmentTreeInline.allCheck"), value: "all", onChange: ce }, null, 8, ["modelValue", "label"])) : m("", true)]), i("div", j, [o(I2, { modelValue: d(se).searchValue, "onUpdate:modelValue": t2[1] || (t2[1] = (e4) => d(se).searchValue = e4), placeholder: e3.$t("departmentTreeInline.pleaseInputNameOrCode"), onClear: ye, onKeyup: p(ye, ["enter"]), onBlur: ye, clearable: "" }, { suffix: u(() => [o(k2, { onClick: ye }, { default: u(() => [o(d(v))]), _: 1 })]), _: 1 }, 8, ["modelValue", "placeholder", "onKeyup"])])])]), _: 1 })]), _: 1 })]), _: 1 }), d(Y) ? (n(), r(C2, { key: 0, class: "card-content" }, { default: u(() => [o(w2, { class: "item-row item-row-all" }, { default: u(() => [o(N2, { class: "item-label dept-path" }, { default: u(() => [o(b, { tenantName: d(Y), clickDepts: d(te), onClickBreadcrumb: pe }, null, 8, ["tenantName", "clickDepts"])]), _: 1 })]), _: 1 })]), _: 1 })) : m("", true), o(C2, { class: "card-content org-tree", style: { overflow: "auto" } }, { default: u(() => [d(Z).length ? (n(), r(R2, { key: 1, ref_key: "orgTreeRef", ref: Q, data: d(Z), "show-checkbox": e3.multiple, "node-key": "nodeId", "check-on-click-node": "", "default-checked-keys": d(le), onCheckChange: ue, onNodeClick: ie }, { default: u(({ node: e4, data: t3 }) => [i("div", z, [i("div", M, [f(h(t3.showName) + " ", 1), i("span", P, h(d(T)(t3.showName, t3)), 1)]), t3.leaf ? m("", true) : (n(), s("div", { key: 0, class: "item-side", onClick: (e5) => {
|
|
114
|
+
return l3 = t3, te.value.push(l3), void me(l3);
|
|
115
115
|
var l3;
|
|
116
|
-
} }, [o(k2, null, { default: u(() => [o(d(y))]), _: 1 })], 8,
|
|
116
|
+
} }, [o(k2, null, { default: u(() => [o(d(y))]), _: 1 })], 8, A))])]), _: 1 }, 8, ["data", "show-checkbox", "default-checked-keys"])) : (n(), r(x2, { key: 0, image: d(S) }, null, 8, ["image"]))]), _: 1 }), o(C2, { class: "card-footer" }, { default: u(() => [i("div", U, [i("div", { class: "select-result", onClick: fe }, [e3.multiple ? (n(), s("span", { key: 0, onClick: fe }, [d(ee).length > 0 ? (n(), s("span", B, [f(h(e3.$t("departmentTreeInline.selectResultInfoHasSelect")) + h(e3.$t("departmentTreeInline.selectResultInfo", { num: d(ee).length })) + " ", 1), i("span", F, [o(k2, null, { default: u(() => [o(d(g))]), _: 1 })])])) : m("", true)])) : d(ee).length > 0 ? (n(), s("span", J, [f(h(e3.$t("departmentTreeInline.selectResultInfoHasSelect")) + h(d(ee)[0].showName), 1), "-1" !== d(ee)[0].parentNodeId && d(_)(d(ee)[0]) ? (n(), s("span", K, "(" + h(d(_)(d(ee)[0])) + ")", 1)) : m("", true)])) : m("", true)]), i("div", q, [o(V2, { size: "large", type: "primary", onClick: ve }, { default: u(() => [f(h(e3.$t("imatrixUIPublicModel.sure")), 1)]), _: 1 })])])]), _: 1 }), o(E, { ref_key: "deptResultRef", ref: ae, selectDepts: d(ee), onRemoveDept: he }, null, 8, ["selectDepts"])]);
|
|
117
117
|
};
|
|
118
118
|
} });
|
|
119
119
|
export {
|
|
120
|
-
|
|
120
|
+
H as default
|
|
121
121
|
};
|