cnhis-design-vue 3.1.34-beta.16 → 3.1.34-beta.18
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/fabric-chart/src/hooks/useCenter.js +72 -79
- package/es/components/fabric-chart/src/hooks/useLeft.js +2 -1
- package/es/components/fabric-chart/src/utils/utils.d.ts +6 -0
- package/es/components/fabric-chart/src/utils/utils.js +4 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +17 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +5 -9
- 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/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- 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
|
+
```
|
|
@@ -4,7 +4,7 @@ import useGrid from './useGrid.js';
|
|
|
4
4
|
import { useShadow } from './useShadow.js';
|
|
5
5
|
import { TEMPERATURE_MENU, PAIN_MENU, OVERLAP } from './constant.js';
|
|
6
6
|
import { cloneDeep } from 'lodash-es';
|
|
7
|
-
import { isEffectiveNode, getIndex, deleteProperty } from '../utils/utils.js';
|
|
7
|
+
import { isOneLine, isEffectiveNode, getIndex, deleteProperty } from '../utils/utils.js';
|
|
8
8
|
|
|
9
9
|
function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, addRenderItem, pointTipProps, pointMenuProps, useCommon) {
|
|
10
10
|
useGrid(canvas, propItems);
|
|
@@ -50,9 +50,6 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
50
50
|
drawOverlapPoint();
|
|
51
51
|
setCanvasEvent();
|
|
52
52
|
}
|
|
53
|
-
function isOneLine(type) {
|
|
54
|
-
return ["temperature", "pulse"].includes(type);
|
|
55
|
-
}
|
|
56
53
|
function drawPositionLine(scaleValue) {
|
|
57
54
|
if (scaleValue.type !== "temperature" || !scaleValue.positionLine)
|
|
58
55
|
return;
|
|
@@ -78,78 +75,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
77
|
console.log("shadowPointCache :>> ", shadowPointCache);
|
|
81
|
-
const data =
|
|
82
|
-
const _shadowPointCache = [];
|
|
83
|
-
const somes = [];
|
|
84
|
-
for (const item of shadowPointCache) {
|
|
85
|
-
_shadowPointCache.push(item[1]);
|
|
86
|
-
if (item[0] === SHADOWKEYS[0]) {
|
|
87
|
-
item[1].forEach((_item) => {
|
|
88
|
-
const someIndex = (shadowPointCache.get(SHADOWKEYS[1]) || []).findIndex((v) => v[0] === _item[0]);
|
|
89
|
-
someIndex > -1 && somes.push(_item[0]);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const [points1, points2] = _shadowPointCache;
|
|
94
|
-
console.log("points1, points2 :>> ", points1, points2);
|
|
95
|
-
let _arr1 = [];
|
|
96
|
-
let _arr2 = [];
|
|
97
|
-
somes.forEach((x, i) => {
|
|
98
|
-
const index1 = points1.findIndex((point) => point[0] === x);
|
|
99
|
-
const index2 = points2.findIndex((point) => point[0] === x);
|
|
100
|
-
const currentPoint1 = points1[index1];
|
|
101
|
-
const currentPoint2 = points2[index2];
|
|
102
|
-
const prevPoint1 = points1[index1 - 1];
|
|
103
|
-
const nextPoint1 = points1[index1 + 1];
|
|
104
|
-
const prevPoint2 = points2[index2 - 1];
|
|
105
|
-
const nextPoint2 = points2[index2 + 1];
|
|
106
|
-
if (prevPoint1 && prevPoint2) {
|
|
107
|
-
if (prevPoint1[0] !== prevPoint2[0]) {
|
|
108
|
-
const maxPoint = Math.max(prevPoint1[0], prevPoint2[0]);
|
|
109
|
-
_arr1.push([prevPoint1, prevPoint2].find((point) => point[0] === maxPoint));
|
|
110
|
-
} else {
|
|
111
|
-
const minYPoint = Math.min(currentPoint1[1], currentPoint2[1]);
|
|
112
|
-
_arr1.push([currentPoint1, currentPoint2].find((point) => point[1] === minYPoint));
|
|
113
|
-
const maxYPoint = Math.max(currentPoint1[1], currentPoint2[1]);
|
|
114
|
-
_arr2.push([currentPoint1, currentPoint2].find((point) => point[1] === maxYPoint));
|
|
115
|
-
}
|
|
116
|
-
} else if (prevPoint1) {
|
|
117
|
-
_arr1.push(prevPoint1);
|
|
118
|
-
} else if (prevPoint2) {
|
|
119
|
-
_arr2.push(prevPoint2);
|
|
120
|
-
} else {
|
|
121
|
-
const minYPoint = Math.min(currentPoint1[1], currentPoint2[1]);
|
|
122
|
-
_arr1.push([currentPoint1, currentPoint2].find((point) => point[1] === minYPoint));
|
|
123
|
-
const maxYPoint = Math.max(currentPoint1[1], currentPoint2[1]);
|
|
124
|
-
_arr2.push([currentPoint1, currentPoint2].find((point) => point[1] === maxYPoint));
|
|
125
|
-
}
|
|
126
|
-
const setData = () => {
|
|
127
|
-
const dataItem = [..._arr1, ..._arr2.reverse()];
|
|
128
|
-
const [firstPoint] = dataItem;
|
|
129
|
-
const lastPoint = dataItem.at(-1);
|
|
130
|
-
if (firstPoint[0] === lastPoint[0] && firstPoint[1] === lastPoint[1])
|
|
131
|
-
dataItem.splice(-1, 1);
|
|
132
|
-
data.push(dataItem);
|
|
133
|
-
_arr1 = [];
|
|
134
|
-
_arr2 = [];
|
|
135
|
-
};
|
|
136
|
-
if (nextPoint1 && nextPoint2) {
|
|
137
|
-
if (nextPoint1[0] !== nextPoint2[0]) {
|
|
138
|
-
const minPoint = Math.min(nextPoint1[0], nextPoint2[0]);
|
|
139
|
-
_arr1.push([nextPoint1, nextPoint2].find((point) => point[0] === minPoint));
|
|
140
|
-
setData();
|
|
141
|
-
}
|
|
142
|
-
} else if (nextPoint1) {
|
|
143
|
-
_arr1.push(nextPoint1);
|
|
144
|
-
setData();
|
|
145
|
-
} else if (nextPoint2) {
|
|
146
|
-
_arr2.push(nextPoint2);
|
|
147
|
-
setData();
|
|
148
|
-
} else {
|
|
149
|
-
setData();
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
console.log(data, somes);
|
|
78
|
+
const data = getShadowData();
|
|
153
79
|
data.forEach((item) => {
|
|
154
80
|
var _a2, _b, _c, _d, _e, _f;
|
|
155
81
|
const points = item.map((v) => ({ x: v[0], y: v[1] }));
|
|
@@ -178,6 +104,73 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
178
104
|
});
|
|
179
105
|
}
|
|
180
106
|
}
|
|
107
|
+
function getShadowData() {
|
|
108
|
+
const data = [];
|
|
109
|
+
const _shadowPointCache = [];
|
|
110
|
+
const somes = [];
|
|
111
|
+
for (const item of shadowPointCache) {
|
|
112
|
+
_shadowPointCache.push(item[1]);
|
|
113
|
+
if (item[0] === SHADOWKEYS[0]) {
|
|
114
|
+
item[1].forEach((_item) => {
|
|
115
|
+
const someIndex = (shadowPointCache.get(SHADOWKEYS[1]) || []).findIndex((v) => v[0] === _item[0]);
|
|
116
|
+
someIndex > -1 && somes.push(_item[0]);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const [points1, points2] = _shadowPointCache;
|
|
121
|
+
let _arr1 = [];
|
|
122
|
+
let _arr2 = [];
|
|
123
|
+
somes.forEach((left2) => {
|
|
124
|
+
const index1 = points1.findIndex((point) => point[0] === left2);
|
|
125
|
+
const index2 = points2.findIndex((point) => point[0] === left2);
|
|
126
|
+
const currentPoint1 = points1[index1];
|
|
127
|
+
const currentPoint2 = points2[index2];
|
|
128
|
+
const prevPoint1 = points1[index1 - 1];
|
|
129
|
+
const nextPoint1 = points1[index1 + 1];
|
|
130
|
+
const prevPoint2 = points2[index2 - 1];
|
|
131
|
+
const nextPoint2 = points2[index2 + 1];
|
|
132
|
+
if (prevPoint1 && prevPoint2) {
|
|
133
|
+
if (prevPoint1[0] !== prevPoint2[0]) {
|
|
134
|
+
const maxPoint = Math.max(prevPoint1[0], prevPoint2[0]);
|
|
135
|
+
_arr1.push([prevPoint1, prevPoint2].find((point) => point[0] === maxPoint));
|
|
136
|
+
}
|
|
137
|
+
} else if (prevPoint1) {
|
|
138
|
+
_arr1.push(prevPoint1);
|
|
139
|
+
} else if (prevPoint2) {
|
|
140
|
+
_arr2.push(prevPoint2);
|
|
141
|
+
}
|
|
142
|
+
const minYPoint = Math.min(currentPoint1[1], currentPoint2[1]);
|
|
143
|
+
_arr1.push([currentPoint1, currentPoint2].find((point) => point[1] === minYPoint));
|
|
144
|
+
const maxYPoint = Math.max(currentPoint1[1], currentPoint2[1]);
|
|
145
|
+
_arr2.push([currentPoint1, currentPoint2].find((point) => point[1] === maxYPoint));
|
|
146
|
+
const setData = () => {
|
|
147
|
+
const dataItem = [..._arr1, ..._arr2.reverse()];
|
|
148
|
+
const [firstPoint] = dataItem;
|
|
149
|
+
const lastPoint = dataItem.at(-1);
|
|
150
|
+
if (firstPoint[0] === lastPoint[0] && firstPoint[1] === lastPoint[1])
|
|
151
|
+
dataItem.splice(-1, 1);
|
|
152
|
+
data.push(dataItem);
|
|
153
|
+
_arr1 = [];
|
|
154
|
+
_arr2 = [];
|
|
155
|
+
};
|
|
156
|
+
if (nextPoint1 && nextPoint2) {
|
|
157
|
+
if (nextPoint1[0] !== nextPoint2[0]) {
|
|
158
|
+
const minPoint = Math.min(nextPoint1[0], nextPoint2[0]);
|
|
159
|
+
_arr1.push([nextPoint1, nextPoint2].find((point) => point[0] === minPoint));
|
|
160
|
+
setData();
|
|
161
|
+
}
|
|
162
|
+
} else if (nextPoint1) {
|
|
163
|
+
_arr1.push(nextPoint1);
|
|
164
|
+
setData();
|
|
165
|
+
} else if (nextPoint2) {
|
|
166
|
+
_arr2.push(nextPoint2);
|
|
167
|
+
setData();
|
|
168
|
+
} else {
|
|
169
|
+
setData();
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
return data;
|
|
173
|
+
}
|
|
181
174
|
function setCanvasEvent() {
|
|
182
175
|
if (!propItems.event.evented)
|
|
183
176
|
return;
|
|
@@ -650,7 +643,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
650
643
|
data: {
|
|
651
644
|
time: getXValue(item.pointer.x),
|
|
652
645
|
value: getYValue(item.origin.type, item.pointer.y),
|
|
653
|
-
|
|
646
|
+
...!isOneLine(item.origin.type) ? {} : { key: item.origin.key }
|
|
654
647
|
},
|
|
655
648
|
...item.origin
|
|
656
649
|
};
|
|
@@ -661,7 +654,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
661
654
|
deleteProperty(data, TEMPERATURE_MENU);
|
|
662
655
|
deleteProperty(data, PAIN_MENU);
|
|
663
656
|
data[`${item.type}`] = item.value;
|
|
664
|
-
if (type
|
|
657
|
+
if (isOneLine(type)) {
|
|
665
658
|
data["key"] = target.origin.key;
|
|
666
659
|
}
|
|
667
660
|
const params = {
|
|
@@ -676,7 +669,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
676
669
|
const { type, dataIndex, index, data, key } = params;
|
|
677
670
|
const obj = yScaleValue.find((v) => v.type === type);
|
|
678
671
|
if (mode === "add") {
|
|
679
|
-
const dataList = type
|
|
672
|
+
const dataList = !isOneLine(type) ? obj.dataList[dataIndex] : obj.dataList.find((v) => v.enable);
|
|
680
673
|
const index2 = getIndex(data.time, dataList.list);
|
|
681
674
|
dataList.list.splice(index2, 0, data);
|
|
682
675
|
} else {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fabric } from '../utils/index.js';
|
|
2
2
|
import { defaultBorderStyle, defaultTextStyle, defaultStyle, defaultRectStyle, drawPoint, drawTextGroup } from './useDraw.js';
|
|
3
|
+
import { isOneLine } from '../utils/utils.js';
|
|
3
4
|
|
|
4
5
|
function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, cumputedY, getXValue, getYValue, isAddPoint, updateData, useCommon) {
|
|
5
6
|
var _a, _b;
|
|
@@ -282,7 +283,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
282
283
|
data: {
|
|
283
284
|
time: getXValue(point.left),
|
|
284
285
|
value: getYValue(point.origin.type, point.top),
|
|
285
|
-
|
|
286
|
+
...!isOneLine(point.origin.type) ? {} : { key: point.origin.key }
|
|
286
287
|
},
|
|
287
288
|
...point.origin
|
|
288
289
|
};
|
|
@@ -3,3 +3,9 @@ import { AnyObject } from '../../../../../es/shared/types';
|
|
|
3
3
|
export declare function isEffectiveNode(node: IPoint): string | number | boolean;
|
|
4
4
|
export declare function deleteProperty(data: AnyObject, list: AnyObject[]): void;
|
|
5
5
|
export declare function getIndex(time: string, list: AnyObject[]): number;
|
|
6
|
+
/**
|
|
7
|
+
* @description: 判断yScaleValue数组内的项类型是否可以连成一条折线,比如温度线
|
|
8
|
+
* @param {string} type
|
|
9
|
+
* @return {*}
|
|
10
|
+
*/
|
|
11
|
+
export declare function isOneLine(type: string): boolean;
|
|
@@ -11,5 +11,8 @@ function getIndex(time, list) {
|
|
|
11
11
|
const index = list.findIndex((v) => new Date(v.time).getTime() > new Date(time).getTime());
|
|
12
12
|
return !~index ? list.length : index;
|
|
13
13
|
}
|
|
14
|
+
function isOneLine(type) {
|
|
15
|
+
return ["temperature", "pulse"].includes(type);
|
|
16
|
+
}
|
|
14
17
|
|
|
15
|
-
export { deleteProperty, getIndex, isEffectiveNode };
|
|
18
|
+
export { deleteProperty, getIndex, isEffectiveNode, isOneLine };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { findAncestor } from '../../../../../../../shared/utils/index.js';
|
|
3
|
+
import { isObject } from 'lodash-es';
|
|
2
4
|
import '../../../../../index.js';
|
|
3
5
|
import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index.js';
|
|
4
6
|
import { IhoTableRenderHelper } from '../../../../utils/index.js';
|
|
@@ -8,9 +10,24 @@ import { defineTablePlugin } from '../../../../hooks/useTablePlugin.js';
|
|
|
8
10
|
|
|
9
11
|
function selectRendererPlugin() {
|
|
10
12
|
const pluginName = "selectRendererPlugin";
|
|
13
|
+
function isHTMLElement(target) {
|
|
14
|
+
return isObject(target);
|
|
15
|
+
}
|
|
11
16
|
return defineTablePlugin({
|
|
12
17
|
name: pluginName,
|
|
13
18
|
vxe(instance) {
|
|
19
|
+
instance.interceptor.add("event.clearActived", ({
|
|
20
|
+
$event,
|
|
21
|
+
column
|
|
22
|
+
}) => {
|
|
23
|
+
var _a;
|
|
24
|
+
if (((_a = column.editRender) == null ? void 0 : _a.name) !== EDITABLE_WIDGET_TYPE.SELECT)
|
|
25
|
+
return true;
|
|
26
|
+
const target = $event == null ? void 0 : $event.target;
|
|
27
|
+
if (!isHTMLElement(target))
|
|
28
|
+
return true;
|
|
29
|
+
return !findAncestor(target, (ele) => ele.classList.contains("n-base-select-menu-option-wrapper"));
|
|
30
|
+
});
|
|
14
31
|
instance.renderer.add(EDITABLE_WIDGET_TYPE.SELECT, {
|
|
15
32
|
renderCell({
|
|
16
33
|
props
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
function getDefaultValue(row, item) {
|
|
2
|
-
var _a;
|
|
3
2
|
const value = row[item.columnName];
|
|
4
3
|
if (Array.isArray(value))
|
|
5
|
-
return
|
|
4
|
+
return value.map((v) => getValue(v)).join(",");
|
|
6
5
|
return getValue(value);
|
|
7
6
|
function getValue(value2) {
|
|
8
|
-
var
|
|
7
|
+
var _a;
|
|
9
8
|
const findValue = (options) => {
|
|
10
|
-
var
|
|
11
|
-
return ((
|
|
9
|
+
var _a2;
|
|
10
|
+
return ((_a2 = options == null ? void 0 : options.find((v) => v.value == value2)) == null ? void 0 : _a2.label) || value2 || "";
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
return row[(_a2 = item.formatMap) == null ? void 0 : _a2.label];
|
|
15
|
-
}
|
|
16
|
-
return findValue(((_b = item.componentProps) == null ? void 0 : _b.options) || []);
|
|
12
|
+
return findValue(((_a = item.componentProps) == null ? void 0 : _a.options) || []);
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
15
|
|