Compare commits

..

No commits in common. 'f98d241c3895e057b5b5bdbeaaf19df43ff34f02' and 'b0c11f6676b1ee245db7ea30ff02485e14c91a32' have entirely different histories.

  1. 13
      src/api/user/stud.js
  2. 39
      src/api/user/user.js
  3. 45
      src/layout/logo/index.vue
  4. 2
      src/setting.ts
  5. 4
      src/styles/variable.scss
  6. 125
      src/views/course/components/KnowledgeGraphUi/FoldAdd.vue
  7. 44
      src/views/course/components/KnowledgeGraphUi/foldInfoUi.vue
  8. 84
      src/views/course/components/course-object.vue
  9. 17
      src/views/course/components/resource-management.vue
  10. 219
      src/views/course/courseChapters.vue
  11. 3
      src/views/home/components/Lessonlist.vue
  12. 145
      src/views/home/components/Status.vue
  13. 2
      src/views/home/components/Welcome.vue
  14. 37
      src/views/home/index.vue
  15. 49
      src/views/login/index.vue
  16. 236
      src/views/student/components/editStu.vue
  17. 109
      src/views/student/index.vue

@ -13,17 +13,10 @@ export const stuNumberService = (params) => {
`/api/studentManage/page?number=${params.number}&page=${params.page}&pageSize=${params.pagesize}&userId=${params.id}`, `/api/studentManage/page?number=${params.number}&page=${params.page}&pageSize=${params.pagesize}&userId=${params.id}`,
) )
} }
//获取一行的学生信息 //获取学生
export const stuListService = (id) => { // export const stuListService = (id) => {
return request.get(`/api/studentManage/${id}`) // return request.get(`/api/studentManage/${id}`)
}
// export function getById(id) {
// return request.get(`/api/studentManage/${id}`);
// } // }
//修改
export const updateStuService = (params) => {
return request.put(`/api/studentManage`, params)
}
//删除和批量删除学生 //删除和批量删除学生
export const delStuListService = (ids) => { export const delStuListService = (ids) => {
return request.delete(`/api/studentManage/batchDelete?ids=${ids}`) return request.delete(`/api/studentManage/batchDelete?ids=${ids}`)

@ -40,17 +40,26 @@ export const userIdenService = (id) => {
return request.post('/api/user/personal/info?id=' + id) return request.post('/api/user/personal/info?id=' + id)
} }
//修改个人信息 //修改个人信息
export const userIdenChangeService = (params) => { export const userIdenChangeService = (dataToSend) => {
// return request.post('/api/user/update/PersonalInfo', params, { return request.post('/api/user/update/PersonalInfo', dataToSend, {
// headers: { 'Content-Type': 'application/json;charset=UTF-8' }, headers: { 'Content-Type': 'application/json;charset=UTF-8' },
// }) })
return request.post(`/api/user/update/PersonalInfo`, params)
} }
//修改密码 //修改密码
export const userChangePasswordService = (dataToSend) => { export const userChangePasswordService = (dataToSend) => {
return request.post('/api/user/updatePassword', dataToSend) return request.post('/api/user/updatePassword', dataToSend)
} }
//获取排名靠前的课程
export const userToplessonService = () => request.get('#')
//获取最新收藏的课程
export const userNewLikeService = (id) => {
return request.post('/api/course_favour/newCollect?userId=' + id)
}
//获取学生列表
export const userStudentListService = (id) => {
return request.post('/api/coursesteacher/studentList?userId=' + id)
}
//获取课程列表 //获取课程列表
export const userLessonListService = (id) => { export const userLessonListService = (id) => {
return request.post('/api/courselearingrecord/courseList?userId=' + id) return request.post('/api/courselearingrecord/courseList?userId=' + id)
@ -67,23 +76,3 @@ export const userPicService = () => {
export const userMaxKnowService = (id) => { export const userMaxKnowService = (id) => {
return request.post('/api/knowledgelearning/studyMaxKnowledge?userId=' + id) return request.post('/api/knowledgelearning/studyMaxKnowledge?userId=' + id)
} }
//获取推荐课程
export const userToplessonService = (userId) => {
return request.post(
`/api/courselearingrecord/recommendCourses?userId=${userId}`,
)
}
//获取推荐知识点
export const userTopKnowService = (userId) => {
return request.post(
`/api/knowledgelearning/recommendKnowledge?userId=${userId}`,
)
}
//获取最新收藏的课程
export const userNewLikeService = (id) => {
return request.post('/api/course_favour/newCollect?userId=' + id)
}
//获取学生列表
export const userStudentListService = (id) => {
return request.post('/api/coursesteacher/studentList?userId=' + id)
}

@ -1,9 +1,7 @@
<template> <template>
<div class="logo" v-if="setting.logoHidden" @click="goHome"> <div class="logo" v-if="setting.logoHidden" @click="goHome">
<img :src="setting.logo" alt="" /> <img :src="setting.logo" alt="" />
<div class="font"> <p v-show="!fold">{{ setting.title }}</p>
<p v-show="!fold">{{ setting.title }}</p>
</div>
</div> </div>
</template> </template>
@ -34,59 +32,24 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// .logo {
// width: 100%;
// height: $base-menu-logo-height;
// color: #000000;
// font-weight: 700;
// display: flex;
// align-items: center;
// cursor: pointer;
// // padding: 20px;
// padding: 0 0 0 15px;
// text-overflow: hidden;
// img {
// width: 40px;
// height: 40px;
// }
// p {
// // width: 80%;
// margin-left: 10px;
// font-size: 13px;
// font-size: $base-menu-logo-title-size;
// white-space: nowrap;
// }
// }
.logo { .logo {
width: 100%; width: 100%;
height: $base-menu-logo-height; height: $base-menu-logo-height;
// background-color: aqua;
// height: 10%;
color: #000000; color: #000000;
font-weight: 700; font-weight: 700;
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
// padding: 20px; // padding: 20px;
padding: 8px 15px 0 15px; padding: 0 0 0 15px;
justify-content: center;
flex-direction: column;
img { img {
width: 100%; width: 40px;
height: 40px; height: 40px;
// margin: 0 auto;
} }
p { p {
// margin-left: 10px; margin-left: 10px;
font-size: $base-menu-logo-title-size; font-size: $base-menu-logo-title-size;
// font-size: $base-menu-logo-title-size;
white-space: nowrap; white-space: nowrap;
padding: 10px 10px;
} }
// .logo-img {
// width: 100%;
// }
} }
</style> </style>

@ -1,6 +1,6 @@
// 用于项目logo 标题配置 // 用于项目logo 标题配置
export default { export default {
title: '课图——首个开源课程知识图谱管理系统', //项目标题 title: '教学一体化后台', //项目标题
logo: '/public/vite.svg', //项目logo logo: '/public/vite.svg', //项目logo
logoHidden: true, // logo隐藏设置 logoHidden: true, // logo隐藏设置
'files.associations': { 'files.associations': {

@ -9,6 +9,6 @@ $base-menu-background:#ffffff;
// 顶部导航高度 // 顶部导航高度
$base-tabbar-height:50px; $base-tabbar-height:50px;
// 左侧菜单logo高度 // 左侧菜单logo高度
$base-menu-logo-height:70px; $base-menu-logo-height:50px;
// 左侧菜单标题文字大小 // 左侧菜单标题文字大小
$base-menu-logo-title-size:13px; $base-menu-logo-title-size:20px;

@ -1,4 +1,5 @@
<template> <template>
<<<<<<< HEAD
<div class="add-or-edit"> <div class="add-or-edit">
<el-drawer v-model="isDrawer" title="新增章节" direction="rtl" size="50%"> <el-drawer v-model="isDrawer" title="新增章节" direction="rtl" size="50%">
<el-form <el-form
@ -47,6 +48,31 @@
</el-form> </el-form>
</el-drawer> </el-drawer>
</div> </div>
=======
<div class="add-or-edit">
<el-drawer v-model="isDrawer" title="新增章节" direction="rtl" size="50%">
<el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" :rules="rules" label-width="auto"
class="demo-ruleForm" :size="formSize" status-icon>
<el-form-item label="章节" prop="pid">
<el-cascader v-model="activePidArr" :options="options1" :props="CascaderProps"
:show-all-levels="false" clearable />
</el-form-item>
<el-form-item label="章节名" prop="name">
<el-input v-model="ruleForm.name" style="width: 240px" :placeholder="placeholder" />
</el-form-item>
<el-form-item label="总学时" prop="totalclasshours">
<el-input v-model="ruleForm.totalclasshours" style="width: 240px" placeholder="请输入总学时" />
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="loading" @click="submitForm(ruleFormRef)">
提交
</el-button>
<el-button @click="resetForm(ruleFormRef)">重置</el-button>
</el-form-item>
</el-form>
</el-drawer>
</div>
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
function comNum(n: number | undefined) { function comNum(n: number | undefined) {
@ -61,6 +87,7 @@ const updLoading = (boo: boolean) => (loading.value = boo)
const isDrawer = ref(props.isD) const isDrawer = ref(props.isD)
watch( watch(
<<<<<<< HEAD
() => props.isD, () => props.isD,
(newVal) => (isDrawer.value = newVal), (newVal) => (isDrawer.value = newVal),
) )
@ -81,6 +108,30 @@ const options1 = computed(() => {
obj.chapterSection.push({ obj.chapterSection.push({
name: `${i + 1}章第${comNum(item.chapterSection?.length)}`, name: `${i + 1}章第${comNum(item.chapterSection?.length)}`,
pid: item.id, pid: item.id,
=======
() => props.isD,
(newVal) => (isDrawer.value = newVal),
)
watch(
() => isDrawer.value,
(newVal) => emits('update:isD', newVal),
)
const options1 = computed(() => {
const arr = props.data.map((item: any, i: number) => {
const obj = { ...item }
if (item.chapterSection)
obj.chapterSection = item.chapterSection.map((chap: any) => ({
...chap,
disabled: true,
}))
else obj.chapterSection = []
obj.chapterSection.push({
name: `${i + 1}章第${comNum(item.chapterSection?.length)}`,
pid: item.id,
})
return obj
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
}) })
return obj return obj
}) })
@ -88,9 +139,15 @@ const options1 = computed(() => {
return arr return arr
}) })
const CascaderProps = { const CascaderProps = {
<<<<<<< HEAD
label: 'name', label: 'name',
value: 'pid', value: 'pid',
children: 'chapterSection', children: 'chapterSection',
=======
label: 'name',
value: 'pid',
children: 'chapterSection',
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} }
import type { ComponentSize, FormInstance, FormRules } from 'element-plus' import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
@ -120,6 +177,7 @@ interface RuleForm {
const formSize = ref<ComponentSize>('default') const formSize = ref<ComponentSize>('default')
const ruleFormRef = ref<FormInstance>() const ruleFormRef = ref<FormInstance>()
const ruleForm = reactive<RuleForm>({ const ruleForm = reactive<RuleForm>({
<<<<<<< HEAD
content: '', content: '',
courseid: '2fa0fd63262230639d2c45a3acd9045c', courseid: '2fa0fd63262230639d2c45a3acd9045c',
courseobjectivesid: '', courseobjectivesid: '',
@ -164,6 +222,52 @@ const submitForm = async (formEl: FormInstance | undefined) => {
console.log('error submit!', fields) console.log('error submit!', fields)
} }
}) })
=======
content: '',
courseid: '2fa0fd63262230639d2c45a3acd9045c',
courseobjectivesid: '',
createBy: '',
createTime: '',
id: '',
name: '',
num: 0,
numshow: '',
onlinclasshours: '',
pid: undefined,
requirement: '',
sysOrgCode: '',
totalclasshours: '',
updateBy: '',
updateTime: '',
zc: '',
ziyuan: '',
zywj: '',
})
// @ts-ignore
const validateChapterOrSection = (rule, value, callback) => {
nextTick(() => {
const value = ruleForm.pid
if (!value && value !== '') callback(new Error('请选择新增的章或节'))
else callback()
})
}
//
const rules = reactive<FormRules<RuleForm>>({
pid: [
{ required: true, validator: validateChapterOrSection, trigger: 'change' },
],
})
const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return
await formEl.validate((valid, fields) => {
if (valid) {
emits('submit', ruleForm, updLoading)
} else {
console.log('error submit!', fields)
}
})
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} }
const resetForm = (formEl: FormInstance | undefined) => { const resetForm = (formEl: FormInstance | undefined) => {
@ -173,6 +277,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
} }
const placeholder = ref('请输入章节名') const placeholder = ref('请输入章节名')
watch( watch(
<<<<<<< HEAD
() => ruleForm.pid, () => ruleForm.pid,
(newVal) => { (newVal) => {
if (newVal === undefined) placeholder.value = '请输入章节名' if (newVal === undefined) placeholder.value = '请输入章节名'
@ -191,6 +296,26 @@ watch(
} }
ruleForm.pid = newVal.slice(-1)[0] ruleForm.pid = newVal.slice(-1)[0]
}, },
=======
() => ruleForm.pid,
(newVal) => {
if (newVal === undefined) placeholder.value = '请输入章节名'
else if (newVal === '') placeholder.value = '请输入章名'
else placeholder.value = '请输入节名'
},
)
const activePidArr = ref<string[] | undefined>([])
watch(
() => activePidArr.value,
(newVal) => {
// pid
if (newVal === undefined) {
ruleForm.pid = undefined
return
}
ruleForm.pid = newVal.slice(-1)[0]
},
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
) )
</script> </script>
<style lang="scss"></style> <style lang="scss"></style>

@ -2,11 +2,15 @@
<div class="fold-info-ui"> <div class="fold-info-ui">
<div class="demo-collapse"> <div class="demo-collapse">
<el-collapse class="collapse"> <el-collapse class="collapse">
<<<<<<< HEAD
<button <button
class="my-button" class="my-button"
style="position: absolute; left: 0; top: 0" style="position: absolute; left: 0; top: 0"
@click.stop="emits('add')" @click.stop="emits('add')"
> >
=======
<button class="my-button" style="position: absolute; left: 0; top: 0" @click.stop="emits('add')">
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
新增 新增
</button> </button>
<el-collapse-item v-for="item in foldInfoData" :key="item.id"> <el-collapse-item v-for="item in foldInfoData" :key="item.id">
@ -26,6 +30,7 @@
</div> </div>
<div class="my-tag">本章资源</div> <div class="my-tag">本章资源</div>
</div> </div>
<<<<<<< HEAD
<button <button
class="my-button" class="my-button"
@click.stop="emits('edit', item)" @click.stop="emits('edit', item)"
@ -39,6 +44,12 @@
class="is-el-button" class="is-el-button"
style="margin-right: 10px" style="margin-right: 10px"
> >
=======
<button class="my-button" @click.stop="emits('edit', item)" style="margin-right: 10px">
编辑
</button>
<my-btn :id="item.id" type="danger" class="is-el-button" style="margin-right: 10px">
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
删除 删除
</my-btn> </my-btn>
</div> </div>
@ -52,11 +63,15 @@
<div class="left"></div> <div class="left"></div>
<div class="right"> <div class="right">
<div class="structure-item"> <div class="structure-item">
<<<<<<< HEAD
<div <div
class="structure-item-titile-box" class="structure-item-titile-box"
v-for="(obj, ind) in item.chapterSection" v-for="(obj, ind) in item.chapterSection"
:key="item.id" :key="item.id"
> >
=======
<div class="structure-item-titile-box" v-for="(obj, ind) in item.chapterSection" :key="item.id">
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
<div class="titile-box-titile"> <div class="titile-box-titile">
<div class="sequence">{{ ind + 1 }}</div> <div class="sequence">{{ ind + 1 }}</div>
<div class="tit-box"> <div class="tit-box">
@ -70,6 +85,7 @@
</div> </div>
</div> </div>
<div class="tit-box-edit"> <div class="tit-box-edit">
<<<<<<< HEAD
<button <button
class="my-button" class="my-button"
@click.stop="emits('edit', obj)" @click.stop="emits('edit', obj)"
@ -83,6 +99,12 @@
class="is-el-button" class="is-el-button"
style="margin-right: 10px" style="margin-right: 10px"
> >
=======
<button class="my-button" @click.stop="emits('edit', obj)" style="margin-right: 10px">
编辑
</button>
<my-btn :id="obj.id" type="danger" class="is-el-button" style="margin-right: 10px">
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
删除 删除
</my-btn> </my-btn>
</div> </div>
@ -286,7 +308,11 @@ const MyBtn = {
gap: 38px; gap: 38px;
flex-wrap: wrap; flex-wrap: wrap;
<<<<<<< HEAD
& > * { & > * {
=======
&>* {
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
border: 1px solid #0052d9; border: 1px solid #0052d9;
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: 12px;
@ -337,6 +363,7 @@ const MyBtn = {
cursor: pointer; cursor: pointer;
&:hover { &:hover {
<<<<<<< HEAD
background: linear-gradient( background: linear-gradient(
128deg, 128deg,
lighten($color-start, 5%) 0%, lighten($color-start, 5%) 0%,
@ -358,6 +385,23 @@ const MyBtn = {
lighten($color-start, 20%) 0%, lighten($color-start, 20%) 0%,
lighten($color-end, 20%) 100% lighten($color-end, 20%) 100%
); );
=======
background: linear-gradient(128deg,
lighten($color-start, 5%) 0%,
lighten($color-end, 5%) 100%);
}
&:active {
background: linear-gradient(128deg,
darken($color-start, 10%) 0%,
darken($color-end, 10%) 100%);
}
&:disabled {
background: linear-gradient(128deg,
lighten($color-start, 20%) 0%,
lighten($color-end, 20%) 100%);
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} }
} }

@ -181,13 +181,7 @@ const submit = async () => {
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>整体目标</span> <span>整体目标</span>
<el-button <el-button type="primary" :icon="Edit" circle plain @click="updateContent"></el-button>
type="primary"
:icon="Edit"
circle
plain
@click="updateContent"
></el-button>
</div> </div>
</template> </template>
<div class="el-card__body" style=""> <div class="el-card__body" style="">
@ -217,61 +211,35 @@ const submit = async () => {
</div> </div>
<div class="objectdetails"> <div class="objectdetails">
<el-scrollbar height="89px"> <el-scrollbar height="89px">
<li v-for="(obj, i) in item.contents" :key="obj.id"> <li v-for="(obj, i) in item.contents" :key="obj.id">
<span>目标{{ i + 1 }}{{ obj.content }}</span> <span>目标{{ i + 1 }}{{ obj.content }}</span>
<div class="icon"> <div class="icon">
<el-button <el-button type="primary" :icon="Edit" circle size="small" plain @click="updateObjectContent(obj.id)" />
type="primary" <el-button type="danger" :icon="Delete" circle size="small" plain @click="delObject(obj.id)" />
:icon="Edit"
circle
size="small"
plain
@click="updateObjectContent(obj.id)"
/>
<el-button
type="danger"
:icon="Delete"
circle
size="small"
plain
@click="delObject(obj.id)"
/>
</div>
</li>
</el-scrollbar>
</div>
</div> </div>
<el-divider style="margin: 0; width: 100%" />
</li> </li>
</ul> </el-scrollbar>
<el-dialog
v-if="dialogVisible"
v-model="dialogVisible"
:title="flog ? '编辑' : '新增'"
width="500"
:before-close="handleClose"
>
<el-form
:model="formData"
label-width="auto"
style="max-width: 600px"
>
<el-form-item label="内容" prop="description">
<el-input
v-model="formData.description"
placeholder="请输入内容"
></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="submit">确定</el-button>
</div>
</template>
</el-dialog>
</div> </div>
</div> </div>
<el-divider style="margin: 0; width: 100%" />
</li>
</ul>
<el-dialog v-if="dialogVisible" v-model="dialogVisible" :title="flog ? '编辑' : '新增'" width="500"
:before-close="handleClose">
<el-form :model="formData" label-width="auto" style="max-width: 600px">
<el-form-item label="内容" prop="description">
<el-input v-model="formData.description" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="submit">确定</el-button>
</div>
</template>
</el-dialog>
</div>
</div>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -48,10 +48,7 @@ const tableData: User[] = [
<template> <template>
<div class="grid-content resource-management" style="height: 500px"> <div class="grid-content resource-management" style="height: 500px">
<h1>资源管理</h1> <h1>资源管理</h1>
<el-table <el-table :data="filterTableData" style="width: 90%; margin-left: 30px; font-size: 16px">
:data="filterTableData"
style="width: 90%; margin-left: 30px; font-size: 16px"
>
<el-table-column label="相关内容" prop="chapter" /> <el-table-column label="相关内容" prop="chapter" />
<el-table-column label="文件名称" prop="name" /> <el-table-column label="文件名称" prop="name" />
<el-table-column label="文件类型" prop="type" /> <el-table-column label="文件类型" prop="type" />
@ -60,21 +57,13 @@ const tableData: User[] = [
<el-table-column label="文件类型" prop="name" /> --> <el-table-column label="文件类型" prop="name" /> -->
<el-table-column align="right"> <el-table-column align="right">
<template #header> <template #header>
<el-input <el-input v-model="search" size="small" placeholder="输入内容进行搜索" />
v-model="search"
size="small"
placeholder="输入内容进行搜索"
/>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="handleEdit(scope.$index, scope.row)"> <el-button size="small" @click="handleEdit(scope.$index, scope.row)">
编辑 编辑
</el-button> </el-button>
<el-button <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">
size="small"
type="danger"
@click="handleDelete(scope.$index, scope.row)"
>
删除 删除
</el-button> </el-button>
</template> </template>

@ -1,10 +1,45 @@
<template> <template>
<<<<<<< HEAD
<div class="course-chapters"> <div class="course-chapters">
<div class="flex-layout"> <div class="flex-layout">
<div class="flex-left"> <div class="flex-left">
<div class="left" ref="atlasCon"> <div class="left" ref="atlasCon">
<!-- 知识图谱 --> <!-- 知识图谱 -->
<atlas-ui @hadRouter="handle" /> <atlas-ui @hadRouter="handle" />
=======
<div class="course-chapters">
<div class="flex-layout">
<div class="flex-left">
<div class="left" ref="atlasCon">
<!-- 知识图谱 -->
<atlas-ui @hadRouter="handle" />
</div>
<div class="right-top radius-10 vertical-line">
<!-- 计算机导论 -->
<theory-ui :learnInfo="learnInfo" />
</div>
<div class="right-bottom radius-10 vertical-line">
<!-- 课程目标 -->
<objective-ui :orogramObjective="orogramObjective" />
</div>
<div class="bottom">
<!-- 可折叠基本概念 -->
<fold-info-ui :foldInfoData="foldInfoData" @add="showHide = true" @edit="hanEdit" @del="flodDel" />
<FoldAdd v-model:is-d="showHide" v-if="showHide" :data="foldInfoData" @submit="foldAddSubmit" />
<FoldEdit v-model:is-d="showHide1" v-if="showHide1" :editData="activeEditData" :data="foldInfoData"
@submit="foldEditSubmit" />
</div>
</div>
<div class="flex_right">
<div class="top-container">
<img src="" alt="" />
</div>
<div class="bottom-container radius-10">
<!-- 查看资源 -->
<look-resource-ui :lookResource="lookResource" />
</div>
</div>
>>>>>>> d7b4e7a9c5db447232028c52d0cc49bb8a28830e
</div> </div>
<div class="right-top radius-10 vertical-line"> <div class="right-top radius-10 vertical-line">
<!-- 计算机导论 --> <!-- 计算机导论 -->
@ -48,11 +83,15 @@
</div> </div>
</div> </div>
</div> </div>
<<<<<<< HEAD
</div> </div>
=======
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { import {
<<<<<<< HEAD
getLearnInfoApi, getLearnInfoApi,
getOrogramObjectiveApi, getOrogramObjectiveApi,
} from '@/api/courseChaptersApi' } from '@/api/courseChaptersApi'
@ -70,6 +109,25 @@ import {
foldInfoUi, foldInfoUi,
FoldAdd, FoldAdd,
FoldEdit, FoldEdit,
=======
getLearnInfoApi,
getOrogramObjectiveApi,
} from '@/api/courseChaptersApi'
import {
getChapterApi,
deleteSectionApi,
addChapterApi,
updateChapterApi,
} from '@/api/sectionApi'
import {
theoryUi,
objectiveUi,
atlasUi,
lookResourceUi,
foldInfoUi,
FoldAdd,
FoldEdit,
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} from './components/KnowledgeGraphUi/index' } from './components/KnowledgeGraphUi/index'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
@ -84,6 +142,7 @@ const handle = () => $router.push('/knowledgeAtlas')
const learnInfo: object[] = reactive([]) const learnInfo: object[] = reactive([])
getLearnInfoApi().then((res) => learnInfo.push(...(res as object[]))) getLearnInfoApi().then((res) => learnInfo.push(...(res as object[])))
// getByIdCourseVoApi('2fa0fd63262230639d2c45a3acd9045c') // getByIdCourseVoApi('2fa0fd63262230639d2c45a3acd9045c')
// objective-ui // objective-ui
const orogramObjective: any = reactive({}) const orogramObjective: any = reactive({})
getOrogramObjectiveApi().then((res) => Object.assign(orogramObjective, res)) getOrogramObjectiveApi().then((res) => Object.assign(orogramObjective, res))
@ -94,15 +153,23 @@ const lookResource: any = reactive({})
// fold-info-ui // fold-info-ui
const foldInfoData: any = reactive([]) const foldInfoData: any = reactive([])
function getFold() { function getFold() {
<<<<<<< HEAD
getChapterApi('2fa0fd63262230639d2c45a3acd9045c').then((res) => { getChapterApi('2fa0fd63262230639d2c45a3acd9045c').then((res) => {
foldInfoData.length = 0 foldInfoData.length = 0
foldInfoData.push(...res.data) foldInfoData.push(...res.data)
}) })
=======
getChapterApi('2fa0fd63262230639d2c45a3acd9045c').then((res) => {
foldInfoData.length = 0
foldInfoData.push(...res.data)
})
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} }
getFold() getFold()
// //
const showHide = ref(false) const showHide = ref(false)
function foldAddSubmit(data: any, updLoading: Function) { function foldAddSubmit(data: any, updLoading: Function) {
<<<<<<< HEAD
updLoading(true) updLoading(true)
addChapterApi(data) addChapterApi(data)
.then(() => { .then(() => {
@ -122,6 +189,7 @@ function foldAddSubmit(data: any, updLoading: Function) {
.finally(() => updLoading(false)) .finally(() => updLoading(false))
} }
// //
<<<<<<< HEAD
const foldDelLoading = ref(false) const foldDelLoading = ref(false)
function flodDel(id: string) { function flodDel(id: string) {
foldDelLoading.value = true foldDelLoading.value = true
@ -140,6 +208,57 @@ function flodDel(id: string) {
}) })
}) })
.finally(() => (foldDelLoading.value = false)) .finally(() => (foldDelLoading.value = false))
=======
function flodDel(id: string,setLoading:Function) {
setLoading(true)
deleteSectionApi(id).then(() => {
ElMessage({
message: `删除成功`,
type: 'success'
=======
updLoading(true)
addChapterApi(data)
.then(() => {
ElMessage({
message: `添加${data.pid === '' ? '章' : '节'}成功`,
type: 'success',
})
showHide.value = false
getFold()
})
.catch(() => {
ElMessage({
message: `添加${data.pid === '' ? '章' : '节'}失败`,
type: 'error',
})
})
.finally(() => updLoading(false))
}
//
const foldDelLoading = ref(false)
function flodDel(id: string) {
foldDelLoading.value = true
deleteSectionApi(id)
.then(() => {
ElMessage({
message: `删除成功`,
type: 'success',
})
getFold()
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
})
.catch(() => {
ElMessage({
message: `删除失败`,
type: 'error',
})
})
<<<<<<< HEAD
}).finally(() =>setLoading(false))
>>>>>>> d7b4e7a9c5db447232028c52d0cc49bb8a28830e
=======
.finally(() => (foldDelLoading.value = false))
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} }
// //
const showHide1 = ref(false) const showHide1 = ref(false)
@ -149,6 +268,7 @@ function hanEdit(data: any) {
showHide1.value = true showHide1.value = true
} }
function foldEditSubmit(data: any, updLoading: Function) { function foldEditSubmit(data: any, updLoading: Function) {
<<<<<<< HEAD
updLoading(true) updLoading(true)
updateChapterApi(data) updateChapterApi(data)
.then(() => { .then(() => {
@ -166,6 +286,25 @@ function foldEditSubmit(data: any, updLoading: Function) {
}) })
}) })
.finally(() => updLoading(false)) .finally(() => updLoading(false))
=======
updLoading(true)
updateChapterApi(data)
.then(() => {
ElMessage({
message: `更新${data.pid === '' ? '章' : '节'}成功`,
type: 'success',
})
showHide1.value = false
getFold()
})
.catch(() => {
ElMessage({
message: `更新${data.pid === '' ? '章' : '节'}失败`,
type: 'error',
})
})
.finally(() => updLoading(false))
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} }
</script> </script>
@ -188,6 +327,10 @@ function foldEditSubmit(data: any, updLoading: Function) {
.vertical-line { .vertical-line {
position: relative; position: relative;
<<<<<<< HEAD
=======
background: #f2f7fb;
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
&::before { &::before {
content: ''; content: '';
@ -235,6 +378,7 @@ function foldEditSubmit(data: any, updLoading: Function) {
} }
} }
<<<<<<< HEAD
.flex_right { .flex_right {
width: 355px; width: 355px;
@ -245,6 +389,23 @@ function foldEditSubmit(data: any, updLoading: Function) {
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
=======
.radius-10 {
border-radius: 10px;
overflow: hidden;
}
.vertical-line {
position: relative;
&::before {
content: '';
display: block;
position: absolute;
height: 100%;
width: 12px;
background-color: #2147fb;
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} }
} }
@ -252,6 +413,64 @@ function foldEditSubmit(data: any, updLoading: Function) {
min-height: 945px; min-height: 945px;
} }
} }
<<<<<<< HEAD
} }
=======
.flex-layout {
display: flex;
justify-content: space-between;
align-items: flex-start;
.flex-left {
display: grid;
grid-template-columns: 664px 555px;
justify-content: space-between;
width: 1243px;
.left {
grid-row: 1/3;
height: 424px;
}
.right-top {
width: 100%;
height: 243px;
}
.right-bottom {
align-self: end;
width: 100%;
height: 168px;
}
.bottom {
margin-top: 15px;
grid-column: 1/3;
width: 100%;
min-width: 100%;
min-height: 521px;
}
}
.flex_right {
width: 355px;
.top-container {
height: 231px;
margin-bottom: 23px;
img {
width: 100%;
height: 100%;
}
}
.bottom-container {
min-height: 945px;
}
}
}
>>>>>>> 0b7db324dad8347654933e91ae7e6ca8d2dabd05
} }
</style> </style>

@ -16,7 +16,7 @@ const getLesList = async () => {
const res = await userLessonListService(userStore.data.id) const res = await userLessonListService(userStore.data.id)
lessonList.value = res.data lessonList.value = res.data
loading.value = false loading.value = false
console.log(res.data, 'less') // console.log(res.data, 'less')
} }
const onGetCourseObject = async (id) => { const onGetCourseObject = async (id) => {
router.push({ router.push({
@ -102,7 +102,6 @@ onMounted(() => {
border: 1px solid #e8e8f2; border: 1px solid #e8e8f2;
margin: 10px 0px; margin: 10px 0px;
} }
.lessonlist-item-info { .lessonlist-item-info {
box-sizing: border-box; box-sizing: border-box;
padding: 6px 5px; padding: 6px 5px;

@ -1,11 +1,12 @@
<script setup> <script setup>
import add from '@/assets/images/add.png' import add from '@/assets/images/add.png'
import { userIdenChangeService } from '@/api/user/user.js' // import tool from '@/utils/oss.js'
import { userChangeService } from '@/api/user/user.js'
import { ref, defineEmits, onMounted, reactive } from 'vue' import { ref, defineEmits, onMounted, reactive } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { Edit } from '@element-plus/icons-vue' import { Edit } from '@element-plus/icons-vue'
import { tool, client } from '@/utils/alioss.js' import { tool, client } from '@/utils/alioss.js'
import useUserStore from '@/store/modules/user' // import { error } from 'echarts/types/src/util/log.js'
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
@ -14,14 +15,11 @@ const props = defineProps({
type: Object, type: Object,
}, },
}) })
const userStore = useUserStore()
const imageUrl = ref() const imageUrl = ref()
// //
imageUrl.value = props.data.icon imageUrl.value = props.data.icon
// console.log(props.userData, 'img1') // console.log(props.userData, 'img')
// console.log(props.data, 'imgs')
const beforeUpload = (file) => { const beforeUpload = (file) => {
const validImageTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp'] const validImageTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp']
if (!validImageTypes.includes(file.type)) { if (!validImageTypes.includes(file.type)) {
@ -36,6 +34,7 @@ const upload = async (option) => {
const res = await tool.oss.upload(option.file) const res = await tool.oss.upload(option.file)
imageUrl.value = res.url imageUrl.value = res.url
changeInfo() changeInfo()
// console.log(imageUrl.value, 'img')
} }
// //
const emit = defineEmits(['get-avater', 'getInfo']) const emit = defineEmits(['get-avater', 'getInfo'])
@ -49,8 +48,10 @@ const changeInfo = async () => {
username: props.data.username, username: props.data.username,
} }
const jsonData = JSON.stringify(userInfo) const jsonData = JSON.stringify(userInfo)
await userIdenChangeService(jsonData).then(() => {
await userChangeService(jsonData).then(() => {
ElMessage.success('修改成功') ElMessage.success('修改成功')
// console.log(imageUrl.value, 'fs')
emit('get-avater', imageUrl.value) emit('get-avater', imageUrl.value)
}) })
isUploading.value = false isUploading.value = false
@ -58,20 +59,9 @@ const changeInfo = async () => {
} }
// //
const dialog = ref(false)
const formLabelWidth = '80px'
// const defineForm = ref({
// name: props.userData.name,
// sex: props.userData.sex,
// nationality: props.userData.nationality,
// professionalTitle: props.userData,
// politicalStatus: props.userData,
// profession: props.userData,
// education: props.userData,
// academicDegree: props.userData,
// id: props.data.id,
// })
const dialog = ref(false)
const formLabelWidth = '68px'
const form = ref({ const form = ref({
name: '', name: '',
sex: '', sex: '',
@ -82,64 +72,10 @@ const form = ref({
profession: '', profession: '',
education: '', education: '',
academicDegree: '', academicDegree: '',
id: props.data.id,
}) })
form.value = { ...props.userData } form.value = { ...props.userData }
// // console.log(props.userData, '')
const rules = reactive({ // console.log(form.value, '')
name: [
{ required: true, message: '请输入姓名', trigger: 'blur' },
{ min: 2, max: 5, message: '长度在2-5之间', trigger: 'blur' },
],
sex: [
{
required: true,
message: '请选择性别',
trigger: 'change',
},
],
nationality: [
{
message: '请输入民族',
trigger: 'blur',
},
],
professionalTitle: [
{ required: true, message: '职位不能为空', trigger: 'blur' },
{
min: 2,
max: 10,
message: '职位名称至少2个字符最多10个字符',
trigger: 'blur',
},
],
politicalStatus: [
{
required: true,
trigger: 'change',
},
],
profession: [
{
required: true,
trigger: 'change',
},
],
education: [
{
required: true,
trigger: 'change',
},
],
academicDegree: [
{
required: true,
trigger: 'change',
},
],
})
form.value.sex === '男' ? 0 : 1 form.value.sex === '男' ? 0 : 1
const value = ref('') const value = ref('')
value.value = form.value.politicalStatus value.value = form.value.politicalStatus
@ -150,16 +86,15 @@ const onCancel = () => {
dialog.value = false dialog.value = false
} }
// //
const infoform = ref()
const res = ref()
const onSubmit = async () => { const onSubmit = async () => {
await infoform.value.validate() // const jsonData = JSON.stringify(form.value)
// console.log(form.value, 'form') // console.log(form.value, 'jj')
await await userIdenChangeService(form.value).then(() => { await userChangeService(form).then(() => {
ElMessage.success('修改成功') ElMessage.success('修改成功')
// console.log(form.value, 'aaaa') // console.log(form.value, 'aaaa')
// res.value = userStore.getUserInfo()
// emit('getInfo', res.value) emit('getInfo', form.value)
dialog.value = false dialog.value = false
}) })
} }
@ -186,21 +121,19 @@ const onSubmit = async () => {
<img :src="add" /> <img :src="add" />
</el-upload> </el-upload>
<div class="info_content" style="height: 58px"> <div class="info_content" style="height: 58px">
<div class="name"> <div class="name">{{ props.data.username }}</div>
{{ props.data.username }} <div class="na">
{{ props.userData.professionalTitle }}
<el-icon class="icon" @click="openInfo"> <el-icon class="icon" @click="openInfo">
<Edit /> <Edit />
</el-icon> </el-icon>
</div> </div>
<!-- <div class="na">
{{ props.userData.professionalTitle }}
</div> -->
</div> </div>
</div> </div>
</div> </div>
<el-drawer v-model="dialog" title="个人信息" class="demo-drawer"> <el-drawer v-model="dialog" title="个人信息" class="demo-drawer">
<div class="content"> <div class="content">
<el-form :model="form" class="infocont" :rules="rules" ref="infoform"> <el-form :model="form">
<el-form-item label="姓名" :label-width="formLabelWidth" prop="name"> <el-form-item label="姓名" :label-width="formLabelWidth" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input> <el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
@ -210,6 +143,16 @@ const onSubmit = async () => {
<el-radio value="女"></el-radio> <el-radio value="女"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item
label="手机号"
:label-width="formLabelWidth"
prop="emergencyContact"
>
<el-input
v-model="form.emergencyContact"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item <el-form-item
label="民族" label="民族"
:label-width="formLabelWidth" :label-width="formLabelWidth"
@ -272,7 +215,9 @@ const onSubmit = async () => {
</el-form> </el-form>
<div class="footer"> <div class="footer">
<el-button @click="onCancel">取消</el-button> <el-button @click="onCancel">取消</el-button>
<el-button type="primary" @click="onSubmit">确认</el-button> <el-button type="primary" :loading="loading" @click="onSubmit">
确认
</el-button>
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
@ -307,9 +252,6 @@ const onSubmit = async () => {
font-style: normal; font-style: normal;
text-transform: none; text-transform: none;
} }
.el-form-item {
margin-bottom: 30px;
}
.na { .na {
/* height: 28px; */ /* height: 28px; */
font-family: Inter, Inter; font-family: Inter, Inter;
@ -333,9 +275,9 @@ const onSubmit = async () => {
} }
.footer { .footer {
display: flex; display: flex;
justify-content: end; justify-content: space-between;
align-items: center; align-items: center;
margin-top: 200px; margin-top: 20px;
} }
.iden { .iden {
width: 126px; width: 126px;
@ -356,19 +298,6 @@ const onSubmit = async () => {
border-radius: 50px 50px 50px 50px; border-radius: 50px 50px 50px 50px;
display: flex; display: flex;
} }
.content {
display: flex;
flex-direction: column;
justify-content: space-between;
}
::v-deep .el-drawer__body {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.infocont {
}
span { span {
width: 24px; width: 24px;
height: 44px; height: 44px;

@ -187,6 +187,7 @@ const changeInfo = async () => {
emit('get-message', form.value.nickName) emit('get-message', form.value.nickName)
emit('userInfoModified', res) emit('userInfoModified', res)
dialogFormVisible.value = false dialogFormVisible.value = false
form.value.newphone = '' form.value.newphone = ''
form.value.code = '' form.value.code = ''
}) })
@ -212,6 +213,7 @@ const changeInfo = async () => {
emit('get-message', form.value.nickName) emit('get-message', form.value.nickName)
emit('userInfoModified', res) emit('userInfoModified', res)
dialogFormVisible.value = false dialogFormVisible.value = false
form.value.newphone = '' form.value.newphone = ''
form.value.code = '' form.value.code = ''
}) })

@ -10,8 +10,6 @@ import {
userNewLikeService, userNewLikeService,
userLookService, userLookService,
userMaxKnowService, userMaxKnowService,
userTopKnowService,
userToplessonService,
} from '@/api/user/user' } from '@/api/user/user'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
@ -54,10 +52,9 @@ const getAvater = (avater) => {
const getInfo = (info) => { const getInfo = (info) => {
// console.log(userStore.userInfo, 'msg') // console.log(userStore.userInfo, 'msg')
userStore.userInfo = info userStore.userInfo = info
console.log(userStore.userData, 'icon111') // console.log(userStore.userData, 'icon111')
} }
const courselist = ref([]) const courselist = ref([])
const toplist = ref([])
// const img = ref() // const img = ref()
// const courseName = ref() // const courseName = ref()
// const courseTea = ref() // const courseTea = ref()
@ -72,13 +69,6 @@ function fetchNewUserInfo(res) {
// userInfo // userInfo
data.value = res data.value = res
} }
//
const topKnow = ref([])
const gettopKnow = async () => {
const res = await userTopKnowService(userStore.data.id)
topKnow.value = res.data
// console.log(maxKnow.value, 'max')
}
onMounted(() => { onMounted(() => {
// getData() // getData()
username.value = userStore.userName username.value = userStore.userName
@ -105,18 +95,10 @@ onMounted(() => {
courselist.value = res.data courselist.value = res.data
loading.value = false loading.value = false
}) })
//
userToplessonService(userStore.data.id).then((res) => {
loading.value = true
toplist.value = res.data
loading.value = false
})
//echart //echart
userLookService() userLookService()
// //
getmaxKnow() getmaxKnow()
//
gettopKnow()
}) })
</script> </script>
<template> <template>
@ -172,7 +154,7 @@ onMounted(() => {
></conheader> ></conheader>
</a> </a>
<div class="contt"> <div class="contt">
<p class="button" round v-for="item in topKnow" :key="item.id"> <p class="button" round v-for="item in maxKnow" :key="item.id">
{{ item.label }} {{ item.label }}
</p> </p>
</div> </div>
@ -193,9 +175,7 @@ onMounted(() => {
<conheader :title="`推荐知识点`"></conheader> <conheader :title="`推荐知识点`"></conheader>
</a> </a>
<div class="contt"> <div class="contt">
<p class="button" round v-for="item in maxKnow" :key="item.id"> <p class="button" round v-for="item in 30" :key="item">Roshabei</p>
{{ item.label }}
</p>
</div> </div>
</div> </div>
</el-col> </el-col>
@ -212,14 +192,12 @@ onMounted(() => {
</a> </a>
<div class="con"> <div class="con">
<ul> <ul>
<li <li class="lessonlist-item" v-for="(item, index) in 4" :key="item">
class="lessonlist-item" <!-- <img :src="fe" class="lessonlist-item-img" /> -->
v-for="(item, index) in toplist"
:key="item.id"
>
<div class="lessonlist-item-info"> <div class="lessonlist-item-info">
<p>{{ index + 1 }}</p> <p>{{ index + 1 }}</p>
<h5>{{ item.name || '暂无' }}</h5> <h5>课程名称</h5>
</div> </div>
</li> </li>
</ul> </ul>
@ -243,6 +221,7 @@ onMounted(() => {
class="lessonlist-item" class="lessonlist-item"
v-for="(item, index) in courselist" v-for="(item, index) in courselist"
:key="item.id" :key="item.id"
v-loading="loading"
> >
<div class="lessonlist-item-info"> <div class="lessonlist-item-info">
<p>{{ index + 1 }}</p> <p>{{ index + 1 }}</p>

@ -1,23 +1,10 @@
<template> <template>
<div id="your-element-selector" style="width: 100%; height: 100vh"></div> <div id="your-element-selector" style="width: 100%; height: 100vh"></div>
<div class="login_container"> <div class="login_container">
<el-row :span="24" style="height: 5%"> <el-row :span="24" style="height: 5%; background-color: #5577ff">
<el-col> <el-col>
<div class="grid-content ep-bg-purple-dark"> <div class="grid-content ep-bg-purple-dark">
<div class="logo"> <img src="" />
<div class="logo_main">
<img :src="setting.logo" alt="" />
<div class="font">
<p>{{ setting.title }}</p>
</div>
</div>
<a @click.prevent="goToPage">
<el-icon class="link">
<Link />
</el-icon>
</a>
</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -302,7 +289,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted, onUnmounted, onBeforeUnmount, watch } from 'vue' import { ref, onMounted, onUnmounted, onBeforeUnmount, watch } from 'vue'
import { User, Lock, Phone, Check, Link } from '@element-plus/icons-vue' import { User, Lock, Phone, Check } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
@ -313,18 +300,6 @@ import {
userCodeRegisterService, userCodeRegisterService,
} from '@/api/user/user' } from '@/api/user/user'
// let loginForm = reactive({ username: 'admin', password: '111111' }) // let loginForm = reactive({ username: 'admin', password: '111111' })
//logo
import useLayoutSettingStoe from '@/store/modules/setting'
// logo
import setting from '@/setting'
const goToPage = (event) => {
event.preventDefault()
// window.open('https:www.baidu.com', '_blank')
window.location.href = 'https:www.baidu.com'
}
const fold = ref(false)
const LayoutSettingStoe = useLayoutSettingStoe()
// //
let userStore = useUserStore() let userStore = useUserStore()
// //
@ -597,24 +572,6 @@ onUnmounted(() => {
height: 100vh; height: 100vh;
position: absolute; position: absolute;
top: 0; top: 0;
.logo {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px 35px 0px 20px;
.logo_main {
display: flex;
align-items: center;
}
.font {
font-size: 20px;
font-family: 'YourChosenArtisticFont', sans-serif;
// text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
color: #171615;
// transform: rotateX(5deg) rotateY(5deg);
margin-left: 5px;
}
}
// background: url('../../assets/images/background.jpg') no-repeat; // background: url('../../assets/images/background.jpg') no-repeat;
.loin_form { .loin_form {
position: relative; position: relative;

@ -1,236 +0,0 @@
<script setup>
import { ref } from 'vue'
import { stuListService, updateStuService } from '@/api/user/stud'
import { tool, client } from '@/utils/alioss.js'
import { ElMessage } from 'element-plus'
const drawer = ref(false)
const formLabelWidth = '80px'
const emit = defineEmits(['success'])
const imgUrl = ref()
const formModel = ref({
icon: '',
number: '',
name: '',
sex: '',
nickName: '',
username: '',
major: '',
yearAge: '',
createTime: '',
})
formModel.value.sex === '男' ? 0 : 1
const open = async (row) => {
drawer.value = true
await stuListService(row.id).then((res) => {
formModel.value = res.data
imgUrl.value = formModel.value.icon
// console.log(formModel.value.icon, 'defauleForm.value')
})
}
const beforeUpload = (file) => {
const validImageTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp']
if (!validImageTypes.includes(file.type)) {
ElMessage.error('请上传图片')
return false
}
return true
}
const upload = async (option) => {
const res = await tool.oss.upload(option.file)
// console.log(res, 'res')
formModel.value.icon = res.url
imgUrl.value = formModel.value.icon
}
const formRef = ref(null)
//
const rules = {
number: [
{ required: true, message: '请输入学号', trigger: 'blur' },
{ min: 2, max: 20, message: '长度在2-20之间', trigger: 'blur' },
],
name: [
{ required: true, message: '请输入姓名', trigger: 'blur' },
{ min: 2, max: 5, message: '长度在2-5之间', trigger: 'blur' },
],
sex: [
{
required: true,
message: '请选择性别',
trigger: 'change',
},
],
nickName: [
{
message: '请输入昵称',
trigger: 'blur',
},
],
username: [{ required: true }],
createTime: [{ required: true }],
major: [
{ required: true, message: '专业不能为空', trigger: 'blur' },
{
min: 2,
max: 20,
message: '职位名称至少2个字符最多20个字符',
trigger: 'blur',
},
],
yearAge: [
{
required: true,
trigger: 'change',
message: '请选择入学年份',
},
],
}
function formatDate(yearAge) {
return new Date(yearAge).toISOString()
}
//
const onSubmit = async () => {
await formRef.value.validate()
console.log(formModel.value, 'form')
await await updateStuService({
id: formModel.value.id,
userId: formModel.value.userId,
icon: formModel.value.icon,
number: formModel.value.number,
name: formModel.value.name,
sex: formModel.value.sex,
nickName: formModel.value.nickName,
major: formModel.value.major,
// yearAge: formModel.value.yearAge,
}).then(() => {
ElMessage.success('修改成功')
drawer.value = false
// console.log('aa')
emit('success', 'edit')
// console.log(form.value, 'aaaa')
// res.value = userStore.getUserInfo()
// emit('getInfo', res.value)
// dialog.value = false
})
}
const onCancel = () => {
drawer.value = false
}
defineExpose({
open,
})
</script>
<template>
<el-drawer v-model="drawer" title="编辑信息" style="">
<el-form
:model="formModel"
:rules="rules"
ref="formRef"
:label-width="formLabelWidth"
>
<el-form-item label="头像" prop="icon">
<el-upload
v-model="formModel.icon"
class="avatar-uploader"
:http-request="upload"
:show-file-list="false"
:before-upload="beforeUpload"
>
<img v-if="imgUrl" :src="imgUrl" class="avatar" />
<!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" /> -->
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
<template #tip>
<div class="el-upload__tip">图片文件要为jpg/png格式小于500kb</div>
</template>
</el-upload>
</el-form-item>
<el-form-item label="学号" prop="number">
<el-input v-model="formModel.number" placeholder="请输入学号" />
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="formModel.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="formModel.sex">
<el-radio value="男"></el-radio>
<el-radio value="女"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="用户名" prop="userName">
<el-input v-model="formModel.username" readonly />
</el-form-item>
<el-form-item label="昵称" prop="nickName">
<el-input v-model="formModel.nickName" placeholder="请输入昵称" />
</el-form-item>
<el-form-item label="专业" prop="major">
<el-input v-model="formModel.major" placeholder="请输入专业" />
</el-form-item>
<el-form-item label="入学年分" prop="yearAge">
<el-date-picker
v-model="formModel.yearAge"
type="date"
placeholder="请选择入学年份"
:size="small"
style="width: 100%"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
/>
<!-- <el-date-picker
v-model="formModel.yearAge"
type="datetime"
placeholder="Pick a Date"
format="YYYY/MM/DD hh:mm:ss"
value-format="YYYY-MM-DDThh:mm:ss"
/> -->
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="formModel.createTime" readonly />
</el-form-item>
</el-form>
<div class="footer">
<el-button @click="onCancel">取消</el-button>
<el-button type="primary" @click="onSubmit">确认</el-button>
</div>
</el-drawer>
</template>
<style scoped lang="scss">
.avatar-uploader {
:deep() {
.avatar {
width: 178px;
height: 178px;
display: block;
}
.el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
}
.el-upload:hover {
border-color: var(--el-color-primary);
}
.el-icon.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
text-align: center;
}
}
}
.footer {
display: flex;
justify-content: end;
align-items: center;
margin-top: 100px;
}
</style>

@ -1,6 +1,6 @@
<script setup> <script setup>
import { Search, Edit, Delete, CircleClose } from '@element-plus/icons-vue' import { Search, Edit, Delete, CircleClose } from '@element-plus/icons-vue'
import { ref, onMounted, computed } from 'vue' import { ref, onMounted } from 'vue'
import { import {
// stuListService, // stuListService,
stuPageService, stuPageService,
@ -11,7 +11,6 @@ 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 { 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') //
@ -60,15 +59,19 @@ const onCurrentChange = (page) => {
getData() getData()
} }
//
// const onSearch = () => {
// params.value.pagenum = 1
// // getArticleService()
// }
const loading = ref(false) const loading = ref(false)
// //
const drawer = ref(false) const drawer = ref(false)
// //
const stuChange = ref()
const editTable = (row) => { const editTable = (row) => {
stuChange.value.open(row)
console.log(row)
drawer.value = true drawer.value = true
console.log(row)
} }
// //
const delTable = async (row) => { const delTable = async (row) => {
@ -140,8 +143,7 @@ tableData.value.forEach((item) => {
}) })
async function handleStatusChange(row) { async function handleStatusChange(row) {
status.value = row.status status.value = row.status
console.log(`${row.status}` === 1 ? true : false, 'status') console.log(status.value, 'status')
console.log(status.value === 0 ? true : false, 'status1')
console.log(`状态更改: ${row.status}`) console.log(`状态更改: ${row.status}`)
if (!isFirstLoad.value) { if (!isFirstLoad.value) {
await changeStaService(status.value, row.userId).then(() => { await changeStaService(status.value, row.userId).then(() => {
@ -159,13 +161,19 @@ const studentName = ref()
function onFocus1() { function onFocus1() {
show1.value = true show1.value = true
} }
// function onBlur1() {
// show1.value = true
// }
const closeName = () => { const closeName = () => {
show1.value = false show1.value = false
studentName.value = '' studentName.value = ''
} }
const searchInfo = async () => { const searchInfo = async () => {
params.value.name = studentName.value params.value.name = studentName.value
// console.log(params.value.name, 'params.value.number')
if (studentName.value.trim() !== '') { if (studentName.value.trim() !== '') {
// show.value = true
// console.log(params.value.name, 'params')
await stuPageService({ await stuPageService({
page: 1, page: 1,
pagesize: 3, pagesize: 3,
@ -189,12 +197,14 @@ function onFocus() {
function onblur1() { function onblur1() {
show.value = false show.value = false
} }
// closeName
const clearIdinput = () => { const clearIdinput = () => {
show.value = false show.value = false
studentId.value = '' studentId.value = ''
} }
const searchNumber = async () => { const searchNumber = async () => {
// console.log(studentId.value, 'params.value.number')
// console.log(studentId.value > 0, 'params')
params.value.number = studentId.value params.value.number = studentId.value
if (studentId.value > 0) { if (studentId.value > 0) {
await stuPageService({ await stuPageService({
@ -208,6 +218,8 @@ const searchNumber = async () => {
getData() getData()
}) })
} }
// console.log(res, 'change')
} }
// //
const onReset = () => { const onReset = () => {
@ -224,14 +236,8 @@ function clearInput1() {
studentName.value = '' studentName.value = ''
} }
const value1 = ref(true) const value1 = ref(true)
let switchValue = ref() console.log(typeof value1.value, 'value2')
switchValue.value = tableData.value.status const changeStatus = async (row) => {}
const handleSwitchChange = (value) => {
switchValue.value === 1 ? true : false
}
const onSuccess = () => {
getData()
}
onMounted(() => { onMounted(() => {
getData() getData()
}) })
@ -243,6 +249,7 @@ onMounted(() => {
<div class="card-header"> <div class="card-header">
<span>学生信息</span> <span>学生信息</span>
<div> <div>
<el-switch v-model="value1" />
<el-button type="primary" @click="onResetPass">重置密码</el-button> <el-button type="primary" @click="onResetPass">重置密码</el-button>
<el-button type="danger" @click="onDel">批量删除</el-button> <el-button type="danger" @click="onDel">批量删除</el-button>
</div> </div>
@ -330,11 +337,12 @@ onMounted(() => {
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="number" label="学号" width="120" />
<el-table-column prop="name" label="姓名" /> <el-table-column prop="name" label="姓名" />
<el-table-column prop="number" label="学号" width="120" />
<el-table-column prop="sex" label="性别" />
<el-table-column prop="username" label="用户名" /> <el-table-column prop="username" label="用户名" />
<el-table-column prop="nickName" label="昵称" /> <el-table-column prop="nickName" label="昵称" />
<el-table-column prop="sex" label="性别" /> <el-table-column prop="phone" label="手机号" width="120" />
<el-table-column prop="major" label="专业" /> <el-table-column prop="major" label="专业" />
<el-table-column prop="yearAge" label="年级" /> <el-table-column prop="yearAge" label="年级" />
<el-table-column prop="createTime" label="创建时间" width="200" /> <el-table-column prop="createTime" label="创建时间" width="200" />
@ -387,9 +395,68 @@ onMounted(() => {
/> />
</div> </div>
</el-card> </el-card>
<!-- <edit-stu ref="stuChange"></edit-stu> --> <el-drawer v-model="drawer" title="编辑信息" style="">
<el-form :model="tableData" :rules="rules" ref="formRef">
<edit-stu ref="stuChange" @success="onSuccess()"></edit-stu> <el-form-item label="头像" prop="icon">
<el-upload
v-model="tableData.icon"
class="avatar-uploader"
:http-request="upload"
:show-file-list="false"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
<template #tip>
<div class="el-upload__tip">
图片文件要为jpg/png格式小于500kb
</div>
</template>
</el-upload>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="tableData.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="学号" prop="number">
<el-input v-model="tableData.number" placeholder="请输入学号" />
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="tableData.sex">
<el-radio value="1"></el-radio>
<el-radio value="2"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="姓名" prop="username">
<el-input v-model="tableData.username" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="用户名" prop="nickName">
<el-input v-model="tableData.nickName" />
</el-form-item>
<el-form-item label="昵称" prop="nickName">
<el-input v-model="tableData.nickName" />
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="tableData.phone" />
</el-form-item>
<el-form-item label="专业" prop="major">
<el-input v-model="tableData.major" placeholder="请输入专业" />
</el-form-item>
<el-form-item label="年级" prop="yearAge">
<el-input v-model="tableData.yearAge" placeholder="请输入年级" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="tableData.createTime" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch
v-model="tableData.status"
inline-prompt
active-text="启用"
inactive-text="禁用"
/>
<!-- <el-input v-model="tableData.status" placeholder="请输入姓名" /> -->
</el-form-item>
</el-form>
</el-drawer>
</page-container> </page-container>
</template> </template>

Loading…
Cancel
Save