@ibiz-template/vue3-components 0.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/es/common/app-icon/app-icon.d.ts +19 -0
  2. package/es/common/app-icon/app-icon.js +71 -0
  3. package/es/common/app-keep-alive/app-keep-alive.d.ts +47 -0
  4. package/es/common/app-keep-alive/app-keep-alive.js +297 -0
  5. package/es/common/app-keep-alive/scheduler.d.ts +39 -0
  6. package/es/common/app-keep-alive/scheduler.js +171 -0
  7. package/es/common/app-router-view/app-router-view.d.ts +30 -0
  8. package/es/common/app-router-view/app-router-view.js +73 -0
  9. package/es/common/app-user/app-user.d.ts +8 -0
  10. package/es/common/app-user/app-user.js +60 -0
  11. package/es/common/grid-pagination/grid-pagination.d.ts +41 -0
  12. package/es/common/grid-pagination/grid-pagination.js +84 -0
  13. package/es/common/grid-pagination/index.d.ts +40 -0
  14. package/es/common/grid-pagination/index.js +9 -0
  15. package/es/common/index.d.ts +8 -0
  16. package/es/common/index.js +8 -0
  17. package/es/common/quick-search/quick-search.d.ts +30 -0
  18. package/es/common/quick-search/quick-search.js +63 -0
  19. package/es/common/tab-page-exp/tab-page-exp.d.ts +69 -0
  20. package/es/common/tab-page-exp/tab-page-exp.js +117 -0
  21. package/es/control/app-menu/app-menu-provider.d.ts +13 -0
  22. package/es/control/app-menu/app-menu-provider.js +14 -0
  23. package/es/control/app-menu/app-menu.d.ts +54 -0
  24. package/es/control/app-menu/app-menu.js +178 -0
  25. package/es/control/app-menu/index.d.ts +53 -0
  26. package/es/control/app-menu/index.js +12 -0
  27. package/es/control/grid-control/grid-control.d.ts +158 -0
  28. package/es/control/grid-control/grid-control.util.d.ts +38 -0
  29. package/es/control/grid-control/grid-control.util.js +84 -0
  30. package/es/control/grid-control/grid-field-column/grid-field-column.d.ts +26 -0
  31. package/es/control/grid-control/grid-field-column-provider.d.ts +15 -0
  32. package/es/control/grid-control/grid-field-column-provider.js +20 -0
  33. package/es/control/grid-control/grid-provider.d.ts +13 -0
  34. package/es/control/grid-control/grid-provider.js +14 -0
  35. package/es/control/grid-control/index.d.ts +114 -0
  36. package/es/control/grid-control/index.js +23 -0
  37. package/es/control/index.d.ts +3 -0
  38. package/es/control/index.js +3 -0
  39. package/es/control/toolbar-control/index.d.ts +43 -0
  40. package/es/control/toolbar-control/index.js +12 -0
  41. package/es/control/toolbar-control/toolbar-control.d.ts +44 -0
  42. package/es/control/toolbar-control/toolbar-provider.d.ts +13 -0
  43. package/es/control/toolbar-control/toolbar-provider.js +14 -0
  44. package/es/index.d.ts +4 -0
  45. package/es/index.js +4 -0
  46. package/es/layout/app-layout/app-layout.d.ts +32 -0
  47. package/es/layout/control-base/control-base.d.ts +17 -0
  48. package/es/layout/control-base/control-base.js +42 -0
  49. package/es/layout/control-layout/control-layout.d.ts +19 -0
  50. package/es/layout/control-shell/control-shell.d.ts +18 -0
  51. package/es/layout/index.d.ts +10 -0
  52. package/es/layout/index.js +20 -0
  53. package/es/layout/md-view-base/md-view-base.d.ts +12 -0
  54. package/es/layout/md-view-base/md-view-base.js +35 -0
  55. package/es/layout/router-shell/router-shell.d.ts +27 -0
  56. package/es/layout/router-shell/router-shell.js +96 -0
  57. package/es/layout/view-base/view-base.d.ts +18 -0
  58. package/es/layout/view-layout/view-layout.d.ts +44 -0
  59. package/es/layout/view-shell/view-shell.d.ts +42 -0
  60. package/es/shims-vue.d.ts +5 -0
  61. package/es/util/install.d.ts +3 -0
  62. package/es/util/install.js +9 -0
  63. package/es/views/edit-view/index.d.ts +3 -0
  64. package/es/views/edit-view/index.js +9 -0
  65. package/es/views/edit-view/src/edit-view.css +6 -0
  66. package/es/views/edit-view/src/edit-view.d.ts +3 -0
  67. package/es/views/edit-view/src/edit-view.js +15 -0
  68. package/es/views/grid-view/grid-view-engine.d.ts +8 -0
  69. package/es/views/grid-view/grid-view-engine.js +21 -0
  70. package/es/views/grid-view/grid-view-provider.d.ts +13 -0
  71. package/es/views/grid-view/grid-view-provider.js +14 -0
  72. package/es/views/grid-view/grid-view.d.ts +32 -0
  73. package/es/views/grid-view/grid-view.js +64 -0
  74. package/es/views/grid-view/index.d.ts +32 -0
  75. package/es/views/grid-view/index.js +14 -0
  76. package/es/views/index-view/index-view-default.d.ts +22 -0
  77. package/es/views/index-view/index-view-default.js +117 -0
  78. package/es/views/index-view/index-view-engine.d.ts +6 -0
  79. package/es/views/index-view/index-view-engine.js +9 -0
  80. package/es/views/index-view/index-view-exp.d.ts +29 -0
  81. package/es/views/index-view/index-view-exp.js +177 -0
  82. package/es/views/index-view/index-view-provider.d.ts +13 -0
  83. package/es/views/index-view/index-view-provider.js +14 -0
  84. package/es/views/index-view/index-view.d.ts +44 -0
  85. package/es/views/index-view/index-view.js +155 -0
  86. package/es/views/index-view/index.d.ts +44 -0
  87. package/es/views/index-view/index.js +14 -0
  88. package/es/views/index.d.ts +4 -0
  89. package/es/views/index.js +6 -0
  90. package/lib/common/app-icon/app-icon.d.ts +19 -0
  91. package/lib/common/app-icon/app-icon.js +71 -0
  92. package/lib/common/app-keep-alive/app-keep-alive.d.ts +47 -0
  93. package/lib/common/app-keep-alive/app-keep-alive.js +297 -0
  94. package/lib/common/app-keep-alive/scheduler.d.ts +39 -0
  95. package/lib/common/app-keep-alive/scheduler.js +171 -0
  96. package/lib/common/app-router-view/app-router-view.d.ts +30 -0
  97. package/lib/common/app-router-view/app-router-view.js +73 -0
  98. package/lib/common/app-user/app-user.d.ts +8 -0
  99. package/lib/common/app-user/app-user.js +60 -0
  100. package/lib/common/grid-pagination/grid-pagination.d.ts +41 -0
  101. package/lib/common/grid-pagination/grid-pagination.js +84 -0
  102. package/lib/common/grid-pagination/index.d.ts +40 -0
  103. package/lib/common/grid-pagination/index.js +9 -0
  104. package/lib/common/index.d.ts +8 -0
  105. package/lib/common/index.js +66 -0
  106. package/lib/common/quick-search/quick-search.d.ts +30 -0
  107. package/lib/common/quick-search/quick-search.js +63 -0
  108. package/lib/common/tab-page-exp/tab-page-exp.d.ts +69 -0
  109. package/lib/common/tab-page-exp/tab-page-exp.js +117 -0
  110. package/lib/control/app-menu/app-menu-provider.d.ts +13 -0
  111. package/lib/control/app-menu/app-menu-provider.js +14 -0
  112. package/lib/control/app-menu/app-menu.d.ts +54 -0
  113. package/lib/control/app-menu/app-menu.js +178 -0
  114. package/lib/control/app-menu/index.d.ts +53 -0
  115. package/lib/control/app-menu/index.js +12 -0
  116. package/lib/control/grid-control/grid-control.d.ts +158 -0
  117. package/lib/control/grid-control/grid-control.util.d.ts +38 -0
  118. package/lib/control/grid-control/grid-control.util.js +84 -0
  119. package/lib/control/grid-control/grid-field-column/grid-field-column.d.ts +26 -0
  120. package/lib/control/grid-control/grid-field-column-provider.d.ts +15 -0
  121. package/lib/control/grid-control/grid-field-column-provider.js +20 -0
  122. package/lib/control/grid-control/grid-provider.d.ts +13 -0
  123. package/lib/control/grid-control/grid-provider.js +14 -0
  124. package/lib/control/grid-control/index.d.ts +114 -0
  125. package/lib/control/grid-control/index.js +24 -0
  126. package/lib/control/index.d.ts +3 -0
  127. package/lib/control/index.js +26 -0
  128. package/lib/control/toolbar-control/index.d.ts +43 -0
  129. package/lib/control/toolbar-control/index.js +12 -0
  130. package/lib/control/toolbar-control/toolbar-control.d.ts +44 -0
  131. package/lib/control/toolbar-control/toolbar-provider.d.ts +13 -0
  132. package/lib/control/toolbar-control/toolbar-provider.js +14 -0
  133. package/lib/index.d.ts +4 -0
  134. package/lib/index.js +34 -0
  135. package/lib/layout/app-layout/app-layout.d.ts +32 -0
  136. package/lib/layout/control-base/control-base.d.ts +17 -0
  137. package/lib/layout/control-base/control-base.js +42 -0
  138. package/lib/layout/control-layout/control-layout.d.ts +19 -0
  139. package/lib/layout/control-shell/control-shell.d.ts +18 -0
  140. package/lib/layout/index.d.ts +10 -0
  141. package/lib/layout/index.js +44 -0
  142. package/lib/layout/md-view-base/md-view-base.d.ts +12 -0
  143. package/lib/layout/md-view-base/md-view-base.js +35 -0
  144. package/lib/layout/router-shell/router-shell.d.ts +27 -0
  145. package/lib/layout/router-shell/router-shell.js +96 -0
  146. package/lib/layout/view-base/view-base.d.ts +18 -0
  147. package/lib/layout/view-layout/view-layout.d.ts +44 -0
  148. package/lib/layout/view-shell/view-shell.d.ts +42 -0
  149. package/lib/shims-vue.d.ts +5 -0
  150. package/lib/util/install.d.ts +3 -0
  151. package/lib/util/install.js +9 -0
  152. package/lib/views/edit-view/index.d.ts +3 -0
  153. package/lib/views/edit-view/index.js +8 -0
  154. package/lib/views/edit-view/src/edit-view.css +6 -0
  155. package/lib/views/edit-view/src/edit-view.d.ts +3 -0
  156. package/lib/views/edit-view/src/edit-view.js +14 -0
  157. package/lib/views/grid-view/grid-view-engine.d.ts +8 -0
  158. package/lib/views/grid-view/grid-view-engine.js +21 -0
  159. package/lib/views/grid-view/grid-view-provider.d.ts +13 -0
  160. package/lib/views/grid-view/grid-view-provider.js +14 -0
  161. package/lib/views/grid-view/grid-view.d.ts +32 -0
  162. package/lib/views/grid-view/grid-view.js +64 -0
  163. package/lib/views/grid-view/index.d.ts +32 -0
  164. package/lib/views/grid-view/index.js +14 -0
  165. package/lib/views/index-view/index-view-default.d.ts +22 -0
  166. package/lib/views/index-view/index-view-default.js +117 -0
  167. package/lib/views/index-view/index-view-engine.d.ts +6 -0
  168. package/lib/views/index-view/index-view-engine.js +9 -0
  169. package/lib/views/index-view/index-view-exp.d.ts +29 -0
  170. package/lib/views/index-view/index-view-exp.js +177 -0
  171. package/lib/views/index-view/index-view-provider.d.ts +13 -0
  172. package/lib/views/index-view/index-view-provider.js +14 -0
  173. package/lib/views/index-view/index-view.d.ts +44 -0
  174. package/lib/views/index-view/index-view.js +155 -0
  175. package/lib/views/index-view/index.d.ts +44 -0
  176. package/lib/views/index-view/index.js +14 -0
  177. package/lib/views/index.d.ts +4 -0
  178. package/lib/views/index.js +20 -0
  179. package/package.json +71 -0
  180. package/src/common/app-col/app-col.tsx +90 -0
  181. package/src/common/app-icon/app-icon.tsx +58 -0
  182. package/src/common/app-keep-alive/app-keep-alive.ts +441 -0
  183. package/src/common/app-keep-alive/scheduler.ts +281 -0
  184. package/src/common/app-router-view/app-router-view.tsx +73 -0
  185. package/src/common/app-row/app-row.tsx +31 -0
  186. package/src/common/app-user/app-user.scss +32 -0
  187. package/src/common/app-user/app-user.tsx +61 -0
  188. package/src/common/index.ts +9 -0
  189. package/src/common/quick-search/quick-search.scss +15 -0
  190. package/src/common/quick-search/quick-search.tsx +59 -0
  191. package/src/common/tab-page-exp/tab-page-exp.scss +43 -0
  192. package/src/common/tab-page-exp/tab-page-exp.tsx +125 -0
  193. package/src/control/app-menu/app-menu-provider.ts +14 -0
  194. package/src/control/app-menu/app-menu-state.ts +20 -0
  195. package/src/control/app-menu/app-menu.controller.ts +97 -0
  196. package/src/control/app-menu/app-menu.scss +163 -0
  197. package/src/control/app-menu/app-menu.tsx +305 -0
  198. package/src/control/app-menu/index.ts +12 -0
  199. package/src/control/form/form/form-control.tsx +98 -0
  200. package/src/control/form/form/form-state.ts +39 -0
  201. package/src/control/form/form/form.controller.ts +260 -0
  202. package/src/control/form/form/form.scss +10 -0
  203. package/src/control/form/form/index.ts +30 -0
  204. package/src/control/form/form-detail/form-detail/form-detail-state.ts +92 -0
  205. package/src/control/form/form-detail/form-detail/form-detail.ts +214 -0
  206. package/src/control/form/form-detail/form-detail/index.ts +2 -0
  207. package/src/control/form/form-detail/form-group-panel/form-group-panel-provider.ts +27 -0
  208. package/src/control/form/form-detail/form-group-panel/form-group-panel-state.ts +29 -0
  209. package/src/control/form/form-detail/form-group-panel/form-group-panel.controller.ts +103 -0
  210. package/src/control/form/form-detail/form-group-panel/index.ts +3 -0
  211. package/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss +90 -0
  212. package/src/control/form/form-detail/form-item/form-item-container/form-item-container.tsx +68 -0
  213. package/src/control/form/form-detail/form-item/form-item-provider.ts +28 -0
  214. package/src/control/form/form-detail/form-item/form-item-state.ts +48 -0
  215. package/src/control/form/form-detail/form-item/form-item.controller.ts +341 -0
  216. package/src/control/form/form-detail/form-item/form-item.scss +4 -0
  217. package/src/control/form/form-detail/form-item/form-item.tsx +69 -0
  218. package/src/control/form/form-detail/form-item/index.ts +3 -0
  219. package/src/control/form/form-detail/form-page/form-page-item.tsx +59 -0
  220. package/src/control/form/form-detail/form-page/form-page-provider.ts +27 -0
  221. package/src/control/form/form-detail/form-page/form-page-state.ts +12 -0
  222. package/src/control/form/form-detail/form-page/form-page.controller.ts +20 -0
  223. package/src/control/form/form-detail/form-page/form-page.scss +42 -0
  224. package/src/control/form/form-detail/form-page/form-page.tsx +56 -0
  225. package/src/control/form/form-detail/index.ts +3 -0
  226. package/src/control/form/index.ts +12 -0
  227. package/src/control/form/search-form/index.ts +15 -0
  228. package/src/control/form/search-form/search-form-provider.ts +14 -0
  229. package/src/control/form/search-form/search-form-state.ts +12 -0
  230. package/src/control/form/search-form/search-form.controller.ts +135 -0
  231. package/src/control/form/search-form/search-form.scss +48 -0
  232. package/src/control/form/search-form/search-form.tsx +70 -0
  233. package/src/control/grid/grid/grid-column.controller.ts +98 -0
  234. package/src/control/grid/grid/grid-control.tsx +174 -0
  235. package/src/control/grid/grid/grid-control.util.ts +135 -0
  236. package/src/control/grid/grid/grid-provider.ts +13 -0
  237. package/src/control/grid/grid/grid-row.controller.ts +114 -0
  238. package/src/control/grid/grid/grid-state.ts +20 -0
  239. package/src/control/grid/grid/grid.controller.ts +531 -0
  240. package/src/control/grid/grid/grid.scss +79 -0
  241. package/src/control/grid/grid-field-column/grid-field-column-provider.ts +26 -0
  242. package/src/control/grid/grid-field-column/grid-field-column.controller.ts +189 -0
  243. package/src/control/grid/grid-field-column/grid-field-column.scss +19 -0
  244. package/src/control/grid/grid-field-column/grid-field-column.tsx +87 -0
  245. package/src/control/grid/grid-pagination/grid-pagination.scss +7 -0
  246. package/src/control/grid/grid-pagination/grid-pagination.tsx +88 -0
  247. package/src/control/grid/index.ts +23 -0
  248. package/src/control/index.ts +4 -0
  249. package/src/control/panel/index.ts +23 -0
  250. package/src/control/panel/panel/panel-item-state.ts +73 -0
  251. package/src/control/panel/panel/panel-item.controller.ts +161 -0
  252. package/src/control/panel/panel/panel-state.ts +22 -0
  253. package/src/control/panel/panel/panel.controller.ts +256 -0
  254. package/src/control/panel/panel-container/index.ts +23 -0
  255. package/src/control/panel/panel-container/panel-container-provider.ts +28 -0
  256. package/src/control/panel/panel-container/panel-container-state.ts +12 -0
  257. package/src/control/panel/panel-container/panel-container.controller.ts +18 -0
  258. package/src/control/panel/panel-container/panel-container.scss +66 -0
  259. package/src/control/panel/panel-container/panel-container.tsx +93 -0
  260. package/src/control/panel/panel-ctrl-pos/index.ts +13 -0
  261. package/src/control/panel/panel-ctrl-pos/panel-ctrl-pos-provider.ts +28 -0
  262. package/src/control/panel/panel-ctrl-pos/panel-ctrl-pos.controller.ts +23 -0
  263. package/src/control/panel/panel-ctrl-pos/panel-ctrl-pos.tsx +39 -0
  264. package/src/control/panel/view-layout-panel/view-layout-panel-provider.ts +14 -0
  265. package/src/control/panel/view-layout-panel/view-layout-panel.controller.ts +62 -0
  266. package/src/control/panel/view-layout-panel/view-layout-panel.scss +3 -0
  267. package/src/control/panel/view-layout-panel/view-layout-panel.tsx +127 -0
  268. package/src/control/panel/view-layout-panel.json +141 -0
  269. package/src/control/toolbar/index.ts +12 -0
  270. package/src/control/toolbar/toolbar-control.scss +46 -0
  271. package/src/control/toolbar/toolbar-control.tsx +127 -0
  272. package/src/control/toolbar/toolbar-provider.ts +14 -0
  273. package/src/control/toolbar/toolbar-state.ts +31 -0
  274. package/src/control/toolbar/toolbar.controllerr.ts +112 -0
  275. package/src/editor/index.ts +14 -0
  276. package/src/editor/text-box/ibiz-input/ibiz-input.scss +48 -0
  277. package/src/editor/text-box/ibiz-input/ibiz-input.tsx +176 -0
  278. package/src/editor/text-box/index.ts +1 -0
  279. package/src/editor/text-box/text-box-provider.ts +39 -0
  280. package/src/editor/text-box/text-box.controller.ts +21 -0
  281. package/src/index.ts +57 -0
  282. package/src/layout/app-layout/app-layout.scss +133 -0
  283. package/src/layout/app-layout/app-layout.tsx +149 -0
  284. package/src/layout/control-base/control-base.tsx +37 -0
  285. package/src/layout/control-layout/control-layout.scss +4 -0
  286. package/src/layout/control-layout/control-layout.tsx +29 -0
  287. package/src/layout/index.ts +15 -0
  288. package/src/layout/md-view-base/md-view-base.tsx +69 -0
  289. package/src/layout/view-base/view-base.scss +11 -0
  290. package/src/layout/view-base/view-base.tsx +147 -0
  291. package/src/layout/view-layout/view-layout.scss +198 -0
  292. package/src/layout/view-layout/view-layout.tsx +115 -0
  293. package/src/shims-vue.d.ts +5 -0
  294. package/src/util/install.ts +11 -0
  295. package/src/views/grid-view/grid-view-engine.ts +68 -0
  296. package/src/views/grid-view/index.ts +12 -0
  297. package/src/views/index-view/index-view-default.ts +168 -0
  298. package/src/views/index-view/index-view-engine.ts +10 -0
  299. package/src/views/index-view/index-view-exp.ts +261 -0
  300. package/src/views/index-view/index-view-provider.ts +14 -0
  301. package/src/views/index-view/index-view.tsx +249 -0
  302. package/src/views/index-view/index.ts +14 -0
  303. package/src/views/index.ts +3 -0
  304. package/src/views/view/ibiz-view.tsx +49 -0
  305. package/src/views/view/index.ts +12 -0
  306. package/src/views/view/view-provider.ts +14 -0
@@ -0,0 +1,176 @@
1
+ import { computed, defineComponent, ref, watch } from 'vue';
2
+ import { debounce } from 'lodash-es';
3
+ import {
4
+ getEditorEmits,
5
+ getInputProps,
6
+ useNamespace,
7
+ } from '@ibiz-template/vue3-util';
8
+ import './ibiz-input.scss';
9
+
10
+ export const IBizInput = defineComponent({
11
+ name: 'IBizInput',
12
+ props: getInputProps(),
13
+ emits: getEditorEmits(),
14
+ setup(props, { emit }) {
15
+ const ns = useNamespace('input');
16
+ const c = props.controller;
17
+ const editorModel = c.model;
18
+ const inputRef = ref();
19
+
20
+ // 文本域默认行数,仅在 textarea 类型下有效
21
+ const rows = ref(2);
22
+ if (editorModel.editorType === 'TEXTAREA_10') {
23
+ rows.value = 10;
24
+ }
25
+
26
+ // 类型
27
+ const type = computed(() => {
28
+ switch (editorModel.editorType) {
29
+ case 'TEXTBOX':
30
+ return 'text';
31
+ case 'PASSWORD':
32
+ return 'password';
33
+ case 'TEXTAREA':
34
+ case 'TEXTAREA_10':
35
+ return 'textarea';
36
+ default:
37
+ return 'string';
38
+ }
39
+ });
40
+
41
+ const currentVal = ref<string>('');
42
+
43
+ watch(
44
+ () => props.value,
45
+ (newVal, oldVal) => {
46
+ if (newVal !== oldVal) {
47
+ if (!newVal) {
48
+ currentVal.value = '';
49
+ } else {
50
+ currentVal.value = newVal;
51
+ }
52
+ }
53
+ },
54
+ { immediate: true },
55
+ );
56
+
57
+ let isDebounce = false;
58
+ let awaitSearch: () => void;
59
+ let blurCacheValue: string | undefined;
60
+ // 防抖值变更回调
61
+ const debounceChange = debounce(
62
+ (val: string | number) => {
63
+ // 拦截掉blur触发后change
64
+ if (blurCacheValue !== val) {
65
+ emit('change', val);
66
+ }
67
+ blurCacheValue = undefined;
68
+ isDebounce = false;
69
+ if (awaitSearch) {
70
+ awaitSearch();
71
+ }
72
+ },
73
+ 300,
74
+ { leading: true },
75
+ );
76
+ // 值变更
77
+ const handleChange = (val: string | number) => {
78
+ isDebounce = true;
79
+ debounceChange(val);
80
+ };
81
+
82
+ const handleKeyUp = (e: KeyboardEvent) => {
83
+ if (e && e.code === 'Enter') {
84
+ if (isDebounce) {
85
+ awaitSearch = () => {
86
+ inputRef.value.$el.dispatchEvent(e);
87
+ };
88
+ }
89
+ }
90
+ };
91
+
92
+ /**
93
+ * blur时马上抛值变更
94
+ * @author lxm
95
+ * @date 2023-03-06 06:36:23
96
+ */
97
+ const handleBlur = (event: IData) => {
98
+ blurCacheValue = event.target.value;
99
+ emit('change', blurCacheValue);
100
+ };
101
+
102
+ // 自动聚焦
103
+ if (props.autoFocus) {
104
+ watch(inputRef, newVal => {
105
+ if (newVal) {
106
+ const input = newVal.$el.getElementsByTagName('input')[0];
107
+ input.focus();
108
+ }
109
+ });
110
+ }
111
+
112
+ return {
113
+ ns,
114
+ rows,
115
+ type,
116
+ currentVal,
117
+ handleChange,
118
+ handleKeyUp,
119
+ handleBlur,
120
+ inputRef,
121
+ };
122
+ },
123
+ render() {
124
+ const { unitName } = this.controller.model;
125
+
126
+ let content = null;
127
+ if (this.readonly) {
128
+ // 只读显示
129
+ content = `${this.currentVal}`;
130
+ // 当有值且单位存在时才显示单位
131
+ if (content && unitName) {
132
+ content += unitName;
133
+ }
134
+ } else {
135
+ // 编辑态显示
136
+ const slots: IData = {};
137
+ if (unitName) {
138
+ slots.suffix = () => {
139
+ return <i class={this.ns.e('unit')}>{unitName}</i>;
140
+ };
141
+ }
142
+
143
+ content = (
144
+ <el-input
145
+ ref='inputRef'
146
+ v-model={this.currentVal}
147
+ placeholder={this.controller.placeHolder}
148
+ type={this.type}
149
+ rows={this.rows}
150
+ onInput={this.handleChange}
151
+ onKeyup={this.handleKeyUp}
152
+ onBlur={this.handleBlur}
153
+ class={this.ns.b('input')}
154
+ disabled={this.disabled}
155
+ show-password={this.type === 'password'}
156
+ autocomplete='new-password'
157
+ >
158
+ {slots}
159
+ </el-input>
160
+ );
161
+ }
162
+
163
+ return (
164
+ <div
165
+ class={[
166
+ this.ns.b(),
167
+ this.ns.is('textarea', Object.is(this.type, 'textarea')),
168
+ this.disabled ? this.ns.m('disabled') : '',
169
+ this.readonly ? this.ns.m('readonly') : '',
170
+ ]}
171
+ >
172
+ {content}
173
+ </div>
174
+ );
175
+ },
176
+ });
@@ -0,0 +1 @@
1
+ export { IBizInput } from './ibiz-input/ibiz-input';
@@ -0,0 +1,39 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { IEditorProvider } from '@ibiz-template/runtime';
3
+ import { ITextBox } from '@ibiz/model-core';
4
+ import { TextBoxEditorController } from './text-box.controller';
5
+
6
+ /**
7
+ * 输入框编辑器适配器
8
+ *
9
+ * @author lxm
10
+ * @date 2022-09-19 22:09:03
11
+ * @export
12
+ * @class TextBoxEditorProvider
13
+ * @implements {EditorProvider}
14
+ */
15
+ export class TextBoxEditorProvider implements IEditorProvider {
16
+ formEditor: string = 'IBizInput';
17
+
18
+ gridEditor: string = 'IBizGridInput';
19
+
20
+ constructor(editorType?: string) {
21
+ if (editorType === 'NUMBER') {
22
+ this.formEditor = 'IBizInputNumber';
23
+ this.gridEditor = 'IBizGridInputNumber';
24
+ }
25
+ if (editorType === 'IPADDRESSTEXTBOX') {
26
+ this.formEditor = 'IBizInputIP';
27
+ this.gridEditor = 'IBizInputIP';
28
+ }
29
+ }
30
+
31
+ async createController(
32
+ editorModel: ITextBox,
33
+ parentController: any,
34
+ ): Promise<TextBoxEditorController> {
35
+ const c = new TextBoxEditorController(editorModel, parentController);
36
+ await c.init();
37
+ return c;
38
+ }
39
+ }
@@ -0,0 +1,21 @@
1
+ import { EditorController } from '@ibiz-template/runtime';
2
+ import { ITextBox } from '@ibiz/model-core';
3
+
4
+ /**
5
+ * 输入框编辑器控制器
6
+ *
7
+ * @author lxm
8
+ * @date 2022-08-24 20:08:25
9
+ * @export
10
+ * @class TextBoxEditorController
11
+ * @extends {EditorController}
12
+ */
13
+ export class TextBoxEditorController extends EditorController<ITextBox> {
14
+ /**
15
+ * 占位
16
+ * @return {*}
17
+ * @author: zhujiamin
18
+ * @Date: 2022-08-25 14:33:14
19
+ */
20
+ public placeHolder = '请输入';
21
+ }
package/src/index.ts ADDED
@@ -0,0 +1,57 @@
1
+ import { App } from 'vue';
2
+ import {
3
+ AppKeepAlive,
4
+ AppIcon,
5
+ AppRow,
6
+ AppCol,
7
+ AppUser,
8
+ AppRouterView,
9
+ TabPageExp,
10
+ QuickSearch,
11
+ } from './common';
12
+ import { IBizAppMenu, IBizGrid, IBizToolbar, IBizPanel } from './control';
13
+ import { IBizForm, IBizSearchForm } from './control/form';
14
+ import IBizEditor from './editor';
15
+ import {
16
+ AppLayout,
17
+ ViewLayout,
18
+ ViewBase,
19
+ MDViewBase,
20
+ ControlLayout,
21
+ ControlBase,
22
+ } from './layout';
23
+ import { IBizIndexView, IBizView, IBizGridView } from './views';
24
+
25
+ export * from './layout';
26
+ export * from './views';
27
+ export * from './control';
28
+ export * from './common';
29
+
30
+ export default {
31
+ install: (v: App) => {
32
+ v.use(IBizIndexView);
33
+ v.use(IBizView);
34
+ v.use(IBizAppMenu);
35
+ v.use(IBizGridView);
36
+ v.use(IBizGrid);
37
+ v.use(IBizToolbar);
38
+ v.use(IBizPanel);
39
+ v.use(IBizForm);
40
+ v.use(IBizSearchForm);
41
+ v.use(IBizEditor);
42
+ v.component('AppLayout', AppLayout);
43
+ v.component('ViewLayout', ViewLayout);
44
+ v.component('ViewBase', ViewBase);
45
+ v.component('MdViewBase', MDViewBase);
46
+ v.component('ControlLayout', ControlLayout);
47
+ v.component('ControlBase', ControlBase);
48
+ v.component('AppKeepAlive', AppKeepAlive);
49
+ v.component('AppIcon', AppIcon);
50
+ v.component('AppRow', AppRow);
51
+ v.component('AppCol', AppCol);
52
+ v.component('AppUser', AppUser);
53
+ v.component('AppRouterView', AppRouterView);
54
+ v.component('TabPageExp', TabPageExp);
55
+ v.component('QuickSearch', QuickSearch);
56
+ },
57
+ };
@@ -0,0 +1,133 @@
1
+ @include b(layout) {
2
+ @include set-component-css-var('layout', $app-layout);
3
+ @include set-component-css-var('layout-nav', $app-layout-nav);
4
+ @include set-component-css-var('layout-header', $app-layout-header);
5
+ @include set-component-css-var('layout-content', $app-layout-content);
6
+
7
+ justify-content: flex-start;
8
+ width: getCssVar('layout', 'width');
9
+ height: getCssVar('layout', 'height');
10
+ overflow: hidden;
11
+
12
+ @include e(logo) {
13
+ @include flex-center;
14
+
15
+ width: getCssVar('layout-nav', 'width');
16
+ height: getCssVar('layout-header', 'height');
17
+ cursor: pointer;
18
+ }
19
+
20
+ @include e(logo-caption) {
21
+ font-size: getCssVar('layout', 'caption-font-size');
22
+ }
23
+
24
+ @include when(collapse) {
25
+ @include b(layout-content) {
26
+ padding-left: getCssVar('layout-nav', 'collapse-width');
27
+ }
28
+ }
29
+
30
+ // 空白模式样式,隐藏侧边栏和切换图标
31
+ @include m(blank) {
32
+ &.#{bem('layout')} {
33
+ #{getCssVarName('layout-header', 'height')}: 0;
34
+ }
35
+
36
+ // 隐藏侧边栏
37
+ @include b(layout-nav) {
38
+ &.el-aside {
39
+ display: none;
40
+ }
41
+ }
42
+ @include b(layout-content) {
43
+ padding-left: 0;
44
+ }
45
+
46
+ // 隐藏切换图标
47
+ @include b(layout-header) {
48
+ display: none;
49
+ }
50
+ }
51
+ }
52
+
53
+ @include b(layout-nav) {
54
+ flex: 0 0 getCssVar('layout-nav', 'width') !important;
55
+ width: getCssVar('layout-nav', 'width') !important;
56
+ min-width: getCssVar('layout-nav', 'width') !important;
57
+ max-width: getCssVar('layout-nav', 'width') !important;
58
+
59
+ &.is-collapse {
60
+ flex: 0 0 getCssVar('layout-nav', 'collapse-width') !important;
61
+ width: getCssVar('layout-nav', 'collapse-width') !important;
62
+ min-width: getCssVar('layout-nav', 'collapse-width') !important;
63
+ max-width: getCssVar('layout-nav', 'collapse-width') !important;
64
+
65
+ > .el-menu--collapse {
66
+ width: 100%;
67
+ }
68
+ }
69
+
70
+ transition: all 0.25s;
71
+ }
72
+
73
+ @include b(layout-nav) {
74
+ position: absolute;
75
+ top: 0;
76
+ left: 0;
77
+ z-index: 1;
78
+ height: 100%;
79
+ background-color: getCssVar('layout-nav', 'bg-color');
80
+ box-shadow: getCssVar('layout-nav', 'box-shadow');
81
+ }
82
+
83
+ @include b(layout-header) {
84
+ position: absolute;
85
+ top: 0;
86
+ right: 0;
87
+ z-index: 14;
88
+ @include flex($horizontal: space-between);
89
+
90
+ width: 100%;
91
+ height: getCssVar('layout-header', 'height');
92
+ padding: 0;
93
+ line-height: getCssVar('layout-header', 'height');
94
+ color: getCssVar('layout-header', 'text-color');
95
+ background-color: getCssVar('layout-header', 'bg-color');
96
+ box-shadow: getCssVar('layout-header', 'box-shadow');
97
+ @include e(left) {
98
+ @include flex;
99
+ }
100
+
101
+ @include e(collapse-icon) {
102
+ @include flex-center;
103
+
104
+ width: 42px;
105
+ font-size: getCssVar('font-size', 'large');
106
+ cursor: pointer;
107
+
108
+ &:hover {
109
+ background: hsl(0deg 0% 100% / 5%);
110
+ }
111
+ }
112
+ }
113
+
114
+ @include b(layout-content) {
115
+ width: 100%;
116
+ padding-left: getCssVar('layout-nav', 'width');
117
+ background-color: getCssVar('layout-content', 'bg-color');
118
+ transition: all 0.2s ease-in-out;
119
+ @include e(main) {
120
+ height: calc(100% - getCssVar('layout-header', 'height'));
121
+ padding: getCssVar('layout-header', 'height') 0 0;
122
+
123
+ @include when(exp) {
124
+ > div:nth-child(2) {
125
+ height: calc(100% - 56px);
126
+ }
127
+ }
128
+ }
129
+
130
+ &.is-top {
131
+ padding-left: 0;
132
+ }
133
+ }
@@ -0,0 +1,149 @@
1
+ import { computed, defineComponent, PropType, ref, useSlots } from 'vue';
2
+ import { useNamespace } from '@ibiz-template/vue3-util';
3
+ import { useRouter, useRoute } from 'vue-router';
4
+ import './app-layout.scss';
5
+ import { IAppIndexView } from '@ibiz/model-core';
6
+
7
+ export const AppLayout = defineComponent({
8
+ name: 'AppLayout',
9
+ props: {
10
+ modelData: { type: Object as PropType<IAppIndexView>, required: true },
11
+ // 视图是否完成加载
12
+ isComplete: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
16
+ },
17
+ setup(props, { emit }) {
18
+ const ns = useNamespace('layout');
19
+ const router = useRouter();
20
+ const route = useRoute();
21
+
22
+ // 菜单收缩变化
23
+ const isCollapse = ref(false);
24
+
25
+ const collapseMenus = () => {
26
+ isCollapse.value = !isCollapse.value;
27
+ emit('collapseChange', isCollapse.value);
28
+ };
29
+
30
+ const isBlank = computed(() => props.modelData.blankMode === true);
31
+
32
+ const menuAlign = computed(() => {
33
+ return props.modelData.mainMenuAlign || 'LEFT';
34
+ });
35
+
36
+ const redirectToIndex = () => {
37
+ const fullPath = route.fullPath;
38
+ let index = fullPath.indexOf('/');
39
+ for (let i = 0; i < 2; i++) {
40
+ index = fullPath.indexOf('/', index + 1);
41
+ }
42
+ const indexPath = `${fullPath.substring(0, index)}/-`;
43
+
44
+ router.push(indexPath);
45
+ setTimeout(() => {
46
+ window.location.reload();
47
+ });
48
+ };
49
+
50
+ const slots = useSlots();
51
+ // 是否存在多标签导航
52
+ const hasTabPageExp = computed(() => {
53
+ if (slots.tabPageExp) {
54
+ return true;
55
+ }
56
+ return false;
57
+ });
58
+
59
+ const renderLogo = () => {
60
+ return (
61
+ <div class={ns.e('logo')} onClick={redirectToIndex}>
62
+ {props.modelData.appIconPath ? (
63
+ <img
64
+ class={ns.e('logo-img')}
65
+ src={props.modelData.appIconPath}
66
+ ></img>
67
+ ) : null}
68
+ <div class={ns.e('logo-caption')}>{props.modelData.caption}</div>
69
+ </div>
70
+ );
71
+ };
72
+
73
+ return {
74
+ ns,
75
+ isCollapse,
76
+ isBlank,
77
+ collapseMenus,
78
+ menuAlign,
79
+ redirectToIndex,
80
+ renderLogo,
81
+ hasTabPageExp,
82
+ };
83
+ },
84
+ render() {
85
+ return this.isComplete ? (
86
+ <el-container
87
+ class={[
88
+ this.ns.b(),
89
+ this.isBlank ? this.ns.m('blank') : '',
90
+ this.ns.is('collapse', this.isCollapse),
91
+ ]}
92
+ >
93
+ {this.menuAlign === 'LEFT' ? (
94
+ <el-aside
95
+ hide-trigger
96
+ class={[this.ns.b('nav'), this.ns.is('collapse', this.isCollapse)]}
97
+ value={this.isCollapse}
98
+ >
99
+ {this.renderLogo()}
100
+ {this.$slots.menu && this.$slots.menu()}
101
+ </el-aside>
102
+ ) : null}
103
+ <el-container
104
+ class={[
105
+ this.ns.b('content'),
106
+ this.ns.is(this.menuAlign.toLowerCase(), true),
107
+ ]}
108
+ >
109
+ <el-header class={this.ns.b('header')}>
110
+ <div class={this.ns.be('header', 'left')}>
111
+ {this.renderLogo()}
112
+ {this.menuAlign === 'LEFT' ? (
113
+ <div class={this.ns.be('header', 'collapse-icon')}>
114
+ {!this.isCollapse ? (
115
+ <ion-icon
116
+ src={'./assets/img/menu-fold.svg'}
117
+ onClick={() => this.collapseMenus()}
118
+ />
119
+ ) : (
120
+ <ion-icon
121
+ src={'./assets/img/menu-unfold.svg'}
122
+ onClick={() => this.collapseMenus()}
123
+ />
124
+ )}
125
+ </div>
126
+ ) : null}
127
+ {this.menuAlign === 'TOP'
128
+ ? this.$slots.menu && this.$slots.menu()
129
+ : null}
130
+ </div>
131
+ <div class={this.ns.be('header', 'right')}>
132
+ <app-user />
133
+ </div>
134
+ </el-header>
135
+ <el-main
136
+ class={[
137
+ this.ns.be('content', 'main'),
138
+ this.ns.is('exp', this.hasTabPageExp),
139
+ ]}
140
+ >
141
+ {this.$slots.tabPageExp && this.$slots.tabPageExp()}
142
+ {this.$slots.default && this.$slots.default()}
143
+ </el-main>
144
+ {/* <el-footer class={this.ns.b('footer')}>Footer</el-footer> */}
145
+ </el-container>
146
+ </el-container>
147
+ ) : null;
148
+ },
149
+ });
@@ -0,0 +1,37 @@
1
+ import { ControlController } from '@ibiz-template/runtime';
2
+ import { useNamespace } from '@ibiz-template/vue3-util';
3
+ import { kebabCase } from 'lodash-es';
4
+ import { defineComponent, PropType } from 'vue';
5
+
6
+ export const ControlBase = defineComponent({
7
+ props: {
8
+ controller: {
9
+ type: Object as PropType<ControlController>,
10
+ required: true,
11
+ },
12
+ },
13
+ setup(props) {
14
+ const ns = useNamespace('control');
15
+ const { controlType, sysCss, codeName } = props.controller.model;
16
+ const typeClass = controlType!.toLowerCase();
17
+ const sysCssName = sysCss?.cssName;
18
+ const modelClass = kebabCase(codeName);
19
+
20
+ return { ns, typeClass, sysCssName, modelClass };
21
+ },
22
+ render() {
23
+ return (
24
+ <control-layout
25
+ modelData={this.controller.model}
26
+ class={[
27
+ this.ns.b(),
28
+ this.ns.b(this.typeClass),
29
+ this.ns.m(this.modelClass),
30
+ this.sysCssName,
31
+ ]}
32
+ >
33
+ {this.$slots.default?.()}
34
+ </control-layout>
35
+ );
36
+ },
37
+ });
@@ -0,0 +1,4 @@
1
+ @include b(control-layout) {
2
+ width: 100%;
3
+ height: 100%;
4
+ }
@@ -0,0 +1,29 @@
1
+ import { defineComponent, PropType } from 'vue';
2
+ import { useNamespace } from '@ibiz-template/vue3-util';
3
+ import './control-layout.scss';
4
+ import { IControl } from '@ibiz/model-core';
5
+
6
+ /**
7
+ * 部件布局
8
+ */
9
+ export const ControlLayout = defineComponent({
10
+ name: 'ControlLayout',
11
+ props: {
12
+ modelData: { type: Object as PropType<IControl>, required: true },
13
+ },
14
+ setup() {
15
+ const ns = useNamespace('control-layout');
16
+ return { ns };
17
+ },
18
+ render() {
19
+ return (
20
+ <div
21
+ class={{
22
+ [this.ns.b()]: true,
23
+ }}
24
+ >
25
+ {this.$slots.default?.()}
26
+ </div>
27
+ );
28
+ },
29
+ });
@@ -0,0 +1,15 @@
1
+ import { AppLayout } from './app-layout/app-layout';
2
+ import { ControlLayout } from './control-layout/control-layout';
3
+ import { ViewBase } from './view-base/view-base';
4
+ import { MDViewBase } from './md-view-base/md-view-base';
5
+ import { ViewLayout } from './view-layout/view-layout';
6
+ import { ControlBase } from './control-base/control-base';
7
+
8
+ export {
9
+ AppLayout,
10
+ ViewLayout,
11
+ ViewBase,
12
+ MDViewBase,
13
+ ControlLayout,
14
+ ControlBase,
15
+ };