bm-admin-ui 1.0.77-alpha → 1.0.78-alpha

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.
@@ -3032,25 +3032,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
3032
3032
  function handleChange(val) {
3033
3033
  emits("change", val);
3034
3034
  }
3035
- function shopLinkProduct(newField, oldField) {
3036
- shopRules.value.forEach((shop) => {
3037
- if (shop.field === oldField) {
3038
- shop.config.linkProductCount--;
3039
- }
3040
- if (shop.field === newField) {
3041
- if (!shop.config.linkProductCount) {
3042
- shop.config.linkProductCount = 0;
3043
- }
3044
- shop.config.linkProductCount++;
3045
- }
3046
- });
3047
- }
3048
3035
  watch(checkedValue, (checkedValue2) => {
3049
3036
  checkedValueChange(checkedValue2);
3050
3037
  });
3051
- watch(selectValue, (selectValue2, oldSelectValue) => {
3038
+ watch(selectValue, (selectValue2) => {
3052
3039
  selectValueChange(selectValue2);
3053
- shopLinkProduct(selectValue2, oldSelectValue);
3054
3040
  handleChange(selectValue2);
3055
3041
  });
3056
3042
  return (_ctx, _cache) => {
@@ -3984,7 +3970,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3984
3970
  function handleFormItemClick(rule) {
3985
3971
  setActiveRule(rule);
3986
3972
  }
3987
- function copyRule(rule, ruleConfig, ruleHost, isCopyChildRule = false) {
3973
+ function copyRule(rule, ruleConfig, ruleHost, isCopyChildRule = false, needCopyField = false) {
3988
3974
  const newRule = makeRule(ruleConfig);
3989
3975
  if (isCopyChildRule) {
3990
3976
  ruleHost.push(newRule);
@@ -3994,11 +3980,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3994
3980
  );
3995
3981
  ruleHost.splice(index + 1, 0, newRule);
3996
3982
  }
3997
- copyPropValue(rule, newRule);
3983
+ copyPropValue(rule, newRule, needCopyField);
3998
3984
  if (rule?.config?.childRules?.length) {
3999
3985
  rule.config.childRules.forEach((cRule) => {
4000
3986
  const config = cRule?.config?.config || ruleList[cRule.name];
4001
- copyRule(cRule, config, newRule.config.childRules, true);
3987
+ copyRule(cRule, config, newRule.config.childRules, true, needCopyField);
4002
3988
  });
4003
3989
  }
4004
3990
  return newRule;
@@ -4094,7 +4080,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4094
4080
  return pre[cur];
4095
4081
  }, rule);
4096
4082
  }
4097
- function copyPropValue(oldRule, newRule) {
4083
+ function copyPropValue(oldRule, newRule, needCopyField = false) {
4084
+ if (needCopyField) {
4085
+ newRule.field = oldRule.field;
4086
+ }
4098
4087
  newRule.config.propsFields.forEach((field) => {
4099
4088
  if (field !== "config.childRules")
4100
4089
  setRulePropValue(field, cloneDeep(getValue(field, oldRule)), newRule);
@@ -4142,7 +4131,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4142
4131
  function edit(formRules) {
4143
4132
  widgetFormRules.splice(0);
4144
4133
  formRules.forEach(
4145
- (item) => copyRule(item, ruleList[item.name], widgetFormRules, true)
4134
+ (item) => copyRule(item, ruleList[item.name], widgetFormRules, true, true)
4146
4135
  );
4147
4136
  }
4148
4137
  function getRule(name) {
@@ -3042,25 +3042,11 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
3042
3042
  function handleChange(val) {
3043
3043
  emits("change", val);
3044
3044
  }
3045
- function shopLinkProduct(newField, oldField) {
3046
- shopRules.value.forEach((shop) => {
3047
- if (shop.field === oldField) {
3048
- shop.config.linkProductCount--;
3049
- }
3050
- if (shop.field === newField) {
3051
- if (!shop.config.linkProductCount) {
3052
- shop.config.linkProductCount = 0;
3053
- }
3054
- shop.config.linkProductCount++;
3055
- }
3056
- });
3057
- }
3058
3045
  vue.watch(checkedValue, (checkedValue2) => {
3059
3046
  checkedValueChange(checkedValue2);
3060
3047
  });
3061
- vue.watch(selectValue, (selectValue2, oldSelectValue) => {
3048
+ vue.watch(selectValue, (selectValue2) => {
3062
3049
  selectValueChange(selectValue2);
3063
- shopLinkProduct(selectValue2, oldSelectValue);
3064
3050
  handleChange(selectValue2);
3065
3051
  });
3066
3052
  return (_ctx, _cache) => {
@@ -3994,7 +3980,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3994
3980
  function handleFormItemClick(rule) {
3995
3981
  setActiveRule(rule);
3996
3982
  }
3997
- function copyRule(rule, ruleConfig, ruleHost, isCopyChildRule = false) {
3983
+ function copyRule(rule, ruleConfig, ruleHost, isCopyChildRule = false, needCopyField = false) {
3998
3984
  const newRule = makeRule(ruleConfig);
3999
3985
  if (isCopyChildRule) {
4000
3986
  ruleHost.push(newRule);
@@ -4004,11 +3990,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4004
3990
  );
4005
3991
  ruleHost.splice(index + 1, 0, newRule);
4006
3992
  }
4007
- copyPropValue(rule, newRule);
3993
+ copyPropValue(rule, newRule, needCopyField);
4008
3994
  if (rule?.config?.childRules?.length) {
4009
3995
  rule.config.childRules.forEach((cRule) => {
4010
3996
  const config = cRule?.config?.config || ruleList[cRule.name];
4011
- copyRule(cRule, config, newRule.config.childRules, true);
3997
+ copyRule(cRule, config, newRule.config.childRules, true, needCopyField);
4012
3998
  });
4013
3999
  }
4014
4000
  return newRule;
@@ -4104,7 +4090,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4104
4090
  return pre[cur];
4105
4091
  }, rule);
4106
4092
  }
4107
- function copyPropValue(oldRule, newRule) {
4093
+ function copyPropValue(oldRule, newRule, needCopyField = false) {
4094
+ if (needCopyField) {
4095
+ newRule.field = oldRule.field;
4096
+ }
4108
4097
  newRule.config.propsFields.forEach((field) => {
4109
4098
  if (field !== "config.childRules")
4110
4099
  setRulePropValue(field, lodashEs.cloneDeep(getValue(field, oldRule)), newRule);
@@ -4152,7 +4141,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4152
4141
  function edit(formRules) {
4153
4142
  widgetFormRules.splice(0);
4154
4143
  formRules.forEach(
4155
- (item) => copyRule(item, ruleList[item.name], widgetFormRules, true)
4144
+ (item) => copyRule(item, ruleList[item.name], widgetFormRules, true, true)
4156
4145
  );
4157
4146
  }
4158
4147
  function getRule(name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bm-admin-ui",
3
- "version": "1.0.77-alpha",
3
+ "version": "1.0.78-alpha",
4
4
  "private": false,
5
5
  "description": "An Admin Component Library for Bm",
6
6
  "license": "UNLICENSED",