| | |
| | | not_found: "Either you typed a wrong URL, or you followed a bad link.", |
| | | yes: "Yes", |
| | | unsaved_changes: |
| | | "Some of your changes weren't saved. Are you sure you want to ignore them?", |
| | | "您所做的部分更改尚未保存。确定要忽略这些更改吗?", |
| | | }, |
| | | navigation: { |
| | | no_results: "没有找到数据", |
| | |
| | | fields: '扩展字段', |
| | | fieldsItem: '扩展字段明细', |
| | | warehouseAreasItem: '库区库存信息', |
| | | deviceSite: '站点管理', |
| | | deviceSite: '路径管理', |
| | | waitPakin: '组拖通知档', |
| | | waitPakinItem: '组拖档明细', |
| | | waitPakinLog: '组拖历史档', |
| | |
| | | label={translate("table.field.deviceSite.type")} |
| | | name="type" |
| | | validate={[required()]} |
| | | dictTypeCode="sys_task_type" |
| | | dictTypeCode="sys_task_type" |
| | | multiple |
| | | /> |
| | | perPage={REFERENCE_INPUT_PAGESIZE} |
| | | pagination={true} |
| | | sort={{ field: 'id', order: 'ASC' }} |
| | | filter={{ active: true }} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | const DictionarySelect = (props) => { |
| | | const { dictTypeCode, name, multiple = false, ...parmas } = props; |
| | | const { |
| | | dictTypeCode, |
| | | name, |
| | | multiple = false, |
| | | perPage = 100, // 默认每页显示100条数据 |
| | | page = 1, // 默认第一页 |
| | | ...parmas |
| | | } = props; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const [list, setList] = useState([]) |
| | | const [list, setList] = useState([]); |
| | | const [loading, setLoading] = useState(false); |
| | | |
| | | useEffect(() => { |
| | | http() |
| | | }, [dictTypeCode]); |
| | | http(); |
| | | }, [dictTypeCode, page, perPage]); |
| | | |
| | | const http = async () => { |
| | | const res = await request.post('/dictData/page', { dictTypeCode }); |
| | | if (res?.data?.code === 200) { |
| | | |
| | | setList(res.data.data.records.map((item) => { |
| | | return { |
| | | id: item.value, |
| | | name: item.label |
| | | } |
| | | })) |
| | | } else { |
| | | notify(res.data.msg); |
| | | setLoading(true); |
| | | try { |
| | | const res = await request.post('/dictData/page', { |
| | | dictTypeCode, |
| | | current: page, |
| | | pageSize: perPage |
| | | }); |
| | | |
| | | if (res?.data?.code === 200) { |
| | | setList(res.data.data.records.map((item) => { |
| | | return { |
| | | id: item.value, |
| | | name: item.label |
| | | } |
| | | })); |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | } catch (error) { |
| | | notify('加载字典数据失败', 'error'); |
| | | console.error('加载字典数据失败:', error); |
| | | } finally { |
| | | setLoading(false); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | const InputComponent = multiple ? SelectArrayInput : SelectInput; |
| | | |
| | | return ( |
| | | <InputComponent |
| | | source={name} |
| | | choices={list} |
| | | isLoading={loading} |
| | | {...parmas} |
| | | /> |
| | | |
| | | ); |
| | | }; |
| | | |
| | |
| | | <NumberField source="startDeviceNo" label="table.field.deviceBind.startDeviceNo" /> |
| | | <NumberField source="endDeviceNo" label="table.field.deviceBind.endDeviceNo" /> |
| | | <TextField source="staList" label="table.field.deviceBind.staList" /> |
| | | <NumberField source="typeId" label="table.field.deviceBind.typeId" /> |
| | | <ReferenceField source="typeId" label="table.field.deviceBind.typeId" reference="warehouseAreas" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <TextField source="beSimilar" label="table.field.deviceBind.beSimilar" /> |
| | | <TextField source="emptySimilar" label="table.field.deviceBind.emptySimilar" /> |
| | | |