From 831f2117020d01ed07e709fc96047b53258ece49 Mon Sep 17 00:00:00 2001
From: zhujiyan <17812234322@163.com>
Date: Tue, 27 Aug 2024 14:01:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E9=80=89=E6=8B=A9=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/App.vue | 25 +-
frontend/src/api/plan/static.json | 63 +++++
frontend/src/assets/icons/out_login.svg | 1 +
frontend/src/assets/images/plan/static/1.svg | 1 +
frontend/src/assets/images/plan/static/2.svg | 1 +
frontend/src/assets/images/plan/static/3.svg | 1 +
frontend/src/assets/images/plan/static/4.svg | 1 +
frontend/src/assets/images/plan/static/5.svg | 1 +
frontend/src/assets/images/plan/static/6.svg | 1 +
.../src/components/echarts/pie/default.vue | 23 +-
.../components/Header/components/Avatar.vue | 3 +-
frontend/src/views/dashboard/index.vue | 229 ------------------
frontend/src/views/home/components/tree.vue | 7 +-
frontend/src/views/home/tabs/dashboard.vue | 218 ++++++++++++-----
frontend/src/views/home/tabs/model.vue | 3 +-
frontend/src/views/plan/planList/index.vue | 22 +-
16 files changed, 279 insertions(+), 321 deletions(-)
create mode 100644 frontend/src/api/plan/static.json
create mode 100644 frontend/src/assets/icons/out_login.svg
create mode 100644 frontend/src/assets/images/plan/static/1.svg
create mode 100644 frontend/src/assets/images/plan/static/2.svg
create mode 100644 frontend/src/assets/images/plan/static/3.svg
create mode 100644 frontend/src/assets/images/plan/static/4.svg
create mode 100644 frontend/src/assets/images/plan/static/5.svg
create mode 100644 frontend/src/assets/images/plan/static/6.svg
delete mode 100644 frontend/src/views/dashboard/index.vue
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index d407ed5..6f2e848 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -1,14 +1,18 @@
-
-
-
-
+
+
+
+
-
-
+
diff --git a/frontend/src/api/plan/static.json b/frontend/src/api/plan/static.json
new file mode 100644
index 0000000..f3de0c6
--- /dev/null
+++ b/frontend/src/api/plan/static.json
@@ -0,0 +1,63 @@
+{
+ "code": "200",
+ "data": [
+ {
+ "name": "未检测",
+ "children": [
+ {
+ "id": 4,
+ "pid": 1,
+ "name": "检测计划1"
+ },
+ {
+ "id": 5,
+ "pid": 1,
+ "name": "检测计划2"
+ },
+ {
+ "id": 6,
+ "pid": 1,
+ "name": "检测计划3"
+ }
+ ],
+ "id": 1
+ },
+ {
+ "name": "检测中",
+ "children": [
+ {
+ "id": 7,
+ "pid": 2,
+ "name": "检测计划4"
+ },
+ {
+ "id": 8,
+ "pid": 2,
+ "name": "检测计划5"
+ },
+ {
+ "id": 9,
+ "pid": 2,
+ "name": "检测计划6"
+ }
+ ],
+ "id": 2
+ },
+ {
+ "name": "检测完成",
+ "children": [
+ {
+ "id": 10,
+ "pid": 3,
+ "name": "检测计划7"
+ },
+ {
+ "id": 11,
+ "pid": 3,
+ "name": "检测计划8"
+ }
+ ],
+ "id": 3
+ }
+ ]
+}
\ No newline at end of file
diff --git a/frontend/src/assets/icons/out_login.svg b/frontend/src/assets/icons/out_login.svg
new file mode 100644
index 0000000..727832f
--- /dev/null
+++ b/frontend/src/assets/icons/out_login.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/assets/images/plan/static/1.svg b/frontend/src/assets/images/plan/static/1.svg
new file mode 100644
index 0000000..f41e568
--- /dev/null
+++ b/frontend/src/assets/images/plan/static/1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/assets/images/plan/static/2.svg b/frontend/src/assets/images/plan/static/2.svg
new file mode 100644
index 0000000..51be859
--- /dev/null
+++ b/frontend/src/assets/images/plan/static/2.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/assets/images/plan/static/3.svg b/frontend/src/assets/images/plan/static/3.svg
new file mode 100644
index 0000000..7a732b8
--- /dev/null
+++ b/frontend/src/assets/images/plan/static/3.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/assets/images/plan/static/4.svg b/frontend/src/assets/images/plan/static/4.svg
new file mode 100644
index 0000000..3342fc7
--- /dev/null
+++ b/frontend/src/assets/images/plan/static/4.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/assets/images/plan/static/5.svg b/frontend/src/assets/images/plan/static/5.svg
new file mode 100644
index 0000000..84697d0
--- /dev/null
+++ b/frontend/src/assets/images/plan/static/5.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/assets/images/plan/static/6.svg b/frontend/src/assets/images/plan/static/6.svg
new file mode 100644
index 0000000..0f9a76f
--- /dev/null
+++ b/frontend/src/assets/images/plan/static/6.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/components/echarts/pie/default.vue b/frontend/src/components/echarts/pie/default.vue
index 7269cb5..087a189 100644
--- a/frontend/src/components/echarts/pie/default.vue
+++ b/frontend/src/components/echarts/pie/default.vue
@@ -31,7 +31,8 @@ const props = defineProps({
},
});
const customData: any = ref({}),
- legendData: any = ref({});
+ legendData: any = ref({}),
+ chart: any = ref();
const init = () => {
customData.value = {
title: "", //标题
@@ -50,7 +51,7 @@ const init = () => {
itemGap: 0, // 设置图例项之间的间隔为20
...props.legendData,
};
- var chart = chartsRef.value && echarts.init(chartsRef.value);
+ chart.value = chartsRef.value && echarts.init(chartsRef.value)
var option = {
title: {
text: customData.value.title,
@@ -90,26 +91,24 @@ const init = () => {
},
],
};
- option && chart.setOption(option);
+ option &&chart.value&& chart.value.setOption(option);
setTimeout(() => {
- chart.resize();
+ chart.value.resize();
}, 0);
};
const resizeCharts = () => {
- var chart = chartsRef.value && echarts.init(chartsRef.value);
- if (chart) {
- chart.resize();
+ if (chart.value) {
+ chart.value.resize();
}
};
window.addEventListener("resize", resizeCharts);
onUnmounted(() => {
- var chart = chartsRef.value && echarts.init(chartsRef.value);
- if (chart) {
- chart.resize();
+ if (chart.value) {
+ chart.value.resize();
}
window.removeEventListener("resize", resizeCharts);
- if (chart) {
- chart.dispose();
+ if (chart.value != null && chart.value.dispose) {
+ chart.value.dispose(); // 销毁图表
}
});
watch(
diff --git a/frontend/src/layouts/components/Header/components/Avatar.vue b/frontend/src/layouts/components/Header/components/Avatar.vue
index 74605d6..005cbd2 100644
--- a/frontend/src/layouts/components/Header/components/Avatar.vue
+++ b/frontend/src/layouts/components/Header/components/Avatar.vue
@@ -23,7 +23,7 @@
-

+
@@ -91,6 +91,7 @@ const changeMode = () => {
display: flex;
justify-content: flex-start;
align-items: center;
+ cursor: pointer;
.icon {
width: 18px;
height: 18px;
diff --git a/frontend/src/views/dashboard/index.vue b/frontend/src/views/dashboard/index.vue
deleted file mode 100644
index 00602c4..0000000
--- a/frontend/src/views/dashboard/index.vue
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-
-
-
-
-
![]()
-
-
-
-
-
-
-
diff --git a/frontend/src/views/home/components/tree.vue b/frontend/src/views/home/components/tree.vue
index 694c48b..ad0e0a9 100644
--- a/frontend/src/views/home/components/tree.vue
+++ b/frontend/src/views/home/components/tree.vue
@@ -12,6 +12,7 @@
:props="defaultProps"
node-key="id"
default-expand-all
+ :default-checked-keys="defaultChecked"
@node-click="handleNodeClick"
>
@@ -24,13 +25,16 @@ const data: any = ref([]);
const defaultProps = {
children: "children",
label: "name",
+ pid:"pid",
};
const searchForm = ref({
planName: "",
});
+const defaultChecked=ref([])
const getTreeData = (val: any) => {
- console.log(val, ",,,,");
+ defaultChecked.value=[]
data.value = val;
+ defaultChecked.value.push(data.value[0].children[0].id)
};
const filterText = ref("");
const treeRef = ref();
@@ -63,6 +67,7 @@ defineExpose({ getTreeData });
flex-direction: column;
padding: 5px;
height: calc(100% - 70px);
+ background-color: #fff;
.el-input {
width: 100%;
margin: 0 10px 10px 0;
diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue
index d982067..809185a 100644
--- a/frontend/src/views/home/tabs/dashboard.vue
+++ b/frontend/src/views/home/tabs/dashboard.vue
@@ -6,53 +6,10 @@
-
+
-
+
-
+
+
+
+
+
![]()
+
+
+
+
+
+
+
@@ -155,11 +176,13 @@