From 6f4dbdbd7e7b5617cce1cb4dadc349aa79702905 Mon Sep 17 00:00:00 2001 From: Kane Wang Date: Fri, 17 Mar 2023 15:11:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhtml=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E7=9A=84bug=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/web/task_schedule/.eslintrc.cjs | 1 + .../components/ArchievementChartComponent.vue | 93 ++++++++++--------- .../src/components/HonorListComponent.vue | 13 ++- .../src/views/DesktopArchievement.vue | 25 +++-- 4 files changed, 66 insertions(+), 66 deletions(-) diff --git a/code/web/task_schedule/.eslintrc.cjs b/code/web/task_schedule/.eslintrc.cjs index e2c801f..1efc942 100644 --- a/code/web/task_schedule/.eslintrc.cjs +++ b/code/web/task_schedule/.eslintrc.cjs @@ -36,6 +36,7 @@ module.exports = { ], rules: { indent: ["warn", 4,], + "space-in-parens": ["error", "always", { exceptions: ["empty",], },], "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-unused-vars": "warn", diff --git a/code/web/task_schedule/src/components/ArchievementChartComponent.vue b/code/web/task_schedule/src/components/ArchievementChartComponent.vue index 5818319..8dcc00f 100644 --- a/code/web/task_schedule/src/components/ArchievementChartComponent.vue +++ b/code/web/task_schedule/src/components/ArchievementChartComponent.vue @@ -18,58 +18,59 @@ import { reactive, onMounted } from "vue"; import * as echarts from "echarts"; export default { - name: "ArchievementChartComponent", - props: { - chartData: { - type: Array, - require: true, - default: () => [], + name: "ArchievementChartComponent", + props: { + chartData: { + type: Array, + require: true, + default: () => [], + }, }, - }, - setup (props) - { - const ui = reactive({ - chart_data: props.chartData, - }); - - // 设置图表 - const initCharts = () => + setup( props ) { - const chartDom = document.getElementById("chartWrapper"); - const myChart = echarts.init(chartDom as HTMLDivElement); - const option = { - xAxis: { - type: "category", - data: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",], - }, - yAxis: { - type: "value", - data: [200, 400, 600, 800, 1000,], - }, - series: [ - { - data: props.chartData, - type: "line", - }, - ], - }; + const ui = reactive( { + } ); - option && myChart.setOption(option); + // 设置图表 + const initCharts = () => + { + const chartDom = document.getElementById( "chartWrapper" ); + const myChart = echarts.init( chartDom as HTMLDivElement ); + const option = { + xAxis: { + type: "category", + data: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",], + }, + yAxis: { + type: "value", + data: [200, 400, 600, 800, 1000,], + }, + series: [ + { + data: props.chartData, + type: "line", + }, + ], + }; - window.onresize = function () - { - // 自适应大小 - myChart.resize(); - }; - }; + option && myChart.setOption( option ); - onMounted(() => - { - initCharts(); - }); + window.onresize = function () + { + // 自适应大小 + myChart.resize(); + }; + }; - return { ui, initCharts, }; - }, + onMounted( () => + { + initCharts(); + } ); + + console.log( props ); + + return { ui, initCharts, props, }; + }, }; diff --git a/code/web/task_schedule/src/components/HonorListComponent.vue b/code/web/task_schedule/src/components/HonorListComponent.vue index dd92952..3069ec5 100644 --- a/code/web/task_schedule/src/components/HonorListComponent.vue +++ b/code/web/task_schedule/src/components/HonorListComponent.vue @@ -4,8 +4,8 @@ * @LastEditors: Kane * @FilePath: /task_schedule/src/components/HonorListComponent.vue * @Description: 光荣榜组件 - * - * Copyright (c) ${2022} by Kane, All Rights Reserved. + * + * Copyright (c) ${2022} by Kane, All Rights Reserved. -->