@skyfox2000/webui 1.0.14 → 1.2.1

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 +43 -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 +890 -724
  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 +3 -3
  87. package/src/components/content/table/tableOperate.vue +2 -2
  88. package/src/components/content/toolbar/icontool.vue +2 -2
  89. package/src/components/content/toolbar/index.vue +3 -2
  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 +202 -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
@@ -0,0 +1,175 @@
1
+ import { AnyData, IUrlInfo, ReqParams } from '../../../502417_fapi';
2
+ import { PropType } from 'vue';
3
+ type RawValue = string | number;
4
+ export type SelectValue = RawValue | RawValue[];
5
+ /**
6
+ * 选项基础属性
7
+ */
8
+ export interface OptionItemProps {
9
+ label: string;
10
+ title?: string;
11
+ value: string | number | undefined;
12
+ key?: string | number;
13
+ role?: string | string[];
14
+ permit?: string;
15
+ [key: string]: AnyData;
16
+ }
17
+
18
+ /**
19
+ * 选项类公共属性接口
20
+ */
21
+ export interface OptionProps {
22
+ /**
23
+ * 自动接口加载数据
24
+ * - 默认为true
25
+ */
26
+ autoload?: boolean;
27
+ /**
28
+ * 是否显示全部选项
29
+ * - 默认为false
30
+ */
31
+ all?: boolean;
32
+ /**
33
+ * 选择项数据
34
+ */
35
+ data?: Record<string, any>[];
36
+ /**
37
+ * 字段转换控制
38
+ * - Key:目的字段
39
+ * - Value:源字段,支持模板 ${}
40
+ */
41
+ fieldMap?: Record<string, string>;
42
+ /**
43
+ * 接口定义
44
+ */
45
+ url?: IUrlInfo;
46
+ /**
47
+ * 接口自定义QOD参数
48
+ */
49
+ params?: ReqParams;
50
+ /**
51
+ * 表单数据
52
+ */
53
+ formData?: Record<string, any>;
54
+ /**
55
+ * 返回文字内容或文字内容数组
56
+ */
57
+ labels?: string | number | (string | number)[];
58
+ /**
59
+ * 输出字段转换控制
60
+ * - Key:目的字段
61
+ * - Value:源字段,支持模板 ${}
62
+ */
63
+ outFields?: Record<string, string>;
64
+ /**
65
+ * 通过消息重载数据,只允许改变查询条件
66
+ * - eventBus.on(组件限定前缀 +"."+ reloadEvent, { Q参数 } | 数据[])
67
+ * - 数据组仅用于联动显示
68
+ * - 其它情况使用Query参数
69
+ */
70
+ reloadEvent?: string;
71
+ /**
72
+ * 通过消息触发事件,只允许改变查询条件
73
+ * - eventBus.emit(changeEvent, { Q参数 } | 数据[])
74
+ * - 数据组仅用于联动显示
75
+ * - 其它情况使用Query参数
76
+ */
77
+ changeEvent?: string | string[];
78
+ }
79
+
80
+ /**
81
+ * 选项类props公共属性
82
+ */
83
+ export const OptionCommProps = {
84
+ /**
85
+ * 自动接口加载数据
86
+ * - 默认为true
87
+ */
88
+ autoload: {
89
+ type: Boolean as PropType<boolean>,
90
+ required: false,
91
+ default: true,
92
+ },
93
+ /**
94
+ * 是否显示全部选项
95
+ * - 默认为false
96
+ */
97
+ all: {
98
+ type: Boolean as PropType<boolean>,
99
+ required: false,
100
+ default: false,
101
+ },
102
+ /**
103
+ * 选择项数据
104
+ */
105
+ data: {
106
+ type: Array as PropType<Record<string, any>[]>,
107
+ required: false,
108
+ },
109
+ /**
110
+ * 字段转换控制
111
+ * - Key:目的字段
112
+ * - Value:源字段,支持模板 ${}
113
+ */
114
+ fieldMap: {
115
+ type: Object as PropType<Record<string, string>>,
116
+ required: false,
117
+ },
118
+ /**
119
+ * 接口定义
120
+ */
121
+ url: {
122
+ type: Object as PropType<IUrlInfo>,
123
+ required: false,
124
+ },
125
+ /**
126
+ * 接口自定义QOD参数
127
+ */
128
+ params: {
129
+ type: Object as PropType<ReqParams>,
130
+ required: false,
131
+ },
132
+ /**
133
+ * 返回文字内容或文字内容数组
134
+ */
135
+ labels: {
136
+ type: [String, Number, Array] as PropType<string | number | (string | number)[]>,
137
+ required: false,
138
+ },
139
+ /**
140
+ * 表单数据
141
+ */
142
+ formData: {
143
+ type: Object as PropType<Record<string, any>>,
144
+ required: false,
145
+ },
146
+ /**
147
+ * 输出字段转换控制
148
+ * - Key:目的字段
149
+ * - Value:源字段,支持模板 ${}
150
+ */
151
+ outFields: {
152
+ type: Object as PropType<Record<string, string>>,
153
+ required: false,
154
+ },
155
+ /**
156
+ * 通过消息重载数据,只允许改变查询条件
157
+ * - eventBus.on(组件限定前缀 +"."+ reloadEvent, { Q参数 } | 数据[])
158
+ * - 数据组仅用于联动显示
159
+ * - 其它情况使用Query参数
160
+ */
161
+ reloadEvent: {
162
+ type: String as PropType<string>,
163
+ required: false,
164
+ },
165
+ /**
166
+ * 通过消息触发事件,只允许改变查询条件
167
+ * - eventBus.emit(changeEvent, { Q参数 } | 数据[])
168
+ * - 数据组仅用于联动显示
169
+ * - 其它情况使用Query参数
170
+ */
171
+ changeEvent: {
172
+ type: [String, Array] as PropType<string | string[]>,
173
+ required: false,
174
+ },
175
+ };
@@ -0,0 +1,69 @@
1
+ import { ReqParams } from '../../../502417_fapi';
2
+ import { EditorControl } from './form';
3
+ import { ApiUrls } from './urls';
4
+ import { GridControl } from './table';
5
+ import { TreeControl } from './tree';
6
+ /**
7
+ * 主键类型
8
+ */
9
+ export type PrimaryKey = number | string;
10
+
11
+ /**
12
+ * 页面数据传递键名
13
+ */
14
+ export enum ProviderKeys {
15
+ 'PageControl' = 'Page.PageControl',
16
+ 'EditorControl' = 'Page.EditorControl',
17
+ 'GridControl' = 'Page.GridControl',
18
+ 'LabelText' = 'FormItem.LabelText',
19
+ 'RuleKey' = 'FormItem.RuleKey',
20
+ 'ErrInfo' = 'FormItem.ErrInfo',
21
+ }
22
+ /**
23
+ * 页面控制默认设置
24
+ */
25
+ export interface PageControlOption {
26
+ /**
27
+ * 主键名,默认为Id
28
+ */
29
+ primaryKey: string | 'Id' | 'id';
30
+ /**
31
+ * 记录行状态,默认为Enabled
32
+ */
33
+ statusKey: string | 'Enabled' | 'enabled';
34
+ }
35
+
36
+ /**
37
+ * 页面数据交互标准定义
38
+ */
39
+ export type PageControl<T> = ApiUrls &
40
+ PageControlOption & {
41
+ /**
42
+ * 控制编辑表单显示
43
+ */
44
+ editor?: EditorControl<T>;
45
+ /**
46
+ * 控制左侧树数据
47
+ */
48
+ tree?: TreeControl;
49
+ /**
50
+ * 控制表格数据
51
+ */
52
+ grid?: GridControl<T>;
53
+ /**
54
+ * 当前页面默认条件
55
+ */
56
+ searchQuery?: ReqParams;
57
+ /**
58
+ * 其它弹窗配置
59
+ */
60
+ subEditor?: {
61
+ [key: string]: EditorControl<any>;
62
+ };
63
+ /**
64
+ * 其它表格配置
65
+ */
66
+ subGrid?: {
67
+ [key: string]: GridControl<any>;
68
+ };
69
+ };
@@ -0,0 +1,181 @@
1
+ import { Ref, ShallowRef } from 'vue';
2
+ import { ButtonTools } from './tools';
3
+ import { PageControl, PrimaryKey } from './page';
4
+ import { EditorControl } from './form';
5
+ import { AnyData, IUrlInfo, ReqParams, FindResult } from '../../../502417_fapi';
6
+ /**
7
+ * 表格控制默认设置
8
+ */
9
+ export interface GridControlOption {
10
+ /**
11
+ * 自动加载表格,默认true
12
+ */
13
+ autoload: boolean;
14
+ /**
15
+ * 主键名,默认为Id
16
+ */
17
+ primaryKey: string | 'Id' | 'id';
18
+ /**
19
+ * 记录行状态,默认为Enabled
20
+ */
21
+ statusKey: string | 'Enabled' | 'enabled';
22
+ /**
23
+ * 是否支持多行选择
24
+ */
25
+ selectable: Ref<boolean>;
26
+ /**
27
+ * 搜索栏是否可见
28
+ */
29
+ searchBar: Ref<boolean>;
30
+ /**
31
+ * 分页数量,默认10
32
+ */
33
+ pageSize: Ref<number>;
34
+ /**
35
+ * 主操作按钮列表
36
+ * - 空[]则不显示
37
+ * - 外部控制可用状态
38
+ * - 默认:New
39
+ * - 可用:
40
+ * - New 新增
41
+ * - 下载表格
42
+ */
43
+ buttons: Ref<ButtonTools>;
44
+ /**
45
+ * 平铺数量,超过N个的按钮,会折叠成下拉菜单
46
+ * 默认值:3
47
+ */
48
+ flat?: number;
49
+ /**
50
+ * 常用操作图标,默认显示,空[]则不显示
51
+ *
52
+ * tool开头的可通过后端权限控制
53
+ * - 默认:Reload/RowHeight/TableHeadset/Fullscreen
54
+ * - 可用
55
+ * - Reload: 刷新表格
56
+ * - Query: 展开搜索栏
57
+ * - RowHeight: 行高调整
58
+ * - tool.multiple.checkbox: 显示多选框
59
+ * - tool.expand.rows: 展开记录行
60
+ * - tool.export.excel: 导出Excel
61
+ * - tool.export.excel.all: 全部记录
62
+ * - tool.export.pdf: 导出PDF
63
+ * - TableHeadset: 表头设置
64
+ * - Fullscreen: 设置全屏
65
+ */
66
+ tools: string[];
67
+ /**
68
+ * 远程分页,标准接口需改为find
69
+ * 非标准接口需要返回data.total字段
70
+ */
71
+ remotePage: boolean;
72
+ /**
73
+ * 是否全部行展开
74
+ */
75
+ rowExpand: Ref<boolean>;
76
+ /**
77
+ * 默认行高
78
+ * - 大 / 中 / 小
79
+ */
80
+ tableSize: Ref<'large' | 'middle' | 'small'>;
81
+ /**
82
+ * 表格行操作
83
+ * - 默认:Edit/Delete
84
+ * - 可用:
85
+ * - Edit 编辑
86
+ * - Delete 删除
87
+ */
88
+ operates: ButtonTools;
89
+ }
90
+ /**
91
+ * 页面表格数据交互标准定义
92
+ */
93
+ export type GridControl<T> = GridControlOption & {
94
+ /**
95
+ * 重新加载表格数据
96
+ */
97
+ reload: Ref<boolean>;
98
+ /**
99
+ * 所属页面控制器
100
+ */
101
+ page: PageControl<AnyData>;
102
+ /**
103
+ * 编辑表单控制器
104
+ */
105
+ editor?: EditorControl<T>;
106
+ /**
107
+ * 当前表格点击的数据行
108
+ */
109
+ rowData: Ref<T | undefined>;
110
+ /**
111
+ * 选择的数据行
112
+ */
113
+ selectRows: Ref<T[]>;
114
+ /**
115
+ * 选择的数据行主键
116
+ */
117
+ selectKeys: Ref<PrimaryKey[]>;
118
+ /**
119
+ * 当前页码
120
+ */
121
+ pageNo: Ref<number>;
122
+ /**
123
+ * 总数量
124
+ */
125
+ total: Ref<number>;
126
+ /**
127
+ * 表格列
128
+ */
129
+ columns: Ref<Record<string, any>[]>;
130
+ /**
131
+ * 当前表格查询条件
132
+ */
133
+ gridQuery?: ReqParams;
134
+ /**
135
+ * 当前表格全部数据
136
+ */
137
+ tableData: ShallowRef<T[] | undefined>;
138
+ /**
139
+ * 数据行展开数据,主键为行主键
140
+ * - 通过gridData.expandRows[record.Id]获取数据
141
+ */
142
+ expandRows: Ref<Record<string, AnyData>>;
143
+ /**
144
+ * 表格查询接口
145
+ * - 优先使用
146
+ * - 或使用PageData.urls.list
147
+ */
148
+ gridUrl?: IUrlInfo;
149
+ /**
150
+ * 表格更新接口
151
+ * - 优先使用
152
+ * - 或使用PageData.urls.update
153
+ */
154
+ updateUrl?: IUrlInfo;
155
+ /**
156
+ * 表格删除接口
157
+ * - 优先使用
158
+ * - 或使用PageData.urls.delete
159
+ */
160
+ deleteUrl?: IUrlInfo;
161
+ /**
162
+ * 表格是否正在加载中
163
+ */
164
+ isGridLoading: Ref<boolean>;
165
+ /**
166
+ * 表格是否正在存储中
167
+ */
168
+ isGridSaving: Ref<boolean>;
169
+ /**
170
+ * 表格数据加载后回调
171
+ */
172
+ afterLoad?: (result: FindResult | T[] | null) => void;
173
+ /**
174
+ * 表格数据更新后回调
175
+ */
176
+ afterUpdate?: (record: T) => void;
177
+ /**
178
+ * 表格数据删除后回调
179
+ */
180
+ afterDelete?: (record: T) => void;
181
+ };
@@ -0,0 +1,130 @@
1
+ import { GridControl } from './table.d';
2
+ import { EditorControl } from './form.d';
3
+ import { PageControl } from './page.d';
4
+ import { AnyData } from '../../../502417_fapi';
5
+ import { VNode, Ref, ShallowRef } from 'vue';
6
+ export type ButtonType = 'link' | 'default' | 'primary' | 'ghost' | 'dashed' | 'text';
7
+ export type RowRecord = Record<string, any> | RowRecord[];
8
+ /**
9
+ * 工具/操作按钮定义
10
+ */
11
+ export interface ButtonTool {
12
+ /**
13
+ * 按钮关键字,与权限控制相关
14
+ * 功能码,必须唯一
15
+ * 字符串配置时,使用默认设置
16
+ */
17
+ key: string;
18
+ /**
19
+ * 文字
20
+ */
21
+ label?: string;
22
+ /**
23
+ * 状态文字,与状态图标对应
24
+ * 可切换
25
+ */
26
+ labels?: string[];
27
+ /**
28
+ * 图标
29
+ */
30
+ icon?: string;
31
+ /**
32
+ * 状态图标
33
+ */
34
+ icons?: string[];
35
+ /**
36
+ * 图标状态位
37
+ * - 当前文字
38
+ * - 当前图标
39
+ */
40
+ iconStatus?: number;
41
+ /**
42
+ * 下拉操作
43
+ */
44
+ children?: (IconTool | ButtonTool)[];
45
+ /**
46
+ * 控制表单控制自动弹窗
47
+ * - 配置表单控制器visible
48
+ * - 配置后,可不配置click事件(click自动执行)
49
+ */
50
+ formVisible?: Ref;
51
+ /**
52
+ * /// 主工具栏批量操作
53
+ * @param pageCtrl 页面控制对象
54
+ * @param gridCtrl 表格控制对象
55
+ * @param record 数据表行记录
56
+ * - 配置formVibible后,可自动执行click事件
57
+ * - 实现 grid.rowData.value = record
58
+ * - 实现 formVisible.value = true
59
+ * - 未配置formVisible时,会提示未配置点击处理事件
60
+ * 操作
61
+ * @example
62
+ click: <T>(_: PageControl<T>, _: GridControl<T>, row: T) => {
63
+ const rowData = row as OrderEntity;
64
+ },
65
+ * @returns
66
+ */
67
+ click?: <T>(pageCtrl: PageControl<T>, gridCtrl?: GridControl<T>, record?: T | RowRecord | string[]) => void;
68
+ /**
69
+ * 按钮主样式
70
+ */
71
+ type?: ButtonType;
72
+ /**
73
+ * 是否禁用
74
+ * @example
75
+ visible: (row: OrderEntity) => { }
76
+ */
77
+ disabled?: boolean | ((record) => boolean); /// 表格操作
78
+ /**
79
+ * 是否可见
80
+ * @example
81
+ visible: (row: OrderEntity) => { }
82
+ */
83
+ visible?: boolean | ((record) => boolean); /// 表格操作
84
+ /**
85
+ * 是否弹出确认框,确认操作由确认方法执行
86
+ */
87
+ confirm?: boolean;
88
+ /**
89
+ * 确认框提示文字
90
+ */
91
+ confirmText?: string;
92
+ /**
93
+ * 警告色
94
+ */
95
+ danger?: boolean;
96
+ /**
97
+ * 自定义样式
98
+ */
99
+ class?: string;
100
+ /**
101
+ * 图标属性
102
+ */
103
+ iconProps?: Record<string, any>;
104
+ /**
105
+ * 下拉组件
106
+ */
107
+ dropdown?: string;
108
+ /**
109
+ * 下拉容器样式
110
+ */
111
+ dropdownClass?: string;
112
+ /**
113
+ * 角色权限控制
114
+ */
115
+ role?: string | string[];
116
+ /**
117
+ * 权限控制
118
+ */
119
+ permit?: string;
120
+ }
121
+
122
+ export type IconTool = Omit<ButtonTool, 'disabled' | 'children'> & {
123
+ disabled?: boolean;
124
+ children?: (IconTool | ButtonTool)[];
125
+ };
126
+
127
+ /**
128
+ * 工具/操作按钮定义组
129
+ */
130
+ export type ButtonTools = (IconTool | ButtonTool | string)[];
@@ -0,0 +1,72 @@
1
+ import { Ref, ShallowRef } from 'vue';
2
+ import { AnyData, IUrlInfo, ReqParams } from '../../../502417_fapi';
3
+ import { PageControl } from './page';
4
+ export interface TreeNode {
5
+ /**
6
+ * 节点名称
7
+ */
8
+ title: string;
9
+ /**
10
+ * 节点ID
11
+ */
12
+ key: string;
13
+ /**
14
+ * 节点子节点
15
+ */
16
+ children?: TreeNode[];
17
+ /**
18
+ * 节点数据
19
+ */
20
+ [key: string]: AnyData;
21
+ }
22
+ /**
23
+ * 树控制默认设置
24
+ */
25
+ export interface TreeControlOption {
26
+ /**
27
+ * 自动加载树,默认true
28
+ */
29
+ autoload: boolean;
30
+ }
31
+
32
+ /**
33
+ * 页面左侧树数据交互标准定义
34
+ */
35
+ export type TreeControl = TreeControlOption & {
36
+ /**
37
+ * 重新加载树数据
38
+ */
39
+ reload: Ref<boolean>;
40
+ /**
41
+ * 所属页面控制器
42
+ */
43
+ page: PageControl<AnyData>;
44
+ /**
45
+ * 当前选择节点
46
+ */
47
+ node: Ref<TreeNode | undefined>;
48
+ /**
49
+ * 当前表格查询条件
50
+ */
51
+ treeQuery?: ReqParams;
52
+ /**
53
+ * 当前树数据
54
+ */
55
+ data: ShallowRef<TreeNode[] | undefined>;
56
+ /**
57
+ * 字段转换控制
58
+ * - Key:目的字段
59
+ * - Value:源字段,支持模板 ${}
60
+ */
61
+ fieldMap?: Record<string, string>;
62
+ /**
63
+ * 树查询接口
64
+ * - 优先使用
65
+ * - 或使用PageData.urls.tree
66
+ */
67
+ url?: IUrlInfo;
68
+ /**
69
+ * 是否正在加载中
70
+ */
71
+ isTreeLoading: Ref<boolean>;
72
+ };