From 617479e3c1405b0189363ce31a0d3f7086609294 Mon Sep 17 00:00:00 2001 From: zhaozhenfang Date: Mon, 25 Dec 2023 15:05:50 +0800 Subject: [PATCH] develop the framework of the frontend --- atune/web/src/App.vue | 90 +++++++++---- atune/web/src/api/atune.ts | 37 +++--- atune/web/src/assets/main.css | 43 +++--- atune/web/src/components/table.vue | 160 ++++++++++++---------- atune/web/src/router/index.ts | 34 +++-- atune/web/src/types/atune.d.ts | 11 +- atune/web/src/views/Home.vue | 205 ++++++++++++++--------------- atune/web/src/views/taskDetail.vue | 13 ++ atune/web/src/views/taskList.vue | 198 ++++++++++++++++++++++++++++ 9 files changed, 537 insertions(+), 254 deletions(-) create mode 100644 atune/web/src/views/taskDetail.vue create mode 100644 atune/web/src/views/taskList.vue diff --git a/atune/web/src/App.vue b/atune/web/src/App.vue index 63ccd49e..6b7e6fe4 100644 --- a/atune/web/src/App.vue +++ b/atune/web/src/App.vue @@ -1,5 +1,18 @@ @@ -19,27 +32,56 @@ const zhCn = ref(locale); -moz-osx-font-smoothing: grayscale; height: 100%; width: 100%; - // overflow: hidden; /* Ensure no scrollbars on the app container */ -} + background-color: #f5f5f9; + + .top { + width: 100%; + height: 64px; + display: flex; + flex-direction: column; + justify-content: center; -// html { -// margin: 0; -// padding: 0; -// height: 100%; -// width: 100%; -// } + &-title { + padding-left: 40px; + font-size: 18px; + font-weight: 600; + color: #333; + display: inline-block; + } -// body { -// margin: 0; -// padding: 0; -// height: 100%; -// width: 100%; -// background-color: rgb(11, 35, 117); -// // overflow: hidden; /* Ensure no scrollbars on the body */ -// transform-origin: 0 0 0; -// -moz-transform-origin: 0 0 0; -// -ms-transform-origin: 0 0 0; -// -webkit-transform-origin: 0 0 0; -// -o-transform-origin: 0 0 0; -// } - \ No newline at end of file + &-description { + padding-left: 40px; + font-size: 16px; + color: #444; + font-weight: 500; + } + } + .nav { + width: 200px; + height: 38px; + margin: 0 auto; + display: flex; + justify-content: space-around; + align-items: center; + &-link { + display: inline-block; + width: 46%; + text-align: center; + text-decoration: none; + color: rgb(96, 122, 207); + border-radius: 6px; + font-weight: bold; + &:hover { + background-color: rgba(96, 122, 207, 0.4); + color: #fff; + } + } + .active { + color: #fff; + background-color: rgb(96, 122, 207); + box-shadow: 0 1px 6px 0 rgba(96, 122, 207, 0.4), + 0 2px 6px 0 rgba(96, 122, 207, 0.8); + } + } +} + diff --git a/atune/web/src/api/atune.ts b/atune/web/src/api/atune.ts index d1f1f196..fa0cba1b 100644 --- a/atune/web/src/api/atune.ts +++ b/atune/web/src/api/atune.ts @@ -1,26 +1,27 @@ -import request from './request'; +import request from "./request"; // 获取所有的任务列表 -export function getTaskLists() { +export function getTaskLists(data: Object) { return request({ - url: '/plugin/atune/tasks', - method: 'get', + url: "/plugin/atune/tasks", + method: "get", + params: data, }); } // 获取所有的调优列表 export function getAtuneAllName() { return request({ - url: '/plugin/atune/all', - method: 'get', + url: "/plugin/atune/all", + method: "get", }); } // 获取某个调优对象的具体信息 export function getAtuneInfo(data: object) { return request({ - url: '/plugin/atune/info', - method: 'get', + url: "/plugin/atune/info", + method: "get", params: data, }); } @@ -28,8 +29,8 @@ export function getAtuneInfo(data: object) { // 获取调优模板列表分页 export function getTuneLists(data: object) { return request({ - url: '/plugin/atune/tunes', - method: 'get', + url: "/plugin/atune/tunes", + method: "get", params: data, }); } @@ -37,8 +38,8 @@ export function getTuneLists(data: object) { // 保存调优模板 export function saveTune(data: object) { return request({ - url: '/plugin/atune/save', - method: 'post', + url: "/plugin/atune/save", + method: "post", data, }); } @@ -46,8 +47,8 @@ export function saveTune(data: object) { // 删除调优模板 export function deleteTune(data: object) { return request({ - url: '/plugin/atune/delete', - method: 'delete', + url: "/plugin/atune/delete", + method: "delete", data, }); } @@ -55,8 +56,8 @@ export function deleteTune(data: object) { // 高级搜索模板列表分页 export function searchTune(data: object) { return request({ - url: '/plugin/atune/search', - method: 'get', + url: "/plugin/atune/search", + method: "get", params: data, }); } @@ -64,8 +65,8 @@ export function searchTune(data: object) { // 编辑模板更新 export function updateTune(data: object) { return request({ - url: '/plugin/atune/update', - method: 'post', + url: "/plugin/atune/update", + method: "post", data, }); } diff --git a/atune/web/src/assets/main.css b/atune/web/src/assets/main.css index 4f5ffc80..22c44adf 100644 --- a/atune/web/src/assets/main.css +++ b/atune/web/src/assets/main.css @@ -1,20 +1,25 @@ - html { - height: 100%; - width: 100%; - margin: 0px; - padding: 0px; - box-sizing: border-box; - } - - body { - height: 100%; - width: 100%; - margin: 0px; - padding: 0px; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, - Microsoft YaHei, Arial, sans-serif; - } + height: 100%; + width: 100%; + margin: 0px; + padding: 0px; + box-sizing: border-box; +} + +body { + height: 100%; + width: 100%; + margin: 0px; + padding: 0px; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + /* font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, + Microsoft YaHei, Arial, sans-serif; */ + font-family: Public Sans, sans-serif, -apple-system, blinkmacsystemfont, + Segoe UI, roboto, Helvetica Neue, arial, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", Segoe UI Symbol; +} +.shadow { + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), 0 2px 6px 0 rgba(0, 0, 0, 0.1); +} diff --git a/atune/web/src/components/table.vue b/atune/web/src/components/table.vue index c487884d..7c5e3405 100644 --- a/atune/web/src/components/table.vue +++ b/atune/web/src/components/table.vue @@ -1,101 +1,123 @@ @@ -111,7 +133,11 @@ onMounted(() => { width: 100%; height: 6%; border-radius: 8px 8px 0 0; - background: linear-gradient(to right, rgb(11, 35, 117) 0%, rgb(96, 122, 207) 100%, ); + background: linear-gradient( + to right, + rgb(11, 35, 117) 0%, + rgb(96, 122, 207) 100% + ); .header_content { height: 100%; @@ -121,7 +147,7 @@ onMounted(() => { align-items: center; color: #fff; - .table_search{ + .table_search { margin-left: auto; } } @@ -135,10 +161,10 @@ onMounted(() => { width: 100%; margin: 0; :deep(.el-pagination) { - justify-content: flex-end; - .el-pagination__sizes { - flex: 1, - } + justify-content: flex-end; + .el-pagination__sizes { + flex: 1; + } } .el-pagination { text-align: right; @@ -152,4 +178,4 @@ onMounted(() => { } } } - \ No newline at end of file + diff --git a/atune/web/src/router/index.ts b/atune/web/src/router/index.ts index 20d23202..e40df3f3 100644 --- a/atune/web/src/router/index.ts +++ b/atune/web/src/router/index.ts @@ -1,28 +1,34 @@ -import { createRouter, createWebHistory } from 'vue-router'; -import type { RouteRecordRaw } from 'vue-router'; -import Home from '@/views/Home.vue'; -import Result from '@/views/ResultInfo.vue'; +import { createRouter, createWebHistory } from "vue-router"; +import type { RouteRecordRaw } from "vue-router"; +import Home from "@/views/Home.vue"; +import Atune from "@/components/atuneList.vue"; +import Result from "@/views/ResultInfo.vue"; const routes: Array = [ { - path: '/', - redirect: '/atune' + path: "/", + redirect: "/task", }, { - path: '/atune', + path: "/task", component: Home, - meta: { title: '任务列表' }, + meta: { title: "任务列表" }, children: [ { - path: 'detail', - component: () => import("../components/atuneTemplete.vue") - } - ] + path: "detail", + component: () => import("../views/taskDetail.vue"), + }, + ], }, { - path: '/result', + path: "/atune", + component: Atune, + meta: { title: "模板列表" }, + }, + { + path: "/result", component: Result, - meta: { title: '结果展示' }, + meta: { title: "结果展示" }, }, ]; diff --git a/atune/web/src/types/atune.d.ts b/atune/web/src/types/atune.d.ts index 340465d8..18ea8b2c 100644 --- a/atune/web/src/types/atune.d.ts +++ b/atune/web/src/types/atune.d.ts @@ -1,10 +1,11 @@ export interface Task { id: number; - name: string; - atune: string; - state: number; - createTime: string; - updateTime: string; + task_name: string; + command: string; + task_status: string; + create_time: string; + update_time: string; + results: [{}]; } export interface Atune { diff --git a/atune/web/src/views/Home.vue b/atune/web/src/views/Home.vue index dd4034fd..3a1862df 100644 --- a/atune/web/src/views/Home.vue +++ b/atune/web/src/views/Home.vue @@ -1,95 +1,110 @@ diff --git a/atune/web/src/views/taskList.vue b/atune/web/src/views/taskList.vue new file mode 100644 index 00000000..6b70075a --- /dev/null +++ b/atune/web/src/views/taskList.vue @@ -0,0 +1,198 @@ + + + + + -- Gitee