tangning hace 11 meses
padre
commit
ff534d80a8

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = ./
 
 # Cross-domain proxy, you can configure multiple
 # Please note that no line breaks
-VITE_PROXY = [["/qjkankan","https://test.4dkankan.com/qjkankan"],["/takelook","https://v4-test.4dkankan.com/takelook"],["/upload","https://v4-uat.4dkankan.com/service/manage/common/upload/files"],["/service","https://testeur.4dkankan.com/service"],["/ucenter","https://testeur.4dkankan.com/ucenter"]]
+VITE_PROXY = [["/qjkankan","https://test.4dkankan.com/qjkankan"],["/takelook","https://v4-test.4dkankan.com/takelook"],["/upload","https://v4-uat.4dkankan.com/service/manage/common/upload/files"],["/service","https://test.4dkankan.com/service"],["/ucenter","https://test.4dkankan.com/ucenter"]]
 # VITE_PROXY=[["/api","https://vvbin.cn/test"]]
 
 # Delete console

+ 71 - 1
src/views/product/rtk/AddModal.vue

@@ -24,6 +24,8 @@
   import { uploadApi } from '/@/api/product/index';
   import { rtkDevicesaveOrEdit } from '/@/api/rtk/index';
   import { useI18n } from '/@/hooks/web/useI18n';
+  import { useUserStore } from '/@/store/modules/user';
+  import moment from 'moment';
 
   const { t } = useI18n();
   export default defineComponent({
@@ -33,6 +35,8 @@
     },
     emits: ['update', 'register'],
     setup(props, { emit }) {
+      const userStore = useUserStore();
+      const iseur = userStore.isEnv;
       const modelRef = ref({
         operator: '中国移动',
         ipAddr: '120.253.239.161',
@@ -42,7 +46,55 @@
       const fileFlow = reactive({
         file: null,
         title: '新增RTK账号',
-      });
+      });let disabledDate = (current: any) => {
+        return current && current < moment().subtract(1, 'days').endOf('day');
+      };
+      let range = (start: any, end: any) => {
+        const result = [];
+        for (let i = start; i < end; i++) {
+          result.push(i);
+        }
+        return result;
+      };
+      let disabledDateTime = (current: any) => {
+        if (current) {
+          let today = moment().date();
+          if (today == current.date()) {
+            let minute = Number(moment().minutes());
+            let hour = Number(moment().hour());
+            let finalHour: number, finalMinute: number;
+            console.log('today', minute, current.hour(), hour);
+            // if (current.hour() > hour) {
+            //   finalMinute = 0;
+            // } else {
+            if (current.minute() >= 58) {
+              finalHour = hour + 1;
+              finalMinute = 0;
+            } else {
+              finalHour = hour;
+              finalMinute = minute + 5;
+            }
+            // }
+            console.log('today', finalHour, finalMinute);
+            return {
+              disabledHours: () => range(0, finalHour),
+              disabledMinutes: () => range(0, finalMinute),
+            };
+          } else if (moment() > current) {
+            return {
+              disabledHours: () => range(0, 24),
+              disabledMinutes: () => range(0, 60),
+              disabledSeconds: () => range(0, 60),
+            };
+          }
+        } else {
+          return {
+            disabledHours: () => range(0, 24),
+            disabledMinutes: () => range(0, 60),
+            disabledSeconds: () => range(0, 60),
+          };
+        }
+      };
       const { createMessage } = useMessage();
       const schemas: FormSchema[] = [
         {
@@ -170,6 +222,23 @@
             span: 20,
           },
         },
+        {
+          field: 'failureTime',
+          component: 'DatePicker',
+          label: '到期日期',
+          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 }] =
         useForm({
@@ -205,6 +274,7 @@
           { field: 'port', ifShow },
           { field: 'userName', ifShow },
           // { field: 'sgRtkSn', ifShow },
+          { field: 'failureTime', ifShow: val == 1 && !iseur },
           { field: 'password', ifShow },
           { field: 'operator', ifShow },
         ]);

+ 1 - 4
src/views/product/rtk/AddenvModal.vue

@@ -24,7 +24,6 @@
   import { uploadApi, rtksaveOrEdit } from '/@/api/product/index';
   import { useI18n } from '/@/hooks/web/useI18n';
   import moment from 'moment';
-  import { useUserStore } from '/@/store/modules/user';
 
   const { t } = useI18n();
   export default defineComponent({
@@ -34,8 +33,6 @@
     },
     emits: ['update', 'register'],
     setup(props, { emit }) {
-      const userStore = useUserStore();
-      const iseur = userStore.isEnv;
       const modelRef = ref({
         operator: '中国移动',
         ipAddr: '120.253.239.161',
@@ -371,7 +368,7 @@
           { field: 'mountPoint', ifShow },
           { field: 'port', ifShow },
           { field: 'userName', ifShow },
-          { field: 'failureTime', ifShow: val == 1 && !iseur },
+          // { field: 'sgRtkSn', ifShow },
           { field: 'password', ifShow },
           { field: 'operator', ifShow },
         ]);

+ 6 - 0
src/views/product/rtk/data.ts

@@ -254,6 +254,12 @@ export const rtkdeviceColumns: any[] = [
     width: 120,
   },
   {
+    title: '到期时间',
+    ellipsis: true,
+    dataIndex: 'failureTime',
+    width: 120,
+  },
+  {
     title: '状态',
     dataIndex: 'useStatus',
     width: 60,