fantasy-ngzorro 1.0.56 → 1.0.57

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.
@@ -1902,7 +1902,9 @@
1902
1902
  */
1903
1903
  function () {
1904
1904
  var _this = this;
1905
- console.log('this.filterStr', this.filterStr);
1905
+ if (this.storeFormLinesData.length < 1) {
1906
+ return;
1907
+ }
1906
1908
  this.tableLoading = true;
1907
1909
  // 如果没有输入搜索字符串,则显示缓存内的所有数据
1908
1910
  if (!this.filterStr) {
@@ -1912,10 +1914,8 @@
1912
1914
  }
1913
1915
  /** @type {?} */
1914
1916
  var filterValue = this.filterStr.trim().toLowerCase();
1915
- console.log('this.filterValue', filterValue);
1916
1917
  this.isFilterData = true;
1917
1918
  this.filterIndexStore = [];
1918
- console.log('this.storeFormLinesData', this.storeFormLinesData);
1919
1919
  // 根据搜索字符串过滤数据
1920
1920
  /** @type {?} */
1921
1921
  var filteredData = this.storeFormLinesData.filter((/**
@@ -1928,10 +1928,9 @@
1928
1928
  try {
1929
1929
  for (var _b = __values(_this.formLines), _c = _b.next(); !_c.done; _c = _b.next()) {
1930
1930
  var item = _c.value;
1931
- if (!item.hide) {
1931
+ if ((item.hide && item.canSearch) || (!item.hide && item.name !== 'uuid')) {
1932
1932
  /** @type {?} */
1933
1933
  var value = data[item.name] ? data[item.name].toString().toLowerCase() : '';
1934
- console.log('value', value);
1935
1934
  if (value.includes(filterValue)) {
1936
1935
  _this.filterIndexStore.push(index);
1937
1936
  return true;
@@ -2208,9 +2207,6 @@
2208
2207
  }));
2209
2208
  this.tableLoading = false;
2210
2209
  this.showForm = true;
2211
- if (this.formLinesData.length === 0) {
2212
- this.addFormLine();
2213
- }
2214
2210
  };
2215
2211
  /**
2216
2212
  * @param {?=} index
@@ -2304,86 +2300,93 @@
2304
2300
  */
2305
2301
  function (data) {
2306
2302
  var _this = this;
2307
- if (data && data.lines && this.filterIndexStore.length !== 0) {
2308
- /** @type {?} */
2309
- var lines_1 = data.lines;
2310
- if (lines_1.length === this.filterIndexStore.length) {
2311
- this.filterIndexStore.forEach((/**
2312
- * @param {?} item
2313
- * @param {?} index
2314
- * @return {?}
2315
- */
2316
- function (item, index) {
2317
- _this.storeFormLinesData[item] = __assign({}, _this.filterStoreFormLinesData[index], lines_1[index]);
2318
- }));
2319
- }
2320
- else if (lines_1.length > this.filterIndexStore.length) {
2321
- // 有新增数据的情况
2322
- // step 1: 先找新增的index下标
2323
- /** @type {?} */
2324
- var getNowLines = this.validateHdFormLines.getRawValue().lines;
2303
+ if (this.isFilterData) {
2304
+ if (data && data.lines && this.filterIndexStore.length !== 0) {
2325
2305
  /** @type {?} */
2326
- var addIndex = -1;
2327
- for (var i = 0; i < getNowLines.length; i++) {
2328
- if (getNowLines[i].isHdFormLineSearchAdd) {
2329
- addIndex = i;
2330
- break;
2331
- }
2332
- }
2333
- if (addIndex !== -1) {
2334
- this.storeFormLinesData.splice(this.filterIndexStore[addIndex - 1] + 1, 0, getNowLines[addIndex]);
2335
- }
2336
- this.filterIndexStore.push(this.filterIndexStore[addIndex - 1] + 1);
2337
- }
2338
- else {
2339
- // 有删除数据的情况
2340
- // step 1:先找到删除的index下标
2341
- /** @type {?} */
2342
- var deletedIndex_1 = -1;
2343
- /** @type {?} */
2344
- var count = 0;
2345
- if (lines_1.length === 0) {
2346
- deletedIndex_1 = 0;
2347
- }
2348
- else {
2349
- for (var i = 0; i < lines_1.length; i++) {
2350
- if (lines_1[i].lineIndex - count > 1) {
2351
- deletedIndex_1 = i;
2352
- break;
2353
- }
2354
- count++;
2355
- }
2356
- }
2357
- if (deletedIndex_1 !== -1) {
2358
- // step 2: 删除总数据中的对应数据, 把下标数组和lines长度对齐,同时把下标数组在deletedIndex后面的值全都-1
2359
- this.storeFormLinesData = this.storeFormLinesData.filter((/**
2306
+ var lines_1 = data.lines;
2307
+ if (lines_1.length === this.filterIndexStore.length) {
2308
+ this.filterIndexStore.forEach((/**
2360
2309
  * @param {?} item
2361
2310
  * @param {?} index
2362
2311
  * @return {?}
2363
2312
  */
2364
2313
  function (item, index) {
2365
- return index !== _this.filterIndexStore[deletedIndex_1];
2314
+ _this.storeFormLinesData[item] = __assign({}, _this.filterStoreFormLinesData[index], lines_1[index]);
2366
2315
  }));
2367
- this.filterIndexStore.splice(deletedIndex_1, 1);
2368
- for (var i = 0; i < this.filterIndexStore.length; i++) {
2369
- if (i >= deletedIndex_1) {
2370
- this.filterIndexStore[i]--;
2316
+ }
2317
+ else if (lines_1.length > this.filterIndexStore.length) {
2318
+ // 有新增数据的情况
2319
+ // step 1: 先找新增的index下标
2320
+ /** @type {?} */
2321
+ var getNowLines = this.validateHdFormLines.getRawValue().lines;
2322
+ /** @type {?} */
2323
+ var addIndex = -1;
2324
+ for (var i = 0; i < getNowLines.length; i++) {
2325
+ if (getNowLines[i].isHdFormLineSearchAdd) {
2326
+ addIndex = i;
2327
+ break;
2371
2328
  }
2372
2329
  }
2330
+ if (addIndex !== -1) {
2331
+ this.storeFormLinesData.splice(this.filterIndexStore[addIndex - 1] + 1, 0, getNowLines[addIndex]);
2332
+ }
2333
+ this.filterIndexStore.push(this.filterIndexStore[addIndex - 1] + 1);
2373
2334
  }
2374
2335
  else {
2375
- // step 2: 没有找到deletedIndex说明删除操作在最后一行
2336
+ // 有删除数据的情况
2337
+ // step 1:先找到删除的index下标
2376
2338
  /** @type {?} */
2377
- var filterIndex_1 = this.filterIndexStore[this.filterIndexStore.length - 1];
2378
- this.storeFormLinesData = this.storeFormLinesData.filter((/**
2379
- * @param {?} item
2380
- * @param {?} index
2381
- * @return {?}
2382
- */
2383
- function (item, index) {
2384
- return index !== filterIndex_1;
2385
- }));
2386
- this.filterIndexStore.pop();
2339
+ var deletedIndex_1 = -1;
2340
+ /** @type {?} */
2341
+ var count = 0;
2342
+ if (lines_1.length === 0) {
2343
+ deletedIndex_1 = 0;
2344
+ }
2345
+ else {
2346
+ for (var i = 0; i < lines_1.length; i++) {
2347
+ if (lines_1[i].lineIndex - count > 1) {
2348
+ deletedIndex_1 = i;
2349
+ break;
2350
+ }
2351
+ count++;
2352
+ }
2353
+ }
2354
+ if (deletedIndex_1 !== -1) {
2355
+ // step 2: 删除总数据中的对应数据, 把下标数组和lines长度对齐,同时把下标数组在deletedIndex后面的值全都-1
2356
+ this.storeFormLinesData = this.storeFormLinesData.filter((/**
2357
+ * @param {?} item
2358
+ * @param {?} index
2359
+ * @return {?}
2360
+ */
2361
+ function (item, index) {
2362
+ return index !== _this.filterIndexStore[deletedIndex_1];
2363
+ }));
2364
+ this.filterIndexStore.splice(deletedIndex_1, 1);
2365
+ for (var i = 0; i < this.filterIndexStore.length; i++) {
2366
+ if (i >= deletedIndex_1) {
2367
+ this.filterIndexStore[i]--;
2368
+ }
2369
+ }
2370
+ }
2371
+ else {
2372
+ // step 2: 没有找到deletedIndex说明删除操作在最后一行
2373
+ /** @type {?} */
2374
+ var filterIndex_1 = this.filterIndexStore[this.filterIndexStore.length - 1];
2375
+ this.storeFormLinesData = this.storeFormLinesData.filter((/**
2376
+ * @param {?} item
2377
+ * @param {?} index
2378
+ * @return {?}
2379
+ */
2380
+ function (item, index) {
2381
+ return index !== filterIndex_1;
2382
+ }));
2383
+ this.filterIndexStore.pop();
2384
+ }
2385
+ }
2386
+ }
2387
+ else {
2388
+ if (data && data.lines) {
2389
+ this.storeFormLinesData = data.lines;
2387
2390
  }
2388
2391
  }
2389
2392
  }
@@ -2392,17 +2395,23 @@
2392
2395
  this.storeFormLinesData = data.lines;
2393
2396
  }
2394
2397
  }
2395
- if (this.formValid) {
2396
- // 如果整体表单是true,不管子表单是什么,都变成子表单的状态
2398
+ // 总表单
2399
+ if (!this.isFilterData) {
2397
2400
  this.formValid = this.validateHdFormLines.valid;
2398
2401
  }
2399
2402
  else {
2400
- // 如果整体表单是false:1、子表单为true,需要重算;2、子表单为false,用子表单状态
2401
- if (this.validateHdFormLines.valid) {
2402
- this.formValid = this.innerGetValid();
2403
+ if (this.formValid) {
2404
+ // 如果整体表单是true,不管子表单是什么,都变成子表单的状态
2405
+ this.formValid = this.validateHdFormLines.valid;
2403
2406
  }
2404
2407
  else {
2405
- this.formValid = this.validateHdFormLines.valid;
2408
+ // 如果整体表单是false:1、子表单为true,需要重算;2、子表单为false,用子表单状态
2409
+ if (this.validateHdFormLines.valid) {
2410
+ this.formValid = this.innerGetValid();
2411
+ }
2412
+ else {
2413
+ this.formValid = this.validateHdFormLines.valid;
2414
+ }
2406
2415
  }
2407
2416
  }
2408
2417
  // this.calculateLineNumber();
@@ -3585,6 +3594,7 @@
3585
3594
  this.inputNumber = new InputNumber(); // number组件的min、max、step
3586
3595
  // 不可输入状态
3587
3596
  this.showTime = false; // 日期选择器是否包含时间
3597
+ this.canSearch = false; // 指明hide 情况下的控件是否可以被搜索,默认false
3588
3598
  }
3589
3599
  return FormLine;
3590
3600
  }());
@@ -3635,6 +3645,8 @@
3635
3645
  FormLine.prototype.showTime;
3636
3646
  /** @type {?} */
3637
3647
  FormLine.prototype.style;
3648
+ /** @type {?} */
3649
+ FormLine.prototype.canSearch;
3638
3650
  }
3639
3651
  var ColorOption = /** @class */ (function () {
3640
3652
  function ColorOption() {