|
@@ -22,7 +22,7 @@
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { uploadApi } from '/@/api/product/index';
|
|
import { uploadApi } from '/@/api/product/index';
|
|
- import { rtkaccountFormSchema } from './data'
|
|
|
|
|
|
+ import { rtkaccountFormSchema } from './data';
|
|
import { rtkDevicesaveOrEdit } from '/@/api/rtk/index';
|
|
import { rtkDevicesaveOrEdit } from '/@/api/rtk/index';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
@@ -47,7 +47,8 @@
|
|
const fileFlow = reactive({
|
|
const fileFlow = reactive({
|
|
file: null,
|
|
file: null,
|
|
title: '新增RTK账号',
|
|
title: '新增RTK账号',
|
|
- });let disabledDate = (current: any) => {
|
|
|
|
|
|
+ });
|
|
|
|
+ let disabledDate = (current: any) => {
|
|
return current && current < moment().subtract(1, 'days').endOf('day');
|
|
return current && current < moment().subtract(1, 'days').endOf('day');
|
|
};
|
|
};
|
|
let range = (start: any, end: any) => {
|
|
let range = (start: any, end: any) => {
|
|
@@ -148,7 +149,7 @@
|
|
componentProps: {
|
|
componentProps: {
|
|
maxLength: 50,
|
|
maxLength: 50,
|
|
onChange: (value) => {
|
|
onChange: (value) => {
|
|
- handlertkSn(value.target.value);
|
|
|
|
|
|
+ // handlertkSn(value.target.value);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
colProps: {
|
|
colProps: {
|
|
@@ -199,7 +200,7 @@
|
|
{
|
|
{
|
|
required: true,
|
|
required: true,
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
- validator: (rule, value, ) => {
|
|
|
|
|
|
+ validator: (rule, value) => {
|
|
function isSpec(s) {
|
|
function isSpec(s) {
|
|
var pattern = /[~!@#$%^&*<>|']/gi;
|
|
var pattern = /[~!@#$%^&*<>|']/gi;
|
|
return pattern.test(s);
|
|
return pattern.test(s);
|
|
@@ -284,29 +285,32 @@
|
|
},
|
|
},
|
|
// required: true,
|
|
// required: true,
|
|
},
|
|
},
|
|
- {
|
|
|
|
- field: 'failureTime',
|
|
|
|
- component: 'DatePicker',
|
|
|
|
- label: '到期日期',
|
|
|
|
- ifShow: false,
|
|
|
|
- colProps: {
|
|
|
|
- span: 16,
|
|
|
|
- },
|
|
|
|
- componentProps: {
|
|
|
|
- disabledDate: disabledDate,
|
|
|
|
- disabledTime: disabledDateTime,
|
|
|
|
- showTime: { defaultValue: moment('23:59:59', 'HH:mm:ss') },
|
|
|
|
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
-
|
|
|
|
- // defaultValue: dayjs().add(7, 'day').format('YYYY-MM-DD') + ' 23:59:59',
|
|
|
|
- format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
];
|
|
];
|
|
const [registerForm, { validate, resetFields, setFieldsValue, updateSchema, clearValidate }] =
|
|
const [registerForm, { validate, resetFields, setFieldsValue, updateSchema, clearValidate }] =
|
|
useForm({
|
|
useForm({
|
|
labelWidth: 120,
|
|
labelWidth: 120,
|
|
- schemas: [...schemas, ...rtkaccountFormSchema ],
|
|
|
|
|
|
+ schemas: [
|
|
|
|
+ ...schemas,
|
|
|
|
+ ...rtkaccountFormSchema,
|
|
|
|
+ {
|
|
|
|
+ field: 'failureTime',
|
|
|
|
+ component: 'DatePicker',
|
|
|
|
+ label: '到期日期',
|
|
|
|
+ ifShow: false,
|
|
|
|
+ colProps: {
|
|
|
|
+ span: 16,
|
|
|
|
+ },
|
|
|
|
+ componentProps: {
|
|
|
|
+ disabledDate: disabledDate,
|
|
|
|
+ disabledTime: disabledDateTime,
|
|
|
|
+ showTime: { defaultValue: moment('23:59:59', 'HH:mm:ss') },
|
|
|
|
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
+
|
|
|
|
+ // defaultValue: dayjs().add(7, 'day').format('YYYY-MM-DD') + ' 23:59:59',
|
|
|
|
+ format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
showActionButtonGroup: false,
|
|
showActionButtonGroup: false,
|
|
actionColOptions: {
|
|
actionColOptions: {
|
|
span: 18,
|
|
span: 18,
|
|
@@ -321,7 +325,7 @@
|
|
function onDataReceive(data) {
|
|
function onDataReceive(data) {
|
|
modelRef.value = data;
|
|
modelRef.value = data;
|
|
fileFlow.title = data.id ? '编辑RTK' : '新增RTK';
|
|
fileFlow.title = data.id ? '编辑RTK' : '新增RTK';
|
|
- handlertkSn(data.cameraSn ? true : false);
|
|
|
|
|
|
+ // handlertkSn(data.cameraSn ? true : false);
|
|
resetFields();
|
|
resetFields();
|
|
console.log('data', data);
|
|
console.log('data', data);
|
|
handlertkuserType(data.accountType != null ? data.accountType : 0);
|
|
handlertkuserType(data.accountType != null ? data.accountType : 0);
|
|
@@ -334,6 +338,7 @@
|
|
console.log('val', val);
|
|
console.log('val', val);
|
|
updateSchema([
|
|
updateSchema([
|
|
{ field: 'accountType', ifShow: val != 0 },
|
|
{ field: 'accountType', ifShow: val != 0 },
|
|
|
|
+ { field: 'failureTime', ifShow: val == 0 },
|
|
]);
|
|
]);
|
|
}
|
|
}
|
|
function handlertkuserType(val) {
|
|
function handlertkuserType(val) {
|
|
@@ -348,6 +353,7 @@
|
|
// { field: 'failureTime', ifShow: val == 0 && !iseur },
|
|
// { field: 'failureTime', ifShow: val == 0 && !iseur },
|
|
{ field: 'password', ifShow },
|
|
{ field: 'password', ifShow },
|
|
{ field: 'operator', ifShow },
|
|
{ field: 'operator', ifShow },
|
|
|
|
+ { field: 'failureTime', ifShow },
|
|
]);
|
|
]);
|
|
}
|
|
}
|
|
function handleCarmanType(val) {
|
|
function handleCarmanType(val) {
|