Commit 62e2e1be authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复 渠道数据为 null 报错的问题

parent 5b7418e5
...@@ -12,6 +12,7 @@ import { useLinkageUtils } from '@/utils/formEffectUtils'; ...@@ -12,6 +12,7 @@ import { useLinkageUtils } from '@/utils/formEffectUtils';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetMemberAbilitySubGetResponse } from '@/services/MemberApi'; import { GetMemberAbilitySubGetResponse } from '@/services/MemberApi';
import { initDetailSchema } from './schema'; import { initDetailSchema } from './schema';
import { legoState } from 'lingxi-editor-core';
// import { getAuth } from '@/utils/auth'; // import { getAuth } from '@/utils/auth';
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -352,11 +353,13 @@ const MemberForm: React.FC<MemberFormProps> = ({ ...@@ -352,11 +353,13 @@ const MemberForm: React.FC<MemberFormProps> = ({
if (res.code !== 1000) { if (res.code !== 1000) {
return; return;
} }
const { let {
channelLevelTag = '', channelLevelTag = '',
channelTypes = [], channelTypes,
upperMembers = [], upperMembers,
} = res.data; } = res.data;
channelTypes = channelTypes || [];
upperMembers = upperMembers || [];
formActions.setFieldState('tabs', state => { formActions.setFieldState('tabs', state => {
state.props['x-component-props'] = state.props['x-component-props'] =
state.props['x-component-props'] || {}; state.props['x-component-props'] || {};
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-24 17:47:32 * @Date: 2021-05-24 17:47:32
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 18:47:45 * @LastEditTime: 2021-06-09 10:54:28
* @Description: 审核Form抽屉 * @Description: 审核Form抽屉
*/ */
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
...@@ -156,10 +156,12 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => { ...@@ -156,10 +156,12 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => {
if (!channelInfo) { if (!channelInfo) {
return; return;
} }
const { let {
upperMembers = [], upperMembers,
channelTypes = [], channelTypes,
} = channelInfo; } = channelInfo;
upperMembers = upperMembers || [];
channelTypes = channelTypes || [];
const channelType = channelTypes.map(item => ({ label: item.channelTypeName, value: item.channelTypeId })); const channelType = channelTypes.map(item => ({ label: item.channelTypeName, value: item.channelTypeId }));
// 渠道上级id,如果没有也是返回只有一项的数组 // 渠道上级id,如果没有也是返回只有一项的数组
......
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