vap1 0.4.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/base.json +30 -0
  2. package/basetype.d.ts +4 -1
  3. package/cems/admin/AsyncSelect.d.ts +45 -0
  4. package/cems/admin/AsyncSelect.js +2 -0
  5. package/cems/admin/CardTable.d.ts +207 -0
  6. package/cems/admin/CardTable.js +2 -0
  7. package/cems/admin/EasyuiTree.d.ts +131 -0
  8. package/cems/admin/EasyuiTree.js +2 -0
  9. package/cems/admin/utils.d.ts +5 -0
  10. package/cems/admin/utils.js +3 -0
  11. package/cems/admin/validator.d.ts +137 -0
  12. package/cems/admin/validator.js +2 -0
  13. package/cems/assets/CUpload.d.ts +23 -0
  14. package/cems/assets/CUpload.js +2 -0
  15. package/cems/assets/Charts.d.ts +37 -0
  16. package/cems/assets/Charts.js +2 -0
  17. package/cems/assets/DInfo.d.ts +38 -0
  18. package/cems/assets/DInfo.js +2 -0
  19. package/cems/assets/DModal.d.ts +84 -0
  20. package/cems/assets/DModal.js +2 -0
  21. package/cems/assets/DTable.d.ts +128 -0
  22. package/cems/assets/DTable.js +2 -0
  23. package/cems/assets/DivWidth.d.ts +14 -0
  24. package/cems/assets/DivWidth.js +2 -0
  25. package/cems/assets/Patch.d.ts +9 -0
  26. package/cems/assets/Patch.js +2 -0
  27. package/cems/assets/Sensitive.d.ts +33 -0
  28. package/cems/assets/Sensitive.js +2 -0
  29. package/cems/assets/types.d.ts +200 -0
  30. package/cems/assets/types.js +2 -0
  31. package/cems/assets/utils.d.ts +61 -0
  32. package/cems/assets/utils.js +2 -0
  33. package/cems/define.d.ts +9 -0
  34. package/cems/define.js +18 -0
  35. package/cems/index.d.ts +228 -0
  36. package/cems/index.js +81 -0
  37. package/cems/policy/CForm.d.ts +133 -0
  38. package/cems/policy/CForm.js +2 -0
  39. package/cems/policy/DApiTable.d.ts +78 -0
  40. package/cems/policy/DApiTable.js +2 -0
  41. package/cems/policy/DButton.d.ts +17 -0
  42. package/cems/policy/DButton.js +2 -0
  43. package/cems/policy/DCheckbox.d.ts +50 -0
  44. package/cems/policy/DCheckbox.js +2 -0
  45. package/cems/policy/DCheckboxGroup.d.ts +34 -0
  46. package/cems/policy/DCheckboxGroup.js +2 -0
  47. package/cems/policy/DCol.d.ts +33 -0
  48. package/cems/policy/DCol.js +2 -0
  49. package/cems/policy/DColorPicker.d.ts +9 -0
  50. package/cems/policy/DColorPicker.js +2 -0
  51. package/cems/policy/DDatePicker.d.ts +41 -0
  52. package/cems/policy/DDatePicker.js +2 -0
  53. package/cems/policy/DDiv.d.ts +65 -0
  54. package/cems/policy/DDiv.js +2 -0
  55. package/cems/policy/DDrawer.d.ts +6 -0
  56. package/cems/policy/DDrawer.js +2 -0
  57. package/cems/policy/DDynamicSelect.d.ts +50 -0
  58. package/cems/policy/DDynamicSelect.js +2 -0
  59. package/cems/policy/DDynamicTreeSelect.d.ts +45 -0
  60. package/cems/policy/DDynamicTreeSelect.js +2 -0
  61. package/cems/policy/DForm.d.ts +248 -0
  62. package/cems/policy/DForm.js +2 -0
  63. package/cems/policy/DIcon.d.ts +33 -0
  64. package/cems/policy/DIcon.js +2 -0
  65. package/cems/policy/DInput.d.ts +41 -0
  66. package/cems/policy/DInput.js +2 -0
  67. package/cems/policy/DLabel.d.ts +17 -0
  68. package/cems/policy/DLabel.js +2 -0
  69. package/cems/policy/DPTable.d.ts +86 -0
  70. package/cems/policy/DPTable.js +2 -0
  71. package/cems/policy/DRadio.d.ts +34 -0
  72. package/cems/policy/DRadio.js +2 -0
  73. package/cems/policy/DSCTable.d.ts +33 -0
  74. package/cems/policy/DSCTable.js +2 -0
  75. package/cems/policy/DSelect.d.ts +42 -0
  76. package/cems/policy/DSelect.js +2 -0
  77. package/cems/policy/DSlider.d.ts +21 -0
  78. package/cems/policy/DSlider.js +2 -0
  79. package/cems/policy/DSwitch.d.ts +21 -0
  80. package/cems/policy/DSwitch.js +2 -0
  81. package/cems/policy/DTab.d.ts +30 -0
  82. package/cems/policy/DTab.js +2 -0
  83. package/cems/policy/DTimePicker.d.ts +37 -0
  84. package/cems/policy/DTimePicker.js +2 -0
  85. package/cems/policy/DTree.d.ts +98 -0
  86. package/cems/policy/DTree.js +2 -0
  87. package/cems/policy/DUpload.d.ts +33 -0
  88. package/cems/policy/DUpload.js +2 -0
  89. package/cems/policy/types.d.ts +200 -0
  90. package/cems/policy/types.js +2 -0
  91. package/cems/policy/utils.d.ts +13 -0
  92. package/cems/policy/utils.js +2 -0
  93. package/components/Box/Box.d.ts +43 -7
  94. package/components/Box/Box.js +67 -17
  95. package/components/Box/SelectBar.d.ts +1 -1
  96. package/components/Box/SelectBar.js +19 -9
  97. package/components/Lists/BaseList.d.ts +5 -0
  98. package/components/Lists/BaseList.js +111 -0
  99. package/components/Lists/Fields/IconRender.d.ts +53 -0
  100. package/components/Lists/Fields/IconRender.js +174 -0
  101. package/components/Lists/Fields/ItemRender.d.ts +2 -0
  102. package/components/Lists/Fields/ItemRender.js +127 -0
  103. package/components/Lists/Fields/_utils.d.ts +3 -0
  104. package/components/Lists/Fields/_utils.js +80 -0
  105. package/components/Lists/Fields/index.d.ts +3 -0
  106. package/components/Lists/Fields/index.js +47 -0
  107. package/components/Lists/Grid/grid.d.ts +7 -0
  108. package/components/Lists/Grid/grid.js +18 -0
  109. package/components/Lists/Grid/index.d.ts +3 -0
  110. package/components/Lists/Grid/index.js +50 -0
  111. package/components/Lists/Row/index.d.ts +3 -0
  112. package/components/Lists/Row/index.js +14 -0
  113. package/components/Lists/SList.js +17 -7
  114. package/components/Lists/Timeline/index.d.ts +3 -0
  115. package/components/Lists/Timeline/index.js +117 -0
  116. package/components/Lists/VList.d.ts +3 -0
  117. package/components/Lists/VList.js +92 -0
  118. package/components/Lists/components/LayoutSwitcher.d.ts +13 -0
  119. package/components/Lists/components/LayoutSwitcher.js +121 -0
  120. package/components/Lists/components/SearchTool.d.ts +13 -0
  121. package/components/Lists/components/SearchTool.js +34 -0
  122. package/components/Lists/index.d.ts +129 -0
  123. package/components/Lists/index.js +2 -0
  124. package/components/SearchTool/SearchBand/BandInput.d.ts +3 -0
  125. package/components/SearchTool/SearchBand/BandInput.js +54 -0
  126. package/components/SearchTool/SearchBand/BandTag.d.ts +7 -0
  127. package/components/SearchTool/SearchBand/BandTag.js +82 -0
  128. package/components/SearchTool/SearchBand/_SearchBandAction.d.ts +3 -0
  129. package/components/SearchTool/SearchBand/_SearchBandAction.js +23 -0
  130. package/components/SearchTool/SearchBand/_SearchBandFix.d.ts +3 -0
  131. package/components/SearchTool/SearchBand/_SearchBandFix.js +72 -0
  132. package/components/SearchTool/SearchBand/_SearchBandTag.d.ts +3 -0
  133. package/components/SearchTool/SearchBand/_SearchBandTag.js +75 -0
  134. package/components/SearchTool/SearchBand/_register.d.ts +47 -0
  135. package/components/SearchTool/SearchBand/_register.js +15 -0
  136. package/components/SearchTool/SearchBand/hooks.d.ts +12 -0
  137. package/components/SearchTool/SearchBand/hooks.js +181 -0
  138. package/components/SearchTool/SearchBand/index.d.ts +3 -0
  139. package/components/SearchTool/SearchBand/index.js +66 -0
  140. package/components/SearchTool/SearchBand/type.d.ts +71 -0
  141. package/components/SearchTool/SearchBand/type.js +3 -0
  142. package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.d.ts +2 -2
  143. package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.js +22 -12
  144. package/components/{SearchBar → SearchTool/SearchBar}/ByField.d.ts +1 -1
  145. package/components/{SearchBar → SearchTool/SearchBar}/ByField.js +21 -11
  146. package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.d.ts +1 -1
  147. package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.js +20 -10
  148. package/components/{SearchBar → SearchTool/SearchBar}/SearchField.d.ts +1 -1
  149. package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.js +1 -1
  150. package/components/{SearchBar → SearchTool/SearchBar}/_register.d.ts +1 -1
  151. package/components/{SearchBar → SearchTool/SearchBar}/_register.js +3 -3
  152. package/components/SearchTool/SearchBar/index.d.ts +7 -0
  153. package/components/{SearchBar → SearchTool/SearchBar}/index.js +1 -1
  154. package/components/{SearchBar/index.d.ts → SearchTool/SearchBar/type.d.ts} +68 -67
  155. package/components/SearchTool/SearchBar/type.js +35 -0
  156. package/components/SearchTool/index.d.ts +5 -0
  157. package/components/SearchTool/index.js +7 -0
  158. package/components/Tables/ApiTable.d.ts +5 -7
  159. package/components/Tables/ApiTable.js +17 -7
  160. package/components/Tables/ApiTableModal.d.ts +5 -7
  161. package/components/Tables/ApiTableModal.js +17 -7
  162. package/components/Tables/Components/ActionBar.d.ts +8 -11
  163. package/components/Tables/Components/ActionBar.js +74 -41
  164. package/components/Tables/Components/Actions.d.ts +3 -1
  165. package/components/Tables/Components/Actions.js +40 -3
  166. package/components/Tables/Components/index.d.ts +3 -1
  167. package/components/Tables/Components/useTableContext.d.ts +16 -0
  168. package/components/Tables/Components/useTableContext.js +116 -0
  169. package/components/Tables/STable.js +17 -7
  170. package/components/Tables/TopTable.js +17 -7
  171. package/components/Tables/Util.d.ts +2 -2
  172. package/components/Tables/Util.js +0 -1
  173. package/components/Tables/VTable.d.ts +9 -9
  174. package/components/Tables/VTable.js +119 -172
  175. package/components/Tables/VTableBack.d.ts +0 -0
  176. package/components/Tables/VTableBack.js +269 -0
  177. package/components/Tables/index.d.ts +11 -22
  178. package/components/TreeSelect/BaseTreeSelect.js +17 -7
  179. package/components/TreeSelect/DTreeSelect.js +19 -9
  180. package/components/TreeSelect/FTreeSelect.js +2 -2
  181. package/components/TreeSelect/STreeSelect.js +1 -1
  182. package/components/Trees/ActionTree.d.ts +3 -5
  183. package/components/Trees/ActionTree.js +19 -9
  184. package/components/Trees/BaseTree.js +17 -7
  185. package/components/Trees/COTree/COButton.js +17 -7
  186. package/components/Trees/COTree/COSelect.js +17 -7
  187. package/components/Trees/COTree/COTree.js +19 -9
  188. package/components/Trees/DTree.d.ts +0 -7
  189. package/components/Trees/DTree.js +19 -9
  190. package/components/Trees/FTree.js +19 -9
  191. package/components/Trees/STree.js +17 -7
  192. package/components/UForm/FormWrapper.js +17 -7
  193. package/components/UForm/UDescriptions.d.ts +2 -3
  194. package/components/UForm/UDescriptions.js +17 -7
  195. package/components/UForm/UForm.d.ts +1 -1
  196. package/components/UForm/UForm.js +24 -11
  197. package/components/UForm/UFormModal.js +19 -9
  198. package/components/UForm/_FieldType.d.ts +1 -1
  199. package/components/UForm/_FieldType.js +4 -0
  200. package/components/UForm/_input.d.ts +5 -1
  201. package/components/UForm/_input.js +25 -8
  202. package/components/Upload/UploadImage.js +17 -7
  203. package/components/Upload/UploadModal.js +19 -9
  204. package/components/Upload/useUpload.js +2 -2
  205. package/components/_adapt/Alert.js +17 -7
  206. package/components/_adapt/Col.d.ts +1 -1
  207. package/components/_adapt/ColorPicker.js +17 -7
  208. package/components/_adapt/Drawer.js +17 -7
  209. package/components/_adapt/Dropdown.js +17 -7
  210. package/components/_adapt/FloatButton.js +17 -7
  211. package/components/_adapt/Input.js +17 -7
  212. package/components/_adapt/InputNumber.js +17 -7
  213. package/components/_adapt/Layout.js +17 -7
  214. package/components/_adapt/Menu.js +17 -7
  215. package/components/_adapt/Modal.js +17 -7
  216. package/components/_adapt/Popconfirm.js +17 -7
  217. package/components/_adapt/Popover.js +17 -7
  218. package/components/_adapt/Progress.js +17 -7
  219. package/components/_adapt/Select.js +17 -7
  220. package/components/_adapt/Table.js +17 -7
  221. package/components/_adapt/Tabs.js +17 -7
  222. package/components/_adapt/Tag.js +17 -7
  223. package/components/_adapt/TreeSelect.js +17 -7
  224. package/components/_adapt/todo/Image.d.ts +0 -1
  225. package/components/_adapt/todo/Segmented.d.ts +0 -1
  226. package/components/_common/AutoComplete.js +35 -12
  227. package/components/_common/CountUp.js +17 -7
  228. package/components/_common/DateRange.d.ts +5 -2
  229. package/components/_common/DateRange.js +43 -40
  230. package/components/_common/HighLight.d.ts +1 -1
  231. package/components/_common/HighLight.js +26 -24
  232. package/components/_common/Loading.js +17 -7
  233. package/components/_common/MonthRange.js +17 -7
  234. package/components/_common/PromiseLabel.js +2 -2
  235. package/components/_common/UTitle.d.ts +1 -1
  236. package/components/_common/UTitle.js +18 -8
  237. package/components/_common/Upagination.d.ts +1 -0
  238. package/components/_common/Upagination.js +5 -1
  239. package/components/_i18n.d.ts +1 -102
  240. package/components/index.d.ts +2 -2
  241. package/components/index.js +5 -1
  242. package/deps/JsonView.js +17 -7
  243. package/deps/app-audit/LookUp.js +19 -9
  244. package/deps/app-data/Const.d.ts +68 -3
  245. package/deps/app-data/Const.js +47 -3
  246. package/deps/app-data/TimeConst.d.ts +0 -0
  247. package/deps/app-data/TimeConst.js +58 -0
  248. package/deps/app-data/useSource.d.ts +22 -0
  249. package/deps/app-data/useSource.js +253 -162
  250. package/deps/echarts.d.ts +3 -0
  251. package/deps/echarts.js +20 -10
  252. package/deps/editor/Article.js +17 -7
  253. package/deps/editor/Editor.js +17 -7
  254. package/deps/editor/EditorModal.js +17 -7
  255. package/deps/editor/support/buttons/ImageButton.js +17 -7
  256. package/deps/editor/tools/Button.js +0 -2
  257. package/deps/editor/tools/_TxtButton.js +17 -7
  258. package/deps/vapc/_basic.d.ts +1 -0
  259. package/deps/vapc/_basic.js +15 -0
  260. package/deps/vapc/index.d.ts +10 -0
  261. package/deps/vapc/index.js +70 -0
  262. package/hooks/useAjaxAction.js +2 -2
  263. package/hooks/useAjaxQuery.js +2 -2
  264. package/hooks/useApiBase.js +2 -2
  265. package/hooks/useApiGlobal.js +1 -1
  266. package/hooks/useArray.js +2 -2
  267. package/hooks/useDefault.d.ts +0 -1
  268. package/hooks/useDoLoad.d.ts +1 -1
  269. package/hooks/useError.d.ts +1 -1
  270. package/hooks/useMemoPromise.js +2 -2
  271. package/index.d.ts +2 -1
  272. package/index.js +1 -1
  273. package/login/Base65.d.ts +7 -1
  274. package/login/Base65.js +49 -22
  275. package/login/Password.d.ts +8 -5
  276. package/login/Password.js +68 -102
  277. package/package.json +1 -1
  278. package/screen/Page.js +17 -7
  279. package/screen/vapc-schema/dark.d.ts +1 -0
  280. package/screen/vapc-schema/dark.js +50 -0
  281. package/screen/vapc-schema/insight.d.ts +1 -0
  282. package/screen/vapc-schema/insight.js +49 -0
  283. package/uform/FormEditor.js +17 -7
  284. package/uform/FormViewer.js +17 -7
  285. package/uform/hooks/useEditor.d.ts +0 -1
  286. package/uform/hooks/useForm.d.ts +0 -1
  287. package/uform/inputs/index.d.ts +0 -1
  288. package/uform/panel/Editor/_GroupDefault.js +17 -7
  289. package/uform/panel/Editor/_GroupStep.js +17 -7
  290. package/uform/panel/Editor/_GroupTab.js +17 -7
  291. package/uform/panel/Editor/index.js +17 -7
  292. package/uform/panel/Items/Fields.js +17 -7
  293. package/uform/panel/Items/InputSelector.js +17 -7
  294. package/uform/panel/Items/Inputs.js +17 -7
  295. package/uform/panel/Items/index.d.ts +1 -1
  296. package/uform/panel/Propreties/CanvasProperties.js +17 -7
  297. package/uform/panel/Propreties/Component/FieldPlugin.js +17 -7
  298. package/uform/panel/Propreties/Component/LinkAsyncFunction.js +17 -7
  299. package/uform/panel/Propreties/Component/LinkSyncFunction.js +17 -7
  300. package/uform/panel/Propreties/Component/Links.js +17 -7
  301. package/uform/panel/Propreties/Component/OptionTable.js +17 -7
  302. package/uform/panel/Propreties/Component/RegexpModal.js +17 -7
  303. package/uform/panel/Propreties/Component/Validate.js +17 -7
  304. package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +17 -7
  305. package/uform/panel/Propreties/Component/ValidateSyncFunction.js +17 -7
  306. package/uform/panel/Propreties/FieldOptions.js +17 -7
  307. package/uform/panel/Propreties/FieldProperties.js +17 -7
  308. package/uform/panel/Propreties/_ItemAdvance.js +17 -7
  309. package/uform/panel/Propreties/_ItemBase.js +17 -7
  310. package/uform/panel/Propreties/_ItemLink.js +17 -7
  311. package/uform/panel/Propreties/_ItemValidate.js +17 -7
  312. package/uform/schema.d.ts +1 -1
  313. package/uform/utils/Convert.js +2 -2
  314. package/utils/Ajax.d.ts +3 -0
  315. package/utils/Ajax.js +22 -16
  316. package/utils/CacheUtil.d.ts +1 -1
  317. package/utils/Const.js +17 -7
  318. package/utils/Format.d.ts +138 -14
  319. package/utils/Format.js +132 -23
  320. package/utils/Global.d.ts +46 -2
  321. package/utils/Global.js +24 -2
  322. package/utils/PageUtil.d.ts +111 -23
  323. package/utils/PageUtil.js +163 -28
  324. package/utils/Renders/ApiGetRender.js +25 -12
  325. package/utils/Renders/ApiPostRender.js +3 -3
  326. package/utils/Renders/CondictionRender.js +17 -7
  327. package/utils/Renders/DateRender.js +20 -2
  328. package/utils/Renders/ListRender.js +1 -1
  329. package/utils/Renders/NumberRender.js +24 -5
  330. package/utils/Renders/StringRender.js +81 -11
  331. package/utils/Renders/_define.d.ts +8 -7
  332. package/utils/Renders/_define.js +76 -17
  333. package/utils/StringUtil.d.ts +292 -62
  334. package/utils/StringUtil.js +310 -63
  335. package/utils/TreeUtil.js +14 -12
  336. package/utils/VAP.d.ts +26 -1
  337. package/utils/VAP.js +57 -1
  338. package/utils/_AjaxUtil.d.ts +1 -0
  339. package/utils/_AjaxUtil.js +70 -3
  340. package/utils/_Support.d.ts +2 -2
  341. package/utils/_Support.js +4 -2
  342. package/utils/crontab/_en.d.ts +2 -0
  343. package/utils/crontab/_en.js +178 -0
  344. package/utils/crontab/_global.d.ts +11 -0
  345. package/utils/crontab/_global.js +23 -0
  346. package/utils/crontab/_zh_CN.d.ts +2 -0
  347. package/utils/crontab/_zh_CN.js +180 -0
  348. package/utils/crontab/_zh_TW.d.ts +2 -0
  349. package/utils/crontab/_zh_TW.js +170 -0
  350. package/utils/crontab/crontabParser.d.ts +1 -0
  351. package/utils/crontab/crontabParser.js +251 -0
  352. package/utils/crontab/crontabRender.d.ts +23 -0
  353. package/utils/crontab/crontabRender.js +502 -0
  354. package/utils/crontab/index.d.ts +3 -0
  355. package/utils/crontab/index.js +9 -0
  356. package/utils/crontab/type.d.ts +79 -0
  357. package/utils/crontab/type.js +2 -0
  358. package/utils/crontab/utils.d.ts +20 -0
  359. package/utils/crontab/utils.js +122 -0
  360. package/utils/i18n.d.ts +13 -2
  361. package/utils/i18n.js +13 -2
  362. package/utils/index.d.ts +4 -0
  363. package/utils/index.js +19 -9
  364. package/utils/py.js +2 -0
  365. package/components/SearchBar/_FieldType.d.ts +0 -8
  366. package/components/SearchBar/_FieldType.js +0 -51
  367. /package/components/{SearchBar → SearchTool/SearchBar}/SearchField.js +0 -0
  368. /package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.d.ts +0 -0
@@ -0,0 +1,38 @@
1
+ import type { FC } from "react";
2
+ import type { PlainObject } from "../../basetype";
3
+ import type { BaseOptions } from "./types";
4
+ export interface DInfoProps extends BaseOptions {
5
+ /**
6
+ * 数据详情
7
+ */
8
+ info?: PlainObject;
9
+ /**
10
+ * 显示详情 {dataIndex:'',name:''}
11
+ */
12
+ cols?: PlainObject[];
13
+ /**
14
+ * 标题的宽度
15
+ */
16
+ titleWidth?: number;
17
+ /**
18
+ * 显示列数量
19
+ */
20
+ colNum?: number;
21
+ /**
22
+ * 分组名称
23
+ */
24
+ groupName?: string[] | string;
25
+ /**
26
+ * 显示分组名称
27
+ */
28
+ showGroupName?: boolean;
29
+ /**
30
+ * 显示名称
31
+ */
32
+ showName?: string[] | string;
33
+ /**
34
+ * 内容格式化
35
+ */
36
+ colRender?: (sCol: any, info: any, cValue: any) => any;
37
+ }
38
+ export type DInfoComponent = FC<DInfoProps>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,84 @@
1
+ import type { PlainObject } from '../../basetype';
2
+ import type { FC, PropsWithChildren, ReactNode } from 'react';
3
+ import type { DrawerProps } from '../../components/_adapt/Drawer';
4
+ import type { DApiProp, BaseOptions } from './types';
5
+ import type { DTableProps } from './DTable';
6
+ import type { ForwardRefExoticComponent, RefAttributes } from 'react';
7
+ import type { VTableRef } from '../../components/Tables/VTable';
8
+ export interface DModalInfoProps extends BaseOptions {
9
+ /**
10
+ * modal的参数
11
+ */
12
+ modalProps: any;
13
+ /**
14
+ * 弹窗的宽度
15
+ */
16
+ width?: any;
17
+ /**
18
+ * 接口参数
19
+ */
20
+ api?: DApiProp;
21
+ /**
22
+ * 数据详情
23
+ */
24
+ info?: PlainObject;
25
+ /**
26
+ * 显示详情
27
+ */
28
+ cols?: PlainObject[];
29
+ /**
30
+ * 抽屉右上角的操作区域
31
+ */
32
+ extra?: ReactNode;
33
+ /**
34
+ * 抽屉的页脚
35
+ */
36
+ footer?: ReactNode;
37
+ /**
38
+ * 自定义渲染info
39
+ */
40
+ modalRender?: () => ReactNode;
41
+ /**
42
+ * 标题的宽度
43
+ */
44
+ titleWidth?: number;
45
+ /**
46
+ * Drawer的参数
47
+ */
48
+ drawerProps?: DrawerProps;
49
+ }
50
+ /**
51
+ * 动态接口公共单行的详情页面
52
+ */
53
+ export type DModalInfoComponent = FC<PropsWithChildren<DModalInfoProps>>;
54
+ export interface DModalTableProps extends BaseOptions {
55
+ /**
56
+ * modal的参数
57
+ */
58
+ modalProps: any;
59
+ /**
60
+ * 弹窗的宽度
61
+ */
62
+ width?: any;
63
+ /**
64
+ * 接口参数
65
+ */
66
+ api: DApiProp;
67
+ /**
68
+ * 抽屉右上角的操作区域
69
+ */
70
+ extra?: ReactNode;
71
+ /**
72
+ * 抽屉的页脚
73
+ */
74
+ footer?: ReactNode;
75
+ /**
76
+ * DTable的显示参数
77
+ */
78
+ tableProps?: DTableProps;
79
+ /**
80
+ * Drawer的参数
81
+ */
82
+ drawerProps?: DrawerProps;
83
+ }
84
+ export type DModalTableComponent = ForwardRefExoticComponent<DModalTableProps & RefAttributes<VTableRef>>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,128 @@
1
+ import type { Key, PlainObject } from "../../basetype";
2
+ import type { SearchBarProps } from "../../components/SearchTool";
3
+ import type { TableColumn } from "../../components/Tables";
4
+ import type { BoxMode } from '../../components/Box/Box';
5
+ import type { VTableProps, VTableRef } from '../../components/Tables/VTable';
6
+ import type { TableActionButton } from '../../components/Tables/Components/ActionBar';
7
+ import type { DApiListState, BaseOptions, DApiProp } from './types';
8
+ import type { ForwardRefExoticComponent, RefAttributes } from "react";
9
+ export type DTableAction = (ids?: Key[], objs?: PlainObject[], param?: PlainObject, model?: DApiListState, config?: any) => void;
10
+ export type DTableActionButton = Omit<TableActionButton, 'onClick' | 'children'> & {
11
+ /**
12
+ * 点击事件
13
+ */
14
+ onClick?: DTableAction;
15
+ /**
16
+ * 二级按钮
17
+ * 说明 : 最多支持2级子菜单,不能递归
18
+ */
19
+ children?: DTableActionButton[];
20
+ /**
21
+ * 导出类型 excel、xml、txt 带上表示是导出按钮,可不写onClick
22
+ */
23
+ exportType?: string;
24
+ /**
25
+ * 导出类型 excel、xml、txt 带上表示是导出按钮,可不写onClick
26
+ */
27
+ config?: any;
28
+ /**
29
+ * 是否显示
30
+ */
31
+ show?: boolean;
32
+ };
33
+ export interface DTableProps extends BaseOptions {
34
+ /**
35
+ * 自定义格式化显示列
36
+ * @param cols 显示列
37
+ * @returns
38
+ */
39
+ fmt?: (cols: any) => any;
40
+ /**
41
+ * 自定义格式化显示搜索项
42
+ * @param fields 显示搜索项
43
+ * @returns
44
+ */
45
+ fmtfields?: (fields: any) => any;
46
+ /**
47
+ * 自定义格式化快速搜索项
48
+ * @param keyword 快速搜索项
49
+ * @returns
50
+ */
51
+ fmtKeyword?: (keyword: any) => any;
52
+ /**
53
+ * 操作按钮
54
+ */
55
+ actionBar?: (DTableActionButton[]) | React.ReactNode;
56
+ /**
57
+ * 高级搜索的标题宽和内容宽 默认[150,200]
58
+ */
59
+ fieldWidth?: number | [number, number];
60
+ /**
61
+ * 高级搜索的显示几列
62
+ */
63
+ fieldCols?: 1 | 2 | 3 | 4;
64
+ /**
65
+ * 是否显示导出按钮
66
+ */
67
+ showExportButton?: boolean;
68
+ /**
69
+ * 是否显示刷新按钮
70
+ */
71
+ showRefreshButton?: boolean;
72
+ /**
73
+ * 是否隐藏查询(模糊+高级查询)
74
+ */
75
+ hideSearch?: boolean;
76
+ /**
77
+ * 是否隐藏高级查询
78
+ */
79
+ hideAdvSearch?: boolean;
80
+ /**
81
+ * 是否隐藏操作按钮
82
+ */
83
+ hideActionBar?: boolean;
84
+ /**
85
+ * 是否隐藏分页
86
+ */
87
+ hidePage?: boolean;
88
+ /**
89
+ * 展示模式
90
+ * common : 默认,无固定高度
91
+ * inner : 当 Table 在一个高度固定的容器内时,使用 inner 模式
92
+ * fixed : 页面可见区域只有一个 Table 时, 使用 fixed 模式
93
+ */
94
+ mode?: BoxMode;
95
+ /**
96
+ * 是否显示复选框
97
+ */
98
+ select?: boolean;
99
+ /**
100
+ * 表格搜索区域
101
+ */
102
+ searchBar?: Omit<SearchBarProps, 'onChange' | 'onSearch'>;
103
+ /**
104
+ * 列
105
+ */
106
+ columns?: TableColumn[];
107
+ /**
108
+ * 显示数据
109
+ */
110
+ rows?: any[];
111
+ /**
112
+ * VTable的其他属性
113
+ */
114
+ vtableProps?: Omit<VTableProps, 'columns' | 'model'>;
115
+ /**
116
+ * state 使用useGlobal共享状态 默认false
117
+ */
118
+ globalState?: boolean;
119
+ /**
120
+ * 主键
121
+ */
122
+ rowKey?: string;
123
+ /**
124
+ * 默认选择行 子表时VTable不支持
125
+ */
126
+ SelectedKeys?: (string | number)[];
127
+ }
128
+ export type DTableComponent = ForwardRefExoticComponent<DApiProp & DTableProps & RefAttributes<VTableRef>>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ import type { BaseOptions } from "./types";
3
+ export interface DivWidthProps extends BaseOptions {
4
+ /**
5
+ * 内容
6
+ */
7
+ text?: string;
8
+ /**
9
+ * 宽度
10
+ */
11
+ width: number;
12
+ textKey?: string;
13
+ }
14
+ export type DivWidthComponent = FC<PropsWithChildren<DivWidthProps>>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { FC } from "react";
2
+ import type { BaseOptions } from "./types";
3
+ export interface PatchProps extends BaseOptions {
4
+ devOnlyId: string;
5
+ pSuffix?: string;
6
+ state?: string;
7
+ level?: string;
8
+ }
9
+ export type PatchComponent = FC<PatchProps>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,33 @@
1
+ import type { FC } from "react";
2
+ import type { BaseOptions } from "./types";
3
+ export interface SensitiveProps extends BaseOptions {
4
+ /**
5
+ * key名
6
+ */
7
+ keyId: string;
8
+ /**
9
+ * key值
10
+ */
11
+ keyValue: string;
12
+ /**
13
+ * 显示名
14
+ */
15
+ field: string;
16
+ /**
17
+ * 显示内容
18
+ */
19
+ desc: string;
20
+ /**
21
+ * 请求接口 默认值 '/api/d/assets/device/g'
22
+ */
23
+ url?: string;
24
+ /**
25
+ * 内容在左边还是在右边,有值在左边,默认在右边
26
+ */
27
+ left?: string;
28
+ /**
29
+ * 宽度
30
+ */
31
+ width?: number;
32
+ }
33
+ export type SensitiveComponent = FC<SensitiveProps>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,200 @@
1
+ import type { MutableRefObject } from 'react';
2
+ import type { PlainObject } from '../../basetype';
3
+ import type { Field } from '../../components/SearchTool/SearchBar/type';
4
+ import type { ApiListState } from '../../hooks/_list';
5
+ import type { AOP, ApiOption } from '../../hooks/useApiBase';
6
+ import type { VTableRef } from '../../components/Tables/VTable';
7
+ /**
8
+ * 自行扩展/容错
9
+ */
10
+ export interface BaseOptions {
11
+ [key: string]: any;
12
+ }
13
+ export type DApiAOP = AOP & {
14
+ afterInit?: (config: PlainObject, resp?: PlainObject) => void;
15
+ };
16
+ export type DApiProp = {
17
+ /**
18
+ * 动态接口地址 /api/d/ 开头的接口地址
19
+ */
20
+ api?: string;
21
+ /**
22
+ * 接口默认参数
23
+ */
24
+ params?: PlainObject;
25
+ /**
26
+ * 当api改变后,
27
+ * 赋值大于0的值 即可重新加载数据和显示列
28
+ */
29
+ reloadInit?: number;
30
+ /**
31
+ * 是否初始化数据
32
+ */
33
+ initRow?: boolean;
34
+ /**
35
+ * 说明:AOP 方法
36
+ * before/after Action 是 add/update/delete/init 的集成方式,
37
+ */
38
+ aop?: DApiAOP;
39
+ /**
40
+ * 当params改变后
41
+ * 赋值大于0的值 即可重新加载数据
42
+ */
43
+ reloadRow?: number;
44
+ /**
45
+ * devInfo 设备详情接口的隐秘显示接口地址(专用)
46
+ */
47
+ sUrl?: string;
48
+ /**
49
+ * 功能开关
50
+ */
51
+ config?: PlainObject;
52
+ /**
53
+ * 加载数据
54
+ */
55
+ initData?: boolean;
56
+ /**
57
+ * 改变数据
58
+ */
59
+ changeData?: any;
60
+ /**
61
+ * 改成类型 |'del'|'update'|'add'
62
+ */
63
+ changeType?: string;
64
+ /**
65
+ * 全部更新或局部更新
66
+ */
67
+ changeDiffUpdate?: boolean;
68
+ /**
69
+ * 清理引号空值的参数
70
+ */
71
+ cheanEmpty?: boolean;
72
+ /**
73
+ * 改变应用 >0
74
+ */
75
+ changeReload?: number;
76
+ /**
77
+ * 是否转换上下级模式的数据
78
+ */
79
+ parentId?: string;
80
+ /**
81
+ * 上下级模式的数据的根标记
82
+ */
83
+ rootId?: string;
84
+ /**
85
+ * 前端本地数据 快速搜索的列名
86
+ */
87
+ keyword?: string[];
88
+ };
89
+ export type DApiOption = Omit<ApiOption, 'aop'> & {
90
+ /**
91
+ * 区分api接口地址的后缀
92
+ */
93
+ pSuffix?: string;
94
+ /**
95
+ * true 加载数据+加载显示列
96
+ * false 仅仅加载显示列
97
+ * 默认true
98
+ */
99
+ initRow?: boolean;
100
+ /**
101
+ * 是否前端分页
102
+ */
103
+ localPage?: boolean;
104
+ /**
105
+ * devInfo 设备详情接口的隐秘显示接口地址(专用)
106
+ */
107
+ sUrl?: string;
108
+ /**
109
+ * 功能开关
110
+ */
111
+ config?: PlainObject;
112
+ /**
113
+ * 是否初始数据
114
+ */
115
+ initData?: boolean;
116
+ /**
117
+ * 当api改变后,
118
+ * 赋值大于0的值 即可重新加载数据和显示列
119
+ */
120
+ reloadInit?: number;
121
+ /**
122
+ * 当params改变后
123
+ * 赋值大于0的值 即可重新加载数据
124
+ */
125
+ reloadRow?: number;
126
+ /**
127
+ * 说明:AOP 方法
128
+ * before/after Action 是 add/update/delete/init 的集成方式,
129
+ */
130
+ aop?: DApiAOP;
131
+ /**
132
+ * VTable的选择行和参数
133
+ */
134
+ selectRef?: MutableRefObject<VTableRef>;
135
+ /**
136
+ * 清理引号空值的参数
137
+ */
138
+ cheanEmpty?: boolean;
139
+ /**
140
+ * 静态数据
141
+ */
142
+ rows?: any;
143
+ /**
144
+ * 是否转换上下级模式的数据
145
+ */
146
+ parentId?: string;
147
+ /**
148
+ * 上下级模式的数据的根标记
149
+ */
150
+ rootId?: string;
151
+ /**
152
+ * 前端本地数据 快速搜索的列名
153
+ */
154
+ keyword?: string[];
155
+ /**
156
+ * 前端分页,默认分页
157
+ */
158
+ page?: boolean;
159
+ };
160
+ export type DApiListState = Omit<ApiListState, 'mode'> & {
161
+ mode: 'dapi';
162
+ /**
163
+ * 导出下载
164
+ */
165
+ download: (param: PlainObject) => void;
166
+ /**
167
+ * 初始化显示列和显示数据
168
+ */
169
+ initRefresh: (param: PlainObject) => void;
170
+ /**
171
+ * 显示列
172
+ */
173
+ columns?: PlainObject[];
174
+ /**
175
+ * 快速搜索
176
+ */
177
+ keyword_?: string;
178
+ /**
179
+ * 高级搜索项
180
+ */
181
+ fields: Field[];
182
+ /**
183
+ * 功能开工
184
+ */
185
+ config: PlainObject;
186
+ /**
187
+ * 请求参数
188
+ */
189
+ param: PlainObject;
190
+ /**
191
+ * data的数据
192
+ */
193
+ info: any;
194
+ /**
195
+ * 局部更新
196
+ * @param data
197
+ * @returns
198
+ */
199
+ doDiffUpdate: (data: PlainObject | PlainObject[]) => void;
200
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,61 @@
1
+ import type { PlainObject } from "../../basetype";
2
+ import type { DApiProp, DApiOption, DApiListState } from "./types";
3
+ export type AjaxPostDataFN = (pUrl: string, pdata: PlainObject, defMsg: string, successAfter?: (json: any) => Promise<boolean>, failAfter?: (errMsg: any) => Promise<boolean>) => Promise<void>;
4
+ export type GetReload = (clear?: boolean) => number;
5
+ export type DModalsState = {
6
+ /**
7
+ * 弹窗的参数
8
+ */
9
+ modalProps: {
10
+ onClose: () => void;
11
+ open: boolean;
12
+ title: string;
13
+ };
14
+ /**
15
+ * 弹窗打开状态
16
+ */
17
+ open: boolean;
18
+ /**
19
+ * api接口参数
20
+ */
21
+ api: DApiProp;
22
+ /**
23
+ * 数据详情
24
+ */
25
+ info?: any;
26
+ /**
27
+ * 显示详情
28
+ */
29
+ cols?: PlainObject[];
30
+ };
31
+ export type UseDModals = (apiUrl?: string) => {
32
+ modalState: DModalsState;
33
+ hide: () => void;
34
+ show: (title: string, params?: PlainObject, reloadInit?: boolean, cheanEmpty?: boolean) => void;
35
+ showApi: (title: string, apiUrl: string, params?: PlainObject, cheanEmpty?: boolean) => void;
36
+ showInfo: (title: string, info?: any, cols?: PlainObject[]) => void;
37
+ };
38
+ export type DApiGlobalOption = DApiOption & {
39
+ /**
40
+ * 指定存储空间,
41
+ * 不指定时会以当前页面的URL做为存储空间。
42
+ * 当同一个页面使用两个 不同的 useApiGlobal ,必须为两个 hook 分别指定,应用内唯一NAMESPACE
43
+ */
44
+ namespace?: string;
45
+ };
46
+ export type UseDApi = (options: string | DApiOption) => DApiListState;
47
+ export type UseDApiGlobal = (options: string | DApiGlobalOption) => DApiListState;
48
+ /**
49
+ * 格式化显示列
50
+ * @param resp 接口返回内容
51
+ * @param cConfig 配置参数
52
+ * @returns
53
+ */
54
+ export type FormatColumns = (resp: any, cConfig: any) => any;
55
+ /**
56
+ * 格式化显示列
57
+ * @param cols 接口返回内容
58
+ * @param cConfig 配置参数
59
+ * @returns
60
+ */
61
+ export type FormatCols = (cols: PlainObject[], sUrl: any) => any;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { ComponentType } from 'react';
2
+ /**
3
+ * 定义一个组件
4
+ */
5
+ export declare const defineComponent: (type: string, Component: ComponentType<any>) => void;
6
+ /**
7
+ * 定义一个工具/方法
8
+ */
9
+ export declare const defineMethod: (type: string, Method: any) => void;
package/cems/define.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineMethod = exports.defineComponent = void 0;
4
+ var index_1 = require("./index");
5
+ /**
6
+ * 定义一个组件
7
+ */
8
+ var defineComponent = function (type, Component) {
9
+ index_1.COMPONENTS[type] = Component;
10
+ };
11
+ exports.defineComponent = defineComponent;
12
+ /**
13
+ * 定义一个工具/方法
14
+ */
15
+ var defineMethod = function (type, Method) {
16
+ index_1.UTILS[type] = Method;
17
+ };
18
+ exports.defineMethod = defineMethod;