cnhis-design-vue 3.2.3-beta.0 → 3.2.3-beta.3

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 (248) hide show
  1. package/README.md +87 -87
  2. package/es/components/big-table/index.d.ts +1 -1
  3. package/es/components/big-table/src/BigTable.vue.d.ts +1 -1
  4. package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
  5. package/es/components/calendar/index.d.ts +2 -11
  6. package/es/components/calendar/src/Calendar.vue.d.ts +1 -11
  7. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  8. package/es/components/classification/src/index.vue.d.ts +3 -3
  9. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  10. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
  12. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.d.ts +7 -0
  14. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -0
  15. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +10 -0
  16. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -0
  17. package/es/components/fabric-chart/src/interface.d.ts +4 -3
  18. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  19. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  20. package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
  21. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  22. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  23. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  24. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  25. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
  26. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEventConvert.js +1 -1
  27. package/es/components/node_modules/naive-ui/node_modules/date-fns/docs/logo.svg +26 -0
  28. package/es/components/node_modules/naive-ui/node_modules/date-fns/docs/logotype.svg +1 -0
  29. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  30. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  31. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  32. package/es/env.d.ts +25 -25
  33. package/es/shared/assets/img/emoji/emotion_001.png.js +1 -1
  34. package/es/shared/assets/img/emoji/emotion_002.png.js +1 -1
  35. package/es/shared/assets/img/emoji/emotion_003.png.js +1 -1
  36. package/es/shared/assets/img/emoji/emotion_004.png.js +1 -1
  37. package/es/shared/assets/img/emoji/emotion_005.png.js +1 -1
  38. package/es/shared/assets/img/emoji/emotion_006.png.js +1 -1
  39. package/es/shared/assets/img/emoji/emotion_007.png.js +1 -1
  40. package/es/shared/assets/img/emoji/emotion_008.png.js +1 -1
  41. package/es/shared/assets/img/emoji/emotion_009.png.js +1 -1
  42. package/es/shared/assets/img/emoji/emotion_010.png.js +1 -1
  43. package/es/shared/assets/img/emoji/emotion_011.png.js +1 -1
  44. package/es/shared/assets/img/emoji/emotion_012.png.js +1 -1
  45. package/es/shared/assets/img/emoji/emotion_013.png.js +1 -1
  46. package/es/shared/assets/img/emoji/emotion_014.png.js +1 -1
  47. package/es/shared/assets/img/emoji/emotion_015.png.js +1 -1
  48. package/es/shared/assets/img/emoji/emotion_016.png.js +1 -1
  49. package/es/shared/assets/img/emoji/emotion_017.png.js +1 -1
  50. package/es/shared/assets/img/emoji/emotion_018.png.js +1 -1
  51. package/es/shared/assets/img/emoji/emotion_019.png.js +1 -1
  52. package/es/shared/assets/img/emoji/emotion_020.png.js +1 -1
  53. package/es/shared/assets/img/emoji/emotion_021.png.js +1 -1
  54. package/es/shared/assets/img/emoji/emotion_022.png.js +1 -1
  55. package/es/shared/assets/img/emoji/emotion_023.png.js +1 -1
  56. package/es/shared/assets/img/emoji/emotion_024.png.js +1 -1
  57. package/es/shared/assets/img/emoji/emotion_025.png.js +1 -1
  58. package/es/shared/assets/img/emoji/emotion_026.png.js +1 -1
  59. package/es/shared/assets/img/emoji/emotion_027.png.js +1 -1
  60. package/es/shared/assets/img/emoji/emotion_028.png.js +1 -1
  61. package/es/shared/assets/img/emoji/emotion_029.png.js +1 -1
  62. package/es/shared/assets/img/emoji/emotion_030.png.js +1 -1
  63. package/es/shared/assets/img/emoji/emotion_031.png.js +1 -1
  64. package/es/shared/assets/img/emoji/emotion_032.png.js +1 -1
  65. package/es/shared/assets/img/emoji/emotion_033.png.js +1 -1
  66. package/es/shared/assets/img/emoji/emotion_034.png.js +1 -1
  67. package/es/shared/assets/img/emoji/emotion_035.png.js +1 -1
  68. package/es/shared/assets/img/emoji/emotion_036.png.js +1 -1
  69. package/es/shared/assets/img/emoji/emotion_037.png.js +1 -1
  70. package/es/shared/assets/img/emoji/emotion_038.png.js +1 -1
  71. package/es/shared/assets/img/emoji/emotion_039.png.js +1 -1
  72. package/es/shared/assets/img/emoji/emotion_040.png.js +1 -1
  73. package/es/shared/assets/img/emoji/emotion_041.png.js +1 -1
  74. package/es/shared/assets/img/emoji/emotion_042.png.js +1 -1
  75. package/es/shared/assets/img/emoji/emotion_043.png.js +1 -1
  76. package/es/shared/assets/img/emoji/emotion_044.png.js +1 -1
  77. package/es/shared/assets/img/emoji/emotion_045.png.js +1 -1
  78. package/es/shared/assets/img/emoji/emotion_046.png.js +1 -1
  79. package/es/shared/assets/img/emoji/emotion_047.png.js +1 -1
  80. package/es/shared/assets/img/emoji/emotion_048.png.js +1 -1
  81. package/es/shared/assets/img/emoji/emotion_049.png.js +1 -1
  82. package/es/shared/assets/img/emoji/emotion_050.png.js +1 -1
  83. package/es/shared/assets/img/emoji/emotion_051.png.js +1 -1
  84. package/es/shared/assets/img/emoji/emotion_052.png.js +1 -1
  85. package/es/shared/assets/img/emoji/emotion_053.png.js +1 -1
  86. package/es/shared/assets/img/emoji/emotion_054.png.js +1 -1
  87. package/es/shared/assets/img/emoji/emotion_055.png.js +1 -1
  88. package/es/shared/assets/img/emoji/emotion_056.png.js +1 -1
  89. package/es/shared/assets/img/emoji/emotion_057.png.js +1 -1
  90. package/es/shared/assets/img/emoji/emotion_058.png.js +1 -1
  91. package/es/shared/assets/img/emoji/emotion_059.png.js +1 -1
  92. package/es/shared/assets/img/emoji/emotion_060.png.js +1 -1
  93. package/es/shared/assets/img/emoji/emotion_061.png.js +1 -1
  94. package/es/shared/assets/img/emoji/emotion_062.png.js +1 -1
  95. package/es/shared/assets/img/emoji/emotion_063.png.js +1 -1
  96. package/es/shared/assets/img/emoji/emotion_064.png.js +1 -1
  97. package/es/shared/assets/img/emoji/emotion_065.png.js +1 -1
  98. package/es/shared/assets/img/emoji/emotion_066.png.js +1 -1
  99. package/es/shared/assets/img/emoji/emotion_067.png.js +1 -1
  100. package/es/shared/assets/img/emoji/emotion_068.png.js +1 -1
  101. package/es/shared/assets/img/emoji/emotion_069.png.js +1 -1
  102. package/es/shared/assets/img/emoji/emotion_070.png.js +1 -1
  103. package/es/shared/assets/img/emoji/emotion_071.png.js +1 -1
  104. package/es/shared/assets/img/emoji/emotion_072.png.js +1 -1
  105. package/es/shared/assets/img/emoji/emotion_073.png.js +1 -1
  106. package/es/shared/assets/img/emoji/emotion_074.png.js +1 -1
  107. package/es/shared/assets/img/emoji/emotion_075.png.js +1 -1
  108. package/es/shared/assets/img/emoji/emotion_076.png.js +1 -1
  109. package/es/shared/assets/img/emoji/emotion_077.png.js +1 -1
  110. package/es/shared/assets/img/emoji/emotion_078.png.js +1 -1
  111. package/es/shared/assets/img/emoji/emotion_079.png.js +1 -1
  112. package/es/shared/assets/img/emoji/emotion_080.png.js +1 -1
  113. package/es/shared/assets/img/emoji/emotion_081.png.js +1 -1
  114. package/es/shared/assets/img/emoji/emotion_082.png.js +1 -1
  115. package/es/shared/assets/img/emoji/emotion_083.png.js +1 -1
  116. package/es/shared/assets/img/emoji/emotion_084.png.js +1 -1
  117. package/es/shared/assets/img/emoji/emotion_085.png.js +1 -1
  118. package/es/shared/assets/img/emoji/emotion_086.png.js +1 -1
  119. package/es/shared/assets/img/emoji/emotion_087.png.js +1 -1
  120. package/es/shared/assets/img/emoji/emotion_088.png.js +1 -1
  121. package/es/shared/assets/img/emoji/emotion_089.png.js +1 -1
  122. package/es/shared/assets/img/emoji/emotion_090.png.js +1 -1
  123. package/es/shared/assets/img/emoji/emotion_091.png.js +1 -1
  124. package/es/shared/assets/img/emoji/emotion_092.png.js +1 -1
  125. package/es/shared/assets/img/emoji/emotion_093.png.js +1 -1
  126. package/es/shared/assets/img/emoji/emotion_094.png.js +1 -1
  127. package/es/shared/assets/img/emoji/emotion_095.png.js +1 -1
  128. package/es/shared/assets/img/emoji/emotion_096.png.js +1 -1
  129. package/es/shared/assets/img/emoji/emotion_097.png.js +1 -1
  130. package/es/shared/assets/img/emoji/emotion_098.png.js +1 -1
  131. package/es/shared/assets/img/emoji/emotion_099.png.js +1 -1
  132. package/es/shared/assets/img/emoji/emotion_100.png.js +1 -1
  133. package/es/shared/assets/img/emoji/emotion_101.png.js +1 -1
  134. package/es/shared/assets/img/emoji/emotion_102.png.js +1 -1
  135. package/es/shared/assets/img/emoji/emotion_103.png.js +1 -1
  136. package/es/shared/assets/img/emoji/emotion_104.png.js +1 -1
  137. package/es/shared/assets/img/emoji/emotion_105.png.js +1 -1
  138. package/es/shared/assets/img/emoji/emotion_106.png.js +1 -1
  139. package/es/shared/assets/img/emoji/emotion_107.png.js +1 -1
  140. package/es/shared/assets/img/emoji/emotion_108.png.js +1 -1
  141. package/es/shared/assets/img/emoji/emotion_109.png.js +1 -1
  142. package/es/shared/assets/img/emoji/emotion_110.png.js +1 -1
  143. package/es/shared/assets/img/emoji/emotion_111.png.js +1 -1
  144. package/es/shared/assets/img/emoji/emotion_112.png.js +1 -1
  145. package/es/shared/assets/img/emoji/emotion_113.png.js +1 -1
  146. package/es/shared/assets/img/emoji/emotion_114.png.js +1 -1
  147. package/es/shared/assets/img/emoji/emotion_115.png.js +1 -1
  148. package/es/shared/assets/img/emoji/emotion_116.png.js +1 -1
  149. package/es/shared/assets/img/emoji/emotion_117.png.js +1 -1
  150. package/es/shared/assets/img/emoji/emotion_118.png.js +1 -1
  151. package/es/shared/assets/img/emoji/emotion_119.png.js +1 -1
  152. package/es/shared/assets/img/emoji/emotion_120.png.js +1 -1
  153. package/es/shared/assets/img/emoji/emotion_121.png.js +1 -1
  154. package/es/shared/assets/img/emoji/emotion_122.png.js +1 -1
  155. package/es/shared/assets/img/emoji/emotion_123.png.js +1 -1
  156. package/es/shared/assets/img/emoji/emotion_124.png.js +1 -1
  157. package/es/shared/assets/img/emoji/emotion_125.png.js +1 -1
  158. package/es/shared/assets/img/emoji/emotion_126.png.js +1 -1
  159. package/es/shared/assets/img/emoji/emotion_127.png.js +1 -1
  160. package/es/shared/assets/img/emoji/emotion_128.png.js +1 -1
  161. package/es/shared/assets/img/emoji/emotion_129.png.js +1 -1
  162. package/es/shared/assets/img/emoji/emotion_130.png.js +1 -1
  163. package/es/shared/assets/img/emoji/emotion_131.png.js +1 -1
  164. package/es/shared/assets/img/emoji/emotion_132.png.js +1 -1
  165. package/es/shared/assets/img/emoji/emotion_133.png.js +1 -1
  166. package/es/shared/assets/img/emoji/emotion_134.png.js +1 -1
  167. package/es/shared/assets/img/emoji/emotion_135.png.js +1 -1
  168. package/es/shared/assets/img/emoji/emotion_136.png.js +1 -1
  169. package/es/shared/assets/img/emoji/emotion_137.png.js +1 -1
  170. package/es/shared/assets/img/emoji/emotion_138.png.js +1 -1
  171. package/es/shared/assets/img/emoji/emotion_139.png.js +1 -1
  172. package/es/shared/assets/img/emoji/emotion_140.png.js +1 -1
  173. package/es/shared/assets/img/emoji/emotion_141.png.js +1 -1
  174. package/es/shared/assets/img/emoji/emotion_142.png.js +1 -1
  175. package/es/shared/assets/img/emoji/emotion_143.png.js +1 -1
  176. package/es/shared/assets/img/emoji/emotion_144.png.js +1 -1
  177. package/es/shared/assets/img/emoji/emotion_145.png.js +1 -1
  178. package/es/shared/assets/img/emoji/emotion_146.png.js +1 -1
  179. package/es/shared/assets/img/emoji/emotion_147.png.js +1 -1
  180. package/es/shared/assets/img/emoji/emotion_148.png.js +1 -1
  181. package/es/shared/assets/img/emoji/emotion_149.png.js +1 -1
  182. package/es/shared/assets/img/emoji/emotion_150.png.js +1 -1
  183. package/es/shared/assets/img/emoji/emotion_151.png.js +1 -1
  184. package/es/shared/assets/img/emoji/emotion_152.png.js +1 -1
  185. package/es/shared/assets/img/emoji/emotion_153.png.js +1 -1
  186. package/es/shared/assets/img/emoji/emotion_154.png.js +1 -1
  187. package/es/shared/assets/img/emoji/emotion_155.png.js +1 -1
  188. package/es/shared/assets/img/emoji/emotion_156.png.js +1 -1
  189. package/es/shared/assets/img/emoji/emotion_157.png.js +1 -1
  190. package/es/shared/assets/img/emoji/emotion_158.png.js +1 -1
  191. package/es/shared/assets/img/emoji/emotion_159.png.js +1 -1
  192. package/es/shared/assets/img/emoji/emotion_160.png.js +1 -1
  193. package/es/shared/assets/img/emoji/emotion_161.png.js +1 -1
  194. package/es/shared/assets/img/emoji/emotion_162.png.js +1 -1
  195. package/es/shared/assets/img/emoji/emotion_163.png.js +1 -1
  196. package/es/shared/assets/img/emoji/emotion_164.png.js +1 -1
  197. package/es/shared/assets/img/emoji/emotion_165.png.js +1 -1
  198. package/es/shared/assets/img/emoji/emotion_166.png.js +1 -1
  199. package/es/shared/assets/img/emoji/emotion_167.png.js +1 -1
  200. package/es/shared/assets/img/emoji/emotion_168.png.js +1 -1
  201. package/es/shared/assets/img/emoji/emotion_169.png.js +1 -1
  202. package/es/shared/assets/img/emoji/emotion_170.png.js +1 -1
  203. package/es/shared/assets/img/emoji/emotion_171.png.js +1 -1
  204. package/es/shared/assets/img/emoji/emotion_172.png.js +1 -1
  205. package/es/shared/assets/img/emoji/emotion_173.png.js +1 -1
  206. package/es/shared/assets/img/emoji/emotion_174.png.js +1 -1
  207. package/es/shared/assets/img/emoji/emotion_175.png.js +1 -1
  208. package/es/shared/assets/img/emoji/emotion_176.png.js +1 -1
  209. package/es/shared/assets/img/emoji/emotion_177.png.js +1 -1
  210. package/es/shared/assets/img/emoji/emotion_178.png.js +1 -1
  211. package/es/shared/assets/img/emoji/emotion_179.png.js +1 -1
  212. package/es/shared/assets/img/emoji/emotion_180.png.js +1 -1
  213. package/es/shared/assets/img/emoji/emotion_181.png.js +1 -1
  214. package/es/shared/assets/img/emoji/emotion_182.png.js +1 -1
  215. package/es/shared/assets/img/emoji/emotion_183.png.js +1 -1
  216. package/es/shared/assets/img/emoji/emotion_184.png.js +1 -1
  217. package/es/shared/assets/img/emoji/emotion_185.png.js +1 -1
  218. package/es/shared/assets/img/emoji/emotion_186.png.js +1 -1
  219. package/es/shared/assets/img/emoji/emotion_187.png.js +1 -1
  220. package/es/shared/assets/img/emoji/emotion_188.png.js +1 -1
  221. package/es/shared/assets/img/emoji/emotion_189.png.js +1 -1
  222. package/es/shared/assets/img/emoji/emotion_190.png.js +1 -1
  223. package/es/shared/assets/img/emoji/emotion_191.png.js +1 -1
  224. package/es/shared/assets/img/emoji/emotion_192.png.js +1 -1
  225. package/es/shared/assets/img/emoji/emotion_193.png.js +1 -1
  226. package/es/shared/assets/img/emoji/emotion_194.png.js +1 -1
  227. package/es/shared/assets/img/emoji/emotion_195.png.js +1 -1
  228. package/es/shared/assets/img/emoji/emotion_196.png.js +1 -1
  229. package/es/shared/assets/img/failure.png.js +1 -1
  230. package/es/shared/assets/img/no-permission.png.js +1 -1
  231. package/es/shared/assets/img/nodata.png.js +1 -1
  232. package/es/shared/assets/img/notfound.png.js +1 -1
  233. package/es/shared/assets/img/qr.png.js +1 -1
  234. package/es/shared/assets/img/success.png.js +1 -1
  235. package/es/shared/assets/img/table_style_2.png.js +1 -1
  236. package/es/shared/assets/img/video.png.js +1 -1
  237. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  238. package/es/shared/assets/img/xb_big.png.js +1 -1
  239. package/es/shared/assets/img/xb_small.png.js +1 -1
  240. package/es/shared/package.json.js +1 -1
  241. package/package.json +2 -2
  242. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  243. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  244. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  245. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  246. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  247. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  248. package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -610,7 +610,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
610
610
  setGroupTreeExpand: () => void;
611
611
  resetTableInlineEditStatus: () => false | undefined;
612
612
  renderAnnotation: (columnConfig: import("../../shared/types").AnyObject) => JSX.Element | null;
613
- toolTipTitle: (item: any, type?: any) => (JSX.Element | null)[] | (() => any);
613
+ toolTipTitle: (item: any, type?: any) => (() => any) | (JSX.Element | null)[];
614
614
  triggerExpand: (e: any, isExpand: any) => void;
615
615
  getOtherConfigInit: () => any;
616
616
  refreshTable: () => void;
@@ -612,7 +612,7 @@ declare const _default: import("vue").DefineComponent<{
612
612
  setGroupTreeExpand: () => void;
613
613
  resetTableInlineEditStatus: () => false | undefined;
614
614
  renderAnnotation: (columnConfig: AnyObject) => JSX.Element | null;
615
- toolTipTitle: (item: any, type?: any) => (JSX.Element | null)[] | (() => any);
615
+ toolTipTitle: (item: any, type?: any) => (() => any) | (JSX.Element | null)[];
616
616
  triggerExpand: (e: any, isExpand: any) => void;
617
617
  getOtherConfigInit: () => any;
618
618
  refreshTable: () => void;
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as c,withCtx as r,createCommentVNode as u,Fragment as d,renderList as p,createBlock as f,createTextVNode as g,toDisplayString as m,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as T}from"naive-ui";import{format as x}from"date-fns";import{useState as C}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as E,alt as I}from"../utils/emoji.js";import{MESSAGE_TYPE as w}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],X={class:"btn-box"},z=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var B=t({__name:"ChatFooter",setup(t){const B=e(),R=e(""),{state:U,stompClient:q}=C(),{setCurrentSessionItem:P}=b(U);function Q(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Y()))}function V(){var t,e;R.value=(null==(e=null==(t=B.value)?void 0:t.innerText)?void 0:e.trim())||""}async function W(t,e){console.log(W,t);const{file:n,name:s}=t.file,i=new FormData;i.append("sender",U.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");Z({chatMessageType:e,msg:e===w.FILE?s:a,url:a})}function Y(){if(!(R.value.length>2e3))return R.value?void Z({msg:R.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function Z(t){const{chatMessageType:e=w.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===w.FILE&&(i.fileUrl=s),[w.TEXT,w.BLEND].includes(e)&&(B.value.innerHTML="",R.value="");const a=x(new Date,"yyyy-MM-dd HH:mm:ss");U.currentMsg={content:i,sender:U.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},U.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i.msg,sortTime:a,chatMessageType:i.chatMessageType}),U.isChangeSession=!0;try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:U.currentSessionItem.receiver})),U.currentMsg={...U.currentMsg,fail:!1}}catch(t){U.currentMsg={...U.currentMsg,fail:!0}}finally{U.currentMsg={...U.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(U).id?"default":"not-allowed"})},[l("div",S,[c(o(v),{placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:r((()=>[j])),default:r((()=>[l("div",L,[u(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,p(o(E),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),f(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:r((()=>[l("i",{onClick:()=>Z({chatMessageType:o(w).EMOJI,msg:e})},[l("img",{src:t},null,8,H)],8,D)])),default:r((()=>[g(" "+m(o(I)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1}),l("span",{onClick:e[0]||(e[0]=()=>Z({chatMessageType:o(w).EMOJI,msg:0}))},J),c(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[1]||(e[1]=t=>W(t,o(w).IMAGE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),c(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[2]||(e[2]=t=>W(t,o(w).FILE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:B,class:"input-box",contenteditable:"",onKeydown:Q,onInput:V},null,544),[[h,o(U).id]]),l("div",X,[z,c(o(T),{type:"primary",round:"",disabled:!R.value,onClick:Y},{default:r((()=>[g("发送")])),_:1},8,["disabled"])])],4)),[[h,o(U).id]])}});export{B as default};
1
+ import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as r,withCtx as c,createCommentVNode as u,Fragment as d,renderList as p,createBlock as f,createTextVNode as g,toDisplayString as m,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as T}from"naive-ui";import{format as x}from"date-fns";import{useState as C}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as E,alt as I}from"../utils/emoji.js";import{MESSAGE_TYPE as w}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],X={class:"btn-box"},z=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var B=t({__name:"ChatFooter",setup(t){const B=e(),R=e(""),{state:U,stompClient:q}=C(),{setCurrentSessionItem:P}=b(U);function Q(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Y()))}function V(){var t,e;R.value=(null==(e=null==(t=B.value)?void 0:t.innerText)?void 0:e.trim())||""}async function W(t,e){console.log(W,t);const{file:n,name:s}=t.file,i=new FormData;i.append("sender",U.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");Z({chatMessageType:e,msg:e===w.FILE?s:a,url:a})}function Y(){if(!(R.value.length>2e3))return R.value?void Z({msg:R.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function Z(t){const{chatMessageType:e=w.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===w.FILE&&(i.fileUrl=s),[w.TEXT,w.BLEND].includes(e)&&(B.value.innerHTML="",R.value="");const a=x(new Date,"yyyy-MM-dd HH:mm:ss");U.currentMsg={content:i,sender:U.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},U.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i.msg,sortTime:a,chatMessageType:i.chatMessageType}),U.isChangeSession=!0;try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:U.currentSessionItem.receiver})),U.currentMsg={...U.currentMsg,fail:!1}}catch(t){U.currentMsg={...U.currentMsg,fail:!0}}finally{U.currentMsg={...U.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(U).id?"default":"not-allowed"})},[l("div",S,[r(o(v),{placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:c((()=>[j])),default:c((()=>[l("div",L,[u(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,p(o(E),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),f(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:c((()=>[l("i",{onClick:()=>Z({chatMessageType:o(w).EMOJI,msg:e})},[l("img",{src:t},null,8,H)],8,D)])),default:c((()=>[g(" "+m(o(I)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1}),l("span",{onClick:e[0]||(e[0]=()=>Z({chatMessageType:o(w).EMOJI,msg:0}))},J),r(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[1]||(e[1]=t=>W(t,o(w).IMAGE))},{default:c((()=>[r(o(k),{abstract:""},{default:c((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),r(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[2]||(e[2]=t=>W(t,o(w).FILE))},{default:c((()=>[r(o(k),{abstract:""},{default:c((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:B,class:"input-box",contenteditable:"",onKeydown:Q,onInput:V},null,544),[[h,o(U).id]]),l("div",X,[z,r(o(T),{type:"primary",round:"",disabled:!R.value,onClick:Y},{default:c((()=>[g("发送")])),_:1},8,["disabled"])])],4)),[[h,o(U).id]])}});export{B as default};
@@ -1,4 +1,5 @@
1
1
  /// <reference types="date-fns" />
2
+ /// <reference types="../../components/node_modules/naive-ui/node_modules/date-fns/typings" />
2
3
  import { SFCWithInstall } from '../../shared/types';
3
4
  export * from './src/types';
4
5
  declare const Calendar: SFCWithInstall<import("vue").DefineComponent<{
@@ -228,17 +229,7 @@ declare const Calendar: SFCWithInstall<import("vue").DefineComponent<{
228
229
  NIcon: any;
229
230
  ChevronBackOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
230
231
  ChevronForwardOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
231
- FullCalendar: import("vue").DefineComponent<{
232
- options: import("vue").PropType<import("@fullcalendar/core/internal-common").a>;
233
- }, unknown, {
234
- renderId: number;
235
- customRenderingMap: Map<string, import("@fullcalendar/core/internal-common").eF<any>>;
236
- }, {}, {
237
- getApi(): import("@fullcalendar/core").Calendar;
238
- buildOptions(suppliedOptions: import("@fullcalendar/core/internal-common").a | undefined): import("@fullcalendar/core/internal-common").a;
239
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
240
- options: import("vue").PropType<import("@fullcalendar/core/internal-common").a>;
241
- }>>, {}>;
232
+ FullCalendar: any;
242
233
  isSameDay: typeof import("date-fns").isSameDay;
243
234
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange")[], "select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
244
235
  showDateNavigation: {
@@ -221,17 +221,7 @@ declare const _default: import("vue").DefineComponent<{
221
221
  NIcon: any;
222
222
  ChevronBackOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
223
223
  ChevronForwardOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
224
- FullCalendar: import("vue").DefineComponent<{
225
- options: PropType<import("@fullcalendar/core/internal-common").a>;
226
- }, unknown, {
227
- renderId: number;
228
- customRenderingMap: Map<string, import("@fullcalendar/core/internal-common").eF<any>>;
229
- }, {}, {
230
- getApi(): import("@fullcalendar/core").Calendar;
231
- buildOptions(suppliedOptions: import("@fullcalendar/core/internal-common").a | undefined): import("@fullcalendar/core/internal-common").a;
232
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
233
- options: PropType<import("@fullcalendar/core/internal-common").a>;
234
- }>>, {}>;
224
+ FullCalendar: any;
235
225
  isSameDay: typeof isSameDay;
236
226
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange")[], "select" | "eventClick" | "eventDrag" | "eventResize" | "dateChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
237
227
  showDateNavigation: {
@@ -175,6 +175,9 @@ declare const _default: import("vue").DefineComponent<{
175
175
  modelValue: unknown[];
176
176
  componentData: Record<string, any>;
177
177
  } & {
178
+ /**
179
+ * 改变弹窗大小
180
+ */
178
181
  itemKey?: string | Function | undefined;
179
182
  }>, {
180
183
  move: Function;
@@ -699,6 +699,9 @@ declare const _default: import("vue").DefineComponent<{
699
699
  handleInitConditions: () => Promise<void>;
700
700
  validate: () => Promise<unknown>;
701
701
  saveAdd: () => void;
702
+ /**
703
+ * 改变展示方式
704
+ */
702
705
  cancelSaveAdd: () => void;
703
706
  checkActionList: () => boolean;
704
707
  NSpin: any;
@@ -1447,9 +1450,6 @@ declare const _default: import("vue").DefineComponent<{
1447
1450
  isSecondDisabled(second: number, minute: number | null, hour: number | null): boolean | 0;
1448
1451
  };
1449
1452
  NSelect: any;
1450
- /**
1451
- * 改变展示方式
1452
- */
1453
1453
  NPopover: any;
1454
1454
  CDatePicker: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
1455
1455
  updateUnchangedValue: {
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as l,normalizeStyle as u,unref as n,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import g from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as w}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as y}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid","eventClick"],setup(e,{expose:j,emit:P}){const x=e,I=r(null),b=r(),M=t({show:!1,point:{x:0,y:0},list:[]}),R=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=o((()=>{var e;return null==(e=b.value)?void 0:e.wrapperEl})),E=o((()=>({width:`${x.data.width||800}px`,height:`${x.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}=function(){const e=[b,x,P,I,M,R];switch(x.type){case"birthProcess":return w(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return y(...e);default:return C(...e)}}();return s((()=>{b.value=new f.Canvas(I.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=b.value)?void 0:e.off)||r.call(e),null==(o=null==(t=b.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:T,select:_,canvas:b,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}),(e,r)=>(i(),l("div",{class:"c-fabric-chart",style:u(n(E))},[p("canvas",{ref_key:"canvasRef",ref:I},null,512),n(A)?(i(),l(c,{key:0},[h(v,d({propItems:n(S)},M),null,16,["propItems"]),h(n(g),d({propItems:n(S)},R,{show:R.show,"onUpdate:show":r[0]||(r[0]=e=>R.show=e),onClickMenu:n(F)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{j as default};
1
+ import{defineComponent as e,ref as r,reactive as t,computed as s,onMounted as o,onBeforeUnmount as a,openBlock as i,createElementBlock as l,normalizeStyle as n,unref as u,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as m,createCommentVNode as d}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import w from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as g}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as j}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";import{useNewBirthProcessChart as y}from"./hooks/newBirthProcess/useNewBirthProcessChart.js";var P=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid","eventClick"],setup(e,{expose:P,emit:x}){const I=e,b=r(null),M=r(),R=t({show:!1,point:{x:0,y:0},list:[]}),B=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=s((()=>{var e;return null==(e=M.value)?void 0:e.wrapperEl})),E=s((()=>({width:`${I.data.width||800}px`,height:`${I.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:D,getGridInfo:H}=function(){const e=[M,I,x,b,R,B];switch(I.type){case"birthProcess":return g(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return j(...e);case"newBirthProcess":return y(...e);default:return C(...e)}}();return o((()=>{M.value=new f.Canvas(b.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,s;null==(r=null==(e=M.value)?void 0:e.off)||r.call(e),null==(s=null==(t=M.value)?void 0:t.clear)||s.call(t)})),P({redrawPoints:T,select:_,canvas:M,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:D,getGridInfo:H}),(e,r)=>(i(),l("div",{class:"c-fabric-chart",style:n(u(E))},[p("canvas",{ref_key:"canvasRef",ref:b},null,512),u(A)?(i(),l(c,{key:0},[h(v,m({propItems:u(S)},R),null,16,["propItems"]),h(u(w),m({propItems:u(S)},B,{show:B.show,"onUpdate:show":r[0]||(r[0]=e=>B.show=e),onClickMenu:u(F)}),null,16,["propItems","show","onClickMenu"])],64)):d("v-if",!0)],4))}});export{P as default};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w}from"lodash-es";import"../temperature/useShadow.js";import{format as x}from"date-fns";import"naive-ui";import"@vueuse/core";function b(b,j,P,C,E){const{computedX:S,computedY:G,getXValue:T,getYValue:L}=c(j),{getEqualXTypes:Y,handleAddPrevent:M,isGridLimit:A,setPrevAndNextPoint:X,getPointEventProps:I}=h(b,P,j),{xAxis:H,grid:W,originX:N,originY:O,xCellWidth:V,endY:D,startTime:R,leftAddAreaWidth:$,leftScales:B,rightScales:F,yCellHeight:q,endX:z,scaleValues:J,canvasWidth:K,borderStyle:Q,rightAddAreaWidth:U,event:Z,originYCervix:_,other:tt,canvasHeight:et}=j,ot=k(J),nt=new Set;function it(){ot.filter((t=>t.show)).forEach(((t,s)=>{var l;const a=[],u=[],c=[];null==(l=t.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=t,x=t.data[f+1],j=ut(x,t);if(l&&j&&!d.breakpoint)h=e([...l,...j],{...m});else if(l&&!j&&!d.breakpoint){const o=ut(x,t);h=o?e([...l,...o],{...m}):null}let E,S;if(d.childbirth){const t=l[1]+q;E=o([l[0],l[1],t],w),c.push(E),S=n([l[0]+V/2,t-q/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(S)}const G=u[f-1],Y={origin:{data:d,title:v,key:y||"",dataIndex:s,index:f},leftLine:G,rightLine:h,arrowGroup:E,arrowGroupText:S,...g,...I()};l&&(G||(Y.leftLine=null),p=r(k,{left:l[0],top:l[1],...Y}));u.push(h),p&&(!function(t){Z.hovered&&(t.on("mouseover",(()=>{at(t,"hover")})),t.on("mouseout",(()=>{C.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{lt(t),function(t){var e,o,n,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top}),null==(n=t.arrowGroup)||n.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+V/2,top:t.top+q/2})}(t),Z.hovered&&at(t)})),t.on("mouseup",(e=>{if(C.show=!1,1===e.button){const{key:e}=t.origin,o={...t.origin,data:{...t.origin.data,time:T(t.left),value:L(e,t.top)}};b.value.discardActiveObject(),P("change",o),rt(o,"change")}}))}(p),a.push(p),nt.add(p))}(ut(l,t),l,d)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));X(t),Promise.all(c).then((o=>{b.value.add(...e,...t,...o),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function rt(t,e="add"){const{dataIndex:o,data:n,index:i,key:r}=t,s=ot.find((t=>t.key===r));switch(e){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const t=g(n.time,s.data);s.data.splice(t,0,n);break}}st()}function st(){var t;nt.size&&(null==(t=b.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...nt]))),nt.clear(),it()}function lt(t){const e=t.prevPoint?t.prevPoint.left:N,o=t.nextPoint?t.nextPoint.left:z;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<_&&t.set("top",_),t.top<O&&t.set("top",O),t.top>D&&t.set("top",D),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}function at(t,e="moving"){const{title:o,key:n,data:i}=t.origin;C.point={x:t.left,y:t.top},C.list=[`${o} ${"hover"===e?i.value:L(n,t.top)}`,`时间 ${T(t.left).slice(-5)}`],C.show=!0}function ut(t,e){if(m(t)&&function(t){const e=R+864e5,o=v(t);return o>=R&&o<=e}(t.time)){const o=S(t.time),n=G(e.key,e.range,t.value);return[o,n<O?O:n>D?D:n]}}function ct(t,e){return t+1>e[1]?e[0]:t+1}return u(b,j),function(){const e=new t.Rect({...Q,width:K-$-U-1,height:D-1,left:$,top:0,fill:"transparent"});b.value.add(e)}(),function(){function e(e,o="left"){let r="left"===o?$:z;e.forEach(((e,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=e,j=[],P=[],C=r+c/2,E=y(s,u),S=E.length;E.forEach(((t,o)=>{const{lineXMain:n,lineXSub:i,textLeft:s}=d(v,r,c),l=D-o*q*k,a=0===o?D-8:o!==E.length-1||O||_&&"FHR"!==m?l:O+8;!w||(0===o||o===S-1)&&!x||j.push(f(String(t),e,s,a)),P.push(...p(e,o,n,i,l,q,O,S))}));const G=new t.Rect({...a,strokeWidth:.5,width:c,height:D,left:C,top:D/2}),T=n([C,O>0?O-q/2:q/2],{value:String(h),...i,...g}),L=new t.Group([...P,...j,G,...T?[T]:[]],{objectCaching:!1,...l});b.value.add(L),L.sendToBack(),r+=c}))}e(B),e(F,"right")}(),function(){const{show:e,startTime:o,range:r=[0,23],position:s="top",style:a}=H.time,{show:u,range:c=[0,23],position:d,style:f}=H.processTime;if(e||u){const p=[],h=[],g=[],m=[],v=N+V/2,y=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const e=0===t?+o.slice(11,13):ct(w(p),r);p.push(e);const l="top"===s?O-y:D+y;g.push(n([v+t*V,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:w(h)+1;h.push(e);const o="top"===d?y:et-y;m.push(n([v+t*V,o],{value:String(e),...i,...f||{}}))}}const k=new t.Group([...g,...m],{objectCaching:!1,...l});b.value.add(k),b.value.sendToBack(k)}}(),function(){var t;const o=Object.values(tt),n=[],i={},r=ot.find((t=>"cervix"===t.key&&t.show)),s=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function l(t,e){const{key:o,range:n}=r||{},i=G(o,n,10),s=[0,e],l=[-e/t,0],a=[(D-i-e)/t,D-i],u=[z-N,t*(z-N)+e];let c=[],d=[];function f([o,n]){return Math.abs(n-t*o-e)<=1}function p([t,e]){const[o,n]=[...h([t,e])];return o>=N&&o<=z&&n>=i&&n<=D}function h([t,e]){return[N+t,D-e]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((t=>{if(!t.show)return;const{key:o}=t;switch(o){case"fetalPresentation":{const{range:i,show:r}=ot.find((t=>t.key===o));if(r){const r=G(o,i,0);n.push(e([N,r,z,r],{...t}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:x(new Date(v(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-N,D-G(o,a,s.value)],[p,h]=[S(c.time)-N,D-G(o,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=l(g,m);y.length>0&&(n.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(x(new Date(v(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(e(u,{...t}))}}})),b.value.add(...n)}(),it(),function(){function t(t,e){const o=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:o,key:t.key},pointer:e}}j.event.evented&&b.value.on("mouse:up",(e=>{if(3===e.button){const{x:o=0,y:n=0}=e.pointer||{};o>=N&&o<=z&&n>=O&&n<=D&&(E.point={x:o,y:n},E.show=!0,e.target?(E.target=e.target,E.list=["删除节点"],[...nt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&E.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(E.target=null,E.list=["新增节点"],ot.filter((t=>t.show)).forEach((i=>{if(!Y([...nt],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<_)return;E.list.push(t(i,e.pointer))}})),1===E.list.length&&(E.show=!1,M("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=K-U/2;function e(t,e){if(!t.length)return;let n=O;const i=[];t.forEach((t=>{const o=t.title.split("").join("\n"),r=J.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(o,t,{text:{originY:"top",left:e,top:n},icon:{left:e,topY:n,originY:"top",origin:{type:t.type,dataIndex:r},...j.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),A(u)?(lt(u),at(u)):C.show=!1})),u.on("mouseup:before",(t=>{if(C.show=!1,0===t.e.button&&A(u))if(Y([...nt],u.left,"key").includes(u.origin.key))M("repeat");else{const t={data:{time:T(u.left),value:L(u.origin.key,u.top)},...u.origin};P("add",t),rt(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(u)})),i.push(l,a)})),o(i),b.value.add(...i)}function o(t){const e=w(t),o=(D-O)/2,n=(e.height+e.top-O)/2;t.forEach((t=>{const e=t.top+o-n;t.set({top:e,originTop:e})}))}e(B,$/2),e(F,t)}(),{clickMenu:function({item:t,target:e}){const o={...t.origin};"remove"===t.mode?(P("remove",o),rt(o,"remove")):(Object.assign(o,{data:{time:T(t.pointer.x),value:L(t.origin.key,t.pointer.y)}}),P("add",o),rt(o))},redrawPoints:st}}export{b as useBirthProcess};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w}from"lodash-es";import"../temperature/useShadow.js";import{format as x}from"date-fns";import"naive-ui";import"@vueuse/core";function b(b,j,P,C,E){const{computedX:S,computedY:G,getXValue:T,getYValue:L}=c(j),{getEqualXTypes:Y,handleAddPrevent:M,isGridLimit:A,setPrevAndNextPoint:X,getPointEventProps:I}=h(b,P,j),{xAxis:H,grid:W,originX:N,originY:O,xCellWidth:V,endY:D,startTime:R,leftAddAreaWidth:$,leftScales:B,rightScales:F,yCellHeight:q,endX:z,scaleValues:J,canvasWidth:K,borderStyle:Q,rightAddAreaWidth:U,event:Z,originYCervix:_,other:tt,canvasHeight:et}=j,ot=k(J),nt=new Set;function it(){ot.filter((t=>t.show)).forEach(((t,s)=>{var l;const a=[],u=[],c=[];null==(l=t.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=t,x=t.data[f+1],j=ut(x,t);if(l&&j&&!d.breakpoint)h=e([...l,...j],{...m});else if(l&&!j&&!d.breakpoint){const o=ut(x,t);h=o?e([...l,...o],{...m}):null}let E,S;if(d.childbirth){const t=l[1]+q;E=o([l[0],l[1],t],w),c.push(E),S=n([l[0]+V/2,t-q/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(S)}const G=u[f-1],Y={origin:{data:d,title:v,key:y||"",dataIndex:s,index:f},leftLine:G,rightLine:h,arrowGroup:E,arrowGroupText:S,...g,...I()};l&&(G||(Y.leftLine=null),p=r(k,{left:l[0],top:l[1],...Y}));u.push(h),p&&(!function(t){Z.hovered&&(t.on("mouseover",(()=>{at(t,"hover")})),t.on("mouseout",(()=>{C.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{lt(t),function(t){var e,o,n,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top}),null==(n=t.arrowGroup)||n.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+V/2,top:t.top+q/2})}(t),Z.hovered&&at(t)})),t.on("mouseup",(e=>{if(C.show=!1,1===e.button){const{key:e}=t.origin,o={...t.origin,data:{...t.origin.data,time:T(t.left),value:L(e,t.top)}};b.value.discardActiveObject(),P("change",o),rt(o,"change")}}))}(p),a.push(p),nt.add(p))}(ut(l,t),l,d)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));X(t),Promise.all(c).then((o=>{b.value.add(...e,...t,...o),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function rt(t,e="add"){const{dataIndex:o,data:n,index:i,key:r}=t,s=ot.find((t=>t.key===r));switch(e){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const t=g(n.time,s.data);s.data.splice(t,0,n);break}}st()}function st(){var t;nt.size&&(null==(t=b.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...nt]))),nt.clear(),it()}function lt(t){const e=t.prevPoint?t.prevPoint.left:N,o=t.nextPoint?t.nextPoint.left:z;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<_&&t.set("top",_),t.top<O&&t.set("top",O),t.top>D&&t.set("top",D),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}function at(t,e="moving"){const{title:o,key:n,data:i}=t.origin;C.point={x:t.left,y:t.top},C.list=[`${o} ${"hover"===e?i.value:L(n,t.top)}`,`时间 ${T(t.left).slice(-5)}`],C.show=!0}function ut(t,e){if(m(t)&&function(t){const e=R+864e5,o=v(t);return o>=R&&o<=e}(t.time)){const o=S(t.time),n=G(e.key,e.range,t.value);return[o,n<O?O:n>D?D:n]}}function ct(t,e){return t+1>e[1]?e[0]:t+1}return u(b,j),function(){const e=new t.Rect({...Q,width:K-$-U-1,height:D-1,left:$,top:0,fill:"transparent"});b.value.add(e)}(),function(){function e(e,o="left"){let r="left"===o?$:z;e.forEach(((e,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=e,j=[],P=[],C=r+c/2,E=y(s,u),S=E.length,{lineXMain:G,lineXSub:T,textLeft:L}=d(v,r,c);E.forEach(((t,o)=>{const n=D-o*q*k,i=0===o?D-8:o!==E.length-1||O||_&&"FHR"!==m?n:O+8;!w||(0===o||o===S-1)&&!x||j.push(f(String(t),e,L,i)),P.push(...p(e,o,G,T,n,q,O,S))}));const Y=new t.Rect({...a,strokeWidth:.5,width:c,height:D,left:C,top:D/2}),M=n([C,O>0?O-q/2:q/2],{value:String(h),...i,...g}),A=new t.Group([...P,...j,Y,...M?[M]:[]],{objectCaching:!1,...l});b.value.add(A),A.sendToBack(),r+=c}))}e(B),e(F,"right")}(),function(){const{show:e,startTime:o,range:r=[0,23],position:s="top",style:a}=H.time,{show:u,range:c=[0,23],position:d,style:f}=H.processTime;if(e||u){const p=[],h=[],g=[],m=[],v=N+V/2,y=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const e=0===t?+o.slice(11,13):ct(w(p),r);p.push(e);const l="top"===s?O-y:D+y;g.push(n([v+t*V,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:w(h)+1;h.push(e);const o="top"===d?y:et-y;m.push(n([v+t*V,o],{value:String(e),...i,...f||{}}))}}const k=new t.Group([...g,...m],{objectCaching:!1,...l});b.value.add(k),b.value.sendToBack(k)}}(),function(){var t;const o=Object.values(tt),n=[],i={},r=ot.find((t=>"cervix"===t.key&&t.show)),s=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function l(t,e){const{key:o,range:n}=r||{},i=G(o,n,10),s=[0,e],l=[-e/t,0],a=[(D-i-e)/t,D-i],u=[z-N,t*(z-N)+e];let c=[],d=[];function f([o,n]){return Math.abs(n-t*o-e)<=1}function p([t,e]){const[o,n]=[...h([t,e])];return o>=N&&o<=z&&n>=i&&n<=D}function h([t,e]){return[N+t,D-e]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((t=>{if(!t.show)return;const{key:o}=t;switch(o){case"fetalPresentation":{const{range:i,show:r}=ot.find((t=>t.key===o));if(r){const r=G(o,i,0);n.push(e([N,r,z,r],{...t}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:x(new Date(v(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-N,D-G(o,a,s.value)],[p,h]=[S(c.time)-N,D-G(o,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=l(g,m);y.length>0&&(n.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(x(new Date(v(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(e(u,{...t}))}}})),b.value.add(...n)}(),it(),function(){function t(t,e){const o=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:o,key:t.key},pointer:e}}j.event.evented&&b.value.on("mouse:up",(e=>{if(3===e.button){const{x:o=0,y:n=0}=e.pointer||{};o>=N&&o<=z&&n>=O&&n<=D&&(E.point={x:o,y:n},E.show=!0,e.target?(E.target=e.target,E.list=["删除节点"],[...nt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&E.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(E.target=null,E.list=["新增节点"],ot.filter((t=>t.show)).forEach((i=>{if(!Y([...nt],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<_)return;E.list.push(t(i,e.pointer))}})),1===E.list.length&&(E.show=!1,M("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=K-U/2;function e(t,e){if(!t.length)return;let n=O;const i=[];t.forEach((t=>{const o=t.title.split("").join("\n"),r=J.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(o,t,{text:{originY:"top",left:e,top:n},icon:{left:e,topY:n,originY:"top",origin:{type:t.type,dataIndex:r},...j.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),A(u)?(lt(u),at(u)):C.show=!1})),u.on("mouseup:before",(t=>{if(C.show=!1,0===t.e.button&&A(u))if(Y([...nt],u.left,"key").includes(u.origin.key))M("repeat");else{const t={data:{time:T(u.left),value:L(u.origin.key,u.top)},...u.origin};P("add",t),rt(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(u)})),i.push(l,a)})),o(i),b.value.add(...i)}function o(t){const e=w(t),o=(D-O)/2,n=(e.height+e.top-O)/2;t.forEach((t=>{const e=t.top+o-n;t.set({top:e,originTop:e})}))}e(B,$/2),e(F,t)}(),{clickMenu:function({item:t,target:e}){const o={...t.origin};"remove"===t.mode?(P("remove",o),rt(o,"remove")):(Object.assign(o,{data:{time:T(t.pointer.x),value:L(t.origin.key,t.pointer.y)}}),P("add",o),rt(o))},redrawPoints:st}}export{b as useBirthProcess};
@@ -8,3 +8,4 @@ export * from './birthProcess/useBirthProcessChart';
8
8
  export * from './temperature/useTemperatureChart';
9
9
  export * from './surgicalAnesthesia/useSurgicalAnesthesiaChart';
10
10
  export * from './electrocardiogram/useElectrocardiogramChart';
11
+ export * from './newBirthProcess/useNewBirthProcessChart';
@@ -1 +1 @@
1
- export{defaultBorderStyle,defaultLineStyle,defaultRectStyle,defaultStyle,defaultTextStyle,drawArrow,drawLine,drawPoint,drawText,drawTextAndIconGroup,drawTextGroup}from"./useDraw.js";export{useGrid}from"./useGrid.js";export{useBirthProcessCumputedPoint,useCumputedPoint,useElectrocardiogramCumputedPoint}from"./useCumputedPoint.js";export{bus,useCanvasEvent}from"./useEvent.js";export{drawScaleLine,drawScaleNumber,getScaleInfo}from"./useScaleColumn.js";export{useCommon}from"./useCommon.js";export{useBirthProcessChart}from"./birthProcess/useBirthProcessChart.js";export{useTemperatureChart}from"./temperature/useTemperatureChart.js";export{useSurgicalAnesthesiaChart}from"./surgicalAnesthesia/useSurgicalAnesthesiaChart.js";export{useElectrocardiogramChart}from"./electrocardiogram/useElectrocardiogramChart.js";
1
+ export{defaultBorderStyle,defaultLineStyle,defaultRectStyle,defaultStyle,defaultTextStyle,drawArrow,drawLine,drawPoint,drawText,drawTextAndIconGroup,drawTextGroup}from"./useDraw.js";export{useGrid}from"./useGrid.js";export{useBirthProcessCumputedPoint,useCumputedPoint,useElectrocardiogramCumputedPoint}from"./useCumputedPoint.js";export{bus,useCanvasEvent}from"./useEvent.js";export{drawScaleLine,drawScaleNumber,getScaleInfo}from"./useScaleColumn.js";export{useCommon}from"./useCommon.js";export{useBirthProcessChart}from"./birthProcess/useBirthProcessChart.js";export{useTemperatureChart}from"./temperature/useTemperatureChart.js";export{useSurgicalAnesthesiaChart}from"./surgicalAnesthesia/useSurgicalAnesthesiaChart.js";export{useElectrocardiogramChart}from"./electrocardiogram/useElectrocardiogramChart.js";export{useNewBirthProcessChart}from"./newBirthProcess/useNewBirthProcessChart.js";
@@ -0,0 +1,7 @@
1
+ import { type Ref } from 'vue';
2
+ import { fabric } from '../../../../../shared/utils/fabricjs';
3
+ import { AnyObject } from '../../../../../shared/types';
4
+ import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
+ export declare function useNewBirthProcess(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ redrawPoints: () => void;
7
+ };
@@ -0,0 +1 @@
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultTextStyle as n,defaultStyle as i,drawPoint as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as s,drawScaleNumber as u,drawScaleLine as a}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import{isEffectiveNode as f,getTime as h,getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as p,last as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function v(v,g,y,b,w){const{computedX:x,computedY:S,getXValue:j,getYValue:k}=l(g),{getEqualXTypes:E,handleAddPrevent:L,isGridLimit:P,setPrevAndNextPoint:C,getPointEventProps:X}=c(v,y,g),{xAxis:G,grid:T,originX:A,originY:N,xCellWidth:V,endY:Y,startTime:M,leftScales:$,rightScales:B,yCellHeight:H,endX:W,scaleValues:q,canvasWidth:z,borderStyle:D,event:F,other:I,canvasHeight:R}=g,J=p(q),K=new Set;function O(){J.filter((t=>t.show)).forEach(((t,r)=>{var l;const s=[],u=[],a=[];null==(l=t.data)||l.forEach(((l,c)=>{!function(l,c,f){let h,d;const{pointAttr:p={},lineAttr:m={},title:v="",key:g,type:y="circle",childbirthStyle:w={}}=t,x=t.data[f+1],S=U(x,t);if(l&&S&&!c.breakpoint)d=Q([...l,...S],m);else if(l&&!S&&!c.breakpoint){const e=U(x,t);d=e?Q([...l,...e],m):null}if(c.childbirth){const t=l[0]+V,i=l[1]+H/2,o=Q([l[0],l[1],t,i],m);a.push(o);const r=e([t,i],{value:String(c.childbirth),...n,...w,backgroundColor:"#fff"});a.push(r)}const E=u[f-1],L={origin:{data:c,title:v,key:g||"",dataIndex:r,index:f},leftLine:E,rightLine:d,...p,...X(),...i};l&&(E||(L.leftLine=null),h=o(y,{left:l[0],top:l[1],...L}));u.push(d),h&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{!function(t,e="moving"){const{title:n,key:i,data:o}=t.origin;b.point={x:t.left,y:t.top},b.list=[`${n} ${"hover"===e?o.value:k(i,t.top)}`,`时间 ${j(t.left).slice(-5)}`],b.show=!0}(t,"hover")})),t.on("mouseout",(()=>{b.show=!1})))}(h),s.push(h),K.add(h))}(U(l,t),l,c)})),Promise.all(s).then((t=>{const e=u.filter((t=>t));C(t),Promise.all(a).then((n=>{v.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Q([e,n,o,r],l){return new t.Polyline([{x:e,y:n},{x:o,y:n},{x:o,y:r}],{...l,fill:"transparent",...i})}function U(t,e){if(f(t)&&function(t){const e=M+864e5,n=h(t);return n>=M&&n<=e}(t.time)){const n=x(t.time),i=S(e.key,e.range,t.value);return[n,i<N?N:i>Y?Y:i]}}function Z(t,e,n=1){return t+n>e[1]?e[0]:t+n}return r(v,g),function(){const e=new t.Rect({...D,width:W-A,height:Y-N,left:A,top:N,fill:"transparent"});v.value.add(e)}(),function(){function o(o,r="left"){const l=10;let c="left"===r?0:W;o.forEach(((o,r)=>{const{range:f,spaceValue:h,width:p,title:m,titleStyle:g,unit:y,key:b,position:w="center",spaceGridNumber:x=1,showNumber:S,showMaxMinNumber:j}=o,k=[],E=[],L=d(f,h),P=L.length,{lineXMain:C,lineXSub:X,textLeft:G}=s(w,c,p);L.forEach(((t,e)=>{const n=Y-e*H*x;!S||(0===e||e===P-1)&&!j||k.push(u(String(t),o,G,n)),E.push(...a(o,e,C,X,n,H,N,P))}));const T=e([c+l,N+(Y-N)/2],{value:String(m+"("+y+")"),...n,originX:"left",angle:-90,...g}),A=new t.Group([...E,...k,...T?[T]:[]],{objectCaching:!1,...i});v.value.add(A),A.sendToBack(),c+=p}))}o($),o(B,"right")}(),function(){const{show:o,startTime:r,range:l=[0,20],position:s="top",style:u,spaceGridNumber:a=2,spaceValue:c=2}=G.time;if(o){const f=[],h=[],d=[],p=H/2;for(let t=0,i=T.mainXCell/2;t<i+1;t++)if(o){const i=0===t?+r.slice(11,13):Z(m(f),l,c);f.push(i);const o="top"===s?N-p:Y+p;h.push(e([A+t*V*a,o],{value:String(i),...n,...u||{}}))}const g=new t.Group([...h,...d],{objectCaching:!1,...i});v.value.add(g),v.value.sendToBack(g)}}(),function(){const{alertLineList:t=[]}=I;t.length<1||t.forEach((t=>{const{style:n,data:i=[]}=t;if(i.length<1)return;const o=[],r=J.find((t=>"cervix"===t.key));i.forEach(((t,l)=>{const s=U(t,r),u=U(i[l+1],r);s&&!u&&o.push(e([s[0],N-10],{value:i[0].value+(r.unit||"cm"),fill:n.stroke||"#000"})),s&&u&&o.push(Q([...s,...u],n))})),v.value.add(...o)}))}(),O(),{redrawPoints:function(){var t;K.size&&(null==(t=v.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...K]))),K.clear(),O()}}}export{v as useNewBirthProcess};
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'vue';
2
+ import { fabric } from '../../../../../shared/utils/fabricjs';
3
+ import { AnyObject } from '../../../../../shared/types';
4
+ import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
+ export declare function useNewBirthProcessChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ propItems: any;
7
+ redrawPoints: Ref<any>;
8
+ select: Ref<any>;
9
+ clickMenu: Ref<any>;
10
+ };
@@ -0,0 +1 @@
1
+ import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{useNewBirthProcess as u}from"./useNewBirthProcess.js";function s(s,o,d,n,v,c){const h=e(),m=e(),p=e(),g=t((()=>o.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),x=t((()=>o.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=t((()=>{var e;return null==(e=g.value)?void 0:e.reduce(((e,t)=>e+=t.width),0)})),f=t((()=>{var e;const{width:t}=o.data;return t-((null==(e=x.value)?void 0:e.reduce(((e,t)=>e+=t.width),0))||10)})),b=t((()=>o.data.grid.mainXCell||20)),j=t((()=>o.data.grid.mainYCell||8)),y=t((()=>(f.value-w.value)/b.value)),S=t((()=>{var e;const{xAxis:t,height:a,other:l}=o.data,r=Object.values(t).reduce(((e,t)=>(t.show&&e++,e)),0),i=(null!=(e=null==l?void 0:l.alertLineList.length)?e:0)>0;return a/(j.value+r+(i?1:0))})),A=t((()=>{var e;const{xAxis:t,other:a}=o.data,l=Object.values(t).reduce(((e,t)=>(t.show&&"top"===t.position&&e++,e)),0),r=(null!=(e=null==a?void 0:a.alertLineList.length)?e:0)>0;return S.value*(l||r?1:0)})),C=t((()=>{const{xAxis:e,height:t}=o.data,a=Object.values(e).reduce(((e,t)=>(t.show&&"bottom"===t.position&&e++,e)),0);return t-S.value*a})),V=t((()=>i(o.data.xAxis.time.startTime))),X=t((()=>36e5/y.value)),Y=t((()=>{const{scaleValues:e}=o.data,t=e.find((e=>"cervix"===e.key));return S.value/((null==t?void 0:t.spaceValue)||1)})),L=t((()=>{var e;return(null==(e=o.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),N=a({canvasWidth:o.data.width,canvasHeight:o.data.height,borderStyle:{...r,...o.data.borderStyle||{}},selectionStyle:o.data.selectionStyle||{},grid:o.data.grid,other:o.data.other,originX:w.value,endX:f.value,originY:A.value,endY:C.value,xCellWidth:y.value,yCellHeight:S.value,gridXNumber:b.value,gridYNumber:j.value,xAxis:o.data.xAxis,leftScales:g.value,rightScales:x.value,startTime:V.value,timeXCell:X.value,cervixYCell:Y.value,scaleValues:o.data.scaleValues,event:L.value});return l((()=>s.value),(e=>{e&&function(){const{redrawPoints:e}=u(s,N,d,v);m.value=e}()}),{immediate:!0}),{propItems:N,redrawPoints:m,select:h,clickMenu:p}}export{s as useNewBirthProcessChart};
@@ -1,7 +1,8 @@
1
1
  import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../shared/types';
4
- export declare type IType = 'temperature' | 'birthProcess' | 'surgicalAnesthesia' | 'electrocardiogram' | undefined;
4
+ export declare type IType = 'temperature' | 'birthProcess' | 'surgicalAnesthesia' | 'electrocardiogram' | 'newBirthProcess' | undefined;
5
+ export declare type ILineCoordinate = [number, number, number, number];
5
6
  interface IEvent {
6
7
  selectable: boolean;
7
8
  evented: boolean;
@@ -31,7 +32,7 @@ interface IGrid {
31
32
  subSecondXCell: number;
32
33
  mainYCell: number;
33
34
  subYCell: number;
34
- surplusCell: [number, number, number, number];
35
+ surplusCell: ILineCoordinate;
35
36
  mainLineStyle?: ImainLineStyle;
36
37
  subLineStyle?: fabric.ILineOptions;
37
38
  subSecondLineStyle?: fabric.ILineOptions;
@@ -79,7 +80,7 @@ export interface IPropItems {
79
80
  itemList: Array<any>;
80
81
  getRightInfo: AnyObject;
81
82
  config: AnyObject;
82
- surplusCell: [number, number, number, number];
83
+ surplusCell: ILineCoordinate;
83
84
  }
84
85
  export interface IPoint {
85
86
  time: string;
@@ -457,9 +457,9 @@ declare const _default: import("vue").DefineComponent<{
457
457
  requiredDisable: boolean;
458
458
  hide: boolean;
459
459
  }>;
460
+ isHighlightRow: boolean;
460
461
  idx: number;
461
462
  isHighlight: boolean;
462
- isHighlightRow: boolean;
463
463
  }>;
464
464
  EditDialog: import("vue").DefineComponent<{
465
465
  visible: {
@@ -575,9 +575,9 @@ declare const _default: import("vue").DefineComponent<{
575
575
  requiredDisable: boolean;
576
576
  hide: boolean;
577
577
  }>;
578
+ isHighlightRow: boolean;
578
579
  idx: number;
579
580
  isHighlight: boolean;
580
- isHighlightRow: boolean;
581
581
  }>;
582
582
  isArray: {
583
583
  (value?: any): value is any[];
@@ -282,8 +282,8 @@ declare const _default: import("vue").DefineComponent<{
282
282
  requiredDisable: boolean;
283
283
  hide: boolean;
284
284
  }>;
285
+ isHighlightRow: boolean;
285
286
  idx: number;
286
287
  isHighlight: boolean;
287
- isHighlightRow: boolean;
288
288
  }>;
289
289
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as i,openBlock as t,createBlock as l,unref as a,withCtx as o,createVNode as r,createTextVNode as n}from"vue";import{pick as s}from"lodash-es";import{NButtonGroup as m,NPopconfirm as u,NButton as d}from"naive-ui";import{EditAbleField as f}from"../constants/index.js";import{useConfigurationField as _}from"../hooks/useConfigurationField.js";import"../../../index.js";import L from"../../../form-render/index.js";var c=e({__name:"FormConfigCreator",emits:{submit:e=>e},setup(e,{emit:c}){const p=_().generateFieldListByKeys([f.NAME,f.LAYOUT_WIDTH_ENUM,f.NOTES,f.DEFAULT_EXPAND,f.FOLD]),h=i(),E=i(),w={defaultExpand:!0,fold:!0,layoutWidthEnum:"ALL_LINE"};async function y(e,i,t){if(!t)return;await t.validate();const l=t.getFormValues();c("submit",{layoutWidthEnum:"ALL_LINE",...l,type:e,key:l.name,...i,__new:!0})}return(e,i)=>(t(),l(a(m),{size:"small"},{default:o((()=>[r(a(u),{width:"200px","show-icon":!1,"show-arrow":!1,onPositiveClick:i[0]||(i[0]=e=>y("NEWLINE",{},E.value))},{trigger:o((()=>[r(a(d),null,{default:o((()=>[n("新建分行符")])),_:1})])),default:o((()=>[r(a(L),{column:12,ref_key:"lineBreakFormRef",ref:E,"initial-data":a(s)(w,["layoutWidthEnum"]),size:"small","label-width":"auto","label-placement":"left",fieldList:a(p).slice(0,2)},null,8,["initial-data","fieldList"])])),_:1}),r(a(u),{width:"300px","show-icon":!1,"show-arrow":!1,onPositiveClick:i[1]||(i[1]=e=>y("LINE_BAR",{children:[]},h.value))},{trigger:o((()=>[r(a(d),null,{default:o((()=>[n("新建分线栏")])),_:1})])),default:o((()=>[r(a(L),{column:12,ref_key:"linebarFormRef",ref:h,"initial-data":w,size:"small","label-width":"auto","label-placement":"left",fieldList:a(p)},null,8,["fieldList"])])),_:1})])),_:1}))}});export{c as default};
1
+ import{defineComponent as e,ref as i,openBlock as t,createBlock as l,unref as a,withCtx as o,createVNode as r,createTextVNode as n}from"vue";import{pick as s}from"lodash-es";import{NButtonGroup as m,NPopconfirm as u,NButton as d}from"naive-ui";import{EditAbleField as f}from"../constants/index.js";import{useConfigurationField as _}from"../hooks/useConfigurationField.js";import"../../../index.js";import L from"../../../form-render/index.js";var c=e({__name:"FormConfigCreator",emits:{submit:e=>e},setup(e,{emit:c}){const p=_().generateFieldListByKeys([f.NAME,f.LAYOUT_WIDTH_ENUM,f.NOTES,f.DEFAULT_EXPAND,f.FOLD]),h=i(),E=i(),w={defaultExpand:!0,fold:!0,layoutWidthEnum:"ALL_LINE"};async function y(e,i,t){if(!t)return;await t.validate();const l=t.getFormValues();c("submit",{layoutWidthEnum:"ALL_LINE",...l,type:e,key:l.name,...i,__new:!0})}return(e,i)=>(t(),l(a(m),{size:"small"},{default:o((()=>[r(a(u),{width:"200px","show-icon":!1,"show-arrow":!1,onPositiveClick:i[0]||(i[0]=e=>y("NEWLINE",{},E.value))},{trigger:o((()=>[r(a(d),null,{default:o((()=>[n("新建分行符")])),_:1})])),default:o((()=>[r(a(L),{column:12,ref_key:"lineBreakFormRef",ref:E,"initial-data":a(s)(w,["layoutWidthEnum"]),size:"small","label-width":"auto","label-placement":"left",fieldList:a(p).slice(0,1)},null,8,["initial-data","fieldList"])])),_:1}),r(a(u),{width:"300px","show-icon":!1,"show-arrow":!1,onPositiveClick:i[1]||(i[1]=e=>y("LINE_BAR",{children:[]},h.value))},{trigger:o((()=>[r(a(d),null,{default:o((()=>[n("新建分线栏")])),_:1})])),default:o((()=>[r(a(L),{column:12,ref_key:"linebarFormRef",ref:h,"initial-data":w,size:"small","label-width":"auto","label-placement":"left",fieldList:a(p)},null,8,["fieldList"])])),_:1})])),_:1}))}});export{c as default};
@@ -1 +1 @@
1
- import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as _,isEditOptionConfig as o,isNullOptionConfig as m,isVisibleOptionConfig as s,rowsOptionConfig as n}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as r}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=r();function E(){const r=new Map([[l.KEY,e=>({alias:"字段",elem_width:6,html_type:"TEXT",content:null==e?void 0:e.key,decoratorProps:{labelPlacement:"left"}})],[l.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const a=d.call(Object.assign({},null==l?void 0:l.originalSetting,i),{});return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(a.componentProps,["class","style","disabled"]),...t(a,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","allowSlash","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...a()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,..._()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",...o()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...m()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...s()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...n()})]]);function E(e,t,l){return e.map((e=>{var i,a;return{...null!=(a=null==(i=r.get(e))?void 0:i(t,l))?a:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.KEY,l.NAME,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[l.KEY,l.NAME,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.KEY,l.NAME,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const a=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&a.splice(3,0,l.ROWS),E(a,e,t)}}}export{E as useConfigurationField};
1
+ import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as _,isEditOptionConfig as o,isNullOptionConfig as m,isVisibleOptionConfig as s,rowsOptionConfig as n}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as r}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=r();function E(){const r=new Map([[l.KEY,e=>({alias:"字段",elem_width:6,html_type:"TEXT",content:null==e?void 0:e.key,decoratorProps:{labelPlacement:"left"}})],[l.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const a=d.call(Object.assign({},null==l?void 0:l.originalSetting,i),{});return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(a.componentProps,["class","style","disabled"]),...t(a,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","allowSlash","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...a()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,..._()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",...o()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...m()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...s()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...n()})]]);function E(e,t,l){return e.map((e=>{var i,a;return{...null!=(a=null==(i=r.get(e))?void 0:i(t,l))?a:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.KEY,l.NAME,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],["NEWLINE",[l.KEY,l.NAME]],...["COMPLEX","COMBINATION"].map((e=>[e,[l.KEY,l.NAME,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.KEY,l.NAME,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const a=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&a.splice(3,0,l.ROWS),E(a,e,t)}}}export{E as useConfigurationField};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,computed as r,ref as t,onUnmounted as o,createVNode as n,mergeProps as a,unref as i}from"vue";import{arrayed as u,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as d}from"@formily/core";import{observe as m,autorun as f}from"@formily/reactive";import{connect as v,mapProps as p}from"@formily/vue";import{useDebounceFn as c}from"@vueuse/core";import{isString as b,isArray as y,isNumber as _,isFunction as h,uniq as g}from"lodash-es";import{NFormItem as x}from"naive-ui";import I from"../../../../annotation-edit/index.js";import"../../../index.js";import F from"../tooltipMessage.vue.js";import{InjectionFormUUID as k,InjectionFormGraph as j,InjectionAnnotation as R,InjectionAnnotationShortcuts as M,InjectionFormGlobalProps as L,InjectionFormGlobalEmit as q}from"../../constants/index.js";import{useComplexOptionsSpan as E}from"../../hooks/useComplexOptions.js";import{validateMessageParser as K,editorUnescape as N}from"../../utils/index.js";import{dotEscape as S}from"../../utils/schema.js";import{useFormField as W}from"../../hooks/useFormField.js";const A=v(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{type:Object}},setup(e,{slots:u,attrs:v}){const{field:p,fieldKey:K,fieldAddress:A}=W(),O=l(k),T=r((()=>S(`${O}-${A.value}`))),C=t(!1);if(d(p.value)&&y(e.suffixFields)){const r=l(j);o(m(r,c((()=>{d(p.value)&&y(e.suffixFields)&&(C.value=e.suffixFields.some((e=>{const l=p.value.form.query(e).take();return l&&Reflect.get(l,"required")})))}),100)))}else o(f((()=>{C.value=Reflect.get(p.value,"required")})));const P=l(R),V=r({get(){var l,r;return null!=(r=null==(l=P.value)?void 0:l[e.propertyKey])?r:""},set(l){P.value={property:e.propertyKey,value:l}}}),$=l(M);const w=r((()=>P.value&&!1!==e.annotation)),B=r((()=>e.label&&" "!==e.label)),H=r((()=>{let l=0;return w.value&&(l+=18),e.remark&&(l+=18),l})),U=l(L,{}),z=r((()=>{var l;const r=null==(l=e.fieldItem)?void 0:l.bordered;return null==r?U.bordered:r})),D=l("n-form",{}),G=r((()=>{var e,l,r,t;if("left"!==(null!=(l=v.labelPlacement)?l:null==(e=D.props)?void 0:e.labelPlacement))return"";let o=null!=(t=v.labelWidth)?t:null==(r=D.props)?void 0:r.labelWidth;return o&&"auto"!==o?(o=+o,isNaN(o)||!_(o)?"":s(o-12-H.value-(C.value?11:0))):""})),J=r((()=>h(e.labelRender)?"":b(e.label)?e.label:""));function Q(){return B.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:s(H.value),maxWidth:G.value},title:J.value},[h(e.labelRender)?e.labelRender(e.label):e.label]),H.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(F,{message:e.remark},null)]):null,w.value?n(I,{class:"form-render__formItemLabel--annotation",modelValue:V.value,"onUpdate:modelValue":e=>V.value=e,shortcuts:i($)},null):null]):null]):null}const{getSpan:X}=E();function Y(){var l,r,t;const o=null==(l=e.fieldItem)?void 0:l.editor_title;return b(o)&&o?n("section",{style:"display:flex;flex-direction:column;gap:4px"},[null==(t=u.default)?void 0:t.call(u),n("div",{innerHTML:N(o)},null)]):null==(r=u.default)?void 0:r.call(u)}const Z=l(L),ee=l(q);function le(){const e=[p.value.path+""];return p.value.form.query("*").forEach((l=>{(l.address+"").includes(p.value.address+"")&&((l.path+"").includes(p.value.path+"")||e.push(l.path+""))})),e}const re=r({get:()=>!(!(null==Z?void 0:Z.selectMode)||!y(null==Z?void 0:Z.selectedFields))&&Z.selectedFields.includes(p.value.path+""),set(e){if(!y(null==Z?void 0:Z.selectedFields))return;let l=[...Z.selectedFields];e?(l.push(...le()),l=g(l)):le().forEach((e=>{const r=l.indexOf(e);r>-1&&l.splice(r,1)})),null==ee||ee("update:selectedFields",l)}}),te=r((()=>(null==Z?void 0:Z.selectMode)&&!(p.value.parent&&"LINEBAR"!==p.value.parent.componentType)));function oe(){(null==Z?void 0:Z.selectMode)&&(re.value=!re.value)}return()=>{return n(x,a({class:["form-render__formItem",{"form-render--no-border":!z.value,"form-render--underline":"underline"===z.value,"form-render__formItemMask":te.value,"form-render__formItemMask--selected":te.value&&re.value}],style:{"--form-item-column":"inner"===(null==(l=e.fieldItem)?void 0:l.childWidthMode)?e.span:X(O,p.value.address,!1)+e.span}},{id:T.value,uuid:O,onClick:oe,"widget-type":p.value.componentType,"field-key":S(K.value),"field-address":S(A.value),required:C.value}),{...u,default:Y,label:Q});var l}}}),p({title:"label"},((e,l)=>{const r=d(l)?void 0:u(l.selfErrors).length?function(e,l){if(!b(l.defined_error_msg)||!l.defined_error_msg)return e.map((e=>K(e,l))).join(",");return K(l.defined_error_msg,l)}(u(l.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:r,"validation-status":r?"error":void 0}})));export{A as FORM_ITEM};
1
+ import{defineComponent as e,inject as l,computed as r,ref as t,onUnmounted as o,createVNode as n,mergeProps as a,unref as i}from"vue";import{arrayed as u,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as d}from"@formily/core";import{observe as m,autorun as f}from"@formily/reactive";import{connect as v,mapProps as p}from"@formily/vue";import{useDebounceFn as c}from"@vueuse/core";import{isString as b,isArray as y,isNumber as _,isFunction as h,uniq as g}from"lodash-es";import{NFormItem as x}from"naive-ui";import I from"../../../../annotation-edit/index.js";import"../../../index.js";import F from"../tooltipMessage.vue.js";import{InjectionFormUUID as k,InjectionFormGraph as j,InjectionAnnotation as R,InjectionAnnotationShortcuts as M,InjectionFormGlobalProps as L,InjectionFormGlobalEmit as q}from"../../constants/index.js";import{useComplexOptionsSpan as E}from"../../hooks/useComplexOptions.js";import{validateMessageParser as K,editorUnescape as N}from"../../utils/index.js";import{dotEscape as S}from"../../utils/schema.js";import{useFormField as W}from"../../hooks/useFormField.js";const A=v(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},fieldItem:{type:Object}},setup(e,{slots:u,attrs:v}){const{field:p,fieldKey:K,fieldAddress:A}=W(),O=l(k),T=r((()=>S(`${O}-${A.value}`))),C=t(!1);if(d(p.value)&&y(e.suffixFields)){const r=l(j);o(m(r,c((()=>{d(p.value)&&y(e.suffixFields)&&(C.value=e.suffixFields.some((e=>{const l=p.value.form.query(e).take();return l&&Reflect.get(l,"required")})))}),100)))}else o(f((()=>{C.value=Reflect.get(p.value,"required")})));const P=l(R),V=r({get(){var l,r;return null!=(r=null==(l=P.value)?void 0:l[e.propertyKey])?r:""},set(l){P.value={property:e.propertyKey,value:l}}}),$=l(M);const w=r((()=>P.value&&!1!==e.annotation)),B=r((()=>e.label&&" "!==e.label)),H=r((()=>{let l=0;return w.value&&(l+=18),e.remark&&(l+=18),l})),U=l(L,{}),z=r((()=>{var l;const r=null==(l=e.fieldItem)?void 0:l.bordered;return null==r?U.bordered:r})),D=l("n-form",{}),G=r((()=>{var e,l,r,t;if("left"!==(null!=(l=v.labelPlacement)?l:null==(e=D.props)?void 0:e.labelPlacement))return"";let o=null!=(t=v.labelWidth)?t:null==(r=D.props)?void 0:r.labelWidth;return o&&"auto"!==o?(o=parseInt(o+""),isNaN(o)||!_(o)?"":s(o-12-H.value-(C.value?11:0))):""})),J=r((()=>h(e.labelRender)?"":b(e.label)?e.label:""));function Q(){return B.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:s(H.value),maxWidth:G.value},title:J.value},[h(e.labelRender)?e.labelRender(e.label):e.label]),H.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(F,{message:e.remark},null)]):null,w.value?n(I,{class:"form-render__formItemLabel--annotation",modelValue:V.value,"onUpdate:modelValue":e=>V.value=e,shortcuts:i($)},null):null]):null]):null}const{getSpan:X}=E();function Y(){var l,r,t;const o=null==(l=e.fieldItem)?void 0:l.editor_title;return b(o)&&o?n("section",{style:"display:flex;flex-direction:column;gap:4px"},[null==(t=u.default)?void 0:t.call(u),n("div",{innerHTML:N(o)},null)]):null==(r=u.default)?void 0:r.call(u)}const Z=l(L),ee=l(q);function le(){const e=[p.value.path+""];return p.value.form.query("*").forEach((l=>{(l.address+"").includes(p.value.address+"")&&((l.path+"").includes(p.value.path+"")||e.push(l.path+""))})),e}const re=r({get:()=>!(!(null==Z?void 0:Z.selectMode)||!y(null==Z?void 0:Z.selectedFields))&&Z.selectedFields.includes(p.value.path+""),set(e){if(!y(null==Z?void 0:Z.selectedFields))return;let l=[...Z.selectedFields];e?(l.push(...le()),l=g(l)):le().forEach((e=>{const r=l.indexOf(e);r>-1&&l.splice(r,1)})),null==ee||ee("update:selectedFields",l)}}),te=r((()=>(null==Z?void 0:Z.selectMode)&&!(p.value.parent&&"LINEBAR"!==p.value.parent.componentType)));function oe(){(null==Z?void 0:Z.selectMode)&&(re.value=!re.value)}return()=>{return n(x,a({class:["form-render__formItem",{"form-render--no-border":!z.value,"form-render--underline":"underline"===z.value,"form-render__formItemMask":te.value,"form-render__formItemMask--selected":te.value&&re.value}],style:{"--form-item-column":"inner"===(null==(l=e.fieldItem)?void 0:l.childWidthMode)?e.span:X(O,p.value.address,!1)+e.span}},{id:T.value,uuid:O,onClick:oe,"widget-type":p.value.componentType,"field-key":S(K.value),"field-address":S(A.value),required:C.value}),{...u,default:Y,label:Q});var l}}}),p({title:"label"},((e,l)=>{const r=d(l)?void 0:u(l.selfErrors).length?function(e,l){if(!b(l.defined_error_msg)||!l.defined_error_msg)return e.map((e=>K(e,l))).join(",");return K(l.defined_error_msg,l)}(u(l.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:r,"validation-status":r?"error":void 0}})));export{A as FORM_ITEM};
@@ -1 +1 @@
1
- import{arrayed as o}from"../../../../../shared/utils/index.js";import{cloneDeep as e,isArray as r}from"lodash-es";import{unref as t,defineComponent as s}from"vue";import{VxeEventListenerNameList as n}from"../../constants/index.js";import{eventListener2EventName as i}from"../../utils/index.js";import{useConfigHooks as a}from"./useConfigHooks.js";import{useDataHooks as l}from"./useDataHooks.js";import{useDomInsertHooks as f}from"./useDomInsertHooks.js";import{useEventHooks as c}from"./useEventHooks.js";import{useExposeHooks as u}from"./useExposeHooks.js";import{useFieldHooks as d}from"./useFieldHooks.js";import{useSetupHooks as m}from"./useSetupHooks.js";const p=(()=>{let o=null;return()=>o||(o=Object.freeze({configHooks:a().create(),fieldHooks:d().create(),eventHooks:c().create(),dataHooks:l().create(),setupHooks:m().create(),domInsertHooks:f().create(),exposeHooks:u().create()}))})();function k(o,r,t){const s=o.configHooks.config.call(e(r),t);return["rowConfig","editConfig","columnConfig","resizableConfig","seqConfig","sortConfig","filterConfig","radioConfig","checkboxConfig","expandConfig","treeConfig","mouseConfig","menuConfig","keyboardConfig","scrollY","scrollX","editRules"].forEach((e=>{s[e]=o.configHooks[e].call(s[e],s,t)})),s}function H(t,s,n,i){t.fieldHooks.fieldStart.promise(n,i);let a=function e(s){return s.reduce(((s,a,l)=>{const f=[],c=[];let u=!1;return a=t.fieldHooks.field.call(a,{index:l,remove(){u=!0},insertAfter(e){c.push(...o(e))},insertBefore(e){f.push(...o(e))}},n,i),s.push(...f),u||(s.push(a),r(a.children)&&(a.children=e(a.children))),s.push(...c),s}),[])}(e(s));return a=t.fieldHooks.fieldList.call(a,n,i),t.fieldHooks.fieldEnd.promise(n,i),a}function g({hooks:o,config:e,$table:r,emits:s,context:a,globProps:l}){return n.reduce(((n,f)=>(n[f]=n=>function(n,f){var c;const u=i(n);f=o.eventHooks.beforeEvent.call(f,t(e),{$table:t(r),emits:s,globProps:l,...a},u),s(u,f),null==(c=o.eventHooks[n])||c.promise(f,t(e),{$table:t(r),globProps:l,emits:s,...a})}(f,n),n)),{})}function h(e,r,s){return async n=>{e.dataHooks.dataStart.promise(t(r));let i=await n.reduce((async(n,i,a)=>{const l=[],f=[];let c=!1;await e.dataHooks.data.promise(i,t(r),{index:a,$table:s,insertBefore(e){l.push(...o(e))},insertAfter(e){f.push(...o(e))},remove(){c=!0}});const u=await n;return u.push(...l),!c&&u.push(i),u.push(...f),u}),Promise.resolve([]));return i=e.dataHooks.dataList.call(i,t(r)),e.dataHooks.dataEnd.promise(t(r)),i}}function C(o){return{header:s({name:"IhoTableHeader",render:()=>o.domInsertHooks.header.call([])}),footer:s({name:"IhoTableFooter",render:()=>o.domInsertHooks.footer.call([])})}}export{k as applyTableConfigHooks,H as applyTableFieldHooks,h as createDataTransfer,C as createDomInsertComponent,g as createTableEventHandlers,p as createTableHooks};
1
+ import{arrayed as o}from"../../../../../shared/utils/index.js";import{cloneDeep as e,isArray as r}from"lodash-es";import{unref as t,defineComponent as s}from"vue";import{VxeEventListenerNameList as n}from"../../constants/index.js";import{eventListener2EventName as i}from"../../utils/index.js";import{useConfigHooks as a}from"./useConfigHooks.js";import{useDataHooks as f}from"./useDataHooks.js";import{useDomInsertHooks as l}from"./useDomInsertHooks.js";import{useEventHooks as c}from"./useEventHooks.js";import{useExposeHooks as u}from"./useExposeHooks.js";import{useFieldHooks as d}from"./useFieldHooks.js";import{useSetupHooks as m}from"./useSetupHooks.js";const p=(()=>{let o=null;return()=>o||(o=Object.freeze({configHooks:a().create(),fieldHooks:d().create(),eventHooks:c().create(),dataHooks:f().create(),setupHooks:m().create(),domInsertHooks:l().create(),exposeHooks:u().create()}))})();function k(o,r,t){const s=o.configHooks.config.call(e(r),t);return["rowConfig","editConfig","columnConfig","resizableConfig","seqConfig","sortConfig","filterConfig","radioConfig","checkboxConfig","expandConfig","treeConfig","mouseConfig","menuConfig","keyboardConfig","scrollY","scrollX","editRules"].forEach((e=>{s[e]=o.configHooks[e].call(s[e],s,t)})),s}function H(t,s,n,i){t.fieldHooks.fieldStart.promise(n,i);let a=function e(s){return s.reduce(((s,a,f)=>{const l=[],c=[];let u=!1;return a=t.fieldHooks.field.call(a,{index:f,remove(){u=!0},insertAfter(e){c.push(...o(e))},insertBefore(e){l.push(...o(e))}},n,i),s.push(...l),u||(s.push(a),r(a.children)&&(a.children=e(a.children))),s.push(...c),s}),[])}(e(s));return a=t.fieldHooks.fieldList.call(a,n,i),t.fieldHooks.fieldEnd.promise(n,i),a}function g({hooks:o,config:e,$table:r,emits:s,context:a,globProps:f}){return n.reduce(((n,l)=>(n[l]=n=>function(n,l){var c;const u=i(n);if(!(l=o.eventHooks.beforeEvent.call(l,t(e),{$table:t(r),emits:s,globProps:f,...a},u)))return;Reflect.get(l,"eventName")?s(l.eventName,l):s(u,l);null==(c=o.eventHooks[n])||c.promise(l,t(e),{$table:t(r),globProps:f,emits:s,...a})}(l,n),n)),{})}function h(e,r,s){return async n=>{e.dataHooks.dataStart.promise(t(r));let i=await n.reduce((async(n,i,a)=>{const f=[],l=[];let c=!1;await e.dataHooks.data.promise(i,t(r),{index:a,$table:s,insertBefore(e){f.push(...o(e))},insertAfter(e){l.push(...o(e))},remove(){c=!0}});const u=await n;return u.push(...f),!c&&u.push(i),u.push(...l),u}),Promise.resolve([]));return i=e.dataHooks.dataList.call(i,t(r)),e.dataHooks.dataEnd.promise(t(r)),i}}function C(o){return{header:s({name:"IhoTableHeader",render:()=>o.domInsertHooks.header.call([])}),footer:s({name:"IhoTableFooter",render:()=>o.domInsertHooks.footer.call([])})}}export{k as applyTableConfigHooks,H as applyTableFieldHooks,h as createDataTransfer,C as createDomInsertComponent,g as createTableEventHandlers,p as createTableHooks};
@@ -1 +1 @@
1
- import{createVNode as e,defineComponent as o,inject as n,computed as l}from"vue";import{isNumber as t,constant as a,isString as i}from"lodash-es";import"../../../../index.js";import{NCheckbox as d}from"naive-ui";import{defineTablePlugin as c}from"../../../hooks/useTablePlugin.js";function r(){const o="checkRendererPlugin";return c({name:o,apply(n){n.fieldHooks.field.tap(o,((n,{index:l,insertBefore:i},d)=>{if(0===l&&d.selectType&&["checkbox","radio"].includes(d.selectType)){const{radioConfig:n,checkboxConfig:l={}}=d,c={width:45,align:"center",fixed:"left",..."radio"===d.selectType?n:l,field:o,type:d.selectType,annotation:!1};l.disableHeader&&(c.slots={header:()=>e("span",{class:"checkbox-cell--disable"},null),...c.slots}),l.useNCheckbox&&(c.slots={checkbox:e=>s(e,l),header:t(l.maxCheckSize)?a([]):e=>s(e,l),...c.slots}),i(c)}return n}))}})}function s(o,n){return[e(p,{payload:o,checkboxConfig:n},null)]}const p=o({name:"IhoTableNCheckbox",props:{payload:{type:Object,default:()=>({})},checkboxConfig:{type:Object,default:()=>({})}},setup(o){const t=n("$xetable");function a(e,n){var l;n.stopPropagation(),"header"===(null==(l=o.payload)?void 0:l.type)?null==t||t.triggerCheckAllEvent(new MouseEvent("mouse-down"),e):null==t||t.triggerCheckRowEvent(new MouseEvent("mouse-down"),o.payload,e)}const c=l((()=>{var e,n;return i(null==(e=o.checkboxConfig)?void 0:e.indeterminateField)?null==(n=o.payload.row)?void 0:n[o.checkboxConfig.indeterminateField]:o.payload.indeterminate}));return()=>o.payload.visible?e(d,{checked:o.payload.checked,"onUpdate:checked":e=>o.payload.checked=e,indeterminate:c.value,disabled:o.payload.disabled,onUpdateChecked:a},null):null}});export{r as checkRendererPlugin};
1
+ import{createVNode as e,defineComponent as o,inject as n,computed as l}from"vue";import{isNumber as t,constant as a,isString as i}from"lodash-es";import"../../../../index.js";import{NCheckbox as d}from"naive-ui";import{defineTablePlugin as c}from"../../../hooks/useTablePlugin.js";function r(){const o="checkRendererPlugin";return c({name:o,apply(n){n.fieldHooks.field.tap(o,((n,{index:l,insertBefore:i},d)=>{if(0===l&&d.selectType&&["checkbox","radio"].includes(d.selectType)){const{radioConfig:n,checkboxConfig:l={}}=d,c={width:45,align:"center",fixed:"left",..."radio"===d.selectType?n:l,field:o,type:d.selectType,annotation:!1};l.disableHeader&&(c.slots={header:()=>e("span",{class:"checkbox-cell--disable"},null),...c.slots}),l.useNCheckbox&&(c.slots={checkbox:e=>s(e,l),header:t(l.maxCheckSize)?a([]):e=>s(e,l),...c.slots}),i(c)}return n}))}})}function s(o,n){return[e(p,{payload:o,checkboxConfig:n},null)]}const p=o({name:"IhoTableNCheckbox",props:{payload:{type:Object,default:()=>({})},checkboxConfig:{type:Object,default:()=>({})}},setup(o){const t=n("$xetable");function a(e,n){var l;n.stopPropagation(),"header"===(null==(l=o.payload)?void 0:l.type)?null==t||t.triggerCheckAllEvent(new MouseEvent("mouse-down"),e):null==t||t.triggerCheckRowEvent(new MouseEvent("mouse-down"),o.payload,e)}const c=l((()=>{var e,n;return i(null==(e=o.checkboxConfig)?void 0:e.indeterminateField)?null==(n=o.payload.row)?void 0:n[o.checkboxConfig.indeterminateField]:o.payload.indeterminate}));return()=>!1===o.payload.visible?null:e(d,{checked:o.payload.checked,"onUpdate:checked":e=>o.payload.checked=e,indeterminate:c.value,disabled:o.payload.disabled,onUpdateChecked:a},null)}});export{r as checkRendererPlugin};
@@ -1 +1 @@
1
- import{isObject as e}from"lodash-es";import{unref as o}from"vue";import{isVerticalTable as n,isVerticalHeader as r,getHeaderDepthByField as t,getOriginFieldFromRowData as d,getOriginRowFromRowData as l}from"../utils.js";const u=(u,c,m)=>{c.eventHooks.beforeEvent.tap("Vertical--useEventConvert",((u,c)=>{var i;if(!e(u))return u;const x=null==(i=o(c))?void 0:i.uuid;if(!x||!n(c))return u;const I=u,{$table:a,$event:s,cell:v}=I;let{$columnIndex:f,$rowIndex:p,column:w,columnIndex:$,row:h,rowIndex:b,type:_,_rowIndex:y,_columnIndex:E}=I;if(w&&(_=r(w.field)?"header":"body",h)){const e=t(w.field);w=d(h),h="header"===_?void 0:l(h,e),E=$=f=(m(x).headerDepth||0)+(y||0),y=b=p="header"===_?-1:e}return{$table:a,$event:s,cell:v,type:_,row:h,column:w,rowIndex:b,columnIndex:$,$rowIndex:p,$columnIndex:f,_rowIndex:y,_columnIndex:E}}))};export{u as useEventConvert};
1
+ import{isObject as e}from"lodash-es";import{unref as l}from"vue";import{isVerticalTable as o,isVerticalHeader as n,getHeaderDepthByField as r,getOriginFieldFromRowData as t,getOriginRowFromRowData as d}from"../utils.js";const c=(c,i,a)=>{i.eventHooks.beforeEvent.tap("Vertical--useEventConvert",((c,i,u,m)=>{var x,v;if(!e(c))return c;const I=null==(x=l(i))?void 0:x.uuid;if(!I||!o(i))return c;const f=c,{$table:s,$event:h,cell:p}=f;let{$columnIndex:w,$rowIndex:$,column:C,columnIndex:y,row:b,rowIndex:k,type:_,_rowIndex:g,_columnIndex:E}=f;if(C&&(_=n(C.field)?"header":"body","headerCellClick"===m&&"body"===_?m="cellClick":"cellClick"===m&&"header"===_&&(m="headerCellClick"),b)){const e=r(C.field);C=t(b),b="header"===_?void 0:d(b,e),E=y=w="header"===f.type?$||0:((null==(v=a(I).fixedLeftVerticalData)?void 0:v.length)||0)+($||0),g=k=$="header"===_?-1:e}return{_originalPayload:f,$table:s,$event:h,cell:p,type:_,row:b,column:C,rowIndex:k,columnIndex:y,$rowIndex:$,$columnIndex:w,_rowIndex:g,_columnIndex:E,eventName:m}}))};export{c as useEventConvert};