@skyfox2000/webui 1.2.8 → 1.2.10

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 (148) hide show
  1. package/package.json +1 -1
  2. package/scripts/userInput.py +2 -0
  3. package/src/components/common/index.ts +3 -0
  4. package/src/components/common/loading/index.vue +11 -0
  5. package/src/components/content/dialog/index.vue +15 -8
  6. package/src/components/content/dialog/uploadForm.vue +38 -79
  7. package/src/components/content/drawer/index.vue +26 -6
  8. package/src/components/content/form/formItem.vue +21 -5
  9. package/src/components/content/form/index.vue +4 -2
  10. package/src/components/content/search/searchItem.vue +1 -1
  11. package/src/components/form/autoComplete/index.vue +12 -4
  12. package/src/components/form/cascader/index.vue +1 -1
  13. package/src/components/form/datePicker/index.vue +1 -1
  14. package/src/components/form/index.ts +1 -0
  15. package/src/components/form/input/inputIcon.vue +1 -1
  16. package/src/components/form/propEditor/index.vue +113 -33
  17. package/src/components/form/select/index.vue +27 -17
  18. package/src/components/form/upload/uploadList.vue +174 -34
  19. package/src/components/index.ts +13 -1
  20. package/src/directives/permission.ts +2 -2
  21. package/src/index.ts +3 -1
  22. package/src/stores/userInfo.ts +28 -2
  23. package/src/typings/form.d.ts +18 -2
  24. package/src/typings/option.d.ts +16 -2
  25. package/src/typings/page.d.ts +1 -0
  26. package/src/utils/download.ts +1 -1
  27. package/src/utils/eventbus.ts +1 -1
  28. package/src/utils/file-upload.ts +75 -14
  29. package/src/utils/form-excel.ts +50 -1
  30. package/src/utils/form-validate.ts +18 -1
  31. package/src/utils/form.ts +3 -1
  32. package/src/utils/options.ts +38 -12
  33. package/lib/AceEditor.d.ts +0 -1
  34. package/lib/BasicLayout.d.ts +0 -1
  35. package/lib/Error403.d.ts +0 -1
  36. package/lib/Error404.d.ts +0 -1
  37. package/lib/ExcelForm.d.ts +0 -1
  38. package/lib/UploadForm.d.ts +0 -1
  39. package/lib/assets/modules/file-upload-CZO-pMJd.js +0 -176
  40. package/lib/assets/modules/form-excel-N-2OYqKv.js +0 -211
  41. package/lib/assets/modules/index-BnHnS9ug.js +0 -111
  42. package/lib/assets/modules/index-CTVMLeDF.js +0 -109
  43. package/lib/assets/modules/index-D9kzQ23e.js +0 -2213
  44. package/lib/assets/modules/menuTabs-BtOiocOC.js +0 -676
  45. package/lib/assets/modules/toolIcon-B9Mw9Ktm.js +0 -50
  46. package/lib/assets/modules/uploadList-B4LxzsC6.js +0 -210
  47. package/lib/components/common/button/index.vue.d.ts +0 -41
  48. package/lib/components/common/icon/appicon.vue.d.ts +0 -11
  49. package/lib/components/common/icon/fullscreen.vue.d.ts +0 -3
  50. package/lib/components/common/icon/helper.vue.d.ts +0 -22
  51. package/lib/components/common/icon/index.vue.d.ts +0 -243
  52. package/lib/components/common/icon/layoutIcon.vue.d.ts +0 -43
  53. package/lib/components/common/icon/projectIcon.vue.d.ts +0 -59
  54. package/lib/components/common/icon/toolIcon.vue.d.ts +0 -43
  55. package/lib/components/common/index.d.ts +0 -18
  56. package/lib/components/common/tooltip/index.vue.d.ts +0 -21
  57. package/lib/components/content/dialog/index.vue.d.ts +0 -34
  58. package/lib/components/content/drawer/index.vue.d.ts +0 -26
  59. package/lib/components/content/form/formItem.vue.d.ts +0 -25
  60. package/lib/components/content/form/index.vue.d.ts +0 -25
  61. package/lib/components/content/index.d.ts +0 -22
  62. package/lib/components/content/search/index.vue.d.ts +0 -30
  63. package/lib/components/content/search/searchItem.vue.d.ts +0 -23
  64. package/lib/components/content/table/index.vue.d.ts +0 -36
  65. package/lib/components/content/table/tableOperate.vue.d.ts +0 -18
  66. package/lib/components/content/toolbar/icontool.vue.d.ts +0 -7
  67. package/lib/components/content/toolbar/index.vue.d.ts +0 -18
  68. package/lib/components/content/tree/index.vue.d.ts +0 -46
  69. package/lib/components/form/aceEditor/aceConfig.d.ts +0 -8
  70. package/lib/components/form/autoComplete/index.vue.d.ts +0 -139
  71. package/lib/components/form/cascader/index.vue.d.ts +0 -109
  72. package/lib/components/form/checkbox/index.vue.d.ts +0 -128
  73. package/lib/components/form/datePicker/index.vue.d.ts +0 -6
  74. package/lib/components/form/index.d.ts +0 -38
  75. package/lib/components/form/input/index.vue.d.ts +0 -26
  76. package/lib/components/form/input/inputIcon.vue.d.ts +0 -10
  77. package/lib/components/form/input/inputNumber.vue.d.ts +0 -3
  78. package/lib/components/form/input/inputPassword.vue.d.ts +0 -3
  79. package/lib/components/form/propEditor/index.vue.d.ts +0 -12
  80. package/lib/components/form/radio/index.vue.d.ts +0 -133
  81. package/lib/components/form/radio/radioStatus.vue.d.ts +0 -31
  82. package/lib/components/form/rangePicker/index.vue.d.ts +0 -16
  83. package/lib/components/form/select/index.vue.d.ts +0 -142
  84. package/lib/components/form/switch/index.vue.d.ts +0 -43
  85. package/lib/components/form/textarea/index.vue.d.ts +0 -3
  86. package/lib/components/form/transfer/index.vue.d.ts +0 -38
  87. package/lib/components/form/transfer/transferTable.vue.d.ts +0 -38
  88. package/lib/components/form/treeSelect/index.vue.d.ts +0 -38
  89. package/lib/components/form/upload/uploadList.vue.d.ts +0 -476
  90. package/lib/components/index.d.ts +0 -4
  91. package/lib/components/layout/breadcrumb/index.vue.d.ts +0 -3
  92. package/lib/components/layout/content/index.vue.d.ts +0 -22
  93. package/lib/components/layout/datetime/index.vue.d.ts +0 -3
  94. package/lib/components/layout/header/headerExits.vue.d.ts +0 -3
  95. package/lib/components/layout/header/index.vue.d.ts +0 -3
  96. package/lib/components/layout/header/user.vue.d.ts +0 -3
  97. package/lib/components/layout/index.d.ts +0 -14
  98. package/lib/components/layout/menu/index.vue.d.ts +0 -6
  99. package/lib/components/layout/menu/menuTabs.vue.d.ts +0 -3
  100. package/lib/const/options.d.ts +0 -32
  101. package/lib/directives/enter-submit.d.ts +0 -4
  102. package/lib/directives/index.d.ts +0 -2
  103. package/lib/directives/permission.d.ts +0 -5
  104. package/lib/es/AceEditor/index.js +0 -167
  105. package/lib/es/BasicLayout/index.js +0 -101
  106. package/lib/es/Error403/index.js +0 -39
  107. package/lib/es/Error404/index.js +0 -39
  108. package/lib/es/ExcelForm/index.js +0 -321
  109. package/lib/es/UploadForm/index.js +0 -137
  110. package/lib/index.d.ts +0 -45
  111. package/lib/router/index.d.ts +0 -15
  112. package/lib/stores/appInfo.d.ts +0 -31
  113. package/lib/stores/hostInfo.d.ts +0 -9
  114. package/lib/stores/pageInfo.d.ts +0 -18
  115. package/lib/stores/pinia.d.ts +0 -3
  116. package/lib/stores/settingInfo.d.ts +0 -8
  117. package/lib/stores/userInfo.d.ts +0 -24
  118. package/lib/typings/data.d.ts +0 -80
  119. package/lib/typings/form.d.ts +0 -171
  120. package/lib/typings/menu.d.ts +0 -7
  121. package/lib/typings/option.d.ts +0 -175
  122. package/lib/typings/page.d.ts +0 -69
  123. package/lib/typings/table.d.ts +0 -181
  124. package/lib/typings/tools.d.ts +0 -130
  125. package/lib/typings/tree.d.ts +0 -72
  126. package/lib/typings/upload.d.ts +0 -161
  127. package/lib/typings/urls.d.ts +0 -69
  128. package/lib/utils/cache.d.ts +0 -23
  129. package/lib/utils/data.d.ts +0 -6
  130. package/lib/utils/download.d.ts +0 -4
  131. package/lib/utils/eventbus.d.ts +0 -16
  132. package/lib/utils/export-table.d.ts +0 -12
  133. package/lib/utils/file-upload.d.ts +0 -15
  134. package/lib/utils/form-excel.d.ts +0 -30
  135. package/lib/utils/form-validate.d.ts +0 -29
  136. package/lib/utils/form.d.ts +0 -9
  137. package/lib/utils/icon-loader.d.ts +0 -125
  138. package/lib/utils/isEmpty.d.ts +0 -1
  139. package/lib/utils/main-openapis.d.ts +0 -8
  140. package/lib/utils/menu.d.ts +0 -6
  141. package/lib/utils/options.d.ts +0 -10
  142. package/lib/utils/page.d.ts +0 -25
  143. package/lib/utils/table.d.ts +0 -21
  144. package/lib/utils/tools.d.ts +0 -18
  145. package/lib/utils/tree.d.ts +0 -3
  146. package/lib/vite-env.d.ts +0 -8
  147. package/lib/webui.css +0 -1
  148. package/lib/webui.es.js +0 -2240
@@ -1,137 +0,0 @@
1
- import { defineComponent as S, ref as m, watch as k, onMounted as z, createBlock as D, openBlock as E, unref as s, withCtx as f, createVNode as v, createTextVNode as g } from "vue";
2
- import { _ as x } from "../../assets/modules/index-CTVMLeDF.js";
3
- import { Modal as L, Space as N } from "ant-design-vue";
4
- import { ResStatus as $ } from "@skyfox2000/fapi";
5
- import { a1 as B } from "../../assets/modules/index-D9kzQ23e.js";
6
- import { A as R, U as A } from "../../assets/modules/file-upload-CZO-pMJd.js";
7
- import "@skyfox2000/microbase";
8
- import t from "vue-m-message";
9
- import "async-validator";
10
- import "dayjs";
11
- import "vue-draggable-next";
12
- import { _ as M } from "../../assets/modules/uploadList-B4LxzsC6.js";
13
- const W = /* @__PURE__ */ S({
14
- __name: "uploadForm",
15
- props: {
16
- mode: {},
17
- fileExt: {},
18
- gridCtrl: {},
19
- maxCount: {},
20
- maxConcurrent: {},
21
- uploadForm: {},
22
- uploadUrl: {},
23
- downloadUrl: {},
24
- continueOnError: { type: Boolean }
25
- },
26
- emits: ["before:file-list", "before:upload", "after:upload"],
27
- setup(U, { emit: _ }) {
28
- const l = U, e = l.uploadForm, p = m(!1), b = l.maxCount ?? 1, F = l.maxConcurrent ?? 3, n = m([]), d = _;
29
- k(
30
- () => e.visible.value,
31
- () => {
32
- p.value = e.visible.value;
33
- }
34
- );
35
- const i = m(l.uploadUrl), u = m(l.downloadUrl), h = async () => {
36
- const o = i.value;
37
- if (!o) {
38
- t.error("未配置文件上传地址!");
39
- return;
40
- }
41
- d("before:upload", n.value);
42
- const r = new R(o, F);
43
- e.isFormLoading.value = !0;
44
- try {
45
- if (n.value.length === 0) {
46
- t.warning("请选择上传的文件!");
47
- return;
48
- }
49
- await r.uploadFiles(
50
- n.value,
51
- (a) => {
52
- },
53
- (a) => {
54
- e.isFormLoading.value = !1;
55
- let c = 0;
56
- for (const y of a)
57
- y.status === A.Error && c++;
58
- c ? c < a.length ? l.continueOnError ? (t.error("上传结束,部分文件上传失败!"), t.warning("保存上传成功的文件!"), d("after:upload", a), w()) : t.error("上传结束,部分文件上传失败,取消保存!") : t.error("上传结束,所有文件上传失败!") : (t.success("全部文件上传成功!"), d("after:upload", a), w());
59
- }
60
- );
61
- } catch (a) {
62
- e.isFormLoading.value = !1, console.error("上传错误:", a), t.error("上传错误,请稍后再试!"), d("after:upload", n.value);
63
- }
64
- }, w = async () => {
65
- switch (l.mode) {
66
- case "Row":
67
- e.formData.value && (await B(l.gridCtrl, e.formData.value)).status === $.SUCCESS && (e.visible.value = !1);
68
- break;
69
- }
70
- };
71
- z(() => {
72
- const o = l.gridCtrl.page;
73
- if (i.value = i.value ?? o.urls.upload, u.value = u.value ?? o.urls.download, !i.value) {
74
- t.error("未配置文件上传地址!");
75
- return;
76
- }
77
- if (i.value.api || (i.value.api = o.api), i.value.authorize === void 0 && (i.value.authorize = o.authorize), !u.value) {
78
- t.error("未配置文件下载地址!");
79
- return;
80
- }
81
- u.value.api || (u.value.api = o.api), u.value.authorize === void 0 && (u.value.authorize = o.authorize);
82
- for (const a in e.formData.value)
83
- l.gridCtrl.rowData.value && (e.formData.value[a] = l.gridCtrl.rowData.value[a]);
84
- const r = [];
85
- d("before:file-list", e, r), n.value.push(...r), p.value = e.visible.value;
86
- });
87
- const C = () => {
88
- e.visible.value = !1;
89
- };
90
- return (o, r) => (E(), D(s(L), {
91
- title: "文件上传",
92
- open: p.value,
93
- "onUpdate:open": r[1] || (r[1] = (a) => p.value = a),
94
- wrapClassName: "modal mx-auto " + (o.$attrs.width ? "w-[" + o.$attrs.width + "]" : "w-[430px]"),
95
- onClose: C
96
- }, {
97
- footer: f(() => [
98
- v(s(N), null, {
99
- default: f(() => [
100
- v(s(x), { onClick: C }, {
101
- default: f(() => r[2] || (r[2] = [
102
- g("取消")
103
- ])),
104
- _: 1,
105
- __: [2]
106
- }),
107
- v(s(x), {
108
- onClick: h,
109
- type: "primary",
110
- loading: s(e).isFormSaving.value
111
- }, {
112
- default: f(() => r[3] || (r[3] = [
113
- g(" 上传文件并保存 ")
114
- ])),
115
- _: 1,
116
- __: [3]
117
- }, 8, ["loading"])
118
- ]),
119
- _: 1
120
- })
121
- ]),
122
- default: f(() => [
123
- v(s(M), {
124
- "file-list": n.value,
125
- "onUpdate:fileList": r[0] || (r[0] = (a) => n.value = a),
126
- "download-url": u.value,
127
- "max-count": s(b),
128
- "file-ext": o.fileExt
129
- }, null, 8, ["file-list", "download-url", "max-count", "file-ext"])
130
- ]),
131
- _: 1
132
- }, 8, ["open", "wrapClassName"]));
133
- }
134
- });
135
- export {
136
- W as default
137
- };
package/lib/index.d.ts DELETED
@@ -1,45 +0,0 @@
1
- import { default as router } from './router';
2
- export { pinia } from './stores/pinia';
3
- export type { AnyControl, PostOptions, ExecuteOptions, } from './typings/data.d';
4
- export type { PageControl, PageControlOption, PrimaryKey, } from './typings/page.d';
5
- export { ProviderKeys } from './typings/page.d';
6
- export type { GridControl, GridControlOption, } from './typings/table.d';
7
- export type { EditorControl, EditorControlOption, InputFactoryItems, ValidateRule, ValidateRuleItem, ValidateError, } from './typings/form.d';
8
- export type { ButtonTool, ButtonTools, ButtonType, IconTool, RowRecord, } from './typings/tools.d';
9
- export type { TreeControl, TreeControlOption, TreeNode, } from './typings/tree.d';
10
- export type { UploadFile, MinioFile, ExcelFileParams, } from './typings/upload.d';
11
- export { UploadStatus } from './typings/upload.d';
12
- export type { ApiUrls, ReqUrls, } from './typings/urls.d';
13
- export type { OptionItemProps, OptionProps, SelectValue, } from './typings/option.d';
14
- export type { BreadcrumbRoute, } from './typings/menu.d';
15
- export { OPTIONS } from './const/options';
16
- export { OptionCommProps } from './typings/option.d';
17
- export { initDirective } from './directives/index';
18
- export { isEmpty } from './utils/isEmpty';
19
- export { queryTree } from './utils/tree';
20
- export { getToolByKey, getToolGroup, getToolStatus, getToolVisible, onReloadClick, onToolClicked, onFullscreenClick, onColumnVisibleChanged, defaultTools, useToolFactory, } from './utils/tools';
21
- export { initPageFactory, useEditorFactory, useGridFactory, useTreeFactory, usePageFactory } from './utils/page';
22
- export { loadOption, unloadOption, getSelectedValues, outFormDataFields, onOptionChanged, getSelectedLabels, } from './utils/options';
23
- export { downloadBlob, donwloadFromMinio } from './utils/download';
24
- export { ICONS_LIB, checkIconsExpired, circleLoading, createFromIconfont, parseIcons, getIconTransform, } from './utils/icon-loader';
25
- export { CacheKeys, Cache, initCacheCheck } from './utils/cache';
26
- export { initMenu, crumbs, showBreadcrumb } from './utils/menu';
27
- export { onFormSave, onFormSaveAs, onFormClose, saveForm, getFormDetail, openNewForm, setFormData } from './utils/form';
28
- export { initValidate, formValidate, validateData, resetRules, getRuleTexts, useInputFactory, useFormItemFactory, } from './utils/form-validate';
29
- export { validateExcel, checkExcelDuplicates, processExcelFile } from './utils/form-excel';
30
- export type { ExcelMarkCell, ExcelMarkInfo } from './utils/form-excel';
31
- export { filterColumns, mergeColumns, gridQueryList, gridQueryFind, gridRowUpdate, gridStatusUpdate, getRecordDetail, onGridRowExpand, onGridRowEdit, onGridRowDelete, } from './utils/table';
32
- export { doQuery, doExecute, doSave, doDelete } from './utils/data';
33
- export { exportSelectedRows, exportResults } from './utils/export-table';
34
- export { path, AsyncUploader } from './utils/file-upload';
35
- export { EventPrefix } from './utils/eventbus';
36
- export { default as eventBus } from './utils/eventbus';
37
- export { getHostInfo, getAppInfo, userLogin, userLogout, getToken, getUserInfo } from './utils/main-openapis';
38
- export { router as AppRouter };
39
- export { pendingNavigation, routes } from './router';
40
- export { useAppInfo } from './stores/appInfo';
41
- export { useHostInfo } from './stores/hostInfo';
42
- export { useUserInfo } from './stores/userInfo';
43
- export { usePageInfo } from './stores/pageInfo';
44
- export { useSettingInfo } from './stores/settingInfo';
45
- export { Button, Tooltip, AppIcon, Fullscreen, Helper, Icon, LayoutIcon, ProjectIcon, ToolIcon, Dialog, Drawer, Form, FormItem, Search, SearchItem, Table, TableOperate, Toolbar, Icontool, Tree, AutoComplete, Cascader, Checkbox, DatePicker, Input, InputIcon, InputPassword, InputNumber, PropEditor, Radio, RadioStatus, RangePicker, Select, Switch, Textarea, Transfer, TransferTable, TreeSelect, UploadList, Breadcrumb, Content, Datetime, Header, HeaderExits, Menu, MenuTabs, } from './components/index';
@@ -1,15 +0,0 @@
1
- import { RouteRecord } from '../../../502424_MicroBase';
2
- import { RouteLocationNormalizedGeneric, RouteRecordRaw, Router } from 'vue-router';
3
- import { Ref } from 'vue';
4
- export declare const LOGIN_PATH = "/login/";
5
- declare const routes: RouteRecord[];
6
- export declare const addAppRoutes: (subRoutes: RouteRecord[]) => void;
7
- export declare const flattenRoute: (route: RouteRecordRaw, flattenRoutes: Record<string, RouteRecord>, parent?: RouteRecord, parentPath?: string) => void;
8
- declare const router: Router;
9
- export { routes };
10
- export declare const pendingNavigation: Ref<{
11
- to: RouteLocationNormalizedGeneric;
12
- next: Function;
13
- } | null>;
14
- export declare const continueNavigation: (defaultPage: string) => void;
15
- export default router;
@@ -1,31 +0,0 @@
1
- import { RouteRecordRaw } from 'vue-router';
2
- import { AppInfo, RouteRecord } from '../../../502424_MicroBase';
3
- import { Component } from 'vue';
4
- import { StoreDefinition } from 'pinia';
5
- export declare const useAppInfo: StoreDefinition<"appInfo", {
6
- appInfo: AppInfo & {
7
- Routes: RouteRecordRaw[];
8
- flattenRoutes: Record<string, RouteRecord>;
9
- defaultPage: string;
10
- };
11
- appList: AppInfo[];
12
- CachedComponents: string[];
13
- ExcludeComponents: string[];
14
- menuLoaded: boolean;
15
- }, {}, {
16
- loadAppList(appList?: AppInfo[]): Promise<void>;
17
- getRemoteAppList(): Promise<void>;
18
- toDefaultApp(url?: string): Promise<void>;
19
- setActiveApp(key: string, appRoutes?: RouteRecord[]): Promise<void>;
20
- setAppRoutes(appRoutes: RouteRecord[]): void;
21
- formatRoute(path: string): string;
22
- push(path: string): void;
23
- findRoute(key: string): RouteRecord | undefined;
24
- cacheComponent(component: Component, route: {
25
- path: string;
26
- }): Component;
27
- excludeComponent(path: string): void;
28
- matchedRoutes(key: string): RouteRecord[];
29
- clean(): void;
30
- logout(): void;
31
- }>;
@@ -1,9 +0,0 @@
1
- import { HostInfo, MainOpenApis } from '../../../502424_MicroBase';
2
- import { StoreDefinition } from 'pinia';
3
- export declare const useHostInfo: StoreDefinition<"hostInfo", {
4
- hostInfo: HostInfo;
5
- }, {}, {
6
- loadHostInfo(hostApi: string, hostKey?: string, mainOpenApis?: MainOpenApis): Promise<void>;
7
- _setHostInfo(hostInfo: HostInfo): void;
8
- getHostInfo(): HostInfo;
9
- }>;
@@ -1,18 +0,0 @@
1
- import { StoreDefinition } from 'pinia';
2
- interface TabPaneProps {
3
- key: string;
4
- title: string;
5
- closable?: boolean;
6
- keepAlive?: boolean;
7
- content: any;
8
- }
9
- interface PageInfo {
10
- TabActive: string;
11
- TabPanes: TabPaneProps[];
12
- TabEnabled: boolean;
13
- }
14
- export declare const usePageInfo: StoreDefinition<"pageInfo", PageInfo, {}, {
15
- removeTabPane(path: string): void;
16
- setTabActive(path: string): Promise<void>;
17
- }>;
18
- export {};
@@ -1,3 +0,0 @@
1
- import { Pinia } from 'pinia';
2
- declare const pinia: Pinia;
3
- export { pinia };
@@ -1,8 +0,0 @@
1
- import { SettingInfo } from '../../../502424_MicroBase';
2
- import { StoreDefinition } from 'pinia';
3
- export declare const useSettingInfo: StoreDefinition<"settingInfo", SettingInfo, {}, {
4
- setFullscreen(status: boolean): void;
5
- setMenuCollapse(status: boolean): void;
6
- getTableColumns(pageUrl: string): Record<string, any>[];
7
- setTableColumns(pageUrl: string, columns: Record<string, any>[]): void;
8
- }>;
@@ -1,24 +0,0 @@
1
- import { ApiResponse } from '../../../502417_fapi';
2
- import { LoginInfo, UserInfo } from '../../../502424_MicroBase';
3
- import { StoreDefinition } from 'pinia';
4
- interface UserState {
5
- isLogin: boolean;
6
- userInfo: UserInfo;
7
- token?: string;
8
- refreshToken?: string;
9
- }
10
- export declare const useUserInfo: StoreDefinition<"userInfo", UserState, {}, {
11
- login(loginInfo: LoginInfo, redirect?: boolean): Promise<ApiResponse<LoginInfo> | void>;
12
- getRolePermits(appId: string): Promise<boolean>;
13
- hasRole(role: string | string[]): boolean;
14
- hasPermit(url: string, permitCode: string): boolean;
15
- getUserInfo(): UserInfo;
16
- setUserInfo(userInfo: UserInfo, token: string): void;
17
- getToken(): string;
18
- isSuperAdmin(): boolean;
19
- isAdmin(): boolean;
20
- getUserLevel(): string;
21
- clean(): Promise<void>;
22
- logout(): Promise<void>;
23
- }>;
24
- export {};
@@ -1,80 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { PageControl } from './page';
3
- import { AnyData, ApiResponse, IUrlInfo, ReqParams } from '../../../502417_fapi';
4
- /**
5
- * 任何控制对象的通用接口
6
- * 包括TreeControl和GridControl等
7
- */
8
- export interface AnyControl {
9
- /**
10
- * 所属页面控制器
11
- */
12
- page: PageControl<AnyData>;
13
-
14
- /**
15
- * URL信息
16
- */
17
- url?: IUrlInfo;
18
-
19
- /**
20
- * 是否重新加载相关数据
21
- */
22
- reload?: Ref<boolean>;
23
- }
24
-
25
- /**
26
- * 通用选项
27
- */
28
- export interface PostOptions<T> {
29
- /**
30
- * Page页面URL的Key
31
- */
32
- urlKey: string;
33
-
34
- /**
35
- * 自定义URL,优先使用
36
- */
37
- url?: IUrlInfo;
38
-
39
- /**
40
- * 执行提示文字
41
- * - false时,不显示提示文字
42
- * - 空时,显示默认文字
43
- */
44
- loadingText?: string | boolean;
45
-
46
- /**
47
- * 是否隐藏错误提示
48
- */
49
- hideErrorToast?: boolean;
50
-
51
- /**
52
- * 执行参数
53
- */
54
- params?: ReqParams;
55
-
56
- /**
57
- * 处理参数的函数
58
- */
59
- processParams?: (params: ReqParams) => ReqParams;
60
-
61
- /**
62
- * 加载状态引用
63
- */
64
- loadingState?: Ref<boolean>;
65
- }
66
-
67
- /**
68
- * 执行选项
69
- */
70
- export interface ExecuteOptions<T> extends PostOptions<T> {
71
- /**
72
- * 主键字段名
73
- */
74
- primaryKey?: string;
75
-
76
- /**
77
- * 状态字段名
78
- */
79
- statusKey?: string;
80
- }
@@ -1,171 +0,0 @@
1
- import { AnyData, IUrlInfo } from '../../../502417_fapi';
2
- import { PageControl } from './page';
3
- import { default as Validator, RuleItem, ValidateError } from 'async-validator';
4
- import { Ref, DefineProps } from 'vue';
5
- import { GridControl } from './table';
6
- interface ValidateRuleItem extends RuleItem {
7
- errors?: ValidateError[];
8
- }
9
- type ValidateRule =
10
- | ValidateRuleItem
11
- | (ValidateRuleItem[] & {
12
- required?: boolean;
13
- errors?: ValidateError[];
14
- });
15
-
16
- /**
17
- * 弹窗控制默认设置
18
- */
19
- export interface EditorControlOption {
20
- /**
21
- * 主键名,默认为Id
22
- */
23
- primaryKey: string | 'Id' | 'id';
24
- /**
25
- * 保存后自动关闭窗口
26
- */
27
- autoClose: boolean;
28
- /**
29
- * 弹窗自动获取详情并赋值给formData
30
- * - 默认 false,使用表格的数据
31
- * - true 自动获取详情并赋值给formData
32
- */
33
- autoDetail: boolean;
34
- /**
35
- * 保存按钮是否可见
36
- */
37
- saveBtnVisible: boolean;
38
- /**
39
- * 另存为按钮是否可见
40
- */
41
- saveAsBtnVisible: boolean;
42
- }
43
-
44
- /**
45
- * 页面表单数据交互标准定义
46
- */
47
- export type EditorControl<T> = EditorControlOption & {
48
- /**
49
- * 表单名称
50
- */
51
- readonly name: string;
52
- /**
53
- * 表单是否可见
54
- */
55
- visible: Ref<boolean>;
56
- /**
57
- * 表单默认数据
58
- */
59
- default: Readonly<T>;
60
- /**
61
- * 所属页面控制器
62
- */
63
- page: PageControl<AnyData>;
64
- /**
65
- * 所属表格控制器
66
- */
67
- grid?: GridControl<AnyData>;
68
- /**
69
- * 表单保存前判断
70
- * @param editorCtrl 表单配置数据
71
- * @returns 是否保存
72
- */
73
- beforeSave?: () => boolean | undefined;
74
- /**
75
- * 表单保存后处理
76
- * @param editorCtrl 表单配置数据
77
- * @param pageCtrl 页面控制器
78
- */
79
- afterSave?: () => void | undefined;
80
- /**
81
- * 表单数据
82
- * - Model对象
83
- */
84
- formData: Ref<T>;
85
- /**
86
- * 更新数据
87
- * - 自定义对象
88
- */
89
- updateData: Ref<Record<string, any> | undefined>;
90
- /**
91
- * 表单验证条件
92
- * - errors 验证失败信息数组
93
- */
94
- formRules: Ref<Record<string, ValidateRule> | undefined>;
95
- /**
96
- * 验证器
97
- */
98
- ruleValidator?: Validator;
99
- /**
100
- * 验证结果
101
- */
102
- ruleResults: Ref<Record<string, ValidateError[]> | undefined>;
103
- /**
104
- * 表单存储接口
105
- * - 优先使用
106
- * - 或使用PageData.urls.save
107
- */
108
- saveUrl?: IUrlInfo;
109
- /**
110
- * 获取详情接口
111
- */
112
- detailUrl?: IUrlInfo;
113
- /**
114
- * 表单是否正在执行存储
115
- */
116
- isFormSaving: Ref<boolean>;
117
- /**
118
- * 表单详情加载中
119
- */
120
- isFormLoading: Ref<boolean>;
121
- /**
122
- * 上级表单
123
- */
124
- parentEditor?: EditorControl<any>;
125
- };
126
-
127
- /**
128
- * 输入项工厂结构
129
- */
130
- export interface InputFactoryItems<T> {
131
- /**
132
- * 页面表单数据
133
- */
134
- editorCtrl: EditorControl<T> | undefined;
135
- /**
136
- * 表单项Label文字
137
- */
138
- labelText: Ref<string>;
139
- /**
140
- * 输入项错误列表
141
- */
142
- // ruleErrors: Ref<ValidateError[] | undefined>;
143
- /**
144
- * 输入项验证规则名
145
- */
146
- ruleKey: Ref<string>;
147
- /**
148
- * 输入项错误状态
149
- */
150
- errInfo?: Ref<{ msg: string; errClass: string }>;
151
- /**
152
- * 输入项属性
153
- */
154
- inputProps?: DefineProps;
155
- /**
156
- * 输入项reload事件处理
157
- * @param event 事件名
158
- * @param data 参数
159
- * @returns
160
- */
161
- reloadHandler?: (event: string, data: Record<string, AnyData> | AnyData[]) => void;
162
- /**
163
- * 输入项事件
164
- * @param evt 事件
165
- * @param args 参数
166
- * @returns
167
- */
168
- inputEmit?: (evt: any, ...args) => void;
169
- }
170
-
171
- export type { ValidateRule, ValidateRuleItem, ValidateError };
@@ -1,7 +0,0 @@
1
- export interface BreadcrumbRoute {
2
- index?: number;
3
- path: string;
4
- breadcrumbName: string;
5
- icon?: string;
6
- children?: Array<BreadcrumbRoute>;
7
- }