|
@@ -27,6 +27,7 @@
|
|
import { updateCameraType } from '/@/api/device';
|
|
import { updateCameraType } from '/@/api/device';
|
|
import { agentNewList } from '/@/api/dealer';
|
|
import { agentNewList } from '/@/api/dealer';
|
|
import { CameraList } from '/@/api/order';
|
|
import { CameraList } from '/@/api/order';
|
|
|
|
+ import { cameraAllType, wifiPrefixAll } from '/@/api/account';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
@@ -54,39 +55,74 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
field: 'cameraType',
|
|
field: 'cameraType',
|
|
- component: 'Select',
|
|
|
|
|
|
+ component: 'ApiSelect',
|
|
label: '设备类型',
|
|
label: '设备类型',
|
|
required: true,
|
|
required: true,
|
|
colProps: {
|
|
colProps: {
|
|
span: 18,
|
|
span: 18,
|
|
},
|
|
},
|
|
componentProps: {
|
|
componentProps: {
|
|
- options: [
|
|
|
|
- {
|
|
|
|
- label: t('routes.product.type.1'),
|
|
|
|
- value: '1',
|
|
|
|
- key: '1',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: t('routes.product.type.9'),
|
|
|
|
- value: '9',
|
|
|
|
- key: '9',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: t('routes.product.type.10'),
|
|
|
|
- value: '10',
|
|
|
|
- key: '10',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: t('routes.product.type.11'),
|
|
|
|
- value: '11',
|
|
|
|
- key: '1',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ api: cameraAllType,
|
|
|
|
+ numberToString: true,
|
|
|
|
+ labelField: 'name',
|
|
|
|
+ valueField: 'cameraType',
|
|
|
|
+ immediate: true,
|
|
|
|
+ params: {
|
|
|
|
+ agentName: '',
|
|
|
|
+ },
|
|
|
|
+ onChange: (value) => {
|
|
|
|
+ console.log('onChange', value);
|
|
|
|
+ updateSchema([
|
|
|
|
+ { field: 'wifiNamePrefix', ifShow: value == 1, },
|
|
|
|
+ ]);
|
|
|
|
+ },
|
|
|
|
+ // options: [
|
|
|
|
+ // {
|
|
|
|
+ // label: t('routes.product.type.1'),
|
|
|
|
+ // value: '1',
|
|
|
|
+ // key: '1',
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // label: t('routes.product.type.9'),
|
|
|
|
+ // value: '9',
|
|
|
|
+ // key: '9',
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // label: t('routes.product.type.10'),
|
|
|
|
+ // value: '10',
|
|
|
|
+ // key: '10',
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // label: t('routes.product.type.11'),
|
|
|
|
+ // value: '11',
|
|
|
|
+ // key: '1',
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ field: 'wifiNamePrefix',
|
|
|
|
+ component: 'ApiSelect',
|
|
|
|
+ label: 'wifi前缀',
|
|
|
|
+ required: true,
|
|
|
|
+ colProps: {
|
|
|
|
+ span: 18,
|
|
|
|
+ },
|
|
|
|
+ componentProps: {
|
|
|
|
+ api: wifiPrefixAll,
|
|
|
|
+ labelField: 'wifiNamePrefix',
|
|
|
|
+ // numberToString: false,
|
|
|
|
+ valueField: 'id',
|
|
|
|
+ params: {
|
|
|
|
+ cameraType: '1',
|
|
|
|
+ },
|
|
|
|
+ onChange: (value) => {
|
|
|
|
+ console.log('onChange', value);
|
|
|
|
+ },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
];
|
|
];
|
|
- const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
|
|
|
|
|
|
+ const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
|
|
labelWidth: 120,
|
|
labelWidth: 120,
|
|
schemas,
|
|
schemas,
|
|
showActionButtonGroup: false,
|
|
showActionButtonGroup: false,
|
|
@@ -103,10 +139,13 @@
|
|
|
|
|
|
function onDataReceive(data) {
|
|
function onDataReceive(data) {
|
|
modelRef.value = data;
|
|
modelRef.value = data;
|
|
|
|
+ let wifiNamePrefix = data.wifiName.indexOf('YUNPRO_') != -1 ? 8 : 2;
|
|
const { type } = data;
|
|
const { type } = data;
|
|
resetFields();
|
|
resetFields();
|
|
|
|
+ updateSchema([{ field: 'wifiNamePrefix', ifShow: type == 1 }]);
|
|
setFieldsValue({
|
|
setFieldsValue({
|
|
...data,
|
|
...data,
|
|
|
|
+ wifiNamePrefix,
|
|
cameraType: type,
|
|
cameraType: type,
|
|
});
|
|
});
|
|
}
|
|
}
|