Commit 32d32c4e authored by Sixiang_Zzb's avatar Sixiang_Zzb

服务商编辑页显示bug修复

parent 75f1683c
......@@ -48,11 +48,6 @@ const Edit = (props: any) => {
optionsList = [...DataServices.data.rows];
}
return () => {
}
}, [DataServices]);
// 判断是否有小区列表数据返回
......@@ -72,14 +67,30 @@ const Edit = (props: any) => {
useEffect(() => {
if (SaveChooseData != null) {
console.log(optionsList);
console.log(SaveChooseData);
if (SaveChooseData.serviceScopeList.length <= 1) {
// 处理服务范围数据
optionsList.forEach((v) => {
if (v.serviceName === SaveChooseData.serviceScope) {
SaveChooseData.serviceScopeList = v.serviceCode;
formRef.current.setFieldsValue(SaveChooseData);
}
});
} else {
console.log(1122);
// 处理服务范围数据
optionsList.forEach((v1) => {
SaveChooseData.serviceScopeList.forEach((v2: string, index: number) => {
console.log(v1.serviceName);
console.log(v1.serviceName === v2);
if (v1.serviceName === v2) {
SaveChooseData.serviceScopeList[index] = v1.serviceCode;
}
});
});
}
formRef.current.setFieldsValue(SaveChooseData);
console.log(SaveChooseData);
}
}, [SaveChooseData]);
......@@ -239,7 +250,7 @@ function mapStateToProps(state: any) {
const { CurData, SaveChooseData } = state.ServiceProvider;
const { DataServices } = state.User;
const { CommunityList } = state.Init;
console.log(CurData)
console.log(CurData);
return {
CurData,
SaveChooseData,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment