问题修改

develoop
JayChou 1 month ago
parent 244fa219ef
commit d2bd4f86d1
  1. 2
      .env.development
  2. 8302
      pnpm-lock.yaml
  3. 2
      src/permission.ts
  4. 4
      src/views/course/components/course-brief.vue
  5. 32
      src/views/course/components/course-chapters.vue
  6. 51
      src/views/course/components/knowledge-statistic.vue
  7. 9
      src/views/login/index.vue
  8. 4
      src/views/student/index.vue
  9. 12
      vite.config.ts

@ -2,4 +2,4 @@
NODE_ENV = 'development' NODE_ENV = 'development'
VITE_APP_TITLE = '无糖运营平台' VITE_APP_TITLE = '无糖运营平台'
# VITE_APP_BASE_API = 'http://127.0.0.1:8080' # VITE_APP_BASE_API = 'http://127.0.0.1:8080'
VITE_APP_BASE_API = 'http://39.106.16.162:8080' VITE_APP_BASE_API = 'http://10.100.200.177:8080'

File diff suppressed because it is too large Load Diff

@ -61,7 +61,7 @@ router.beforeEach(async (to, form, next) => {
next() next()
} else { } else {
// 访问其他页面则阻止 // 访问其他页面则阻止
next({ path: '/login', query: { redirect: to.path } }) next({ path: '/login' })
} }
} }
}) })

@ -177,8 +177,8 @@ onMounted(() => {
li { li {
// margin-top: 10px; // margin-top: 10px;
// padding-left: 10px; // padding-left: 10px;
width: 33%;
margin-right: 80px; // margin-right: 80px;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
margin-bottom: 10px; margin-bottom: 10px;

@ -15,7 +15,7 @@ const courseId = ref()
// const courseId = '719f91586a64413898253c5b7d046fd8' // const courseId = '719f91586a64413898253c5b7d046fd8'
onMounted(() => { onMounted(() => {
courseId.value = route.query.id courseId.value = route.query.id
console.log(courseId.value, 'route.query.id'); console.log(courseId.value, 'route.query.id')
// courseId.value = '719f91586a64413898253c5b7d046fd8' // courseId.value = '719f91586a64413898253c5b7d046fd8'
getChaptersList() getChaptersList()
@ -24,7 +24,7 @@ onMounted(() => {
// console.log(courseId.value, 'courseId.value') // console.log(courseId.value, 'courseId.value')
const getChaptersList = async () => { const getChaptersList = async () => {
console.log(courseId, 'courseId.value') console.log(courseId, 'courseId.value')
const res = await getChaptersListApi({ id: courseId }) const res = await getChaptersListApi({ id: courseId.value })
console.log(res, 'get') console.log(res, 'get')
const transformedData: Tree[] = res.data.map((item: any) => ({ const transformedData: Tree[] = res.data.map((item: any) => ({
id: item.id, id: item.id,
@ -107,7 +107,7 @@ const remove = async (node: Node, data: Tree) => {
}) })
} }
// //
const getDetails = (id: any) => { } const getDetails = (id: any) => {}
const dataSource = ref<Tree[]>([ const dataSource = ref<Tree[]>([
{ {
id, id,
@ -135,18 +135,36 @@ const dataSource = ref<Tree[]>([
<h1>课程章节</h1> <h1>课程章节</h1>
<!-- <button @click="getChaptersList">获取</button> --> <!-- <button @click="getChaptersList">获取</button> -->
<div class="custom-tree-container"> <div class="custom-tree-container">
<el-tree style="max-width: 600px" :data="dataSource" node-key="id" default-expand-all <el-tree
:expand-on-click-node="false" empty-text="暂无章节"> style="max-width: 600px"
:data="dataSource"
node-key="id"
default-expand-all
:expand-on-click-node="false"
empty-text="暂无章节"
>
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node"> <span class="custom-tree-node">
<span @click="getDetails(data.id)">{{ data.name }}</span> <span @click="getDetails(data.id)">{{ data.name }}</span>
<span> <span>
<el-button @click="append(data)" circle size="small" type="primary" plain> <el-button
@click="append(data)"
circle
size="small"
type="primary"
plain
>
<el-icon :size="15"> <el-icon :size="15">
<Plus /> <Plus />
</el-icon> </el-icon>
</el-button> </el-button>
<el-button @click="remove(node, data)" circle size="small" type="danger" plain> <el-button
@click="remove(node, data)"
circle
size="small"
type="danger"
plain
>
<el-icon :size="15"> <el-icon :size="15">
<Delete /> <Delete />
</el-icon> </el-icon>

@ -103,7 +103,7 @@ onMounted(() => {
], ],
center: ['50%', '60%'], center: ['50%', '60%'],
radius: 100, radius: 70,
startAngle: 90, startAngle: 90,
splitNumber: 1, splitNumber: 1,
shape: 'circle', shape: 'circle',
@ -222,6 +222,20 @@ onMounted(() => {
}, },
], ],
}) })
let resize = throttle(() => {
console.log(111, myChart.resize)
setTimeout(() => {
myChart.resize()
}, 0)
})
let resize1 = throttle(() => {
setTimeout(() => {
myChart1.resize()
}, 0)
})
window.addEventListener('resize', resize)
window.addEventListener('resize', resize1)
const myChart2 = echarts.init(liquidechart2.value) // 使 ref const myChart2 = echarts.init(liquidechart2.value) // 使 ref
myChart2.setOption({ myChart2.setOption({
title: { title: {
@ -274,16 +288,35 @@ onMounted(() => {
}, },
], ],
}) })
let resize2 = throttle(() => {
setTimeout(() => {
myChart2.resize()
}, 0)
})
window.addEventListener('resize', resize2)
}) })
const throttle = (fn: any) => {
let timer: any
return function () {
if (timer) {
return
}
timer = setTimeout(() => {
fn()
clearTimeout(timer)
timer = null
}, 1000)
}
}
</script> </script>
<template> <template>
<div class="grid-content knowledge-statistic" style="height: 300px"> <div class="grid-content knowledge-statistic" style="height: 300px">
<!-- <h1>知识点统计</h1> --> <!-- <h1>知识点统计</h1> -->
<div class="box"> <div class="box">
<div style="width: 300px; height: 250px" id="main" class="radarmap"></div> <div class="chart-item radarmap" id="main"></div>
<div style="width: 300px; height: 250px" ref="liquidechart1"></div> <div class="chart-item" ref="liquidechart1"></div>
<div style="width: 300px; height: 250px" ref="liquidechart2"></div> <div class="chart-item" ref="liquidechart2"></div>
</div> </div>
</div> </div>
</template> </template>
@ -300,6 +333,16 @@ onMounted(() => {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-content: center; align-content: center;
.chart-item {
width: 300px;
height: 250px;
}
}
}
@media screen and (max-width: 1600px) {
.chart-item {
width: 200px !important;
// height: 200px !important;
} }
} }
</style> </style>

@ -523,12 +523,9 @@ const login = async () => {
try { try {
await userStore.userLogin(formModel.value).then(() => { await userStore.userLogin(formModel.value).then(() => {
isBtnLoading.value = false isBtnLoading.value = false
$router.push('/curriculumCenter/basicCourseInformation') // $router.push('/curriculumCenter/basicCourseInformation')
if ($route.query.redirect) {
$router.push($route.query.redirect as string) $router.push('/')
} else {
$router.push('/')
}
}) })
} catch (error) { } catch (error) {
isBtnLoading.value = false isBtnLoading.value = false

@ -11,7 +11,7 @@ import {
} from '@/api/user/stud' } from '@/api/user/stud'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
// import editStu from './components/editStu.vue' import editStu from './components/editStu.vue'
// import { tryOnMounted } from '@vueuse/core' // import { tryOnMounted } from '@vueuse/core'
const userStore = useUserStore() const userStore = useUserStore()
// console.log(userStore.data.id, 'icon') // // console.log(userStore.data.id, 'icon') //
@ -67,6 +67,8 @@ const drawer = ref(false)
// //
const stuChange = ref() const stuChange = ref()
const editTable = (row) => { const editTable = (row) => {
console.log( stuChange.value,' stuChange.value');
stuChange.value.open(row) stuChange.value.open(row)
console.log(row) console.log(row)
drawer.value = true drawer.value = true

@ -34,5 +34,17 @@ export default ({ command }: any) => {
}, },
}, },
}, },
server: {
host: '0.0.0.0',
port: 8080,
open: true,
// proxy: {
// '/api': {
// target: 'http://10.100.200.177:8080',
// changeOrigin: true,
// rewrite: (path: any) => path.replace('/api', ''),
// },
// },
},
} }
} }

Loading…
Cancel
Save