@sun-chaoqun 1 жил өмнө
parent
commit
8e1e1da3a5

+ 1 - 1
src/api/project/index.ts

@@ -19,4 +19,4 @@ export const Project_Del = (params: any) => $http.post('/api/project/Project/Del
 // 左侧用户列表
 export const Project_User_List = (params: any) => $http.post('/api/project/User/List', params)
 // 导出word
-export const Project_Word = (params: any) => $http.post('/testapi/project/Project/Word', params)
+export const Project_Word = (params: any) => $http.post('/api/project/Project/Word', params)

+ 9 - 9
src/api/role/index.ts

@@ -1,20 +1,20 @@
 import $http from '../index'
 
 // 获取列表
-export const User_Power_List = (params: any) => $http.post('/testapi/user/Power/List', params)
+export const User_Power_List = (params: any) => $http.post('/api/user/Power/List', params)
 // 权限系统列表
-export const User_Sys_List = (params: any) => $http.post('/testapi/user/Power/Sys_List', params)
+export const User_Sys_List = (params: any) => $http.post('/api/user/Power/Sys_List', params)
 // 弹框菜单
-export const Menu_List = (params: any): any => $http.post('/testapi/user/Menu/List', params)
+export const Menu_List = (params: any): any => $http.post('/api/user/Menu/List', params)
 // 左侧菜单栏
-export const Menu_User_List = (params: any) => $http.post('/testapi/user/Menu/User_List', params)
+export const Menu_User_List = (params: any) => $http.post('/api/user/Menu/User_List', params)
 // 添加角色名
-export const User_Power_Add = (params: any): any => $http.post('/testapi/user/Power/Add', params)
+export const User_Power_Add = (params: any): any => $http.post('/api/user/Power/Add', params)
 // 编辑角色名
-export const User_Power_Edit = (params: any): any => $http.post('/testapi/user/Power/Edit', params)
+export const User_Power_Edit = (params: any): any => $http.post('/api/user/Power/Edit', params)
 // 删除角色名
-export const User_Power_Del = (params: any): any => $http.post('/testapi/user/Power/Del', params)
+export const User_Power_Del = (params: any): any => $http.post('/api/user/Power/Del', params)
 // 编辑菜单
-export const User_Power_Edit_Menu = (params: any): any => $http.post('/testapi/user/Power/Edit_Menu', params)
+export const User_Power_Edit_Menu = (params: any): any => $http.post('/api/user/Power/Edit_Menu', params)
 // 获取用户权限
-export const User_Power_Get = (params: any): any => $http.post('/testapi/user/Power/Get', params)
+export const User_Power_Get = (params: any): any => $http.post('/api/user/Power/Get', params)

+ 8 - 10
src/api/storehouse/index.ts

@@ -125,22 +125,20 @@ export const Storehouse_Device_Check = (params: any) => $http.post('/api/storage
  */
 // 客户列表
 export const Storehouse_VerifyContract_Customer_List = (params: any) =>
-  $http.post('/testapi/storage/VerifyContract/Customer_List', params)
+  $http.post('/api/storage/VerifyContract/Customer_List', params)
 // 添加客户
 export const Storehouse_VerifyContract_Add_Customer = (params: any) =>
-  $http.post('/testapi/storage/VerifyContract/Add_Customer', params)
+  $http.post('/api/storage/VerifyContract/Add_Customer', params)
 // 编辑客户
 export const Storehouse_VerifyContract_Update_Customer = (params: any) =>
-  $http.post('/testapi/storage/VerifyContract/Update_Customer', params)
+  $http.post('/api/storage/VerifyContract/Update_Customer', params)
 // 明细列表
-export const Storehouse_VerifyContract_List = (params: any) =>
-  $http.post('/testapi/storage/VerifyContract/List', params)
+export const Storehouse_VerifyContract_List = (params: any) => $http.post('/api/storage/VerifyContract/List', params)
 // 添加
-export const Storehouse_VerifyContract_Add = (params: any) => $http.post('/testapi/storage/VerifyContract/Add', params)
+export const Storehouse_VerifyContract_Add = (params: any) => $http.post('/api/storage/VerifyContract/Add', params)
 // 编辑
-export const Storehouse_VerifyContract_Edit = (params: any) =>
-  $http.post('/testapi/storage/VerifyContract/Edit', params)
+export const Storehouse_VerifyContract_Edit = (params: any) => $http.post('/api/storage/VerifyContract/Edit', params)
 // 获取详情
-export const Storehouse_VerifyContract_Get = (params: any) => $http.post('/testapi/storage/VerifyContract/Get', params)
+export const Storehouse_VerifyContract_Get = (params: any) => $http.post('/api/storage/VerifyContract/Get', params)
 // 删除
-export const Storehouse_VerifyContract_Del = (params: any) => $http.post('/testapi/storage/VerifyContract/Del', params)
+export const Storehouse_VerifyContract_Del = (params: any) => $http.post('/api/storage/VerifyContract/Del', params)

+ 1 - 2
src/layouts/Header/Breadcrumb.vue

@@ -15,7 +15,6 @@ const breadcrumbList: any = computed(() => {
   if (BreadcrumbList) return BreadcrumbList
   return globalStore.GET_AllBreadcrumbList[path]
 })
-// console.log(globalStore.GET_AllBreadcrumbList)
 /**
  * 获取额外的面包屑
  * @param name 路由名称
@@ -51,7 +50,7 @@ const isUnicode = (val: string | undefined) => {
 }
 
 const onBreadcrumbClick = (item: any, index: number) => {
-  if (item.meta.routerView) return
+  if (['/project', '/account', '/workAttendance', '/salary', '/storehouse'].includes(item.T_uri)) return
   if (index !== breadcrumbList.value.length - 1) router.push(item.path)
 }
 </script>

+ 1 - 27
src/layouts/Main/index.vue

@@ -1,29 +1,4 @@
-<script setup lang="ts">
-// import { ref, provide, beforeRouteUpdate } from 'vue'
-// import { useRoute } from 'vue-router'
-// import { KeepAliveStore } from '@/stores/modules/keepAlive'
-// const isRouterShow = ref(true)
-// const refreshCurrentPage = (val: boolean) => {
-//   isRouterShow.value = val
-// }
-// provide('refresh', refreshCurrentPage)
-
-// const keepAliveStore = KeepAliveStore()
-// console.log(keepAliveStore)
-// const transitionName = ''
-// beforeRouteUpdate (to, from, next) {
-//  // 如果isBack为true时,证明是用户点击了回退,执行slide-right动画
-//   let isBack = this.$router.isBack
-//   if (isBack) {
-//    this.transitionName = 'slide-right'
-//   } else {
-//    this.transitionName = 'slide-left'
-//   }
-//   // 做完回退动画后,要设置成前进动画,否则下次打开页面动画将还是回退
-//   this.$router.isBack = false
-//   next()
-// }
-</script>
+<script setup lang="ts"></script>
 
 <template>
   <el-main>
@@ -31,7 +6,6 @@
       <transition appear name="fade-transform" mode="out-in">
         <component :is="Component" :key="route.path" />
       </transition>
-
       <!-- <keep-alive>
        
       </keep-alive> -->

+ 1 - 43
src/utils/common.ts

@@ -45,46 +45,6 @@ export const getAllBreadcrumbList = (menuList: any, result: { [key: string]: any
   return result
 }
 
-const path = {
-  roles: ['/roles'],
-  users: ['/users'],
-  salary: ['/salary'],
-  records: ['/records'],
-  outStock: ['/outStock'],
-  inventory: ['/device', '/inStorage'],
-  sales: ['/contract', '/contractSale', '/verifyContract'],
-  salarys: ['/salaryCount', '/salaryMy'],
-  project: ['/projectFinance', '/project', '/myProject'],
-  workAttendance: ['/leave', '/myLeave', '/myOvertime', '/overtime', '/recordsFinance'],
-  storehouse: ['/list', '/classify', '/productionList', '/ioTNetworkCard', '/inventoryStatistics']
-}
-
-const permissionPath = (permission: string) => {
-  if (path.roles.includes(permission)) {
-    return '/account/roles'
-  } else if (path.users.includes(permission)) {
-    return '/account/users'
-  } else if (path.salarys.includes(permission)) {
-    return '/salary'
-  } else if (path.salary.includes(permission)) {
-    return '/salary/salary'
-  } else if (path.workAttendance.includes(permission)) {
-    return '/workAttendance'
-  } else if (path.records.includes(permission)) {
-    return '/workAttendance/records'
-  } else if (path.storehouse.includes(permission)) {
-    return '/storehouse'
-  } else if (path.inventory.includes(permission)) {
-    return '/storehouse/inventory'
-  } else if (path.outStock.includes(permission)) {
-    return '/storehouse/outStock'
-  } else if (path.sales.includes(permission)) {
-    return '/storehouse/sales'
-  } else if (path.project.includes(permission)) {
-    return '/project'
-  }
-}
-
 const get_name = (name: string): string => {
   if (/\//.test(name)) {
     return name.split('/')[1]
@@ -92,8 +52,6 @@ const get_name = (name: string): string => {
   return name
 }
 
-const functionucFirst = (str: string) => str[0].toUpperCase() + str.slice(1)
-
 /**
  * 将扁平化的数组转换成带有meta component字段的新数组
  * @param menuList []
@@ -111,7 +69,7 @@ export const AddRouterMeta = (menuList: any[]) => {
       title: menu.T_name,
       isKeepAlive: true
     }
-    menu.component = permissionPath(menu.T_permission) + '/' + functionucFirst(menu.name)
+    menu.component = menu.T_uri
   })
   return menuList
 }

+ 0 - 1
src/views/storehouse/inventory/InStorageProduct.vue

@@ -103,7 +103,6 @@ const getProductList = async () => {
     // 设置产品的选中
     tableProductData.value.forEach((row: any) => {
       const matchedIndex = selectProductData.value?.findIndex((item: any) => item.Id == row.Id)
-      console.log(matchedIndex)
       selectTable.value?.toggleRowSelection(row, matchedIndex != -1)
     })
   }

+ 16 - 16
vite.config.ts

@@ -29,22 +29,22 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
     },
     server: {
       open: true,
-      host: '0.0.0.0',
-      proxy: {
-        '/api': {
-          target: 'https://erp.baozhida.cn',
-          changeOrigin: true,
-          rewrite: path => path.replace(/^\/api/, '/testapi')
-        },
-        '/testapi': {
-          target: 'https://erp.baozhida.cn',
-          changeOrigin: true
-        },
-        '/ams': {
-          target: 'http://erp.baozhida.cn',
-          changeOrigin: true
-        }
-      }
+      host: '0.0.0.0'
+      // proxy: {
+      //   '/api': {
+      //     target: 'https://erp.baozhida.cn',
+      //     changeOrigin: true,
+      //     rewrite: path => path.replace(/^\/api/, '/testapi')
+      //   },
+      //   '/testapi': {
+      //     target: 'https://erp.baozhida.cn',
+      //     changeOrigin: true
+      //   },
+      //   '/ams': {
+      //     target: 'http://erp.baozhida.cn',
+      //     changeOrigin: true
+      //   }
+      // }
     },
     plugins: [
       vue(),