diff --git a/package.json b/package.json index 508d1f7..de6909c 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "nprogress": "0.2.0", "ol": "^6.4.3", "pinia": "2.0.22", + "pinia-plugin-persist": "^1.0.0", "swiper": "^8.0.4", "three": "^0.125.2", "vue": "3.2.45", diff --git a/package.json b/package.json index 508d1f7..de6909c 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "nprogress": "0.2.0", "ol": "^6.4.3", "pinia": "2.0.22", + "pinia-plugin-persist": "^1.0.0", "swiper": "^8.0.4", "three": "^0.125.2", "vue": "3.2.45", diff --git a/src/api/order.js b/src/api/order.js index eb8b5cf..6136038 100644 --- a/src/api/order.js +++ b/src/api/order.js @@ -81,3 +81,30 @@ }); } + +// business/workOrder/listWorkOrderDept +export function listWorkOrderDept(query) { + return request({ + url: '/business/workOrder/listWorkOrderDept', + method: 'get', + params: query, + }); +} + +// business/workOrder/listWorkOrderHandler +export function listWorkOrderHandler(query) { + return request({ + url: '/business/workOrder/listWorkOrderHandler', + method: 'get', + params: query, + }); +} + +// business/workOrder/groupCount +export function groupCount(query) { + return request({ + url: '/business/workOrder/groupCount', + method: 'get', + params: query, + }); +} \ No newline at end of file diff --git a/package.json b/package.json index 508d1f7..de6909c 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "nprogress": "0.2.0", "ol": "^6.4.3", "pinia": "2.0.22", + "pinia-plugin-persist": "^1.0.0", "swiper": "^8.0.4", "three": "^0.125.2", "vue": "3.2.45", diff --git a/src/api/order.js b/src/api/order.js index eb8b5cf..6136038 100644 --- a/src/api/order.js +++ b/src/api/order.js @@ -81,3 +81,30 @@ }); } + +// business/workOrder/listWorkOrderDept +export function listWorkOrderDept(query) { + return request({ + url: '/business/workOrder/listWorkOrderDept', + method: 'get', + params: query, + }); +} + +// business/workOrder/listWorkOrderHandler +export function listWorkOrderHandler(query) { + return request({ + url: '/business/workOrder/listWorkOrderHandler', + method: 'get', + params: query, + }); +} + +// business/workOrder/groupCount +export function groupCount(query) { + return request({ + url: '/business/workOrder/groupCount', + method: 'get', + params: query, + }); +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 41843e4..9ee25c3 100644 --- a/src/main.js +++ b/src/main.js @@ -57,6 +57,11 @@ //空数据组件 import Empty from '@/components/Empty'; +// 持久化存储pinia +import piniaPluginPersist from 'pinia-plugin-persist'; + +store.use(piniaPluginPersist); + const app = createApp(App); // 全局方法挂载 diff --git a/package.json b/package.json index 508d1f7..de6909c 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "nprogress": "0.2.0", "ol": "^6.4.3", "pinia": "2.0.22", + "pinia-plugin-persist": "^1.0.0", "swiper": "^8.0.4", "three": "^0.125.2", "vue": "3.2.45", diff --git a/src/api/order.js b/src/api/order.js index eb8b5cf..6136038 100644 --- a/src/api/order.js +++ b/src/api/order.js @@ -81,3 +81,30 @@ }); } + +// business/workOrder/listWorkOrderDept +export function listWorkOrderDept(query) { + return request({ + url: '/business/workOrder/listWorkOrderDept', + method: 'get', + params: query, + }); +} + +// business/workOrder/listWorkOrderHandler +export function listWorkOrderHandler(query) { + return request({ + url: '/business/workOrder/listWorkOrderHandler', + method: 'get', + params: query, + }); +} + +// business/workOrder/groupCount +export function groupCount(query) { + return request({ + url: '/business/workOrder/groupCount', + method: 'get', + params: query, + }); +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 41843e4..9ee25c3 100644 --- a/src/main.js +++ b/src/main.js @@ -57,6 +57,11 @@ //空数据组件 import Empty from '@/components/Empty'; +// 持久化存储pinia +import piniaPluginPersist from 'pinia-plugin-persist'; + +store.use(piniaPluginPersist); + const app = createApp(App); // 全局方法挂载 diff --git a/src/store/modules/order.js b/src/store/modules/order.js index 3dfbb10..d5c2aec 100644 --- a/src/store/modules/order.js +++ b/src/store/modules/order.js @@ -1,4 +1,5 @@ import { listDept } from '@/api/system/dept'; // 部门 +import { listWorkOrderDept, listWorkOrderHandler } from '@/api/order'; // 部门 import { listUser } from '@/api/system/user'; import { handleTree } from '@/utils/ruoyi'; @@ -17,17 +18,31 @@ status: undefined, } */ - listDept(data).then(response => { + listWorkOrderDept(data).then(response => { this.deptList = handleTree(response.data, 'deptId'); console.log('🚀 ~ listDept ~ this.deptList:', this.deptList, response); }); }, getUserList(data = {}) { - listUser(data).then(response => { + listWorkOrderHandler(data).then(response => { this.userList = handleTree(response.data, 'deptId'); console.log('🚀 ~ listUser ~ this.userList:', this.userList, response); }); }, }, + persist: { + enabled: true, + // 自定义持久化参数 + strategies: [ + { + // 自定义key + // key: "userInfo", + // 自定义存储方式,默认 sessionStorage + storage: sessionStorage, + // 指定要持久化的数据,默认所有 state 都会进行缓存,可以通过 paths 指定要持久化的字段,其他的则不会进行持久化。 + paths: ['deptList'], + }, + ], + }, }); export default useOrderStore; diff --git a/package.json b/package.json index 508d1f7..de6909c 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "nprogress": "0.2.0", "ol": "^6.4.3", "pinia": "2.0.22", + "pinia-plugin-persist": "^1.0.0", "swiper": "^8.0.4", "three": "^0.125.2", "vue": "3.2.45", diff --git a/src/api/order.js b/src/api/order.js index eb8b5cf..6136038 100644 --- a/src/api/order.js +++ b/src/api/order.js @@ -81,3 +81,30 @@ }); } + +// business/workOrder/listWorkOrderDept +export function listWorkOrderDept(query) { + return request({ + url: '/business/workOrder/listWorkOrderDept', + method: 'get', + params: query, + }); +} + +// business/workOrder/listWorkOrderHandler +export function listWorkOrderHandler(query) { + return request({ + url: '/business/workOrder/listWorkOrderHandler', + method: 'get', + params: query, + }); +} + +// business/workOrder/groupCount +export function groupCount(query) { + return request({ + url: '/business/workOrder/groupCount', + method: 'get', + params: query, + }); +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 41843e4..9ee25c3 100644 --- a/src/main.js +++ b/src/main.js @@ -57,6 +57,11 @@ //空数据组件 import Empty from '@/components/Empty'; +// 持久化存储pinia +import piniaPluginPersist from 'pinia-plugin-persist'; + +store.use(piniaPluginPersist); + const app = createApp(App); // 全局方法挂载 diff --git a/src/store/modules/order.js b/src/store/modules/order.js index 3dfbb10..d5c2aec 100644 --- a/src/store/modules/order.js +++ b/src/store/modules/order.js @@ -1,4 +1,5 @@ import { listDept } from '@/api/system/dept'; // 部门 +import { listWorkOrderDept, listWorkOrderHandler } from '@/api/order'; // 部门 import { listUser } from '@/api/system/user'; import { handleTree } from '@/utils/ruoyi'; @@ -17,17 +18,31 @@ status: undefined, } */ - listDept(data).then(response => { + listWorkOrderDept(data).then(response => { this.deptList = handleTree(response.data, 'deptId'); console.log('🚀 ~ listDept ~ this.deptList:', this.deptList, response); }); }, getUserList(data = {}) { - listUser(data).then(response => { + listWorkOrderHandler(data).then(response => { this.userList = handleTree(response.data, 'deptId'); console.log('🚀 ~ listUser ~ this.userList:', this.userList, response); }); }, }, + persist: { + enabled: true, + // 自定义持久化参数 + strategies: [ + { + // 自定义key + // key: "userInfo", + // 自定义存储方式,默认 sessionStorage + storage: sessionStorage, + // 指定要持久化的数据,默认所有 state 都会进行缓存,可以通过 paths 指定要持久化的字段,其他的则不会进行持久化。 + paths: ['deptList'], + }, + ], + }, }); export default useOrderStore; diff --git a/src/views/index.vue b/src/views/index.vue index 9558cf5..9ab8a50 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -121,7 +121,7 @@ AllData.BottmBackGroundShow = true; orderStore.getDeptList(); - orderStore.getUserList(); + // orderStore.getUserList(); }); onBeforeUnmount(() => { clearInterval(timer.value); diff --git a/package.json b/package.json index 508d1f7..de6909c 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "nprogress": "0.2.0", "ol": "^6.4.3", "pinia": "2.0.22", + "pinia-plugin-persist": "^1.0.0", "swiper": "^8.0.4", "three": "^0.125.2", "vue": "3.2.45", diff --git a/src/api/order.js b/src/api/order.js index eb8b5cf..6136038 100644 --- a/src/api/order.js +++ b/src/api/order.js @@ -81,3 +81,30 @@ }); } + +// business/workOrder/listWorkOrderDept +export function listWorkOrderDept(query) { + return request({ + url: '/business/workOrder/listWorkOrderDept', + method: 'get', + params: query, + }); +} + +// business/workOrder/listWorkOrderHandler +export function listWorkOrderHandler(query) { + return request({ + url: '/business/workOrder/listWorkOrderHandler', + method: 'get', + params: query, + }); +} + +// business/workOrder/groupCount +export function groupCount(query) { + return request({ + url: '/business/workOrder/groupCount', + method: 'get', + params: query, + }); +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 41843e4..9ee25c3 100644 --- a/src/main.js +++ b/src/main.js @@ -57,6 +57,11 @@ //空数据组件 import Empty from '@/components/Empty'; +// 持久化存储pinia +import piniaPluginPersist from 'pinia-plugin-persist'; + +store.use(piniaPluginPersist); + const app = createApp(App); // 全局方法挂载 diff --git a/src/store/modules/order.js b/src/store/modules/order.js index 3dfbb10..d5c2aec 100644 --- a/src/store/modules/order.js +++ b/src/store/modules/order.js @@ -1,4 +1,5 @@ import { listDept } from '@/api/system/dept'; // 部门 +import { listWorkOrderDept, listWorkOrderHandler } from '@/api/order'; // 部门 import { listUser } from '@/api/system/user'; import { handleTree } from '@/utils/ruoyi'; @@ -17,17 +18,31 @@ status: undefined, } */ - listDept(data).then(response => { + listWorkOrderDept(data).then(response => { this.deptList = handleTree(response.data, 'deptId'); console.log('🚀 ~ listDept ~ this.deptList:', this.deptList, response); }); }, getUserList(data = {}) { - listUser(data).then(response => { + listWorkOrderHandler(data).then(response => { this.userList = handleTree(response.data, 'deptId'); console.log('🚀 ~ listUser ~ this.userList:', this.userList, response); }); }, }, + persist: { + enabled: true, + // 自定义持久化参数 + strategies: [ + { + // 自定义key + // key: "userInfo", + // 自定义存储方式,默认 sessionStorage + storage: sessionStorage, + // 指定要持久化的数据,默认所有 state 都会进行缓存,可以通过 paths 指定要持久化的字段,其他的则不会进行持久化。 + paths: ['deptList'], + }, + ], + }, }); export default useOrderStore; diff --git a/src/views/index.vue b/src/views/index.vue index 9558cf5..9ab8a50 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -121,7 +121,7 @@ AllData.BottmBackGroundShow = true; orderStore.getDeptList(); - orderStore.getUserList(); + // orderStore.getUserList(); }); onBeforeUnmount(() => { clearInterval(timer.value); diff --git a/src/views/order/components/orderDia.vue b/src/views/order/components/orderDia.vue index 8a62412..4cb1241 100644 --- a/src/views/order/components/orderDia.vue +++ b/src/views/order/components/orderDia.vue @@ -113,17 +113,17 @@