@bit-sun/business-component 4.0.12-alpha.23 → 4.0.12-alpha.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.0.12-alpha.23",
3
+ "version": "4.0.12-alpha.25",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -84,11 +84,11 @@ const PropertySelector = ({
84
84
 
85
85
  const newArr = (data?.data || []).map((item: any) => {
86
86
  return {
87
- propertyCode: item.property.propertyCode,
88
- propertyName: item.property.name,
89
- propertyId: item.property.id,
90
- isCommonUse: item.property.isCommonUse === 'commonUse',
91
- detailList: item.propertyValueList.map((detail: any) => ({
87
+ propertyCode: item.property?.propertyCode,
88
+ propertyName: item.property?.name,
89
+ propertyId: item.property?.id,
90
+ isCommonUse: item.property?.isCommonUse === 'commonUse',
91
+ detailList: (item.propertyValueList || []).map((detail: any) => ({
92
92
  name: detail.value,
93
93
  value: detail.value,
94
94
  isCommonUse: detail.isCommonUse === 'commonUse',
@@ -104,17 +104,22 @@ const PropertySelector = ({
104
104
 
105
105
 
106
106
  useEffect(() => {
107
- // 获取选中品类信息
108
- setChoosedClassify(value?.classifyCode);
109
-
107
+ if (visible) {
108
+ // 获取选中品类信息
109
+ setChoosedClassify(value?.classifyCode || classifyOptionList[0]?.value);
110
+ }
110
111
  // 获取选中属性值展示
111
112
  const choosedPropertyList = (value?.propertyList || []).map(item => (item.detailList || []).map(detail => detail.name)).flat();
112
113
  if ((value?.propertyList || []).some(item => !item.isCommonUse)) {
113
114
  setShowNotCommon(true);
114
115
  }
116
+ settingValue.current = {
117
+ ...value,
118
+ classifyCode: value?.classifyCode || classifyOptionList[0]?.value,
119
+ };
115
120
  setChoosedValues(choosedPropertyList);
116
- settingValue.current = {...value};
117
- }, [value])
121
+
122
+ }, [value, visible])
118
123
 
119
124
  // 关闭弹窗回传组件值
120
125
  const handleConfirm = () => {