cnhis-design-vue 3.1.34-beta.5 → 3.1.34-beta.7

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 (69) hide show
  1. package/README.md +123 -123
  2. package/es/components/big-table/index.d.ts +1 -0
  3. package/es/components/big-table/src/BigTable.vue.d.ts +1 -0
  4. package/es/components/big-table/src/BigTable.vue2.js +13 -1
  5. package/es/components/big-table/src/components/edit-form/edit-select.js +26 -1
  6. package/es/components/big-table/src/hooks/useEvent.js +3 -4
  7. package/es/components/fabric-chart/index.d.ts +141 -374
  8. package/es/components/fabric-chart/src/BirthProcessChart.vue.d.ts +2 -2
  9. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +142 -374
  10. package/es/components/fabric-chart/src/FabricChart.vue.js +52 -22
  11. package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
  12. package/es/components/fabric-chart/src/hooks/index.js +1 -0
  13. package/es/components/fabric-chart/src/hooks/useBirthProcess.js +2 -2
  14. package/es/components/fabric-chart/src/hooks/useBottom.js +1 -6
  15. package/es/components/fabric-chart/src/hooks/useCenter.d.ts +4 -18
  16. package/es/components/fabric-chart/src/hooks/useCenter.js +3 -20
  17. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -1
  18. package/es/components/fabric-chart/src/hooks/useCommon.js +2 -2
  19. package/es/components/fabric-chart/src/hooks/useGrid.js +2 -7
  20. package/es/components/fabric-chart/src/hooks/useLeft.d.ts +2 -1
  21. package/es/components/fabric-chart/src/hooks/useLeft.js +22 -28
  22. package/es/components/fabric-chart/src/hooks/useOther.js +1 -6
  23. package/es/components/fabric-chart/src/hooks/useRight.js +13 -18
  24. package/es/components/fabric-chart/src/hooks/useTemperatureChart.d.ts +25 -0
  25. package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +339 -0
  26. package/es/components/fabric-chart/src/hooks/useTop.js +1 -6
  27. package/es/components/iho-table/index.d.ts +6 -4
  28. package/es/components/iho-table/src/IhoTable.vue.d.ts +6 -4
  29. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +9 -3
  30. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +5 -5
  31. package/es/components/iho-table/src/types/index.d.ts +7 -6
  32. package/es/components/iho-table/src/utils/index.d.ts +6 -0
  33. package/es/components/iho-table/src/utils/index.js +16 -2
  34. package/es/shared/assets/img/failure.js +1 -1
  35. package/es/shared/assets/img/failure.png.js +1 -1
  36. package/es/shared/assets/img/icon-asc.js +1 -1
  37. package/es/shared/assets/img/icon-desc.js +1 -1
  38. package/es/shared/assets/img/no-permission.js +1 -1
  39. package/es/shared/assets/img/no-permission.png.js +1 -1
  40. package/es/shared/assets/img/nodata.js +1 -1
  41. package/es/shared/assets/img/nodata.png.js +1 -1
  42. package/es/shared/assets/img/notfound.js +1 -1
  43. package/es/shared/assets/img/notfound.png.js +1 -1
  44. package/es/shared/assets/img/qr.js +1 -1
  45. package/es/shared/assets/img/qr.png.js +1 -1
  46. package/es/shared/assets/img/success.js +1 -1
  47. package/es/shared/assets/img/success.png.js +1 -1
  48. package/es/shared/assets/img/video.js +1 -1
  49. package/es/shared/assets/img/video.png.js +1 -1
  50. package/es/shared/assets/img/video_default_cover.js +1 -1
  51. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  52. package/es/shared/assets/img/video_hover.js +1 -1
  53. package/es/shared/assets/img/video_play_hover.js +1 -1
  54. package/es/shared/assets/img/xb_big.js +1 -1
  55. package/es/shared/assets/img/xb_big.png.js +1 -1
  56. package/es/shared/assets/img/xb_small.js +1 -1
  57. package/es/shared/assets/img/xb_small.png.js +1 -1
  58. package/es/shared/types/index.d.ts +1 -0
  59. package/package.json +2 -2
  60. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  61. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  62. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  63. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  64. package/es/components/fabric-chart/src/BirthProcessChart.vue.js +0 -172
  65. package/es/components/fabric-chart/src/TemperatureChart.vue.d.ts +0 -214
  66. package/es/components/fabric-chart/src/TemperatureChart.vue.js +0 -355
  67. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  68. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  69. package/es/shared/utils/tapable/index.d.ts +0 -139
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
+ ```
@@ -647,6 +647,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
647
647
  sysImageSize: unknown[];
648
648
  }>;
649
649
  treeConfig: import("vue").ComputedRef<any>;
650
+ keyboardConfig: import("vue").ComputedRef<any>;
650
651
  hideAllWrap: (e: any) => void;
651
652
  bindDocumentClick: () => void;
652
653
  unBindDocumentClick: () => void;
@@ -646,6 +646,7 @@ declare const _default: import("vue").DefineComponent<{
646
646
  sysImageSize: unknown[];
647
647
  }>;
648
648
  treeConfig: import("vue").ComputedRef<any>;
649
+ keyboardConfig: import("vue").ComputedRef<any>;
649
650
  hideAllWrap: (e: any) => void;
650
651
  bindDocumentClick: () => void;
651
652
  unBindDocumentClick: () => void;
@@ -168,6 +168,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
168
168
  }
169
169
  return result;
170
170
  });
171
+ const keyboardConfig = computed(() => {
172
+ return {
173
+ editMethod({
174
+ row,
175
+ column
176
+ }) {
177
+ const $table = xGrid.value;
178
+ $table.setEditCell(row, column);
179
+ },
180
+ ...props.columnConfig.keyboardConfig || {}
181
+ };
182
+ });
171
183
  const hideAllWrap = (e) => {
172
184
  const path = e.path || e.composedPath && e.composedPath();
173
185
  const noWrap = (className) => {
@@ -2361,7 +2373,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2361
2373
  iconClose: "iconfont icon-a-xitongtubiaotianjia",
2362
2374
  ...unref(getAttr)("expand-config")
2363
2375
  },
2364
- "keyboard-config": _ctx.columnConfig.keyboardConfig || {},
2376
+ "keyboard-config": unref(keyboardConfig),
2365
2377
  "edit-rules": _ctx.columnConfig.editRules || {},
2366
2378
  "menu-config": _ctx.menuConfig,
2367
2379
  onCellDblclick: rowdblclick,
@@ -35,6 +35,7 @@ var EditSelect = defineComponent({
35
35
  isShow
36
36
  } = useCommon(props, attrs, true);
37
37
  const state = reactive({
38
+ keyupValue: attrs.value,
38
39
  options: [],
39
40
  loading: false,
40
41
  keyword: "",
@@ -82,6 +83,28 @@ var EditSelect = defineComponent({
82
83
  selectSearch("");
83
84
  }
84
85
  };
86
+ function onKeyup(event) {
87
+ const {
88
+ key
89
+ } = event;
90
+ if (state.config.multiple || !["ArrowUp", "ArrowDown"].includes(key))
91
+ return;
92
+ let index = state.options.findIndex((item) => item.value === state.keyupValue);
93
+ const length = state.options.length;
94
+ if (key === "ArrowUp") {
95
+ index = index === 0 ? length - 1 : index - 1;
96
+ }
97
+ if (key === "ArrowDown") {
98
+ index = index === length - 1 ? 0 : index + 1;
99
+ }
100
+ state.keyupValue = state.options[index].value;
101
+ onUpdateValue(state.keyupValue);
102
+ }
103
+ function onBlur() {
104
+ var _a, _b;
105
+ if (!state.keyupValue)
106
+ onUpdateValue((_b = (_a = state.options) == null ? void 0 : _a[0]) == null ? void 0 : _b.value);
107
+ }
85
108
  init();
86
109
  return () => createVNode(NSelect, mergeProps({
87
110
  "ref": formRef,
@@ -94,7 +117,9 @@ var EditSelect = defineComponent({
94
117
  "filterable": true,
95
118
  "placeholder": props.col.placeholder || "\u8BF7\u9009\u62E9",
96
119
  "loading": state.loading,
97
- "onUpdateValue": onUpdateValue
120
+ "onUpdateValue": onUpdateValue,
121
+ "onKeyup": onKeyup,
122
+ "onBlur": onBlur
98
123
  }), null);
99
124
  }
100
125
  });
@@ -17,12 +17,11 @@ const useEvent = (props, state, emit, xGrid, anchorEvent) => {
17
17
  if (!activeRow && !isEdit)
18
18
  return;
19
19
  if (isEdit) {
20
- const { row, $rowIndex, rowIndex, column } = xGridRef.getEditRecord() || {};
20
+ const data = xGridRef.getEditRecord() || xGridRef.getSelectedCell() || {};
21
21
  emit("keyboard", {
22
22
  key: $event.key,
23
- index: $rowIndex != null ? $rowIndex : rowIndex,
24
- row,
25
- column
23
+ ...data,
24
+ index: data.rowIndex
26
25
  });
27
26
  return;
28
27
  }