iov-pro-components 0.0.21 → 0.0.22

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.
@@ -8378,7 +8378,9 @@ var script$j = {
8378
8378
  modelValue: {}
8379
8379
  },
8380
8380
  // 需要触发的钩子函数
8381
- hooks: _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, HOOKS.INIT, []), HOOKS.DO_LAYOUT, []), HOOKS.VALUE_CHANGE, []), HOOKS.OPTION_CHANGE, []), HOOKS.PROPS_CHANGE, [])
8381
+ hooks: _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, HOOKS.INIT, []), HOOKS.DO_LAYOUT, []), HOOKS.VALUE_CHANGE, []), HOOKS.OPTION_CHANGE, []), HOOKS.PROPS_CHANGE, []),
8382
+ // 当前所有的form-item集合
8383
+ formItems: []
8382
8384
  };
8383
8385
  },
8384
8386
  computed: {
@@ -8388,16 +8390,20 @@ var script$j = {
8388
8390
  */
8389
8391
  formProps: function formProps() {
8390
8392
  return this.normalizeFormProps();
8391
- },
8392
- /**
8393
- * 当前所有的form-item集合
8394
- * @time 2024-11-04 17:23:02
8395
- */
8396
- formItems: function formItems() {
8397
- return this.normalizeFormItems(this.items);
8398
8393
  }
8399
8394
  },
8400
8395
  watch: {
8396
+ /**
8397
+ * 监听items的变化,如果变化了,重新生成formItems
8398
+ * @time 2025-06-20 11:25:49
8399
+ */
8400
+ items: {
8401
+ handler: function handler() {
8402
+ this.formItems = this.normalizeFormItems(this.items);
8403
+ },
8404
+ deep: true,
8405
+ immediate: true
8406
+ },
8401
8407
  /**
8402
8408
  * 如果表单数据的变化,则v-model双向绑定外部数据
8403
8409
  * @time 2024-11-01 15:17:51
@@ -8465,31 +8471,36 @@ var script$j = {
8465
8471
  // 遍历当前传入的数据
8466
8472
  valueKeys.forEach(function (key) {
8467
8473
  // 取出当前表单项配置
8468
- var formItem = _this2.formItems.find(function (item) {
8474
+ var formItems = _this2.formItems.filter(function (item) {
8469
8475
  return Array.isArray(item.name) ? item.name.includes(key) : item.name === key;
8476
+ }).filter(function (item) {
8477
+ return _this2.vif(item);
8470
8478
  });
8471
8479
  // 如果当前是表单的字段
8472
- if (formItem) {
8473
- // 如果当前名称需要解构
8474
- if (Array.isArray(formItem.name)) {
8475
- var _this2$modelValue$for;
8476
- // 当前key在数组中索引
8477
- var nameIndex = formItem.name.indexOf(key);
8478
- // 值发生改变
8479
- if (!isEqual(_this2.value[key], (_this2$modelValue$for = _this2.modelValue[formItem.key]) === null || _this2$modelValue$for === void 0 ? void 0 : _this2$modelValue$for[nameIndex])) {
8480
- // 如果字段值不存在
8481
- if (isEmpty(_this2.modelValue[formItem.key])) {
8482
- _this2.$set(_this2.modelValue, formItem.key, []);
8480
+ if (formItems && formItems.length > 0) {
8481
+ // 遍历数据
8482
+ formItems.forEach(function (formItem) {
8483
+ // 如果当前名称需要解构
8484
+ if (Array.isArray(formItem.name)) {
8485
+ var _this2$modelValue$for;
8486
+ // 当前key在数组中索引
8487
+ var nameIndex = formItem.name.indexOf(key);
8488
+ // 值发生改变
8489
+ if (!isEqual(_this2.value[key], (_this2$modelValue$for = _this2.modelValue[formItem.key]) === null || _this2$modelValue$for === void 0 ? void 0 : _this2$modelValue$for[nameIndex])) {
8490
+ // 如果字段值不存在
8491
+ if (isEmpty(_this2.modelValue[formItem.key])) {
8492
+ _this2.$set(_this2.modelValue, formItem.key, []);
8493
+ }
8494
+ // 设置值
8495
+ _this2.$set(_this2.modelValue[formItem.key], nameIndex, _this2.value[key]);
8496
+ }
8497
+ } else {
8498
+ // 值发生改变
8499
+ if (!isEqual(_this2.value[key], _this2.modelValue[formItem.key])) {
8500
+ _this2.$set(_this2.modelValue, formItem.key, _this2.value[key]);
8483
8501
  }
8484
- // 设置值
8485
- _this2.$set(_this2.modelValue[formItem.key], nameIndex, _this2.value[key]);
8486
- }
8487
- } else {
8488
- // 值发生改变
8489
- if (!isEqual(_this2.value[key], _this2.modelValue[formItem.key])) {
8490
- _this2.$set(_this2.modelValue, formItem.key, _this2.value[key]);
8491
8502
  }
8492
- }
8503
+ });
8493
8504
  } else {
8494
8505
  // 值发生改变
8495
8506
  if (!isEqual(_this2.value[key], _this2.modelValue[key])) {
@@ -8523,7 +8534,7 @@ var script$j = {
8523
8534
  }
8524
8535
  } else {
8525
8536
  // 值被清空了
8526
- if (isNil(_this2.value[key])) {
8537
+ if (isNil(_this2.value[formItem.name])) {
8527
8538
  _this2.clearFieldValue(formItem);
8528
8539
  }
8529
8540
  }
@@ -11393,6 +11404,7 @@ var script$9 = {
11393
11404
  var _this$request = this.request,
11394
11405
  _api = _this$request.api,
11395
11406
  params = _this$request.params,
11407
+ hideLoading = _this$request.hideLoading,
11396
11408
  requiredFields = _this$request.requiredFields,
11397
11409
  reloadOnParamsChange = _this$request.reloadOnParamsChange,
11398
11410
  threshold = _this$request.threshold;
@@ -11425,6 +11437,7 @@ var script$9 = {
11425
11437
  },
11426
11438
  params: requestParams,
11427
11439
  requiredFields: requiredFields,
11440
+ hideLoading: hideLoading || false,
11428
11441
  reloadOnParamsChange: isNil$2(reloadOnParamsChange) ? true : reloadOnParamsChange,
11429
11442
  threshold: threshold || 10
11430
11443
  };
@@ -19923,7 +19936,7 @@ var install = function install(Vue, componentConfig) {
19923
19936
  };
19924
19937
  var index = {
19925
19938
  install: install,
19926
- version: '0.0.21',
19939
+ version: '0.0.22',
19927
19940
  ColumnTooltip: __vue_component__$t,
19928
19941
  Description: __vue_component__$q,
19929
19942
  DialogSelect: __vue_component__$p,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iov-pro-components",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "IOV Pro Components for Vue.js",
5
5
  "main": "lib/iov-pro-components.min.js",
6
6
  "files": [