소스 검색

处理bug

yangg 1 년 전
부모
커밋
c5c9c7c413

+ 8 - 0
src/api/api.ts

@@ -78,6 +78,14 @@ export class infoApi {     // 字典,仓库,客户
     static async getExpressList(params) {//客户列表
         return request('/admin/systems/logi-companies', params, 'get')
     }
+    //admin/systems/manager/admin-users/${id}
+    static async getUser(id) {//客户列表
+        return request(`admin/systems/manager/admin-users/${id}`, '', 'get')
+    }
+    /* admin/systems/menus/children/${parent_id} */
+    static async getMenu(parent_id=0) {//客户列表
+        return request(`admin/systems/menus/children/${parent_id}`, '', 'get')
+    }
    
 }
 export class dictionaryAPI {

+ 193 - 180
src/components/layout/Header.vue

@@ -6,12 +6,11 @@
                     <router-link to="/" class="main-logo flex items-center shrink-0">
                         <img class="w-8 ltr:-ml-1 rtl:-mr-1 inline" src="/src/assets/images/logo.png" alt="" />
                         <span
-                            class="text-2xl ltr:ml-1.5 rtl:mr-1.5 font-semibold align-middle hidden md:inline dark:text-white-light transition-all duration-300"
-                            >V3studio App</span
-                        >
+                            class="text-2xl ltr:ml-1.5 rtl:mr-1.5 font-semibold align-middle hidden md:inline dark:text-white-light transition-all duration-300">V3studio
+                            App</span>
 
                     </router-link>
-<!-- 原导航 -->
+                    <!-- 原导航 -->
                     <!-- <a
                         href="javascript:;"
                         class="collapse-icon flex-none dark:text-[#d0d2d6] hover:text-primary dark:hover:text-primary flex lg:hidden ltr:ml-2 rtl:mr-2 p-2 rounded-full bg-white-light/40 dark:bg-dark/40 hover:bg-white-light/90 dark:hover:bg-dark/60"
@@ -51,8 +50,7 @@
                     </ul>
                 </div> -->
                 <div
-                    class="sm:flex-1 ltr:sm:ml-0 ltr:ml-auto sm:rtl:mr-0 rtl:mr-auto flex items-center space-x-1.5 lg:space-x-2 rtl:space-x-reverse dark:text-[#d0d2d6]"
-                >
+                    class="sm:flex-1 ltr:sm:ml-0 ltr:ml-auto sm:rtl:mr-0 rtl:mr-auto flex items-center space-x-1.5 lg:space-x-2 rtl:space-x-reverse dark:text-[#d0d2d6]">
                     <!-- <div class="sm:ltr:mr-auto sm:rtl:ml-auto">
                         <form
                             class="sm:relative absolute inset-x-0 sm:top-0 top-1/2 sm:translate-y-0 -translate-y-1/2 sm:mx-0 mx-4 z-10 sm:block hidden"
@@ -71,28 +69,19 @@
                         </button>
                     </div> -->
                     <div>
-                        <a
-                            href="javascript:;"
-                            v-show="store.theme === 'light'"
+                        <a href="javascript:;" v-show="store.theme === 'light'"
                             class="flex items-center p-2 rounded-full bg-white-light/40 dark:bg-dark/40 hover:text-primary hover:bg-white-light/90 dark:hover:bg-dark/60"
-                            @click="store.toggleTheme('dark')"
-                        >
+                            @click="store.toggleTheme('dark')">
                             <icon-sun />
                         </a>
-                        <a
-                            href="javascript:;"
-                            v-show="store.theme === 'dark'"
+                        <a href="javascript:;" v-show="store.theme === 'dark'"
                             class="flex items-center p-2 rounded-full bg-white-light/40 dark:bg-dark/40 hover:text-primary hover:bg-white-light/90 dark:hover:bg-dark/60"
-                            @click="store.toggleTheme('system')"
-                        >
+                            @click="store.toggleTheme('system')">
                             <icon-moon />
                         </a>
-                        <a
-                            href="javascript:;"
-                            v-show="store.theme === 'system'"
+                        <a href="javascript:;" v-show="store.theme === 'system'"
                             class="flex items-center p-2 rounded-full bg-white-light/40 dark:bg-dark/40 hover:text-primary hover:bg-white-light/90 dark:hover:bg-dark/60"
-                            @click="store.toggleTheme('dark')"
-                        >
+                            @click="store.toggleTheme('dark')">
                             <!-- <icon-laptop /> -->
                             <icon-sun />
 
@@ -100,7 +89,7 @@
                     </div>
 
 
-                   
+
 
                     <!-- <div class="dropdown shrink-0">
                         <Popper :placement="store.rtlClass === 'rtl' ? 'bottom-end' : 'bottom-start'" offsetDistance="8">
@@ -125,9 +114,9 @@
                                             <template v-if="notifications.length">
                                                 <span class="badge bg-primary/80" v-text="notifications.length + 'New'"></span>
                                             </template>
-                                        </div>
-                                    </li>
-                                    <template v-for="notification in notifications" :key="notification.id">
+</div>
+</li>
+<template v-for="notification in notifications" :key="notification.id">
                                         <li class="dark:text-white-light/90">
                                             <div class="group flex items-center px-4 py-2">
                                                 <div class="grid place-content-center rounded">
@@ -156,14 +145,14 @@
                                             </div>
                                         </li>
                                     </template>
-                                    <template v-if="notifications.length">
+<template v-if="notifications.length">
                                         <li>
                                             <div class="p-4">
                                                 <button class="btn btn-primary block w-full btn-small" @click="close()">Read All Notifications</button>
                                             </div>
                                         </li>
                                     </template>
-                                    <template v-if="!notifications.length">
+<template v-if="!notifications.length">
                                         <li>
                                             <div class="!grid place-content-center hover:!bg-transparent text-lg min-h-[200px]">
                                                 <div class="mx-auto ring-4 ring-primary/30 rounded-full mb-4 text-primary">
@@ -173,52 +162,49 @@
                                             </div>
                                         </li>
                                     </template>
-                                </ul>
-                            </template>
-                        </Popper>
-                    </div> -->
+</ul>
+</template>
+</Popper>
+</div> -->
 
                     <div class="dropdown shrink-0">
-                        <Popper :placement="store.rtlClass === 'rtl' ? 'bottom-end' : 'bottom-start'" offsetDistance="8" class="!block">
+                        <Popper :placement="store.rtlClass === 'rtl' ? 'bottom-end' : 'bottom-start'" offsetDistance="8"
+                            class="!block">
                             <button type="button" class="relative group block">
-                                <img
-                                    class="w-9 h-9 rounded-full object-cover saturate-50 group-hover:saturate-100"
-                                    src="/assets/images/me.jpg"
-                                    alt=""
-                                />
+                                <img class="w-9 h-9 rounded-full object-cover saturate-50 group-hover:saturate-100"
+                                    :src="face" alt="" />
                             </button>
                             <template #content="{ close }">
-                                <ul class="text-dark dark:text-white-dark !py-0 w-[230px] font-semibold dark:text-white-light/90">
+                                <ul
+                                    class="text-dark dark:text-white-dark !py-0 w-[230px] font-semibold dark:text-white-light/90">
                                     <li>
                                         <div class="flex items-center px-4 py-4">
                                             <div class="flex-none">
-                                                <img class="rounded-md w-10 h-10 object-cover" src="/assets/images/me.jpg" alt="" />
+                                                <img class="rounded-md w-10 h-10 object-cover" :src="face" alt="" />
                                             </div>
                                             <div class="ltr:pl-4 rtl:pr-4 truncate">
                                                 <h4 class="text-base">
-                                                    Johnny Liang<span class="text-xs bg-success-light rounded text-success px-1 ltr:ml-2 rtl:ml-2">Pro</span>
+                                                    {{ nickName }}<span
+                                                        class="text-xs bg-success-light rounded text-success px-1 ltr:ml-2 rtl:ml-2">Pro</span>
                                                 </h4>
-                                                <a class="text-black/60 hover:text-primary dark:text-dark-light/60 dark:hover:text-white" href="javascript:;"
-                                                    >johndoe@gmail.com</a
-                                                >
+                                                <a class="text-black/60 hover:text-primary dark:text-dark-light/60 dark:hover:text-white"
+                                                    href="javascript:;">{{ email }}</a>
                                             </div>
                                         </div>
                                     </li>
-                                    <li>
-                                        <router-link to="/users/profile" class="dark:hover:text-white" @click="close()">
+                                    <!-- <li>
+                                        <router-link to="/users/profile" class="dark:hover:text-white">
                                             <icon-user class="w-4.5 h-4.5 ltr:mr-2 rtl:ml-2 shrink-0" />
-
                                             个人信息
                                         </router-link>
-                                    </li>
-                                   
-                                
-                                    <li class="border-t border-white-light dark:border-white-light/10">
-                                        <router-link to="/auth/boxed-signin" class="text-danger !py-3" @click="close()">
-                                            <icon-logout class="w-4.5 h-4.5 ltr:mr-2 rtl:ml-2 rotate-90 shrink-0" />
+                                    </li> -->
+
 
+                                    <li class="border-t border-white-light dark:border-white-light/10">
+                                        <div class="text-danger !py-3 flex pl-4" @click="goPageList">
+                                            <icon-logout class="w-4.5 h-4.5 ltr:mr-2 rtl:ml-2 rotate-90 shrink-0 " />
                                             退出
-                                        </router-link>
+                                        </div>
                                     </li>
                                 </ul>
                             </template>
@@ -227,147 +213,174 @@
                 </div>
             </div>
 
-  
+
         </div>
     </header>
 </template>
 
 <script lang="ts" setup>
-    import { ref, onMounted, computed, reactive, watch } from 'vue';
-    import { useI18n } from 'vue-i18n';
+import { ref, onMounted, computed, reactive, watch } from 'vue';
+import { useI18n } from 'vue-i18n';
 
-    import appSetting from '@/app-setting';
+import appSetting from '@/app-setting';
+import router from '@/router';
+import { useRoute } from 'vue-router';
+import { useAppStore } from '@/stores/index';
 
-    import { useRoute } from 'vue-router';
-    import { useAppStore } from '@/stores/index';
+import IconMenu from '@/components/icon/icon-menu.vue';
+import IconCalendar from '@/components/icon/icon-calendar.vue';
+import IconEdit from '@/components/icon/icon-edit.vue';
+import IconChatNotification from '@/components/icon/icon-chat-notification.vue';
+import IconSearch from '@/components/icon/icon-search.vue';
+import IconXCircle from '@/components/icon/icon-x-circle.vue';
+import IconSun from '@/components/icon/icon-sun.vue';
+import IconMoon from '@/components/icon/icon-moon.vue';
+import IconLaptop from '@/components/icon/icon-laptop.vue';
+import IconMailDot from '@/components/icon/icon-mail-dot.vue';
+import IconArrowLeft from '@/components/icon/icon-arrow-left.vue';
+import IconInfoCircle from '@/components/icon/icon-info-circle.vue';
+import IconBellBing from '@/components/icon/icon-bell-bing.vue';
+import IconUser from '@/components/icon/icon-user.vue';
+import IconMail from '@/components/icon/icon-mail.vue';
+import IconLockDots from '@/components/icon/icon-lock-dots.vue';
+import IconLogout from '@/components/icon/icon-logout.vue';
+import IconMenuDashboard from '@/components/icon/menu/icon-menu-dashboard.vue';
+import IconCaretDown from '@/components/icon/icon-caret-down.vue';
+import IconMenuApps from '@/components/icon/menu/icon-menu-apps.vue';
+import IconMenuComponents from '@/components/icon/menu/icon-menu-components.vue';
+import IconMenuElements from '@/components/icon/menu/icon-menu-elements.vue';
+import IconMenuDatatables from '@/components/icon/menu/icon-menu-datatables.vue';
+import IconMenuForms from '@/components/icon/menu/icon-menu-forms.vue';
+import IconMenuPages from '@/components/icon/menu/icon-menu-pages.vue';
+import IconMenuMore from '@/components/icon/menu/icon-menu-more.vue';
+import { infoApi } from '@/api/api'
+const store = useAppStore();
+const route = useRoute();
+const search = ref(false);
 
-    import IconMenu from '@/components/icon/icon-menu.vue';
-    import IconCalendar from '@/components/icon/icon-calendar.vue';
-    import IconEdit from '@/components/icon/icon-edit.vue';
-    import IconChatNotification from '@/components/icon/icon-chat-notification.vue';
-    import IconSearch from '@/components/icon/icon-search.vue';
-    import IconXCircle from '@/components/icon/icon-x-circle.vue';
-    import IconSun from '@/components/icon/icon-sun.vue';
-    import IconMoon from '@/components/icon/icon-moon.vue';
-    import IconLaptop from '@/components/icon/icon-laptop.vue';
-    import IconMailDot from '@/components/icon/icon-mail-dot.vue';
-    import IconArrowLeft from '@/components/icon/icon-arrow-left.vue';
-    import IconInfoCircle from '@/components/icon/icon-info-circle.vue';
-    import IconBellBing from '@/components/icon/icon-bell-bing.vue';
-    import IconUser from '@/components/icon/icon-user.vue';
-    import IconMail from '@/components/icon/icon-mail.vue';
-    import IconLockDots from '@/components/icon/icon-lock-dots.vue';
-    import IconLogout from '@/components/icon/icon-logout.vue';
-    import IconMenuDashboard from '@/components/icon/menu/icon-menu-dashboard.vue';
-    import IconCaretDown from '@/components/icon/icon-caret-down.vue';
-    import IconMenuApps from '@/components/icon/menu/icon-menu-apps.vue';
-    import IconMenuComponents from '@/components/icon/menu/icon-menu-components.vue';
-    import IconMenuElements from '@/components/icon/menu/icon-menu-elements.vue';
-    import IconMenuDatatables from '@/components/icon/menu/icon-menu-datatables.vue';
-    import IconMenuForms from '@/components/icon/menu/icon-menu-forms.vue';
-    import IconMenuPages from '@/components/icon/menu/icon-menu-pages.vue';
-    import IconMenuMore from '@/components/icon/menu/icon-menu-more.vue';
+// multi language
+const i18n = reactive(useI18n());
+let uid = ref('')
+let face = ref('')
+let nickName = ref('')
+let email = ref("")
+watch(route, (to, from) => {
+    // 检查本地存储中是否存在用户信息
+    if (localStorage.getItem('USER') !== null) {
+        uid = JSON.parse(localStorage.getItem('USER')).uid
+        init(uid)
+    } else {
+        router.push(({ path: '/login' }))
+    }
+});
+const changeLanguage = (item: any) => {
+    i18n.locale = item.code;
+    appSetting.toggleLanguage(item);
+};
+const currentFlag = computed(() => {
+    return `/assets/images/flags/${i18n.locale.toUpperCase()}.svg`;
+});
+const init = (uid) => {
+    infoApi.getUser(uid).then((res: any) => {
+        face = res.data.face
+        nickName = res.data.nickname
+        email = res.data.email
+    })
+}
+const notifications = ref([
+    {
+        id: 1,
+        profile: 'user-profile.jpeg',
+        message: '<strong class="text-sm mr-1">John Doe</strong>invite you to <strong>Prototyping</strong>',
+        time: '45 min ago',
+    },
+    {
+        id: 2,
+        profile: 'profile-34.jpeg',
+        message: '<strong class="text-sm mr-1">Adam Nolan</strong>mentioned you to <strong>UX Basics</strong>',
+        time: '9h Ago',
+    },
+    {
+        id: 3,
+        profile: 'profile-16.jpeg',
+        message: '<strong class="text-sm mr-1">Anna Morgan</strong>Upload a file',
+        time: '9h Ago',
+    },
+]);
 
-    const store = useAppStore();
-    const route = useRoute();
-    const search = ref(false);
-
-    // multi language
-    const i18n = reactive(useI18n());
-    const changeLanguage = (item: any) => {
-        i18n.locale = item.code;
-        appSetting.toggleLanguage(item);
-    };
-    const currentFlag = computed(() => {
-        return `/assets/images/flags/${i18n.locale.toUpperCase()}.svg`;
-    });
+const messages = ref([
+    {
+        id: 1,
+        image: '<span class="grid place-content-center w-9 h-9 rounded-full bg-success-light dark:bg-success text-success dark:text-success-light"><svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg></span>',
+        title: 'Congratulations!',
+        message: 'Your OS has been updated.',
+        time: '1hr',
+    },
+    {
+        id: 2,
+        image: '<span class="grid place-content-center w-9 h-9 rounded-full bg-info-light dark:bg-info text-info dark:text-info-light"><svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg></span>',
+        title: 'Did you know?',
+        message: 'You can switch between artboards.',
+        time: '2hr',
+    },
+    {
+        id: 3,
+        image: '<span class="grid place-content-center w-9 h-9 rounded-full bg-danger-light dark:bg-danger text-danger dark:text-danger-light"> <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></span>',
+        title: 'Something went wrong!',
+        message: 'Send Reposrt',
+        time: '2days',
+    },
+    {
+        id: 4,
+        image: '<span class="grid place-content-center w-9 h-9 rounded-full bg-warning-light dark:bg-warning text-warning dark:text-warning-light"><svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">    <circle cx="12" cy="12" r="10"></circle>    <line x1="12" y1="8" x2="12" y2="12"></line>    <line x1="12" y1="16" x2="12.01" y2="16"></line></svg></span>',
+        title: 'Warning',
+        message: 'Your password strength is low.',
+        time: '5days',
+    },
+]);
 
-    const notifications = ref([
-        {
-            id: 1,
-            profile: 'user-profile.jpeg',
-            message: '<strong class="text-sm mr-1">John Doe</strong>invite you to <strong>Prototyping</strong>',
-            time: '45 min ago',
-        },
-        {
-            id: 2,
-            profile: 'profile-34.jpeg',
-            message: '<strong class="text-sm mr-1">Adam Nolan</strong>mentioned you to <strong>UX Basics</strong>',
-            time: '9h Ago',
-        },
-        {
-            id: 3,
-            profile: 'profile-16.jpeg',
-            message: '<strong class="text-sm mr-1">Anna Morgan</strong>Upload a file',
-            time: '9h Ago',
-        },
-    ]);
+onMounted(() => {
+    uid = JSON.parse(localStorage.getItem('USER')).uid
+    init(uid)
+    setActiveDropdown();
+});
 
-    const messages = ref([
-        {
-            id: 1,
-            image: '<span class="grid place-content-center w-9 h-9 rounded-full bg-success-light dark:bg-success text-success dark:text-success-light"><svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg></span>',
-            title: 'Congratulations!',
-            message: 'Your OS has been updated.',
-            time: '1hr',
-        },
-        {
-            id: 2,
-            image: '<span class="grid place-content-center w-9 h-9 rounded-full bg-info-light dark:bg-info text-info dark:text-info-light"><svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg></span>',
-            title: 'Did you know?',
-            message: 'You can switch between artboards.',
-            time: '2hr',
-        },
-        {
-            id: 3,
-            image: '<span class="grid place-content-center w-9 h-9 rounded-full bg-danger-light dark:bg-danger text-danger dark:text-danger-light"> <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></span>',
-            title: 'Something went wrong!',
-            message: 'Send Reposrt',
-            time: '2days',
-        },
-        {
-            id: 4,
-            image: '<span class="grid place-content-center w-9 h-9 rounded-full bg-warning-light dark:bg-warning text-warning dark:text-warning-light"><svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">    <circle cx="12" cy="12" r="10"></circle>    <line x1="12" y1="8" x2="12" y2="12"></line>    <line x1="12" y1="16" x2="12.01" y2="16"></line></svg></span>',
-            title: 'Warning',
-            message: 'Your password strength is low.',
-            time: '5days',
-        },
-    ]);
+watch(route, (to, from) => {
+    setActiveDropdown();
+});
 
-    onMounted(() => {
-        setActiveDropdown();
-    });
-
-    watch(route, (to, from) => {
-        setActiveDropdown();
-    });
-
-    const setActiveDropdown = () => {
-        const selector = document.querySelector('ul.horizontal-menu a[href="' + window.location.pathname + '"]');
-        if (selector) {
-            selector.classList.add('active');
-            const all: any = document.querySelectorAll('ul.horizontal-menu .nav-link.active');
-            for (let i = 0; i < all.length; i++) {
-                all[0]?.classList.remove('active');
-            }
-            const ul: any = selector.closest('ul.sub-menu');
-            if (ul) {
-                let ele: any = ul.closest('li.menu').querySelectorAll('.nav-link');
-                if (ele) {
-                    ele = ele[0];
-                    setTimeout(() => {
-                        ele?.classList.add('active');
-                    });
-                }
+const setActiveDropdown = () => {
+    const selector = document.querySelector('ul.horizontal-menu a[href="' + window.location.pathname + '"]');
+    if (selector) {
+        selector.classList.add('active');
+        const all: any = document.querySelectorAll('ul.horizontal-menu .nav-link.active');
+        for (let i = 0; i < all.length; i++) {
+            all[0]?.classList.remove('active');
+        }
+        const ul: any = selector.closest('ul.sub-menu');
+        if (ul) {
+            let ele: any = ul.closest('li.menu').querySelectorAll('.nav-link');
+            if (ele) {
+                ele = ele[0];
+                setTimeout(() => {
+                    ele?.classList.add('active');
+                });
             }
         }
-    };
+    }
+};
 
-    const removeNotification = (value: number) => {
-        notifications.value = notifications.value.filter((d) => d.id !== value);
-    };
+const removeNotification = (value: number) => {
+    notifications.value = notifications.value.filter((d) => d.id !== value);
+};
 
-    const removeMessage = (value: number) => {
-        messages.value = messages.value.filter((d) => d.id !== value);
-    };
+const removeMessage = (value: number) => {
+    messages.value = messages.value.filter((d) => d.id !== value);
+};
+const goPageList = (item?: any) => {
+    localStorage.removeItem('USER')
+    router.replace({
+        name: 'login',
+    });
+}
 </script>

+ 64 - 52
src/layouts/app-layout.vue

@@ -2,46 +2,39 @@
     <!--  BEGIN MAIN CONTAINER  -->
     <div class="relative">
         <!-- sidebar menu overlay -->
-        <div class="fixed inset-0 bg-[black]/60 z-50 lg:hidden" :class="{ hidden: !store.sidebar }" @click="store.toggleSidebar()"></div>
+        <div class="fixed inset-0 bg-[black]/60 z-50 lg:hidden" :class="{ hidden: !store.sidebar }"
+            @click="store.toggleSidebar()"></div>
 
         <!-- screen loader -->
-        <div
-            v-show="store.isShowMainLoader"
-            class="screen_loader fixed inset-0 bg-[#fafafa] dark:bg-[#060818] z-[60] grid place-content-center animate__animated"
-        >
+        <div v-show="store.isShowMainLoader"
+            class="screen_loader fixed inset-0 bg-[#fafafa] dark:bg-[#060818] z-[60] grid place-content-center animate__animated">
             <svg width="64" height="64" viewBox="0 0 135 135" xmlns="http://www.w3.org/2000/svg" fill="#4361ee">
                 <path
-                    d="M67.447 58c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10zm9.448 9.447c0 5.523 4.477 10 10 10 5.522 0 10-4.477 10-10s-4.478-10-10-10c-5.523 0-10 4.477-10 10zm-9.448 9.448c-5.523 0-10 4.477-10 10 0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10zM58 67.447c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10z"
-                >
-                    <animateTransform attributeName="transform" type="rotate" from="0 67 67" to="-360 67 67" dur="2.5s" repeatCount="indefinite" />
+                    d="M67.447 58c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10zm9.448 9.447c0 5.523 4.477 10 10 10 5.522 0 10-4.477 10-10s-4.478-10-10-10c-5.523 0-10 4.477-10 10zm-9.448 9.448c-5.523 0-10 4.477-10 10 0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10zM58 67.447c0-5.523-4.477-10-10-10s-10 4.477-10 10 4.477 10 10 10 10-4.477 10-10z">
+                    <animateTransform attributeName="transform" type="rotate" from="0 67 67" to="-360 67 67" dur="2.5s"
+                        repeatCount="indefinite" />
                 </path>
                 <path
-                    d="M28.19 40.31c6.627 0 12-5.374 12-12 0-6.628-5.373-12-12-12-6.628 0-12 5.372-12 12 0 6.626 5.372 12 12 12zm30.72-19.825c4.686 4.687 12.284 4.687 16.97 0 4.686-4.686 4.686-12.284 0-16.97-4.686-4.687-12.284-4.687-16.97 0-4.687 4.686-4.687 12.284 0 16.97zm35.74 7.705c0 6.627 5.37 12 12 12 6.626 0 12-5.373 12-12 0-6.628-5.374-12-12-12-6.63 0-12 5.372-12 12zm19.822 30.72c-4.686 4.686-4.686 12.284 0 16.97 4.687 4.686 12.285 4.686 16.97 0 4.687-4.686 4.687-12.284 0-16.97-4.685-4.687-12.283-4.687-16.97 0zm-7.704 35.74c-6.627 0-12 5.37-12 12 0 6.626 5.373 12 12 12s12-5.374 12-12c0-6.63-5.373-12-12-12zm-30.72 19.822c-4.686-4.686-12.284-4.686-16.97 0-4.686 4.687-4.686 12.285 0 16.97 4.686 4.687 12.284 4.687 16.97 0 4.687-4.685 4.687-12.283 0-16.97zm-35.74-7.704c0-6.627-5.372-12-12-12-6.626 0-12 5.373-12 12s5.374 12 12 12c6.628 0 12-5.373 12-12zm-19.823-30.72c4.687-4.686 4.687-12.284 0-16.97-4.686-4.686-12.284-4.686-16.97 0-4.687 4.686-4.687 12.284 0 16.97 4.686 4.687 12.284 4.687 16.97 0z"
-                >
-                    <animateTransform attributeName="transform" type="rotate" from="0 67 67" to="360 67 67" dur="8s" repeatCount="indefinite" />
+                    d="M28.19 40.31c6.627 0 12-5.374 12-12 0-6.628-5.373-12-12-12-6.628 0-12 5.372-12 12 0 6.626 5.372 12 12 12zm30.72-19.825c4.686 4.687 12.284 4.687 16.97 0 4.686-4.686 4.686-12.284 0-16.97-4.686-4.687-12.284-4.687-16.97 0-4.687 4.686-4.687 12.284 0 16.97zm35.74 7.705c0 6.627 5.37 12 12 12 6.626 0 12-5.373 12-12 0-6.628-5.374-12-12-12-6.63 0-12 5.372-12 12zm19.822 30.72c-4.686 4.686-4.686 12.284 0 16.97 4.687 4.686 12.285 4.686 16.97 0 4.687-4.686 4.687-12.284 0-16.97-4.685-4.687-12.283-4.687-16.97 0zm-7.704 35.74c-6.627 0-12 5.37-12 12 0 6.626 5.373 12 12 12s12-5.374 12-12c0-6.63-5.373-12-12-12zm-30.72 19.822c-4.686-4.686-12.284-4.686-16.97 0-4.686 4.687-4.686 12.285 0 16.97 4.686 4.687 12.284 4.687 16.97 0 4.687-4.685 4.687-12.283 0-16.97zm-35.74-7.704c0-6.627-5.372-12-12-12-6.626 0-12 5.373-12 12s5.374 12 12 12c6.628 0 12-5.373 12-12zm-19.823-30.72c4.687-4.686 4.687-12.284 0-16.97-4.686-4.686-12.284-4.686-16.97 0-4.687 4.686-4.687 12.284 0 16.97 4.686 4.687 12.284 4.687 16.97 0z">
+                    <animateTransform attributeName="transform" type="rotate" from="0 67 67" to="360 67 67" dur="8s"
+                        repeatCount="indefinite" />
                 </path>
             </svg>
         </div>
 
         <div class="fixed bottom-16 ltr:right-6 rtl:left-6 z-50">
             <template v-if="showTopButton">
-                <button
-                    type="button"
+                <button type="button"
                     class="w-auto btn btn-outline-primary rounded-full p-2 animate-pulse bg-[#fafafa] dark:bg-[#060818] dark:hover:bg-primary"
-                    @click="goToTop"
-                >
-                    <svg width="24" height="24" class="h-4 w-4" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
-                        <path
-                            opacity="0.5"
-                            fill-rule="evenodd"
-                            clip-rule="evenodd"
+                    @click="goToTop">
+                    <svg width="24" height="24" class="h-4 w-4" viewBox="0 0 24 24" fill="none"
+                        xmlns="http://www.w3.org/2000/svg">
+                        <path opacity="0.5" fill-rule="evenodd" clip-rule="evenodd"
                             d="M12 20.75C12.4142 20.75 12.75 20.4142 12.75 20L12.75 10.75L11.25 10.75L11.25 20C11.25 20.4142 11.5858 20.75 12 20.75Z"
-                            fill="currentColor"
-                        />
+                            fill="currentColor" />
                         <path
                             d="M6.00002 10.75C5.69667 10.75 5.4232 10.5673 5.30711 10.287C5.19103 10.0068 5.25519 9.68417 5.46969 9.46967L11.4697 3.46967C11.6103 3.32902 11.8011 3.25 12 3.25C12.1989 3.25 12.3897 3.32902 12.5304 3.46967L18.5304 9.46967C18.7449 9.68417 18.809 10.0068 18.6929 10.287C18.5768 10.5673 18.3034 10.75 18 10.75L6.00002 10.75Z"
-                            fill="currentColor"
-                        />
+                            fill="currentColor" />
                     </svg>
                 </button>
             </template>
@@ -58,7 +51,7 @@
 
             <div class="main-content flex flex-col min-h-screen">
                 <!--  BEGIN TOP NAVBAR  -->
-                <Header />
+                <Header v-if="heardShow" />
                 <!--  END TOP NAVBAR  -->
 
                 <!--  BEGIN CONTENT AREA  -->
@@ -75,34 +68,53 @@
     </div>
 </template>
 <script setup lang="ts">
-    import { ref, onMounted } from 'vue';
-    import Sidebar from '@/components/layout/Sidebar.vue';
-    import Header from '@/components/layout/Header.vue';
-    import Footer from '@/components/layout/Footer.vue';
-    // import Setting from '@/components/ThemeCustomizer.vue';
-    import appSetting from '@/app-setting';
+import { ref, onMounted, watch } from 'vue';
+import Sidebar from '@/components/layout/Sidebar.vue';
+import Header from '@/components/layout/Header.vue';
+import Footer from '@/components/layout/Footer.vue';
+// import Setting from '@/components/ThemeCustomizer.vue';
+import appSetting from '@/app-setting';
+import router from '@/router';
+import { useRoute } from 'vue-router';
+import { useAppStore } from '@/stores/index';
+import {infoApi } from '@/api/api'
+const store = useAppStore();
+const route = useRoute();
+const showTopButton = ref(false);
+let heardShow: any = ref(false)
+let uid=ref('')
+watch(route, (to, from) => {
+    // 检查本地存储中是否存在用户信息
+    if (localStorage.getItem('USER') !== null) {
+     /*    uid=JSON.parse(localStorage.getItem('USER')).uid */
+        heardShow.value = true;
+       /*  init(uid) */
+    } else {
+        heardShow.value = false;
+        router.push(({ path: '/login' }))
+    }
+});
+onMounted(() => {
 
-    import { useAppStore } from '@/stores/index';
-    const store = useAppStore();
-    const showTopButton = ref(false);
-    onMounted(() => {
-        window.onscroll = () => {
-            if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
-                showTopButton.value = true;
-            } else {
-                showTopButton.value = false;
-            }
-        };
+     // 检查本地存储中是否存在用户信息
+    if (localStorage.getItem('USER') !== null) {
+        heardShow.value = true;
+    }
 
-        const eleanimation: any = document.querySelector('.animation');
-        eleanimation.addEventListener('animationend', function () {
-            appSetting.changeAnimation('remove');
-        });
-        store.toggleMainLoader();
-    });
 
-    const goToTop = () => {
-        document.body.scrollTop = 0;
-        document.documentElement.scrollTop = 0;
-    };
+    const eleanimation: any = document.querySelector('.animation');
+    eleanimation.addEventListener('animationend', function () {
+        appSetting.changeAnimation('remove');
+    });
+    store.toggleMainLoader();
+});
+const init=(uid)=>{
+    infoApi.getUser(uid).then(res=>{
+        console.log(res);
+    })
+}
+const goToTop = () => {
+    document.body.scrollTop = 0;
+    document.documentElement.scrollTop = 0;
+};
 </script>

+ 5 - 5
src/views/InoutStorage/inStorage.vue

@@ -30,17 +30,17 @@
                 <el-table-column prop="goods_vo.name" label="商品名称" />
                 <el-table-column prop="product_vo.sku" label="SKU" />
                 <el-table-column prop="num" label="入库数量" />
-                <el-table-column prop="orderNum" label="待入库数量" />
+                <el-table-column prop="orderNum" :style="{ color: 'red' }" label="待入库数量" />
             </el-table>
         </el-form>
-        <el-dialog v-model="dialogVisible" :modal=false title="扫码入库" :close-on-click-modal="false" width="80%"
+        <el-dialog v-model="dialogVisible" :modal=false title="扫码入库" :close-on-click-modal="false" top="80px" width="90%" style="height: 200px"
             :before-close="handleClose">
             <el-form :model="snCodeForm" label-width="auto" style="max-width: 600px">
                 <el-form-item label="SKU">
-                    <el-input v-model="snCodeForm.bar_code" ref="inputRef" @keyup.enter="toSearch()" />
+                    <el-input v-model="snCodeForm.bar_code" ref="inputRef" inputmode="none" @keyup.enter="toSearch()" />
                 </el-form-item>
                 <el-form-item label="序列号">
-                    <el-input v-model="snCodeForm.sn_code" ref="snInputRef" @keyup.enter="toSnCode()" />
+                    <el-input v-model="snCodeForm.sn_code" ref="snInputRef" inputmode="none" @keyup.enter="toSnCode()" />
                 </el-form-item>
             </el-form>
             <!-- <template #footer>
@@ -149,7 +149,6 @@ const toSearch = async () => {
         if (indexs === -1) {
             index.value = goodsExchangeAddForm.product_list.length;
             goodsExchangeAddForm.product_list.push(res.data);
-            console.log(goodsExchangeAddForm.product_list);
         } else {
             index.value = indexs;
         }
@@ -158,6 +157,7 @@ const toSearch = async () => {
                 snInputRef.value.focus();
             });
         } else {
+            goodsExchangeAddForm.product_list[index.value].num += 1
             /* this.scanDialogVisible = false; */
         }
     } catch (error) {

+ 5 - 5
src/views/InoutStorage/outStorage.vue

@@ -30,7 +30,7 @@
                 <el-table-column prop="goods_vo.name" label="商品名称"  />
                 <el-table-column prop="product_vo.sku" label="SKU" />
                 <el-table-column prop="out_num" label="出库数量" />
-                <el-table-column prop="orderNum" label="待出库数量" />
+                <el-table-column prop="orderNum" :style="{ color: 'red' }" label="待出库数量" />
                 <el-table-column  label="操作">
                     <template #default="scope">
                         <el-button size="mini" type="danger" @click="
@@ -40,14 +40,14 @@
                 </el-table-column>
             </el-table>
         </el-form>
-        <el-dialog v-model="dialogVisible" :modal=false title="扫码出库" :close-on-click-modal="false" width="80%"
+        <el-dialog v-model="dialogVisible" :modal=false title="扫码出库" :close-on-click-modal="false" top="80px" width="90%" style="height: 200px"
             :before-close="handleClose">
             <el-form :model="snCodeForm" label-width="auto" style="max-width: 600px">
                 <el-form-item label="SKU">
-                    <el-input v-model="snCodeForm.bar_code" ref="inputRef" @keyup.enter="toSearch()" />
+                    <el-input v-model="snCodeForm.bar_code" ref="inputRef" inputmode="none" @keyup.enter="toSearch()" />
                 </el-form-item>
                 <el-form-item label="序列号">
-                    <el-input v-model="snCodeForm.sn_code" ref="snInputRef" @keyup.enter="toSnCode()" />
+                    <el-input v-model="snCodeForm.sn_code" ref="snInputRef" inputmode="none" @keyup.enter="toSnCode()" />
                 </el-form-item>
             </el-form>
             <!-- <template #footer>
@@ -157,7 +157,6 @@ const toSearch = async () => {
         if (indexs === -1) {
             index.value = goodsExchangeAddForm.product_list.length;
             goodsExchangeAddForm.product_list.push(res.data);
-            console.log(goodsExchangeAddForm.product_list);
         } else {
             index.value = indexs;
         }
@@ -166,6 +165,7 @@ const toSearch = async () => {
                 snInputRef.value.focus();
             });
         } else {
+            goodsExchangeAddForm.product_list[index.value].out_num += 1
             /* this.scanDialogVisible = false; */
         }
     } catch (error) {

+ 9 - 5
src/views/Inventory/addInventory.vue

@@ -29,17 +29,21 @@
                 <el-table-column prop="goods_vo.name" label="商品名称" />
                 <el-table-column prop="product_vo.sku" label="SKU" />
                 <el-table-column prop="inventory_num" label="盘点数量" />
-                <el-table-column prop="actual_stock" label="库存数量" />
+                <el-table-column prop="actual_stock" :style="{ color: 'red' }" label="库存数量">
+                    <!-- <template #default="scope">
+                        <span style="color: red;">{{ scope.actual_stock }}</span>
+                    </template> -->
+                </el-table-column>
             </el-table>
         </el-form>
-        <el-dialog v-model="dialogVisible" :modal=false title="商品扫码" :close-on-click-modal="false" width="80%"
+        <el-dialog v-model="dialogVisible" :modal=false title="商品扫码" :close-on-click-modal="false" top="80px" width="90%" style="height: 200px"
             :before-close="handleClose">
             <el-form :model="snCodeForm" label-width="auto" style="max-width: 600px">
                 <el-form-item label="SKU">
-                    <el-input v-model="snCodeForm.bar_code" ref="inputRef" @keyup.enter="toSearch()" />
+                    <el-input v-model="snCodeForm.bar_code" ref="inputRef" inputmode="none" @keyup.enter="toSearch()" />
                 </el-form-item>
                 <el-form-item label="序列号">
-                    <el-input v-model="snCodeForm.sn_code" ref="snInputRef" @keyup.enter="toSnCode()" />
+                    <el-input v-model="snCodeForm.sn_code" ref="snInputRef" inputmode="none" @keyup.enter="toSnCode()" />
                 </el-form-item>
             </el-form>
             <!-- <template #footer>
@@ -151,7 +155,6 @@ const toSearch = async () => {
         if (indexs === -1) {
             index.value = goodsInventoryAddForm.product_list.length;
             goodsInventoryAddForm.product_list.push(res.data);
-            console.log(goodsInventoryAddForm.product_list);
         } else {
             index.value = indexs;
         }
@@ -163,6 +166,7 @@ const toSearch = async () => {
             /* this.scanDialogVisible = false; */
         }
     } catch (error) {
+        goodsInventoryAddForm.product_list[index.value].inventory_num +=1
         console.error('Error fetching product:', error);
     }
 };

+ 15 - 1
src/views/apps/applist.vue

@@ -10,6 +10,7 @@
     </ul> -->
     <div class="grid grid-cols-2 gap-8">
         <div v-for="(item, index) in cols" :key="index" @click="goPageList(item)">
+            
             <svg class="w-40 h-40 text-gray-500 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
                 fill="currentColor" viewBox="0 0 24 24">
                 <path fill-rule="evenodd"
@@ -70,6 +71,7 @@ import { ref, computed, onMounted, inject } from 'vue'; // Added onMounted here
 import { useAppStore } from '@/stores/index';
 import { useMeta } from '@/composables/use-meta';
 import router from '@/router';
+import {infoApi } from '@/api/api'
 import { AxiosInstance } from 'axios';
 const $axios = inject('axios') as AxiosInstance;
 const cols: any = ref([
@@ -83,7 +85,7 @@ const cols: any = ref([
     { path: 'actions', title: '售后列表'},
     { path: 'actions', title: '商品列表'} */
 ]);
-
+const menuList:any={}
 
 const godashbord = () => {
     router.push(({ path: '/' }))
@@ -113,9 +115,21 @@ const fetchData = async () => {
         console.error('API Error:', error);
     }
 };
+const init=()=>{
+    infoApi.getMenu().then((res:any)=>{
+        res.map(el => {
+          el.children.map(e => {
+            if (e.show_home == 1) {
+              menuList.push(e)
+            }
+          })
+        })
+    })
+}
 
 // 在组件加载时调用 fetchData
 onMounted(() => {
+   /*  init() */
    /*  fetchData(); */
 });
 </script>

+ 12 - 6
src/views/apps/shippingPage.vue

@@ -72,19 +72,19 @@
                     <el-table-column prop="goods_vo.name" label="商品名称" />
                     <el-table-column prop="product_vo.sku" label="SKU" />
                     <el-table-column prop="orderNum" label="订单数量" />
-                    <el-table-column prop="num" label="出库数量" />
+                    <el-table-column prop="num"  :style="{ color: 'red' }" label="出库数量" />
                 </el-table>
             </el-tab-pane>
 
         </el-tabs>
-        <el-dialog v-model="dialogVisible" :modal=false title="扫码出库" :close-on-click-modal="false" width="80%"
+        <el-dialog v-model="dialogVisible" :modal=false title="扫码出库" :close-on-click-modal="false" top="80px" width="90%" style="height: 200px"
             :before-close="handleClose">
             <el-form :model="snCodeForm" label-width="auto" style="max-width: 600px">
                 <el-form-item label="SKU">
-                    <el-input v-model="snCodeForm.bar_code"  ref="inputRef" @keyup.enter="toSearch()" />
+                    <el-input v-model="snCodeForm.bar_code" inputmode="none" ref="inputRef" @keyup.enter="toSearch()" />
                 </el-form-item>
                 <el-form-item label="序列号">
-                    <el-input v-model="snCodeForm.sn_code" ref="snInputRef" @keyup.enter="toSnCode()" />
+                    <el-input v-model="snCodeForm.sn_code" inputmode="none" ref="snInputRef" @keyup.enter="toSnCode()" />
                 </el-form-item>
             </el-form>
             <!-- <template #footer>
@@ -202,12 +202,18 @@ const params: any = ref({
     warehouse_id: '',
     goods_num: '',
 })
+let isReadOnly:any=ref(false)
 let sku = ref('');
 watch(activeTab, (newValue, oldValue) => {
     console.log(`Tab changed from ${oldValue} to ${newValue}`);
     // 这里可以添加一些逻辑,但要确保不会再次修改 activeTab
 });
-
+const toggleReadOnly = () => {
+    isReadOnly = !isReadOnly;
+};
+const enableVirtualKeyboard = (event) => {
+    event.target.readOnly = false;
+};
 /* 扫sku */
 const toSearch = async () => {
     activeTab.value = 'product-info'
@@ -251,7 +257,7 @@ const toSearch = async () => {
                 snInputRef.value.focus();
             });
         } else {
-            shippingForm.value.order_item_vos[index.value].num = 1
+            shippingForm.value.order_item_vos[index.value].num += 1
             //dialogVisible.value = false;
         }
     } catch (error) {

+ 13 - 14
src/views/auth/boxed-signin.vue

@@ -130,20 +130,19 @@ interface LoginResponse {
 }
 
 const handleSubmit = async () => {
-        try {
-            inputValue.uuid = uuid;
-            const response = await UserService.login(inputValue) as LoginResponse
-            console.log('Login successful:', response);
-            store.setUser({
-                ...response.data,
-                token: response.data.refresh_token
-            });
-            router.replace({
-                name: 'home'
-            });
-        } catch (error) {
-            console.error('Login failed:', error);
-        }
+    try {
+        inputValue.uuid = uuid;
+        const response = await UserService.login(inputValue) as LoginResponse
+        store.setUser({
+            ...response.data,
+            token: response.data.refresh_token
+        });
+        router.replace({
+            name: 'home'
+        });
+    } catch (error) {
+        console.error('Login failed:', error);
+    }
     /* try {
         
         const res:Object = await reactive(UserService.login(inputValue))