Преглед изворни кода

fix(bugs): 添加已过期和列表宽度

tangning пре 3 година
родитељ
комит
4183b2aa8a
3 измењених фајлова са 22 додато и 3 уклоњено
  1. 20 1
      src/layouts/default/header/index.vue
  2. 1 1
      src/views/devices/list.vue
  3. 1 1
      src/views/scenes/list.vue

+ 20 - 1
src/layouts/default/header/index.vue

@@ -19,7 +19,6 @@
       <LayoutBreadcrumb v-if="getShowContent && getShowBread" :theme="getHeaderTheme" />
     </div>
     <!-- left end -->
-
     <!-- menu start -->
     <div :class="`${prefixCls}-menu`" v-if="getShowTopMenu && !getIsMobile">
       <LayoutMenu
@@ -33,6 +32,9 @@
 
     <!-- action  -->
     <div :class="`${prefixCls}-action`">
+      <div v-if="expire">
+        <Tag color="pink">已过期</Tag>
+      </div>
       <!-- <AppSearch :class="`${prefixCls}-action__item `" v-if="getShowSearch" /> -->
 
       <!-- <ErrorAction v-if="getUseErrorHandle" :class="`${prefixCls}-action__item error-action`" /> -->
@@ -63,8 +65,10 @@
   import { AppLogo } from '/@/components/Application';
   import LayoutMenu from '../menu/index.vue';
   import LayoutTrigger from '../trigger/index.vue';
+  import dayjs from 'dayjs';
 
   // import { AppSearch } from '/@/components/Application';
+  import { Tag } from 'ant-design-vue';
 
   import { useHeaderSetting } from '/@/hooks/setting/useHeaderSetting';
   import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
@@ -80,6 +84,7 @@
 
   import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
   import { useLocale } from '/@/locales/useLocale';
+  import { useUserStore } from '/@/store/modules/user';
 
   export default defineComponent({
     name: 'LayoutHeader',
@@ -92,6 +97,7 @@
       UserDropDown,
       AppLocalePicker,
       FullScreen,
+      Tag,
       // Notify,
       // AppSearch,
       // ErrorAction,
@@ -104,6 +110,7 @@
     },
     setup(props) {
       const { prefixCls } = useDesign('layout-header');
+      const userStore = useUserStore();
       const {
         getShowTopMenu,
         getShowHeaderTrigger,
@@ -130,6 +137,16 @@
 
       const { getIsMobile } = useAppInject();
 
+      const userinfo = computed(() => userStore.getUserInfo);
+      const expire = computed(() => {
+        let expireTime = userinfo.value?.companyExpirationTime;
+        if (expireTime && dayjs(expireTime) < dayjs()) {
+          return true;
+        } else {
+          return false;
+        }
+      });
+      console.log('userinfo', userinfo.value);
       const getHeaderClass = computed(() => {
         const theme = unref(getHeaderTheme);
         return [
@@ -192,6 +209,8 @@
         getShowSettingButton,
         getShowSetting,
         getShowSearch,
+        userinfo,
+        expire,
       };
     },
   });

+ 1 - 1
src/views/devices/list.vue

@@ -89,7 +89,7 @@
         {
           title: t('routes.devices.companyId'),
           dataIndex: 'companyName',
-          width: 120,
+          width: 260,
         },
         {
           title: t('routes.devices.cameraType'),

+ 1 - 1
src/views/scenes/list.vue

@@ -126,7 +126,7 @@
         {
           title: t('routes.scenes.childName'),
           dataIndex: 'childName',
-          width: 120,
+          width: 200,
         },
         {
           title: t('routes.scenes.viewCount'),