From 0e5f07eaf79034d327c893f2f9338c50a3365bd8 Mon Sep 17 00:00:00 2001 From: zhangpeng <690927457@qq.com> Date: Fri, 25 Apr 2025 16:19:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(dev):=20=E8=B0=83=E6=95=B4=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=B7=AF=E7=94=B1=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 .env.development 文件中的 VITE_BASE_PATH 为本地地址 - 在 pathInfo.json 中添加订单管理相关页面的路径信息 - 更新 router.js 中的异步路由获取逻辑,使用 getMenuList 替代原 asyncMenu --- .env.development | 2 +- src/api/order/index.js | 14 ++++++ src/pathInfo.json | 4 +- src/pinia/modules/router.js | 8 +-- src/view/order/index.vue | 21 ++++++++ src/view/order/order/index.vue | 92 ++++++++++++++++++++++++++++++++++ 6 files changed, 136 insertions(+), 5 deletions(-) create mode 100644 src/api/order/index.js create mode 100644 src/view/order/index.vue create mode 100644 src/view/order/order/index.vue diff --git a/.env.development b/.env.development index ad07c38..821004f 100644 --- a/.env.development +++ b/.env.development @@ -8,4 +8,4 @@ VITE_POSITION = close VITE_EDITOR = vscode // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP -//VITE_BASE_PATH = http://177.7.0.12 +//VITE_BASE_PATH = http://127.0.0.1 diff --git a/src/api/order/index.js b/src/api/order/index.js new file mode 100644 index 0000000..021faf8 --- /dev/null +++ b/src/api/order/index.js @@ -0,0 +1,14 @@ +import service from '@/utils/request' + +// @tag Order +// @summary 获取订单列表 +// @param {object} params +// @return {object} data +// @router get /order/list +export const list = (params) => { + return service({ + url: '/order/list', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/pathInfo.json b/src/pathInfo.json index 8205a95..b59b0fc 100644 --- a/src/pathInfo.json +++ b/src/pathInfo.json @@ -70,5 +70,7 @@ "/src/view/systemTools/system/system.vue": "Config", "/src/plugin/announcement/form/info.vue": "InfoForm", "/src/plugin/announcement/view/info.vue": "Info", - "/src/plugin/email/view/index.vue": "Email" + "/src/plugin/email/view/index.vue": "Email", + "/src/view/order/idnex.vue": "OrderManage", + "/src/view/order/order/index.vue": "Order" } \ No newline at end of file diff --git a/src/pinia/modules/router.js b/src/pinia/modules/router.js index 33ebbc9..359f9ff 100644 --- a/src/pinia/modules/router.js +++ b/src/pinia/modules/router.js @@ -1,6 +1,6 @@ import { asyncRouterHandle } from '@/utils/asyncRouter' import { emitter } from '@/utils/bus.js' -import { asyncMenu } from '@/api/menu' +import { asyncMenu, getMenuList } from '@/api/menu' import { defineStore } from 'pinia' import { ref, watchEffect } from 'vue' import pathInfo from '@/pathInfo.json' @@ -106,8 +106,10 @@ export const useRouterStore = defineStore('router', () => { children: [] } ] - const asyncRouterRes = await asyncMenu() - const asyncRouter = asyncRouterRes.data.menus + // const asyncRouterRes = await asyncMenu() + const asyncRouterRes = await getMenuList() + // const asyncRouter = asyncRouterRes.data.menus + const asyncRouter = asyncRouterRes.data asyncRouter && asyncRouter.push({ path: 'reload', diff --git a/src/view/order/index.vue b/src/view/order/index.vue new file mode 100644 index 0000000..ccc458f --- /dev/null +++ b/src/view/order/index.vue @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/view/order/order/index.vue b/src/view/order/order/index.vue new file mode 100644 index 0000000..b8e0fe2 --- /dev/null +++ b/src/view/order/order/index.vue @@ -0,0 +1,92 @@ + + + + + + + + + + + + 查询 + 重置 + + + + + + + + + + + + + + + + + 删除 + + + + + + + + \ No newline at end of file