atr-components 0.2.312 → 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.
@@ -1897,7 +1897,7 @@ class DictService {
1897
1897
  }
1898
1898
  async getCodeNameSync(keys, code, selectUrl, splitKey) {
1899
1899
  return new Promise((resolve, reject) => {
1900
- this.getDictByCodeSync(code, selectUrl).then(() => {
1900
+ this.getCodeNamePromise(code, selectUrl).then(() => {
1901
1901
  if (splitKey && keys) {
1902
1902
  let result = [];
1903
1903
  for (let item of keys.split(splitKey)) {
@@ -1941,6 +1941,34 @@ class DictService {
1941
1941
  });
1942
1942
  });
1943
1943
  }
1944
+ async getCodeNamePromise(code, selectUrl) {
1945
+ return new Promise(async (resolve, reject) => {
1946
+ let dict = SessionStorageUtil.getDictGroupByCode(code);
1947
+ if (dict) {
1948
+ resolve(dict);
1949
+ }
1950
+ else {
1951
+ if (commonDatas.await_Data[code]) {
1952
+ setTimeout(() => {
1953
+ this.getDictBycode(code, selectUrl).subscribe(res => {
1954
+ resolve(res);
1955
+ }, error => {
1956
+ resolve(error);
1957
+ });
1958
+ }, 500);
1959
+ return;
1960
+ }
1961
+ commonDatas.await_Data[code] = true;
1962
+ this.getDicBycodeBase(code, selectUrl).subscribe(result => {
1963
+ resolve(result);
1964
+ commonDatas.await_Data[code] = false;
1965
+ }, error => {
1966
+ resolve(error);
1967
+ commonDatas.await_Data[code] = false;
1968
+ });
1969
+ }
1970
+ });
1971
+ }
1944
1972
  getDictBycode(code, selectUrl) {
1945
1973
  // //console.log(code);
1946
1974
  return new Observable(observe => {
@@ -2009,7 +2037,7 @@ class DictsPipe {
2009
2037
  if (ToolsUtil.isNull(dictCode)) {
2010
2038
  return value;
2011
2039
  }
2012
- // return this.dictService.getCodeNameSync(value, dictCode)
2040
+ // return this.dictService.getCodeNameSync(value, dictCode,null,splitKey )
2013
2041
  return this.dictService.getCodeNameSync(value, dictCode, null, splitKey).then(res => {
2014
2042
  return res;
2015
2043
  });
@@ -2104,7 +2132,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
2104
2132
  class OssImgPipe {
2105
2133
  constructor() {
2106
2134
  }
2107
- transform(value, param = { isVideoCover: false, needTime: true }) {
2135
+ transform(value, param = { isVideoCover: false, needTime: false }) {
2108
2136
  return param.isVideoCover ? ToolsUtil.getVideoCover(value) : ToolsUtil.getOssUrl(value, param.needTime);
2109
2137
  }
2110
2138
  }
@@ -5063,6 +5091,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
5063
5091
  class ImgCanvasComponent {
5064
5092
  constructor(elementRef) {
5065
5093
  this.elementRef = elementRef;
5094
+ this.needTime = false;
5066
5095
  this.width = 800;
5067
5096
  this.height = 800;
5068
5097
  this.clipArr = [];
@@ -5071,12 +5100,13 @@ class ImgCanvasComponent {
5071
5100
  this.needContextmenu = false;
5072
5101
  }
5073
5102
  set url(url) {
5074
- if (url && url.indexOf('?v=') < 0) {
5075
- if (url.indexOf("?") < 0) {
5076
- url += "?";
5077
- }
5078
- url += "v=" + new Date().getTime();
5079
- }
5103
+ // if (url && url.indexOf('?v=') < 0) {
5104
+ // if (url.indexOf("?") < 0) {
5105
+ // url += "?";
5106
+ //
5107
+ // }
5108
+ // url += "v=" + new Date().getTime()
5109
+ // }
5080
5110
  this.imgUrl = url;
5081
5111
  }
5082
5112
  ngOnInit() {
@@ -5128,6 +5158,12 @@ class ImgCanvasComponent {
5128
5158
  let context1 = this.canvasDom.getContext('2d');
5129
5159
  let img = new Image();
5130
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
+ }
5131
5167
  img.src = this.imgUrl;
5132
5168
  img.onload = () => {
5133
5169
  this.img = img;
@@ -5161,11 +5197,13 @@ class ImgCanvasComponent {
5161
5197
  }
5162
5198
  }
5163
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 });
5164
- 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: [""] });
5165
5201
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImgCanvasComponent, decorators: [{
5166
5202
  type: Component,
5167
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: [""] }]
5168
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { url: [{
5204
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { needTime: [{
5205
+ type: Input
5206
+ }], url: [{
5169
5207
  type: Input
5170
5208
  }], canvas1: [{
5171
5209
  type: ViewChild,