fantasy-ngzorro 1.0.41 → 1.0.43
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/bundles/fantasy-ngzorro.umd.js +69 -74
- package/bundles/fantasy-ngzorro.umd.js.map +1 -1
- package/bundles/fantasy-ngzorro.umd.min.js +1 -1
- package/bundles/fantasy-ngzorro.umd.min.js.map +1 -1
- package/esm2015/hd-form-lines/hd-form-lines.component.js +50 -58
- package/esm5/hd-form-lines/hd-form-lines.component.js +70 -75
- package/fantasy-ngzorro.metadata.json +1 -1
- package/fesm2015/fantasy-ngzorro.js +49 -57
- package/fesm2015/fantasy-ngzorro.js.map +1 -1
- package/fesm5/fantasy-ngzorro.js +69 -74
- package/fesm5/fantasy-ngzorro.js.map +1 -1
- package/hd-form-lines/hd-form-lines.component.d.ts +0 -2
- package/package.json +1 -1
|
@@ -1793,89 +1793,84 @@
|
|
|
1793
1793
|
function () {
|
|
1794
1794
|
var _this = this;
|
|
1795
1795
|
this.tableLoading = true;
|
|
1796
|
-
/**
|
|
1797
|
-
var filterValue = this.filterStr.trim().toLowerCase();
|
|
1798
|
-
// 如果没有输入搜索字符串,则显示所有数据
|
|
1799
|
-
if (!filterValue) {
|
|
1800
|
-
this.hideForm();
|
|
1801
|
-
this.addExistingFormLines(this.formLinesData);
|
|
1802
|
-
this.tableLoading = false;
|
|
1803
|
-
return;
|
|
1804
|
-
}
|
|
1805
|
-
// 根据搜索字符串过滤数据
|
|
1806
|
-
/** @type {?} */
|
|
1807
|
-
var filteredData = this.formLinesData.filter((/**
|
|
1808
|
-
* @param {?} data
|
|
1796
|
+
setTimeout((/**
|
|
1809
1797
|
* @return {?}
|
|
1810
1798
|
*/
|
|
1811
|
-
function (
|
|
1799
|
+
function () {
|
|
1812
1800
|
var e_1, _a;
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1801
|
+
/** @type {?} */
|
|
1802
|
+
var filterValue = _this.filterStr.trim().toLowerCase();
|
|
1803
|
+
// 如果没有输入搜索字符串或者没有数据,则显示所有数据
|
|
1804
|
+
if (!filterValue || !_this.formLinesData || _this.formLinesData.length === 0) {
|
|
1805
|
+
_this.tableLoading = false;
|
|
1806
|
+
return;
|
|
1807
|
+
}
|
|
1808
|
+
// 根据搜索字符串过滤数据
|
|
1809
|
+
/** @type {?} */
|
|
1810
|
+
var filteredData = _this.formLinesData.filter((/**
|
|
1811
|
+
* @param {?} data
|
|
1812
|
+
* @return {?}
|
|
1813
|
+
*/
|
|
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
|
+
}
|
|
1825
|
+
}
|
|
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);
|
|
1820
1830
|
}
|
|
1831
|
+
finally { if (e_2) throw e_2.error; }
|
|
1821
1832
|
}
|
|
1833
|
+
return false;
|
|
1834
|
+
}));
|
|
1835
|
+
// 如果没有匹配的数据,则显示空白表单行
|
|
1836
|
+
if (filteredData.length === 0) {
|
|
1837
|
+
_this.tableLoading = false;
|
|
1822
1838
|
}
|
|
1823
|
-
|
|
1824
|
-
|
|
1839
|
+
else {
|
|
1840
|
+
_this.validateHdFormLines = _this.fb.group({
|
|
1841
|
+
'lines': _this.fb.array([])
|
|
1842
|
+
});
|
|
1843
|
+
// 在这里把formlinesData里面匹配到的filteredData数据排序到最前面
|
|
1844
|
+
/** @type {?} */
|
|
1845
|
+
var sortedData = [];
|
|
1825
1846
|
try {
|
|
1826
|
-
|
|
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; }
|
|
1827
1863
|
}
|
|
1828
|
-
|
|
1864
|
+
_this.formLinesData = sortedData;
|
|
1865
|
+
_this.init();
|
|
1866
|
+
setTimeout((/**
|
|
1867
|
+
* @return {?}
|
|
1868
|
+
*/
|
|
1869
|
+
function () {
|
|
1870
|
+
_this.tableLoading = false;
|
|
1871
|
+
}), 0);
|
|
1829
1872
|
}
|
|
1830
|
-
|
|
1831
|
-
}));
|
|
1832
|
-
// 如果没有匹配的数据,则显示空白表单行
|
|
1833
|
-
if (filteredData.length === 0) {
|
|
1834
|
-
this.hideForm();
|
|
1835
|
-
this.addFormLine();
|
|
1836
|
-
}
|
|
1837
|
-
else {
|
|
1838
|
-
this.hideForm();
|
|
1839
|
-
this.addExistingFormLines(filteredData);
|
|
1840
|
-
}
|
|
1841
|
-
this.tableLoading = false;
|
|
1842
|
-
};
|
|
1843
|
-
/**
|
|
1844
|
-
* @return {?}
|
|
1845
|
-
*/
|
|
1846
|
-
HdFormLinesComponent.prototype.hideForm = /**
|
|
1847
|
-
* @return {?}
|
|
1848
|
-
*/
|
|
1849
|
-
function () {
|
|
1850
|
-
// 隐藏所有表单行
|
|
1851
|
-
for (var i = 0; i < this.linesFormArray.controls.length; i++) {
|
|
1852
|
-
this.linesFormArray.controls[i].get('hide').setValue(true);
|
|
1853
|
-
}
|
|
1854
|
-
};
|
|
1855
|
-
/**
|
|
1856
|
-
* @param {?} filteredData
|
|
1857
|
-
* @return {?}
|
|
1858
|
-
*/
|
|
1859
|
-
HdFormLinesComponent.prototype.addExistingFormLines = /**
|
|
1860
|
-
* @param {?} filteredData
|
|
1861
|
-
* @return {?}
|
|
1862
|
-
*/
|
|
1863
|
-
function (filteredData) {
|
|
1864
|
-
var _this = this;
|
|
1865
|
-
// 显示匹配的数据行
|
|
1866
|
-
filteredData.forEach((/**
|
|
1867
|
-
* @param {?} formLinesDataItem
|
|
1868
|
-
* @return {?}
|
|
1869
|
-
*/
|
|
1870
|
-
function (formLinesDataItem) {
|
|
1871
|
-
/** @type {?} */
|
|
1872
|
-
var index = _this.formLinesData.findIndex((/**
|
|
1873
|
-
* @param {?} data
|
|
1874
|
-
* @return {?}
|
|
1875
|
-
*/
|
|
1876
|
-
function (data) { return data === formLinesDataItem; }));
|
|
1877
|
-
_this.linesFormArray.controls[index].get('hide').setValue(false);
|
|
1878
|
-
}));
|
|
1873
|
+
}), 10);
|
|
1879
1874
|
};
|
|
1880
1875
|
/**
|
|
1881
1876
|
* @param {?} line
|