fantasy-ngzorro 1.0.43 → 1.0.45

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.
@@ -1738,6 +1738,7 @@
1738
1738
  this.fb = fb;
1739
1739
  this.ngZone = ngZone;
1740
1740
  this.tableLoading = false;
1741
+ this.showSearch = false;
1741
1742
  this.operateButtons = ['add', 'delete'];
1742
1743
  this.scroll = { x: '1px' };
1743
1744
  this.changeEvent = new core.EventEmitter();
@@ -1750,6 +1751,11 @@
1750
1751
  this.columnsNumber = 0;
1751
1752
  this.totalOptionList = [];
1752
1753
  this.showForm = false;
1754
+ this.storeFormLinesData = []; // 缓存的总的表单数据
1755
+ // 缓存的总的表单数据
1756
+ this.filterStoreFormLinesData = []; // 筛选出来的数据列表
1757
+ // 筛选出来的数据列表
1758
+ this.filterIndexStore = []; // 筛选出来的数据在原始列表中的下标
1753
1759
  }
1754
1760
  /**
1755
1761
  * @return {?}
@@ -1758,6 +1764,8 @@
1758
1764
  * @return {?}
1759
1765
  */
1760
1766
  function () {
1767
+ // 缓存一下总的表单数据
1768
+ this.storeFormLinesData = this.formLinesData;
1761
1769
  this.init();
1762
1770
  };
1763
1771
  Object.defineProperty(HdFormLinesComponent.prototype, "linesFormArray", {
@@ -1780,6 +1788,94 @@
1780
1788
  enumerable: true,
1781
1789
  configurable: true
1782
1790
  });
1791
+ // 暴露的方法,用于获取所有数据的valid状态
1792
+ // 暴露的方法,用于获取所有数据的valid状态
1793
+ /**
1794
+ * @return {?}
1795
+ */
1796
+ HdFormLinesComponent.prototype.getValid =
1797
+ // 暴露的方法,用于获取所有数据的valid状态
1798
+ /**
1799
+ * @return {?}
1800
+ */
1801
+ function () {
1802
+ var _this = this;
1803
+ /** @type {?} */
1804
+ var tmpValidateHdFormLines = this.fb.group({
1805
+ 'lines': this.fb.array([])
1806
+ });
1807
+ this.storeFormLinesData.forEach((/**
1808
+ * @param {?} formLinesDataItem
1809
+ * @return {?}
1810
+ */
1811
+ function (formLinesDataItem) {
1812
+ /** @type {?} */
1813
+ var formGroupObj = {};
1814
+ _this.formLines.forEach((/**
1815
+ * @param {?} item
1816
+ * @return {?}
1817
+ */
1818
+ function (item) {
1819
+ // 新增行 初始数据都为null
1820
+ formGroupObj[item.name] = _this.fb.control({ value: formLinesDataItem[item.name] === 0 ? 0 : (formLinesDataItem[item.name] || item.value || null), disabled: item.disabled }, item.require ? [forms.Validators.required] : []);
1821
+ if (item.selectOption && item.selectOption.label) {
1822
+ formGroupObj[item.selectOption.label] = _this.fb.control(formLinesDataItem[item.selectOption.label] || null, []);
1823
+ }
1824
+ }));
1825
+ formGroupObj.lineIndex = _this.fb.control(((/** @type {?} */ (tmpValidateHdFormLines.get('lines')))).controls.length, []);
1826
+ /** @type {?} */
1827
+ var formGroupTmp = _this.fb.group(formGroupObj);
1828
+ _this.formLines.forEach((/**
1829
+ * @param {?} item
1830
+ * @return {?}
1831
+ */
1832
+ function (item) {
1833
+ if (item.onChangeEvent) {
1834
+ formGroupTmp.get(item.name).valueChanges.subscribe((/**
1835
+ * @param {?} value
1836
+ * @return {?}
1837
+ */
1838
+ function (value) { return _this.triggerEvent(item.onChangeEvent, value, formGroupTmp); }));
1839
+ }
1840
+ }));
1841
+ ((/** @type {?} */ (tmpValidateHdFormLines.get('lines')))).insert(((/** @type {?} */ (tmpValidateHdFormLines.get('lines')))).controls.length, formGroupTmp);
1842
+ }));
1843
+ return tmpValidateHdFormLines.valid;
1844
+ };
1845
+ // 暴露的方法,用于获取所有数据
1846
+ // 暴露的方法,用于获取所有数据
1847
+ /**
1848
+ * @return {?}
1849
+ */
1850
+ HdFormLinesComponent.prototype.getLines =
1851
+ // 暴露的方法,用于获取所有数据
1852
+ /**
1853
+ * @return {?}
1854
+ */
1855
+ function () {
1856
+ var _this = this;
1857
+ /** @type {?} */
1858
+ var allLines = [];
1859
+ this.storeFormLinesData.forEach((/**
1860
+ * @param {?} formLinesDataItem
1861
+ * @return {?}
1862
+ */
1863
+ function (formLinesDataItem) {
1864
+ /** @type {?} */
1865
+ var formGroupObj = {};
1866
+ _this.formLines.forEach((/**
1867
+ * @param {?} item
1868
+ * @return {?}
1869
+ */
1870
+ function (item) {
1871
+ // 新增行 初始数据都为null
1872
+ formGroupObj[item.name] = formLinesDataItem[item.name];
1873
+ }));
1874
+ formGroupObj.lineIndex = formLinesDataItem.lineIndex;
1875
+ allLines.push(formGroupObj);
1876
+ }));
1877
+ return allLines;
1878
+ };
1783
1879
  // 全局性的搜索(涵盖页面上所有的可视文字)
1784
1880
  // 全局性的搜索(涵盖页面上所有的可视文字)
1785
1881
  /**
@@ -1793,84 +1889,77 @@
1793
1889
  function () {
1794
1890
  var _this = this;
1795
1891
  this.tableLoading = true;
1796
- setTimeout((/**
1892
+ /** @type {?} */
1893
+ var filterValue = this.filterStr.trim().toLowerCase();
1894
+ // 如果没有输入搜索字符串,则显示缓存内的所有数据
1895
+ if (!filterValue) {
1896
+ this.setStoreData();
1897
+ return;
1898
+ }
1899
+ this.filterIndexStore = [];
1900
+ // 根据搜索字符串过滤数据
1901
+ /** @type {?} */
1902
+ var filteredData = this.storeFormLinesData.filter((/**
1903
+ * @param {?} data
1904
+ * @param {?} index
1797
1905
  * @return {?}
1798
1906
  */
1799
- function () {
1907
+ function (data, index) {
1800
1908
  var e_1, _a;
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
- }
1909
+ try {
1910
+ for (var _b = __values(_this.formLines), _c = _b.next(); !_c.done; _c = _b.next()) {
1911
+ var item = _c.value;
1912
+ /** @type {?} */
1913
+ var value = data[item.name] ? data[item.name].toString().toLowerCase() : '';
1914
+ if (value.includes(filterValue)) {
1915
+ _this.filterIndexStore.push(index);
1916
+ return true;
1824
1917
  }
1825
1918
  }
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
1919
  }
1839
- else {
1840
- _this.validateHdFormLines = _this.fb.group({
1841
- 'lines': _this.fb.array([])
1842
- });
1843
- // 在这里把formlinesData里面匹配到的filteredData数据排序到最前面
1844
- /** @type {?} */
1845
- var sortedData = [];
1920
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1921
+ finally {
1846
1922
  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
- }
1923
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1856
1924
  }
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((/**
1867
- * @return {?}
1868
- */
1869
- function () {
1870
- _this.tableLoading = false;
1871
- }), 0);
1925
+ finally { if (e_1) throw e_1.error; }
1872
1926
  }
1873
- }), 10);
1927
+ return false;
1928
+ }));
1929
+ // 如果没有匹配的数据,则显示空白表单行
1930
+ if (filteredData.length === 0) {
1931
+ this.setStoreData();
1932
+ }
1933
+ else {
1934
+ // 缓存一下筛选后的表单数据
1935
+ this.filterStoreFormLinesData = filteredData;
1936
+ // 处理筛选好的数据 然后重新渲染
1937
+ this.formLinesData = filteredData;
1938
+ this.init();
1939
+ setTimeout((/**
1940
+ * @return {?}
1941
+ */
1942
+ function () {
1943
+ _this.tableLoading = false;
1944
+ }), 0);
1945
+ }
1946
+ };
1947
+ /**
1948
+ * @return {?}
1949
+ */
1950
+ HdFormLinesComponent.prototype.setStoreData = /**
1951
+ * @return {?}
1952
+ */
1953
+ function () {
1954
+ var _this = this;
1955
+ this.formLinesData = this.storeFormLinesData;
1956
+ this.init();
1957
+ setTimeout((/**
1958
+ * @return {?}
1959
+ */
1960
+ function () {
1961
+ _this.tableLoading = false;
1962
+ }), 0);
1874
1963
  };
1875
1964
  /**
1876
1965
  * @param {?} line
@@ -2015,7 +2104,6 @@
2015
2104
  formGroupObj[item.name] = _this.fb.control({ value: item.value, disabled: item.disabled } || null, item.require && !item.hide ? [forms.Validators.required] : []);
2016
2105
  }));
2017
2106
  formGroupObj.lineIndex = this.fb.control(this.linesFormArray.controls.length, []);
2018
- formGroupObj.hide = this.fb.control(false, []);
2019
2107
  /** @type {?} */
2020
2108
  var formGroupSubmit = this.fb.group(formGroupObj);
2021
2109
  this.formLines.forEach((/**
@@ -2085,7 +2173,6 @@
2085
2173
  }
2086
2174
  }));
2087
2175
  formGroupObj.lineIndex = _this.fb.control(_this.linesFormArray.controls.length, []);
2088
- formGroupObj.hide = _this.fb.control(false, []);
2089
2176
  /** @type {?} */
2090
2177
  var formGroupTmp = _this.fb.group(formGroupObj);
2091
2178
  _this.formLines.forEach((/**
@@ -2196,6 +2283,31 @@
2196
2283
  * @return {?}
2197
2284
  */
2198
2285
  function (data) {
2286
+ var _this = this;
2287
+ if (data && data.lines && data.lines.length > 0) {
2288
+ /** @type {?} */
2289
+ var lines_1 = data.lines;
2290
+ if (lines_1.length === this.storeFormLinesData.length) {
2291
+ lines_1.forEach((/**
2292
+ * @param {?} item
2293
+ * @param {?} index
2294
+ * @return {?}
2295
+ */
2296
+ function (item, index) {
2297
+ _this.storeFormLinesData[index] = __assign({}, _this.storeFormLinesData[index], item);
2298
+ }));
2299
+ }
2300
+ else {
2301
+ this.filterIndexStore.forEach((/**
2302
+ * @param {?} item
2303
+ * @param {?} index
2304
+ * @return {?}
2305
+ */
2306
+ function (item, index) {
2307
+ _this.storeFormLinesData[item] = __assign({}, _this.filterStoreFormLinesData[index], lines_1[index]);
2308
+ }));
2309
+ }
2310
+ }
2199
2311
  this.calculateLineNumber();
2200
2312
  this.changeEvent.emit(this.validateHdFormLines);
2201
2313
  };
@@ -2302,7 +2414,7 @@
2302
2414
  HdFormLinesComponent.decorators = [
2303
2415
  { type: core.Component, args: [{
2304
2416
  selector: 'hd-form-lines',
2305
- template: "<hd-button-group *ngIf=\"showForm\">\n <ng-template #buttonGroupLeft>\n <nz-input-group [nzSuffix]=\"suffixIconSearch\">\n <input type=\"text\" nz-input (keyup.enter)=\"searchLines()\" placeholder=\"\u8BF7\u8F93\u5165\u5185\u5BB9\u641C\u7D22\" style=\"width: 300px;\"\n [(ngModel)]=\"filterStr\" />\n </nz-input-group>\n <ng-template #suffixIconSearch>\n <i nz-icon nzType=\"search\" (click)=\"searchLines()\"></i>\n </ng-template>\n </ng-template>\n</hd-button-group>\n<hd-space background=\"transparent\" type=\"row\" size=\"16\"></hd-space>\n<form *ngIf=\"showForm\" nz-form [formGroup]=\"validateHdFormLines\"\n class=\"ant-advanced-search-form hd-formLines-container\">\n <nz-table nzTemplateMode [nzFrontPagination]=\"false\" [nzLoading]=\"tableLoading\" [nzScroll]=\"scroll\">\n <thead>\n <tr>\n <th nzWidth=\"58px\" nzLeft=\"0px\">\u5E8F\u53F7</th>\n <ng-container *ngFor=\"let item of formLines\">\n <th *ngIf=\"!item.hide\" [nzAlign]=\"item.align ? item.align : 'left'\">\n <span *ngIf=\"item.require\" style=\"color: red;\">*</span>{{item.label}}\n </th>\n </ng-container>\n <th style=\"width: 80px\" nzRight=\"0\">\u64CD\u4F5C</th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngFor=\"let line of linesFormArray.controls.slice((paginationPageIndex - 1) * paginationPageSize, (paginationPageIndex - 1) * paginationPageSize + paginationPageSize);index as dataIndex\"\n formArrayName=\"lines\">\n <tr [formGroup]=\"line\" *ngIf=\"!line.get('hide').value\">\n <td nzWidth=\"58px\" nzLeft=\"0px\">\n {{line.get('lineIndex').value}}\n </td>\n <ng-container *ngFor=\"let formItem of formLines\">\n <td *ngIf=\"!formItem.hide\" [nzAlign]=\"formItem.align ? formItem.align : 'left'\">\n <nz-form-item>\n <nz-form-control [nzErrorTip]=\"formItem.label + '\u4E0D\u80FD\u4E3A\u7A7A'\">\n <ng-container [ngSwitch]=\"formItem.type\">\n <ng-container *ngSwitchCase=\"0\">\n <nz-input-group [nzSuffix]=\"inputCleanTemplate\">\n <input [ngStyle]=\"getStyle(line, formItem, '100px')\" nz-input\n [ngStyle]=\"{'color': formItem?.colorOption?.name ? line.get(formItem.colorOption.name ).value : null}\"\n [id]=\"'input-' + formItem.name + line.get('lineIndex').value\"\n (click)=\"formItem.isSelect ? selectValue('#input-' + formItem.name + line.get('lineIndex').value) : null\"\n [maxlength]=\"formItem.maxLength || null\"\n [placeholder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u8F93\u5165' + formItem.label\"\n [formControlName]=\"formItem.name\" />\n </nz-input-group>\n <ng-template #inputCleanTemplate>\n <i nz-icon nz-tooltip class=\"ant-input-clear-icon\" nzTheme=\"fill\" nzType=\"close-circle\"\n *ngIf=\"line.get(formItem.name).value && !line.get(formItem.name).disabled\"\n (click)=\"inputClean(formItem ,line)\"></i>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"1\">\n <nz-select nzShowSearch [nzServerSearch]=\"formItem.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"formItem.selectOption.hdDropdownMatchSelectWidth ? formItem.selectOption.hdDropdownMatchSelectWidth : false\"\n nzAllowClear\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\"\n (nzOnSearch)=\"triggerEvent(formItem.onSearchEvent || null, $event, line)\"\n [ngStyle]=\"getStyle(line, formItem, '200px')\">\n <nz-option\n *ngFor=\"let selectItem of (formItem.selectOption.selectList || line.get(formItem.selectOption.selectListName).value)\"\n [nzValue]=\"selectItem[formItem.selectOption.value]\" [nzLabel]=\"formItem.selectOption.showLabelAndValue ? '['+ selectItem[formItem.selectOption.value] +']' +\n selectItem[formItem.selectOption.label] : selectItem[formItem.selectOption.label]\">\n </nz-option>\n <nz-option\n *ngIf=\"formItem.selectOption.label && line.get(formItem.name) && line.get(formItem.selectOption.label)?.value && line.get(formItem.selectOption.value)?.value\"\n [nzLabel]=\"(formItem.selectOption.value === 'code' || formItem.selectOption.value === 'productCode' || formItem.selectOption.hdShowItemCode) ? ('['+ line.get(formItem.selectOption.value).value + ']' + line.get(formItem.selectOption.label).value) : line.get(formItem.selectOption.label).value\"\n [nzValue]=\"line.get(formItem.selectOption.value).value\" nzHide></nz-option>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"2\">\n <nz-date-picker *ngIf=\"formItem.showTime\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\" [nzDisabledDate]=\"formItem.hdDisabledDate\" nzShowTime\n nzFormat=\"yyyy-MM-dd HH:mm:ss\">\n </nz-date-picker>\n <nz-date-picker *ngIf=\"!formItem.showTime\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\" [nzDisabledDate]=\"formItem.hdDisabledDate\">\n </nz-date-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"3\">\n <nz-range-picker [nzPlaceHolder]=\"['\u5F00\u59CB\u65E5\u671F','\u7ED3\u675F\u65E5\u671F']\" [formControlName]=\"formItem.name\">\n </nz-range-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"4\">\n <textarea\n [ngStyle]=\"{'color': formItem?.colorOption?.name ? line.get(formItem.colorOption.name).value : null}\"\n [placeholder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u8F93\u5165' + formItem.label\"\n [maxlength]=\"formItem.maxLength || null\" rows=\"4\" nz-input\n [maxlength]=\"formItem.maxLength || null\" [formControlName]=\"formItem.name\"></textarea>\n </ng-container>\n <ng-container *ngSwitchCase=\"5\">\n <div style=\"display: flex;align-items: center;\">\n <nz-input-number [ngStyle]=\"getStyle(line, formItem, '100px')\"\n [maxlength]=\"formItem.maxLength || null\" [formControlName]=\"formItem.name\"\n [nzMin]=\"formItem?.inputNumber?.min || 0\" [nzMax]=\"formItem?.inputNumber?.max || 99999999\"\n [nzStep]=\"formItem?.inputNumber?.step || 1\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u8F93\u5165' + formItem.label\"\n [nzId]=\"'inputNumber-' + formItem.name + line.get('lineIndex').value\"\n (click)=\"formItem.isSelect ? selectValue('#inputNumber-' + formItem.name + line.get('lineIndex').value) : null\">\n </nz-input-number>\n <div *ngIf=\"formItem?.explainOptionRight?.show\"\n [style.color]=\"formItem?.explainOptionRight?.color ? formItem.explainOptionRight.color : null\">\n &nbsp;&nbsp;{{line.get(formItem.explainOptionRight.name).value}}</div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"6\">\n <nz-select nzMode=\"multiple\" [nzServerSearch]=\"formItem.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"formItem.selectOption.hdDropdownMatchSelectWidth ? formItem.selectOption.hdDropdownMatchSelectWidth : false\"\n nzShowSearch nzAllowClear\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\" [ngStyle]=\"getStyle(line, formItem, '200px')\"\n (nzOnSearch)=\"triggerEvent(formItem.onSearchEvent || null, $event, line)\">\n <nz-option *ngFor=\"let selectItem of formItem.selectOption.selectList\"\n [nzValue]=\"selectItem[formItem.selectOption.value]\" [nzLabel]=\"formItem.selectOption.showLabelAndValue ? '['+ selectItem[formItem.selectOption.value] +']' +\n selectItem[formItem.selectOption.label] : selectItem[formItem.selectOption.label]\"></nz-option>\n <ng-container\n *ngIf=\"formItem.selectOption.label && line.get(formItem.name) && line.get(formItem.selectOption.label)?.value && line.get(formItem.selectOption.value)?.value\">\n <nz-option *ngFor=\"let option of line.get(formItem.selectOption.value).value;index as i\"\n [nzLabel]=\"line.get(formItem.selectOption.label).value[i]\" [nzValue]=\"option\" nzHide>\n </nz-option>\n </ng-container>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"7\">\n {{(formItem.preserveNumber && line.get(formItem.name).value) ?\n LodashRound(line.get(formItem.name).value,formItem.preserveNumber).toFixed(formItem.preserveNumber)\n : line.get(formItem.name).value}}\n </ng-container>\n <ng-container *ngSwitchCase=\"8\">\n <nz-switch [formControlName]=\"formItem.name\"></nz-switch>\n </ng-container>\n <ng-container *ngSwitchCase=\"9\">\n <nz-time-picker [formControlName]=\"formItem.name\"></nz-time-picker>\n </ng-container>\n </ng-container>\n </nz-form-control>\n </nz-form-item>\n <div *ngIf=\"formItem?.explainOption?.show\"\n [style.color]=\"formItem?.explainOption?.color ? formItem.explainOption.color : null\">\n {{line.get(formItem.explainOption.name).value}}</div>\n </td>\n </ng-container>\n <td style=\"width: 80px\" nzRight=\"0\">\n <span class=\"common-btn-group\">\n <a *ngIf=\"operateButtons.includes('add')\" (click)=\"addFormLine(line.get('lineIndex').value)\">\u6DFB\u52A0</a>\n <a class=\"common-danger-btn\" *ngIf=\"operateButtons.includes('delete') && !showDeleteConfirm\"\n (click)=\"deleteFormLine(line.get('lineIndex').value)\">\u5220\u9664</a>\n <a class=\"common-danger-btn\" *ngIf=\"operateButtons.includes('delete') && showDeleteConfirm\" nz-popconfirm\n nzPopconfirmTitle=\"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u884C\u5417?\" nzPopconfirmPlacement=\"bottom\"\n (nzOnConfirm)=\"deleteFormLine(line.get('lineIndex').value)\">\u5220\u9664</a>\n </span>\n </td>\n </tr>\n </ng-container>\n <!-- \u5408\u8BA1\u533A\u57DF -->\n <tr *ngIf=\"showTotal\" class=\"hd-table-total\">\n <td>\u5408\u8BA1</td>\n <ng-container *ngFor=\"let totalOption of totalOptionList\">\n <td [nzAlign]=\"totalOption.align ? totalOption.align : 'left'\">{{ (totalOption.value || totalOption.value ===\n 0) ? (((totalOption.value % 1 === 0) && !totalOption.showDecimal ) ? totalOption.value :\n LodashRound(totalOption.value,2).toFixed(2)) : '' }} </td>\n </ng-container>\n </tr>\n </tbody>\n </nz-table>\n <ng-container *ngIf=\"linesFormArray.controls.length > 10\">\n <hd-space background=\"transparent\" type=\"row\" size=\"16\"></hd-space>\n <nz-pagination [nzSize]=\"'small'\" style=\"text-align: right;\" [nzPageIndex]=\"paginationPageIndex\"\n [nzPageSize]=\"paginationPageSize\" [nzPageSizeOptions]=\"[10, 20, 30, 40, 50, 100, 200]\"\n [nzTotal]=\"linesFormArray.controls.length\" nzShowSizeChanger (nzPageIndexChange)=\"pageIndexChange($event)\"\n (nzPageSizeChange)=\"pageSizeChange($event)\" [nzShowTotal]=\"totalTemplate\"></nz-pagination>\n <ng-template #totalTemplate let-total>\u5171 {{linesFormArray.controls.length}} \u6761\u6570\u636E</ng-template>\n </ng-container>\n</form>",
2417
+ template: "<hd-button-group *ngIf=\"showForm && showSearch\">\n <ng-template #buttonGroupLeft>\n <nz-input-group [nzSuffix]=\"suffixIconSearch\">\n <input type=\"text\" nz-input (keyup.enter)=\"searchLines()\" placeholder=\"\u8BF7\u8F93\u5165\u5185\u5BB9\u641C\u7D22\" style=\"width: 300px;\"\n [(ngModel)]=\"filterStr\" />\n </nz-input-group>\n <ng-template #suffixIconSearch>\n <i nz-icon nzType=\"search\" (click)=\"searchLines()\"></i>\n </ng-template>\n </ng-template>\n</hd-button-group>\n<hd-space background=\"transparent\" type=\"row\" size=\"16\"></hd-space>\n<form *ngIf=\"showForm\" nz-form [formGroup]=\"validateHdFormLines\"\n class=\"ant-advanced-search-form hd-formLines-container\">\n <nz-table nzTemplateMode [nzFrontPagination]=\"false\" [nzLoading]=\"tableLoading\" [nzScroll]=\"scroll\">\n <thead>\n <tr>\n <th nzWidth=\"58px\" nzLeft=\"0px\">\u5E8F\u53F7</th>\n <ng-container *ngFor=\"let item of formLines\">\n <th *ngIf=\"!item.hide\" [nzAlign]=\"item.align ? item.align : 'left'\">\n <span *ngIf=\"item.require\" style=\"color: red;\">*</span>{{item.label}}\n </th>\n </ng-container>\n <th style=\"width: 80px\" nzRight=\"0\">\u64CD\u4F5C</th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngFor=\"let line of linesFormArray.controls.slice((paginationPageIndex - 1) * paginationPageSize, (paginationPageIndex - 1) * paginationPageSize + paginationPageSize);index as dataIndex\"\n formArrayName=\"lines\">\n <tr [formGroup]=\"line\">\n <td nzWidth=\"58px\" nzLeft=\"0px\">\n {{line.get('lineIndex').value}}\n </td>\n <ng-container *ngFor=\"let formItem of formLines\">\n <td *ngIf=\"!formItem.hide\" [nzAlign]=\"formItem.align ? formItem.align : 'left'\">\n <nz-form-item>\n <nz-form-control [nzErrorTip]=\"formItem.label + '\u4E0D\u80FD\u4E3A\u7A7A'\">\n <ng-container [ngSwitch]=\"formItem.type\">\n <ng-container *ngSwitchCase=\"0\">\n <nz-input-group [nzSuffix]=\"inputCleanTemplate\">\n <input [ngStyle]=\"getStyle(line, formItem, '100px')\" nz-input\n [ngStyle]=\"{'color': formItem?.colorOption?.name ? line.get(formItem.colorOption.name ).value : null}\"\n [id]=\"'input-' + formItem.name + line.get('lineIndex').value\"\n (click)=\"formItem.isSelect ? selectValue('#input-' + formItem.name + line.get('lineIndex').value) : null\"\n [maxlength]=\"formItem.maxLength || null\"\n [placeholder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u8F93\u5165' + formItem.label\"\n [formControlName]=\"formItem.name\" />\n </nz-input-group>\n <ng-template #inputCleanTemplate>\n <i nz-icon nz-tooltip class=\"ant-input-clear-icon\" nzTheme=\"fill\" nzType=\"close-circle\"\n *ngIf=\"line.get(formItem.name).value && !line.get(formItem.name).disabled\"\n (click)=\"inputClean(formItem ,line)\"></i>\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"1\">\n <nz-select nzShowSearch [nzServerSearch]=\"formItem.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"formItem.selectOption.hdDropdownMatchSelectWidth ? formItem.selectOption.hdDropdownMatchSelectWidth : false\"\n nzAllowClear\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\"\n (nzOnSearch)=\"triggerEvent(formItem.onSearchEvent || null, $event, line)\"\n [ngStyle]=\"getStyle(line, formItem, '200px')\">\n <nz-option\n *ngFor=\"let selectItem of (formItem.selectOption.selectList || line.get(formItem.selectOption.selectListName).value)\"\n [nzValue]=\"selectItem[formItem.selectOption.value]\" [nzLabel]=\"formItem.selectOption.showLabelAndValue ? '['+ selectItem[formItem.selectOption.value] +']' +\n selectItem[formItem.selectOption.label] : selectItem[formItem.selectOption.label]\">\n </nz-option>\n <nz-option\n *ngIf=\"formItem.selectOption.label && line.get(formItem.name) && line.get(formItem.selectOption.label)?.value && line.get(formItem.selectOption.value)?.value\"\n [nzLabel]=\"(formItem.selectOption.value === 'code' || formItem.selectOption.value === 'productCode' || formItem.selectOption.hdShowItemCode) ? ('['+ line.get(formItem.selectOption.value).value + ']' + line.get(formItem.selectOption.label).value) : line.get(formItem.selectOption.label).value\"\n [nzValue]=\"line.get(formItem.selectOption.value).value\" nzHide></nz-option>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"2\">\n <nz-date-picker *ngIf=\"formItem.showTime\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\" [nzDisabledDate]=\"formItem.hdDisabledDate\" nzShowTime\n nzFormat=\"yyyy-MM-dd HH:mm:ss\">\n </nz-date-picker>\n <nz-date-picker *ngIf=\"!formItem.showTime\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\" [nzDisabledDate]=\"formItem.hdDisabledDate\">\n </nz-date-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"3\">\n <nz-range-picker [nzPlaceHolder]=\"['\u5F00\u59CB\u65E5\u671F','\u7ED3\u675F\u65E5\u671F']\" [formControlName]=\"formItem.name\">\n </nz-range-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"4\">\n <textarea\n [ngStyle]=\"{'color': formItem?.colorOption?.name ? line.get(formItem.colorOption.name).value : null}\"\n [placeholder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u8F93\u5165' + formItem.label\"\n [maxlength]=\"formItem.maxLength || null\" rows=\"4\" nz-input\n [maxlength]=\"formItem.maxLength || null\" [formControlName]=\"formItem.name\"></textarea>\n </ng-container>\n <ng-container *ngSwitchCase=\"5\">\n <div style=\"display: flex;align-items: center;\">\n <nz-input-number [ngStyle]=\"getStyle(line, formItem, '100px')\"\n [maxlength]=\"formItem.maxLength || null\" [formControlName]=\"formItem.name\"\n [nzMin]=\"formItem?.inputNumber?.min || 0\" [nzMax]=\"formItem?.inputNumber?.max || 99999999\"\n [nzStep]=\"formItem?.inputNumber?.step || 1\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u8F93\u5165' + formItem.label\"\n [nzId]=\"'inputNumber-' + formItem.name + line.get('lineIndex').value\"\n (click)=\"formItem.isSelect ? selectValue('#inputNumber-' + formItem.name + line.get('lineIndex').value) : null\">\n </nz-input-number>\n <div *ngIf=\"formItem?.explainOptionRight?.show\"\n [style.color]=\"formItem?.explainOptionRight?.color ? formItem.explainOptionRight.color : null\">\n &nbsp;&nbsp;{{line.get(formItem.explainOptionRight.name).value}}</div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"6\">\n <nz-select nzMode=\"multiple\" [nzServerSearch]=\"formItem.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"formItem.selectOption.hdDropdownMatchSelectWidth ? formItem.selectOption.hdDropdownMatchSelectWidth : false\"\n nzShowSearch nzAllowClear\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\" [ngStyle]=\"getStyle(line, formItem, '200px')\"\n (nzOnSearch)=\"triggerEvent(formItem.onSearchEvent || null, $event, line)\">\n <nz-option *ngFor=\"let selectItem of formItem.selectOption.selectList\"\n [nzValue]=\"selectItem[formItem.selectOption.value]\" [nzLabel]=\"formItem.selectOption.showLabelAndValue ? '['+ selectItem[formItem.selectOption.value] +']' +\n selectItem[formItem.selectOption.label] : selectItem[formItem.selectOption.label]\"></nz-option>\n <ng-container\n *ngIf=\"formItem.selectOption.label && line.get(formItem.name) && line.get(formItem.selectOption.label)?.value && line.get(formItem.selectOption.value)?.value\">\n <nz-option *ngFor=\"let option of line.get(formItem.selectOption.value).value;index as i\"\n [nzLabel]=\"line.get(formItem.selectOption.label).value[i]\" [nzValue]=\"option\" nzHide>\n </nz-option>\n </ng-container>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"7\">\n {{(formItem.preserveNumber && line.get(formItem.name).value) ?\n LodashRound(line.get(formItem.name).value,formItem.preserveNumber).toFixed(formItem.preserveNumber)\n : line.get(formItem.name).value}}\n </ng-container>\n <ng-container *ngSwitchCase=\"8\">\n <nz-switch [formControlName]=\"formItem.name\"></nz-switch>\n </ng-container>\n <ng-container *ngSwitchCase=\"9\">\n <nz-time-picker [formControlName]=\"formItem.name\"></nz-time-picker>\n </ng-container>\n </ng-container>\n </nz-form-control>\n </nz-form-item>\n <div *ngIf=\"formItem?.explainOption?.show\"\n [style.color]=\"formItem?.explainOption?.color ? formItem.explainOption.color : null\">\n {{line.get(formItem.explainOption.name).value}}</div>\n </td>\n </ng-container>\n <td style=\"width: 80px\" nzRight=\"0\">\n <span class=\"common-btn-group\">\n <a *ngIf=\"operateButtons.includes('add')\" (click)=\"addFormLine(line.get('lineIndex').value)\">\u6DFB\u52A0</a>\n <a class=\"common-danger-btn\" *ngIf=\"operateButtons.includes('delete') && !showDeleteConfirm\"\n (click)=\"deleteFormLine(line.get('lineIndex').value)\">\u5220\u9664</a>\n <a class=\"common-danger-btn\" *ngIf=\"operateButtons.includes('delete') && showDeleteConfirm\" nz-popconfirm\n nzPopconfirmTitle=\"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u884C\u5417?\" nzPopconfirmPlacement=\"bottom\"\n (nzOnConfirm)=\"deleteFormLine(line.get('lineIndex').value)\">\u5220\u9664</a>\n </span>\n </td>\n </tr>\n </ng-container>\n <!-- \u5408\u8BA1\u533A\u57DF -->\n <tr *ngIf=\"showTotal\" class=\"hd-table-total\">\n <td>\u5408\u8BA1</td>\n <ng-container *ngFor=\"let totalOption of totalOptionList\">\n <td [nzAlign]=\"totalOption.align ? totalOption.align : 'left'\">{{ (totalOption.value || totalOption.value ===\n 0) ? (((totalOption.value % 1 === 0) && !totalOption.showDecimal ) ? totalOption.value :\n LodashRound(totalOption.value,2).toFixed(2)) : '' }} </td>\n </ng-container>\n </tr>\n </tbody>\n </nz-table>\n <ng-container *ngIf=\"linesFormArray.controls.length > 10\">\n <hd-space background=\"transparent\" type=\"row\" size=\"16\"></hd-space>\n <nz-pagination [nzSize]=\"'small'\" style=\"text-align: right;\" [nzPageIndex]=\"paginationPageIndex\"\n [nzPageSize]=\"paginationPageSize\" [nzPageSizeOptions]=\"[10, 20, 30, 40, 50, 100, 200]\"\n [nzTotal]=\"linesFormArray.controls.length\" nzShowSizeChanger (nzPageIndexChange)=\"pageIndexChange($event)\"\n (nzPageSizeChange)=\"pageSizeChange($event)\" [nzShowTotal]=\"totalTemplate\"></nz-pagination>\n <ng-template #totalTemplate let-total>\u5171 {{linesFormArray.controls.length}} \u6761\u6570\u636E</ng-template>\n </ng-container>\n</form>",
2306
2418
  styles: ["::ng-deep .common-btn-group>a{font-size:12px;font-weight:400;color:#12a34f!important;white-space:nowrap}::ng-deep .common-btn-group .common-danger-btn:hover{color:#f05b24!important}::ng-deep .common-btn-group>a:hover{color:#20bd62!important}::ng-deep .common-btn-group>a:not(:last-child)::after{content:'';margin:0 2px}::ng-deep .common-billNumber>a{color:#3b77e3}button{box-shadow:unset;text-shadow:unset}::ng-deep .ant-form-item-label>label{color:#4b504e}::ng-deep .ant-input-number-input{height:28px}::ng-deep .ant-input-number{height:28px}textarea.ant-input{height:auto;min-height:28px}::ng-deep .ant-select-selection--multiple{min-height:28px}::ng-deep .ant-select-selection__rendered>ul>li{height:22px!important;margin-top:3px!important;line-height:22px!important}::ng-deep .ant-advanced-search-form .ant-form-item{margin-bottom:0!important}::ng-deep .ant-select-selection--single{height:28px!important}::ng-deep .ant-input{height:28px}::ng-deep .ant-input[disabled]:hover{border-color:#d9d9d9!important}::ng-deep .ant-select-selection__rendered{line-height:28px!important}::ng-deep .ant-calendar-range-picker-input{text-align:left!important}::ng-deep .ant-calendar-picker{width:100%!important}::ng-deep .ant-row{margin-right:0!important;margin-left:0!important}::ng-deep .ant-col-6{padding-left:12px;padding-right:12px}::ng-deep .ant-col-12{padding-left:12px;padding-right:12px}::ng-deep .ant-col-18{padding-left:12px;padding-right:12px}::ng-deep .ant-col-24{padding-left:12px;padding-right:12px}::ng-deep .ant-alert-info{background-color:#f5f8f6;border:1px solid #cfe3d4}:host ::ng-deep th{background:#f5f8f6!important;font-weight:700!important;white-space:nowrap;font-size:12px;font-family:PingFangSC-Medium,PingFang SC;color:#2a3634;padding:8px!important;box-sizing:border-box}:host ::ng-deep td{font-weight:400;font-style:normal;font-size:12px;color:#2a3634;text-align:left;white-space:nowrap;padding:8px!important;box-sizing:border-box}::ng-deep .ant-pagination-options{display:inline-flex;align-items:center}::ng-deep .ant-time-picker{width:100%}.hd-formLines-container ::ng-deep td{padding:1.5px 8px!important}.hd-formLines-container .ant-table-tbody>tr>td,.hd-formLines-container ::ng-deep .ant-table-thead>tr>th{padding:16px 8px}.hd-formLines-container ::ng-deep .hd-table-total>td{border:0!important}.hd-formLines-container .ant-input-number{width:100%}"]
2307
2419
  }] }
2308
2420
  ];
@@ -2313,6 +2425,7 @@
2313
2425
  ]; };
2314
2426
  HdFormLinesComponent.propDecorators = {
2315
2427
  tableLoading: [{ type: core.Input }],
2428
+ showSearch: [{ type: core.Input }],
2316
2429
  formLines: [{ type: core.Input }],
2317
2430
  formLinesData: [{ type: core.Input }],
2318
2431
  operateButtons: [{ type: core.Input }],
@@ -2337,6 +2450,8 @@
2337
2450
  /** @type {?} */
2338
2451
  HdFormLinesComponent.prototype.tableLoading;
2339
2452
  /** @type {?} */
2453
+ HdFormLinesComponent.prototype.showSearch;
2454
+ /** @type {?} */
2340
2455
  HdFormLinesComponent.prototype.formLines;
2341
2456
  /** @type {?} */
2342
2457
  HdFormLinesComponent.prototype.formLinesData;
@@ -2370,6 +2485,12 @@
2370
2485
  HdFormLinesComponent.prototype.showForm;
2371
2486
  /** @type {?} */
2372
2487
  HdFormLinesComponent.prototype.filterStr;
2488
+ /** @type {?} */
2489
+ HdFormLinesComponent.prototype.storeFormLinesData;
2490
+ /** @type {?} */
2491
+ HdFormLinesComponent.prototype.filterStoreFormLinesData;
2492
+ /** @type {?} */
2493
+ HdFormLinesComponent.prototype.filterIndexStore;
2373
2494
  /**
2374
2495
  * @type {?}
2375
2496
  * @private