diff --git a/code/web/task_schedule/.eslintrc.cjs b/code/web/task_schedule/.eslintrc.cjs index 54a8ba5..e2c801f 100644 --- a/code/web/task_schedule/.eslintrc.cjs +++ b/code/web/task_schedule/.eslintrc.cjs @@ -1,101 +1,136 @@ /* * @Author: Kane - * @Date: 2022-12-14 15:12:46 + * @Date: 2023-03-14 09:19:21 * @LastEditors: Kane - * @LastEditTime: 2023-03-05 21:35:01 * @FilePath: /task_schedule/.eslintrc.cjs - * @Description: - * - * Copyright (c) ${2022} by Kane, All Rights Reserved. + * @Description: eslint 配置文件 + * + * Copyright (c) ${2022} by Kane, All Rights Reserved. */ + module.exports = { - root: true, - env: { //需要在 env 中指定运行的环境,这些环境其实就是一组预定义的全局变量,让 ESLint 知道当前环境存在这些全局变量 - node: true, - browser: true, - es2021: true, - }, - extends: [ - "plugin:vue/vue3-essential", - "eslint:recommended", - ], - // parser: "@babel/eslint-parser", - parserOptions: { - ecmaVersion: 2021, - sourceType: "module", - parser: "@babel/eslint-parser", - requireConfigFile: false, - }, - rules: { - "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", - "no-unused-vars": "warn", - "semi": ["error", "always",], //控制行尾部分号 - "quotes": ["error", "double",], - "comma-dangle": ["error", { - "arrays": "always", - "objects": "always", - "imports": "never", - "exports": "never", - "functions": "never", - },], //数组和对象键值对最后一个逗号 - "comma-style": ["error", "last",], //逗号在行位 - "array-bracket-spacing": ["error", "never",], - "no-undef-init": "error", - "no-invalid-this": "error", - "no-use-before-define": "error", - "no-shadow-restricted-names": "error", //禁止对一些关键字或者保留字进行赋值操作,比如NaN、Infinity、undefined、eval、arguments等 - "comma-spacing": ["error", { "before": false, "after": true, },], - "brace-style": ["error", "allman", { "allowSingleLine": true, },], - "prefer-const": "warn", - }, - overrides: [ - { - files: ["*.ts",], - parser: "@typescript-eslint/parser", - parserOptions: { - project: "./tsconfig.json", - }, - plugins: ["@typescript-eslint",], - extends: [ - "standard-with-typescript", + root: true, + env: { // 需要在env中指定运行的环境,这些环境其实就是一组预定义的全局变量,让 ESLint 知道当前环境存在这些全局变量 + node: true, + browser: true, + es2021: true, + }, + parser: "vue-eslint-parser", + parserOptions: { + ecmaVersion: 2021, + sourceType: "module", + parser: { // - diff --git a/code/web/task_schedule/src/components/ArchievementChartComponent.vue b/code/web/task_schedule/src/components/ArchievementChartComponent.vue index d9f7f1f..5818319 100644 --- a/code/web/task_schedule/src/components/ArchievementChartComponent.vue +++ b/code/web/task_schedule/src/components/ArchievementChartComponent.vue @@ -4,12 +4,12 @@ * @LastEditors: Kane * @FilePath: /task_schedule/src/components/ArchievementChartComponent.vue * @Description: 业绩图表组件 - * - * Copyright (c) ${2022} by Kane, All Rights Reserved. + * + * Copyright (c) ${2022} by Kane, All Rights Reserved. --> @@ -18,58 +18,58 @@ import { reactive, onMounted } from "vue"; import * as echarts from "echarts"; export default { - name: "ArchievementChartComponent", - props: { - chart_data: { - type: Array, - require: true, - }, + name: "ArchievementChartComponent", + props: { + chartData: { + type: Array, + require: true, + default: () => [], }, - setup(props) + }, + setup (props) + { + const ui = reactive({ + chart_data: props.chartData, + }); + + // 设置图表 + const initCharts = () => { - const ui = reactive({ - chart_data: props.chart_data, - }); + 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 initCharts = () => - { - const chartDom = document.getElementById("chartWrapper"); - // @ts-ignore - const myChart = echarts.init(chartDom); - const option = { - xAxis: { - type: "category", - data: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",], - }, - yAxis: { - type: "value", - data: [200, 400, 600, 800, 1000,], - }, - series: [ - { - data: props.chart_data, - type: "line", - }, - ], - }; + option && myChart.setOption(option); - option && myChart.setOption(option); + window.onresize = function () + { + // 自适应大小 + myChart.resize(); + }; + }; - window.onresize = function () - { - //自适应大小 - myChart.resize(); - }; - }; + onMounted(() => + { + initCharts(); + }); - onMounted(() => - { - initCharts(); - }); - - return { ui, initCharts, }; - }, + return { ui, initCharts, }; + }, }; @@ -105,4 +105,4 @@ export default { border-radius: 5px; } } - \ No newline at end of file + diff --git a/code/web/task_schedule/src/components/ArchievementCompleteRateComponent.vue b/code/web/task_schedule/src/components/ArchievementCompleteRateComponent.vue index aac21e3..531b7ee 100644 --- a/code/web/task_schedule/src/components/ArchievementCompleteRateComponent.vue +++ b/code/web/task_schedule/src/components/ArchievementCompleteRateComponent.vue @@ -9,8 +9,11 @@ -->