Browse Source

feat:修改白名单

DESKTOP-USV654P\pc 6 months ago
parent
commit
4f8c55b706
1 changed files with 16 additions and 2 deletions
  1. 16 2
      src/views/educational/whiteList/index.vue

+ 16 - 2
src/views/educational/whiteList/index.vue

@@ -43,6 +43,7 @@
   import FormImport from '/@/views/sys/import/index.vue';
   import { useModal } from '/@/components/Modal';
   import DateSetting from './components/setting.vue';
+  import { formatToDate } from '/@/utils/dateUtil';
 
   const { createConfirm, createMessage } = useMessage();
 
@@ -101,8 +102,8 @@
         align: 'left',
         width: 80,
         customRender: ({ record }) => {
-          const isTemporary = record.isTemporary === 0;
-          const text = isTemporary ? '永久' : '临时';
+          const isTemporary = formatToDate(new Date()) <= formatToDate(record.endTime);
+          const text = isTemporary ? '正常' : '失效';
           const color = isTemporary ? 'success' : 'error';
           return h(
             'span',
@@ -157,6 +158,19 @@
             getPopupContainer: () => document.body,
           },
         },
+        {
+          field: 'isTemporary',
+          label: '状态',
+          component: 'Select',
+          colProps: { span: 8 },
+          componentProps: {
+            options: [
+              { label: '正常', value: 0 },
+              { label: '失效', value: 1 },
+            ],
+            getPopupContainer: () => document.body,
+          },
+        },
       ],
     },
     useSearchForm: true,