cnhis-design-vue 3.1.35-beta.7 → 3.1.35-beta.9
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.
- package/README.md +123 -123
- package/es/components/big-table/index.d.ts +13 -1
- package/es/components/big-table/src/BigTable.vue.d.ts +13 -1
- package/es/components/big-table/src/BigTable.vue2.js +47 -7
- package/es/components/big-table/src/components/edit-form/edit-separate.vue.d.ts +4 -0
- package/es/components/big-table/src/components/separate.vue.d.ts +1 -0
- package/es/components/big-table/src/hooks/useEdit.d.ts +4 -0
- package/es/components/big-table/src/hooks/useSeparateRow.d.ts +11 -1
- package/es/components/big-table/src/hooks/useSeparateRow.js +53 -12
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- 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
|
+
```
|
|
@@ -656,6 +656,13 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
656
656
|
separate: (data: import("../../../es/shared/types").AnyObject[], rawData: import("../../../es/shared/types").AnyObject[]) => Promise<import("../../../es/shared/types").AnyObject[]>;
|
|
657
657
|
onColumnResize: import("vxe-table").VxeTableEvents.ResizableChange;
|
|
658
658
|
separateHandle: import("./src/hooks").SeparateHandle;
|
|
659
|
+
separateDataMap: import("vue").Ref<WeakMap<import("../../../es/shared/types").AnyObject, {
|
|
660
|
+
separateData: Record<string, string>;
|
|
661
|
+
index: number;
|
|
662
|
+
rawRow: import("../../../es/shared/types").AnyObject;
|
|
663
|
+
row: import("../../../es/shared/types").AnyObject;
|
|
664
|
+
colspans?: Record<string, number> | undefined;
|
|
665
|
+
}>>;
|
|
659
666
|
onResizableChange: (payload: any) => void;
|
|
660
667
|
loadData: (data: any) => Promise<void>;
|
|
661
668
|
setGroupTitleToFristColumnFieldData: (formatList: any) => void;
|
|
@@ -667,6 +674,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
667
674
|
index: number;
|
|
668
675
|
rawRow: import("../../../es/shared/types").AnyObject;
|
|
669
676
|
row: import("../../../es/shared/types").AnyObject;
|
|
677
|
+
colspans?: Record<string, number> | undefined;
|
|
670
678
|
} | undefined;
|
|
671
679
|
formatterEdit: (params: any, col: any) => any;
|
|
672
680
|
getEditBtn: (row: any, col: any, index: any) => any;
|
|
@@ -702,6 +710,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
702
710
|
}) => Promise<any>;
|
|
703
711
|
getAsyncTableData: (params: any) => Promise<void>;
|
|
704
712
|
setChecklist: (list: any) => any;
|
|
713
|
+
spanMethod: (payload: any) => any;
|
|
705
714
|
colspanMethod: (payload: any) => any;
|
|
706
715
|
footerRowspanMethod: (obj: any) => {
|
|
707
716
|
rowspan: number;
|
|
@@ -729,7 +738,10 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
729
738
|
records: any;
|
|
730
739
|
}) => void;
|
|
731
740
|
radioOnChange: (rowData?: {}) => void;
|
|
732
|
-
sortChange: (
|
|
741
|
+
sortChange: ({ property, order }: {
|
|
742
|
+
property: any;
|
|
743
|
+
order: any;
|
|
744
|
+
}) => false | undefined;
|
|
733
745
|
showDrawer: () => void;
|
|
734
746
|
handleCellMouseenter: ({ column, $event }: {
|
|
735
747
|
column: any;
|
|
@@ -655,6 +655,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
655
655
|
separate: (data: import("../../../shared/types").AnyObject[], rawData: import("../../../shared/types").AnyObject[]) => Promise<import("../../../shared/types").AnyObject[]>;
|
|
656
656
|
onColumnResize: import("vxe-table").VxeTableEvents.ResizableChange;
|
|
657
657
|
separateHandle: import("./hooks").SeparateHandle;
|
|
658
|
+
separateDataMap: import("vue").Ref<WeakMap<import("../../../shared/types").AnyObject, {
|
|
659
|
+
separateData: Record<string, string>;
|
|
660
|
+
index: number;
|
|
661
|
+
rawRow: import("../../../shared/types").AnyObject;
|
|
662
|
+
row: import("../../../shared/types").AnyObject;
|
|
663
|
+
colspans?: Record<string, number> | undefined;
|
|
664
|
+
}>>;
|
|
658
665
|
onResizableChange: (payload: any) => void;
|
|
659
666
|
loadData: (data: any) => Promise<void>;
|
|
660
667
|
setGroupTitleToFristColumnFieldData: (formatList: any) => void;
|
|
@@ -666,6 +673,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
666
673
|
index: number;
|
|
667
674
|
rawRow: import("../../../shared/types").AnyObject;
|
|
668
675
|
row: import("../../../shared/types").AnyObject;
|
|
676
|
+
colspans?: Record<string, number> | undefined;
|
|
669
677
|
} | undefined;
|
|
670
678
|
formatterEdit: (params: any, col: any) => any;
|
|
671
679
|
getEditBtn: (row: any, col: any, index: any) => any;
|
|
@@ -701,6 +709,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
701
709
|
}) => Promise<any>;
|
|
702
710
|
getAsyncTableData: (params: any) => Promise<void>;
|
|
703
711
|
setChecklist: (list: any) => any;
|
|
712
|
+
spanMethod: (payload: any) => any;
|
|
704
713
|
colspanMethod: (payload: any) => any;
|
|
705
714
|
footerRowspanMethod: (obj: any) => {
|
|
706
715
|
rowspan: number;
|
|
@@ -728,7 +737,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
728
737
|
records: any;
|
|
729
738
|
}) => void;
|
|
730
739
|
radioOnChange: (rowData?: {}) => void;
|
|
731
|
-
sortChange: (
|
|
740
|
+
sortChange: ({ property, order }: {
|
|
741
|
+
property: any;
|
|
742
|
+
order: any;
|
|
743
|
+
}) => false | undefined;
|
|
732
744
|
showDrawer: () => void;
|
|
733
745
|
handleCellMouseenter: ({ column, $event }: {
|
|
734
746
|
column: any;
|
|
@@ -246,11 +246,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
246
246
|
const {
|
|
247
247
|
separate,
|
|
248
248
|
onColumnResize,
|
|
249
|
-
separateHandle
|
|
249
|
+
separateHandle,
|
|
250
|
+
separateDataMap
|
|
250
251
|
} = useSeparateRow(() => {
|
|
251
252
|
var _a, _b;
|
|
252
253
|
return (_b = (_a = props.columnConfig) == null ? void 0 : _a.fieldList) != null ? _b : [];
|
|
253
|
-
}, (columnName) => {
|
|
254
|
+
}, colspanMethod, (columnName) => {
|
|
254
255
|
var _a, _b;
|
|
255
256
|
return (_b = (_a = props.columnConfig) == null ? void 0 : _a.fieldList) == null ? void 0 : _b.find((field) => field.columnName === columnName);
|
|
256
257
|
}, xGrid);
|
|
@@ -1154,7 +1155,37 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1154
1155
|
};
|
|
1155
1156
|
});
|
|
1156
1157
|
};
|
|
1157
|
-
|
|
1158
|
+
function spanMethod(payload) {
|
|
1159
|
+
const {
|
|
1160
|
+
row,
|
|
1161
|
+
column,
|
|
1162
|
+
rowIndex
|
|
1163
|
+
} = payload;
|
|
1164
|
+
if (row.$__SEPARATE && separateDataMap.value.has(row)) {
|
|
1165
|
+
const {
|
|
1166
|
+
rawRow
|
|
1167
|
+
} = separateDataMap.value.get(row);
|
|
1168
|
+
const {
|
|
1169
|
+
colspans
|
|
1170
|
+
} = separateDataMap.value.get(rawRow) || {};
|
|
1171
|
+
if (colspans) {
|
|
1172
|
+
const colspan = colspans[column.field];
|
|
1173
|
+
column.title === "\u64CD\u4F5C" && console.log(rowIndex, colspan);
|
|
1174
|
+
if (colspan === 0)
|
|
1175
|
+
return {
|
|
1176
|
+
colspan: 0,
|
|
1177
|
+
rowspan: 0
|
|
1178
|
+
};
|
|
1179
|
+
if (colspan > 1)
|
|
1180
|
+
return {
|
|
1181
|
+
rowspan: 1,
|
|
1182
|
+
colspan
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
return colspanMethod(payload);
|
|
1187
|
+
}
|
|
1188
|
+
function colspanMethod(payload) {
|
|
1158
1189
|
var _a;
|
|
1159
1190
|
const defaultSpan = {
|
|
1160
1191
|
rowspan: 1,
|
|
@@ -1197,7 +1228,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1197
1228
|
};
|
|
1198
1229
|
}
|
|
1199
1230
|
}
|
|
1200
|
-
}
|
|
1231
|
+
}
|
|
1201
1232
|
const footerRowspanMethod = (obj) => {
|
|
1202
1233
|
if (!props.groupCountFields || !props.groupCountFields.length)
|
|
1203
1234
|
return {
|
|
@@ -1543,11 +1574,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1543
1574
|
...row
|
|
1544
1575
|
}]);
|
|
1545
1576
|
};
|
|
1546
|
-
const sortChange = (
|
|
1577
|
+
const sortChange = ({
|
|
1578
|
+
property,
|
|
1579
|
+
order
|
|
1580
|
+
}) => {
|
|
1581
|
+
var _a;
|
|
1547
1582
|
if (props.isInlineOperating)
|
|
1548
1583
|
return false;
|
|
1549
1584
|
Object.values(state.filterFields).forEach((item) => item.filterSort = null);
|
|
1550
|
-
|
|
1585
|
+
const column = (_a = props.columnConfig.fieldList) == null ? void 0 : _a.find((item) => item.columnName === property);
|
|
1586
|
+
emit("sortChange", {
|
|
1587
|
+
prop: property,
|
|
1588
|
+
order,
|
|
1589
|
+
column
|
|
1590
|
+
});
|
|
1551
1591
|
};
|
|
1552
1592
|
const showDrawer = () => {
|
|
1553
1593
|
const theads = xGrid.value.$el.childNodes[0].childNodes[1].childNodes[0].getElementsByClassName("mycolumn");
|
|
@@ -2338,7 +2378,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2338
2378
|
remote: true,
|
|
2339
2379
|
...unref(getAttr)("sort-config")
|
|
2340
2380
|
},
|
|
2341
|
-
"span-method":
|
|
2381
|
+
"span-method": spanMethod,
|
|
2342
2382
|
"footer-span-method": footerRowspanMethod,
|
|
2343
2383
|
"tooltip-config": {
|
|
2344
2384
|
enterable: false,
|
|
@@ -40,18 +40,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
40
40
|
index: number;
|
|
41
41
|
rawRow: AnyObject;
|
|
42
42
|
row: AnyObject;
|
|
43
|
+
colspans?: Record<string, number> | undefined;
|
|
43
44
|
} | undefined;
|
|
44
45
|
onShow: (target: {
|
|
45
46
|
separateData: Record<string, string>;
|
|
46
47
|
index: number;
|
|
47
48
|
rawRow: AnyObject;
|
|
48
49
|
row: AnyObject;
|
|
50
|
+
colspans?: Record<string, number> | undefined;
|
|
49
51
|
} | undefined) => Promise<void>;
|
|
50
52
|
onClose: (target: {
|
|
51
53
|
separateData: Record<string, string>;
|
|
52
54
|
index: number;
|
|
53
55
|
rawRow: AnyObject;
|
|
54
56
|
row: AnyObject;
|
|
57
|
+
colspans?: Record<string, number> | undefined;
|
|
55
58
|
} | undefined) => Promise<void>;
|
|
56
59
|
updateShow: (show: boolean) => void;
|
|
57
60
|
style: CSSProperties;
|
|
@@ -99,6 +102,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
99
102
|
index: number;
|
|
100
103
|
rawRow: AnyObject;
|
|
101
104
|
row: AnyObject;
|
|
105
|
+
colspans?: Record<string, number> | undefined;
|
|
102
106
|
}>>;
|
|
103
107
|
displayContent: import("vue").ComputedRef<string>;
|
|
104
108
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -25,6 +25,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
25
|
index: number;
|
|
26
26
|
rawRow: AnyObject;
|
|
27
27
|
row: AnyObject;
|
|
28
|
+
colspans?: Record<string, number> | undefined;
|
|
28
29
|
}>>;
|
|
29
30
|
displayContent: import("vue").ComputedRef<string>;
|
|
30
31
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -232,18 +232,21 @@ export declare const comps: {
|
|
|
232
232
|
index: number;
|
|
233
233
|
rawRow: import("../../../../shared/types").AnyObject;
|
|
234
234
|
row: import("../../../../shared/types").AnyObject;
|
|
235
|
+
colspans?: Record<string, number> | undefined;
|
|
235
236
|
} | undefined;
|
|
236
237
|
onShow: (target: {
|
|
237
238
|
separateData: Record<string, string>;
|
|
238
239
|
index: number;
|
|
239
240
|
rawRow: import("../../../../shared/types").AnyObject;
|
|
240
241
|
row: import("../../../../shared/types").AnyObject;
|
|
242
|
+
colspans?: Record<string, number> | undefined;
|
|
241
243
|
} | undefined) => Promise<void>;
|
|
242
244
|
onClose: (target: {
|
|
243
245
|
separateData: Record<string, string>;
|
|
244
246
|
index: number;
|
|
245
247
|
rawRow: import("../../../../shared/types").AnyObject;
|
|
246
248
|
row: import("../../../../shared/types").AnyObject;
|
|
249
|
+
colspans?: Record<string, number> | undefined;
|
|
247
250
|
} | undefined) => Promise<void>;
|
|
248
251
|
updateShow: (show: boolean) => void;
|
|
249
252
|
style: import("vue").CSSProperties;
|
|
@@ -291,6 +294,7 @@ export declare const comps: {
|
|
|
291
294
|
index: number;
|
|
292
295
|
rawRow: import("../../../../shared/types").AnyObject;
|
|
293
296
|
row: import("../../../../shared/types").AnyObject;
|
|
297
|
+
colspans?: Record<string, number> | undefined;
|
|
294
298
|
}>>;
|
|
295
299
|
displayContent: import("vue").ComputedRef<string>;
|
|
296
300
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AnyObject, Func } from '../../../../../es/shared/types';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
3
|
import { VxeTableEvents, VxeTableInstance } from 'vxe-table';
|
|
4
|
+
import { VxeTablePropTypes } from 'vxe-table/types/table';
|
|
4
5
|
export declare class SeparateHandle {
|
|
5
6
|
callbacks: Set<Func<any[], any>>;
|
|
6
7
|
add(cb: Func): void;
|
|
@@ -14,17 +15,26 @@ export declare function useSeparateMap(): {
|
|
|
14
15
|
index: number;
|
|
15
16
|
rawRow: AnyObject;
|
|
16
17
|
row: AnyObject;
|
|
18
|
+
colspans?: Record<string, number> | undefined;
|
|
17
19
|
}>>;
|
|
18
20
|
getRowData: (row: AnyObject) => {
|
|
19
21
|
separateData: Record<string, string>;
|
|
20
22
|
index: number;
|
|
21
23
|
rawRow: AnyObject;
|
|
22
24
|
row: AnyObject;
|
|
25
|
+
colspans?: Record<string, number> | undefined;
|
|
23
26
|
} | undefined;
|
|
24
27
|
};
|
|
25
|
-
export declare function useSeparateRow(getColumnConfig: () => AnyObject[], getFieldItem: (columnName: string) => AnyObject, $VXETable: Ref<undefined | VxeTableInstance>): {
|
|
28
|
+
export declare function useSeparateRow(getColumnConfig: () => AnyObject[], spanMethod: VxeTablePropTypes.SpanMethod, getFieldItem: (columnName: string) => AnyObject, $VXETable: Ref<undefined | VxeTableInstance>): {
|
|
26
29
|
onColumnResize: VxeTableEvents.ResizableChange;
|
|
27
30
|
needSeparateColumn: import("vue").ComputedRef<AnyObject[]>;
|
|
28
31
|
separate: (data: AnyObject[], rawData: AnyObject[]) => Promise<AnyObject[]>;
|
|
29
32
|
separateHandle: SeparateHandle;
|
|
33
|
+
separateDataMap: Ref<WeakMap<AnyObject, {
|
|
34
|
+
separateData: Record<string, string>;
|
|
35
|
+
index: number;
|
|
36
|
+
rawRow: AnyObject;
|
|
37
|
+
row: AnyObject;
|
|
38
|
+
colspans?: Record<string, number> | undefined;
|
|
39
|
+
}>>;
|
|
30
40
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getStringWidth } from '../../../../shared/utils/index.js';
|
|
2
|
-
import { isNumber, isArray, cloneDeep, isString } from 'lodash-es';
|
|
2
|
+
import { isFunction, isNumber, isArray, cloneDeep, isString } from 'lodash-es';
|
|
3
3
|
import { ref, computed, provide, watch, nextTick } from 'vue';
|
|
4
4
|
import { InjectionSeparateHandle } from '../constants/index.js';
|
|
5
5
|
|
|
@@ -29,22 +29,32 @@ function useSeparateMap() {
|
|
|
29
29
|
}
|
|
30
30
|
return { separateDataMap, getRowData };
|
|
31
31
|
}
|
|
32
|
-
function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
32
|
+
function useSeparateRow(getColumnConfig, spanMethod, getFieldItem, $VXETable) {
|
|
33
33
|
const needSeparateColumn = computed(() => {
|
|
34
34
|
return getColumnConfig().filter((column) => column.formType === "separate");
|
|
35
35
|
});
|
|
36
|
+
const columnWidthCacheMap = /* @__PURE__ */ new Map();
|
|
36
37
|
async function separate(data, rawData) {
|
|
38
|
+
var _a, _b;
|
|
37
39
|
if (!needSeparateColumn.value.length) {
|
|
38
40
|
return data;
|
|
39
41
|
}
|
|
42
|
+
columnWidthCacheMap.clear();
|
|
43
|
+
const visibleColumn = (_b = (_a = $VXETable.value) == null ? void 0 : _a.getColumns()) != null ? _b : [];
|
|
40
44
|
return data.reduce(async (res, row, dataIndex) => {
|
|
41
45
|
const parsedRowData = [];
|
|
42
46
|
for (const column of needSeparateColumn.value) {
|
|
47
|
+
const { width, colspan } = await getColumnRenderWidth(column, row, dataIndex);
|
|
43
48
|
parsedRowData.push({
|
|
44
49
|
columnName: column.columnName,
|
|
45
|
-
|
|
50
|
+
colspan,
|
|
51
|
+
data: contentSeparate(row[column.columnName], column.columnName, width)
|
|
46
52
|
});
|
|
47
53
|
}
|
|
54
|
+
const separateColspans = visibleColumn.reduce((res2, column) => {
|
|
55
|
+
res2[column.field] = getColspanInfo(column.field, row, dataIndex).colspan;
|
|
56
|
+
return res2;
|
|
57
|
+
}, {});
|
|
48
58
|
(await res).push(
|
|
49
59
|
...Array.from({ length: getColumnInfoMaxLength(parsedRowData) }).map((_, index) => {
|
|
50
60
|
const separateData = getSeparateRowData(parsedRowData, index);
|
|
@@ -53,7 +63,8 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
53
63
|
row,
|
|
54
64
|
rawRow: rawData[dataIndex],
|
|
55
65
|
index: dataIndex,
|
|
56
|
-
separateData
|
|
66
|
+
separateData,
|
|
67
|
+
colspans: separateColspans
|
|
57
68
|
});
|
|
58
69
|
row.$__SEPARATE_DATA = [separateData];
|
|
59
70
|
return row;
|
|
@@ -77,21 +88,51 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
77
88
|
return res;
|
|
78
89
|
}, {});
|
|
79
90
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
91
|
+
}
|
|
92
|
+
function getColumnInfoMaxLength(parsedRowData) {
|
|
93
|
+
return Math.max(...parsedRowData.map((r) => r.data.length), 1);
|
|
94
|
+
}
|
|
95
|
+
function getColspanInfo(field, row, rowIndex) {
|
|
96
|
+
if (!$VXETable.value)
|
|
97
|
+
return { colspan: 1, columnIndex: 0 };
|
|
98
|
+
const columnInfo = $VXETable.value.getColumnByField(field);
|
|
99
|
+
const columnIndex = $VXETable.value.getColumnIndex(columnInfo);
|
|
100
|
+
const { colspan = 1 } = spanMethod({
|
|
101
|
+
column: columnInfo,
|
|
102
|
+
row,
|
|
103
|
+
rowIndex,
|
|
104
|
+
$rowIndex: rowIndex,
|
|
105
|
+
_rowIndex: rowIndex,
|
|
106
|
+
columnIndex,
|
|
107
|
+
$columnIndex: columnIndex
|
|
108
|
+
}) || {};
|
|
109
|
+
return { colspan, columnIndex };
|
|
110
|
+
}
|
|
111
|
+
async function getColumnRenderWidth(column, row, rowIndex) {
|
|
112
|
+
if (!isFunction(spanMethod) || !$VXETable.value)
|
|
113
|
+
return { width: await getWidth(column), colspan: 1 };
|
|
114
|
+
const { colspan, columnIndex } = getColspanInfo(column.columnName, row, rowIndex);
|
|
115
|
+
const width = colspan <= 0 ? 0 : colspan === 1 ? await getWidth(column) : await $VXETable.value.getColumns().slice(columnIndex, columnIndex + colspan).reduce(async (res, columnInfo) => {
|
|
116
|
+
return await res + await getWidth({ columnName: columnInfo.field });
|
|
117
|
+
}, Promise.resolve(0));
|
|
118
|
+
return { width, colspan };
|
|
119
|
+
async function getWidth(column2) {
|
|
120
|
+
let width2 = columnWidthCacheMap.get(column2.columnName);
|
|
121
|
+
if (width2)
|
|
122
|
+
return width2;
|
|
84
123
|
const prev = getRenderWidth();
|
|
85
124
|
if (!prev) {
|
|
86
125
|
await nextTick();
|
|
87
126
|
}
|
|
88
|
-
|
|
127
|
+
width2 = getRenderWidth() || getColumnWidth();
|
|
128
|
+
columnWidthCacheMap.set(column2.columnName, width2);
|
|
129
|
+
return width2;
|
|
89
130
|
function getRenderWidth() {
|
|
90
131
|
var _a, _b;
|
|
91
|
-
return (_b = (_a = $VXETable.value) == null ? void 0 : _a.getColumnByField(
|
|
132
|
+
return (_b = (_a = $VXETable.value) == null ? void 0 : _a.getColumnByField(column2.columnName)) == null ? void 0 : _b.renderWidth;
|
|
92
133
|
}
|
|
93
134
|
function getColumnWidth() {
|
|
94
|
-
return isNumber(
|
|
135
|
+
return isNumber(column2.width) ? column2.width : 64;
|
|
95
136
|
}
|
|
96
137
|
}
|
|
97
138
|
}
|
|
@@ -126,7 +167,7 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
126
167
|
const separateHandle = new SeparateHandle();
|
|
127
168
|
provide(InjectionSeparateHandle, separateHandle);
|
|
128
169
|
watch(needSeparateColumn, separateHandle.trigger.bind(separateHandle));
|
|
129
|
-
return { onColumnResize, needSeparateColumn, separate, separateHandle };
|
|
170
|
+
return { onColumnResize, needSeparateColumn, separate, separateHandle, separateDataMap };
|
|
130
171
|
}
|
|
131
172
|
|
|
132
173
|
export { SeparateHandle, useSeparateMap, useSeparateRow };
|
|
File without changes
|
|
@@ -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';
|