@skyfox2000/webui 0.1.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.
Files changed (213) hide show
  1. package/.eslintrc.js +23 -0
  2. package/.prettierrc +11 -0
  3. package/.vscode/settings.json +25 -0
  4. package/README.md +104 -0
  5. package/env.d.ts +11 -0
  6. package/index.html +19 -0
  7. package/lib/AceEditor.d.ts +4 -0
  8. package/lib/BasicLayout.d.ts +4 -0
  9. package/lib/Error403.d.ts +4 -0
  10. package/lib/Error404.d.ts +4 -0
  11. package/lib/ExcelForm.d.ts +4 -0
  12. package/lib/UploadForm.d.ts +4 -0
  13. package/lib/assets/modules/basicLayout-YP_-EySb.js +726 -0
  14. package/lib/assets/modules/error403-Bi0E2twj.js +33 -0
  15. package/lib/assets/modules/error404-BF7vasR_.js +33 -0
  16. package/lib/assets/modules/excelForm-Dzndz-SG.js +109 -0
  17. package/lib/assets/modules/excelForm-WJVQmaDT.js +317 -0
  18. package/lib/assets/modules/index-FzWSvscZ.js +107 -0
  19. package/lib/assets/modules/index-ekkaExvB.js +49 -0
  20. package/lib/assets/modules/uploadForm-BahGnrAq.js +415 -0
  21. package/lib/assets/modules/uploadForm-DEnOjhwc.js +308 -0
  22. package/lib/components/common/button/index.vue.d.ts +42 -0
  23. package/lib/components/common/button/index.vue.d.ts.map +1 -0
  24. package/lib/components/common/icon/appicon.vue.d.ts +12 -0
  25. package/lib/components/common/icon/appicon.vue.d.ts.map +1 -0
  26. package/lib/components/common/icon/fullscreen.vue.d.ts +4 -0
  27. package/lib/components/common/icon/fullscreen.vue.d.ts.map +1 -0
  28. package/lib/components/common/icon/helper.vue.d.ts +23 -0
  29. package/lib/components/common/icon/helper.vue.d.ts.map +1 -0
  30. package/lib/components/common/icon/index.vue.d.ts +244 -0
  31. package/lib/components/common/icon/index.vue.d.ts.map +1 -0
  32. package/lib/components/common/icon/layoutIcon.vue.d.ts +44 -0
  33. package/lib/components/common/icon/layoutIcon.vue.d.ts.map +1 -0
  34. package/lib/components/common/icon/projectIcon.vue.d.ts +60 -0
  35. package/lib/components/common/icon/projectIcon.vue.d.ts.map +1 -0
  36. package/lib/components/common/icon/toolIcon.vue.d.ts +44 -0
  37. package/lib/components/common/icon/toolIcon.vue.d.ts.map +1 -0
  38. package/lib/components/common/index.d.ts +19 -0
  39. package/lib/components/common/index.d.ts.map +1 -0
  40. package/lib/components/common/tooltip/index.vue.d.ts +22 -0
  41. package/lib/components/common/tooltip/index.vue.d.ts.map +1 -0
  42. package/lib/components/content/dialog/excelForm.vue.d.ts +31 -0
  43. package/lib/components/content/dialog/excelForm.vue.d.ts.map +1 -0
  44. package/lib/components/content/dialog/index.vue.d.ts +35 -0
  45. package/lib/components/content/dialog/index.vue.d.ts.map +1 -0
  46. package/lib/components/content/dialog/uploadForm.vue.d.ts +25 -0
  47. package/lib/components/content/dialog/uploadForm.vue.d.ts.map +1 -0
  48. package/lib/components/content/drawer/index.vue.d.ts +27 -0
  49. package/lib/components/content/drawer/index.vue.d.ts.map +1 -0
  50. package/lib/components/content/form/formItem.vue.d.ts +26 -0
  51. package/lib/components/content/form/formItem.vue.d.ts.map +1 -0
  52. package/lib/components/content/form/index.vue.d.ts +26 -0
  53. package/lib/components/content/form/index.vue.d.ts.map +1 -0
  54. package/lib/components/content/index.d.ts +27 -0
  55. package/lib/components/content/index.d.ts.map +1 -0
  56. package/lib/components/content/search/index.vue.d.ts +30 -0
  57. package/lib/components/content/search/index.vue.d.ts.map +1 -0
  58. package/lib/components/content/search/searchItem.vue.d.ts +24 -0
  59. package/lib/components/content/search/searchItem.vue.d.ts.map +1 -0
  60. package/lib/components/content/table/index.vue.d.ts +37 -0
  61. package/lib/components/content/table/index.vue.d.ts.map +1 -0
  62. package/lib/components/content/table/tableOperate.vue.d.ts +19 -0
  63. package/lib/components/content/table/tableOperate.vue.d.ts.map +1 -0
  64. package/lib/components/content/toolbar/icontool.vue.d.ts +8 -0
  65. package/lib/components/content/toolbar/icontool.vue.d.ts.map +1 -0
  66. package/lib/components/content/toolbar/index.vue.d.ts +19 -0
  67. package/lib/components/content/toolbar/index.vue.d.ts.map +1 -0
  68. package/lib/components/content/tree/index.vue.d.ts +47 -0
  69. package/lib/components/content/tree/index.vue.d.ts.map +1 -0
  70. package/lib/components/error/error403.vue.d.ts +4 -0
  71. package/lib/components/error/error403.vue.d.ts.map +1 -0
  72. package/lib/components/error/error404.vue.d.ts +4 -0
  73. package/lib/components/error/error404.vue.d.ts.map +1 -0
  74. package/lib/components/form/aceEditor/aceConfig.d.ts +9 -0
  75. package/lib/components/form/aceEditor/aceConfig.d.ts.map +1 -0
  76. package/lib/components/form/aceEditor/index.vue.d.ts +13 -0
  77. package/lib/components/form/aceEditor/index.vue.d.ts.map +1 -0
  78. package/lib/components/form/autoComplete/index.vue.d.ts +140 -0
  79. package/lib/components/form/autoComplete/index.vue.d.ts.map +1 -0
  80. package/lib/components/form/cascader/index.vue.d.ts +110 -0
  81. package/lib/components/form/cascader/index.vue.d.ts.map +1 -0
  82. package/lib/components/form/checkbox/index.vue.d.ts +129 -0
  83. package/lib/components/form/checkbox/index.vue.d.ts.map +1 -0
  84. package/lib/components/form/datePicker/index.vue.d.ts +7 -0
  85. package/lib/components/form/datePicker/index.vue.d.ts.map +1 -0
  86. package/lib/components/form/index.d.ts +41 -0
  87. package/lib/components/form/index.d.ts.map +1 -0
  88. package/lib/components/form/input/index.vue.d.ts +27 -0
  89. package/lib/components/form/input/index.vue.d.ts.map +1 -0
  90. package/lib/components/form/input/inputIcon.vue.d.ts +11 -0
  91. package/lib/components/form/input/inputIcon.vue.d.ts.map +1 -0
  92. package/lib/components/form/input/inputNumber.vue.d.ts +4 -0
  93. package/lib/components/form/input/inputNumber.vue.d.ts.map +1 -0
  94. package/lib/components/form/input/inputPassword.vue.d.ts +4 -0
  95. package/lib/components/form/input/inputPassword.vue.d.ts.map +1 -0
  96. package/lib/components/form/propEditor/index.vue.d.ts +13 -0
  97. package/lib/components/form/propEditor/index.vue.d.ts.map +1 -0
  98. package/lib/components/form/radio/index.vue.d.ts +134 -0
  99. package/lib/components/form/radio/index.vue.d.ts.map +1 -0
  100. package/lib/components/form/radio/radioStatus.vue.d.ts +32 -0
  101. package/lib/components/form/radio/radioStatus.vue.d.ts.map +1 -0
  102. package/lib/components/form/rangePicker/index.vue.d.ts +17 -0
  103. package/lib/components/form/rangePicker/index.vue.d.ts.map +1 -0
  104. package/lib/components/form/select/index.vue.d.ts +143 -0
  105. package/lib/components/form/select/index.vue.d.ts.map +1 -0
  106. package/lib/components/form/switch/index.vue.d.ts +44 -0
  107. package/lib/components/form/switch/index.vue.d.ts.map +1 -0
  108. package/lib/components/form/textarea/index.vue.d.ts +4 -0
  109. package/lib/components/form/textarea/index.vue.d.ts.map +1 -0
  110. package/lib/components/form/transfer/index.vue.d.ts +39 -0
  111. package/lib/components/form/transfer/index.vue.d.ts.map +1 -0
  112. package/lib/components/form/transfer/transferTable.vue.d.ts +39 -0
  113. package/lib/components/form/transfer/transferTable.vue.d.ts.map +1 -0
  114. package/lib/components/form/treeSelect/index.vue.d.ts +39 -0
  115. package/lib/components/form/treeSelect/index.vue.d.ts.map +1 -0
  116. package/lib/components/form/upload/uploadList.vue.d.ts +477 -0
  117. package/lib/components/form/upload/uploadList.vue.d.ts.map +1 -0
  118. package/lib/components/index.d.ts +9 -0
  119. package/lib/components/index.d.ts.map +1 -0
  120. package/lib/components/layout/breadcrumb/index.vue.d.ts +4 -0
  121. package/lib/components/layout/breadcrumb/index.vue.d.ts.map +1 -0
  122. package/lib/components/layout/content/index.vue.d.ts +23 -0
  123. package/lib/components/layout/content/index.vue.d.ts.map +1 -0
  124. package/lib/components/layout/datetime/index.vue.d.ts +4 -0
  125. package/lib/components/layout/datetime/index.vue.d.ts.map +1 -0
  126. package/lib/components/layout/header/headerExits.vue.d.ts +4 -0
  127. package/lib/components/layout/header/headerExits.vue.d.ts.map +1 -0
  128. package/lib/components/layout/header/index.vue.d.ts +4 -0
  129. package/lib/components/layout/header/index.vue.d.ts.map +1 -0
  130. package/lib/components/layout/index.d.ts +17 -0
  131. package/lib/components/layout/index.d.ts.map +1 -0
  132. package/lib/components/layout/menu/index.vue.d.ts +7 -0
  133. package/lib/components/layout/menu/index.vue.d.ts.map +1 -0
  134. package/lib/components/layout/menu/menuTabs.vue.d.ts +4 -0
  135. package/lib/components/layout/menu/menuTabs.vue.d.ts.map +1 -0
  136. package/lib/components/layout/page/basicLayout.vue.d.ts +7 -0
  137. package/lib/components/layout/page/basicLayout.vue.d.ts.map +1 -0
  138. package/lib/es/AceEditor/index.js +168 -0
  139. package/lib/es/BasicLayout/index.js +4 -0
  140. package/lib/es/Error403/index.js +4 -0
  141. package/lib/es/Error404/index.js +4 -0
  142. package/lib/es/ExcelForm/index.js +5 -0
  143. package/lib/es/UploadForm/index.js +5 -0
  144. package/lib/index.d.ts +2 -0
  145. package/lib/webui.css +1 -0
  146. package/lib/webui.es.js +3349 -0
  147. package/package.json +66 -0
  148. package/plugins/vite-plugin-auto-generate-vue.ts +105 -0
  149. package/postcss.config.ts +6 -0
  150. package/src/assets/global.css +9 -0
  151. package/src/components/common/button/index.vue +126 -0
  152. package/src/components/common/icon/appicon.vue +28 -0
  153. package/src/components/common/icon/fullscreen.vue +13 -0
  154. package/src/components/common/icon/helper.vue +30 -0
  155. package/src/components/common/icon/index.vue +426 -0
  156. package/src/components/common/icon/layoutIcon.vue +33 -0
  157. package/src/components/common/icon/projectIcon.vue +41 -0
  158. package/src/components/common/icon/toolIcon.vue +33 -0
  159. package/src/components/common/index.ts +19 -0
  160. package/src/components/common/tooltip/index.vue +25 -0
  161. package/src/components/content/dialog/excelForm.vue +479 -0
  162. package/src/components/content/dialog/index.vue +149 -0
  163. package/src/components/content/dialog/uploadForm.vue +228 -0
  164. package/src/components/content/drawer/index.vue +93 -0
  165. package/src/components/content/form/formItem.vue +76 -0
  166. package/src/components/content/form/index.vue +48 -0
  167. package/src/components/content/index.ts +32 -0
  168. package/src/components/content/search/index.vue +135 -0
  169. package/src/components/content/search/searchItem.vue +52 -0
  170. package/src/components/content/table/index.vue +215 -0
  171. package/src/components/content/table/tableOperate.vue +131 -0
  172. package/src/components/content/toolbar/icontool.vue +151 -0
  173. package/src/components/content/toolbar/index.vue +107 -0
  174. package/src/components/content/tree/index.vue +140 -0
  175. package/src/components/error/error403.vue +14 -0
  176. package/src/components/error/error404.vue +14 -0
  177. package/src/components/form/aceEditor/aceConfig.ts +90 -0
  178. package/src/components/form/aceEditor/index.vue +175 -0
  179. package/src/components/form/autoComplete/index.vue +171 -0
  180. package/src/components/form/cascader/index.vue +110 -0
  181. package/src/components/form/checkbox/index.vue +108 -0
  182. package/src/components/form/datePicker/index.vue +29 -0
  183. package/src/components/form/index.ts +54 -0
  184. package/src/components/form/input/index.vue +70 -0
  185. package/src/components/form/input/inputIcon.vue +39 -0
  186. package/src/components/form/input/inputNumber.vue +23 -0
  187. package/src/components/form/input/inputPassword.vue +22 -0
  188. package/src/components/form/propEditor/index.vue +81 -0
  189. package/src/components/form/radio/index.vue +132 -0
  190. package/src/components/form/radio/radioStatus.vue +42 -0
  191. package/src/components/form/rangePicker/index.vue +64 -0
  192. package/src/components/form/select/index.vue +186 -0
  193. package/src/components/form/switch/index.vue +58 -0
  194. package/src/components/form/textarea/index.vue +23 -0
  195. package/src/components/form/transfer/index.vue +95 -0
  196. package/src/components/form/transfer/transferTable.vue +124 -0
  197. package/src/components/form/treeSelect/index.vue +108 -0
  198. package/src/components/form/upload/uploadList.vue +235 -0
  199. package/src/components/index.ts +97 -0
  200. package/src/components/layout/breadcrumb/index.vue +38 -0
  201. package/src/components/layout/content/index.vue +28 -0
  202. package/src/components/layout/datetime/index.vue +16 -0
  203. package/src/components/layout/header/headerExits.vue +28 -0
  204. package/src/components/layout/header/index.vue +43 -0
  205. package/src/components/layout/index.ts +16 -0
  206. package/src/components/layout/menu/index.vue +64 -0
  207. package/src/components/layout/menu/menuTabs.vue +56 -0
  208. package/src/components/layout/page/basicLayout.vue +67 -0
  209. package/src/vite-env.d.ts +8 -0
  210. package/tailwind.config.ts +11 -0
  211. package/tsconfig.json +53 -0
  212. package/vite.config.ts +117 -0
  213. package//344/273/243/347/240/201/350/247/204/350/214/203/345/217/212/351/243/216/346/240/274/346/214/207/345/215/227.md +116 -0
@@ -0,0 +1,33 @@
1
+ import { defineComponent as n, createBlock as p, openBlock as i, unref as e, withCtx as r, createVNode as _, createTextVNode as a } from "vue";
2
+ import { Result as c, Button as m } from "ant-design-vue";
3
+ import { AppRouter as s } from "@skyfox2000/webbase";
4
+ const x = /* @__PURE__ */ n({
5
+ __name: "error403",
6
+ setup(u) {
7
+ const o = () => {
8
+ s.back();
9
+ };
10
+ return (l, t) => (i(), p(e(c), {
11
+ status: "403",
12
+ title: "403",
13
+ "sub-title": "您没有权限访问当前页面!"
14
+ }, {
15
+ extra: r(() => [
16
+ _(e(m), {
17
+ type: "primary",
18
+ onClick: o
19
+ }, {
20
+ default: r(() => t[0] || (t[0] = [
21
+ a("点击返回")
22
+ ])),
23
+ _: 1,
24
+ __: [0]
25
+ })
26
+ ]),
27
+ _: 1
28
+ }));
29
+ }
30
+ });
31
+ export {
32
+ x as _
33
+ };
@@ -0,0 +1,33 @@
1
+ import { defineComponent as n, createBlock as p, openBlock as i, unref as e, withCtx as r, createVNode as _, createTextVNode as a } from "vue";
2
+ import { Result as c, Button as m } from "ant-design-vue";
3
+ import { AppRouter as s } from "@skyfox2000/webbase";
4
+ const x = /* @__PURE__ */ n({
5
+ __name: "error404",
6
+ setup(u) {
7
+ const o = () => {
8
+ s.back();
9
+ };
10
+ return (l, t) => (i(), p(e(c), {
11
+ status: "404",
12
+ title: "404",
13
+ "sub-title": "页面不存在或者没有权限访问页面!"
14
+ }, {
15
+ extra: r(() => [
16
+ _(e(m), {
17
+ type: "primary",
18
+ onClick: o
19
+ }, {
20
+ default: r(() => t[0] || (t[0] = [
21
+ a("点击返回")
22
+ ])),
23
+ _: 1,
24
+ __: [0]
25
+ })
26
+ ]),
27
+ _: 1
28
+ }));
29
+ }
30
+ });
31
+ export {
32
+ x as _
33
+ };
@@ -0,0 +1,109 @@
1
+ import { defineComponent as d, useAttrs as f, createElementBlock as u, openBlock as x, createVNode as e, withCtx as n, unref as o, mergeProps as r, renderSlot as p } from "vue";
2
+ import { Button as _ } from "ant-design-vue";
3
+ import { a as P, _ as k } from "./index-ekkaExvB.js";
4
+ const C = /* @__PURE__ */ d({
5
+ inheritAttrs: !1,
6
+ __name: "index",
7
+ props: {
8
+ /**
9
+ * 提示标题
10
+ * @props
11
+ * @name content
12
+ * @type {string}
13
+ */
14
+ tiptext: String,
15
+ /**
16
+ * 提示显示位置
17
+ * @props
18
+ * @name placement
19
+ * @type {string}
20
+ * @default 'top'
21
+ */
22
+ placement: {
23
+ type: String,
24
+ default: "top"
25
+ },
26
+ /**
27
+ * 内置图标属性设置
28
+ * @props
29
+ * @name iconProps
30
+ * @type {object}
31
+ * @summary 内置图标复杂属性设置,仅支持前置图标
32
+ */
33
+ iconProps: Object,
34
+ /**
35
+ * 默认使用框架图标
36
+ * 其它图标请自定义
37
+ * @props
38
+ * @name icon
39
+ * @type {string}
40
+ */
41
+ icon: String
42
+ // /**
43
+ // * 点击事件
44
+ // * @props
45
+ // * @name clickEvent
46
+ // * @summary 格式 "空间名#事件名",空间名和事件名用#分隔,事件名用.分隔
47
+ // * @type {string}
48
+ // */
49
+ // clickEvent: {
50
+ // type: String
51
+ // },
52
+ // /**
53
+ // * 点击传输数据
54
+ // * @props
55
+ // * @name data
56
+ // * @summary 点击事件传输的默认数据
57
+ // * @type {object|string}
58
+ // */
59
+ // data: {
60
+ // type: [Object, String]
61
+ // }
62
+ },
63
+ emits: [
64
+ /**
65
+ * 点击事件
66
+ * @emits
67
+ * @name click
68
+ * @summary 图标按钮点击时触发的事件
69
+ */
70
+ "click"
71
+ ],
72
+ setup(i, { emit: l }) {
73
+ const c = f(), t = i, a = l, m = () => {
74
+ t.iconProps && t.iconProps.icons && (t.iconProps.iconIndex = (t.iconProps.iconIndex + 1) % t.iconProps.icons.length), a("click");
75
+ };
76
+ return (s, b) => (x(), u("div", null, [
77
+ e(P, {
78
+ title: t.tiptext,
79
+ disabled: t.tiptext ? void 0 : "disabled",
80
+ placement: i.placement
81
+ }, {
82
+ default: n(() => [
83
+ e(o(_), r({ class: "px-[10px] py-[4px] flex items-center gap-1" }, o(c), { onClick: m }), {
84
+ icon: n(() => [
85
+ p(s.$slots, "icon", {}, () => [
86
+ e(k, r({
87
+ icon: t.icon,
88
+ class: [
89
+ o(c).type === "primary" ? "ant-btn-primary" : "",
90
+ "cursor-pointer w-[17px] h-[17px] mx-auto"
91
+ ],
92
+ clickable: ""
93
+ }, t.iconProps), null, 16, ["icon", "class"])
94
+ ])
95
+ ]),
96
+ default: n(() => [
97
+ p(s.$slots, "default")
98
+ ]),
99
+ _: 3
100
+ }, 16)
101
+ ]),
102
+ _: 3
103
+ }, 8, ["title", "disabled", "placement"])
104
+ ]));
105
+ }
106
+ });
107
+ export {
108
+ C as _
109
+ };
@@ -0,0 +1,317 @@
1
+ import { defineComponent as Y, ref as r, watch as A, onMounted as Z, createBlock as ee, openBlock as d, unref as i, withCtx as _, renderSlot as le, createElementVNode as c, createVNode as m, createElementBlock as f, createCommentVNode as M, createTextVNode as O, toDisplayString as F, normalizeClass as ae, Fragment as P, renderList as $ } from "vue";
2
+ import { _ as K } from "./excelForm-Dzndz-SG.js";
3
+ import { Modal as te, Upload as I, Alert as G, Space as re } from "ant-design-vue";
4
+ import { ResStatus as oe } from "@skyfox2000/fapi";
5
+ import { getRuleTexts as se, AsyncUploader as ie, path as ue, UploadStatus as ne, processExcelFile as ce, doSave as ve, validateExcel as de, checkExcelDuplicates as fe } from "@skyfox2000/webbase";
6
+ import "./index-ekkaExvB.js";
7
+ import n from "vue-m-message";
8
+ import pe from "@vue-office/excel";
9
+ const me = { class: "mb-4 flex items-center" }, xe = {
10
+ key: 0,
11
+ class: "ml-3 text-gray-600"
12
+ }, ge = { class: "flex gap-4" }, ye = {
13
+ key: 0,
14
+ class: "w-[22%] flex-grow overflow-hidden flex flex-col"
15
+ }, he = { class: "bg-gray-50 p-2 rounded border flex-grow flex flex-col" }, _e = {
16
+ key: 0,
17
+ class: "text-gray-500"
18
+ }, be = {
19
+ key: 1,
20
+ class: "flex flex-col"
21
+ }, we = { class: "overflow-y-auto" }, Ce = { class: "text-[13px] text-gray-600" }, Fe = { class: "pl-5 mt-1 mb-0" }, Ee = {
22
+ key: 0,
23
+ class: "mt-3"
24
+ }, Ue = { class: "text-[12px] text-gray-600 p-1" }, Se = { class: "text-[13px] text-gray-600" }, ke = { class: "pl-5 mt-1 mb-0" }, De = { class: "text-[12px] text-gray-600" }, Oe = /* @__PURE__ */ Y({
25
+ __name: "excelForm",
26
+ props: {
27
+ title: {},
28
+ gridCtrl: {},
29
+ excelCtrl: {},
30
+ uploadParams: {},
31
+ excelFieldMap: {},
32
+ fileField: {},
33
+ excelBatchField: {},
34
+ saveText: {}
35
+ },
36
+ setup(Q) {
37
+ const o = Q, e = o.excelCtrl, b = r(!1), w = r(""), q = r([]), x = r(""), E = r(!0), U = r("待验证数据规则"), S = r("warning"), k = r("待验证重复数据"), D = r("warning");
38
+ A(
39
+ () => e.visible.value,
40
+ () => {
41
+ b.value = e.visible.value;
42
+ }
43
+ ), A(
44
+ () => b.value,
45
+ () => {
46
+ e.visible.value = b.value;
47
+ }
48
+ );
49
+ const R = r(o.uploadParams), p = r(R.value.uploadUrl), g = r(R.value.duplicateRules), C = r(R.value.duplicateUrl), H = async () => {
50
+ const l = p.value;
51
+ if (!l) {
52
+ n.error("未配置文件上传地址!");
53
+ return;
54
+ }
55
+ if (B.value) {
56
+ n.error("表格数据存在验证错误,请修正后再上传!");
57
+ return;
58
+ }
59
+ e.isFormLoading.value = !0;
60
+ try {
61
+ if (!z.value || !x.value) {
62
+ n.warning("请先选择Excel文件!"), e.isFormLoading.value = !1;
63
+ return;
64
+ }
65
+ const a = new ie(l, 1), s = new File([z.value], x.value, {
66
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
67
+ }), t = ue.join(R.value.basePath, x.value), v = {
68
+ uid: "1",
69
+ name: x.value,
70
+ originFileObj: s,
71
+ status: ne.Uploading,
72
+ percent: 0,
73
+ params: {
74
+ FileKey: t
75
+ }
76
+ }, y = new AbortController();
77
+ try {
78
+ await a.uploadFile(v, y.signal, (u) => {
79
+ v.percent = u;
80
+ }), n.success("文件上传成功,开始业务处理!"), J(v);
81
+ } catch (u) {
82
+ throw console.error("文件上传错误:", u), n.error((u == null ? void 0 : u.message) || "文件上传失败,请稍后再试!"), u;
83
+ }
84
+ } catch (a) {
85
+ console.error("上传处理错误:", a), n.error("上传处理失败:" + ((a == null ? void 0 : a.message) || "未知错误"));
86
+ } finally {
87
+ e.isFormLoading.value = !1;
88
+ }
89
+ }, J = async (l) => {
90
+ if (e.formData.value) {
91
+ if (o.excelBatchField) {
92
+ const t = await ce(z.value);
93
+ if (!t) return null;
94
+ const { excelData: v } = t, y = v.map((u) => {
95
+ const h = {};
96
+ for (const L in u) {
97
+ const j = o.excelFieldMap[L];
98
+ j && (h[j] = u[L]);
99
+ }
100
+ return h;
101
+ });
102
+ e.formData.value[o.excelBatchField] = y;
103
+ }
104
+ const a = o.fileField ?? "FileInfo";
105
+ e.formData.value[a] = l, e.beforeSave && e.beforeSave();
106
+ const s = {
107
+ Data: {
108
+ ...e.formData.value
109
+ },
110
+ Query: {
111
+ [o.excelCtrl.primaryKey]: e.formData.value[o.excelCtrl.primaryKey]
112
+ }
113
+ };
114
+ e.isFormLoading.value = !0;
115
+ try {
116
+ const t = await ve(o.excelCtrl, {
117
+ params: s,
118
+ urlKey: "save",
119
+ url: o.excelCtrl.saveUrl
120
+ });
121
+ (t == null ? void 0 : t.status) === oe.SUCCESS ? (n.success("数据保存成功!"), e.afterSave && e.afterSave(), e.visible.value = !1) : n.error("保存失败:" + ((t == null ? void 0 : t.msg) || "未知错误"));
122
+ } catch (t) {
123
+ console.error("保存错误:", t), n.error("数据保存失败,请稍后再试!");
124
+ } finally {
125
+ e.isFormLoading.value = !1;
126
+ }
127
+ }
128
+ }, B = r(!1), N = r(!1), z = r(null), W = async (l) => {
129
+ if (!(l.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || l.type === "application/vnd.ms-excel"))
130
+ return n.error("只能上传Excel文件!"), I.LIST_IGNORE;
131
+ try {
132
+ x.value = l.name, B.value = !1, N.value = !1, E.value = !0, U.value = "待验证数据规则", S.value = "warning", k.value = "待验证重复数据", D.value = "warning";
133
+ const s = await l.arrayBuffer();
134
+ z.value = s;
135
+ const t = new FileReader();
136
+ t.readAsDataURL(l), t.onload = async (v) => {
137
+ if (v.target) {
138
+ const { hasError: y, errBlob: u } = await de(s, e.formRules.value);
139
+ if (y) {
140
+ if (u) {
141
+ B.value = !0, E.value = !1, U.value = "数据验证失败", S.value = "error";
142
+ const h = URL.createObjectURL(u);
143
+ w.value = h;
144
+ }
145
+ return;
146
+ } else
147
+ U.value = "数据验证成功", S.value = "success";
148
+ if (g.value && g.value.length > 0 && C.value)
149
+ try {
150
+ C.value.api || (C.value.api = o.gridCtrl.page.api), C.value.authorize === void 0 && (C.value.authorize = o.gridCtrl.page.authorize);
151
+ const { hasError: h, errBlob: L } = await fe(
152
+ s,
153
+ g.value,
154
+ C.value
155
+ );
156
+ if (h) {
157
+ if (L) {
158
+ N.value = !0, k.value = "检测到重复数据", D.value = "error";
159
+ const j = URL.createObjectURL(L);
160
+ w.value = j;
161
+ }
162
+ return;
163
+ } else
164
+ N.value = !1, k.value = "数据验证通过", D.value = "success";
165
+ } catch {
166
+ k.value = "重复检测异常", D.value = "error";
167
+ }
168
+ w.value = v.target.result, E.value = !1;
169
+ } else
170
+ n.error("加载Excel文件失败,请检查文件格式!");
171
+ };
172
+ } catch (s) {
173
+ console.error("Excel处理错误:", s), n.error("Excel文件处理失败,请检查文件格式!"), E.value = !1, U.value = "Excel处理错误", S.value = "error";
174
+ }
175
+ return !1;
176
+ }, T = se(e.formRules.value);
177
+ Z(() => {
178
+ const l = o.gridCtrl.page;
179
+ if (p.value = p.value ?? l.urls.upload, !p.value) {
180
+ n.error("未配置文件上传地址!");
181
+ return;
182
+ }
183
+ p.value.api || (p.value.api = l.api), p.value.authorize === void 0 && (p.value.authorize = l.authorize);
184
+ for (const a in e.formData.value)
185
+ o.gridCtrl.rowData.value && (e.formData.value[a] = o.gridCtrl.rowData.value[a]);
186
+ b.value = e.visible.value;
187
+ });
188
+ const V = () => {
189
+ e.visible.value = !1;
190
+ }, X = () => {
191
+ console.error("渲染失败");
192
+ };
193
+ return (l, a) => (d(), ee(i(te), {
194
+ title: l.title ?? "Excel文件上传",
195
+ open: b.value,
196
+ "onUpdate:open": a[0] || (a[0] = (s) => b.value = s),
197
+ wrapClassName: ["modal", "mx-auto", l.$attrs.width ? "w-[" + l.$attrs.width + "]" : ""].join(" "),
198
+ width: 940,
199
+ onClose: V
200
+ }, {
201
+ footer: _(() => [
202
+ m(i(re), null, {
203
+ default: _(() => [
204
+ m(i(K), { onClick: V }, {
205
+ default: _(() => a[2] || (a[2] = [
206
+ O("取消")
207
+ ])),
208
+ _: 1,
209
+ __: [2]
210
+ }),
211
+ m(i(K), {
212
+ onClick: H,
213
+ type: "primary",
214
+ loading: i(e).isFormSaving.value,
215
+ disabled: !w.value || B.value || N.value || E.value
216
+ }, {
217
+ default: _(() => [
218
+ O(F(l.saveText ?? "上传文件"), 1)
219
+ ]),
220
+ _: 1
221
+ }, 8, ["loading", "disabled"])
222
+ ]),
223
+ _: 1
224
+ })
225
+ ]),
226
+ default: _(() => [
227
+ le(l.$slots, "default"),
228
+ c("div", me, [
229
+ m(i(I), {
230
+ "file-list": q.value,
231
+ "before-upload": W,
232
+ accept: ".xlsx,.xls",
233
+ showUploadList: !0
234
+ }, {
235
+ default: _(() => [
236
+ m(i(K), { type: "primary" }, {
237
+ default: _(() => a[1] || (a[1] = [
238
+ O("选择Excel文件")
239
+ ])),
240
+ _: 1,
241
+ __: [1]
242
+ })
243
+ ]),
244
+ _: 1
245
+ }, 8, ["file-list"]),
246
+ w.value && x.value ? (d(), f("div", xe, [
247
+ c("span", null, F(x.value), 1)
248
+ ])) : M("", !0)
249
+ ]),
250
+ c("div", ge, [
251
+ c("div", {
252
+ class: ae(["flex-shrink-0 excel-container", [i(T).length === 0 ? "w-[100%]" : "w-[80%]"]]),
253
+ style: { height: "430px" }
254
+ }, [
255
+ m(i(pe), {
256
+ src: w.value,
257
+ onError: X,
258
+ style: { width: "100%", height: "100%" },
259
+ options: {
260
+ styles: !0,
261
+ formatCells: !0,
262
+ skipStyles: !1,
263
+ autoStyle: !0,
264
+ keepOriginalFormat: !0,
265
+ renderingStyle: "svg"
266
+ }
267
+ }, null, 8, ["src"])
268
+ ], 2),
269
+ i(T).length > 0 ? (d(), f("div", ye, [
270
+ c("div", he, [
271
+ i(T).length === 0 ? (d(), f("div", _e, "没有设置验证规则")) : (d(), f("div", be, [
272
+ m(i(G), {
273
+ message: U.value,
274
+ type: S.value,
275
+ "show-icon": "",
276
+ class: "mb-2"
277
+ }, null, 8, ["message", "type"]),
278
+ c("div", we, [
279
+ (d(!0), f(P, null, $(i(T), (s, t) => (d(), f("div", {
280
+ key: t,
281
+ class: "border-b pb-0"
282
+ }, [
283
+ c("div", Ce, F(s.field), 1),
284
+ c("ul", Fe, [
285
+ (d(!0), f(P, null, $(s.rules, (v, y) => (d(), f("li", {
286
+ key: y,
287
+ class: "text-[12px] text-gray-600"
288
+ }, F(v), 1))), 128))
289
+ ])
290
+ ]))), 128))
291
+ ]),
292
+ g.value && g.value.length > 0 ? (d(), f("div", Ee, [
293
+ m(i(G), {
294
+ message: k.value,
295
+ type: D.value,
296
+ "show-icon": "",
297
+ class: "mt-2 mb-2"
298
+ }, null, 8, ["message", "type"]),
299
+ c("div", Ue, [
300
+ c("div", Se, " 以下" + F(g.value.length > 1 ? "组合" : "字段") + "必须唯一 ", 1),
301
+ c("ul", ke, [
302
+ c("li", De, F(g.value.join(", ")), 1)
303
+ ])
304
+ ])
305
+ ])) : M("", !0)
306
+ ]))
307
+ ])
308
+ ])) : M("", !0)
309
+ ])
310
+ ]),
311
+ _: 3
312
+ }, 8, ["title", "open", "wrapClassName"]));
313
+ }
314
+ });
315
+ export {
316
+ Oe as _
317
+ };
@@ -0,0 +1,107 @@
1
+ import { defineComponent as A, provide as B, ref as S, watch as p, onMounted as F, createBlock as i, openBlock as r, unref as a, withCtx as t, createElementVNode as N, renderSlot as V, createVNode as b, createCommentVNode as d, createTextVNode as u, toDisplayString as f } from "vue";
2
+ import { _ as v } from "./excelForm-Dzndz-SG.js";
3
+ import { Modal as E, Space as M } from "ant-design-vue";
4
+ import "@skyfox2000/fapi";
5
+ import { ProviderKeys as $, onFormClose as D, onFormSave as K, onFormSaveAs as P } from "@skyfox2000/webbase";
6
+ import "./index-ekkaExvB.js";
7
+ const U = { class: "overflow-y-auto w-full h-full" }, J = /* @__PURE__ */ A({
8
+ __name: "index",
9
+ props: {
10
+ saveText: {},
11
+ saveAsText: {},
12
+ cancelText: {},
13
+ editorCtrl: {},
14
+ dialogSave: { type: Function },
15
+ width: {},
16
+ full: { type: Boolean },
17
+ open: { type: Boolean }
18
+ },
19
+ emits: ["update:open"],
20
+ setup(C, { emit: T }) {
21
+ const n = C, e = n.editorCtrl;
22
+ B($.EditorControl, e);
23
+ const l = S(n.open ?? !1), h = T, k = S(n.width ?? 430);
24
+ p(
25
+ () => e == null ? void 0 : e.visible.value,
26
+ (o) => {
27
+ l.value = o ?? !1;
28
+ }
29
+ ), p(
30
+ () => n.open,
31
+ (o) => {
32
+ l.value = o;
33
+ }
34
+ ), p(
35
+ () => l.value,
36
+ (o) => {
37
+ h("update:open", o), o || m();
38
+ }
39
+ ), F(() => {
40
+ l.value = (e == null ? void 0 : e.visible.value) ?? !1;
41
+ });
42
+ const x = () => {
43
+ n.dialogSave || e && K(e);
44
+ }, _ = () => {
45
+ e && P(e);
46
+ }, m = () => {
47
+ e ? D(e) : l.value = !1;
48
+ };
49
+ return (o, c) => (r(), i(a(E), {
50
+ open: l.value,
51
+ "onUpdate:open": c[0] || (c[0] = (s) => l.value = s),
52
+ wrapClassName: "modal mx-auto min-w-[430px] " + (o.full ? "full-modal w-full" : ""),
53
+ width: k.value
54
+ }, {
55
+ footer: t(() => [
56
+ b(a(M), null, {
57
+ default: t(() => {
58
+ var s, y, g, w;
59
+ return [
60
+ o.cancelText !== "" ? (r(), i(a(v), {
61
+ key: 0,
62
+ onClick: m
63
+ }, {
64
+ default: t(() => [
65
+ u(f(o.cancelText ?? "取消"), 1)
66
+ ]),
67
+ _: 1
68
+ })) : d("", !0),
69
+ o.saveAsText !== "" && ((s = a(e)) == null ? void 0 : s.saveAsBtnVisible) !== !1 ? (r(), i(a(v), {
70
+ key: 1,
71
+ onClick: _,
72
+ type: "primary",
73
+ loading: (y = a(e)) == null ? void 0 : y.isFormSaving.value
74
+ }, {
75
+ default: t(() => [
76
+ u(f(o.saveAsText ?? "另存为"), 1)
77
+ ]),
78
+ _: 1
79
+ }, 8, ["loading"])) : d("", !0),
80
+ o.saveText !== "" && ((g = a(e)) == null ? void 0 : g.saveBtnVisible) !== !1 ? (r(), i(a(v), {
81
+ key: 2,
82
+ onClick: x,
83
+ type: "primary",
84
+ loading: (w = a(e)) == null ? void 0 : w.isFormSaving.value
85
+ }, {
86
+ default: t(() => [
87
+ u(f(o.saveText ?? "保存"), 1)
88
+ ]),
89
+ _: 1
90
+ }, 8, ["loading"])) : d("", !0)
91
+ ];
92
+ }),
93
+ _: 1
94
+ })
95
+ ]),
96
+ default: t(() => [
97
+ N("div", U, [
98
+ V(o.$slots, "default")
99
+ ])
100
+ ]),
101
+ _: 3
102
+ }, 8, ["open", "wrapClassName", "width"]));
103
+ }
104
+ });
105
+ export {
106
+ J as _
107
+ };
@@ -0,0 +1,49 @@
1
+ import { defineComponent as r, createBlock as i, openBlock as s, unref as l, withCtx as m, renderSlot as p, createCommentVNode as f, mergeProps as u } from "vue";
2
+ import { Tooltip as d } from "ant-design-vue";
3
+ import { SERVER_HOST as x } from "@skyfox2000/fapi";
4
+ import { createFromIconfont as y } from "@skyfox2000/webbase";
5
+ const _ = /* @__PURE__ */ r({
6
+ __name: "index",
7
+ props: {
8
+ size: {}
9
+ },
10
+ setup(o) {
11
+ const e = o, t = {}, n = {};
12
+ return e.size === "small" && (n.fontSize = "12px", n.padding = "4px 6px", n.minHeight = "26px", t.height = "30px"), (c, a) => (s(), i(l(d), {
13
+ overlayInnerStyle: n,
14
+ overlayStyle: t
15
+ }, {
16
+ default: m(() => [
17
+ p(c.$slots, "default")
18
+ ]),
19
+ _: 3
20
+ }));
21
+ }
22
+ }), g = /* @__PURE__ */ r({
23
+ __name: "toolIcon",
24
+ props: {
25
+ icon: {
26
+ type: String
27
+ },
28
+ icons: {
29
+ type: Array
30
+ }
31
+ },
32
+ setup(o) {
33
+ const e = o, n = y({
34
+ iconUrl: `${x.TOOL_ICONS}`,
35
+ monoColor: !0,
36
+ icon: e.icon,
37
+ icons: e.icons
38
+ });
39
+ return (c, a) => o.icon || o.icons ? (s(), i(l(n), u({
40
+ key: 0,
41
+ icon: o.icon,
42
+ icons: o.icons
43
+ }, c.$attrs), null, 16, ["icon", "icons"])) : f("", !0);
44
+ }
45
+ });
46
+ export {
47
+ g as _,
48
+ _ as a
49
+ };