浏览代码

代码上传

zhangqiOMG 2 年之前
父节点
当前提交
b6da0d480d

+ 6 - 2
src/components/layout/index.vue

@@ -14,13 +14,16 @@
                 <component :is="Component" :key="router.currentRoute.value.fullPath" v-if="$route.meta.keepAlive"/>
               </keep-alive>
             </transition>
-            <transition name="scale" mode="out-in">
+            <transition>
               <component :is="Component" :key="router.currentRoute.value.fullPath" v-if="!$route.meta.keepAlive"></component>
             </transition>
           </router-view>
         </div>
       </a-layout-content>
     </div>
+    <!-- <a-layout-footer class="footer">
+      Copyright © 2023 嘉兴市云链信息技术有限公司
+    </a-layout-footer> -->
   </a-layout>
   <div class="flex-loading" v-else>
     <div style="text-align:center">
@@ -39,8 +42,8 @@ import { storeToRefs } from 'pinia'
 import { useAuthStore } from '@/stores/modules/auth'
 import { useRouter } from "vue-router";
 const router = useRouter()
-
 const store = useAuthStore()
+
 let { isRefresh } = storeToRefs(store)
 </script>
 <style>
@@ -83,6 +86,7 @@ let { isRefresh } = storeToRefs(store)
   opacity: 0;
   transform: scale(0.9);
 }
+
 .flex-loading{
   height: 100vh;
   width: 100vw;

+ 19 - 11
src/components/layout/modules/header.vue

@@ -37,31 +37,44 @@
 </template>
 
 <script setup>
-import {ref,createVNode,watch,nextTick} from 'vue'
+import {ref,createVNode} from 'vue'
 import { UserOutlined, DownOutlined,BellOutlined,QuestionCircleOutlined, LogoutOutlined,ExclamationCircleOutlined} from '@ant-design/icons-vue';
 import { useAuthStore } from '@/stores/modules/auth'
 import { useRouteTabsStore } from '@/stores/modules/Htabs'
 import { storeToRefs } from 'pinia'
-import { Modal } from 'ant-design-vue';
 import weather from '@/components/weather/index.vue'
+import { Modal } from 'ant-design-vue';
 import { useRouter } from "vue-router";
 const router = useRouter()
 import Api from '@/api/api'
 
 const store = useAuthStore()
-let { mods,actMod,nowAccount,accountList,current,app } = storeToRefs(store)
+let { accountList,nowAccount } = storeToRefs(store)
 
 const rotTabs = useRouteTabsStore()
 let {historyRoutes} = storeToRefs(rotTabs)
 const accountItemClick = (account,bool)=>{
-  if (router.currentRoute.value.meta.isDetail) {
-    router.go(-1)
-  }
   store.defaultAccount(account,()=>{
     store.reloadPage()
     historyRoutes.value = []
   })
+  if (!bool){
+    if (router.currentRoute.value.meta.isDetail) {
+      router.go(-1)
+    }
+  }else {
+    router.go(0)
+  }
 }
+// const accountItemClick = (account,bool)=>{
+//   if (router.currentRoute.value.meta.isDetail) {
+//     router.go(-1)
+//   }
+//   store.defaultAccount(account,()=>{
+//     store.reloadPage()
+//     historyRoutes.value = []
+//   })
+// }
 const loginOut = ()=>{
   Modal.confirm({
     title: '注意',
@@ -76,11 +89,6 @@ const loginOut = ()=>{
     }
   });
 }
-watch(() => router.currentRoute.value,(to, from) => {
-  nextTick(()=>{
-    current.value = [app.value.systemmoduleid,app.value.systemappid]
-  })
-})
 </script>
 <style scoped>
 .sw-header{

+ 1 - 1
src/components/layout/modules/historyTabs.vue

@@ -37,8 +37,8 @@ const onChange = (val)=>{
 }
 router.beforeEach((to,from,next)=>{
   let rs = historyRoutes.value.some(item=>item.name == from.name)
- 
   rotTabs.saveRoute(to)
+  console.log(to.meta.name,'---')
   store.appData(to.meta.name)
   activeKey.value = to.name
   next()

+ 9 - 35
src/components/layout/modules/menu.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="sw-menu">
-    <a-menu style="flex:1" v-model:selectedKeys="current" mode="inline" :open-keys="openKeys" @openChange="onOpenChange" active-text-color="#000" @click="itemClick">
+    <a-menu style="flex:1" v-model:selectedKeys="current" mode="inline" active-text-color="#000" @click="itemClick">
       <template v-for="item in mods" :key="item.systemmoduleid">
         <a-sub-menu v-if="item.apps.length > 1" :key="item.systemmoduleid" @click="modClick(item)">
           <template #title>
@@ -33,27 +33,13 @@ import { useAuthStore } from '@/stores/modules/auth'
 import { storeToRefs } from 'pinia'
 import { useRouter } from "vue-router"
 import less from 'less'
-import { CalendarOutlined,PieChartOutlined} from '@ant-design/icons-vue'
+import { CalendarOutlined} from '@ant-design/icons-vue'
 import {ConfigProvider, Modal } from 'ant-design-vue';
 const router = useRouter()
 const store = useAuthStore()
-let { mods,actMod,system } = storeToRefs(store)
-
-let rootSubmenuKeys = ref([])
-let openKeys = ref([])
-let selectedKeys = ref([])
+let { mods,actMod } = storeToRefs(store)
 
 const current = ref([])
-
-const onOpenChange = openKey => {
-  const latestOpenKey = openKey.find(key => openKeys.value.indexOf(key) === -1);
-  if (rootSubmenuKeys.value.indexOf(latestOpenKey) === -1) {
-    openKeys.value = openKey;
-  } else {
-    openKeys.value = latestOpenKey ? [latestOpenKey] : [];
-  }
-}
-
 const itemClick = (item, key, keyPath)=>{
   current.value = item.keyPath
 }
@@ -61,10 +47,7 @@ const modClick = (item)=>{
   actMod.value = item
 }
 const routeChange = (app)=>{
-  // store.appData(app)
-  console.log(app)
-  router.push({path:app.path})
-  console.log(app.path);
+  router.replace({path:app.path,meta:{keepAlive:false}})
 }
 const colorState = ref({})
 const setTheme = (themeName)=> {
@@ -76,11 +59,11 @@ const setTheme = (themeName)=> {
       successColor: '#4aa0d5',
       infoColor: '#d8e9f0',
     }
-
+   
     ConfigProvider.config({
       theme: colorState.value
     });
-
+    
   } else if (themeName === 'normal') {
     colorState.value = {
       primaryColor: '#14317D',
@@ -112,22 +95,13 @@ const setTheme = (themeName)=> {
       theme: colorState.value
     });
   }
-
-}
-
-let getKeys = () => {
-  system.value.forEach(sys => {
-    sys.modules.forEach(mod => {
-      rootSubmenuKeys.value.push(mod.systemmoduleid)
-    })
-  })
+  
 }
-
 onBeforeMount(()=>{
  setTheme('normal')
-  getKeys()
+
 })
 </script>
 <style scoped>
 
-</style>
+</style>

+ 1 - 1
src/router/modelNormal.js

@@ -123,7 +123,7 @@ const moduleNormal = [
     name: 'bs_productcategory',
     meta: {
       title: '产品分类',
-      name: 'bs_productcategory',
+      name: 'productcategory',
       keepAlive:false
     },
     component: () => import(/* webpackChunkName: "about" */ '@/system/moduleNormal/productCategory/index.vue')

+ 1 - 0
src/stores/modules/auth.js

@@ -145,4 +145,5 @@ export const useAuthStore = defineStore('auth', {
       }, 1000);
     }
   }
+    
 })

+ 23 - 10
src/stores/modules/base.js

@@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
 
 import { message } from 'ant-design-vue';
 import { useRouter } from "vue-router";
+import utils from '@/utils/utils'
 import Api from '@/api/api'
 // 第一个参数是应用程序中 store 的唯一 id
 export const useBaseStore = defineStore('base', {
@@ -14,10 +15,7 @@ export const useBaseStore = defineStore('base', {
       nowPageData:[],
       pageTotal:0,
       keyid:'',
-      tableRecord:[], // 记录表格勾选状态
-
-      colMap:new Map(),
-      fullscreen:false,
+      tableRecord:[] // 记录表格勾选状态
     }
   },
   // 开启数据缓存
@@ -32,9 +30,26 @@ export const useBaseStore = defineStore('base', {
   },
   getters:{},
   actions:{
-    /**
-     * 获取系统省市县数据
-     */
+    // 系统选项分类查询
+    optiontypeselect (param) {
+      return new Promise(async (reslove,reject)=>{
+        let obj = {
+          "classname": "sysmanage.develop.optiontype.optiontype",
+          "method": "optiontypeselect",
+          "content": {
+            "pageNumber": 1,
+            "pageSize": 1000,
+            "typename": param,
+            "parameter": {
+            },
+          }
+        }
+        const res = await Api.requested(obj)
+
+        reslove(res)
+      })
+    },
+    // 查询省市县数据
     async ProvincesData () {
       const res = await Api.requested({
         "classname": "system.tools",
@@ -72,10 +87,8 @@ export const useBaseStore = defineStore('base', {
       
     },
 
-    /**
-     * 系统翻页
-     */
     async next () {
+      console.log(this.keyid)
       const rs = await this.checkPaginationData()
       if (rs == 0 && this.nowPageData.length == 1) return false
       if (rs == 1 && this.PageUpParam.content.pageNumber == this.pageTotal) return false

+ 2 - 0
src/stores/modules/columns.js

@@ -37,6 +37,7 @@ export const useColumnsStore = defineStore('columnStore', {
      * 用户修改后的配置
      */
     userSetting (tableName) {
+      
       // 设置时间戳,监听列表发生改动
       this.selectedColumns = new Date()
       
@@ -50,6 +51,7 @@ export const useColumnsStore = defineStore('columnStore', {
      * 获取应用配置
      */
     getUserSetting (tableName) {
+      console.log(app.value)
       let a = []
       let b = new Map()
       let tableColData = utils.TBLayout(tableName)