@kengic/vue 0.16.6 → 0.16.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.css +1 -1
  3. package/dist/kengic-vue.js +3479 -2941
  4. package/dist/src/apis/WMS/Controllers/VarContextController/Add.d.ts +16 -0
  5. package/dist/src/apis/WMS/Controllers/VarContextController/Delete.d.ts +18 -0
  6. package/dist/src/apis/WMS/Controllers/VarContextController/DeleteBatch.d.ts +18 -0
  7. package/dist/src/apis/WMS/Controllers/VarContextController/Edit.d.ts +16 -0
  8. package/dist/src/apis/WMS/Controllers/VarContextController/ExportXls.d.ts +24 -0
  9. package/dist/src/apis/WMS/Controllers/VarContextController/ImportExcel.d.ts +15 -0
  10. package/dist/src/apis/WMS/Controllers/VarContextController/List.d.ts +31 -0
  11. package/dist/src/apis/WMS/Controllers/VarContextController/QueryById.d.ts +19 -0
  12. package/dist/src/apis/WMS/Controllers/VarContextController/index.d.ts +8 -0
  13. package/dist/src/apis/WMS/Controllers/VarController/GetAll.d.ts +19 -0
  14. package/dist/src/apis/WMS/Controllers/VarController/index.d.ts +1 -0
  15. package/dist/src/apis/WMS/Controllers/VarGridMasterController/QueryByID.d.ts +19 -0
  16. package/dist/src/apis/WMS/Controllers/VarGridMasterController/Update.d.ts +16 -0
  17. package/dist/src/apis/WMS/Controllers/VarGridMasterController/index.d.ts +2 -0
  18. package/dist/src/apis/WMS/Controllers/VarProfileMasterController/QueryByID.d.ts +19 -0
  19. package/dist/src/apis/WMS/Controllers/VarProfileMasterController/index.d.ts +1 -0
  20. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/Add.d.ts +16 -0
  21. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/Delete.d.ts +18 -0
  22. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/DeleteBatch.d.ts +18 -0
  23. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/Edit.d.ts +16 -0
  24. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/ExportXls.d.ts +30 -0
  25. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/ImportExcel.d.ts +15 -0
  26. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/List.d.ts +37 -0
  27. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/QueryById.d.ts +19 -0
  28. package/dist/src/apis/WMS/Controllers/VarVariableCatalogController/index.d.ts +8 -0
  29. package/dist/src/apis/WMS/Controllers/WhController/ListVO.d.ts +52 -0
  30. package/dist/src/apis/WMS/Controllers/WhController/index.d.ts +1 -0
  31. package/dist/src/apis/WMS/Controllers/index.d.ts +6 -0
  32. package/dist/src/apis/WMS/index.d.ts +2 -0
  33. package/dist/src/apis/WMS/models.d.ts +728 -0
  34. package/dist/src/apis/api.d.ts +1 -0
  35. package/dist/src/apis/def.d.ts +1 -0
  36. package/dist/src/apis/index.d.ts +2 -0
  37. package/dist/src/components/KgAppSelect/KgAppSelect.d.ts +47 -0
  38. package/dist/src/components/KgAppSelect/index.d.ts +3 -0
  39. package/dist/src/components/KgAppSelect/index.hooks.d.ts +41 -0
  40. package/dist/src/components/KgAppSelect/index.store.d.ts +73 -0
  41. package/dist/src/components/KgButton/KgButton.Item.d.ts +41 -0
  42. package/dist/src/components/KgButton/KgButton.Item.data.d.ts +31 -0
  43. package/dist/src/components/KgButton/KgButton.d.ts +34 -0
  44. package/dist/src/components/KgButton/KgButton.hooks.d.ts +61 -0
  45. package/dist/src/components/KgButton/KgButton.store.d.ts +89 -0
  46. package/dist/src/components/KgButton/components/KgButton.Copy.d.ts +39 -0
  47. package/dist/src/components/KgButton/components/KgButton.Create.d.ts +39 -0
  48. package/dist/src/components/KgButton/components/KgButton.Delete.d.ts +40 -0
  49. package/dist/src/components/KgButton/components/KgButton.Export.d.ts +39 -0
  50. package/dist/src/components/KgButton/components/KgButton.Import.d.ts +39 -0
  51. package/dist/src/components/KgButton/components/KgButton.ImportTemplate.d.ts +39 -0
  52. package/dist/src/components/KgButton/components/KgButton.Other.d.ts +40 -0
  53. package/dist/src/components/KgButton/components/KgButton.Search.d.ts +40 -0
  54. package/dist/src/components/KgButton/components/KgButton.Update.d.ts +39 -0
  55. package/dist/src/components/KgButton/index.d.ts +62 -0
  56. package/dist/src/components/KgForm/KgForm.d.ts +414 -0
  57. package/dist/src/components/KgForm/index.d.ts +604 -0
  58. package/dist/src/components/KgForm/index.hooks.d.ts +42 -0
  59. package/dist/src/components/KgForm/index.store.d.ts +107 -0
  60. package/dist/src/components/KgForm/index.vm.d.ts +9 -0
  61. package/dist/src/components/KgForm.Item/KgForm.Item.d.ts +100 -0
  62. package/dist/src/components/KgForm.Item/KgForm.Item.hooks.d.ts +17 -0
  63. package/dist/src/components/KgForm.Item/addon/KgForm.Item.Addon.Lookup.Modal.d.ts +17 -0
  64. package/dist/src/components/KgForm.Item/addon/KgForm.Item.Addon.Lookup.d.ts +32 -0
  65. package/dist/src/components/KgForm.Item/components/KgForm.Item.Checkbox.d.ts +103 -0
  66. package/dist/src/components/KgForm.Item/components/KgForm.Item.CheckboxGroup.d.ts +102 -0
  67. package/dist/src/components/KgForm.Item/components/KgForm.Item.Date.d.ts +100 -0
  68. package/dist/src/components/KgForm.Item/components/KgForm.Item.DateRange.d.ts +100 -0
  69. package/dist/src/components/KgForm.Item/components/KgForm.Item.Input.d.ts +99 -0
  70. package/dist/src/components/KgForm.Item/components/KgForm.Item.InputNumber.d.ts +99 -0
  71. package/dist/src/components/KgForm.Item/components/KgForm.Item.RadioGroup.d.ts +99 -0
  72. package/dist/src/components/KgForm.Item/components/KgForm.Item.Select.d.ts +104 -0
  73. package/dist/src/components/KgForm.Item/components/KgForm.Item.Select.hooks.d.ts +27 -0
  74. package/dist/src/components/KgForm.Item/components/KgForm.Item.Switch.d.ts +99 -0
  75. package/dist/src/components/KgForm.Item/components/KgForm.Item.TextArea.d.ts +99 -0
  76. package/dist/src/components/KgForm.Item/index.d.ts +2 -0
  77. package/dist/src/components/KgForm.Item/index.vm.d.ts +104 -0
  78. package/dist/src/components/KgModal/KgModal.d.ts +395 -0
  79. package/dist/src/components/KgModal/components/KgModal.Close.d.ts +41 -0
  80. package/dist/src/components/KgModal/index.d.ts +2 -0
  81. package/dist/src/components/KgModal/index.vm.d.ts +194 -0
  82. package/dist/src/components/KgProgressA/KgProgressA.d.ts +85 -0
  83. package/dist/src/components/KgProgressA/index.d.ts +1 -0
  84. package/dist/src/components/KgResizable/KgResizable.d.ts +143 -0
  85. package/dist/src/components/KgResizable/index.d.ts +1 -0
  86. package/dist/src/components/KgSearch/KgSearch.d.ts +42 -0
  87. package/dist/src/components/KgSearch/KgSearch.hooks.d.ts +39 -0
  88. package/dist/src/components/KgSearch/components/KgSearch.ConfigModal.Body.d.ts +22 -0
  89. package/dist/src/components/KgSearch/components/KgSearch.ConfigModal.VarProfileConfig.d.ts +8 -0
  90. package/dist/src/components/KgSearch/components/KgSearch.ConfigModal.VarProfileMaster.d.ts +24 -0
  91. package/dist/src/components/KgSearch/components/KgSearch.ConfigModal.VarProfileMaster.hooks.d.ts +7 -0
  92. package/dist/src/components/KgSearch/components/KgSearch.ConfigModal.d.ts +32 -0
  93. package/dist/src/components/KgSearch/index.d.ts +3 -0
  94. package/dist/src/components/KgSearch/index.hooks.d.ts +41 -0
  95. package/dist/src/components/KgSearch/index.store.d.ts +86 -0
  96. package/dist/src/components/KgSearch/index.vm.d.ts +1 -0
  97. package/dist/src/components/KgSubmit/KgSubmit.d.ts +41 -0
  98. package/dist/src/components/KgSubmit/KgSubmit.hooks.d.ts +20 -0
  99. package/dist/src/components/KgSubmit/components/KgSubmit.Header.VarSubmitConfig.d.ts +28 -0
  100. package/dist/src/components/KgSubmit/components/KgSubmit.Header.d.ts +82 -0
  101. package/dist/src/components/KgSubmit/index.d.ts +4 -0
  102. package/dist/src/components/KgSubmit/index.hooks.d.ts +74 -0
  103. package/dist/src/components/KgSubmit/index.store.d.ts +130 -0
  104. package/dist/src/components/KgSubmit/index.vm.d.ts +10 -0
  105. package/dist/src/components/KgTable/KgTable.d.ts +39 -0
  106. package/dist/src/components/KgTable/KgTable.hooks.d.ts +43 -0
  107. package/dist/src/components/KgTable/components/KgTable.Cell.d.ts +61 -0
  108. package/dist/src/components/KgTable/components/KgTable.Info.d.ts +58 -0
  109. package/dist/src/components/KgTable/components/setting/KgTable.Setting.VarGridMaster.SaveAs.d.ts +5 -0
  110. package/dist/src/components/KgTable/components/setting/KgTable.Setting.d.ts +22 -0
  111. package/dist/src/components/KgTable/components/setting/KgTable.Setting.hooks.d.ts +14 -0
  112. package/dist/src/components/KgTable/components/setting/config/KgTable.Setting.ConfigModal.Body.d.ts +22 -0
  113. package/dist/src/components/KgTable/components/setting/config/KgTable.Setting.ConfigModal.VarGridConfig.d.ts +21 -0
  114. package/dist/src/components/KgTable/components/setting/config/KgTable.Setting.ConfigModal.VarGridMaster.d.ts +24 -0
  115. package/dist/src/components/KgTable/components/setting/config/KgTable.Setting.ConfigModal.VarGridMaster.hooks.d.ts +23 -0
  116. package/dist/src/components/KgTable/components/setting/config/KgTable.Setting.ConfigModal.d.ts +33 -0
  117. package/dist/src/components/KgTable/index.d.ts +4 -0
  118. package/dist/src/components/KgTable/index.hooks.d.ts +84 -0
  119. package/dist/src/components/KgTable/index.store.d.ts +157 -0
  120. package/dist/src/components/KgTable/index.vm.d.ts +66 -0
  121. package/dist/src/components/KgVar/KgVar.d.ts +28 -0
  122. package/dist/src/components/KgVar/index.d.ts +4 -0
  123. package/dist/src/components/KgVar/index.hooks.d.ts +242 -0
  124. package/dist/src/components/KgVar/index.store.d.ts +315 -0
  125. package/dist/src/components/KgVar/index.store.service.d.ts +21 -0
  126. package/dist/src/components/KgVar/index.vm.d.ts +47 -0
  127. package/dist/src/components/KgVarConfig/KgVarConfig.d.ts +2 -0
  128. package/dist/src/components/KgVarConfig/components/KgVarConfig.FormIDsModal.d.ts +24 -0
  129. package/dist/src/components/KgVarConfig/components/KgVarConfig.Modal.d.ts +17 -0
  130. package/dist/src/components/KgVarConfig/components/button/KgVarConfig.Modal.Button.VarButton.d.ts +25 -0
  131. package/dist/src/components/KgVarConfig/components/button/KgVarConfig.Modal.Button.VarButtonConfig.d.ts +29 -0
  132. package/dist/src/components/KgVarConfig/components/button/KgVarConfig.Modal.Button.d.ts +22 -0
  133. package/dist/src/components/KgVarConfig/components/submit/KgVarConfig.Modal.Submit.VarSubmitField.d.ts +25 -0
  134. package/dist/src/components/KgVarConfig/components/submit/KgVarConfig.Modal.Submit.d.ts +22 -0
  135. package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.CreateModal.d.ts +33 -0
  136. package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.VarVariableCatalog.d.ts +3 -0
  137. package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.VarVariableCatalog.data.d.ts +3 -0
  138. package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.Vars.d.ts +3 -0
  139. package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.Vars.data.d.ts +3 -0
  140. package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.d.ts +3 -0
  141. package/dist/src/components/KgVarConfig/index.d.ts +2 -0
  142. package/dist/src/components/KgVarConfig/index.store.d.ts +20 -0
  143. package/dist/src/components/KgVarConfig/index.vm.d.ts +3 -0
  144. package/dist/src/components/KgWarehouse/KgWarehouse.d.ts +38 -0
  145. package/dist/src/components/KgWarehouse/index.d.ts +4 -0
  146. package/dist/src/components/KgWarehouse/index.guard.d.ts +8 -0
  147. package/dist/src/components/KgWarehouse/index.hooks.d.ts +27 -0
  148. package/dist/src/components/KgWarehouse/index.store.d.ts +63 -0
  149. package/dist/src/components/KgYesOrNo/KgYesOrNo.d.ts +60 -0
  150. package/dist/src/components/KgYesOrNo/index.d.ts +1 -0
  151. package/dist/src/components/index.d.ts +16 -0
  152. package/dist/src/components/util.d.ts +14 -0
  153. package/dist/src/config/index.d.ts +3 -0
  154. package/dist/src/config/index.hooks.d.ts +43 -0
  155. package/dist/src/config/index.store.d.ts +192 -0
  156. package/dist/src/config/setup.d.ts +45 -0
  157. package/dist/src/consts/i18n/en.d.ts +228 -0
  158. package/dist/src/consts/i18n/index.d.ts +2 -0
  159. package/dist/src/consts/i18n/zh_CN.d.ts +227 -0
  160. package/dist/src/consts/index.d.ts +253 -0
  161. package/dist/src/consts/index.vm.d.ts +170 -0
  162. package/dist/src/consts/injection-keys.const.d.ts +9 -0
  163. package/dist/src/helpers/ant-design-vue.d.ts +316 -0
  164. package/dist/src/helpers/tsx.helper.d.ts +13 -0
  165. package/dist/src/index.d.ts +9 -0
  166. package/dist/src/pages/KgPageDda/KgPageDda.d.ts +8 -0
  167. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.Basic.SqlModal.d.ts +32 -0
  168. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.Basic.d.ts +7 -0
  169. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.Button.d.ts +8 -0
  170. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.Child.d.ts +7 -0
  171. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.Menu.d.ts +7 -0
  172. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.Search.d.ts +7 -0
  173. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.Submit.d.ts +7 -0
  174. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.Table.d.ts +7 -0
  175. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.d.ts +29 -0
  176. package/dist/src/pages/KgPageDda/components/KgPageDda.Create.store.d.ts +26 -0
  177. package/dist/src/pages/KgPageDda/index.const.d.ts +11 -0
  178. package/dist/src/pages/KgPageDda/index.d.ts +5 -0
  179. package/dist/src/pages/index.d.ts +2 -0
  180. package/dist/src/services/http-client.d.ts +46 -0
  181. package/dist/src/services/index.d.ts +1 -0
  182. package/dist/src/utils/index.d.ts +6 -0
  183. package/dist/src/utils/kg-auth.util.d.ts +26 -0
  184. package/dist/src/utils/kg-dom.util.d.ts +12 -0
  185. package/dist/src/utils/kg-logger.util.d.ts +65 -0
  186. package/dist/src/utils/kg-route.util.d.ts +54 -0
  187. package/dist/src/utils/kg-var.util.d.ts +36 -0
  188. package/dist/src/utils/kg.util.d.ts +114 -0
  189. package/package.json +6 -5
@@ -0,0 +1,65 @@
1
+ /**
2
+ * 日志服务.
3
+ */
4
+ declare class KgLogger {
5
+ /**
6
+ * 打印弃用日志.
7
+ *
8
+ * @param message 提示消息.
9
+ * @param args 数据对象.
10
+ * @param collapsed 是否折叠.
11
+ */
12
+ static deprecated(message: string, args?: Record<string, any>, collapsed?: boolean): void;
13
+ /**
14
+ * 打印错误日志.
15
+ *
16
+ * @param message 提示消息.
17
+ * @param args 数据对象.
18
+ * @param collapsed 是否折叠.
19
+ */
20
+ static error(message: string, args?: Record<string, any>, collapsed?: boolean): void;
21
+ /**
22
+ * 打印普通日志.
23
+ *
24
+ * @param message 提示消息.
25
+ * @param args 数据对象.
26
+ * @param collapsed 是否折叠.
27
+ */
28
+ static info(message: string, args?: Record<string, any>, collapsed?: boolean): void;
29
+ /**
30
+ * 打印日志.
31
+ *
32
+ * @param level 日志等级.
33
+ * @param message 提示消息.
34
+ * @param args 数据对象.
35
+ * @param collapsed 是否折叠.
36
+ * @param style 样式.
37
+ */
38
+ static log(level: "debug" | "info" | "warn" | "error" | "deprecated" | undefined, message: string, args?: Record<string, any>, collapsed?: boolean, style?: string | null): void;
39
+ /**
40
+ * 打印警告日志.
41
+ *
42
+ * @param message 提示消息.
43
+ * @param args 数据对象.
44
+ * @param collapsed 是否折叠.
45
+ */
46
+ static warn(message: string, args?: Record<string, any>, collapsed?: boolean): void;
47
+ /**
48
+ * 打印调试日志.
49
+ * @param message 提示消息.
50
+ * @param args 数据对象.
51
+ * @param collapsed 是否折叠.
52
+ */
53
+ static debug(message: string, args?: Record<string, any>, collapsed?: boolean): void;
54
+ /**
55
+ * 打印调试日志: DDA.
56
+ * @param formID 界面标识.
57
+ * @param component 组件.
58
+ * @param method 方法.
59
+ * @param message 提示消息.
60
+ * @param args 数据对象.
61
+ * @param collapsed 是否折叠.
62
+ */
63
+ static debugDDA(formID: string | null | undefined, component: string | null | undefined, method: string | null | undefined, message: string | null | undefined, args?: Record<string, any>, collapsed?: boolean): void;
64
+ }
65
+ export { KgLogger };
@@ -0,0 +1,54 @@
1
+ import { KG_APP, Menu } from '../consts';
2
+ export declare class KgRouteUtil {
3
+ /**
4
+ * 给所有模块都添加在线表单的路由.
5
+ * 由于默认的在线表单路由是没有区分模块的, 而每个模块下都可能有在线表单, 因此给每个模块都添加在线表单的路由.
6
+ * @param routes 当前路由列表.
7
+ */
8
+ static addOnlineRoutesForAllApps(routes: any[]): any[];
9
+ /**
10
+ * 根据地址获取菜单.
11
+ * @param menus 菜单列表.
12
+ * @param path 地址.
13
+ * @return {} 如果能找到某个菜单的地址等于传入的地址, 则返回该菜单, 否则返回 null.
14
+ */
15
+ static getMenuByPath(menus: Array<Menu> | null | undefined, path: string): Menu | null;
16
+ /**
17
+ * 获取第一个类型为叶子节点的菜单, 即第一个没有下级菜单的菜单, 即第一个拥有页面的菜单.
18
+ * 如果参数 app 不为空, 表示只在该模块的菜单中找; 否则在所有的菜单中找.
19
+ * @param app 模块.
20
+ * @return {} 如果能找到, 则返回该菜单, 否则返回 null.
21
+ */
22
+ static getFirstLeafMenu(app?: KG_APP | null): Menu | null;
23
+ /**
24
+ * 翻译菜单标题.
25
+ * @param menus 菜单列表, 树形结构.
26
+ * @param titleKey 标题的属性名, 即要将哪个属性作为菜单的标题.
27
+ */
28
+ static translateMenus(menus: Array<Menu> | null | undefined, titleKey?: string): Array<Menu>;
29
+ /**
30
+ * 转换菜单列表.
31
+ * 1. 根据模块分组,
32
+ * @param menus 菜单列表, 树形结构.
33
+ */
34
+ static transformMenus(menus: Array<Menu> | null | undefined): Array<Menu>;
35
+ /**
36
+ * 判断某个路径是否属于某个模块.
37
+ * @param path 路径.
38
+ * @param app 模块.
39
+ */
40
+ static isPathInApp(path: string | null | undefined, app: KG_APP | null): boolean;
41
+ /**
42
+ * 根据地址获取模块.
43
+ * @param path 地址.
44
+ * @return {} 地址所属模块.
45
+ */
46
+ static getAppByPath(path: string): KG_APP | null;
47
+ /**
48
+ * 获取模块的首页地址.
49
+ * @param app 模块.
50
+ * @return {} 该模块的首页地址.
51
+ * @throws {} 如果模块无法识别, 会报错.
52
+ */
53
+ static getAppIndexPath(app: KG_APP): string;
54
+ }
@@ -0,0 +1,36 @@
1
+ import dayjs from 'dayjs';
2
+ import { KG_FORM_ITEM_TYPE } from '../consts';
3
+ /**
4
+ * 变量相关工具.
5
+ */
6
+ export declare class KgVarUtil {
7
+ /**
8
+ * 将 JSON 字符串形式的参数 `'{"foo":1,"bar":2}'` 转换为对象形式的参数 `{ "foo": 1, "bar": 2 }`.
9
+ * @param params JSON 字符串形式的参数.
10
+ * @return {} 参数对象.
11
+ */
12
+ static parseCommandParameter(params?: string | null): Record<string, any>;
13
+ /**
14
+ * 根据控件类型, 将任意的值(可能非法)转换为合法的值.
15
+ * @param frm_id 界面标识.
16
+ * @param var_name 变量名称.
17
+ * @param $dayjs dayjs.
18
+ * @param value 原始的值.
19
+ * @param op 操作类型. C: 创建, R: 查询, U: 更新, D: 删除, CP: 复制.
20
+ * @return {} 转换后的合法的值.
21
+ */
22
+ static transformFormItemValue(frm_id: string, var_name: string, $dayjs: typeof dayjs, value: any, op: 'C' | 'R' | 'U' | 'D' | 'CP'): any;
23
+ /**
24
+ * 根据控件类型, 将任意的高级查询操作符(可能非法)转换为合法的值.
25
+ * @param frm_id 界面标识.
26
+ * @param var_name 变量名称.
27
+ * @param value 原始的高级查询操作符.
28
+ * @return {} 转换后的合法的值.
29
+ */
30
+ static transformFormItemDynamicQueryOperator(frm_id: string, var_name: string, value: string | null | undefined): string;
31
+ /**
32
+ * 根据控件类型获取高级查询操作符的下拉列表.
33
+ * @param controlType 控件类型.
34
+ */
35
+ static getDynamicQueryOperatorSelectOptions(controlType: KG_FORM_ITEM_TYPE): any;
36
+ }
@@ -0,0 +1,114 @@
1
+ import { ModalFuncProps } from 'ant-design-vue/lib/modal/Modal';
2
+ import dayjs, { Dayjs } from 'dayjs';
3
+ import { IKgButtonModalProps } from '../consts';
4
+ /**
5
+ * 通用工具.
6
+ */
7
+ export declare class KgUtil {
8
+ /**
9
+ * 根据'文件大小数值'获取'文件大小文本'.
10
+ * @param size 文件大小数值.
11
+ */
12
+ static getFileSize(size: any): string;
13
+ /**
14
+ * BASE64 转换为 BLOB.
15
+ * @param base64 base64 字符串.
16
+ * @param contentType 文件类型.
17
+ * @param sliceSize 分块大小.
18
+ */
19
+ static base64toBlob(base64: string, contentType: string, sliceSize?: number): Blob;
20
+ /**
21
+ * 下载文件.
22
+ * @param data 文件数据.
23
+ * @param fileName 文件名称, 包含后缀.
24
+ * @param contentType 文件类型.
25
+ */
26
+ static downloadFile(data: string | BlobPart, fileName: string, contentType?: string): void;
27
+ /**
28
+ * <p>处理请求参数.</p>
29
+ * <ol>
30
+ * <li>填充通用参数的值:
31
+ * <ul>
32
+ * <li>仓库: '{WAREHOUSE}'</li>
33
+ * </ul>
34
+ * </li>
35
+ * </ol>
36
+ * @param params 请求参数.
37
+ * @param formID 界面标识.
38
+ * @param $dayjs dayjs.
39
+ */
40
+ static parseParams(params: Record<string, any> | null | undefined, formID?: string | null, $dayjs?: typeof dayjs): Record<string, any>;
41
+ /**
42
+ * <p>获取高级查询的各个请求头的值.</p>
43
+ * <p>处理查询参数, 最终拼接为一个 SQL 格式如下: `WHERE ... ORDER BY ...`.</p>
44
+ * <p>
45
+ * 参数 formID 和 operators 只能其中一个传值.
46
+ * <ul>
47
+ * <li>如果 formID 传值, 表示通过变量配置获取各个字段的高级查询操作符.</li>
48
+ * <li>如果 operators 传值, 表示直接使用传入的 operators 作为各个字段的高级查询操作符.</li>
49
+ * </ul>
50
+ * </p>
51
+ * <ol>
52
+ * <li>填充通用参数的值:
53
+ * <ul>
54
+ * <li>仓库: '{WAREHOUSE}'</li>
55
+ * </ul>
56
+ * </li>
57
+ * </ol>
58
+ * @param params 请求参数.
59
+ * @param formID 界面标识.
60
+ * @param operators 各个字段的高级查询操作符.
61
+ * @param $dayjs dayjs.
62
+ * @return {} 拼接好的 SQL.
63
+ */
64
+ static getQuerySql(params: Record<string, any> | null | undefined, formID: string | null | undefined, operators: Record<string, any> | null | undefined, $dayjs: typeof dayjs): {
65
+ sql: string;
66
+ whereSql: string;
67
+ orderBySql: string;
68
+ };
69
+ /**
70
+ * 处理请求参数: 解析字符串类型的参数值.
71
+ * @param value 参数的原始值.
72
+ */
73
+ private static parseParamFromString;
74
+ /**
75
+ * 处理请求参数: 解析 DayJS 类型的参数值.
76
+ * @param key 属性名.
77
+ * @param value 参数的原始值.
78
+ * @param formID 界面标识.
79
+ * @param isPad 是否补齐日期格式. 即将 `YYYY-MM-DD` 补齐为 `YYYY-MM-DD 00:00:00`, 将 `HH:mm:ss` 补齐为 `1900-01-01 HH:mm:ss`.
80
+ */
81
+ private static parseParamFromDayJS;
82
+ /**
83
+ * 确认弹窗.
84
+ * 设置了多个属性的默认值, 简化使用.
85
+ * https://www.antdv.com/components/modal
86
+ * @param props
87
+ */
88
+ static confirm(props: IKgButtonModalProps): ModalFunc;
89
+ /**
90
+ * 如果不是表单验证错误, 则抛出该错误.
91
+ * @param e 错误对象.
92
+ */
93
+ static throwIfNotFormError(e: any): void;
94
+ /**
95
+ * 将 JSON 字符串转换为 JSON 对象, 如果转化失败, 则返回空对象.
96
+ * @param str JSON 字符串.
97
+ */
98
+ static tryParseJSON<T = Record<string, any>>(str?: string | null): T;
99
+ /**
100
+ * 将值转换为 Dayjs 对象.
101
+ * @param value 值.
102
+ */
103
+ static toDayjs(value: any): Dayjs | undefined;
104
+ /** 显示全局遮罩. */
105
+ static showLoading(): void;
106
+ /** 隐藏全局遮罩. */
107
+ static hideLoading(): void;
108
+ }
109
+ export declare type ModalFunc = {
110
+ destroy: () => void;
111
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
112
+ showLoading(): void;
113
+ hideLoading(): void;
114
+ };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.16.6",
3
+ "version": "0.16.7",
4
4
  "scripts": {
5
- "build": "npm run switch-node-version && rimraf dist && vite build",
6
- "build:dev": "npm run switch-node-version && rimraf dist && vite build --mode development",
5
+ "build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
6
+ "build:dev": "npm run switch-node-version && rimraf dist && vue-tsc && vite build --mode development",
7
7
  "--------------------------------------------------": "",
8
8
  "publish:all:beta": "npm run bump-version:beta && npm run publish:all",
9
9
  "publish:all:patch": "npm run bump-version:patch && npm run publish:all",
@@ -69,7 +69,8 @@
69
69
  "tsx": "3.12.3",
70
70
  "typescript": "~4.8.4",
71
71
  "vite": "3.2.5",
72
- "vue": "3.2.43"
72
+ "vue": "3.2.43",
73
+ "vue-tsc": "1.8.27"
73
74
  },
74
75
  "main": "./dist/kengic-vue.js",
75
76
  "module": "./dist/kengic-vue.js",
@@ -82,7 +83,7 @@
82
83
  },
83
84
  "prettier": {
84
85
  "endOfLine": "auto",
85
- "printWidth": 160,
86
+ "printWidth": 120,
86
87
  "semi": true,
87
88
  "singleQuote": true,
88
89
  "tabWidth": 4,