From 1593bf497364307f12e0c17205f9db0098f354f5 Mon Sep 17 00:00:00 2001 From: yh Date: Fri, 21 Jun 2024 17:07:34 +0800 Subject: [PATCH 1/9] 123yh --- .env_1.development | 4 --- .env_1.production | 2 -- .env_1.test | 4 --- .eslintrc_1.cjs | 65 ---------------------------------------------- .prettierrc_1.json | 9 ------- .stylelintrc_1.cjs | 53 ------------------------------------- _1.eslintignore | 2 -- _1.gitignore | 24 ----------------- _1.stylelintignore | 4 --- index_1.html | 15 ----------- 10 files changed, 182 deletions(-) delete mode 100644 .env_1.development delete mode 100644 .env_1.production delete mode 100644 .env_1.test delete mode 100644 .eslintrc_1.cjs delete mode 100644 .prettierrc_1.json delete mode 100644 .stylelintrc_1.cjs delete mode 100644 _1.eslintignore delete mode 100644 _1.gitignore delete mode 100644 _1.stylelintignore delete mode 100644 index_1.html diff --git a/.env_1.development b/.env_1.development deleted file mode 100644 index 57ed20d..0000000 --- a/.env_1.development +++ /dev/null @@ -1,4 +0,0 @@ -# 变量必须以 VITE_ 为前缀才能暴露给外部读取 -NODE_ENV = 'development' -VITE_APP_TITLE = '无糖运营平台' -VITE_APP_BASE_API = '/api' \ No newline at end of file diff --git a/.env_1.production b/.env_1.production deleted file mode 100644 index 6d6d61c..0000000 --- a/.env_1.production +++ /dev/null @@ -1,2 +0,0 @@ -NODE_ENV = 'production' -VITE_APP_TITLE = '无糖运营平台' \ No newline at end of file diff --git a/.env_1.test b/.env_1.test deleted file mode 100644 index 536fa85..0000000 --- a/.env_1.test +++ /dev/null @@ -1,4 +0,0 @@ - # 变量必须以 VITE_ 为前缀才能暴露给外部读取 -NODE_ENV = 'test' -VITE_APP_TITLE = '无糖运营平台' -VITE_APP_BASE_API = '/test-api' \ No newline at end of file diff --git a/.eslintrc_1.cjs b/.eslintrc_1.cjs deleted file mode 100644 index af8e1fb..0000000 --- a/.eslintrc_1.cjs +++ /dev/null @@ -1,65 +0,0 @@ -// @see https://eslint.bootcss.com/docs/rules/ - -module.exports = { - env: { - browser: true, - es2021: true, - node: true, - jest: true, - }, - globals: { - VANTA: 'readonly', //VANTA 已经cdn引入 这里拒绝eslint报错 全局声明一下 - ElMessage: 'readonly', - ElMessageBox: 'readonly', - ElLoading: 'readonly', - }, - /* 指定如何解析语法 */ - parser: 'vue-eslint-parser', - /** 优先级低于 parse 的语法解析配置 */ - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - parser: '@typescript-eslint/parser', - jsxPragma: 'React', - ecmaFeatures: { - jsx: true, - }, - }, - /* 继承已有的规则 */ - extends: [ - 'eslint:recommended', - 'plugin:vue/vue3-essential', - 'plugin:@typescript-eslint/recommended', - 'plugin:prettier/recommended', - ], - plugins: ['vue', '@typescript-eslint'], - /* - * "off" 或 0 ==> 关闭规则 - * "warn" 或 1 ==> 打开的规则作为警告(不影响代码执行) - * "error" 或 2 ==> 规则作为一个错误(代码不能执行,界面报错) - */ - rules: { - // eslint(https://eslint.bootcss.com/docs/rules/) - 'no-var': 'off', // 要求使用 let 或 const 而不是 var - 'no-multiple-empty-lines': ['off', { max: 1 }], // 不允许多个空行 - 'no-console': process.env.NODE_ENV === 'production' ? 'off' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'off' : 'off', - 'no-unexpected-multiline': 'off', // 禁止空余的多行 - 'no-useless-escape': 'off', // 禁止不必要的转义字符 - - // typeScript (https://typescript-eslint.io/rules) - '@typescript-eslint/no-unused-vars': 'off', // 禁止定义未使用的变量 - '@typescript-eslint/prefer-ts-expect-off': 'off', // 禁止使用 @ts-ignore - '@typescript-eslint/ban-ts-ignore': 'off', - '@typescript-eslint/no-explicit-any': 'off', // 禁止使用 any 类型 - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-namespace': 'off', // 禁止使用自定义 TypeScript 模块和命名空间。 - '@typescript-eslint/semi': 'off', - - // eslint-plugin-vue (https://eslint.vuejs.org/rules/) - 'vue/multi-word-component-names': 'off', // 要求组件名称始终为 “-” 链接的单词 - 'vue/script-setup-uses-vars': 'off', // 防止 - - - - From 0ffe772345e76f165bfe9933b539efb8a4165771 Mon Sep 17 00:00:00 2001 From: xy <2115269706@qq.com> Date: Fri, 21 Jun 2024 18:16:12 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/courseChaptersApi.ts | 14 +------------- src/views/course/CourseObjectives.vue | 14 ++------------ 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/api/courseChaptersApi.ts b/src/api/courseChaptersApi.ts index 51d0c75..ccfebcf 100644 --- a/src/api/courseChaptersApi.ts +++ b/src/api/courseChaptersApi.ts @@ -92,24 +92,12 @@ export const deleteCourse = (params: any) => { method: 'DELETE', }) } -// /api/objective_contents/ +// /objective_contents/ // 获取详情 export const getCourseInfo = (params: any) => { return request({ -<<<<<<< HEAD - url: '/objective_contents/' + params.id, - method: 'get', - // params -======= -<<<<<<< HEAD - url: '/api/objective_contents/' + params.id, - method: 'get', - params, -======= url: '/objective_contents/' + params.id, method: "get", // params ->>>>>>> 1a620e19de970965f426e07348b1dbc4be900eaf ->>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a }) } diff --git a/src/views/course/CourseObjectives.vue b/src/views/course/CourseObjectives.vue index 2e1fc03..485a28d 100644 --- a/src/views/course/CourseObjectives.vue +++ b/src/views/course/CourseObjectives.vue @@ -3,12 +3,9 @@ import { ref, onMounted } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import { id } from 'element-plus/es/locales.mjs' import * as echarts from 'echarts' -<<<<<<< HEAD + // import { useRoute } from 'vue-router' -======= -<<<<<<< HEAD -import { useRoute } from 'vue-router' ->>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a + import { getCourseList, addCourse, @@ -16,14 +13,7 @@ import { deleteCourse, getCourseInfo, } from '@/api/courseChaptersApi' -<<<<<<< HEAD import { useRoute, useRouter } from 'vue-router' -======= -======= -import { useRoute ,useRouter} from 'vue-router' -import { getCourseList, addCourse, editCourse, deleteCourse, getCourseInfo } from '@/api/courseChaptersApi' ->>>>>>> 1a620e19de970965f426e07348b1dbc4be900eaf ->>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a const route = useRoute() const router = useRouter() // id : 分目标id From 894c303b9a3a43c874f982d2f3256440b2296d26 Mon Sep 17 00:00:00 2001 From: xy <2115269706@qq.com> Date: Fri, 21 Jun 2024 18:25:42 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9B=AE=E6=A0=87=E6=8E=A5=E5=8F=A3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/courseChaptersApi.ts | 2 +- src/views/course/CourseObjectives.vue | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/courseChaptersApi.ts b/src/api/courseChaptersApi.ts index ccfebcf..45525c2 100644 --- a/src/api/courseChaptersApi.ts +++ b/src/api/courseChaptersApi.ts @@ -96,7 +96,7 @@ export const deleteCourse = (params: any) => { // 获取详情 export const getCourseInfo = (params: any) => { return request({ - url: '/objective_contents/' + params.id, + url: 'api/objective_contents/' + params.id, method: "get", // params }) diff --git a/src/views/course/CourseObjectives.vue b/src/views/course/CourseObjectives.vue index 485a28d..428eac1 100644 --- a/src/views/course/CourseObjectives.vue +++ b/src/views/course/CourseObjectives.vue @@ -60,7 +60,7 @@ const handleClose = () => { const submit = async () => { if (flog.value) { await editCourse({ - id: activeIndex.value, + ...editdata.value, content: formData.value.description, }) } else { @@ -114,11 +114,13 @@ const filterTarger = (target) => { return res.label } +const editdata = ref({ id: '', objectiveId:'' }) // 编辑事件 const flog = ref(false) const editBook = async (obj) => { const res = await getCourseInfo({ id: obj.id }) - + editdata.value.id = res.data.id + editdata.value.objectiveId = res.data.objectiveId flog.value = true console.log(obj) activeIndex.value = res.data.id From 51d96cddccd59e2fb7a2bdcf0481ae34fc7ff9f4 Mon Sep 17 00:00:00 2001 From: ww Date: Fri, 21 Jun 2024 21:24:09 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E5=92=8Cecharts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/components/Echart/Echarts.vue | 129 +++++++++++-------- src/views/home/components/Echarts.vue | 3 +- src/views/home/components/Status.vue | 32 ++--- src/views/home/index.vue | 8 +- 4 files changed, 89 insertions(+), 83 deletions(-) diff --git a/src/views/home/components/Echart/Echarts.vue b/src/views/home/components/Echart/Echarts.vue index 9947fe9..af7d72a 100644 --- a/src/views/home/components/Echart/Echarts.vue +++ b/src/views/home/components/Echart/Echarts.vue @@ -7,79 +7,96 @@ onMounted(() => { // 绘制图表 myChart.setOption({ // 标题 - grid: { - left: '4%', // 左边距 - right: '10%', // 右边距 - bottom: '20%', // 底边距 - top: '10%', // 顶部边距 - }, tooltip: { trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999', + }, + }, }, - legend: { - left: 'center', // 图例水平居中 - bottom: 0, // 图例距离容器顶部的距离 - orient: 'horizontal', // 水平布局 - itemWidth: 16, // 设置图例标识的宽度为0,即不显示图标 - itemHeight: 0, // 设置图例标识的高度为0,即不显示图标 - data: ['本月', '上月'], - }, - // grid: { - // left: '3%', - // right: '4%', - // bottom: '3%', - // containLabel: true - // }, toolbox: { feature: { - saveAsImage: {}, + dataView: { show: true, readOnly: false }, + magicType: { show: true, type: ['line', 'bar'] }, + restore: { show: true }, + saveAsImage: { show: true }, }, }, - xAxis: { - type: 'category', - boundaryGap: true, - data: [ - '09-01', - '09-03', - '09-05', - '09-07', - '09-09', - '09-11', - '09-13', - '09-15', - ], - }, - yAxis: { - type: 'value', + legend: { + data: ['本月', '上月'], }, + xAxis: [ + { + type: 'category', + data: [ + '09-01', + '09-03', + '09-05', + '09-07', + '09-09', + '09-11', + '09-13', + '09-15', + ], + axisPointer: { + type: 'shadow', + }, + }, + ], + yAxis: [ + { + type: 'value', + name: '浏览次数', + min: 0, + max: 200, + interval: 40, + axisLabel: { + formatter: '{value}', + }, + }, + { + type: 'value', + name: '', + min: 0, + max: 100, + interval: 20, + axisLabel: { + formatter: '{value}', + }, + }, + ], series: [ { name: '本月', - // itemStyle: { - // color: '#0052D9' - // }, - symbol: 'circle', - itemStyle: { - color: '#0052D9', // 设置圆的颜色为白色 - borderWidth: 1.5, // 设置圆边框的宽度 - borderColor: 'white', // 设置圆边框的颜色 + type: 'bar', + tooltip: { + valueFormatter: function (value) { + return (value as number) + ' 次' + }, }, - symbolSize: 8, // 设置图标大小 - type: 'line', - data: [20, 38, 60, 65, 90, 55, 36, 30], + data: [2, 4, 7, 23, 25, 76, 35, 62, 32, 20, 6, 3], }, { name: '上月', - symbol: 'circle', - itemStyle: { - color: '#B5C7FF', // 设置圆的颜色为白色 - borderWidth: 1.5, // 设置圆边框的宽度 - borderColor: 'white', // 设置圆边框的颜色 + type: 'bar', + tooltip: { + valueFormatter: function (value) { + return (value as number) + ' 次' + }, }, - symbolSize: 8, // 设置图标大小 + data: [2, 5, 9, 26, 28, 70, 75, 82, 48, 18, 6, 2], + }, + { type: 'line', - - data: [22, 25, 48, 70, 80, 45, 24, 38], + yAxisIndex: 1, + data: [2, 4, 7, 23, 25, 76, 35, 62, 32, 20, 6, 3], + }, + { + type: 'line', + yAxisIndex: 1, + data: [2, 5, 9, 26, 28, 70, 75, 82, 48, 18, 6, 2], }, ], }) diff --git a/src/views/home/components/Echarts.vue b/src/views/home/components/Echarts.vue index 33d7c2b..731afa9 100644 --- a/src/views/home/components/Echarts.vue +++ b/src/views/home/components/Echarts.vue @@ -1,10 +1,11 @@