| | |
| | | if (Array.isArray(listValue)) { |
| | | return listValue; |
| | | } |
| | | if (Array.isArray(idsValue)) { |
| | | return idsValue; |
| | | } |
| | | if (typeof idsValue === 'string' && idsValue) { |
| | | return idsValue |
| | | .split(',') |
| | | .filter(Boolean) |
| | | .map((item) => Number(item)); |
| | | } |
| | | if (idsValue !== undefined && idsValue !== null && idsValue !== '') { |
| | | return [idsValue]; |
| | | } |
| | | return []; |
| | | }; |
| | |
| | | res.data.subClassifyIdList = normalizeIdList( |
| | | res.data.subClassifyIdList, |
| | | res.data.subClassifyIds, |
| | | ); |
| | | res.data.mainClassifyIdList = normalizeIdList( |
| | | res.data.mainClassifyIdList, |
| | | res.data.mainClassifyIds || res.data.mainClassifyId, |
| | | ); |
| | | res.data.isShowPrice = res.data.isShowPrice == 1; |
| | | setDetail(res.data); |
| | |
| | | </Form.Item> |
| | | <Form.Item |
| | | label="师傅接单主品类" |
| | | name="mainClassifyId" |
| | | name="mainClassifyIdList" |
| | | rules={[{ required: true, message: '请选择主品类' }]} |
| | | > |
| | | <Select |
| | | allowClear |
| | | showSearch |
| | | mode="multiple" |
| | | optionFilterProp="label" |
| | | disabled={disabled} |
| | | options={classifyOptions} |
| | | placeholder="请选择" |
| | | placeholder="请选择(可多选)" |
| | | /> |
| | | </Form.Item> |
| | | {renderRangeItem( |