问题修改

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'
VITE_APP_TITLE = '无糖运营平台'
# 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()
} else {
// 访问其他页面则阻止
next({ path: '/login', query: { redirect: to.path } })
next({ path: '/login' })
}
}
})

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

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

@ -103,7 +103,7 @@ onMounted(() => {
],
center: ['50%', '60%'],
radius: 100,
radius: 70,
startAngle: 90,
splitNumber: 1,
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
myChart2.setOption({
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>
<template>
<div class="grid-content knowledge-statistic" style="height: 300px">
<!-- <h1>知识点统计</h1> -->
<div class="box">
<div style="width: 300px; height: 250px" id="main" class="radarmap"></div>
<div style="width: 300px; height: 250px" ref="liquidechart1"></div>
<div style="width: 300px; height: 250px" ref="liquidechart2"></div>
<div class="chart-item radarmap" id="main"></div>
<div class="chart-item" ref="liquidechart1"></div>
<div class="chart-item" ref="liquidechart2"></div>
</div>
</div>
</template>
@ -300,6 +333,16 @@ onMounted(() => {
display: flex;
justify-content: space-around;
align-content: center;
.chart-item {
width: 300px;
height: 250px;
}
}
}
@media screen and (max-width: 1600px) {
.chart-item {
width: 200px !important;
// height: 200px !important;
}
}
</style>

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

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