@skyfox2000/webui 1.0.13 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/lib/assets/modules/file-upload-CBUcsUnR.js +170 -0
  2. package/lib/assets/modules/form-validate-CgX7aR7T.js +297 -0
  3. package/lib/assets/modules/index-Civhd8xG.js +112 -0
  4. package/lib/assets/modules/index-DQMdt51R.js +726 -0
  5. package/lib/assets/modules/{index-BEWJ_qAH.js → index-DmWrkTXX.js} +1 -1
  6. package/lib/assets/modules/{menuTabs-BXdbFZor.js → menuTabs-BRYvFWA-.js} +131 -121
  7. package/lib/assets/modules/settingInfo-BZakNKIN.js +999 -0
  8. package/lib/assets/modules/uploadList-B7XoxGOh.js +278 -0
  9. package/lib/components/common/icon/index.vue.d.ts +1 -1
  10. package/lib/components/content/dialog/index.vue.d.ts +1 -1
  11. package/lib/components/content/drawer/index.vue.d.ts +1 -1
  12. package/lib/components/content/form/index.vue.d.ts +1 -1
  13. package/lib/components/content/search/index.vue.d.ts +1 -1
  14. package/lib/components/content/table/index.vue.d.ts +1 -1
  15. package/lib/components/content/table/tableOperate.vue.d.ts +1 -1
  16. package/lib/components/content/toolbar/icontool.vue.d.ts +1 -1
  17. package/lib/components/content/toolbar/index.vue.d.ts +1 -1
  18. package/lib/components/content/tree/index.vue.d.ts +1 -1
  19. package/lib/components/form/transfer/transferTable.vue.d.ts +1 -1
  20. package/lib/components/form/treeSelect/index.vue.d.ts +1 -1
  21. package/lib/components/form/upload/uploadList.vue.d.ts +1 -1
  22. package/lib/const/options.d.ts +32 -0
  23. package/lib/directives/enter-submit.d.ts +4 -0
  24. package/lib/directives/index.d.ts +2 -0
  25. package/lib/directives/permission.d.ts +5 -0
  26. package/lib/es/AceEditor/index.js +9 -8
  27. package/lib/es/BasicLayout/index.js +28 -24
  28. package/lib/es/Error403/index.js +15 -10
  29. package/lib/es/Error404/index.js +15 -10
  30. package/lib/es/ExcelForm/index.js +380 -175
  31. package/lib/es/UploadForm/index.js +23 -20
  32. package/lib/index.d.ts +42 -2
  33. package/lib/router/index.d.ts +16 -0
  34. package/lib/stores/appInfo.d.ts +34 -0
  35. package/lib/stores/hostInfo.d.ts +9 -0
  36. package/lib/stores/pageInfo.d.ts +18 -0
  37. package/lib/stores/pinia.d.ts +3 -0
  38. package/lib/stores/settingInfo.d.ts +8 -0
  39. package/lib/stores/userInfo.d.ts +21 -0
  40. package/lib/typings/data.d.ts +80 -0
  41. package/lib/typings/form.d.ts +171 -0
  42. package/lib/typings/menu.d.ts +7 -0
  43. package/lib/typings/option.d.ts +175 -0
  44. package/lib/typings/page.d.ts +69 -0
  45. package/lib/typings/table.d.ts +181 -0
  46. package/lib/typings/tools.d.ts +130 -0
  47. package/lib/typings/tree.d.ts +72 -0
  48. package/lib/typings/upload.d.ts +161 -0
  49. package/lib/typings/urls.d.ts +69 -0
  50. package/lib/utils/cache.d.ts +23 -0
  51. package/lib/utils/data.d.ts +6 -0
  52. package/lib/utils/download.d.ts +4 -0
  53. package/lib/utils/eventbus.d.ts +16 -0
  54. package/lib/utils/export-table.d.ts +12 -0
  55. package/lib/utils/file-upload.d.ts +15 -0
  56. package/lib/utils/form-excel.d.ts +30 -0
  57. package/lib/utils/form-validate.d.ts +29 -0
  58. package/lib/utils/form.d.ts +9 -0
  59. package/lib/utils/icon-loader.d.ts +125 -0
  60. package/lib/utils/isEmpty.d.ts +1 -0
  61. package/lib/utils/main-openapis.d.ts +9 -0
  62. package/lib/utils/menu.d.ts +6 -0
  63. package/lib/utils/options.d.ts +10 -0
  64. package/lib/utils/page.d.ts +25 -0
  65. package/lib/utils/table.d.ts +21 -0
  66. package/lib/utils/tools.d.ts +18 -0
  67. package/lib/utils/tree.d.ts +3 -0
  68. package/lib/vite-env.d.ts +8 -0
  69. package/lib/webui.css +1 -1
  70. package/lib/webui.es.js +1020 -854
  71. package/package.json +7 -6
  72. package/src/components/common/icon/appicon.vue +1 -1
  73. package/src/components/common/icon/fullscreen.vue +2 -1
  74. package/src/components/common/icon/index.vue +1 -1
  75. package/src/components/common/icon/layoutIcon.vue +1 -1
  76. package/src/components/common/icon/projectIcon.vue +1 -1
  77. package/src/components/common/icon/toolIcon.vue +1 -1
  78. package/src/components/content/dialog/excelForm.vue +2 -2
  79. package/src/components/content/dialog/index.vue +1 -1
  80. package/src/components/content/dialog/uploadForm.vue +7 -6
  81. package/src/components/content/drawer/index.vue +43 -18
  82. package/src/components/content/form/formItem.vue +1 -1
  83. package/src/components/content/form/index.vue +1 -1
  84. package/src/components/content/search/index.vue +1 -1
  85. package/src/components/content/search/searchItem.vue +1 -1
  86. package/src/components/content/table/index.vue +8 -5
  87. package/src/components/content/table/tableOperate.vue +8 -4
  88. package/src/components/content/toolbar/icontool.vue +2 -2
  89. package/src/components/content/toolbar/index.vue +9 -5
  90. package/src/components/content/tree/index.vue +1 -1
  91. package/src/components/error/error403.vue +2 -2
  92. package/src/components/error/error404.vue +2 -2
  93. package/src/components/form/autoComplete/index.vue +1 -1
  94. package/src/components/form/cascader/index.vue +1 -2
  95. package/src/components/form/checkbox/index.vue +11 -5
  96. package/src/components/form/datePicker/index.vue +1 -1
  97. package/src/components/form/input/index.vue +1 -1
  98. package/src/components/form/input/inputNumber.vue +1 -1
  99. package/src/components/form/input/inputPassword.vue +1 -1
  100. package/src/components/form/radio/index.vue +1 -1
  101. package/src/components/form/radio/radioStatus.vue +1 -1
  102. package/src/components/form/rangePicker/index.vue +1 -1
  103. package/src/components/form/select/index.vue +1 -1
  104. package/src/components/form/switch/index.vue +7 -3
  105. package/src/components/form/textarea/index.vue +1 -1
  106. package/src/components/form/transfer/index.vue +1 -1
  107. package/src/components/form/transfer/transferTable.vue +42 -22
  108. package/src/components/form/treeSelect/index.vue +2 -3
  109. package/src/components/form/upload/uploadList.vue +1 -1
  110. package/src/components/layout/breadcrumb/index.vue +1 -1
  111. package/src/components/layout/header/headerExits.vue +1 -1
  112. package/src/components/layout/header/index.vue +1 -1
  113. package/src/components/layout/header/user.vue +2 -1
  114. package/src/components/layout/menu/index.vue +9 -3
  115. package/src/components/layout/menu/menuTabs.vue +10 -12
  116. package/src/components/layout/page/basicLayout.vue +1 -1
  117. package/src/const/options.ts +114 -0
  118. package/src/directives/enter-submit.ts +13 -0
  119. package/src/directives/index.ts +26 -0
  120. package/src/directives/permission.ts +144 -0
  121. package/src/index.ts +201 -0
  122. package/src/router/index.ts +196 -0
  123. package/src/stores/appInfo.ts +471 -0
  124. package/src/stores/hostInfo.ts +117 -0
  125. package/src/stores/pageInfo.ts +131 -0
  126. package/src/stores/pinia.ts +10 -0
  127. package/src/stores/settingInfo.ts +53 -0
  128. package/src/stores/userInfo.ts +392 -0
  129. package/src/typings/data.d.ts +81 -0
  130. package/src/typings/form.d.ts +172 -0
  131. package/src/typings/menu.d.ts +7 -0
  132. package/src/typings/option.d.ts +177 -0
  133. package/src/typings/page.d.ts +70 -0
  134. package/src/typings/table.d.ts +182 -0
  135. package/src/typings/tools.d.ts +131 -0
  136. package/src/typings/tree.d.ts +73 -0
  137. package/src/typings/upload.d.ts +162 -0
  138. package/src/typings/urls.d.ts +70 -0
  139. package/src/utils/cache.ts +175 -0
  140. package/src/utils/data.ts +189 -0
  141. package/src/utils/download.ts +80 -0
  142. package/src/utils/eventbus.ts +78 -0
  143. package/src/utils/export-table.ts +155 -0
  144. package/src/utils/file-upload.ts +304 -0
  145. package/src/utils/form-excel.ts +523 -0
  146. package/src/utils/form-validate.ts +368 -0
  147. package/src/utils/form.ts +188 -0
  148. package/src/utils/icon-loader.ts +412 -0
  149. package/src/utils/isEmpty.ts +18 -0
  150. package/src/utils/main-openapis.ts +72 -0
  151. package/src/utils/menu.ts +89 -0
  152. package/src/utils/options.ts +324 -0
  153. package/src/utils/page.ts +262 -0
  154. package/src/utils/table.ts +274 -0
  155. package/src/utils/tools.ts +362 -0
  156. package/src/utils/tree.ts +28 -0
  157. package/tsconfig.json +1 -8
  158. package/vite.config.ts +7 -4
  159. package/lib/assets/modules/index-BahGnrAq.js +0 -415
  160. package/lib/assets/modules/index-BoKIa2sr.js +0 -109
  161. package/lib/assets/modules/index-D47Ci-T3.js +0 -107
  162. package/lib/assets/modules/uploadList-Dzlg47V0.js +0 -182
@@ -1,14 +1,17 @@
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-BoKIa2sr.js";
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 p, createVNode as v, createTextVNode as g } from "vue";
2
+ import { _ as x } from "../../assets/modules/form-validate-CgX7aR7T.js";
3
3
  import { Modal as L, Space as N } from "ant-design-vue";
4
4
  import { ResStatus as $ } from "@skyfox2000/fapi";
5
- import { AsyncUploader as B, UploadStatus as R, gridRowUpdate as M } from "@skyfox2000/webbase";
6
- import "../../assets/modules/index-BEWJ_qAH.js";
7
- import "../../assets/modules/index-BahGnrAq.js";
8
- import "dayjs";
5
+ import "../../assets/modules/settingInfo-BZakNKIN.js";
6
+ import { A as B, U as R } from "../../assets/modules/file-upload-CBUcsUnR.js";
7
+ import "@skyfox2000/microbase";
9
8
  import t from "vue-m-message";
10
- import { _ as O } from "../../assets/modules/uploadList-Dzlg47V0.js";
11
- const P = /* @__PURE__ */ S({
9
+ import "async-validator";
10
+ import { _ as A, d as M } from "../../assets/modules/uploadList-B7XoxGOh.js";
11
+ import "dayjs";
12
+ import "../../assets/modules/index-DmWrkTXX.js";
13
+ import "../../assets/modules/index-DQMdt51R.js";
14
+ const X = /* @__PURE__ */ S({
12
15
  __name: "uploadForm",
13
16
  props: {
14
17
  mode: {},
@@ -23,11 +26,11 @@ const P = /* @__PURE__ */ S({
23
26
  },
24
27
  emits: ["before:file-list", "before:upload", "after:upload"],
25
28
  setup(U, { emit: _ }) {
26
- const l = U, e = l.uploadForm, p = m(!1), b = l.maxCount ?? 1, F = l.maxConcurrent ?? 3, n = m([]), d = _;
29
+ const l = U, e = l.uploadForm, f = m(!1), b = l.maxCount ?? 1, F = l.maxConcurrent ?? 3, n = m([]), d = _;
27
30
  k(
28
31
  () => e.visible.value,
29
32
  () => {
30
- p.value = e.visible.value;
33
+ f.value = e.visible.value;
31
34
  }
32
35
  );
33
36
  const i = m(l.uploadUrl), u = m(l.downloadUrl), h = async () => {
@@ -80,23 +83,23 @@ const P = /* @__PURE__ */ S({
80
83
  for (const a in e.formData.value)
81
84
  l.gridCtrl.rowData.value && (e.formData.value[a] = l.gridCtrl.rowData.value[a]);
82
85
  const r = [];
83
- d("before:file-list", e, r), n.value.push(...r), p.value = e.visible.value;
86
+ d("before:file-list", e, r), n.value.push(...r), f.value = e.visible.value;
84
87
  });
85
88
  const C = () => {
86
89
  e.visible.value = !1;
87
90
  };
88
91
  return (o, r) => (E(), D(s(L), {
89
92
  title: "文件上传",
90
- open: p.value,
91
- "onUpdate:open": r[1] || (r[1] = (a) => p.value = a),
93
+ open: f.value,
94
+ "onUpdate:open": r[1] || (r[1] = (a) => f.value = a),
92
95
  wrapClassName: "modal mx-auto " + (o.$attrs.width ? "w-[" + o.$attrs.width + "]" : "w-[430px]"),
93
96
  onClose: C
94
97
  }, {
95
- footer: f(() => [
98
+ footer: p(() => [
96
99
  v(s(N), null, {
97
- default: f(() => [
100
+ default: p(() => [
98
101
  v(s(x), { onClick: C }, {
99
- default: f(() => r[2] || (r[2] = [
102
+ default: p(() => r[2] || (r[2] = [
100
103
  g("取消")
101
104
  ])),
102
105
  _: 1,
@@ -107,7 +110,7 @@ const P = /* @__PURE__ */ S({
107
110
  type: "primary",
108
111
  loading: s(e).isFormSaving.value
109
112
  }, {
110
- default: f(() => r[3] || (r[3] = [
113
+ default: p(() => r[3] || (r[3] = [
111
114
  g(" 上传文件并保存 ")
112
115
  ])),
113
116
  _: 1,
@@ -117,8 +120,8 @@ const P = /* @__PURE__ */ S({
117
120
  _: 1
118
121
  })
119
122
  ]),
120
- default: f(() => [
121
- v(s(O), {
123
+ default: p(() => [
124
+ v(s(A), {
122
125
  "file-list": n.value,
123
126
  "onUpdate:fileList": r[0] || (r[0] = (a) => n.value = a),
124
127
  "download-url": u.value,
@@ -131,5 +134,5 @@ const P = /* @__PURE__ */ S({
131
134
  }
132
135
  });
133
136
  export {
134
- P as default
137
+ X as default
135
138
  };
package/lib/index.d.ts CHANGED
@@ -1,2 +1,42 @@
1
- export * from './components/index'
2
- export {}
1
+ import { default as router } from './router';
2
+ export type { AnyControl, PostOptions, ExecuteOptions, } from './typings/data.d';
3
+ export type { PageControl, PageControlOption, PrimaryKey, } from './typings/page.d';
4
+ export { ProviderKeys } from './typings/page.d';
5
+ export type { GridControl, GridControlOption, } from './typings/table.d';
6
+ export type { EditorControl, EditorControlOption, InputFactoryItems, ValidateRule, ValidateRuleItem, ValidateError, } from './typings/form.d';
7
+ export type { ButtonTool, ButtonTools, ButtonType, IconTool, RowRecord, } from './typings/tools.d';
8
+ export type { TreeControl, TreeControlOption, TreeNode, } from './typings/tree.d';
9
+ export type { UploadFile, MinioFile, ExcelFileParams, } from './typings/upload.d';
10
+ export { UploadStatus } from './typings/upload.d';
11
+ export type { ApiUrls, ReqUrls, } from './typings/urls.d';
12
+ export type { OptionItemProps, OptionProps, SelectValue, } from './typings/option.d';
13
+ export type { BreadcrumbRoute, } from './typings/menu.d';
14
+ export { OPTIONS } from './const/options';
15
+ export { OptionCommProps } from './typings/option.d';
16
+ export { initDirective } from './directives/index';
17
+ export { isEmpty } from './utils/isEmpty';
18
+ export { queryTree } from './utils/tree';
19
+ export { getToolByKey, getToolGroup, getToolStatus, getToolVisible, onReloadClick, onToolClicked, onFullscreenClick, onColumnVisibleChanged, defaultTools, useToolFactory, } from './utils/tools';
20
+ export { initPageFactory, useEditorFactory, useGridFactory, useTreeFactory, usePageFactory } from './utils/page';
21
+ export { loadOption, unloadOption, getSelectedValues, outFormDataFields, onOptionChanged, getSelectedLabels, } from './utils/options';
22
+ export { downloadBlob, donwloadFromMinio } from './utils/download';
23
+ export { ICONS_LIB, checkIconsExpired, circleLoading, createFromIconfont, parseIcons, getIconTransform, } from './utils/icon-loader';
24
+ export { CacheKeys, Cache, initCacheCheck } from './utils/cache';
25
+ export { initMenu, crumbs, showBreadcrumb } from './utils/menu';
26
+ export { onFormSave, onFormSaveAs, onFormClose, saveForm, getFormDetail, openNewForm, setFormData } from './utils/form';
27
+ export { initValidate, formValidate, validateData, resetRules, getRuleTexts, useInputFactory, useFormItemFactory, } from './utils/form-validate';
28
+ export { validateExcel, checkExcelDuplicates, processExcelFile } from './utils/form-excel';
29
+ export type { ExcelMarkCell, ExcelMarkInfo } from './utils/form-excel';
30
+ export { filterColumns, mergeColumns, gridQueryList, gridQueryFind, gridRowUpdate, gridStatusUpdate, getRecordDetail, onGridRowExpand, onGridRowEdit, onGridRowDelete, } from './utils/table';
31
+ export { doQuery, doExecute, doSave, doDelete } from './utils/data';
32
+ export { exportSelectedRows, exportResults } from './utils/export-table';
33
+ export { path, AsyncUploader } from './utils/file-upload';
34
+ export { EventPrefix } from './utils/eventbus';
35
+ export { default as eventBus } from './utils/eventbus';
36
+ export { getHostInfo, getAppInfo, userLogin, userLogout, getToken, getUserInfo, mainAppPush, } from './utils/main-openapis';
37
+ export { router as AppRouter };
38
+ export { useAppInfo } from './stores/appInfo';
39
+ export { useHostInfo } from './stores/hostInfo';
40
+ export { useUserInfo } from './stores/userInfo';
41
+ export { usePageInfo } from './stores/pageInfo';
42
+ export { useSettingInfo } from './stores/settingInfo';
@@ -0,0 +1,16 @@
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 hasPermission: (route: RouteRecord, isLogin: boolean) => boolean;
11
+ export declare const pendingNavigation: Ref<{
12
+ to: RouteLocationNormalizedGeneric;
13
+ next: Function;
14
+ } | null>;
15
+ export declare const continueNavigation: (defaultPage: string) => void;
16
+ export default router;
@@ -0,0 +1,34 @@
1
+ import { Router, 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
+ microRouter: any;
7
+ microActions: Record<string, () => void>;
8
+ appInfo: AppInfo & {
9
+ Routes: RouteRecordRaw[];
10
+ flattenRoutes: Record<string, RouteRecord>;
11
+ defaultPage: string;
12
+ };
13
+ appList: AppInfo[];
14
+ CachedComponents: string[];
15
+ ExcludeComponents: string[];
16
+ menuLoaded: boolean;
17
+ }, {}, {
18
+ init(router: Router, microActions: Record<string, () => void>): void;
19
+ loadAppList(appList?: AppInfo[]): Promise<void>;
20
+ getRemoteAppList(): Promise<void>;
21
+ toDefaultApp(url?: string): Promise<void>;
22
+ setActiveApp(key: string, appRoutes?: RouteRecord[]): Promise<void>;
23
+ setAppRoutes(appRoutes: RouteRecord[]): void;
24
+ formatRoute(path: string): string;
25
+ push(path: string): void;
26
+ findRoute(key: string): RouteRecord | undefined;
27
+ cacheComponent(component: Component, route: {
28
+ path: string;
29
+ }): Component;
30
+ excludeComponent(path: string): void;
31
+ matchedRoutes(key: string): RouteRecord[];
32
+ clear(): void;
33
+ logout(): void;
34
+ }>;
@@ -0,0 +1,9 @@
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
+ }>;
@@ -0,0 +1,18 @@
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 {};
@@ -0,0 +1,3 @@
1
+ import { Pinia } from 'pinia';
2
+ declare const pinia: Pinia;
3
+ export { pinia };
@@ -0,0 +1,8 @@
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
+ }>;
@@ -0,0 +1,21 @@
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
+ init(): void;
12
+ login(loginInfo: LoginInfo, redirect?: boolean): Promise<ApiResponse<LoginInfo> | void>;
13
+ getRolePermits(appId: string): Promise<boolean>;
14
+ hasRole(role: string | string[]): boolean;
15
+ hasPermit(url: string, permitCode: string): boolean;
16
+ getUserInfo(): UserInfo;
17
+ getToken(): string;
18
+ clean(): Promise<void>;
19
+ logout(): Promise<void>;
20
+ }>;
21
+ export {};
@@ -0,0 +1,80 @@
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
+ }
@@ -0,0 +1,171 @@
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 };
@@ -0,0 +1,7 @@
1
+ export interface BreadcrumbRoute {
2
+ index?: number;
3
+ path: string;
4
+ breadcrumbName: string;
5
+ icon?: string;
6
+ children?: Array<BreadcrumbRoute>;
7
+ }