wlwy-package 3.2.1 → 3.2.2

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 (170) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/types/index.d.ts +17 -0
  3. package/dist/types/packages/axios/index.d.ts +6 -0
  4. package/dist/types/packages/axios/service.d.ts +21 -0
  5. package/dist/types/packages/axios/types/index.d.ts +32 -0
  6. package/dist/types/packages/components/antd/index.d.ts +10 -0
  7. package/dist/types/packages/components/antd/src/button.vue.d.ts +10 -0
  8. package/dist/types/packages/components/antd/src/datePicker.vue.d.ts +16 -0
  9. package/dist/types/packages/components/antd/src/descriptions-item.vue.d.ts +9 -0
  10. package/dist/types/packages/components/antd/src/descriptions.vue.d.ts +6 -0
  11. package/dist/types/packages/components/antd/src/modal.vue.d.ts +30 -0
  12. package/dist/types/packages/components/antd/src/select.vue.d.ts +14 -0
  13. package/dist/types/packages/components/antd/src/statistic.vue.d.ts +3 -0
  14. package/dist/types/packages/components/antd/src/upload.vue.d.ts +40 -0
  15. package/dist/types/packages/components/antd/type.d.ts +164 -0
  16. package/dist/types/packages/components/common/index.d.ts +20 -0
  17. package/dist/types/packages/components/common/src/Redirect.vue.d.ts +2 -0
  18. package/dist/types/packages/components/common/src/configProvider.vue.d.ts +13 -0
  19. package/dist/types/packages/components/common/src/cropper.vue.d.ts +29 -0
  20. package/dist/types/packages/components/common/src/dropdown.vue.d.ts +23 -0
  21. package/dist/types/packages/components/common/src/editTitle.vue.d.ts +18 -0
  22. package/dist/types/packages/components/common/src/noData.vue.d.ts +7 -0
  23. package/dist/types/packages/components/common/src/page.vue.d.ts +38 -0
  24. package/dist/types/packages/components/common/src/pageHead.vue.d.ts +29 -0
  25. package/dist/types/packages/components/common/src/rangePicker.vue.d.ts +24 -0
  26. package/dist/types/packages/components/common/src/slashHeader.vue.d.ts +7 -0
  27. package/dist/types/packages/components/common/src/upload-modal.vue.d.ts +43 -0
  28. package/dist/types/packages/components/common/type.d.ts +296 -0
  29. package/dist/types/packages/components/form/business/index.d.ts +8 -0
  30. package/dist/types/packages/components/form/business/src/channel.vue.d.ts +5 -0
  31. package/dist/types/packages/components/form/business/src/country.vue.d.ts +3 -0
  32. package/dist/types/packages/components/form/business/src/customer.vue.d.ts +6 -0
  33. package/dist/types/packages/components/form/business/src/sku.vue.d.ts +5 -0
  34. package/dist/types/packages/components/form/business/type.d.ts +36 -0
  35. package/dist/types/packages/components/form/default/index.d.ts +44 -0
  36. package/dist/types/packages/components/form/default/src/checkbox.vue.d.ts +18 -0
  37. package/dist/types/packages/components/form/default/src/custom.vue.d.ts +14 -0
  38. package/dist/types/packages/components/form/default/src/datePicker.vue.d.ts +6 -0
  39. package/dist/types/packages/components/form/default/src/dateRange.vue.d.ts +10 -0
  40. package/dist/types/packages/components/form/default/src/form.vue.d.ts +429 -0
  41. package/dist/types/packages/components/form/default/src/formCol.vue.d.ts +16 -0
  42. package/dist/types/packages/components/form/default/src/formItem.vue.d.ts +20 -0
  43. package/dist/types/packages/components/form/default/src/formItemRest.vue.d.ts +2 -0
  44. package/dist/types/packages/components/form/default/src/input.vue.d.ts +26 -0
  45. package/dist/types/packages/components/form/default/src/inputI18n.vue.d.ts +14 -0
  46. package/dist/types/packages/components/form/default/src/inputMatch.vue.d.ts +18 -0
  47. package/dist/types/packages/components/form/default/src/inputNumber.vue.d.ts +16 -0
  48. package/dist/types/packages/components/form/default/src/inputPassword.vue.d.ts +16 -0
  49. package/dist/types/packages/components/form/default/src/inputTags.vue.d.ts +21 -0
  50. package/dist/types/packages/components/form/default/src/modal.vue.d.ts +46 -0
  51. package/dist/types/packages/components/form/default/src/numberRange.vue.d.ts +9 -0
  52. package/dist/types/packages/components/form/default/src/page.vue.d.ts +48 -0
  53. package/dist/types/packages/components/form/default/src/radio.vue.d.ts +18 -0
  54. package/dist/types/packages/components/form/default/src/select.vue.d.ts +21 -0
  55. package/dist/types/packages/components/form/default/src/selectInput.vue.d.ts +13 -0
  56. package/dist/types/packages/components/form/default/src/textarea.vue.d.ts +14 -0
  57. package/dist/types/packages/components/form/default/src/timePicker.vue.d.ts +6 -0
  58. package/dist/types/packages/components/form/default/src/upload-image.vue.d.ts +23 -0
  59. package/dist/types/packages/components/form/default/src/upload.vue.d.ts +12 -0
  60. package/dist/types/packages/components/form/default/src/wrap.vue.d.ts +56 -0
  61. package/dist/types/packages/components/form/default/type.d.ts +680 -0
  62. package/dist/types/packages/components/form/index.d.ts +2 -0
  63. package/dist/types/packages/components/form/type.d.ts +2 -0
  64. package/dist/types/packages/components/icon/index.d.ts +4 -0
  65. package/dist/types/packages/components/icon/src/icon.vue.d.ts +12 -0
  66. package/dist/types/packages/components/icon/src/index.vue.d.ts +9 -0
  67. package/dist/types/packages/components/icon/src/switch.vue.d.ts +18 -0
  68. package/dist/types/packages/components/icon/type.d.ts +41 -0
  69. package/dist/types/packages/components/index.d.ts +7 -0
  70. package/dist/types/packages/components/layout/blank.vue.d.ts +2 -0
  71. package/dist/types/packages/components/layout/index.d.ts +7 -0
  72. package/dist/types/packages/components/layout/index.vue.d.ts +9 -0
  73. package/dist/types/packages/components/layout/skeleton/list.vue.d.ts +2 -0
  74. package/dist/types/packages/components/layout/skeleton/switch.vue.d.ts +2 -0
  75. package/dist/types/packages/components/layout/src/footer.vue.d.ts +2 -0
  76. package/dist/types/packages/components/layout/src/header/index.vue.d.ts +10 -0
  77. package/dist/types/packages/components/layout/src/header/modules/download.vue.d.ts +6 -0
  78. package/dist/types/packages/components/layout/src/header/modules/language.vue.d.ts +2 -0
  79. package/dist/types/packages/components/layout/src/header/modules/password-modal.vue.d.ts +9 -0
  80. package/dist/types/packages/components/layout/src/header/modules/topMenu.vue.d.ts +2 -0
  81. package/dist/types/packages/components/layout/src/header/modules/warehouse.vue.d.ts +2 -0
  82. package/dist/types/packages/components/layout/src/logo.vue.d.ts +2 -0
  83. package/dist/types/packages/components/layout/src/siderMenu.vue.d.ts +2 -0
  84. package/dist/types/packages/components/layout/src/subMenuItem.vue.d.ts +6 -0
  85. package/dist/types/packages/components/layout/src/tabsNav.vue.d.ts +2 -0
  86. package/dist/types/packages/components/layout/type.d.ts +17 -0
  87. package/dist/types/packages/components/lazy/charts/index.d.ts +21 -0
  88. package/dist/types/packages/components/lazy/charts/index.vue.d.ts +7 -0
  89. package/dist/types/packages/components/lazy/editor/editor-core.vue.d.ts +36 -0
  90. package/dist/types/packages/components/lazy/editor/index.d.ts +3 -0
  91. package/dist/types/packages/components/lazy/editor/index.vue.d.ts +35 -0
  92. package/dist/types/packages/components/lazy/editor/type.d.ts +62 -0
  93. package/dist/types/packages/components/list/index.d.ts +7 -0
  94. package/dist/types/packages/components/list/input.d.ts +432 -0
  95. package/dist/types/packages/components/list/src/header.vue.d.ts +44 -0
  96. package/dist/types/packages/components/list/src/index.vue.d.ts +68 -0
  97. package/dist/types/packages/components/list/src/pager.vue.d.ts +10 -0
  98. package/dist/types/packages/components/list/src/table.vue.d.ts +774 -0
  99. package/dist/types/packages/components/list/type.d.ts +346 -0
  100. package/dist/types/packages/components/table/constants.d.ts +15 -0
  101. package/dist/types/packages/components/table/index.d.ts +7 -0
  102. package/dist/types/packages/components/table/resolveInjectColumns.d.ts +17 -0
  103. package/dist/types/packages/components/table/src/action-column.vue.d.ts +11 -0
  104. package/dist/types/packages/components/table/src/column.vue.d.ts +82 -0
  105. package/dist/types/packages/components/table/src/pager.vue.d.ts +314 -0
  106. package/dist/types/packages/components/table/src/search.vue.d.ts +34 -0
  107. package/dist/types/packages/components/table/src/table.vue.d.ts +802 -0
  108. package/dist/types/packages/components/table/type.d.ts +179 -0
  109. package/dist/types/packages/components/table/useWTableConfig.d.ts +34 -0
  110. package/dist/types/packages/components/table/vxeDefaultConfig.d.ts +8 -0
  111. package/dist/types/packages/components/table/warnDeprecated.d.ts +6 -0
  112. package/dist/types/packages/config.d.ts +27 -0
  113. package/dist/types/packages/directive/auth.d.ts +4 -0
  114. package/dist/types/packages/directive/auths.d.ts +4 -0
  115. package/dist/types/packages/directive/index.d.ts +6 -0
  116. package/dist/types/packages/hooks/business/index.d.ts +4 -0
  117. package/dist/types/packages/hooks/business/src/index.d.ts +4 -0
  118. package/dist/types/packages/hooks/business/src/useCountryDict.d.ts +22 -0
  119. package/dist/types/packages/hooks/business/src/useCurrencyDict.d.ts +22 -0
  120. package/dist/types/packages/hooks/business/src/useCustomerDict.d.ts +22 -0
  121. package/dist/types/packages/hooks/business/src/useWarehouseZoneDict.d.ts +22 -0
  122. package/dist/types/packages/hooks/business/useBusinessDict.d.ts +2 -0
  123. package/dist/types/packages/hooks/business/useDict.d.ts +25 -0
  124. package/dist/types/packages/hooks/index.d.ts +2 -0
  125. package/dist/types/packages/hooks/private/index.d.ts +2 -0
  126. package/dist/types/packages/hooks/private/src/useKey.d.ts +1 -0
  127. package/dist/types/packages/hooks/private/src/useRenderCell.d.ts +71 -0
  128. package/dist/types/packages/hooks/web/index.d.ts +17 -0
  129. package/dist/types/packages/hooks/web/src/useAffix.d.ts +19 -0
  130. package/dist/types/packages/hooks/web/src/useCatchPreloadError.d.ts +6 -0
  131. package/dist/types/packages/hooks/web/src/useCookie.d.ts +11 -0
  132. package/dist/types/packages/hooks/web/src/useEmitBack.d.ts +3 -0
  133. package/dist/types/packages/hooks/web/src/useEnum.d.ts +24 -0
  134. package/dist/types/packages/hooks/web/src/useExport.d.ts +4 -0
  135. package/dist/types/packages/hooks/web/src/useFormItemProps.d.ts +22 -0
  136. package/dist/types/packages/hooks/web/src/useFormStorage.d.ts +18 -0
  137. package/dist/types/packages/hooks/web/src/useI18n.d.ts +26 -0
  138. package/dist/types/packages/hooks/web/src/useListConfig.d.ts +16 -0
  139. package/dist/types/packages/hooks/web/src/useLocale.d.ts +6 -0
  140. package/dist/types/packages/hooks/web/src/useNProgress.d.ts +5 -0
  141. package/dist/types/packages/hooks/web/src/usePageForm.d.ts +9 -0
  142. package/dist/types/packages/hooks/web/src/usePrefixTitle.d.ts +7 -0
  143. package/dist/types/packages/hooks/web/src/useTabsNav.d.ts +13 -0
  144. package/dist/types/packages/hooks/web/src/useUpload.d.ts +1 -0
  145. package/dist/types/packages/hooks/web/src/useWatchForm.d.ts +10 -0
  146. package/dist/types/packages/hooks/web/src/useWindowSize.d.ts +8 -0
  147. package/dist/types/packages/index.d.ts +21 -0
  148. package/dist/types/packages/keys/index.d.ts +6 -0
  149. package/dist/types/packages/keys/public.d.ts +0 -0
  150. package/dist/types/packages/plugins/index.d.ts +1 -0
  151. package/dist/types/packages/plugins/vueI18n/helper.d.ts +1 -0
  152. package/dist/types/packages/plugins/vueI18n/index.d.ts +14 -0
  153. package/dist/types/packages/setup/index.d.ts +1 -0
  154. package/dist/types/packages/setup/vxe.d.ts +10 -0
  155. package/dist/types/packages/store/index.d.ts +9 -0
  156. package/dist/types/packages/store/modules/common.d.ts +50 -0
  157. package/dist/types/packages/store/modules/dict.d.ts +436 -0
  158. package/dist/types/packages/store/modules/language.d.ts +182 -0
  159. package/dist/types/packages/store/modules/tagsNav.d.ts +156 -0
  160. package/dist/types/packages/store/modules/userPermission.d.ts +60 -0
  161. package/dist/types/packages/type.d.ts +44 -0
  162. package/dist/types/packages/utils/config.d.ts +1 -0
  163. package/dist/types/packages/utils/createRefInstanceProxy.d.ts +13 -0
  164. package/dist/types/packages/utils/formatCellValue.d.ts +82 -0
  165. package/dist/types/packages/utils/getPrefixTitle.d.ts +5 -0
  166. package/dist/types/packages/utils/index.d.ts +48 -0
  167. package/dist/types/packages/utils/type.d.ts +6 -0
  168. package/dist/types/packages/utils/warehouse.d.ts +30 -0
  169. package/dist/wlwy-package.es.js +19 -21
  170. package/package.json +1 -1
@@ -0,0 +1,179 @@
1
+ import type { FormInstance, FormProps } from 'ant-design-vue';
2
+ import type { VxeColumnProps, VxePagerInstance, VxePagerProps, VxeTableInstance, VxeTableProps, VxeToolbarInstance, VxeToolbarProps } from 'vxe-table';
3
+ import type { RenderCellProps, RenderCellFormatType } from '../../hooks/private';
4
+ import type { Slot } from 'vue';
5
+ /**
6
+ * w-toolbar 组件属性
7
+ */
8
+ export interface WToolbarProps extends Omit<VxeToolbarProps, 'id'> {
9
+ toolid?: string;
10
+ /** @deprecated 请改用 WTable 顶层的 `showToolbar` */
11
+ hideToolbar?: boolean;
12
+ }
13
+ /** 多子组件共享,平铺在 WTable 顶层 */
14
+ export type WTableSharedPropKeys = 'loading' | 'size' | 'perfect' | 'border' | 'align';
15
+ export type WToolbarOnlyProps = Omit<WToolbarProps, WTableSharedPropKeys>;
16
+ export type WPagerOnlyProps = Omit<WPagerProps, WTableSharedPropKeys | 'dataSource'>;
17
+ export type WTableOnlyProps<Row = any> = Omit<VxeTableProps<Row>, 'data' | WTableSharedPropKeys>;
18
+ /**
19
+ * w-table 组件属性
20
+ */
21
+ export interface WTableProps<Row = any> extends WTableOnlyProps<Row>, Partial<Pick<WToolbarProps & WPagerProps, WTableSharedPropKeys>> {
22
+ data?: Row[];
23
+ showPager?: boolean;
24
+ /** 是否显示复选框列 */
25
+ showCheckbox?: boolean;
26
+ /** 是否显示序号列 @default true */
27
+ showSeq?: boolean;
28
+ /**
29
+ * 是否显示工具栏,优先级高于 `toolbar.hideToolbar`。
30
+ * 若存在 `#toolbar-buttons` / `#toolbar-tools`(或旧 `#buttons` / `#tools`),则以 slot 为准强制显示。
31
+ */
32
+ showToolbar?: boolean;
33
+ toolbar?: Partial<WToolbarOnlyProps>;
34
+ pager?: Partial<WPagerOnlyProps>;
35
+ }
36
+ /**
37
+ * w-table 弃用平铺属性(仍可通过 attrs 传入,请迁移至 toolbar / pager 嵌套对象)
38
+ */
39
+ export interface WTableDeprecatedProps extends Partial<WToolbarOnlyProps>, Partial<Omit<WPagerOnlyProps, keyof WToolbarOnlyProps>> {
40
+ /** @deprecated 请改用 `data` */
41
+ dataSource?: unknown[];
42
+ }
43
+ /**
44
+ * w-table 插槽
45
+ */
46
+ export interface WTableSlots {
47
+ 'toolbar-buttons'?: Slot;
48
+ 'toolbar-tools'?: Slot;
49
+ 'pager-left'?: Slot;
50
+ 'pager-right'?: Slot;
51
+ default?: Slot;
52
+ }
53
+ /**
54
+ * w-pager组件示例
55
+ */
56
+ export interface WPagerInstance extends VxePagerInstance {
57
+ /**
58
+ * 获取分页实例
59
+ */
60
+ getPagerInstance: () => VxePagerInstance | undefined;
61
+ }
62
+ /** w-table.resetPager 参数 */
63
+ export type ResetPagerParams = {
64
+ currentPage?: number;
65
+ pageSize?: number;
66
+ };
67
+ /** w-table 内部分页快照 */
68
+ export type PagerState = {
69
+ currentPage: number;
70
+ pageSize: number;
71
+ };
72
+ /**
73
+ * w-table组件示例
74
+ */
75
+ export interface WTableInstance extends VxeTableInstance {
76
+ /**
77
+ * 获取表格实例
78
+ */
79
+ getTableInstance: () => VxeTableInstance | undefined;
80
+ /**
81
+ * 获取表格工具栏实例
82
+ */
83
+ getToolbarInstance: () => VxeToolbarInstance | undefined;
84
+ /**
85
+ * 获取表格分页实例
86
+ */
87
+ getPagerInstance: () => WPagerInstance | undefined;
88
+ /**
89
+ * 读取内部分页状态(供列表页拼请求参数)
90
+ */
91
+ getPagerState: () => PagerState;
92
+ /**
93
+ * 更新内部分页状态(默认回到第 1 页;pageSize 不传则保持)
94
+ */
95
+ resetPager: (params?: ResetPagerParams) => void;
96
+ }
97
+ /**
98
+ * w-column组件属性
99
+ */
100
+ export type WColumnProp = Omit<RenderCellProps, 'type' | 'field'> & Pick<VxeColumnProps, 'field' | 'title' | 'fixed' | 'width' | 'minWidth' | 'editRender' | 'headerClassName' | 'formatter' | 'showOverflow'> & {
101
+ /**
102
+ * 渲染类型
103
+ */
104
+ type?: VxeColumnProps['type'] | RenderCellFormatType | 'action';
105
+ /**
106
+ * 列是否可排序
107
+ */
108
+ sortable?: boolean;
109
+ /**
110
+ * 列头提示图标
111
+ * @default 'QuestionCircleOutlined'
112
+ */
113
+ suffixIcon?: 'QuestionCircleOutlined' | 'InfoCircleOutlined' | 'ExclamationCircleOutlined' | Slot;
114
+ /**
115
+ * 列头提示图标
116
+ * @default 'QuestionCircleOutlined'
117
+ */
118
+ prefixIcon?: 'QuestionCircleOutlined' | 'InfoCircleOutlined' | 'ExclamationCircleOutlined' | Slot;
119
+ /**
120
+ * 列头提示内容
121
+ */
122
+ tipsContent?: string | Slot;
123
+ /**
124
+ * 默认值
125
+ */
126
+ defaultValue?: string;
127
+ };
128
+ /**
129
+ * w-pager 组件属性
130
+ */
131
+ export interface WPagerProps<T = any[]> extends VxePagerProps {
132
+ /**
133
+ * 数据源
134
+ */
135
+ dataSource?: T;
136
+ }
137
+ /**********************WListSearch组件********************** */
138
+ /**
139
+ * WListSearch 组件属性
140
+ */
141
+ export interface WListSearchProps extends Pick<FormProps, 'rules'> {
142
+ /**
143
+ * 搜索表单 model
144
+ */
145
+ model: Record<string, any>;
146
+ /**
147
+ * 每行几列,默认 4
148
+ */
149
+ column?: number;
150
+ /**
151
+ * 列间距
152
+ */
153
+ gutter?: number;
154
+ /**
155
+ * 查询按钮 loading
156
+ */
157
+ loading?: boolean;
158
+ /**
159
+ * 是否显示展开/收起
160
+ */
161
+ expand?: boolean;
162
+ /**
163
+ * 卡片 bordered
164
+ */
165
+ bordered?: boolean;
166
+ }
167
+ /**
168
+ * WListSearch 组件实例
169
+ */
170
+ export interface WListSearchInstance {
171
+ /**
172
+ * 获取 FormInstance
173
+ */
174
+ getFormInstance: () => FormInstance | undefined;
175
+ /**
176
+ * 触发重置
177
+ */
178
+ reset: () => void;
179
+ }
@@ -0,0 +1,34 @@
1
+ import { type ComputedRef, type Slots } from 'vue';
2
+ import type { WPagerOnlyProps, WTableProps, WToolbarOnlyProps } from './type';
3
+ export type WTableResolvedConfig = {
4
+ toolbar: Partial<WToolbarOnlyProps> & {
5
+ hideToolbar?: boolean;
6
+ toolid?: string;
7
+ };
8
+ pager: Partial<WPagerOnlyProps>;
9
+ table: Record<string, unknown>;
10
+ };
11
+ /** 父组件 vnode 上是否显式传入过该 prop */
12
+ export declare function isPropExplicit(vnodeProps: Record<string, unknown>, key: string): boolean;
13
+ /** 父组件 vnode 上真正传过的 prop(未传的 Boolean 不会出现在这里,避免 Vue 缺省 false 覆盖 setConfig) */
14
+ export declare function pickExplicitProps(props: Record<string, unknown>, vnodeProps: Record<string, unknown> | null | undefined): Record<string, unknown>;
15
+ export declare function resolveWTableConfig(props: WTableProps, attrs: Record<string, unknown>, vnodeProps?: Record<string, unknown> | null): WTableResolvedConfig;
16
+ export declare function useWTableConfig(props: WTableProps, attrs: Record<string, unknown>): {
17
+ config: ComputedRef<WTableResolvedConfig>;
18
+ };
19
+ export declare function resolveWTableSlots(slots: Slots): {
20
+ hasToolbarButtons: boolean;
21
+ hasToolbarTools: boolean;
22
+ hasPagerLeft: boolean;
23
+ hasPagerRight: boolean;
24
+ hasToolbarSlots: boolean;
25
+ tableSlotNames: string[];
26
+ };
27
+ export declare function useWTableSlots(slots: Slots): ComputedRef<{
28
+ hasToolbarButtons: boolean;
29
+ hasToolbarTools: boolean;
30
+ hasPagerLeft: boolean;
31
+ hasPagerRight: boolean;
32
+ hasToolbarSlots: boolean;
33
+ tableSlotNames: string[];
34
+ }>;
@@ -0,0 +1,8 @@
1
+ import type { VxePagerProps, VxeTableProps, VxeToolbarProps } from 'vxe-table';
2
+ export type WTableVxeDefaultConfig = {
3
+ table: Partial<VxeTableProps>;
4
+ toolbar: Partial<VxeToolbarProps>;
5
+ pager: Partial<VxePagerProps>;
6
+ };
7
+ /** WTable 组件约定的 vxe 全局默认配置 */
8
+ export declare const WTABLE_VXE_DEFAULT_CONFIG: WTableVxeDefaultConfig;
@@ -0,0 +1,6 @@
1
+ export declare function warnDeprecated(oldKey: string, newPath: string): void;
2
+ export declare function warnDeprecatedSlot(oldName: string, newName: string): void;
3
+ export declare function warnPropConflict(key: string, namespace: 'toolbar' | 'pager'): void;
4
+ export declare function warnShowToolbarConflict(): void;
5
+ /** toolbar slot 与显式关闭工具栏冲突时,以 slot 为准 */
6
+ export declare function warnToolbarSlotConflict(source: 'showToolbar' | 'toolbar.hideToolbar'): void;
@@ -0,0 +1,27 @@
1
+ import type { LayoutHeaderProps } from './components/layout';
2
+ export interface Config extends LayoutHeaderProps {
3
+ exportPagePath?: string;
4
+ logo?: string;
5
+ favicon?: string;
6
+ }
7
+ declare const config: {
8
+ exportPagePath?: string | undefined;
9
+ logo?: string | undefined;
10
+ favicon?: string | undefined;
11
+ systemName?: string | undefined;
12
+ userOption?: {
13
+ key: string;
14
+ icon: string;
15
+ label: string;
16
+ href?: string | undefined;
17
+ click?: (() => void) | undefined;
18
+ }[] | undefined;
19
+ showWarehouse?: boolean | undefined;
20
+ showDownload?: boolean | undefined;
21
+ downloadConfig?: {
22
+ getFileUrl?: string | undefined;
23
+ pageUrl?: string | undefined;
24
+ } | undefined;
25
+ };
26
+ export declare function setConfig(options: Config): void;
27
+ export default config;
@@ -0,0 +1,4 @@
1
+ import { type App, type Directive } from 'vue';
2
+ declare const authDirective: Directive;
3
+ export declare const setupAuthDirective: (app: App<Element>) => void;
4
+ export default authDirective;
@@ -0,0 +1,4 @@
1
+ import type { App, Directive } from 'vue';
2
+ declare const authsDirective: Directive;
3
+ export declare const setupAuthsDirective: (app: App<Element>) => void;
4
+ export default authsDirective;
@@ -0,0 +1,6 @@
1
+ import type { App } from 'vue';
2
+ /**
3
+ * 导出指令:v-xxx
4
+ * @methods auth 按钮权限,用法: v-auth
5
+ */
6
+ export declare const setupDirective: (app: App<Element>) => void;
@@ -0,0 +1,4 @@
1
+ export type { DictNameType, DictBasicNameType } from './useDict';
2
+ export * from './src';
3
+ export { default as useDict } from './useDict';
4
+ export { default as useBusinessDict } from './useBusinessDict';
@@ -0,0 +1,4 @@
1
+ export { default as useWarehouseZoneDict } from './useWarehouseZoneDict';
2
+ export { default as useCountryDict } from './useCountryDict';
3
+ export { default as useCustomerDict } from './useCustomerDict';
4
+ export { default as useCurrencyDict } from './useCurrencyDict';
@@ -0,0 +1,22 @@
1
+ import type { ExtendedSuffix } from '../../../type';
2
+ type IdType = ExtendedSuffix<'country'>;
3
+ export default function useCountryDict(id?: IdType): {
4
+ dict: {
5
+ [x: string]: any;
6
+ key: import("../../../type").KeyType;
7
+ value: import("../../../type").KeyType;
8
+ label: string;
9
+ disabled?: boolean | undefined;
10
+ }[];
11
+ getDict: () => Promise<import("../../../type").OptionType[]>;
12
+ getLabelByCode: (code: string) => string;
13
+ getItemByCode: (code: string) => {
14
+ [x: string]: any;
15
+ key: import("../../../type").KeyType;
16
+ value: import("../../../type").KeyType;
17
+ label: string;
18
+ disabled?: boolean | undefined;
19
+ } | undefined;
20
+ clearDict: (option?: boolean | import("../../../type").ClearDictOption | undefined) => void;
21
+ };
22
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { ExtendedSuffix } from '../../../type';
2
+ type IdType = ExtendedSuffix<'currency'>;
3
+ export default function useCurrencyDict(id?: IdType): {
4
+ dict: {
5
+ [x: string]: any;
6
+ key: import("../../../type").KeyType;
7
+ value: import("../../../type").KeyType;
8
+ label: string;
9
+ disabled?: boolean | undefined;
10
+ }[];
11
+ getDict: () => Promise<import("../../../type").OptionType[]>;
12
+ getLabelByCode: (code: string) => string;
13
+ getItemByCode: (code: string) => {
14
+ [x: string]: any;
15
+ key: import("../../../type").KeyType;
16
+ value: import("../../../type").KeyType;
17
+ label: string;
18
+ disabled?: boolean | undefined;
19
+ } | undefined;
20
+ clearDict: (option?: boolean | import("../../../type").ClearDictOption | undefined) => void;
21
+ };
22
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { ExtendedSuffix } from '../../../type';
2
+ type IdType = ExtendedSuffix<'customer'>;
3
+ export default function useCustomerDict(id?: IdType): {
4
+ dict: {
5
+ [x: string]: any;
6
+ key: import("../../../type").KeyType;
7
+ value: import("../../../type").KeyType;
8
+ label: string;
9
+ disabled?: boolean | undefined;
10
+ }[];
11
+ getDict: () => Promise<import("../../../type").OptionType[]>;
12
+ getLabelByCode: (code: string) => string;
13
+ getItemByCode: (code: string) => {
14
+ [x: string]: any;
15
+ key: import("../../../type").KeyType;
16
+ value: import("../../../type").KeyType;
17
+ label: string;
18
+ disabled?: boolean | undefined;
19
+ } | undefined;
20
+ clearDict: (option?: boolean | import("../../../type").ClearDictOption | undefined) => void;
21
+ };
22
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { ExtendedSuffix } from '../../../type';
2
+ type IdType = ExtendedSuffix<'warehouseZone'>;
3
+ export default function useWarehouseZoneDict(id?: IdType): {
4
+ dict: {
5
+ [x: string]: any;
6
+ key: import("../../../type").KeyType;
7
+ value: import("../../../type").KeyType;
8
+ label: string;
9
+ disabled?: boolean | undefined;
10
+ }[];
11
+ getDict: () => Promise<import("../../../type").OptionType[]>;
12
+ getLabelByCode: (code: string) => string;
13
+ getItemByCode: (code: string) => {
14
+ [x: string]: any;
15
+ key: import("../../../type").KeyType;
16
+ value: import("../../../type").KeyType;
17
+ label: string;
18
+ disabled?: boolean | undefined;
19
+ } | undefined;
20
+ clearDict: (option?: boolean | import("../../../type").ClearDictOption | undefined) => void;
21
+ };
22
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { DictBasicNameType } from '.';
2
+ export default function useBusinessDict(name: DictBasicNameType): any;
@@ -0,0 +1,25 @@
1
+ import type { ClearDictOption, ExtendedSuffix, OptionType } from '../../type';
2
+ export type DictBasicNameType = 'warehouseZone' | 'country' | 'customer' | 'currency';
3
+ export type DictNameType = `private_${string}` | ExtendedSuffix<DictBasicNameType>;
4
+ export type DictOptionType = {
5
+ request: () => Promise<OptionType[]>;
6
+ };
7
+ export default function useDict(name: DictNameType, option: DictOptionType): {
8
+ dict: {
9
+ [x: string]: any;
10
+ key: import("../../type").KeyType;
11
+ value: import("../../type").KeyType;
12
+ label: string;
13
+ disabled?: boolean | undefined;
14
+ }[];
15
+ getDict: () => Promise<OptionType[]>;
16
+ getLabelByCode: (code: string) => string;
17
+ getItemByCode: (code: string) => {
18
+ [x: string]: any;
19
+ key: import("../../type").KeyType;
20
+ value: import("../../type").KeyType;
21
+ label: string;
22
+ disabled?: boolean | undefined;
23
+ } | undefined;
24
+ clearDict: (option?: ClearDictOption | boolean) => void;
25
+ };
@@ -0,0 +1,2 @@
1
+ export * from './web';
2
+ export * from './business';
@@ -0,0 +1,2 @@
1
+ export { default as useRenderCell, toFormatCellOptions, resolveLegacyEnumMap, type RenderCellProps, type RenderCellFormatByType, type RenderCellFormatType, type RenderCellLegacyProps } from './src/useRenderCell';
2
+ export { default as useKey } from './src/useKey';
@@ -0,0 +1 @@
1
+ export default function useKey(defaultValue?: string): string;
@@ -0,0 +1,71 @@
1
+ import { type DictBasicNameType } from '../../business';
2
+ import type { OptionType } from '../../../type';
3
+ import { type FormatCellBooleanOptions, type FormatCellEnumMap, type FormatCellEnumOptionsExtension, type FormatCellI18nOptions, type FormatCellNumberOptions, type FormatCellOptions, type FormatCellPercentOptions, type FormatCellTemporalOptions } from '../../../utils/formatCellValue';
4
+ type TemporalExtra = Pick<FormatCellTemporalOptions, 'format' | 'timeZone'>;
5
+ type FieldPath = string | number | string[] | number[];
6
+ /** 与 {@link FormatCellOptions} 对齐的按 `type` 区分的格式化 props */
7
+ export type RenderCellFormatByType = {
8
+ type?: 'raw';
9
+ } | ({
10
+ type: 'date';
11
+ } & TemporalExtra) | ({
12
+ type: 'time';
13
+ } & TemporalExtra) | ({
14
+ type: 'datetime';
15
+ } & TemporalExtra) | ({
16
+ type: 'number';
17
+ } & Pick<FormatCellNumberOptions, 'precision'>) | ({
18
+ type: 'percent';
19
+ } & Pick<FormatCellPercentOptions, 'valueScale'>) | ({
20
+ type: 'boolean';
21
+ } & Pick<FormatCellBooleanOptions, 'trueText' | 'falseText'>) | ({
22
+ type: 'enum';
23
+ } & FormatCellEnumOptionsExtension & {
24
+ name?: string;
25
+ map?: FormatCellEnumMap;
26
+ }) | ({
27
+ type: 'i18n';
28
+ } & Pick<FormatCellI18nOptions, 'values'>)
29
+ /** @deprecated 请改用 `type: 'number'` 且 `precision: 2` */
30
+ | {
31
+ type: 'amount';
32
+ };
33
+ /** @deprecated 旧版平铺 props,由 {@link toFormatCellOptions} 自动映射 */
34
+ export type RenderCellLegacyProps = {
35
+ /** @deprecated 请改用 `format` */
36
+ dateFormat?: string;
37
+ enum?: OptionType[] | Record<string, string> | string;
38
+ options?: OptionType[];
39
+ enumFieldNames?: {
40
+ label?: string;
41
+ value?: string;
42
+ };
43
+ fieldNames?: {
44
+ label?: string;
45
+ value?: string;
46
+ };
47
+ dictName?: DictBasicNameType;
48
+ /** @deprecated 请配合 `type: 'number'` 使用 */
49
+ precision?: number;
50
+ };
51
+ export type RenderCellFormatType = NonNullable<RenderCellFormatByType['type']>;
52
+ export type RenderCellProps = {
53
+ field?: FieldPath;
54
+ } & RenderCellFormatByType & Partial<RenderCellLegacyProps>;
55
+ export declare function resolveLegacyEnumMap(props: RenderCellProps, context: {
56
+ translate: (key: string) => string;
57
+ dictOptions?: OptionType[];
58
+ labelKey: string;
59
+ valueKey: string;
60
+ }): FormatCellEnumMap | undefined;
61
+ export declare function toFormatCellOptions(props: RenderCellProps, context?: {
62
+ enumMap?: FormatCellEnumMap;
63
+ translate?: (key: string) => string;
64
+ dictOptions?: OptionType[];
65
+ labelKey?: string;
66
+ valueKey?: string;
67
+ }): FormatCellOptions;
68
+ export default function useRenderCell(props: RenderCellProps): {
69
+ getRenderValue: (row?: Record<string, unknown>) => string | undefined;
70
+ };
71
+ export {};
@@ -0,0 +1,17 @@
1
+ export { default as useCatchPreloadError } from './src/useCatchPreloadError';
2
+ export { default as useCookie } from './src/useCookie';
3
+ export { default as useEnum } from './src/useEnum';
4
+ export { default as useExport } from './src/useExport';
5
+ export * from './src/useI18n';
6
+ export { default as useFormItemProps } from './src/useFormItemProps';
7
+ export { default as useFormStorage } from './src/useFormStorage';
8
+ export { default as useListConfig } from './src/useListConfig';
9
+ export { default as useLocale } from './src/useLocale';
10
+ export { default as useNProgress } from './src/useNProgress';
11
+ export { default as usePageForm } from './src/usePageForm';
12
+ export { default as usePrefixTitle } from './src/usePrefixTitle';
13
+ export { default as useTabsNav } from './src/useTabsNav';
14
+ export { default as useUpload } from './src/useUpload';
15
+ export { default as useWatchForm, type UseWatchFormType } from './src/useWatchForm';
16
+ export { default as useWindowSize } from './src/useWindowSize';
17
+ export { default as useEmitBack } from './src/useEmitBack';
@@ -0,0 +1,19 @@
1
+ type AffixOptions = {
2
+ /**
3
+ * 偏移量
4
+ * @default 0
5
+ */
6
+ offset?: number;
7
+ /**
8
+ * 滚动方向
9
+ * @default top
10
+ */
11
+ direction?: 'top' | 'bottom';
12
+ /**
13
+ * 滚动容器
14
+ * @default document.body
15
+ */
16
+ container?: () => HTMLElement;
17
+ };
18
+ export default function useAffix(target: () => HTMLElement, options?: AffixOptions): {};
19
+ export {};
@@ -0,0 +1,6 @@
1
+ type ErrorHandler = (event: Event) => void;
2
+ export default function useCatchPreloadError(handler?: ErrorHandler): {
3
+ catchPreloadError: () => void;
4
+ removeCatchPreloadError: () => void;
5
+ };
6
+ export {};
@@ -0,0 +1,11 @@
1
+ declare function getCookie(key: string): string;
2
+ declare function setCookie(key: string, value: string, options?: any): import("xe-utils").XECookie;
3
+ declare function removeCookie(key: string): number;
4
+ declare function getCookieAll(): import("xe-utils").XECookie;
5
+ export default function (): {
6
+ getCookie: typeof getCookie;
7
+ setCookie: typeof setCookie;
8
+ removeCookie: typeof removeCookie;
9
+ getCookieAll: typeof getCookieAll;
10
+ };
11
+ export {};
@@ -0,0 +1,3 @@
1
+ export default function useEmitBack(eventName?: string): {
2
+ handleBack: (reload?: boolean) => void;
3
+ };
@@ -0,0 +1,24 @@
1
+ import type { OptionType } from '../../../type';
2
+ type CommonType = {
3
+ [key: string]: {
4
+ [key: string]: string;
5
+ };
6
+ };
7
+ type EnumType<T extends CommonType, K> = {
8
+ COMMON: T;
9
+ OPTION: K;
10
+ };
11
+ export declare const COMMON: {};
12
+ export declare const OPTION: {};
13
+ export default function useEnum<T extends CommonType, K>(options: EnumType<T, K>): {
14
+ enums: T;
15
+ enumMap: Map<keyof T, OptionType[]>;
16
+ getEnum: <T_1 extends keyof T, K_1 extends keyof T[T_1]>(name: T_1, keyTypeTransform?: "number" | "boolean" | "boolean2number" | "original") => {
17
+ key: keyof T[T_1];
18
+ value: keyof T[T_1];
19
+ label: string | T[T_1][K_1];
20
+ }[];
21
+ getEnumLable: <T_2 extends keyof T, K_2 extends keyof T[T_2]>(name: T_2, key: K_2) => string | K_2 | T[T_2][K_2];
22
+ getOption: (name: keyof K) => K[keyof K];
23
+ };
24
+ export {};
@@ -0,0 +1,4 @@
1
+ export default function useExport(): {
2
+ exportXls: (url: string, parames?: any, fileName?: string) => Promise<void>;
3
+ downloadFile: (url: string, fileName?: string) => void;
4
+ };
@@ -0,0 +1,22 @@
1
+ import { type ComputedRef } from 'vue';
2
+ import type { FormItemProps } from 'ant-design-vue';
3
+ import type { FormItemXxProps } from '../../../components';
4
+ type PropsType = Partial<Pick<FormItemXxProps, 'form' | 'label' | 'isDetails' | 'disabled' | 'placeholder'>>;
5
+ type FormItemSlotsKeyType = keyof Pick<FormItemProps, 'label' | 'help' | 'extra'>;
6
+ type AttrMapType = {
7
+ formItem: Partial<FormItemProps>;
8
+ default: any;
9
+ };
10
+ type SlotMapType = {
11
+ formItem: Partial<Pick<FormItemProps, FormItemSlotsKeyType>>;
12
+ default: any;
13
+ };
14
+ declare function useFormItemProps(props: PropsType): {
15
+ attrMap: ComputedRef<AttrMapType>;
16
+ slotMap: ComputedRef<SlotMapType>;
17
+ form: ComputedRef<any>;
18
+ label: ComputedRef<string>;
19
+ disabled: ComputedRef<boolean>;
20
+ placeholder: ComputedRef<string>;
21
+ };
22
+ export default useFormItemProps;
@@ -0,0 +1,18 @@
1
+ import type { FormProps } from 'ant-design-vue';
2
+ import { type Ref } from 'vue';
3
+ export default function useFormStorage<T = any>(): {
4
+ useProvideData: (data: Ref<T>) => void;
5
+ useInjectData: (defaultValue?: Ref<T>) => Ref<T> | undefined;
6
+ useProvideDisabled: (disabled: Ref<boolean>) => void;
7
+ useInjectDisabled: (defaultValue?: boolean) => Ref<boolean>;
8
+ useProvideColumn: (column: Ref<number | undefined>) => void;
9
+ useInjectColumn: (defaultValue?: number) => Ref<number | undefined>;
10
+ useProvideLabelCol: (col: Ref<FormProps['labelCol']>) => void;
11
+ useInjectLabelCol: (defaultValue?: Ref<FormProps['labelCol']>) => Ref<FormProps['labelCol']> | undefined;
12
+ useProvideWrapperCol: (col: Ref<FormProps['wrapperCol']>) => void;
13
+ useInjectWrapperCol: (defaultValue?: Ref<FormProps['wrapperCol']>) => Ref<FormProps['wrapperCol']> | undefined;
14
+ useProvideDetailsLoading: (loading: Ref<boolean>) => void;
15
+ useInjectDetailsLoading: (defaultValue?: boolean) => Ref<boolean>;
16
+ useProvideCard: (loading: Ref<boolean>) => void;
17
+ useInjectCard: (defaultValue?: boolean) => Ref<boolean>;
18
+ };