g-ui-web 1.4.21 → 1.4.23

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 (241) hide show
  1. package/lib/bar/index.d.ts +16 -0
  2. package/lib/bar/src/chart.d.ts +2 -0
  3. package/lib/bar/src/index.vue.d.ts +26 -0
  4. package/lib/bar/src/options.d.ts +33 -0
  5. package/lib/bar-compare/index.d.ts +14 -0
  6. package/lib/bar-compare/src/chart.d.ts +2 -0
  7. package/lib/bar-compare/src/index.vue.d.ts +24 -0
  8. package/lib/bar-compare/src/options.d.ts +74 -0
  9. package/lib/bar-conv/index.d.ts +14 -0
  10. package/lib/bar-conv/src/index.vue.d.ts +22 -0
  11. package/lib/bar-line/index.d.ts +14 -0
  12. package/lib/bar-line/src/chart.d.ts +2 -0
  13. package/lib/bar-line/src/index.vue.d.ts +22 -0
  14. package/lib/bar-line/src/options.d.ts +57 -0
  15. package/lib/box/index.d.ts +331 -0
  16. package/lib/box/src/index.vue.d.ts +203 -0
  17. package/lib/calendar/index.d.ts +208 -0
  18. package/lib/calendar/src/index.vue.d.ts +793 -0
  19. package/lib/cashflow/index.d.ts +18 -0
  20. package/lib/cashflow/src/cash-flow-curve.d.ts +1 -0
  21. package/lib/cashflow/src/cash-line.d.ts +1 -0
  22. package/lib/cashflow/src/index.vue.d.ts +26 -0
  23. package/lib/cashflow/src/time-formatter.d.ts +2 -0
  24. package/lib/chart/index.d.ts +24 -0
  25. package/lib/chart/src/index.vue.d.ts +60 -0
  26. package/lib/compo-picker/index.d.ts +54 -0
  27. package/lib/compo-picker/src/index.vue.d.ts +24 -0
  28. package/lib/datafill/index.d.ts +2 -0
  29. package/lib/datatable/index.d.ts +111 -0
  30. package/lib/datatable/src/index.vue.d.ts +72 -0
  31. package/lib/dynamic-target/index.d.ts +101 -0
  32. package/lib/dynamic-target/src/index.vue.d.ts +52 -0
  33. package/lib/ele/button/index.d.ts +18 -0
  34. package/lib/ele/button/src/index.vue.d.ts +16 -0
  35. package/lib/ele/button-group/index.d.ts +18 -0
  36. package/lib/ele/button-group/src/index.vue.d.ts +16 -0
  37. package/lib/ele/card/index.d.ts +16 -0
  38. package/lib/ele/card/src/index.vue.d.ts +14 -0
  39. package/lib/ele/carousel/index.d.ts +18 -0
  40. package/lib/ele/carousel/src/index.vue.d.ts +16 -0
  41. package/lib/ele/carousel-item/index.d.ts +18 -0
  42. package/lib/ele/carousel-item/src/index.vue.d.ts +16 -0
  43. package/lib/ele/cascader/index.d.ts +14 -0
  44. package/lib/ele/cascader/src/index.vue.d.ts +2 -0
  45. package/lib/ele/cascader-panel/index.d.ts +14 -0
  46. package/lib/ele/cascader-panel/src/index.vue.d.ts +2 -0
  47. package/lib/ele/check-tag/index.d.ts +18 -0
  48. package/lib/ele/check-tag/src/index.vue.d.ts +16 -0
  49. package/lib/ele/checkbox/index.d.ts +16 -0
  50. package/lib/ele/checkbox/src/index.vue.d.ts +14 -0
  51. package/lib/ele/checkbox-button/index.d.ts +18 -0
  52. package/lib/ele/checkbox-button/src/index.vue.d.ts +16 -0
  53. package/lib/ele/checkbox-group/index.d.ts +18 -0
  54. package/lib/ele/checkbox-group/src/index.vue.d.ts +16 -0
  55. package/lib/ele/col/index.d.ts +18 -0
  56. package/lib/ele/col/src/index.vue.d.ts +16 -0
  57. package/lib/ele/collapse/index.d.ts +16 -0
  58. package/lib/ele/collapse/src/index.vue.d.ts +14 -0
  59. package/lib/ele/collapse-item/index.d.ts +19 -0
  60. package/lib/ele/collapse-item/src/index.vue.d.ts +17 -0
  61. package/lib/ele/date-picker/index.d.ts +18 -0
  62. package/lib/ele/date-picker/src/index.vue.d.ts +16 -0
  63. package/lib/ele/dialog/index.d.ts +16 -0
  64. package/lib/ele/dialog/src/index.vue.d.ts +14 -0
  65. package/lib/ele/drawer/index.d.ts +16 -0
  66. package/lib/ele/drawer/src/index.vue.d.ts +14 -0
  67. package/lib/ele/form/index.d.ts +18 -0
  68. package/lib/ele/form/src/index.vue.d.ts +16 -0
  69. package/lib/ele/form-item/index.d.ts +18 -0
  70. package/lib/ele/form-item/src/index.vue.d.ts +16 -0
  71. package/lib/ele/input/index.d.ts +16 -0
  72. package/lib/ele/input/src/index.vue.d.ts +14 -0
  73. package/lib/ele/menu/index.d.ts +16 -0
  74. package/lib/ele/menu/src/index.vue.d.ts +14 -0
  75. package/lib/ele/menu-item/index.d.ts +18 -0
  76. package/lib/ele/menu-item/src/index.vue.d.ts +16 -0
  77. package/lib/ele/menu-item-group/index.d.ts +16 -0
  78. package/lib/ele/menu-item-group/src/index.vue.d.ts +14 -0
  79. package/lib/ele/option/index.d.ts +69 -0
  80. package/lib/ele/option/src/index.vue.d.ts +46 -0
  81. package/lib/ele/option-group/index.d.ts +18 -0
  82. package/lib/ele/option-group/src/index.vue.d.ts +16 -0
  83. package/lib/ele/pagination/index.d.ts +18 -0
  84. package/lib/ele/pagination/src/index.vue.d.ts +16 -0
  85. package/lib/ele/popover/index.d.ts +16 -0
  86. package/lib/ele/popover/src/index.vue.d.ts +14 -0
  87. package/lib/ele/progress/index.d.ts +16 -0
  88. package/lib/ele/progress/src/index.vue.d.ts +14 -0
  89. package/lib/ele/radio/index.d.ts +16 -0
  90. package/lib/ele/radio/src/index.vue.d.ts +14 -0
  91. package/lib/ele/radio-button/index.d.ts +18 -0
  92. package/lib/ele/radio-button/src/index.vue.d.ts +16 -0
  93. package/lib/ele/radio-group/index.d.ts +18 -0
  94. package/lib/ele/radio-group/src/index.vue.d.ts +16 -0
  95. package/lib/ele/row/index.d.ts +18 -0
  96. package/lib/ele/row/src/index.vue.d.ts +16 -0
  97. package/lib/ele/select/index.d.ts +18 -0
  98. package/lib/ele/select/src/index.vue.d.ts +16 -0
  99. package/lib/ele/sub-menu/index.d.ts +18 -0
  100. package/lib/ele/sub-menu/src/index.vue.d.ts +16 -0
  101. package/lib/ele/switch/index.d.ts +16 -0
  102. package/lib/ele/switch/src/index.vue.d.ts +14 -0
  103. package/lib/ele/tab-pane/index.d.ts +19 -0
  104. package/lib/ele/tab-pane/src/index.vue.d.ts +17 -0
  105. package/lib/ele/table/index.d.ts +89 -0
  106. package/lib/ele/table-column/index.d.ts +16 -0
  107. package/lib/ele/table-column/src/index.vue.d.ts +14 -0
  108. package/lib/ele/tabs/index.d.ts +18 -0
  109. package/lib/ele/tabs/src/index.vue.d.ts +16 -0
  110. package/lib/ele/tag/index.d.ts +18 -0
  111. package/lib/ele/tag/src/index.vue.d.ts +16 -0
  112. package/lib/ele/tooltip/index.d.ts +16 -0
  113. package/lib/ele/tooltip/src/index.vue.d.ts +14 -0
  114. package/lib/ele/tree-select/index.d.ts +16 -0
  115. package/lib/ele/tree-select/src/index.vue.d.ts +14 -0
  116. package/lib/ele/upload/index.d.ts +16 -0
  117. package/lib/ele/upload/src/index.vue.d.ts +14 -0
  118. package/lib/ele/watermark/index.d.ts +18 -0
  119. package/lib/ele/watermark/src/index.vue.d.ts +16 -0
  120. package/lib/favicon.ico +0 -0
  121. package/lib/floating-ai/index.d.ts +104 -0
  122. package/lib/floating-ai/src/index.vue.d.ts +53 -0
  123. package/lib/fonts/bb3347.ttf +0 -0
  124. package/lib/fonts/font.css +6 -0
  125. package/lib/funnel/index.d.ts +16 -0
  126. package/lib/funnel/src/chart.d.ts +4 -0
  127. package/lib/funnel/src/index.vue.d.ts +32 -0
  128. package/lib/funnel/src/options.d.ts +77 -0
  129. package/lib/g-ui-web.cjs +131 -0
  130. package/lib/g-ui-web.iife.js +131 -0
  131. package/lib/g-ui-web.iife.js.gz +0 -0
  132. package/lib/g-ui-web.js +118260 -0
  133. package/lib/g-ui-web.js.gz +0 -0
  134. package/lib/g-ui-web.umd.cjs +131 -0
  135. package/lib/gauge/index.d.ts +14 -0
  136. package/lib/gauge/src/chart.d.ts +4 -0
  137. package/lib/gauge/src/index.vue.d.ts +22 -0
  138. package/lib/gauge/src/options.d.ts +45 -0
  139. package/lib/heatmap/src/index.vue.d.ts +169 -0
  140. package/lib/line/index.d.ts +16 -0
  141. package/lib/line/src/chart.d.ts +2 -0
  142. package/lib/line/src/index.vue.d.ts +24 -0
  143. package/lib/line/src/options.d.ts +59 -0
  144. package/lib/map/index.d.ts +14 -0
  145. package/lib/map/src/chart.d.ts +2 -0
  146. package/lib/map/src/index.vue.d.ts +22 -0
  147. package/lib/map/src/options.d.ts +21 -0
  148. package/lib/multiple-dimension-table/index.d.ts +2 -0
  149. package/lib/multiple-dimension-table/src/index.vue.d.ts +154 -0
  150. package/lib/node-achievement/index.d.ts +80 -0
  151. package/lib/node-achievement/src/index.vue.d.ts +53 -0
  152. package/lib/pie/index.d.ts +17 -0
  153. package/lib/pie/src/chart.d.ts +2 -0
  154. package/lib/pie/src/index.vue.d.ts +29 -0
  155. package/lib/pie/src/options.d.ts +30 -0
  156. package/lib/pie-distri/index.d.ts +16 -0
  157. package/lib/pie-distri/src/chart.d.ts +2 -0
  158. package/lib/pie-distri/src/index.vue.d.ts +32 -0
  159. package/lib/pie-distri/src/options.d.ts +82 -0
  160. package/lib/pie-level/index.d.ts +16 -0
  161. package/lib/pie-level/src/chart.d.ts +12 -0
  162. package/lib/pie-level/src/index.vue.d.ts +36 -0
  163. package/lib/pie-level/src/options.d.ts +34 -0
  164. package/lib/pie-table/index.d.ts +146 -0
  165. package/lib/pie-table/src/chart.d.ts +2 -0
  166. package/lib/pie-table/src/index.vue.d.ts +87 -0
  167. package/lib/pie-table/src/options.d.ts +13 -0
  168. package/lib/plan/index.d.ts +21 -0
  169. package/lib/plan/src/index.vue.d.ts +46 -0
  170. package/lib/radar/index.d.ts +14 -0
  171. package/lib/radar/src/chart.d.ts +2 -0
  172. package/lib/radar/src/index.vue.d.ts +22 -0
  173. package/lib/radar/src/options.d.ts +41 -0
  174. package/lib/ranking-cup/index.d.ts +192 -0
  175. package/lib/ranking-cup/src/index.vue.d.ts +109 -0
  176. package/lib/ranking-list/index.d.ts +188 -0
  177. package/lib/ranking-list/src/index.vue.d.ts +113 -0
  178. package/lib/ranking-rb/index.d.ts +180 -0
  179. package/lib/ranking-rb/src/index.vue.d.ts +105 -0
  180. package/lib/ranking-table/index.d.ts +168 -0
  181. package/lib/ranking-table/src/index.vue.d.ts +101 -0
  182. package/lib/reserve/index.d.ts +18 -0
  183. package/lib/reserve/src/index.vue.d.ts +26 -0
  184. package/lib/scatter/index.d.ts +19 -0
  185. package/lib/scatter/src/chart.d.ts +2 -0
  186. package/lib/scatter/src/index.vue.d.ts +39 -0
  187. package/lib/scatter/src/options.d.ts +77 -0
  188. package/lib/store/index.d.ts +2 -0
  189. package/lib/store/saveInLocal.d.ts +2 -0
  190. package/lib/style.css +1 -0
  191. package/lib/style.css.gz +0 -0
  192. package/lib/submarket-map/index.d.ts +424 -0
  193. package/lib/submarket-map/src/index.vue.d.ts +260 -0
  194. package/lib/target-achievement/index.d.ts +167 -0
  195. package/lib/target-achievement/src/index.vue.d.ts +85 -0
  196. package/lib/target-achievement/src/options.d.ts +68 -0
  197. package/lib/target-complete-rate/index.d.ts +95 -0
  198. package/lib/target-complete-rate/src/index.vue.d.ts +52 -0
  199. package/lib/target-current/index.d.ts +144 -0
  200. package/lib/target-current/src/index.vue.d.ts +75 -0
  201. package/lib/target-deviation/index.d.ts +119 -0
  202. package/lib/target-deviation/src/index.vue.d.ts +62 -0
  203. package/lib/target-gauge/index.d.ts +15 -0
  204. package/lib/target-gauge/src/chart.d.ts +4 -0
  205. package/lib/target-gauge/src/index.vue.d.ts +27 -0
  206. package/lib/target-gauge/src/options.d.ts +56 -0
  207. package/lib/target-m/index.d.ts +189 -0
  208. package/lib/target-m/src/index.vue.d.ts +102 -0
  209. package/lib/target-r/index.d.ts +257 -0
  210. package/lib/target-r/src/index.vue.d.ts +144 -0
  211. package/lib/target-s/index.d.ts +210 -0
  212. package/lib/target-s/src/index.vue.d.ts +113 -0
  213. package/lib/target-struct/index.d.ts +141 -0
  214. package/lib/target-struct/src/index.vue.d.ts +69 -0
  215. package/lib/text-select/index.d.ts +92 -0
  216. package/lib/text-select/src/index.vue.d.ts +14894 -0
  217. package/lib/utils/DataSource/DataProvider.d.ts +186 -0
  218. package/lib/utils/DataSource/debugStore.d.ts +28 -0
  219. package/lib/utils/DataSource/index.d.ts +23 -0
  220. package/lib/utils/DataSource/useDataSource.d.ts +66 -0
  221. package/lib/utils/api/index.d.ts +4 -0
  222. package/lib/utils/api/load.d.ts +4 -0
  223. package/lib/utils/directives/click-outside/index.d.ts +3 -0
  224. package/lib/utils/index.d.ts +57 -0
  225. package/lib/utils/loading/index.d.ts +9 -0
  226. package/lib/utils/request/interface/config.d.ts +93 -0
  227. package/lib/utils/request/interface/index.d.ts +3 -0
  228. package/lib/utils/request/interface/interface.d.ts +3 -0
  229. package/lib/utils/request/utils/code.d.ts +6 -0
  230. package/lib/utils/request/utils/filter.d.ts +2 -0
  231. package/lib/utils/request/utils/loading.d.ts +14 -0
  232. package/lib/utils/storage.d.ts +27 -0
  233. package/lib/utils/theme/config/black-blue.d.ts +130 -0
  234. package/lib/utils/theme/config/black-gold.d.ts +154 -0
  235. package/lib/utils/theme/config/black-green.d.ts +127 -0
  236. package/lib/utils/theme/config/om-blue.d.ts +156 -0
  237. package/lib/utils/theme/config/white-blue.d.ts +157 -0
  238. package/lib/utils/theme/config/white-green.d.ts +154 -0
  239. package/lib/utils/theme/index.d.ts +4 -0
  240. package/lib/withInstall.d.ts +4 -0
  241. package/package.json +1 -1
@@ -0,0 +1,186 @@
1
+ import { Ref } from 'vue';
2
+ import { AxiosRequestConfig } from 'axios';
3
+ /** 数据源类型 */
4
+ type DataSourceType = 'static' | 'api';
5
+ /** 加载状态 */
6
+ type LoadingStatus = 'idle' | 'loading' | 'success' | 'error';
7
+ /** 单个数据源配置 */
8
+ interface DataSourceConfig<T = any> {
9
+ /** 数据源唯一标识 */
10
+ key: string;
11
+ /** 数据源类型 */
12
+ type: DataSourceType;
13
+ /** 静态数据(type 为 static 时使用) */
14
+ data?: T;
15
+ /** API 请求配置(type 为 api 时使用) */
16
+ api?: {
17
+ url: string;
18
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
19
+ params?: Record<string, any>;
20
+ data?: Record<string, any>;
21
+ headers?: Record<string, string>;
22
+ /** 响应数据字段路径,如 '/artists' 或 'data.items' */
23
+ fieldPath?: string;
24
+ /** 响应数据转换函数 */
25
+ transform?: (response: any) => T;
26
+ };
27
+ }
28
+ /** 数据源状态 */
29
+ interface DataSourceState<T = any> {
30
+ data: T | null;
31
+ status: LoadingStatus;
32
+ error: Error | null;
33
+ lastUpdated: Date | null;
34
+ }
35
+ /** 融合数据转换函数参数 */
36
+ type MergeDataMap = Record<string, any>;
37
+ /** DataSource 构造配置 */
38
+ interface DataSourceOptions {
39
+ /** 是否立即加载 */
40
+ autoLoad?: boolean;
41
+ /** 请求失败重试次数 */
42
+ retryCount?: number;
43
+ /** 重试延迟(毫秒) */
44
+ retryDelay?: number;
45
+ /** 全局请求拦截器 */
46
+ onRequest?: (config: AxiosRequestConfig) => AxiosRequestConfig;
47
+ /** 全局响应拦截器 */
48
+ onResponse?: (response: any) => any;
49
+ /** 全局错误处理 */
50
+ onError?: (error: Error, key: string) => void;
51
+ /** 融合数据的转换函数,参数为 { key: data } 形式的对象,配置后自动融合所有数据源 */
52
+ mergeTransformer?: (dataMap: MergeDataMap) => any[];
53
+ }
54
+ /** 数据更新监听器 */
55
+ type DataUpdateListener<T = any> = (key: string, data: T, state: DataSourceState<T>) => void;
56
+ declare class DataSource {
57
+ /** 数据源配置映射 */
58
+ private _configMap;
59
+ /** 数据源状态映射 */
60
+ private _stateMap;
61
+ /** 配置选项 */
62
+ private _options;
63
+ /** 数据更新监听器列表 */
64
+ private _listeners;
65
+ /** 响应式状态(用于 Vue 响应式更新) */
66
+ reactiveStates: Record<string, DataSourceState>;
67
+ /** 全局加载状态 */
68
+ isLoading: Ref<boolean>;
69
+ /** 全局错误状态 */
70
+ hasError: Ref<boolean>;
71
+ /** 调试模式 */
72
+ debugMode: boolean;
73
+ constructor(sources: any, options?: DataSourceOptions);
74
+ /**
75
+ * 添加数据源
76
+ */
77
+ addSource<T>(config: DataSourceConfig<T>): void;
78
+ /**
79
+ * 移除数据源
80
+ */
81
+ removeSource(key: string): boolean;
82
+ /**
83
+ * 加载单个数据源
84
+ */
85
+ private loadSingle;
86
+ /**
87
+ * 从对象中按路径获取值
88
+ * 支持两种路径格式:
89
+ * - 点分隔:'data.users'
90
+ * - 斜杠分隔:'/data/users' 或 'data/users'
91
+ */
92
+ private pickPath;
93
+ /**
94
+ * 带重试的请求
95
+ */
96
+ private fetchWithRetry;
97
+ /**
98
+ * 延迟函数
99
+ */
100
+ private delay;
101
+ /**
102
+ * 更新状态
103
+ */
104
+ private updateState;
105
+ /**
106
+ * 更新全局状态
107
+ */
108
+ private updateGlobalStatus;
109
+ /**
110
+ * 通知所有监听器
111
+ */
112
+ private notifyListeners;
113
+ private normalizeMethod;
114
+ private isOldDataSource;
115
+ /**
116
+ * 清理配置,将旧版格式(path + resPath)转换为新版 DataSourceConfig
117
+ * - 支持新版 fieldPath
118
+ * - 兼容旧版 resPath,将其转换为 fieldPath
119
+ */
120
+ private cleanConfig;
121
+ /**
122
+ * 加载数据(支持加载全部或指定的数据源)
123
+ * 返回融合后的数组数据
124
+ */
125
+ loadData(keys?: string | string[]): Promise<any[]>;
126
+ /**
127
+ * 刷新数据(参数变更时重新请求,或手动更新数据)
128
+ * @param key 数据源标识
129
+ * @param paramsOrData 请求参数或直接更新的数据
130
+ * @param manual 是否手动更新本地数据(true: 直接更新本地数据,false: 从数据源加载)
131
+ */
132
+ refreshData<T = any>(key: string, paramsOrData?: Record<string, any> | T, manual?: boolean): Promise<T>;
133
+ /**
134
+ * 刷新所有数据源
135
+ * 返回融合后的数组数据
136
+ */
137
+ refreshAll(params?: Record<string, Record<string, any>>): Promise<any[]>;
138
+ /**
139
+ * 获取数据
140
+ */
141
+ getData<T = any>(key: string): T | null;
142
+ /**
143
+ * 获取所有数据
144
+ */
145
+ getAllData(): Record<string, any>;
146
+ /**
147
+ * 获取状态
148
+ */
149
+ getState(key: string): DataSourceState | undefined;
150
+ /**
151
+ * 获取所有状态
152
+ */
153
+ getAllStates(): Record<string, DataSourceState>;
154
+ /**
155
+ * 获取加载状态
156
+ */
157
+ getLoadingStatus(key: string): LoadingStatus;
158
+ /**
159
+ * 检查是否正在加载
160
+ */
161
+ isSourceLoading(key: string): boolean;
162
+ /**
163
+ * 添加数据更新监听器
164
+ */
165
+ onDataUpdate(listener: DataUpdateListener): () => void;
166
+ /**
167
+ * 融合所有数据源数据
168
+ * @param transformer 可选的转换函数(不传则使用 options 中配置的 mergeTransformer)
169
+ * @returns 融合后的数组数据
170
+ */
171
+ mergeData<T = any>(transformer?: (dataMap: MergeDataMap) => T[]): T[];
172
+ /**
173
+ * 清除所有数据
174
+ */
175
+ clear(): void;
176
+ /**
177
+ * 销毁实例
178
+ */
179
+ destroy(): void;
180
+ /**
181
+ * 旧版本兼容
182
+ */
183
+ reload(key?: any, params?: Record<string, any>): Promise<any>;
184
+ }
185
+ export { DataSource, type DataSourceConfig, type DataSourceState, type DataSourceOptions, type DataSourceType, type LoadingStatus, type DataUpdateListener, };
186
+ export { useDataSource, type UseDataSourceOptions } from './useDataSource';
@@ -0,0 +1,28 @@
1
+ declare const debugStore: {
2
+ markedComponentIds: Set<string> & Omit<Set<string>, keyof Set<any>>;
3
+ };
4
+ /**
5
+ * 标记组件用于调试
6
+ */
7
+ export declare function markComponentForDebug(componentId: string): void;
8
+ /**
9
+ * 取消标记组件
10
+ */
11
+ export declare function unmarkComponentForDebug(componentId: string): void;
12
+ /**
13
+ * 切换组件的调试标记状态
14
+ */
15
+ export declare function toggleComponentDebug(componentId: string): boolean;
16
+ /**
17
+ * 检查组件是否被标记用于调试
18
+ */
19
+ export declare function isComponentMarkedForDebug(componentId: string): boolean;
20
+ /**
21
+ * 获取所有被标记的组件 ID
22
+ */
23
+ export declare function getMarkedComponentIds(): string[];
24
+ /**
25
+ * 清除所有调试标记
26
+ */
27
+ export declare function clearAllDebugMarks(): void;
28
+ export { debugStore };
@@ -0,0 +1,23 @@
1
+ type EventCallback = (data: any) => void;
2
+ export default class DataSource {
3
+ dsKey: string;
4
+ data: any;
5
+ dataUrl: any;
6
+ events: {
7
+ [key: string]: EventCallback[];
8
+ };
9
+ constructor(dataUrl: any);
10
+ loadStaticData(data: any): void;
11
+ load(dataUrl: any): Promise<void>;
12
+ reload(params: any): void;
13
+ on(event: string, callback: EventCallback): void;
14
+ trigger(event: string, data: any): void;
15
+ }
16
+ /**
17
+ *
18
+ * @param data 有 静态形式 包含 array / object;或者dataUrl形式 包含 string / object;或者 DataSource形式
19
+ * @returns
20
+ */
21
+ export declare const resetDataSource: (data: any) => any;
22
+ export declare const checkType: (value: any) => "数组" | "对象" | "字符串" | "其他类型";
23
+ export { toggleComponentDebug, isComponentMarkedForDebug, markComponentForDebug, unmarkComponentForDebug, getMarkedComponentIds, clearAllDebugMarks, debugStore } from './debugStore';
@@ -0,0 +1,66 @@
1
+ import { Ref } from 'vue';
2
+ import { DataSource, DataSourceConfig, DataSourceOptions } from './DataProvider';
3
+ interface UseDataSourceOptions extends DataSourceOptions {
4
+ /** 是否在 onMounted 时自动加载 */
5
+ autoLoad?: boolean;
6
+ /** 监听的参数,参数变化时自动刷新 */
7
+ watchParams?: Ref<Record<string, any>> | (() => Record<string, any>);
8
+ /** 参数变化时刷新的数据源 key */
9
+ watchKeys?: string[];
10
+ }
11
+ declare function useDataSource(sources: DataSourceConfig | DataSourceConfig[] | any, options?: UseDataSourceOptions): {
12
+ /** DataSource 实例 */
13
+ _sourceInstance: DataSource;
14
+ /** 融合后的数组数据 */
15
+ sourceData: import('vue').Reactive<any[]>;
16
+ /** 所有状态 */
17
+ sourceState: Record<string, import('./DataProvider').DataSourceState<any>>;
18
+ /** 全局加载状态 */
19
+ isLoading: Ref<boolean, boolean>;
20
+ /** 全局错误状态 */
21
+ hasError: Ref<boolean, boolean>;
22
+ /** 加载数据 */
23
+ loadData: (keys?: string | string[]) => Promise<any[]>;
24
+ /** 刷新单个数据源 */
25
+ refreshData: (key: string, params?: Record<string, any>) => Promise<Record<string, any> | undefined>;
26
+ /** 兼容旧版 reload 行为 */
27
+ reload: (key?: string, params?: Record<string, any>) => Promise<any[] | Record<string, any> | undefined>;
28
+ /** 刷新所有数据源 */
29
+ refreshAll: (params?: Record<string, Record<string, any>>) => Promise<any[]>;
30
+ /** 更新数据 */
31
+ updateData: <T>(key: string, newData: T) => Promise<T>;
32
+ /** 获取状态 */
33
+ getState: (key: string) => import('./DataProvider').DataSourceState<any>;
34
+ /** 融合数据(调用 DataSource 的 mergeData) */
35
+ mergeData: <T = any>(transformer?: (dataMap: {
36
+ [x: string]: any;
37
+ }) => T[]) => T[];
38
+ /** 添加数据更新监听器 */
39
+ onDataUpdate: (listener: import('./DataProvider').DataUpdateListener) => () => void;
40
+ /** 清除数据 */
41
+ clear: () => void;
42
+ /** 销毁实例 */
43
+ destroy: () => void;
44
+ };
45
+ /**
46
+ * 处理静态数据,将其转换为数组格式
47
+ * @param data 静态数据,可能是数字、字符串、数组或对象
48
+ * @param dataField 如果数据是数字、字符串,指定dataField作为数组元素的键
49
+ * @returns 转换后的数组格式数据
50
+ */
51
+ declare const convertDataToArray: (data: any, dataField?: any) => Promise<any[] | undefined>;
52
+ /**
53
+ * 判断是否是 DataSource 类实例
54
+ */
55
+ declare function isSourceClass(val: any): val is DataSource;
56
+ /**
57
+ * 判断是否是 useDataSource 返回的实例
58
+ */
59
+ declare function isSourceHook(val: any): val is ReturnType<typeof useDataSource>;
60
+ /**
61
+ * 创建调试右键点击处理器
62
+ * @param dbOptions 组件的数据源配置对象
63
+ * @returns 右键点击事件处理器
64
+ */
65
+ declare function createDebugHandler(dbOptions?: any): (e: MouseEvent) => Promise<void>;
66
+ export { useDataSource, isSourceHook, isSourceClass, convertDataToArray, createDebugHandler, type UseDataSourceOptions, };
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ getList(props: any): any;
3
+ };
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export declare const loads: (dataUrl: any) => Promise<{
2
+ resData: any;
3
+ res: any;
4
+ }>;
@@ -0,0 +1,3 @@
1
+ import { ObjectDirective } from 'vue';
2
+ declare const ClickOutside: ObjectDirective;
3
+ export default ClickOutside;
@@ -0,0 +1,57 @@
1
+ type Func = (...args: any[]) => any;
2
+ /**
3
+ * 防抖函数
4
+ * @param { Function } func 函数
5
+ * @param { Number } delay 防抖时间
6
+ * @param { Boolean } immediate 是否立即执行
7
+ * @param { Function } resultCallback
8
+ */
9
+ export declare function debounce(func: Func, delay?: number, immediate?: boolean, resultCallback?: Func): {
10
+ (this: unknown, ...args: any[]): Promise<unknown>;
11
+ cancel(): void;
12
+ };
13
+ /**
14
+ * 节流函数
15
+ * @param { Function } func
16
+ * @param { Boolean } interval
17
+ * @param { Object } options
18
+ * leading:初始 trailing:结尾
19
+ */
20
+ export declare function throttle(func: Func, interval: number, options?: {
21
+ leading: boolean;
22
+ trailing: boolean;
23
+ }): {
24
+ (this: unknown, ...args: any[]): void;
25
+ cancel(): void;
26
+ };
27
+ /**
28
+ * 驼峰转换下划线
29
+ * @param { String } name
30
+ */
31
+ export declare function toLine(name: string): string;
32
+ export declare function formatNumber(value: number | string, precision?: number, separator?: string, decimal?: string, prefix?: string, suffix?: string): string;
33
+ export declare const formatNumberDigit: (num: any, digit: any) => any;
34
+ export declare const formatPercentage: (number: any) => string;
35
+ /**
36
+ * 数据转化
37
+ */
38
+ export declare const getNestedValue: (obj: any, keys: any) => any;
39
+ /**
40
+ * 设置项目配置
41
+ */
42
+ interface configProps {
43
+ baseURL: string;
44
+ sysCode: string;
45
+ appType: string;
46
+ tokenName: string;
47
+ token: string;
48
+ key: string;
49
+ }
50
+ export declare const setAjaxConfig: (config?: configProps) => void;
51
+ export declare const getAjaxConfig: (key?: string) => any;
52
+ export declare const typeofXAxis: (item: any) => "function" | "string" | "number" | "object" | "boolean" | "undefined" | "bigint" | "symbol" | "null";
53
+ export declare const typeIsEmpty: (item: any) => boolean;
54
+ export default class ExportTable {
55
+ constructor(exportConfig: any, searchParam: any[], header: any);
56
+ }
57
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 页面全局 Loading
3
+ * @method start 创建 loading
4
+ * @method done 移除 loading
5
+ */
6
+ export declare const loading: {
7
+ start: (className?: string, size?: string) => void;
8
+ done: (className: any, time?: number) => void;
9
+ };
@@ -0,0 +1,93 @@
1
+ /**
2
+ * 定义一个Ajax请求的配置接口
3
+ * @interface AjaxOptions
4
+ * @property {string} url - 请求的URL地址
5
+ * @property {string} baseURL - 请求的baseURL地址
6
+ * @property {string} [method] - 请求的方法,默认为GET,可选值包括GET, POST, PUT, DELETE等
7
+ * @property {string} [ContentType] - 请求的内容类型,例如 'application/json' 或 'application/x-www-form-urlencoded'
8
+ * @property {any} [params] - 请求的参数,可以是任意类型的对象,通常用于拼接在URL后
9
+ * @property {any} [data] - 请求发送的数据,可以是任意类型的对象
10
+ * @property {number} [timeout] - 请求的超时时间,单位为毫秒
11
+ * @property {boolean} [withCredentials] - 是否携带跨域请求的凭证(cookies)
12
+ * @property {'json' | 'text' | 'blob' | 'arraybuffer' | 'document' | 'stream'} [ResponseType] - 期望的响应类型
13
+ * @property {boolean} [isLoading] - 标记请求是否正在加载
14
+ * @property {any} [loadingConfig] - 加载状态的配置项,可以是任意类型的对象
15
+ * @property {(data: any) => any} [resultFilter] - 请求返回数据的过滤器函数,可用于数据处理和转换
16
+ */
17
+ export interface AjaxOptions {
18
+ url: string;
19
+ baseURL: string;
20
+ method?: string;
21
+ ContentType?: string;
22
+ params?: any;
23
+ data?: any;
24
+ timeout?: number;
25
+ withCredentials?: boolean;
26
+ ResponseType?: 'json' | 'text' | 'blob' | 'arraybuffer' | 'document' | 'stream';
27
+ isLoading?: boolean;
28
+ loadingConfig?: any;
29
+ headers?: any;
30
+ resultFilter?: (data: any) => any;
31
+ }
32
+ /**
33
+ * 定义一个Ajax请求的配置接口
34
+ * 该接口用于配置Ajax请求的各种行为,包括加载状态切换、请求锁定、请求完成、成功回调、错误回调和取消回调等
35
+ */
36
+ export interface AjaxConfig {
37
+ /**
38
+ * 加载状态切换的回调函数
39
+ * @param value boolean类型,表示加载状态是否开启
40
+ * 该函数用于在请求开始和结束时切换页面的加载状态(如显示或隐藏加载动画)
41
+ */
42
+ loadingSwitch?: (value: boolean) => void;
43
+ /**
44
+ * 请求锁定的函数
45
+ * @returns boolean类型,表示是否允许继续发送请求
46
+ * 该函数用于在请求发送前进行一些检查,如防止重复发送请求等
47
+ */
48
+ lock?: () => boolean;
49
+ /**
50
+ * 请求完成的回调函数
51
+ * @param url string类型,表示完成请求的URL
52
+ * 该函数在请求无论成功或失败,只要完成就会被调用,可用于记录日志等操作
53
+ */
54
+ complete?: (url: string) => void;
55
+ /**
56
+ * 请求成功时的回调函数
57
+ * @param data any类型,表示请求成功返回的数据
58
+ * 该函数用于处理请求成功后需要执行的操作,如将数据渲染到页面等
59
+ */
60
+ callback?: (data: any) => void;
61
+ /**
62
+ * 请求错误时的回调函数
63
+ * @param message any类型,表示错误信息
64
+ * @param status number类型,表示HTTP状态码
65
+ * 该函数用于处理请求错误时需要执行的操作,如显示错误信息等
66
+ */
67
+ errorCallback?: (message: any, status: number) => void;
68
+ /**
69
+ * 请求取消时的回调函数
70
+ * @param err any类型,表示取消请求时的错误信息
71
+ * 该函数用于处理请求取消时需要执行的操作,如清理资源等
72
+ */
73
+ cancelCallback?: (err: any) => void;
74
+ }
75
+ /**
76
+ * 定义默认的HTTP请求头。
77
+ *
78
+ * 这是一个对象,键是请求头的字段名,值是字段的值。
79
+ * 主要用于设置跨域请求的Access-Control-Allow-Origin以及标识请求类型为XMLHttpRequest。
80
+ */
81
+ export declare const defaultHeaders: {
82
+ 'Access-Control-Allow-Origin': string;
83
+ 'X-Requested-With': string;
84
+ };
85
+ /**
86
+ * 获取完整URL
87
+ *
88
+ * @param options 配置选项
89
+ * @param options.baseURL 基础URL
90
+ * @param options.url 路径或相对URL
91
+ * @returns 拼接后的完整URL
92
+ */
93
+ export declare function getFullUrl(options: any): string;
@@ -0,0 +1,3 @@
1
+ import { AjaxConfig } from './config';
2
+ declare function interfaceAxios(options: any, ajaxConfig?: AjaxConfig): any;
3
+ export default interfaceAxios;
@@ -0,0 +1,3 @@
1
+ import { AjaxOptions, AjaxConfig } from './config';
2
+ declare function ImplementAxios(options: AjaxOptions, ajaxConfig: AjaxConfig): Promise<void>;
3
+ export default ImplementAxios;
@@ -0,0 +1,6 @@
1
+ interface HttpCodeMessage {
2
+ message: string;
3
+ status?: number;
4
+ }
5
+ export default function httpCodeFilter(code: number): HttpCodeMessage;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const paramsFilter: (params: any, ContentType?: string) => any;
2
+ export default paramsFilter;
@@ -0,0 +1,14 @@
1
+ type LoadingConfig = {
2
+ text?: string;
3
+ background?: string;
4
+ };
5
+ type LoadingState = {
6
+ hide: any;
7
+ show: any;
8
+ instance: any;
9
+ count: number;
10
+ };
11
+ export declare const loading: LoadingState;
12
+ export declare const showLoading: (config?: LoadingConfig) => void;
13
+ export declare const hideLoading: () => void;
14
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * window.localStorage 浏览器永久缓存
3
+ * @method set 设置永久缓存
4
+ * @method get 获取永久缓存
5
+ * @method remove 移除永久缓存
6
+ * @method clear 移除全部永久缓存
7
+ */
8
+ export declare const Local: {
9
+ setKey(key: string): string;
10
+ set<T>(key: string, val: T): void;
11
+ get(key: string): any;
12
+ remove(key: string): void;
13
+ clear(): void;
14
+ };
15
+ /**
16
+ * window.sessionStorage 浏览器临时缓存
17
+ * @method set 设置临时缓存
18
+ * @method get 获取临时缓存
19
+ * @method remove 移除临时缓存
20
+ * @method clear 移除全部临时缓存
21
+ */
22
+ export declare const Session: {
23
+ set<T>(key: string, val: T): void;
24
+ get(key: string): any;
25
+ remove(key: string): void;
26
+ clear(): void;
27
+ };
@@ -0,0 +1,130 @@
1
+ declare const theme: {
2
+ name: string;
3
+ bgColor: string;
4
+ boxColor: string;
5
+ textFontColor: string;
6
+ backColor: string;
7
+ backBorderColor: string;
8
+ contentFillColor: string;
9
+ primary: string;
10
+ primary1: string;
11
+ primary2: string;
12
+ primary3: string;
13
+ primary4: string;
14
+ primary5: string;
15
+ primary6: string;
16
+ primary7: string;
17
+ primaryLight: string;
18
+ primaryLight1: string;
19
+ primaryLight2: string;
20
+ primaryLight3: string;
21
+ primaryLight4: string;
22
+ primaryLight5: string;
23
+ primaryLight6: string;
24
+ primaryLight7: string;
25
+ success: string;
26
+ success1: string;
27
+ success2: string;
28
+ success3: string;
29
+ success4: string;
30
+ success5: string;
31
+ success6: string;
32
+ success7: string;
33
+ warning: string;
34
+ warning1: string;
35
+ warning2: string;
36
+ warning3: string;
37
+ warning4: string;
38
+ warning5: string;
39
+ warning6: string;
40
+ warning7: string;
41
+ danger: string;
42
+ danger1: string;
43
+ danger2: string;
44
+ danger3: string;
45
+ danger4: string;
46
+ danger5: string;
47
+ danger6: string;
48
+ danger7: string;
49
+ error: string;
50
+ info: string;
51
+ info1: string;
52
+ info2: string;
53
+ info3: string;
54
+ info4: string;
55
+ info5: string;
56
+ info6: string;
57
+ info7: string;
58
+ text: {
59
+ primary: string;
60
+ regular: string;
61
+ secondary: string;
62
+ placeholder: string;
63
+ disabled: string;
64
+ light: string;
65
+ };
66
+ border: {
67
+ border: string;
68
+ light: string;
69
+ lighter: string;
70
+ extraLight: string;
71
+ dark: string;
72
+ darker: string;
73
+ };
74
+ fill: {
75
+ fill: string;
76
+ light: string;
77
+ lighter: string;
78
+ extraLight: string;
79
+ dark: string;
80
+ darker: string;
81
+ blank: string;
82
+ bgExtraLight: string;
83
+ bgDark: string;
84
+ };
85
+ scrollColor: string;
86
+ bg: {
87
+ bg: string;
88
+ page: string;
89
+ overlay: string;
90
+ };
91
+ chartOption: {
92
+ fontSize: number;
93
+ barWidth: number;
94
+ symbolSize: number;
95
+ backgroundColor: string;
96
+ padding: number[];
97
+ margin: number;
98
+ grid: {
99
+ top: string;
100
+ left: string;
101
+ right: string;
102
+ bottom: string;
103
+ };
104
+ colors: string[];
105
+ auxiliaryColors: string[];
106
+ chartTitleColor: string;
107
+ chartSubtitleColor: string;
108
+ chartMarkTextColor: string;
109
+ chartLegendTextColor: string;
110
+ chartAxisLineColor: string;
111
+ chartAxisTickColor: string;
112
+ chartAxisLabelColor: string;
113
+ };
114
+ aMapStyle: string;
115
+ aMapScatterColor: string;
116
+ tooltipFill: string;
117
+ tableHeaderBgColor: string;
118
+ tableHeaderTextColor: string;
119
+ rankingRed: string;
120
+ rankingBlack: string;
121
+ cupTitleColor: string;
122
+ cupNameColor: string;
123
+ cupTextColor: string;
124
+ cupChangeTextColor: string;
125
+ cupRateTextColor: string;
126
+ cupTHeadTextColor: string;
127
+ cupTHeadBgColor: string;
128
+ cupTbodyBgColor: string;
129
+ };
130
+ export default theme;