cnhis-design-vue 3.1.38-beta.0 → 3.1.38-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +123 -123
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/fabric-chart/src/hooks/useBirthProcess.js +35 -0
  7. package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +1 -0
  8. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +4 -14
  9. package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +1 -0
  10. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  11. package/es/components/form-config/index.d.ts +10 -6
  12. package/es/components/form-config/src/FormConfig.vue.d.ts +10 -6
  13. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +5 -3
  14. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +5 -3
  15. package/es/components/form-render/index.d.ts +5 -3
  16. package/es/components/form-render/src/FormRender.vue.d.ts +5 -3
  17. package/es/components/form-render/src/FormRender.vue.js +3 -1
  18. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +5 -3
  19. package/es/components/form-render/src/components/renderer/combination.js +2 -4
  20. package/es/components/form-render/src/components/renderer/jsonCombination/index.js +2 -4
  21. package/es/components/form-render/src/hooks/useAnchor.d.ts +3 -4
  22. package/es/components/form-render/src/hooks/useAnchor.js +3 -3
  23. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +2 -4
  24. package/es/components/shortcut-setter/index.d.ts +5 -3
  25. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +5 -3
  26. package/es/shared/assets/img/failure.js +1 -1
  27. package/es/shared/assets/img/failure.png.js +1 -1
  28. package/es/shared/assets/img/icon-asc.js +1 -1
  29. package/es/shared/assets/img/icon-desc.js +1 -1
  30. package/es/shared/assets/img/no-permission.js +1 -1
  31. package/es/shared/assets/img/no-permission.png.js +1 -1
  32. package/es/shared/assets/img/nodata.js +1 -1
  33. package/es/shared/assets/img/nodata.png.js +1 -1
  34. package/es/shared/assets/img/notfound.js +1 -1
  35. package/es/shared/assets/img/notfound.png.js +1 -1
  36. package/es/shared/assets/img/qr.js +1 -1
  37. package/es/shared/assets/img/qr.png.js +1 -1
  38. package/es/shared/assets/img/success.js +1 -1
  39. package/es/shared/assets/img/success.png.js +1 -1
  40. package/es/shared/assets/img/video.js +1 -1
  41. package/es/shared/assets/img/video.png.js +1 -1
  42. package/es/shared/assets/img/video_default_cover.js +1 -1
  43. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  44. package/es/shared/assets/img/video_hover.js +1 -1
  45. package/es/shared/assets/img/video_play_hover.js +1 -1
  46. package/es/shared/assets/img/xb_big.js +1 -1
  47. package/es/shared/assets/img/xb_big.png.js +1 -1
  48. package/es/shared/assets/img/xb_small.js +1 -1
  49. package/es/shared/assets/img/xb_small.png.js +1 -1
  50. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  51. package/es/shared/utils/tapable/index.d.ts +139 -0
  52. package/package.json +2 -2
package/README.md CHANGED
@@ -1,123 +1,123 @@
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. 注意
65
-
66
- 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
-
68
- ```typescript
69
- // main.ts
70
- import { createApp } from 'vue';
71
- import App from './App.vue';
72
-
73
- import { CGrid } from 'cnhis-design-vue';
74
- // 或者
75
- import { CBigTable } from 'cnhis-design-vue';
76
-
77
- const app = createApp(App);
78
- app.use(CGrid);
79
- // 或者
80
- app.use(CBigTable);
81
- app.mount('#app');
82
- ```
83
-
84
- ## 4.FAQ
85
-
86
- ### 4.1 项目打包后样式丢失
87
-
88
- > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
-
90
- ```typescript
91
- // vite.config.ts
92
- import { defineConfig } from 'vite';
93
-
94
- export default defineConfig({
95
- rollupOptions: {
96
- // ..otherOptions
97
- output: {
98
- dir: './dist',
99
- manualChunks(id: string) {
100
- if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
- return 'vendor';
102
- }
103
- }
104
- }
105
- }
106
- });
107
- ```
108
-
109
- ### 4.2 找不到文件
110
-
111
- > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
-
113
- ```javascript
114
- // vite.config.ts
115
- const config = {
116
- // ...otherOptions
117
- resolve: {
118
- // ...otherOptions
119
- // 如果没有配置, 则不用考虑
120
- extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
- }
122
- };
123
- ```
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. 注意
65
+
66
+ 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
+
68
+ ```typescript
69
+ // main.ts
70
+ import { createApp } from 'vue';
71
+ import App from './App.vue';
72
+
73
+ import { CGrid } from 'cnhis-design-vue';
74
+ // 或者
75
+ import { CBigTable } from 'cnhis-design-vue';
76
+
77
+ const app = createApp(App);
78
+ app.use(CGrid);
79
+ // 或者
80
+ app.use(CBigTable);
81
+ app.mount('#app');
82
+ ```
83
+
84
+ ## 4.FAQ
85
+
86
+ ### 4.1 项目打包后样式丢失
87
+
88
+ > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
+
90
+ ```typescript
91
+ // vite.config.ts
92
+ import { defineConfig } from 'vite';
93
+
94
+ export default defineConfig({
95
+ rollupOptions: {
96
+ // ..otherOptions
97
+ output: {
98
+ dir: './dist',
99
+ manualChunks(id: string) {
100
+ if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
+ return 'vendor';
102
+ }
103
+ }
104
+ }
105
+ }
106
+ });
107
+ ```
108
+
109
+ ### 4.2 找不到文件
110
+
111
+ > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
+
113
+ ```javascript
114
+ // vite.config.ts
115
+ const config = {
116
+ // ...otherOptions
117
+ resolve: {
118
+ // ...otherOptions
119
+ // 如果没有配置, 则不用考虑
120
+ extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
+ }
122
+ };
123
+ ```
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/Viewer';
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/features/modeling';
@@ -0,0 +1 @@
1
+ declare module 'diagram-js/lib/navigation/movecanvas';
@@ -4,6 +4,7 @@ import { drawLine, drawPoint, defaultTextStyle, drawText, defaultRectStyle } fro
4
4
  import { fabric } from '../utils/index.js';
5
5
  import { getIndex, isEffectiveNode } from '../utils/utils.js';
6
6
  import { cloneDeep } from 'lodash-es';
7
+ import { format } from 'date-fns';
7
8
 
8
9
  function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps, commonFunc) {
9
10
  const { cumputedX, cumputedY, getXValue, getYValue } = useBirthProcessCumputedPoint(propItems);
@@ -315,6 +316,40 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
315
316
  })
316
317
  );
317
318
  }
319
+ if (key === "alert") {
320
+ const item = yScaleValue.find((item2) => item2.key === "cervix");
321
+ const { data = [], key: key2, range } = item || {};
322
+ const startPoint = data.find((_data) => +_data.value === 3);
323
+ if (startPoint) {
324
+ const _time = 6 * 60 * 60 * 1e3;
325
+ const endPoint = {
326
+ time: format(new Date(new Date(startPoint.time).getTime() + _time), "yyyy-MM-dd HH:mm"),
327
+ value: 10
328
+ };
329
+ const [x1, y1] = [cumputedX(startPoint.time) - originX, endY - cumputedY(key2, range, startPoint.value)];
330
+ const [x2, y2] = [cumputedX(endPoint.time) - originX, endY - cumputedY(key2, range, endPoint.value)];
331
+ const k = (y2 - y1) / (x1 + x2);
332
+ const b = y1 - x1 * k;
333
+ let pointer1 = [-(b / k), 0];
334
+ if (pointer1[0] < 0) {
335
+ pointer1 = [originX, endY - b];
336
+ } else {
337
+ pointer1 = [originX + b / k, endY];
338
+ }
339
+ const _originY = cumputedY(key2, range, 10);
340
+ let pointer2 = [(endY - _originY - b) / k, endY - _originY];
341
+ if (pointer2[0] > endX - originX) {
342
+ pointer2 = [endX, endY - (k * (endX - originX) + b)];
343
+ } else {
344
+ pointer2 = [originX + (endY - _originY - b) / k, _originY];
345
+ }
346
+ lines.push(
347
+ drawLine([...pointer1, ...pointer2], {
348
+ ...line
349
+ })
350
+ );
351
+ }
352
+ }
318
353
  });
319
354
  canvas.value.add(...lines);
320
355
  }
@@ -1,5 +1,6 @@
1
1
  import { ref, reactive, computed, onMounted, nextTick } from 'vue';
2
2
  import { defaultBorderStyle } from './useDraw.js';
3
+ import 'date-fns';
3
4
  import '../utils/index.js';
4
5
  import 'lodash-es';
5
6
  import './useShadow.js';
@@ -1,3 +1,5 @@
1
+ import { format } from 'date-fns';
2
+
1
3
  function useCumputedPoint(propItems) {
2
4
  const { xScaleList, originX, endY, xCellWidth, left, vitalSignsOriginY, painOriginY, canvasWidth } = propItems;
3
5
  function cumputedX(value, setAllCenter = false) {
@@ -27,13 +29,7 @@ function useCumputedPoint(propItems) {
27
29
  const residueX = pointX - item.left;
28
30
  const residueTime = item.scaleCell * residueX;
29
31
  const time = item.start + residueTime;
30
- const d = new Date(time);
31
- const month = `00${d.getMonth() + 1}`.slice(-2);
32
- const day = `00${d.getDate()}`.slice(-2);
33
- const hours = `00${d.getHours()}`.slice(-2);
34
- const minutes = `00${d.getMinutes()}`.slice(-2);
35
- const date = `${d.getFullYear()}-${month}-${day} ${hours}:${minutes}`;
36
- return date;
32
+ return format(new Date(time), "yyyy-MM-dd HH:mm");
37
33
  }
38
34
  }
39
35
  function getYValue(type, pointY) {
@@ -64,13 +60,7 @@ function useBirthProcessCumputedPoint(propItems) {
64
60
  }
65
61
  function getXValue(pointX) {
66
62
  const time = (pointX - originX) * timeXCell + startTime;
67
- const d = new Date(time);
68
- const month = `00${d.getMonth() + 1}`.slice(-2);
69
- const day = `00${d.getDate()}`.slice(-2);
70
- const hours = `00${d.getHours()}`.slice(-2);
71
- const minutes = `00${d.getMinutes()}`.slice(-2);
72
- const date = `${d.getFullYear()}-${month}-${day} ${hours}:${minutes}`;
73
- return date;
63
+ return format(new Date(time), "yyyy-MM-dd HH:mm");
74
64
  }
75
65
  function getYValue(key, pointY) {
76
66
  const item = scaleValues.find((item2) => key === item2.key);
@@ -11,6 +11,7 @@ import { useEvent, useCanvasEvent } from './useEvent.js';
11
11
  import '../utils/index.js';
12
12
  import { setOtherType } from '../utils/utils.js';
13
13
  import 'lodash-es';
14
+ import 'date-fns';
14
15
  import { useCommon } from './useCommon.js';
15
16
 
16
17
  function useTemperatureChart(canvas, props, emits, canvasRef) {