|
|
@@ -22,7 +22,7 @@
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
|
|
|
|
- import { migrateApi } from '/@/api/archive/resstore';
|
|
|
+ import { migrateApi, getCameraListApi } from '/@/api/archive/resstore';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
@@ -50,12 +50,68 @@
|
|
|
label: t('routes.scenes.migrateAccount'),
|
|
|
component: 'Input',
|
|
|
required: true,
|
|
|
+ componentProps: {
|
|
|
+ onBlur: () => {
|
|
|
+ const fields = getFieldsValue();
|
|
|
+ console.log('fields', fields);
|
|
|
+ if (fields.userName) {
|
|
|
+ selectData.value.account = fields.userName;
|
|
|
+ clearValidate(['userName']);
|
|
|
+ } else {
|
|
|
+ selectData.value.account = '';
|
|
|
+ }
|
|
|
+ removeSchemaByFiled('cameraId');
|
|
|
+ appendSchemaByField(schemas[1], 'cameraId');
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
field: 'cameraId',
|
|
|
label: t('routes.scenes.migrateDevice'),
|
|
|
- component: 'Input',
|
|
|
+ component: 'ApiSelect',
|
|
|
required: true,
|
|
|
+ componentProps: {
|
|
|
+ api: async (params) => {
|
|
|
+ console.log('params', params);
|
|
|
+ if (!selectData.value.account) {
|
|
|
+ createMessage.error(t('routes.scenes.selectCameraMFirst'));
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ const res = await getCameraListApi({
|
|
|
+ userName: selectData.value.account,
|
|
|
+ type: selectData.value.tableType,
|
|
|
+ });
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // resultField: 'list',
|
|
|
+ numberToString: true,
|
|
|
+ labelField: 'snCode',
|
|
|
+ valueField: 'id',
|
|
|
+ immediate: false,
|
|
|
+ listHeight: 140,
|
|
|
+ showSearch: true,
|
|
|
+ placeholder: t('routes.scenes.rsMPlaceHolder'),
|
|
|
+ optionFilterProp: 'label',
|
|
|
+ getPopupContainer: (node) => {
|
|
|
+ if (node) {
|
|
|
+ return node.parentNode;
|
|
|
+ } else {
|
|
|
+ return document.body;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onChange: (data) => {
|
|
|
+ if (data) {
|
|
|
+ console.log('snCode', data);
|
|
|
+ clearValidate();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ params: {
|
|
|
+ page: 1,
|
|
|
+ limit: 1000,
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
const [
|