Commit 03c38052 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat: 新增解析内部外部状态

parent 02f48d68
...@@ -4,9 +4,9 @@ import moment from 'moment'; ...@@ -4,9 +4,9 @@ import moment from 'moment';
interface DatePickerSelectPropsType { interface DatePickerSelectPropsType {
/** 开始时间name */ /** 开始时间name */
startTimeName: string, startTimeName?: string,
/** 结束时间name */ /** 结束时间name */
endTimeName: string, endTimeName?: string,
} }
const DatePickerSelect: React.FC<DatePickerSelectPropsType> = (props) => { const DatePickerSelect: React.FC<DatePickerSelectPropsType> = (props) => {
...@@ -83,4 +83,8 @@ const DatePickerSelect: React.FC<DatePickerSelectPropsType> = (props) => { ...@@ -83,4 +83,8 @@ const DatePickerSelect: React.FC<DatePickerSelectPropsType> = (props) => {
) )
} }
DatePickerSelect.displayName = 'DatePicker'; DatePickerSelect.displayName = 'DatePicker';
DatePickerSelect.defaultProps = {
startTimeName: '开始时间',
endTimeName: '结束时间',
}
export default DatePickerSelect export default DatePickerSelect
import { FormEffectHooks } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const { onFormMount$ } = FormEffectHooks
export const useBusinessEffects = (externalStatusFetch, interiorStatusFetch ) => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
externalStatusFetch && externalStatusFetch().then(res => {
const _enum = res.data.map((item) => {return { label: item.name || item.message, value: item.satatus || item.code }})
linkage.enum('externalState',_enum)
linkage.enum('externalStatusList',_enum)
})
interiorStatusFetch && interiorStatusFetch().then(res => {
const _enum = res.data.map((item) => {return { label: item.name || item.message, value: item.satatus || item.code }})
linkage.enum('interiorState',_enum)
linkage.enum('innerStatusList',_enum)
})
})
}
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