diff --git a/src/views/emergency/aed/location/locationList.data.ts b/src/views/emergency/aed/location/locationList.data.ts index a82a4b6..3a94eb9 100644 --- a/src/views/emergency/aed/location/locationList.data.ts +++ b/src/views/emergency/aed/location/locationList.data.ts @@ -167,27 +167,60 @@ export const formSchema: FormSchema[] = [ componentProps: () => ({ format: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD', style: { width: '100%' } }), }, { - label: '布点地址', + label: '地点', + field: 'geoCollectType', + component: 'RadioGroup', + required: true, + defaultValue: '0', + componentProps: { + options: [ + { + value: '0', + label: '地图选点', + }, + { + value: '1', + label: '手动输入', + }, + ], + }, + }, + { + label: '地图选点', field: 'installAddress', component: 'Input', slot: 'installAddress', - rules: [{ required: true, message: '请选择布点位置' }], + dynamicRules: ({ values }) => { + return [ + { + required: values.geoCollectType == 0, + message: '请进行地图选点', + }, + ]; + }, + // required: ({ values }) => values.geoCollectType == 0, + show: ({ values }) => values.geoCollectType == 0, }, { label: '经度', field: 'longitude', - component: 'InputNumber', - componentProps: () => ({ style: { width: '100%' } }), - show: false, - // required: true, + component: 'Input', + required: ({ values }) => values.geoCollectType == 1, + show: ({ values }) => values.geoCollectType == 1, }, { label: '纬度', field: 'latitude', - component: 'InputNumber', - componentProps: () => ({ style: { width: '100%' } }), - show: false, - // required: true, + component: 'Input', + required: ({ values }) => values.geoCollectType == 1, + show: ({ values }) => values.geoCollectType == 1, + }, + { + label: '详细地址', + field: 'installAddress', + component: 'Input', + required: ({ values }) => values.geoCollectType == 1, + show: ({ values }) => values.geoCollectType == 1, }, { label: '覆盖人数',