cnhis-design-vue 2.1.143 → 2.1.145
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/CHANGELOG.md +41 -3
- package/es/age/index.js +2 -2
- package/es/big-table/index.js +26 -26
- package/es/button/index.js +445 -285
- package/es/button/style.css +1 -1
- package/es/captcha/index.js +3 -3
- package/es/card-reader-sdk/index.js +1 -1
- package/es/checkbox/index.js +1 -1
- package/es/color-picker/index.js +1 -1
- package/es/drag-layout/index.js +3 -3
- package/es/editor/index.js +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/fabric-chart/index.js +379 -186
- package/es/fabric-chart/style.css +1 -1
- package/es/form-table/index.js +20 -20
- package/es/full-calendar/index.js +4 -4
- package/es/index/index.js +1766 -953
- package/es/index/style.css +1 -1
- package/es/input/index.js +1 -1
- package/es/map/index.js +1 -1
- package/es/multi-chat/index.js +74 -58
- package/es/multi-chat/style.css +1 -1
- package/es/multi-chat-client/index.js +70 -54
- package/es/multi-chat-client/style.css +1 -1
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +4 -4
- package/es/multi-chat-setting/index.js +64 -47
- package/es/multi-chat-setting/style.css +1 -1
- package/es/multi-chat-sip/index.js +1 -1
- package/es/radio/index.js +1 -1
- package/es/scale-container/index.js +1 -1
- package/es/scale-view/index.js +27 -27
- package/es/select/index.js +4 -4
- package/es/select-label/index.js +3 -3
- package/es/select-person/index.js +2 -2
- package/es/select-tag/index.js +4 -4
- package/es/shortcut-setter/index.js +2 -2
- package/es/slider-tree/index.js +1 -1
- package/es/table-filter/index.js +1100 -529
- package/es/table-filter/style.css +1 -1
- package/es/tag/index.js +1 -1
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +1926 -1139
- package/lib/cui.umd.js +1926 -1139
- package/lib/cui.umd.min.js +34 -34
- package/package.json +1 -1
- package/packages/button/src/ButtonPrint/index.vue +21 -13
- package/packages/button/src/ButtonPrint/new.vue +270 -291
- package/packages/button/src/ButtonPrint/old.vue +33 -4
- package/packages/fabric-chart/src/FabricChart.vue +10 -1
- package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +0 -1
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +200 -89
- package/packages/fabric-chart/src/mixins/eventCommon.js +1 -1
- package/packages/fabric-chart/src/utils/index.js +8 -0
- package/packages/multi-chat/chat/client/clientChat.vue +14 -2
- package/packages/multi-chat/chat/index.vue +14 -2
- package/packages/multi-chat/setting/index.vue +13 -1
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +21 -71
- package/packages/table-filter/src/mixins/printNew.js +184 -0
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
</a-menu-item>
|
|
9
9
|
</a-sub-menu>
|
|
10
10
|
<a-menu-divider />
|
|
11
|
-
<a-menu-item @click="e => handleClickPrint(e)">
|
|
11
|
+
<a-menu-item @click="e => handleClickPrint(e)" v-if="!hideButtons.includes('printText')">
|
|
12
12
|
{{ printText }}
|
|
13
13
|
</a-menu-item>
|
|
14
|
-
<a-menu-item @click="e => handleClickPreview(e)">
|
|
14
|
+
<a-menu-item @click="e => handleClickPreview(e)" v-if="!hideButtons.includes('previewText')">
|
|
15
15
|
{{ previewText }}
|
|
16
16
|
</a-menu-item>
|
|
17
|
-
<a-menu-item @click="e => handleClickPdf(e)">
|
|
17
|
+
<a-menu-item @click="e => handleClickPdf(e)" v-if="isShowDownloadPdf">
|
|
18
18
|
{{ pdfLoadText }}
|
|
19
19
|
</a-menu-item>
|
|
20
|
-
<a-menu-item @click="e => handleClickEdit(e)">
|
|
20
|
+
<a-menu-item @click="e => handleClickEdit(e)" v-if="isShowFormatEditText">
|
|
21
21
|
{{ formatEditText }}
|
|
22
22
|
</a-menu-item>
|
|
23
23
|
</a-menu>
|
|
@@ -59,6 +59,8 @@ import axios from 'axios';
|
|
|
59
59
|
import moment from 'moment';
|
|
60
60
|
import vexutils from '@/utils/vexutils';
|
|
61
61
|
|
|
62
|
+
const downloadPdfCode = 'RY7.2.21.1.M2.G94181E';
|
|
63
|
+
const formatEditTextCode = 'RY7.2.21.1.M2.G33633A';
|
|
62
64
|
export default create({
|
|
63
65
|
name: 'button-print',
|
|
64
66
|
components: {
|
|
@@ -165,6 +167,11 @@ export default create({
|
|
|
165
167
|
|
|
166
168
|
getPrintParamsAfter: {
|
|
167
169
|
type: Function
|
|
170
|
+
},
|
|
171
|
+
// 隐藏默认按钮配置。printText: 直接打印;previewText: 打印预览;downloadPdf:下载pdf;formatEditText:格式编辑。示例:hideButtons = ['formatEditText']
|
|
172
|
+
hideButtons: {
|
|
173
|
+
type: Array,
|
|
174
|
+
default: () => []
|
|
168
175
|
}
|
|
169
176
|
},
|
|
170
177
|
computed: {
|
|
@@ -184,6 +191,18 @@ export default create({
|
|
|
184
191
|
formatId: this.currentFormatId,
|
|
185
192
|
templateId: this.getTemplateIdByFormatId(this.currentFormatId)
|
|
186
193
|
};
|
|
194
|
+
},
|
|
195
|
+
// 展示下载pdf按钮
|
|
196
|
+
isShowDownloadPdf() {
|
|
197
|
+
const isShow = !this.hideButtons.includes('downloadPdf');
|
|
198
|
+
const settingShow = this.isShowOperation(downloadPdfCode);
|
|
199
|
+
return isShow && settingShow;
|
|
200
|
+
},
|
|
201
|
+
// 展示格式编辑按钮
|
|
202
|
+
isShowFormatEditText() {
|
|
203
|
+
const isShow = !this.hideButtons.includes('formatEditText');
|
|
204
|
+
const settingShow = this.isShowOperation(formatEditTextCode);
|
|
205
|
+
return isShow && settingShow;
|
|
187
206
|
}
|
|
188
207
|
},
|
|
189
208
|
data() {
|
|
@@ -232,6 +251,16 @@ export default create({
|
|
|
232
251
|
// getPopupContainer(triggerNode) {
|
|
233
252
|
// return triggerNode.parentNode;
|
|
234
253
|
// },
|
|
254
|
+
isShowOperation(code) {
|
|
255
|
+
const portalStr = sessionStorage.getItem('portal');
|
|
256
|
+
if (portalStr) {
|
|
257
|
+
const portal = JSON.parse(portalStr);
|
|
258
|
+
const limitObj = portal?.user?.currentRoleResourceObj || {};
|
|
259
|
+
const limitList = Object.keys(limitObj);
|
|
260
|
+
return limitList.includes(code)
|
|
261
|
+
}
|
|
262
|
+
return true;
|
|
263
|
+
},
|
|
235
264
|
handleClickOutside() {
|
|
236
265
|
this.visible = false;
|
|
237
266
|
},
|
|
@@ -31,7 +31,6 @@ import FabricGrid from './FabricGrid';
|
|
|
31
31
|
import FabricTextGroup from './fabric-chart/FabricTextGroup';
|
|
32
32
|
import FabricScaleValue from './fabric-chart/FabricScaleValue';
|
|
33
33
|
import FabricLines from './fabric-chart/FabricLines';
|
|
34
|
-
import { isObject } from './utils';
|
|
35
34
|
|
|
36
35
|
export default create({
|
|
37
36
|
name: 'fabric-chart',
|
|
@@ -50,6 +49,12 @@ export default create({
|
|
|
50
49
|
FabricLines
|
|
51
50
|
},
|
|
52
51
|
computed: {
|
|
52
|
+
fabric() {
|
|
53
|
+
return this.$refs.canvasEle?.fabric;
|
|
54
|
+
},
|
|
55
|
+
canvas() {
|
|
56
|
+
return this.$refs.canvasEle?.canvas;
|
|
57
|
+
},
|
|
53
58
|
polylines() {
|
|
54
59
|
const list = [];
|
|
55
60
|
if (this.templateData?.right?.rightYScalevalue?.dataList?.length) {
|
|
@@ -84,6 +89,10 @@ export default create({
|
|
|
84
89
|
this.canvasWidth = `${this.templateData.canvasWidth}px` || '1000px';
|
|
85
90
|
},
|
|
86
91
|
methods: {
|
|
92
|
+
computedX() {
|
|
93
|
+
if (!this.$refs.polylines?.computedX) return;
|
|
94
|
+
return this.$refs.polylines?.computedX(...arguments);
|
|
95
|
+
},
|
|
87
96
|
setTimeRange(enabled) {
|
|
88
97
|
this.$refs.polylines.timeRangeData.enabled = enabled;
|
|
89
98
|
},
|
|
@@ -14,7 +14,8 @@ import MouseRightClick from '../components/MouseRightClick';
|
|
|
14
14
|
import DropPopup from '../components/DropPopup';
|
|
15
15
|
import defaultVaule from '../const/defaultVaule';
|
|
16
16
|
import Bus from '../utils/bus';
|
|
17
|
-
import { nearlyEqual } from '../utils';
|
|
17
|
+
import { nearlyEqual, getUuid } from '../utils';
|
|
18
|
+
import vexutils from '@/utils/vexutils';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* @description: 递归遍历节点,设置颜色属性
|
|
@@ -37,10 +38,17 @@ function resetPointColor(pointArr, color) {
|
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
|
-
const setPointLineColor = (point, color,
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const setPointLineColor = (point, color, isRight) => {
|
|
42
|
+
const lineColor = color === 'transparent' ? color : isRight ? point.prevPoint?.__attrs?.lineAttr?.stroke || color : color;
|
|
43
|
+
if (isRight) {
|
|
44
|
+
point.line1?.set({ stroke: lineColor });
|
|
45
|
+
point.line2?.set({ stroke: color });
|
|
46
|
+
} else {
|
|
47
|
+
point.line2?.set({ stroke: lineColor });
|
|
48
|
+
point.line1?.set({ stroke: color });
|
|
49
|
+
}
|
|
50
|
+
// point.line2?.set({ stroke: color });
|
|
51
|
+
// conditionHasLine && point.line2?.set({ stroke: color });
|
|
44
52
|
};
|
|
45
53
|
|
|
46
54
|
const isEffectiveNode = node => {
|
|
@@ -833,6 +841,7 @@ export default {
|
|
|
833
841
|
const lastPoint = this.addPointList[this.addPointList.length - 1];
|
|
834
842
|
const position = this.polyline[point.polylineTypeId].position;
|
|
835
843
|
const [firstPoint] = this.addPointList;
|
|
844
|
+
const isRight = lastPoint.left > point.originLeft;
|
|
836
845
|
// 如果是重合/连线节点
|
|
837
846
|
if (point.get('scaleX') !== point.scale) {
|
|
838
847
|
const addOjb = {
|
|
@@ -848,17 +857,35 @@ export default {
|
|
|
848
857
|
} else {
|
|
849
858
|
this.addPointList.push(addOjb);
|
|
850
859
|
}
|
|
851
|
-
|
|
852
|
-
|
|
860
|
+
if (!isRight) {
|
|
861
|
+
this.addPointList.unshift({
|
|
862
|
+
...firstPoint,
|
|
863
|
+
value: {
|
|
864
|
+
time: this.getXValue(point.originLeft),
|
|
865
|
+
value: this.getYValue(position, point.originTop),
|
|
866
|
+
...(point.__attrs?.key ? { key: point.__attrs.key } : {})
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
this.addPointList.forEach(v =>
|
|
872
|
+
Object.assign(v, { isConcat: true, concatIndex: isRight ? this._concatIndex : point.pointIndex, pointIndex: isRight ? point.pointIndex : this._concatPoint.pointIndex })
|
|
873
|
+
);
|
|
874
|
+
} else if (!isRight || (isRight && (point.line2 || (point.nextPoint && lastPoint.left >= point.nextPoint.left)))) {
|
|
853
875
|
// 1、存在右连线 2、无右侧连线,并且存在下一个节点的情况
|
|
854
876
|
this.addPointList = [];
|
|
855
877
|
this.repaintPolyline(position, point.polylineIndex);
|
|
856
878
|
return;
|
|
857
879
|
}
|
|
858
|
-
!point.line2 && firstPoint.left <= point.originLeft && this.addPointList.splice(0, 1);
|
|
859
880
|
!point.id.includes('isTitle') && this.removePolyline(point.id);
|
|
881
|
+
if (isRight && !point.line2 && firstPoint.left <= point.originLeft) {
|
|
882
|
+
this.addPointList.splice(0, 1);
|
|
883
|
+
}
|
|
884
|
+
if (!isRight) {
|
|
885
|
+
this.addPointList.splice(-1, 1);
|
|
886
|
+
}
|
|
860
887
|
if (this.addPointList.length > 0) {
|
|
861
|
-
this.$emit('pointOperation', 'increasePointBatch', this.addPointList);
|
|
888
|
+
this.$emit('pointOperation', 'increasePointBatch', isRight ? this.addPointList : this.addPointList.reverse());
|
|
862
889
|
this.addPointList = [];
|
|
863
890
|
} else {
|
|
864
891
|
this.repaintPolyline(position, point.polylineIndex);
|
|
@@ -875,41 +902,59 @@ export default {
|
|
|
875
902
|
this.addPointList.push(data);
|
|
876
903
|
},
|
|
877
904
|
// 纠正线段坐标
|
|
878
|
-
setLinePatch(point) {
|
|
905
|
+
setLinePatch(point, isRight) {
|
|
879
906
|
const { originLeft, originTop } = point;
|
|
880
907
|
for (let i = 0, len = this.addPointList.length; i < len; i++) {
|
|
881
908
|
const currentPoint = this.addPointList[i];
|
|
882
909
|
const prevPoint = this.addPointList[i - 1] || { left: point.prePoint?.left ?? originLeft, top: point.prePoint?.top ?? originTop };
|
|
883
910
|
const currentPointObj = this.addPointObjList.find(obj => nearlyEqual(obj.left, currentPoint.left));
|
|
884
|
-
if (
|
|
885
|
-
currentPointObj?.line1?.
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
911
|
+
if (isRight) {
|
|
912
|
+
if (!nearlyEqual(currentPointObj?.line1?.x1, prevPoint.left)) {
|
|
913
|
+
currentPointObj?.line1?.set({
|
|
914
|
+
x1: prevPoint.left,
|
|
915
|
+
y1: prevPoint.top,
|
|
916
|
+
x2: currentPoint.left,
|
|
917
|
+
y2: currentPoint.top
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
} else {
|
|
921
|
+
if (!nearlyEqual(currentPointObj?.line2?.x2, prevPoint.left)) {
|
|
922
|
+
currentPointObj?.line1?.set({
|
|
923
|
+
x1: currentPoint.left,
|
|
924
|
+
y1: currentPoint.top,
|
|
925
|
+
x2: prevPoint.left,
|
|
926
|
+
y2: prevPoint.top
|
|
927
|
+
});
|
|
928
|
+
}
|
|
891
929
|
}
|
|
892
930
|
}
|
|
893
931
|
},
|
|
894
932
|
// 检查批量新增拖动过程中是否存在漏点的情况
|
|
895
|
-
checkPoints(point) {
|
|
933
|
+
checkPoints(point, isRight) {
|
|
896
934
|
const { originLeft, originTop, left, polylineTypeId } = point;
|
|
897
|
-
const PointLens = Math.floor((left - originLeft) / this.spaceWidth);
|
|
935
|
+
const PointLens = Math.floor(Math.abs(left - originLeft) / this.spaceWidth);
|
|
898
936
|
if (PointLens > 1 && this.addPointList?.length <= PointLens) {
|
|
899
937
|
const position = this.polyline[polylineTypeId].position;
|
|
900
938
|
for (let k = 0; k <= PointLens; k++) {
|
|
901
939
|
if (k > 0) {
|
|
902
|
-
const
|
|
940
|
+
const spaceWidth = this.spaceWidth * k;
|
|
941
|
+
const curLeft = isRight ? originLeft + spaceWidth : originLeft - spaceWidth;
|
|
903
942
|
// 判断this.addPointList中的left是否包含curLeft,不包含就说明是漏了
|
|
904
943
|
const hasPoint = this.addPointList.some(p => nearlyEqual(p.left, curLeft));
|
|
905
|
-
// const hasPoint = this.addPointList.some(v => v.left == curLeft);
|
|
906
944
|
if (!hasPoint) {
|
|
907
945
|
let index;
|
|
908
946
|
const pointObj = this.addPointList.find((v, i) => {
|
|
909
|
-
if (
|
|
910
|
-
|
|
947
|
+
if (isRight) {
|
|
948
|
+
if (v.left > curLeft) {
|
|
949
|
+
index = i;
|
|
950
|
+
}
|
|
951
|
+
return v.left > curLeft;
|
|
952
|
+
} else {
|
|
953
|
+
if (v.left < curLeft) {
|
|
954
|
+
index = i;
|
|
955
|
+
}
|
|
956
|
+
return v.left < curLeft;
|
|
911
957
|
}
|
|
912
|
-
return v.left > curLeft;
|
|
913
958
|
});
|
|
914
959
|
if (pointObj) {
|
|
915
960
|
let cloneObj = JSON.parse(JSON.stringify(pointObj));
|
|
@@ -917,7 +962,7 @@ export default {
|
|
|
917
962
|
left: originLeft,
|
|
918
963
|
top: originTop
|
|
919
964
|
};
|
|
920
|
-
const len = ~~((pointObj.left -
|
|
965
|
+
const len = ~~(Math.abs(pointObj.left - curLeft) / this.spaceWidth) + 1;
|
|
921
966
|
const spaceHeight = (pointObj.top - prePoint.top) / len;
|
|
922
967
|
cloneObj.top = prePoint.top + spaceHeight;
|
|
923
968
|
cloneObj.value.time = this.getXValue(curLeft);
|
|
@@ -925,14 +970,32 @@ export default {
|
|
|
925
970
|
if (point.__attrs.key) cloneObj.value.key = point.__attrs.key;
|
|
926
971
|
cloneObj.left = curLeft;
|
|
927
972
|
this.addPointList.splice(index, 0, cloneObj);
|
|
928
|
-
this.clonePoint(point, [prePoint.left, prePoint.top, cloneObj.left, cloneObj.top]);
|
|
973
|
+
this.clonePoint(point, [prePoint.left, prePoint.top, cloneObj.left, cloneObj.top], isRight);
|
|
929
974
|
}
|
|
930
975
|
}
|
|
931
976
|
}
|
|
932
977
|
}
|
|
933
978
|
}
|
|
934
979
|
// 纠正节点上的line1的坐标
|
|
935
|
-
this.setLinePatch(point);
|
|
980
|
+
this.setLinePatch(point, isRight);
|
|
981
|
+
},
|
|
982
|
+
// 断点相连
|
|
983
|
+
concatPoint(point, target, left, top, n) {
|
|
984
|
+
const { left: targetLeft, top: targetTop } = target;
|
|
985
|
+
point.setCoords();
|
|
986
|
+
if (Math.abs(left - targetLeft) <= n && Math.abs(top - targetTop) <= n) {
|
|
987
|
+
point.set({
|
|
988
|
+
left: targetLeft,
|
|
989
|
+
top: targetTop,
|
|
990
|
+
scaleX: point.scale === 1 ? 2.5 : 0.1,
|
|
991
|
+
scaleY: point.scale === 1 ? 2.5 : 0.1
|
|
992
|
+
});
|
|
993
|
+
} else {
|
|
994
|
+
point.set({
|
|
995
|
+
scaleX: point.scale,
|
|
996
|
+
scaleY: point.scale
|
|
997
|
+
});
|
|
998
|
+
}
|
|
936
999
|
},
|
|
937
1000
|
/**
|
|
938
1001
|
* @description: 拖动批量新增节点
|
|
@@ -942,31 +1005,35 @@ export default {
|
|
|
942
1005
|
addPoint(point) {
|
|
943
1006
|
let { left, top, originLeft, originTop } = point;
|
|
944
1007
|
const currentLeft = left;
|
|
945
|
-
|
|
1008
|
+
const isRight = currentLeft > originLeft;
|
|
946
1009
|
const startLength = this.addPointList.length;
|
|
1010
|
+
|
|
947
1011
|
const n = Math.min(this.spaceWidth / 2, 6); // 拖动范围,在需要增加节点的刻度左右吸入的范围值
|
|
948
|
-
const residue = (left - originLeft) % this.spaceWidth;
|
|
1012
|
+
const residue = Math.abs(left - originLeft) % this.spaceWidth;
|
|
949
1013
|
|
|
950
|
-
const condition = residue >
|
|
951
|
-
const
|
|
952
|
-
const
|
|
1014
|
+
const condition = residue > this.spaceWidth - n || residue < n;
|
|
1015
|
+
const condition2 = left > originLeft + this.spaceWidth;
|
|
1016
|
+
const conditionHasLeftPoint = point.prevPoint && left < originLeft - this.spaceWidth;
|
|
953
1017
|
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1018
|
+
if (condition && (condition2 || conditionHasLeftPoint)) {
|
|
1019
|
+
if (isRight) {
|
|
1020
|
+
if (residue > this.spaceWidth - n) left = left - residue + this.spaceWidth;
|
|
1021
|
+
if (residue < n) left = left - residue;
|
|
1022
|
+
} else {
|
|
1023
|
+
if (residue > this.spaceWidth - n) left = left + residue - this.spaceWidth;
|
|
1024
|
+
if (residue < n) left = left + residue;
|
|
1025
|
+
}
|
|
958
1026
|
point.set({
|
|
959
1027
|
left
|
|
960
1028
|
});
|
|
961
1029
|
|
|
962
|
-
// const i = Math.floor((left - originLeft) / this.spaceWidth);
|
|
963
1030
|
// 复制点和线
|
|
964
|
-
if (
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1031
|
+
if (condition2 || conditionHasLeftPoint) {
|
|
1032
|
+
setPointLineColor(point, 'transparent', isRight);
|
|
1033
|
+
const x1 = isRight ? point.line1?.x1 || originLeft : point.line2?.x2 || originLeft;
|
|
1034
|
+
const y1 = isRight ? point.line1?.y1 || originTop : point.line2?.y2 || originTop;
|
|
1035
|
+
this.addPointList.length == 0 && this.clonePoint(point, [x1, y1, originLeft, originTop]);
|
|
968
1036
|
if (this.addPointList.every(v => !nearlyEqual(v.left, left))) {
|
|
969
|
-
// const points1 = i === 1 ? [originLeft, originTop] : point.prePoints;
|
|
970
1037
|
const points1 = this.addPointList.length == 0 ? [originLeft, originTop] : point.prePoints;
|
|
971
1038
|
if (points1) {
|
|
972
1039
|
// this.setAddPointList(point);
|
|
@@ -979,30 +1046,11 @@ export default {
|
|
|
979
1046
|
// 避免重复添加
|
|
980
1047
|
if (this.addPointObjList.every(o => !nearlyEqual(o.left, left))) {
|
|
981
1048
|
this.addPointList.push(data);
|
|
982
|
-
this.clonePoint(point, [...points1, left, top]);
|
|
1049
|
+
this.clonePoint(point, [...points1, left, top], isRight);
|
|
983
1050
|
}
|
|
984
1051
|
}
|
|
985
1052
|
}
|
|
986
|
-
this.checkPoints(point);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
// 断点相连
|
|
991
|
-
function concatPoint(target) {
|
|
992
|
-
const { left: targetLeft, top: targetTop } = target;
|
|
993
|
-
point.setCoords();
|
|
994
|
-
if (left >= targetLeft - n && left <= targetLeft + n && top <= targetTop + n && top >= targetTop - n) {
|
|
995
|
-
point.set({
|
|
996
|
-
left: targetLeft,
|
|
997
|
-
top: targetTop,
|
|
998
|
-
scaleX: point.scale === 1 ? 2.5 : 0.1,
|
|
999
|
-
scaleY: point.scale === 1 ? 2.5 : 0.1
|
|
1000
|
-
});
|
|
1001
|
-
} else {
|
|
1002
|
-
point.set({
|
|
1003
|
-
scaleX: point.scale,
|
|
1004
|
-
scaleY: point.scale
|
|
1005
|
-
});
|
|
1053
|
+
this.checkPoints(point, isRight);
|
|
1006
1054
|
}
|
|
1007
1055
|
}
|
|
1008
1056
|
|
|
@@ -1011,55 +1059,94 @@ export default {
|
|
|
1011
1059
|
const color = point.__attrs.lineAttr.stroke;
|
|
1012
1060
|
const polylineObj = this.polylinePointList.find(v => v.polylineTypeId == polylineTypeId && v.polylineIndex == polylineIndex);
|
|
1013
1061
|
polylineObj?.pointList.forEach(v => v.bringToFront());
|
|
1014
|
-
if (point.nextPoint) {
|
|
1015
|
-
|
|
1062
|
+
if ((isRight && point.nextPoint) || (!isRight && point.prevPoint)) {
|
|
1063
|
+
if (isRight) {
|
|
1064
|
+
this._concatIndex = polylineObj?.pointerList.findIndex(l => l + n > left && l > originLeft);
|
|
1065
|
+
} else {
|
|
1066
|
+
const idx = polylineObj?.pointerList.toReversed().findIndex(l => l - n < left && l < originLeft);
|
|
1067
|
+
this._concatIndex = !~idx ? -1 : polylineObj?.pointerList.length - 1 - idx;
|
|
1068
|
+
}
|
|
1016
1069
|
if (!~this._concatIndex) {
|
|
1017
1070
|
point.set({
|
|
1018
1071
|
scaleX: point.scale,
|
|
1019
1072
|
scaleY: point.scale
|
|
1020
1073
|
});
|
|
1021
1074
|
} else {
|
|
1022
|
-
concatPoint(polylineObj?.pointList[this._concatIndex]);
|
|
1075
|
+
this.concatPoint(point, polylineObj?.pointList[this._concatIndex], left, top, n);
|
|
1023
1076
|
}
|
|
1024
1077
|
this._concatPoint = polylineObj?.pointList?.[this._concatIndex] || null;
|
|
1025
1078
|
|
|
1026
1079
|
// 被覆盖节点置灰配置
|
|
1027
|
-
polylineObj?.pointerList.forEach((
|
|
1080
|
+
polylineObj?.pointerList.forEach((l, i) => {
|
|
1028
1081
|
const obj = polylineObj?.pointList[i];
|
|
1029
|
-
if (
|
|
1082
|
+
if ((isRight && l > originLeft && l < left) || (!isRight && l < originLeft && l > left)) {
|
|
1030
1083
|
// 此处需要递归遍历group节点的所有子节点,然后更改其颜色
|
|
1031
1084
|
resetPointColor([obj], '#999');
|
|
1032
|
-
obj.line2?.set({ stroke: '#999' });
|
|
1085
|
+
isRight && obj.line2?.set({ stroke: '#999' });
|
|
1086
|
+
!isRight && obj.line1?.set({ stroke: '#999' });
|
|
1033
1087
|
} else {
|
|
1034
1088
|
const color = obj.__attrs.lineAttr.stroke;
|
|
1035
1089
|
resetPointColor([obj], color);
|
|
1036
|
-
obj.line2?.set({ stroke: color });
|
|
1090
|
+
isRight && obj.line2?.set({ stroke: color });
|
|
1091
|
+
!isRight && obj.line1?.set({ stroke: color });
|
|
1037
1092
|
}
|
|
1038
1093
|
});
|
|
1039
|
-
if ((point.line1 || point.line2) && left
|
|
1040
|
-
setPointLineColor(point, color,
|
|
1094
|
+
if ((point.line1 || point.line2) && Math.abs(left - originLeft) < this.spaceWidth) {
|
|
1095
|
+
setPointLineColor(point, color, isRight);
|
|
1041
1096
|
} else {
|
|
1042
|
-
setPointLineColor(point, 'transparent',
|
|
1097
|
+
setPointLineColor(point, 'transparent', isRight);
|
|
1043
1098
|
}
|
|
1044
1099
|
}
|
|
1045
1100
|
|
|
1046
1101
|
// 如果往回拖动则删除经过的已存在的节点
|
|
1047
|
-
if (startLength > 0
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1102
|
+
if (startLength > 0) {
|
|
1103
|
+
if (isRight) {
|
|
1104
|
+
this.removeLeftClonePoint(originLeft - this.spaceWidth);
|
|
1105
|
+
this.addPointList = this.addPointList.filter(v => v.left >= originLeft);
|
|
1106
|
+
if (this.addPointList.length > 0 && currentLeft <= this.addPointList[this.addPointList.length - 1].left) {
|
|
1107
|
+
this.removePolyline('increasePointBatch', left);
|
|
1108
|
+
this.addPointList = this.addPointList.filter(v => v.left < left);
|
|
1109
|
+
const endLength = this.addPointList.length;
|
|
1110
|
+
if (endLength === 0) {
|
|
1111
|
+
setPointLineColor(point, color, isRight);
|
|
1112
|
+
this.removePolyline('increasePointBatch', originLeft);
|
|
1113
|
+
}
|
|
1114
|
+
if (endLength > 0) {
|
|
1115
|
+
point.set({
|
|
1116
|
+
prePoints: [this.addPointList[endLength - 1].left, this.addPointList[endLength - 1].top]
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
} else {
|
|
1121
|
+
this.removePolyline('increasePointBatch', originLeft + this.spaceWidth);
|
|
1122
|
+
this.addPointList = this.addPointList.filter(v => v.left <= originLeft);
|
|
1123
|
+
if (this.addPointList.length > 0 && currentLeft >= this.addPointList[this.addPointList.length - 1].left) {
|
|
1124
|
+
this.removeLeftClonePoint(left);
|
|
1125
|
+
this.addPointList = this.addPointList.filter(v => v.left > left);
|
|
1126
|
+
const endLength = this.addPointList.length;
|
|
1127
|
+
if (endLength === 0) {
|
|
1128
|
+
setPointLineColor(point, color, isRight);
|
|
1129
|
+
this.removeLeftClonePoint(originLeft);
|
|
1130
|
+
}
|
|
1131
|
+
if (endLength > 0) {
|
|
1132
|
+
point.set({
|
|
1133
|
+
prePoints: [this.addPointList[endLength - 1].left, this.addPointList[endLength - 1].top]
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1059
1137
|
}
|
|
1060
1138
|
}
|
|
1061
1139
|
},
|
|
1062
|
-
|
|
1140
|
+
removeLeftClonePoint(left) {
|
|
1141
|
+
this.addPointObjList.forEach(obj => {
|
|
1142
|
+
if (obj.left <= left) {
|
|
1143
|
+
this.canvas.remove(obj);
|
|
1144
|
+
obj.line2 && this.canvas.remove(obj.line2);
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
this.addPointObjList = this.addPointObjList.filter(obj => obj.left > left);
|
|
1148
|
+
},
|
|
1149
|
+
clonePoint(point, points, isRight) {
|
|
1063
1150
|
const { lineIndex, polylineIndex, lineAttr, polylineTypeId, originLeft } = point;
|
|
1064
1151
|
const currentLineAttr = originLeft === points[2] && point.prevPoint ? point.prevPoint.__attrs.lineAttr : lineAttr;
|
|
1065
1152
|
|
|
@@ -1077,7 +1164,11 @@ export default {
|
|
|
1077
1164
|
clonedObj.hasControls = clonedObj.hasBorders = false;
|
|
1078
1165
|
point.prePoints = [point.left, point.top];
|
|
1079
1166
|
const line = this.drawLine([...points], { evented: false, selectable: false, ...currentLineAttr, polylineIndex, polylineTypeId, lineIndex });
|
|
1080
|
-
|
|
1167
|
+
if (isRight) {
|
|
1168
|
+
clonedObj.line1 = line;
|
|
1169
|
+
} else {
|
|
1170
|
+
clonedObj.line2 = line;
|
|
1171
|
+
}
|
|
1081
1172
|
this.canvas.add(clonedObj);
|
|
1082
1173
|
this.canvas.sendBackwards(line);
|
|
1083
1174
|
clonedObj.bringForward();
|
|
@@ -1202,15 +1293,35 @@ export default {
|
|
|
1202
1293
|
this.rightClickNode.push(item);
|
|
1203
1294
|
}
|
|
1204
1295
|
});
|
|
1296
|
+
this.addExtraMenu();
|
|
1205
1297
|
this.isRightVisible = true;
|
|
1206
1298
|
}
|
|
1207
1299
|
});
|
|
1208
1300
|
},
|
|
1301
|
+
addExtraMenu() {
|
|
1302
|
+
const { menuList } = this.propItems.table?.extraMenuConfig || {};
|
|
1303
|
+
if (Array.isArray(menuList) && menuList.length > 0) {
|
|
1304
|
+
menuList.forEach(item => {
|
|
1305
|
+
this.rightClickNode.push({
|
|
1306
|
+
name: item.label,
|
|
1307
|
+
type: item.key || getUuid(),
|
|
1308
|
+
extra: true,
|
|
1309
|
+
origin: item
|
|
1310
|
+
});
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1209
1314
|
// 关闭右键菜单,打开添加节点弹窗表单
|
|
1210
|
-
handleRightClick({ type, name }) {
|
|
1315
|
+
handleRightClick({ type, name, extra, origin }) {
|
|
1211
1316
|
this.isRightVisible = false;
|
|
1212
1317
|
const { left, top } = this._active;
|
|
1213
|
-
|
|
1318
|
+
const data = this._currentPoint?.id ? this.getDataByPoint(this._currentPoint) : this.getValue({ left, top });
|
|
1319
|
+
if (extra) {
|
|
1320
|
+
const { click } = this.propItems.table?.extraMenuConfig || {};
|
|
1321
|
+
if (!vexutils.isFunction(click)) return;
|
|
1322
|
+
click(data, origin);
|
|
1323
|
+
return;
|
|
1324
|
+
}
|
|
1214
1325
|
if (type == 'add') {
|
|
1215
1326
|
if (name.includes('左')) {
|
|
1216
1327
|
data.range = {
|
|
@@ -55,7 +55,7 @@ export default {
|
|
|
55
55
|
point.setCoords(); // 需调用setCoords()才能重新计算控制位置(改变Object状态)
|
|
56
56
|
// const objBoundingBox = point.getBoundingRect(); // 此方式会导致结果不精准,应该用point的top值判断
|
|
57
57
|
const { originX, endX, originY, endY } = this.propItems;
|
|
58
|
-
const leftLimit = point.prevPoint?.get('left') || originX;
|
|
58
|
+
const leftLimit = (isLimit && point.prevPoint?.get('left')) || originX;
|
|
59
59
|
const rightLimit = (isLimit && point.nextPoint?.get('left')) || endX;
|
|
60
60
|
if (point.top < originY) {
|
|
61
61
|
point.set('top', originY);
|
|
@@ -87,3 +87,11 @@ export function sortByTime(list = []) {
|
|
|
87
87
|
|
|
88
88
|
return list;
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
export function getUuid() {
|
|
92
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
|
93
|
+
const r = (Math.random() * 16) | 0,
|
|
94
|
+
v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
95
|
+
return v.toString(16);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
@@ -59,6 +59,9 @@ export default {
|
|
|
59
59
|
isCustomServe: {
|
|
60
60
|
type: Boolean,
|
|
61
61
|
default: false
|
|
62
|
+
},
|
|
63
|
+
decrypt: {
|
|
64
|
+
type: Function
|
|
62
65
|
}
|
|
63
66
|
},
|
|
64
67
|
computed: {
|
|
@@ -201,12 +204,21 @@ export default {
|
|
|
201
204
|
}
|
|
202
205
|
}).then(({ data }) => {
|
|
203
206
|
if (data.result === 'SUCCESS') {
|
|
204
|
-
|
|
207
|
+
let useObj = data?.obj || {}
|
|
208
|
+
const {isEncrypt, obj} = useObj;
|
|
209
|
+
if(isEncrypt && obj && this.decrypt && typeof this.decrypt === 'function') {
|
|
210
|
+
try {
|
|
211
|
+
useObj = JSON.parse(this.decrypt(obj)) || {};
|
|
212
|
+
} catch(err) {
|
|
213
|
+
console.log(err)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const { sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential } = useObj;
|
|
205
217
|
this.setSdkInfo({ sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential });
|
|
206
218
|
// 江苏省
|
|
207
219
|
if (vendor == 3) {
|
|
208
220
|
this.initUniRTC({
|
|
209
|
-
...
|
|
221
|
+
...useObj,
|
|
210
222
|
params: {
|
|
211
223
|
assemblyId: this.assemblyId
|
|
212
224
|
}
|
|
@@ -421,6 +421,9 @@ export default {
|
|
|
421
421
|
rightPanelHide: {
|
|
422
422
|
type: Boolean,
|
|
423
423
|
default: false
|
|
424
|
+
},
|
|
425
|
+
decrypt: {
|
|
426
|
+
type: Function
|
|
424
427
|
}
|
|
425
428
|
},
|
|
426
429
|
async created() {
|
|
@@ -1343,12 +1346,21 @@ export default {
|
|
|
1343
1346
|
})
|
|
1344
1347
|
.then(({ data }) => {
|
|
1345
1348
|
if (data.result === 'SUCCESS') {
|
|
1346
|
-
|
|
1349
|
+
let useObj = data?.obj || {}
|
|
1350
|
+
const {isEncrypt, obj} = useObj;
|
|
1351
|
+
if(isEncrypt && obj && this.decrypt && typeof this.decrypt === 'function') {
|
|
1352
|
+
try {
|
|
1353
|
+
useObj = JSON.parse(this.decrypt(obj)) || {};
|
|
1354
|
+
} catch(err) {
|
|
1355
|
+
console.log(err)
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
const { sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential } = useObj;
|
|
1347
1359
|
this.setSdkInfo({ sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential });
|
|
1348
1360
|
// 江苏省
|
|
1349
1361
|
if (vendor == 3) {
|
|
1350
1362
|
this.initUniRTC({
|
|
1351
|
-
...
|
|
1363
|
+
...useObj,
|
|
1352
1364
|
vueSelf: this,
|
|
1353
1365
|
params: {
|
|
1354
1366
|
assemblyId: this.assemblyId
|