fantasy-ngzorro 1.0.40 → 1.0.42

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.
@@ -1792,94 +1792,85 @@
1792
1792
  */
1793
1793
  function () {
1794
1794
  var _this = this;
1795
- /** @type {?} */
1796
- var filterValue = this.filterStr.trim().toLowerCase();
1797
- // 如果没有输入搜索字符串,则显示所有数据
1798
- if (!filterValue) {
1799
- this.hideForm();
1800
- this.addExistingFormLines(this.formLinesData);
1801
- return;
1802
- }
1803
- // 根据搜索字符串过滤数据
1804
- /** @type {?} */
1805
- var filteredData = this.formLinesData.filter((/**
1806
- * @param {?} data
1795
+ this.tableLoading = true;
1796
+ setTimeout((/**
1807
1797
  * @return {?}
1808
1798
  */
1809
- function (data) {
1799
+ function () {
1800
+ var e_1, _a;
1810
1801
  /** @type {?} */
1811
- var values = Object.entries(data).reduce((/**
1812
- * @param {?} acc
1813
- * @param {?} __1
1802
+ var filterValue = _this.filterStr.trim().toLowerCase();
1803
+ // 如果没有输入搜索字符串,则显示所有数据
1804
+ if (!filterValue) {
1805
+ _this.tableLoading = false;
1806
+ return;
1807
+ }
1808
+ // 根据搜索字符串过滤数据
1809
+ /** @type {?} */
1810
+ var filteredData = _this.formLinesData.filter((/**
1811
+ * @param {?} data
1814
1812
  * @return {?}
1815
1813
  */
1816
- function (acc, _a) {
1817
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
1818
- if (_this.formLines.some((/**
1819
- * @param {?} item
1820
- * @return {?}
1821
- */
1822
- function (item) { return item.name === key; }))) {
1823
- acc[key] = value ? value.toString().toLowerCase() : '';
1814
+ function (data) {
1815
+ var e_2, _a;
1816
+ try {
1817
+ for (var _b = __values(_this.formLines), _c = _b.next(); !_c.done; _c = _b.next()) {
1818
+ var item = _c.value;
1819
+ /** @type {?} */
1820
+ var value = data[item.name] ? data[item.name].toString().toLowerCase() : '';
1821
+ if (value.includes(filterValue)) {
1822
+ return true;
1823
+ }
1824
+ }
1824
1825
  }
1825
- return Object.values(acc).map((/**
1826
- * @param {?} value
1826
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1827
+ finally {
1828
+ try {
1829
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1830
+ }
1831
+ finally { if (e_2) throw e_2.error; }
1832
+ }
1833
+ return false;
1834
+ }));
1835
+ // 如果没有匹配的数据,则显示空白表单行
1836
+ if (filteredData.length === 0) {
1837
+ _this.tableLoading = false;
1838
+ }
1839
+ else {
1840
+ _this.validateHdFormLines = _this.fb.group({
1841
+ 'lines': _this.fb.array([])
1842
+ });
1843
+ // 在这里把formlinesData里面匹配到的filteredData数据排序到最前面
1844
+ /** @type {?} */
1845
+ var sortedData = [];
1846
+ try {
1847
+ for (var _b = __values(_this.formLinesData), _c = _b.next(); !_c.done; _c = _b.next()) {
1848
+ var item = _c.value;
1849
+ if (filteredData.includes(item)) {
1850
+ sortedData.unshift(item);
1851
+ }
1852
+ else {
1853
+ sortedData.push(item);
1854
+ }
1855
+ }
1856
+ }
1857
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1858
+ finally {
1859
+ try {
1860
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1861
+ }
1862
+ finally { if (e_1) throw e_1.error; }
1863
+ }
1864
+ _this.formLinesData = sortedData;
1865
+ _this.init();
1866
+ setTimeout((/**
1827
1867
  * @return {?}
1828
1868
  */
1829
- function (value) { return value ? value.toString().toLowerCase() : ''; }));
1830
- }), {});
1831
- return values.some((/**
1832
- * @param {?} val
1833
- * @return {?}
1834
- */
1835
- function (val) { return val.includes(filterValue); }));
1836
- }));
1837
- // 如果没有匹配的数据,则显示空白表单行
1838
- if (filteredData.length === 0) {
1839
- this.hideForm();
1840
- this.addFormLine();
1841
- }
1842
- else {
1843
- this.hideForm();
1844
- this.addExistingFormLines(filteredData);
1845
- }
1846
- };
1847
- /**
1848
- * @return {?}
1849
- */
1850
- HdFormLinesComponent.prototype.hideForm = /**
1851
- * @return {?}
1852
- */
1853
- function () {
1854
- // 隐藏所有表单行
1855
- for (var i = 0; i < this.linesFormArray.controls.length; i++) {
1856
- this.linesFormArray.controls[i].get('hide').setValue(true);
1857
- }
1858
- };
1859
- /**
1860
- * @param {?} filteredData
1861
- * @return {?}
1862
- */
1863
- HdFormLinesComponent.prototype.addExistingFormLines = /**
1864
- * @param {?} filteredData
1865
- * @return {?}
1866
- */
1867
- function (filteredData) {
1868
- var _this = this;
1869
- // 显示匹配的数据行
1870
- filteredData.forEach((/**
1871
- * @param {?} formLinesDataItem
1872
- * @return {?}
1873
- */
1874
- function (formLinesDataItem) {
1875
- /** @type {?} */
1876
- var index = _this.formLinesData.findIndex((/**
1877
- * @param {?} data
1878
- * @return {?}
1879
- */
1880
- function (data) { return data === formLinesDataItem; }));
1881
- _this.linesFormArray.controls[index].get('hide').setValue(false);
1882
- }));
1869
+ function () {
1870
+ _this.tableLoading = false;
1871
+ }), 0);
1872
+ }
1873
+ }), 10);
1883
1874
  };
1884
1875
  /**
1885
1876
  * @param {?} line