yh 5 months ago
commit d8161eb405
  1. 2
      .env.development
  2. 2
      src/api/courseChaptersApi.ts
  3. 163
      src/views/course/CourseObjectives.vue
  4. 6
      src/views/course/basicCourseInformation.vue
  5. 9
      src/views/course/components/courseEdit.vue

@ -1,4 +1,4 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取 # 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development' NODE_ENV = 'development'
VITE_APP_TITLE = '无糖运营平台' VITE_APP_TITLE = '无糖运营平台'
VITE_APP_BASE_API = 'http://39.106.16.162:8080' VITE_APP_BASE_API = 'http://127.0.0.1:8080'

@ -98,6 +98,6 @@ export const getCourseInfo = (params: any) => {
return request({ return request({
url: '/api/objective_contents/' + params.id, url: '/api/objective_contents/' + params.id,
method: 'get', method: 'get',
params, // params
}) })
} }

@ -3,7 +3,7 @@ import { ref, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { id } from 'element-plus/es/locales.mjs' import { id } from 'element-plus/es/locales.mjs'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { useRoute } from 'vue-router' // import { useRoute } from 'vue-router'
import { import {
getCourseList, getCourseList,
addCourse, addCourse,
@ -11,7 +11,9 @@ import {
deleteCourse, deleteCourse,
getCourseInfo, getCourseInfo,
} from '@/api/courseChaptersApi' } from '@/api/courseChaptersApi'
import { useRoute, useRouter } from 'vue-router'
const route = useRoute() const route = useRoute()
const router = useRouter()
// id id // id id
// targetId // targetId
@ -154,6 +156,9 @@ const getList = async () => {
const data = ref({}) const data = ref({})
const courseId = ref(0) const courseId = ref(0)
onMounted(async () => { onMounted(async () => {
if (!Object.keys(route.query).length) {
return router.push('/curriculumCenter/basicCourseInformation')
}
courseId.value = route.query.id courseId.value = route.query.id
console.log(courseId.value) console.log(courseId.value)
getList() getList()
@ -162,35 +167,155 @@ onMounted(async () => {
let myChart = echarts.init(chartDom) let myChart = echarts.init(chartDom)
let option let option
option = { option = {
title: { radar: [
text: '分目标', {
nameGap: 20,
indicator: [
{
text: '目标一\n',
max: 100,
},
{
text: '目标五\n\n',
max: 100,
},
{
text: '目标四\n\n',
max: 100,
},
{
text: '目标三\n\n',
max: 100,
},
{
text: '目标二\n\n',
max: 100,
},
],
center: ['50%', '50%'],
radius: 100,
startAngle: 90,
splitNumber: 6,
shape: 'circle',
name: {
formatter: '{value}',
textStyle: {
color: '#333333',
fontSize: 20,
}, },
legend: { gap: 60,
data: ['Allocated Budget', 'Actual Spending'],
}, },
radar: { splitArea: {
// shape: 'circle', areaStyle: {
color: [
'transparent',
'transparent',
'rgba(114, 172, 209, 0)',
'transparent',
'rgba(114, 172, 209, 0)',
],
},
},
// 线
axisLine: {
lineStyle: {
color: '#C8D9FF',
},
},
splitLine: {
lineStyle: {
color: '#DADADA',
width: 3,
type: 'dashed', //dashed solid dotted 线线 线
},
},
},
{
nameGap: 20,
indicator: [ indicator: [
{ name: 'Sales', max: 6500 }, {
{ name: 'Administration', max: 16000 }, text: '达成度',
{ name: 'Information Technology', max: 30000 }, max: 100,
{ name: 'Customer Support', max: 38000 }, },
{ name: 'Development', max: 52000 }, {
{ name: 'Marketing', max: 25000 }, text: '达成度',
max: 100,
},
{
text: '达成度',
max: 100,
},
{
text: '达成度',
max: 100,
},
{
text: '达成度',
max: 100,
},
], ],
center: ['50%', '50%'],
radius: 100,
startAngle: 90,
splitNumber: 1,
shape: 'circle',
splitArea: {
show: false,
}, },
axisLine: {
show: false,
},
name: {
formatter: '{value}',
textStyle: {
color: 'rgba(0,0,0,0.4)',
fontSize: 18,
},
},
splitLine: {
lineStyle: {
color: '#6093FF',
type: 'solid',
width: 8,
},
},
},
],
series: [ series: [
{ {
name: 'Budget vs spending',
type: 'radar', type: 'radar',
emphasis: {
lineStyle: {
width: 50,
},
},
symbol: 'none',
data: [ data: [
{ {
value: [4200, 3000, 20000, 35000, 50000, 18000], value: [74, 60, 80, 60, 74],
name: 'Allocated Budget', name: 'Data C',
areaStyle: {
color: '#DBE4F9',
},
},
],
}, },
{ {
value: [5000, 14000, 28000, 26000, 42000, 21000], type: 'radar',
name: 'Actual Spending', emphasis: {
lineStyle: {
width: 50,
},
},
symbol: 'none',
data: [
{
value: [74, 60, 80, 40, 74],
name: 'Data B',
areaStyle: {
color: '#0052FF',
},
}, },
], ],
}, },
@ -332,7 +457,7 @@ const li
<style lang="scss" scoped> <style lang="scss" scoped>
#main { #main {
padding: 15px; padding: 10px;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }

@ -33,6 +33,7 @@ const total = ref(0)
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
pageSize: 7, pageSize: 7,
// username: 'qiuqiu',
username: userStore.userName, username: userStore.userName,
assessmenttype: '', assessmenttype: '',
category: '', category: '',
@ -43,7 +44,10 @@ const loading = ref(false)
// //
const getCourseList = async () => { const getCourseList = async () => {
loading.value = true loading.value = true
console.log(params.value, '11') // console.log(params.value, '11')
if (userStore.userInfo.roleId === 2) {
params.value.pageSize = 8
}
const res = await getCourseListApi(params.value) const res = await getCourseListApi(params.value)
courseList.value = res.data.list courseList.value = res.data.list

@ -7,6 +7,9 @@ import { addCourseApi } from '../../../api/user/crouse'
import { getCourseListApi, getCourseDetailApi } from '../../../api/user/crouse' import { getCourseListApi, getCourseDetailApi } from '../../../api/user/crouse'
import request from '../../../utils/request' import request from '../../../utils/request'
import { tool, client } from '../../../utils/alioss.js' import { tool, client } from '../../../utils/alioss.js'
import useUserStore from '@/store/modules/user'
// import { useRoute } from 'vue-router'
const userStore = useUserStore()
// //
const visibleDrawer = ref(false) const visibleDrawer = ref(false)
// //
@ -175,8 +178,8 @@ const onSubmit = async () => {
ElMessage.success('添加成功') ElMessage.success('添加成功')
// //
emit('CloseCouresNameChange') emit('CloseCouresNameChange')
emit('ClosecreditChange') // emit('ClosecreditChange')
emit('CloseclasshoursChange') // emit('CloseclasshoursChange')
} }
formModel.value = { ...defaultForm } formModel.value = { ...defaultForm }
imgUrl.value = '' imgUrl.value = ''
@ -382,7 +385,7 @@ const upload = async (option: any) => {
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer" v-if="userStore.userInfo.roleId === 1">
<el-button @click="handleClose" size="large">取消</el-button> <el-button @click="handleClose" size="large">取消</el-button>
<el-button type="primary" size="large" @click="onSubmit()"> <el-button type="primary" size="large" @click="onSubmit()">
确认 确认

Loading…
Cancel
Save