@epxing/business 5.3.0-beta.2 → 5.3.0-beta.3

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.
Files changed (98) hide show
  1. package/API.md +8 -4
  2. package/README.md +44 -44
  3. package/dist/src/base/AiSkillEditor.js +1 -1
  4. package/dist/src/base/AiSkillEditor.vue.js +2 -0
  5. package/dist/src/base/AppConfigFormItem.js +1 -3
  6. package/dist/src/base/AppConfigFormItem.vue.js +210 -85
  7. package/dist/src/base/CommonFieldList.js +1 -1
  8. package/dist/src/base/CommonFieldList.vue.js +2 -1
  9. package/dist/src/base/ConfigModuleIndex.js +38 -1
  10. package/dist/src/base/ManageAppNav.js +1 -1
  11. package/dist/src/base/ManageMenu.js +1 -1
  12. package/dist/src/base/RoleBindTrace.js +253 -0
  13. package/dist/src/base/RoleGroupManage.js +1037 -0
  14. package/dist/src/base/ServiceMenu.js +7 -6
  15. package/dist/src/components/AiList.js +1278 -3
  16. package/dist/src/components/EntityCheckboxFind.vue.js +14 -10
  17. package/dist/src/components/EntityRightFormItem.js +1 -5
  18. package/dist/src/components/EntityRightFormItem.vue.js +3 -1
  19. package/dist/src/components/EntitySystemEr.js +492 -0
  20. package/dist/src/components/HallNav.vue.js +7 -36
  21. package/dist/src/components/IconFontLibrary.js +22 -1
  22. package/dist/src/components/IconFontList.js +21 -1
  23. package/dist/src/components/PrintFormList.js +2 -1
  24. package/dist/src/components/PrintFormList.vue.js +3 -1
  25. package/dist/src/components/WikiWorkbench.js +153 -129
  26. package/dist/src/components/authorization/AuthorizationInterface.js +3 -1
  27. package/dist/src/components/custom-bpmn/PropertiesView.js +1991 -1942
  28. package/dist/src/components/icon-gallery/IconGallery.js +193 -0
  29. package/dist/src/components/icon-gallery/mixin.js +150 -0
  30. package/dist/src/components/wiki-workbench/WikiIntake.js +86 -93
  31. package/dist/src/components/wiki-workbench/WikiIntake.vue.js +153 -73
  32. package/dist/src/index.js +26 -20
  33. package/dist/src/public-components.js +16 -14
  34. package/dist/src/route-components.js +5 -5
  35. package/dist/src/system.component.index.js +1 -1
  36. package/dist/src/system.component.js +8 -3
  37. package/dist/src/system.component.lazy.js +1 -1
  38. package/dist/src/views/Add.js +1 -1
  39. package/dist/src/views/Add.vue.js +8 -3
  40. package/dist/src/views/AiToolManager.js +792 -317
  41. package/dist/src/views/App.js +3 -45
  42. package/dist/src/views/AppRoleSelect.js +3 -230
  43. package/dist/src/views/Error.js +3 -207
  44. package/dist/src/views/ExcelDesign.js +326 -316
  45. package/dist/src/views/JvmMemoryMonitor.js +463 -0
  46. package/dist/src/views/Module.js +3 -170
  47. package/dist/src/views/WikiBinding.js +88 -25
  48. package/dist/style.css +2867 -1487
  49. package/package.json +12 -6
  50. package/src/base/AiSkillEditor.vue +2 -0
  51. package/src/base/AppConfigFormItem.vue +211 -145
  52. package/src/base/CommonFieldList.vue +9 -6
  53. package/src/base/ConfigModuleIndex.vue +37 -1
  54. package/src/base/ManageAppNav.vue +1188 -1188
  55. package/src/base/ManageMenu.vue +933 -933
  56. package/src/base/RoleBindTrace.vue +364 -0
  57. package/src/base/RoleGroupManage.vue +1160 -0
  58. package/src/base/ServiceMenu.vue +6 -5
  59. package/src/components/AiList.vue +439 -113
  60. package/src/components/EntityCheckboxFind.vue +12 -8
  61. package/src/components/EntityRightFormItem.vue +9 -10
  62. package/src/components/EntitySystemEr.vue +517 -0
  63. package/src/components/HallNav.vue +6 -33
  64. package/src/components/IconFontLibrary.vue +27 -60
  65. package/src/components/IconFontList.vue +13 -64
  66. package/src/components/PrintFormList.vue +33 -27
  67. package/src/components/WikiWorkbench.vue +90 -60
  68. package/src/components/authorization/AuthorizationInterface.vue +2 -0
  69. package/src/components/custom-bpmn/CustomPalette.js +1 -1
  70. package/src/components/custom-bpmn/CustomRenderer.js +1 -1
  71. package/src/components/custom-bpmn/PropertiesView.vue +35 -4
  72. package/src/components/custom-bpmn/index.js +1 -1
  73. package/src/components/icon-gallery/IconGallery.vue +130 -0
  74. package/src/components/icon-gallery/mixin.jsx +109 -0
  75. package/src/components/wiki-workbench/WikiIntake.vue +178 -104
  76. package/src/index.js +24 -20
  77. package/src/public-components.js +1 -0
  78. package/src/route-components.js +4 -4
  79. package/src/system.component.index.js +1 -1
  80. package/src/views/Add.vue +8 -5
  81. package/src/views/AiToolManager.vue +326 -4
  82. package/src/views/App.vue +4 -53
  83. package/src/views/AppRoleSelect.vue +4 -334
  84. package/src/views/Error.vue +4 -63
  85. package/src/views/ExcelDesign.vue +24 -7
  86. package/src/views/JvmMemoryMonitor.vue +284 -0
  87. package/src/views/Module.vue +4 -210
  88. package/src/views/WikiBinding.vue +42 -0
  89. package/types/app.d.ts +1 -0
  90. package/types/dept-find.d.ts +1 -1
  91. package/types/index.d.ts +15 -14
  92. package/types/popup.d.ts +2 -2
  93. package/types/route-components.d.ts +1 -1
  94. package/types/user-find.d.ts +1 -1
  95. package/dist/assets/role_select-DTqRlFNz.webp +0 -0
  96. package/dist/src/components/AiList.vue.js +0 -93
  97. package/dist/src/components/IconFontLibrary.vue.js +0 -67
  98. package/dist/src/components/IconFontList.vue.js +0 -79
@@ -0,0 +1,193 @@
1
+ import '../../../style.css';
2
+ import { ensureIcons } from "@epxing/icons/src/runtime.mjs";
3
+ import { resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, normalizeClass, Fragment, renderList, toDisplayString, withCtx, createTextVNode, createCommentVNode, renderSlot } from "vue";
4
+ /* empty css */
5
+ import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ const _sfc_main = {
7
+ name: "epx-remix-gallery",
8
+ props: {
9
+ icons: { type: Array, default: () => [] },
10
+ categories: { type: Array, default: () => [] },
11
+ selectedCodes: { type: Array, default: () => [] },
12
+ loading: Boolean,
13
+ error: { type: String, default: "" },
14
+ actionLabel: { type: String, default: "点击复制编号" }
15
+ },
16
+ emits: ["select", "reload"],
17
+ data() {
18
+ return { keyword: "", category: "", categoryKeyword: "" };
19
+ },
20
+ computed: {
21
+ remixIcons() {
22
+ return this.icons.filter((icon) => icon.CODE && icon.CODE.startsWith("ri-"));
23
+ },
24
+ categoryNames() {
25
+ return Object.fromEntries(this.categories.map((item) => [item.code, item.name.replace(/^Remix\s*·\s*/, "")]));
26
+ },
27
+ navigation() {
28
+ const keyword = this.categoryKeyword.trim().toLowerCase();
29
+ return this.categories.map((item) => ({ code: item.code, name: this.categoryNames[item.code] })).filter((item) => `${item.code} ${item.name}`.toLowerCase().includes(keyword));
30
+ },
31
+ filteredIcons() {
32
+ const words = this.keyword.trim().toLowerCase().split(/\s+/).filter(Boolean);
33
+ return this.remixIcons.filter((icon) => {
34
+ if (this.category && icon.TYPE !== this.category) return false;
35
+ const text = `${icon.CODE} ${icon.NAME || ""} ${icon.KEY_WORDS || ""} ${this.categoryNames[icon.TYPE] || ""}`.toLowerCase();
36
+ return words.every((word) => text.includes(word));
37
+ });
38
+ },
39
+ groups() {
40
+ const groups = new Map(this.categories.map((item) => [item.code, { code: item.code, name: this.categoryNames[item.code], icons: [] }]));
41
+ this.filteredIcons.forEach((icon) => {
42
+ const code = icon.TYPE || "ri_others";
43
+ if (!groups.has(code)) groups.set(code, { code, name: "其他", icons: [] });
44
+ groups.get(code).icons.push(icon);
45
+ });
46
+ return [...groups.values()].filter((group) => group.icons.length);
47
+ }
48
+ },
49
+ watch: {
50
+ icons: {
51
+ immediate: true,
52
+ handler(icons) {
53
+ ensureIcons(icons.filter((icon) => icon.CODE && icon.CODE.startsWith("ri-")).map((icon) => icon.CODE));
54
+ }
55
+ },
56
+ keyword: "resetScroll",
57
+ category: "resetScroll"
58
+ },
59
+ methods: {
60
+ resetScroll() {
61
+ if (this.$refs.content) this.$refs.content.scrollTop = 0;
62
+ }
63
+ }
64
+ };
65
+ const _hoisted_1 = { class: "epx-remix-gallery" };
66
+ const _hoisted_2 = {
67
+ class: "epx-remix-gallery__nav",
68
+ "aria-label": "图标分类"
69
+ };
70
+ const _hoisted_3 = ["onClick"];
71
+ const _hoisted_4 = { class: "epx-remix-gallery__main" };
72
+ const _hoisted_5 = { class: "epx-remix-gallery__header" };
73
+ const _hoisted_6 = {
74
+ key: 0,
75
+ class: "epx-remix-gallery__state",
76
+ role: "alert"
77
+ };
78
+ const _hoisted_7 = {
79
+ key: 1,
80
+ class: "epx-remix-gallery__state",
81
+ role: "status"
82
+ };
83
+ const _hoisted_8 = {
84
+ key: 2,
85
+ ref: "content",
86
+ class: "epx-remix-gallery__content"
87
+ };
88
+ const _hoisted_9 = {
89
+ key: 0,
90
+ class: "epx-remix-gallery__state"
91
+ };
92
+ const _hoisted_10 = ["aria-label"];
93
+ const _hoisted_11 = { class: "epx-remix-gallery__grid" };
94
+ const _hoisted_12 = ["title", "aria-label", "aria-pressed", "onClick"];
95
+ const _hoisted_13 = {
96
+ key: 3,
97
+ class: "epx-remix-gallery__footer"
98
+ };
99
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
100
+ const _component_el_input = resolveComponent("el-input");
101
+ const _component_el_button = resolveComponent("el-button");
102
+ return openBlock(), createElementBlock("div", _hoisted_1, [
103
+ createElementVNode("aside", _hoisted_2, [
104
+ _cache[4] || (_cache[4] = createElementVNode("h3", null, "图标分类", -1)),
105
+ createVNode(_component_el_input, {
106
+ modelValue: $data.categoryKeyword,
107
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.categoryKeyword = $event),
108
+ placeholder: "搜索分类",
109
+ clearable: "",
110
+ "aria-label": "搜索分类"
111
+ }, null, 8, ["modelValue"]),
112
+ createElementVNode("button", {
113
+ type: "button",
114
+ class: normalizeClass({ active: !$data.category }),
115
+ onClick: _cache[1] || (_cache[1] = ($event) => $data.category = "")
116
+ }, "全部分类", 2),
117
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.navigation, (item) => {
118
+ return openBlock(), createElementBlock("button", {
119
+ key: item.code,
120
+ type: "button",
121
+ class: normalizeClass({ active: $data.category === item.code }),
122
+ onClick: ($event) => $data.category = item.code
123
+ }, toDisplayString(item.name), 11, _hoisted_3);
124
+ }), 128))
125
+ ]),
126
+ createElementVNode("main", _hoisted_4, [
127
+ createElementVNode("header", _hoisted_5, [
128
+ createElementVNode("div", null, [
129
+ _cache[5] || (_cache[5] = createElementVNode("h2", null, "Remix Icon", -1)),
130
+ createElementVNode("span", null, toDisplayString($props.loading ? "正在加载图标…" : `${$options.filteredIcons.length} 个图标 · ${$props.actionLabel}`), 1)
131
+ ]),
132
+ createVNode(_component_el_input, {
133
+ modelValue: $data.keyword,
134
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.keyword = $event),
135
+ placeholder: "搜索名称、编号或关键词",
136
+ clearable: "",
137
+ "aria-label": "搜索图标"
138
+ }, null, 8, ["modelValue"])
139
+ ]),
140
+ $props.error ? (openBlock(), createElementBlock("div", _hoisted_6, [
141
+ createElementVNode("p", null, toDisplayString($props.error), 1),
142
+ createVNode(_component_el_button, {
143
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("reload"))
144
+ }, {
145
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [
146
+ createTextVNode("重新加载", -1)
147
+ ])]),
148
+ _: 1
149
+ })
150
+ ])) : $props.loading ? (openBlock(), createElementBlock("div", _hoisted_7, "正在加载完整图标库…")) : (openBlock(), createElementBlock("div", _hoisted_8, [
151
+ !$options.groups.length ? (openBlock(), createElementBlock("div", _hoisted_9, "未找到匹配的图标,请更换分类或关键词")) : createCommentVNode("", true),
152
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.groups, (group) => {
153
+ return openBlock(), createElementBlock("section", {
154
+ key: group.code,
155
+ class: "epx-remix-gallery__section",
156
+ "aria-label": group.name
157
+ }, [
158
+ createElementVNode("h3", null, [
159
+ createTextVNode(toDisplayString(group.name) + " ", 1),
160
+ createElementVNode("span", null, toDisplayString(group.icons.length), 1)
161
+ ]),
162
+ createElementVNode("div", _hoisted_11, [
163
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group.icons, (icon) => {
164
+ return openBlock(), createElementBlock("button", {
165
+ key: icon.CODE,
166
+ type: "button",
167
+ class: normalizeClass(["epx-remix-gallery__icon", { selected: $props.selectedCodes.includes(icon.CODE) }]),
168
+ title: icon.CODE,
169
+ "aria-label": `${$props.actionLabel} ${icon.CODE}`,
170
+ "aria-pressed": $props.selectedCodes.includes(icon.CODE),
171
+ onClick: ($event) => _ctx.$emit("select", icon)
172
+ }, [
173
+ createElementVNode("i", {
174
+ class: normalizeClass(icon.CODE),
175
+ "aria-hidden": "true"
176
+ }, null, 2),
177
+ createElementVNode("span", null, toDisplayString(icon.NAME || icon.CODE), 1)
178
+ ], 10, _hoisted_12);
179
+ }), 128))
180
+ ])
181
+ ], 8, _hoisted_10);
182
+ }), 128))
183
+ ], 512)),
184
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_13, [
185
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
186
+ ])) : createCommentVNode("", true)
187
+ ])
188
+ ]);
189
+ }
190
+ const IconGallery = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-be05baa3"]]);
191
+ export {
192
+ IconGallery as default
193
+ };
@@ -0,0 +1,150 @@
1
+ import '../../../style.css';
2
+ import { createVNode, resolveComponent, createTextVNode } from "vue";
3
+ import IconGallery from "./IconGallery.js";
4
+ async function loadAllIcons(http, params, isCurrent = () => true) {
5
+ const icons = [];
6
+ const codes = /* @__PURE__ */ new Set();
7
+ let total = 0;
8
+ for (let page = 1; page === 1 || icons.length < total; page++) {
9
+ const result = await http.list({
10
+ ...params,
11
+ page,
12
+ limit: 500,
13
+ order_field: "CODE",
14
+ order_mode: "asc"
15
+ });
16
+ if (!isCurrent()) return null;
17
+ total = Number(result.total);
18
+ const batch = result.entitys || [];
19
+ if (!Number.isFinite(total) || total < 0 || !batch.length && icons.length < total) throw new Error("图标数据未加载完整,请重新加载");
20
+ for (const icon of batch) {
21
+ if (!icon.CODE || codes.has(icon.CODE)) throw new Error("图标分页数据重复,请重新加载");
22
+ codes.add(icon.CODE);
23
+ icons.push(icon);
24
+ }
25
+ if (icons.length > total) throw new Error("图标数据发生变化,请重新加载");
26
+ }
27
+ return icons.filter((icon) => icon.CODE.startsWith("ri-"));
28
+ }
29
+ const gallery = {
30
+ components: {
31
+ IconGallery
32
+ },
33
+ data() {
34
+ return {
35
+ galleryCategories: [],
36
+ galleryError: "",
37
+ // 请求代次阻止已取消或已卸载组件的旧结果覆盖当前数据。
38
+ galleryRequest: 0
39
+ };
40
+ },
41
+ beforeUnmount() {
42
+ this.galleryRequest++;
43
+ },
44
+ methods: {
45
+ initComponent() {
46
+ if (!this.showFlag) return;
47
+ this.listType = this.$configs.type;
48
+ this.getDefaultOperates();
49
+ this.getFields();
50
+ },
51
+ // 分类与搜索由图标墙统一呈现,不再加载父类的分类树。
52
+ getCategoryMeta() {
53
+ },
54
+ getCategoryTreeData() {
55
+ },
56
+ async getData(current, cb) {
57
+ if (!this.$metaId) return;
58
+ const request = ++this.galleryRequest;
59
+ const isCurrent = () => request === this.galleryRequest;
60
+ this.cancelGetData = () => {
61
+ this.galleryRequest++;
62
+ };
63
+ this.loading = true;
64
+ this.galleryError = "";
65
+ try {
66
+ const scope = JSON.parse(this.params.scopeParams || "[]").map((item) => ({
67
+ ...item
68
+ }));
69
+ if (scope.length) {
70
+ scope[0].lb = "(" + (scope[0].lb || "");
71
+ scope[scope.length - 1].rb = (scope[scope.length - 1].rb || "") + ")";
72
+ scope[scope.length - 1].link = "and";
73
+ }
74
+ scope.push({
75
+ field: "CODE",
76
+ mode: "like",
77
+ values: "ri-%",
78
+ link: "and"
79
+ });
80
+ const field = this.$meta.getAllFieldConfigs().find((item) => item.attriName === "TYPE");
81
+ const [categories, icons] = await Promise.all([this.$http.getCodes({
82
+ key: field && field.codeKey || "ICON_TYPE"
83
+ }), loadAllIcons(this.$http, {
84
+ ...this.params,
85
+ entityId: this.$metaId,
86
+ scopeParams: JSON.stringify(scope),
87
+ columnFields: ["CODE", "NAME", "TYPE", "KEY_WORDS"].map((attriName) => ({
88
+ attriName
89
+ }))
90
+ }, isCurrent)]);
91
+ if (!isCurrent()) return;
92
+ this.galleryCategories = (categories || []).filter((item) => item.code && item.code.startsWith("ri_"));
93
+ this.data = icons;
94
+ this.total = icons.length;
95
+ this.initData = true;
96
+ this.getAllDataMap(icons);
97
+ if (this.afterData) this.afterData(icons);
98
+ if (cb) cb(icons);
99
+ if (this.$component) {
100
+ const result = {
101
+ id: this.$component.id,
102
+ total: this.total,
103
+ entitys: icons
104
+ };
105
+ this.$dispatchPage("listData", [result]);
106
+ this.$emit("listData", result);
107
+ }
108
+ } catch (err) {
109
+ if (!isCurrent()) return;
110
+ this.galleryError = err && (err.msg || err.message) || "图标库加载失败,请重新加载";
111
+ this.$message.error(this.galleryError);
112
+ } finally {
113
+ if (isCurrent()) this.loading = false;
114
+ }
115
+ },
116
+ renderGallery(selectable = false) {
117
+ return createVNode(IconGallery, {
118
+ "class": {
119
+ "epx-remix-gallery--selectable": selectable
120
+ },
121
+ "icons": this.data,
122
+ "categories": this.galleryCategories,
123
+ "selectedCodes": selectable ? this.selectionIds : [],
124
+ "style": this.showFlag === false ? {
125
+ display: "none"
126
+ } : {},
127
+ "loading": !this.initData || this.loading,
128
+ "error": this.galleryError,
129
+ "actionLabel": selectable ? "点击选择图标" : "点击复制编号",
130
+ "onSelect": this.chooseIcon,
131
+ "onReload": () => this.getData()
132
+ }, selectable && this.mode === "confirm" ? {
133
+ footer: () => createVNode("div", null, [createVNode(resolveComponent("el-button"), {
134
+ "onClick": this.cancel
135
+ }, {
136
+ default: () => [createTextVNode("取消")]
137
+ }), createVNode(resolveComponent("el-button"), {
138
+ "type": "primary",
139
+ "onClick": this.confirm
140
+ }, {
141
+ default: () => [createTextVNode("确定")]
142
+ })])
143
+ } : {});
144
+ }
145
+ }
146
+ };
147
+ export {
148
+ gallery as default,
149
+ loadAllIcons
150
+ };
@@ -1,6 +1,6 @@
1
1
  import '../../../style.css';
2
2
  import _sfc_main from "./WikiIntake.vue.js";
3
- import { resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, createVNode, withCtx, createTextVNode, createElementVNode, toDisplayString, createCommentVNode, Fragment, normalizeClass, renderList, vShow, createBlock } from "vue";
3
+ import { resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, createVNode, withCtx, createTextVNode, createElementVNode, toDisplayString, createCommentVNode, createBlock, Fragment, renderList, normalizeClass, vShow } from "vue";
4
4
  /* empty css */
5
5
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
6
6
  const _hoisted_1 = { class: "epx-wiki-intake" };
@@ -11,14 +11,15 @@ const _hoisted_2 = {
11
11
  const _hoisted_3 = { class: "epx-wiki-intake__h" };
12
12
  const _hoisted_4 = { class: "sub" };
13
13
  const _hoisted_5 = { class: "epx-wiki-intake__nm" };
14
- const _hoisted_6 = { class: "epx-wiki-intake__sub" };
15
- const _hoisted_7 = { class: "epx-wiki-intake__pages-list" };
16
- const _hoisted_8 = {
14
+ const _hoisted_6 = { key: 2 };
15
+ const _hoisted_7 = { class: "epx-wiki-intake__sub" };
16
+ const _hoisted_8 = { class: "epx-wiki-intake__pages-list" };
17
+ const _hoisted_9 = {
17
18
  key: 1,
18
19
  class: "epx-wiki-intake__sub"
19
20
  };
20
- const _hoisted_9 = { class: "epx-wiki-intake__sub" };
21
- const _hoisted_10 = {
21
+ const _hoisted_10 = { class: "epx-wiki-intake__sub" };
22
+ const _hoisted_11 = {
22
23
  key: 0,
23
24
  class: "epx-wiki-intake__sub"
24
25
  };
@@ -26,11 +27,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
26
27
  const _component_el_alert = resolveComponent("el-alert");
27
28
  const _component_el_button = resolveComponent("el-button");
28
29
  const _component_el_upload = resolveComponent("el-upload");
30
+ const _component_el_popover = resolveComponent("el-popover");
29
31
  const _component_el_table_column = resolveComponent("el-table-column");
30
32
  const _component_el_tag = resolveComponent("el-tag");
31
- const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
32
- const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
33
- const _component_el_dropdown = resolveComponent("el-dropdown");
34
33
  const _component_el_table = resolveComponent("el-table");
35
34
  const _directive_loading = resolveDirective("loading");
36
35
  return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
@@ -63,39 +62,33 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
63
62
  _cache[8] || (_cache[8] = createTextVNode(" 入库记录 ", -1)),
64
63
  createElementVNode("span", _hoisted_4, "共 " + toDisplayString($data.rows.length) + " 条", 1),
65
64
  createVNode(_component_el_upload, {
65
+ ref: "filePicker",
66
66
  class: "r",
67
67
  action: "",
68
68
  multiple: "",
69
69
  limit: $data.MAX_FILES,
70
70
  "auto-upload": false,
71
+ disabled: $data.uploading,
72
+ "show-file-list": false,
71
73
  "file-list": $data.picked,
72
74
  "on-change": $options.onPick,
73
- "on-remove": $options.onPick,
74
75
  "on-exceed": $options.onExceed,
75
76
  accept: ".doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,.txt,.md"
76
77
  }, {
77
78
  default: withCtx(() => [
78
- createVNode(_component_el_button, { size: "small" }, {
79
+ createVNode(_component_el_button, {
80
+ type: "primary",
81
+ size: "small",
82
+ loading: $data.uploading
83
+ }, {
79
84
  default: withCtx(() => [..._cache[7] || (_cache[7] = [
80
- createTextVNode("选择文件", -1)
85
+ createTextVNode("上传并 AI 生成", -1)
81
86
  ])]),
82
87
  _: 1
83
- })
88
+ }, 8, ["loading"])
84
89
  ]),
85
90
  _: 1
86
- }, 8, ["limit", "file-list", "on-change", "on-remove", "on-exceed"]),
87
- createVNode(_component_el_button, {
88
- type: "primary",
89
- size: "small",
90
- disabled: !$data.picked.length,
91
- loading: $data.uploading,
92
- onClick: $options.doUpload
93
- }, {
94
- default: withCtx(() => [
95
- createTextVNode("⬆ 上传" + toDisplayString($data.picked.length ? " " + $data.picked.length + " 个" : ""), 1)
96
- ]),
97
- _: 1
98
- }, 8, ["disabled", "loading", "onClick"])
91
+ }, 8, ["limit", "disabled", "file-list", "on-change", "on-exceed"])
99
92
  ]),
100
93
  createVNode(_component_el_table, {
101
94
  data: $data.rows,
@@ -108,8 +101,57 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
108
101
  "min-width": "200"
109
102
  }, {
110
103
  default: withCtx((s) => [
111
- createElementVNode("div", _hoisted_5, toDisplayString($data.ICON[s.row.fileType] || "📄") + " " + toDisplayString(s.row.fileName), 1),
112
- createElementVNode("div", _hoisted_6, toDisplayString($options.size(s.row.fileSize)), 1)
104
+ createElementVNode("div", _hoisted_5, [
105
+ $options.filesOf(s.row).length === 1 ? (openBlock(), createBlock(_component_el_button, {
106
+ key: 0,
107
+ type: "text",
108
+ class: "epx-wiki-intake__file",
109
+ onClick: ($event) => $options.download($options.filesOf(s.row)[0])
110
+ }, {
111
+ default: withCtx(() => [
112
+ createTextVNode(toDisplayString($data.ICON[s.row.fileType] || "📄") + " " + toDisplayString(s.row.fileName), 1)
113
+ ]),
114
+ _: 2
115
+ }, 1032, ["onClick"])) : $options.filesOf(s.row).length > 1 ? (openBlock(), createBlock(_component_el_popover, {
116
+ key: 1,
117
+ placement: "bottom-start",
118
+ trigger: "click",
119
+ width: "360"
120
+ }, {
121
+ reference: withCtx(() => [
122
+ createVNode(_component_el_button, {
123
+ type: "text",
124
+ class: "epx-wiki-intake__file"
125
+ }, {
126
+ default: withCtx(() => [
127
+ createTextVNode(toDisplayString($data.ICON[s.row.fileType] || "📄") + " " + toDisplayString(s.row.fileName) + " ", 1),
128
+ _cache[9] || (_cache[9] = createElementVNode("i", { class: "el-icon-arrow-down" }, null, -1))
129
+ ]),
130
+ _: 2
131
+ }, 1024)
132
+ ]),
133
+ default: withCtx(() => [
134
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.filesOf(s.row), (file) => {
135
+ return openBlock(), createElementBlock("div", {
136
+ key: file.id
137
+ }, [
138
+ createVNode(_component_el_button, {
139
+ type: "text",
140
+ class: "epx-wiki-intake__file",
141
+ onClick: ($event) => $options.download(file)
142
+ }, {
143
+ default: withCtx(() => [
144
+ createTextVNode(toDisplayString(file.fileName), 1)
145
+ ]),
146
+ _: 2
147
+ }, 1032, ["onClick"])
148
+ ]);
149
+ }), 128))
150
+ ]),
151
+ _: 2
152
+ }, 1024)) : (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString($data.ICON[s.row.fileType] || "📄") + " " + toDisplayString(s.row.fileName), 1))
153
+ ]),
154
+ createElementVNode("div", _hoisted_7, toDisplayString($options.size(s.row.fileSize)), 1)
113
155
  ]),
114
156
  _: 1
115
157
  }),
@@ -141,7 +183,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
141
183
  ]),
142
184
  _: 2
143
185
  }, 1032, ["onClick"]),
144
- withDirectives(createElementVNode("div", _hoisted_7, [
186
+ withDirectives(createElementVNode("div", _hoisted_8, [
145
187
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.pagesOf(s.row), (p) => {
146
188
  return openBlock(), createElementBlock("div", { key: p }, [
147
189
  createVNode(_component_el_button, {
@@ -158,7 +200,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
158
200
  ], 512), [
159
201
  [vShow, $data.expandedPages[s.row.id]]
160
202
  ])
161
- ], 64)) : (openBlock(), createElementBlock("span", _hoisted_8, "—"))
203
+ ], 64)) : (openBlock(), createElementBlock("span", _hoisted_9, "—"))
162
204
  ]),
163
205
  _: 1
164
206
  }),
@@ -168,7 +210,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
168
210
  }, {
169
211
  default: withCtx((s) => [
170
212
  createTextVNode(toDisplayString(s.row.createUser || "—") + " ", 1),
171
- createElementVNode("div", _hoisted_9, toDisplayString(s.row.createTime), 1)
213
+ createElementVNode("div", _hoisted_10, toDisplayString(s.row.createTime), 1)
172
214
  ]),
173
215
  _: 1
174
216
  }),
@@ -203,7 +245,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
203
245
  ]),
204
246
  _: 2
205
247
  }, 1032, ["type"]),
206
- s.row.note ? (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(s.row.note), 1)) : createCommentVNode("", true)
248
+ s.row.note ? (openBlock(), createElementBlock("div", _hoisted_11, toDisplayString(s.row.note), 1)) : createCommentVNode("", true)
207
249
  ]),
208
250
  _: 1
209
251
  }),
@@ -212,86 +254,37 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
212
254
  width: "250"
213
255
  }, {
214
256
  default: withCtx((s) => [
215
- s.row.state === "wait" || s.row.state === "fail" ? (openBlock(), createBlock(_component_el_dropdown, {
257
+ s.row.state === "wait" || s.row.state === "fail" || $options.canRegenerate(s.row) ? (openBlock(), createBlock(_component_el_button, {
216
258
  key: 0,
217
- trigger: "click",
218
- onCommand: (mode) => $options.run(s.row, mode)
219
- }, {
220
- dropdown: withCtx(() => [
221
- createVNode(_component_el_dropdown_menu, null, {
222
- default: withCtx(() => [
223
- createVNode(_component_el_dropdown_item, {
224
- command: "wiki",
225
- divided: ""
226
- }, {
227
- default: withCtx(() => [..._cache[10] || (_cache[10] = [
228
- createTextVNode("AI 生成目录与内容(会调模型,慢)", -1)
229
- ])]),
230
- _: 1
231
- }),
232
- createVNode(_component_el_dropdown_item, { command: "ai" }, {
233
- default: withCtx(() => [..._cache[11] || (_cache[11] = [
234
- createTextVNode("AI 按语义拆页(Word/PDF 用这个)", -1)
235
- ])]),
236
- _: 1
237
- }),
238
- createVNode(_component_el_dropdown_item, { command: "outline" }, {
239
- default: withCtx(() => [..._cache[12] || (_cache[12] = [
240
- createTextVNode("按标题拆页(原文是 markdown 才有效)", -1)
241
- ])]),
242
- _: 1
243
- }),
244
- createVNode(_component_el_dropdown_item, { command: "single" }, {
245
- default: withCtx(() => [..._cache[13] || (_cache[13] = [
246
- createTextVNode("整篇转成一个页", -1)
247
- ])]),
248
- _: 1
249
- })
250
- ]),
251
- _: 1
252
- })
253
- ]),
254
- default: withCtx(() => [
255
- createVNode(_component_el_button, { type: "text" }, {
256
- default: withCtx(() => [
257
- createTextVNode(toDisplayString(s.row.state === "fail" ? "换方式重试" : "开始处理"), 1),
258
- _cache[9] || (_cache[9] = createElementVNode("i", { class: "el-icon-arrow-down" }, null, -1))
259
- ]),
260
- _: 2
261
- }, 1024)
262
- ]),
263
- _: 2
264
- }, 1032, ["onCommand"])) : createCommentVNode("", true),
265
- s.row.state === "done" && s.row.purged !== "1" ? (openBlock(), createBlock(_component_el_button, {
266
- key: 1,
267
259
  type: "text",
268
- onClick: ($event) => $options.purge(s.row)
260
+ onClick: ($event) => $options.generate(s.row)
269
261
  }, {
270
- default: withCtx(() => [..._cache[14] || (_cache[14] = [
271
- createTextVNode(" 清理原文件 ", -1)
262
+ default: withCtx(() => [..._cache[10] || (_cache[10] = [
263
+ createTextVNode(" 重新 AI 生成 ", -1)
272
264
  ])]),
273
265
  _: 1
274
266
  }, 8, ["onClick"])) : createCommentVNode("", true),
275
- $options.canRegenerate(s.row) ? (openBlock(), createBlock(_component_el_button, {
276
- key: 2,
267
+ s.row.state === "done" && s.row.purged !== "1" ? (openBlock(), createBlock(_component_el_button, {
268
+ key: 1,
277
269
  type: "text",
278
- onClick: ($event) => $options.generate(s.row)
270
+ onClick: ($event) => $options.purge(s.row)
279
271
  }, {
280
- default: withCtx(() => [..._cache[15] || (_cache[15] = [
281
- createTextVNode(" 重新 AI 生成 ", -1)
272
+ default: withCtx(() => [..._cache[11] || (_cache[11] = [
273
+ createTextVNode(" 清理原文件 ", -1)
282
274
  ])]),
283
275
  _: 1
284
276
  }, 8, ["onClick"])) : createCommentVNode("", true),
285
277
  createVNode(_component_el_button, {
286
278
  type: "text",
287
279
  class: "epx-wiki-intake__del",
280
+ disabled: s.row.state === "run",
288
281
  onClick: ($event) => $options.drop(s.row)
289
282
  }, {
290
- default: withCtx(() => [..._cache[16] || (_cache[16] = [
283
+ default: withCtx(() => [..._cache[12] || (_cache[12] = [
291
284
  createTextVNode("删记录", -1)
292
285
  ])]),
293
286
  _: 1
294
- }, 8, ["onClick"])
287
+ }, 8, ["disabled", "onClick"])
295
288
  ]),
296
289
  _: 1
297
290
  })