atr-components 0.2.400 → 0.2.401
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/esm2020/lib/shared/img-canvas/img-canvas.component.mjs +19 -9
- package/fesm2015/atr-components.mjs +18 -8
- package/fesm2015/atr-components.mjs.map +1 -1
- package/fesm2020/atr-components.mjs +18 -8
- 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
|
@@ -5091,6 +5091,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
5091
5091
|
class ImgCanvasComponent {
|
|
5092
5092
|
constructor(elementRef) {
|
|
5093
5093
|
this.elementRef = elementRef;
|
|
5094
|
+
this.needTime = false;
|
|
5094
5095
|
this.width = 800;
|
|
5095
5096
|
this.height = 800;
|
|
5096
5097
|
this.clipArr = [];
|
|
@@ -5099,12 +5100,13 @@ class ImgCanvasComponent {
|
|
|
5099
5100
|
this.needContextmenu = false;
|
|
5100
5101
|
}
|
|
5101
5102
|
set url(url) {
|
|
5102
|
-
if (url && url.indexOf('?v=') < 0) {
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5103
|
+
// if (url && url.indexOf('?v=') < 0) {
|
|
5104
|
+
// if (url.indexOf("?") < 0) {
|
|
5105
|
+
// url += "?";
|
|
5106
|
+
//
|
|
5107
|
+
// }
|
|
5108
|
+
// url += "v=" + new Date().getTime()
|
|
5109
|
+
// }
|
|
5108
5110
|
this.imgUrl = url;
|
|
5109
5111
|
}
|
|
5110
5112
|
ngOnInit() {
|
|
@@ -5156,6 +5158,12 @@ class ImgCanvasComponent {
|
|
|
5156
5158
|
let context1 = this.canvasDom.getContext('2d');
|
|
5157
5159
|
let img = new Image();
|
|
5158
5160
|
img.setAttribute('crossOrigin', 'anonymous');
|
|
5161
|
+
if (this.needTime) {
|
|
5162
|
+
if (this.imgUrl.indexOf("?") < 0) {
|
|
5163
|
+
this.imgUrl += "?";
|
|
5164
|
+
}
|
|
5165
|
+
this.imgUrl += "v=" + new Date().getTime();
|
|
5166
|
+
}
|
|
5159
5167
|
img.src = this.imgUrl;
|
|
5160
5168
|
img.onload = () => {
|
|
5161
5169
|
this.img = img;
|
|
@@ -5189,11 +5197,13 @@ class ImgCanvasComponent {
|
|
|
5189
5197
|
}
|
|
5190
5198
|
}
|
|
5191
5199
|
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: [""] });
|
|
5200
|
+
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
5201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImgCanvasComponent, decorators: [{
|
|
5194
5202
|
type: Component,
|
|
5195
5203
|
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: {
|
|
5204
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { needTime: [{
|
|
5205
|
+
type: Input
|
|
5206
|
+
}], url: [{
|
|
5197
5207
|
type: Input
|
|
5198
5208
|
}], canvas1: [{
|
|
5199
5209
|
type: ViewChild,
|