atr-components 0.2.400 → 0.2.403
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/core/base/atr-common.d.ts +1 -0
- package/core/utils/ToolsUtil.d.ts +8 -4
- package/esm2020/core/base/atr-common.mjs +1 -1
- package/esm2020/core/utils/ToolsUtil.mjs +6 -1
- package/esm2020/lib/shared/form/form.component.mjs +21 -19
- package/esm2020/lib/shared/img-canvas/img-canvas.component.mjs +19 -9
- package/fesm2015/atr-components.mjs +43 -26
- package/fesm2015/atr-components.mjs.map +1 -1
- package/fesm2020/atr-components.mjs +43 -26
- package/fesm2020/atr-components.mjs.map +1 -1
- package/lib/shared/img-canvas/img-canvas.component.d.ts +2 -1
- package/package.json +1 -1
|
@@ -407,9 +407,14 @@ class ToolsUtil {
|
|
|
407
407
|
* @param pointsArr
|
|
408
408
|
*/
|
|
409
409
|
static judgeInRec(p, pointsArr) {
|
|
410
|
+
pointsArr = pointsArr.map(item => {
|
|
411
|
+
return { x1: Number(item.x1 || item.x || 0), y1: Number(item.y1 || item.y || 0) };
|
|
412
|
+
});
|
|
413
|
+
p = { x1: p.x1 || p.x || 0, y1: p.y1 || p.y || 0 };
|
|
410
414
|
let px = Number(p.x1), py = Number(p.y1), flag = false, //穿越边框
|
|
411
415
|
inRect = false; //是否在多边形的边或者端点上
|
|
412
416
|
let start = pointsArr[0];
|
|
417
|
+
//如果数组首尾没有相连,手动添加};
|
|
413
418
|
let end = pointsArr[pointsArr.length - 1];
|
|
414
419
|
//如果数组首尾没有相连,手动添加
|
|
415
420
|
pointsArr = start.x1 != end.x1 || start.y1 != end.y1 ? pointsArr.concat(start) : pointsArr;
|
|
@@ -4551,24 +4556,26 @@ class AtrFormComponent {
|
|
|
4551
4556
|
if (item.selectUrl.convert) {
|
|
4552
4557
|
keys = item.selectUrl.convert.split(',');
|
|
4553
4558
|
}
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
value
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
value
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4559
|
+
if (item.selectUrl.url) {
|
|
4560
|
+
let selectUrl = item.selectUrl;
|
|
4561
|
+
if (selectUrl.host == 'oss') {
|
|
4562
|
+
this.httpService.getOss(selectUrl.url).subscribe(res => {
|
|
4563
|
+
item.dictList = this.conv(JSON.parse(res), keys);
|
|
4564
|
+
if (value && value.length > 0) {
|
|
4565
|
+
value = this.getCascaderDefaultValue(item.dictList, 0, value);
|
|
4566
|
+
this.setValue(item.key, value);
|
|
4567
|
+
}
|
|
4568
|
+
});
|
|
4569
|
+
}
|
|
4570
|
+
else {
|
|
4571
|
+
this.httpService.post(selectUrl.url, {}, ToolsUtil.getHttpOptions()).subscribe(res => {
|
|
4572
|
+
item.dictList = this.conv(res.data, keys);
|
|
4573
|
+
if (value && value.length > 0) {
|
|
4574
|
+
value = this.getCascaderDefaultValue(item.dictList, 0, value);
|
|
4575
|
+
this.setValue(item.key, value);
|
|
4576
|
+
}
|
|
4577
|
+
});
|
|
4578
|
+
}
|
|
4572
4579
|
}
|
|
4573
4580
|
}
|
|
4574
4581
|
if (item.type == "select") {
|
|
@@ -5091,6 +5098,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
5091
5098
|
class ImgCanvasComponent {
|
|
5092
5099
|
constructor(elementRef) {
|
|
5093
5100
|
this.elementRef = elementRef;
|
|
5101
|
+
this.needTime = false;
|
|
5094
5102
|
this.width = 800;
|
|
5095
5103
|
this.height = 800;
|
|
5096
5104
|
this.clipArr = [];
|
|
@@ -5099,12 +5107,13 @@ class ImgCanvasComponent {
|
|
|
5099
5107
|
this.needContextmenu = false;
|
|
5100
5108
|
}
|
|
5101
5109
|
set url(url) {
|
|
5102
|
-
if (url && url.indexOf('?v=') < 0) {
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5110
|
+
// if (url && url.indexOf('?v=') < 0) {
|
|
5111
|
+
// if (url.indexOf("?") < 0) {
|
|
5112
|
+
// url += "?";
|
|
5113
|
+
//
|
|
5114
|
+
// }
|
|
5115
|
+
// url += "v=" + new Date().getTime()
|
|
5116
|
+
// }
|
|
5108
5117
|
this.imgUrl = url;
|
|
5109
5118
|
}
|
|
5110
5119
|
ngOnInit() {
|
|
@@ -5156,6 +5165,12 @@ class ImgCanvasComponent {
|
|
|
5156
5165
|
let context1 = this.canvasDom.getContext('2d');
|
|
5157
5166
|
let img = new Image();
|
|
5158
5167
|
img.setAttribute('crossOrigin', 'anonymous');
|
|
5168
|
+
if (this.needTime) {
|
|
5169
|
+
if (this.imgUrl.indexOf("?") < 0) {
|
|
5170
|
+
this.imgUrl += "?";
|
|
5171
|
+
}
|
|
5172
|
+
this.imgUrl += "v=" + new Date().getTime();
|
|
5173
|
+
}
|
|
5159
5174
|
img.src = this.imgUrl;
|
|
5160
5175
|
img.onload = () => {
|
|
5161
5176
|
this.img = img;
|
|
@@ -5189,11 +5204,13 @@ class ImgCanvasComponent {
|
|
|
5189
5204
|
}
|
|
5190
5205
|
}
|
|
5191
5206
|
ImgCanvasComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImgCanvasComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5192
|
-
ImgCanvasComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ImgCanvasComponent, selector: "app-img", inputs: { url: "url", clipArr: "clipArr", rotateNum: "rotateNum", needContextmenu: "needContextmenu" }, outputs: { loadOver: "loadOver" }, viewQueries: [{ propertyName: "canvas1", first: true, predicate: ["canvas1"], descendants: true }], ngImport: i0, template: "<canvas #canvas1 style=\"width: 100%;height: 100%;\" oncontextmenu=\"return needContextmenu\">\n \u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u753B\u5E03\uFF01\n</canvas>\n<ng-content></ng-content>\n", styles: [""] });
|
|
5207
|
+
ImgCanvasComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ImgCanvasComponent, selector: "app-img", inputs: { needTime: "needTime", url: "url", clipArr: "clipArr", rotateNum: "rotateNum", needContextmenu: "needContextmenu" }, outputs: { loadOver: "loadOver" }, viewQueries: [{ propertyName: "canvas1", first: true, predicate: ["canvas1"], descendants: true }], ngImport: i0, template: "<canvas #canvas1 style=\"width: 100%;height: 100%;\" oncontextmenu=\"return needContextmenu\">\n \u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u753B\u5E03\uFF01\n</canvas>\n<ng-content></ng-content>\n", styles: [""] });
|
|
5193
5208
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImgCanvasComponent, decorators: [{
|
|
5194
5209
|
type: Component,
|
|
5195
5210
|
args: [{ selector: 'app-img', template: "<canvas #canvas1 style=\"width: 100%;height: 100%;\" oncontextmenu=\"return needContextmenu\">\n \u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u753B\u5E03\uFF01\n</canvas>\n<ng-content></ng-content>\n", styles: [""] }]
|
|
5196
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: {
|
|
5211
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { needTime: [{
|
|
5212
|
+
type: Input
|
|
5213
|
+
}], url: [{
|
|
5197
5214
|
type: Input
|
|
5198
5215
|
}], canvas1: [{
|
|
5199
5216
|
type: ViewChild,
|