From 8f9abe2dd1b67465ea1e6254198bee120f8b1a61 Mon Sep 17 00:00:00 2001 From: qz_cx Date: Mon, 13 Oct 2025 17:11:43 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81Add=20device=20management=20page=202?= =?UTF-8?q?=E3=80=81Automatically=20redirect=20to=20data=20list=20after=20?= =?UTF-8?q?modifying=20user=20login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/front-project/src/api/api.js | 14 ++ .../src/components/kytuningLogin.vue | 2 +- templates/front-project/src/router/index.js | 19 +- .../src/views/machineViews/MachineList.vue | 209 ++++++++++++++++++ 4 files changed, 237 insertions(+), 7 deletions(-) create mode 100644 templates/front-project/src/views/machineViews/MachineList.vue diff --git a/templates/front-project/src/api/api.js b/templates/front-project/src/api/api.js index 11a914a..afc6ef6 100644 --- a/templates/front-project/src/api/api.js +++ b/templates/front-project/src/api/api.js @@ -210,4 +210,18 @@ export function error_list(type, paramsOrData) { commonConfig.data = paramsOrData; } return service(commonConfig); +} + +//错误数据管理 +export function machine_list(type, paramsOrData) { + const commonConfig = { + method: type, + url: '/machine_list/', + }; + if (type === 'get') { + commonConfig.params = paramsOrData; + } else { + commonConfig.data = paramsOrData; + } + return service(commonConfig); } \ No newline at end of file diff --git a/templates/front-project/src/components/kytuningLogin.vue b/templates/front-project/src/components/kytuningLogin.vue index 7e5dadd..2769aa1 100644 --- a/templates/front-project/src/components/kytuningLogin.vue +++ b/templates/front-project/src/components/kytuningLogin.vue @@ -60,7 +60,7 @@ export default { setToken('username', res.data.username) setToken('token', 'Bearer ' + res.data.token) this.$message({message: '登录成功', type: 'success'}) - this.$router.push('/test/list') + this.$router.push('/tempData') } }).catch(error => { // 捕获错误 diff --git a/templates/front-project/src/router/index.js b/templates/front-project/src/router/index.js index 9cbdd15..fe7c37b 100644 --- a/templates/front-project/src/router/index.js +++ b/templates/front-project/src/router/index.js @@ -16,10 +16,17 @@ const routes = [ component: () => import('@/components/kytuningLogin'), }, { - path: '/test1', + path: '/machine/list', name: '设备管理', iconClass: 'fa fa-users', component: () => import('@/components/KytuningHome'), + children: [ + { + name: '设备中心', + path: '/machine/list', + component: () => import('@/views/machineViews/MachineList'), + children: [] + },] }, { path: '/test/list', @@ -38,11 +45,11 @@ const routes = [ component: () => import('@/views/testViews/DoTest'), // props:true // 如果props设置为true,$route.params将被设置为组件属性记对象 }, - { - path: '/test/do_test_yaml', - name: '发起测试-yaml', - component: () => import('@/views/testViews/DoTest-yaml'), - }, + // { + // path: '/test/do_test_yaml', + // name: '发起测试-yaml', + // component: () => import('@/views/testViews/DoTest-yaml'), + // }, { path: '/test/config', name: '配置管理', diff --git a/templates/front-project/src/views/machineViews/MachineList.vue b/templates/front-project/src/views/machineViews/MachineList.vue new file mode 100644 index 0000000..158571c --- /dev/null +++ b/templates/front-project/src/views/machineViews/MachineList.vue @@ -0,0 +1,209 @@ + + + + + + + + + -- Gitee