Compare commits

...

6 Commits

Author SHA1 Message Date
小杨 7a18c1927a fix:个人中心修改; 2024-10-30 10:50:30 +08:00
lyc bc8b80e7d7 Merge pull request 'init 2.5' (#8) from lyc-dev into main 2024-10-30 10:38:17 +08:00
lyc 923d0f1f9a init 2.5 2024-10-30 10:39:00 +08:00
lyc 01f32869ba Merge pull request '2.5init' (#7) from lyc-dev into main 2024-10-30 09:59:45 +08:00
lyc 61be71674c 2.5init 2024-10-30 10:00:23 +08:00
yangws 52521e1e97 Merge pull request 'add:个人中心UI还原;' (#6) from yangws_ws into main
Reviewed-on: #6
2024-10-29 17:31:21 +08:00
18 changed files with 289 additions and 91 deletions

View File

@ -18,6 +18,5 @@ const size = ref('default')
text-align: center;
color: #2c3e50;
width: 100%;
/* height: 100vh; */
}
</style>

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4723712 */
src: url('iconfont.woff2?t=1730189025078') format('woff2'),
url('iconfont.woff?t=1730189025078') format('woff'),
url('iconfont.ttf?t=1730189025078') format('truetype');
src: url('iconfont.woff2?t=1730255375658') format('woff2'),
url('iconfont.woff?t=1730255375658') format('woff'),
url('iconfont.ttf?t=1730255375658') format('truetype');
}
.iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-yanhouke-shengyinyichang:before {
content: "\e672";
}
.icon-renzheng-:before {
content: "\e623";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "5257347",
"name": "咽喉科-声音异常",
"font_class": "yanhouke-shengyinyichang",
"unicode": "e672",
"unicode_decimal": 58994
},
{
"icon_id": "7447571",
"name": "认证-01",

View File

@ -4,7 +4,10 @@
<div>
<el-popover ref="popoverRef" placement="right" trigger="hover" popper-class="popoverStyle" :tabindex="999" >
<template #reference>
<el-image class="user-img" :src="dev_api + userStore.user.avatar" />
<div class="user-info">
<el-image class="user-img" :src="dev_api + userStore.user.avatar" />
<span>{{ userStore.user.nickName }}</span>
</div>
</template>
<div class="head-aside">
<ul>
@ -13,9 +16,10 @@
<span class="mlr-5">学校认证</span>
<span class="gray">未认证</span>
</li>
<li>加入学校</li>
<li @click="onUserTo('/profile')">个人中心</li>
<li @click="onUserTo('/class')">班级中心</li>
<li @click="logout">退出登录</li>
<li @click="logout">退出登录</li>
</ul>
</div>
</el-popover>
@ -89,8 +93,14 @@ const headerMenus = [
const sideBottomMenu = [
{
name: '设置',
name: '算力',
id: 4,
icon: 'icon-yanhouke-shengyinyichang',
path: '/hashrate'
},
{
name: '设置',
id: 5,
icon: 'icon-set',
path: '/setting'
},
@ -199,11 +209,19 @@ const logout = () => {
display: flex;
flex-direction: column;
justify-content: space-between;
.user-img{
width: 56px;
height: 56px;
border-radius: 50%;
cursor: pointer;
.user-info{
display: flex;
flex-direction: column;
color: #fff;
align-items: center;
font-size: 12px;
.user-img{
width: 56px;
height: 56px;
border-radius: 50%;
cursor: pointer;
margin-bottom: 10px;
}
}
.aside-tab {
@ -216,12 +234,12 @@ const logout = () => {
width: 100%;
cursor: pointer;
flex-direction: column;
padding: 5px 0;
padding: 8px 0;
align-items: center;
color: #fff;
.text {
font-size: 11px;
font-size: 12px;
}
.iconfont {
@ -255,6 +273,6 @@ const logout = () => {
.verson{
color: #fff;
font-size: 12px;
margin-top: 10px;
margin-top: 5px;
}
</style>

View File

@ -1,14 +1,4 @@
<template>
<!-- <el-container>
<el-header>
<Header />
</el-header>
<el-main>
<AppMain />
</el-main>
<Uploader v-if="uploaderStore.uploadList && uploaderStore.uploadList.length > 0" />
<AiChart/>
</el-container> -->
<div class="common-layout">
<el-container>
<el-aside width="70px">
@ -30,27 +20,21 @@
<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import Header from './components/Header.vue'
import Aside from './components/Aside.vue'
import AppMain from './components/AppMain.vue'
import Uploader from './components/Uploader.vue'
import AiChart from '@/components/ai-chart/index.vue'
import uploaderState from '@/store/modules/uploader'
// import Chat from '@/utils/chat'
let uploaderStore = ref(uploaderState())
// window.test = Chat
// Chat.init()
</script>
<style lang="scss" scoped>
.el-container {
height: 100%;
// background: url(@/assets/images/login/login-bg.png) no-repeat center;
// background: #fff;
background: linear-gradient(to bottom right, #cce6ff 0%, #79d0fc 100%);
background: linear-gradient(#E5EEF5, #F2F2F2);
background-size: cover;
}
.common-layout{

View File

@ -128,6 +128,12 @@ export const constantRoutes = [
name: 'examReport',
meta: {title: '考试分析'}
},
{
path: '/hashrate',
component: () => import('@/views/hashrate/index.vue'),
name: 'hashrate',
meta: {title: '算力'}
},
{
path: '/setting',
component: () => import('@/views/setting/index.vue'),

View File

@ -146,7 +146,7 @@ watch(
padding: 10px 15px;
font-size: 13px;
flex: 1;
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
.class-item {
justify-content: space-between;
align-items: center;

View File

@ -282,6 +282,7 @@ onMounted(async ()=>{
background-color: #fff;
border-radius: 5px;
padding: 10px 0;
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
.con-ul{
justify-content: space-around;

View File

@ -0,0 +1,13 @@
<template>
<div>
算力
</div>
</template>
<script setup>
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,157 @@
<template>
<div>
<el-dialog v-model="dialogVisible" title="加入班级" width="50%" append-to-body>
<el-form
style="width: 100%"
label-width="auto"
:model="classForm"
:rules="rules"
ref="myForm"
>
<el-form-item label="老师" style="margin-right: 10px; width: 50%">
<el-text>
{{ userStore.nickName }}
</el-text>
</el-form-item>
<el-form-item label="班级">
<el-tree-select
v-model="classids"
:data="gradeTree"
multiple
:render-after-expand="false"
style="width: 240px"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="btnSave"> </el-button>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, defineExpose,reactive } from 'vue'
import { listClassmain, addClasses } from '@/api/classManage/index'
import { ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user'
//
const dialogVisible = ref(false)
const userStore = useUserStore().user
const classids = ref([])
//
const classList = ref([])
//
const gradeTree = ref([])
//
const classesNotAMemberOf = ref([])
//
const currentIndex = ref(0)
const newGradeList = reactive([
[
{ label: '一年级', agekey: 1, checked: false, current: 1 },
{ label: '二年级', agekey: 2, checked: false, current: 1 },
{ label: '三年级', agekey: 3, checked: false, current: 1 },
{ label: '四年级', agekey: 4, checked: false, current: 1 },
{ label: '五年级', agekey: 5, checked: false, current: 1 },
{ label: '六年级', agekey: 6, checked: false, current: 1 },
],
[
{ label: '初一', agekey: 7, checked: false, current: 2 },
{ label: '初二', agekey: 8, checked: false, current: 2 },
{ label: '初三', agekey: 9, checked: false, current: 2 },
],
[
{ label: '高一', agekey: 10, checked: false, current: 3 },
{ label: '高二', agekey: 11, checked: false, current: 3 },
{ label: '高三', agekey: 12, checked: false, current: 3 },
],
])
//
const open = () => {
dialogVisible.value = true
getClassInfo()
}
//
const btnSave = () => {
addClasses({ classIds: classids.value.join(','), userId: userStore.userId }).then(res => {
if (res.code === 200) {
dialogVisible.value = false
ElMessage({
message: res.msg,
type: 'success',
})
//
classids.value = []
} else {
ElMessage({
message: res.msg,
type: 'warning',
})
}
})
}
//
const getClassInfo = () => {
classList.value = []
listClassmain({ classuserid: userStore.userId, pageSize: 100, status: 'open' }).then(response => {
classList.value = [...response.rows]
if(classList.value.length > 0){
currentIndex.value = 0
}
});
listClassmain({entpid: userStore.deptId, status: 'open', pageSize: 100}).then(response => {
//
classesNotAMemberOf.value = [...response.rows]
classList.value.forEach(item => {
const currentIndex = classesNotAMemberOf.value.findIndex(items => items.id === item.id)
if(currentIndex) classesNotAMemberOf.value.splice(currentIndex, 1)
})
//
gradeTree.value = groupByCondition(classesNotAMemberOf.value, item => item.agekey);
})
}
//
function groupByCondition(arr, condition) {
//
const groups = arr.reduce((groups, item) => {
const groupKey = condition(item);
item.label = item.caption
item.value = item.id
groups[groupKey] = groups[groupKey] || [];
groups[groupKey].push(item);
return groups;
}, {});
//
const formattedGroups = Object.keys(groups).map(key => ({
label: gradeName(key),
value:key,
children: groups[key]
}));
return formattedGroups;
}
//key
function gradeName(key){
//
const flatGradeDataList = newGradeList.flat();
const currentIndex = flatGradeDataList.findIndex(item => item.agekey === Number(key));
if(currentIndex !== -1){
return flatGradeDataList[currentIndex].label;
}else{
//
const defaultLabel = '社团';
flatGradeDataList[currentIndex] = { ...flatGradeDataList[currentIndex], label: defaultLabel };
return defaultLabel;
}
}
defineExpose({
open
})
</script>

View File

@ -1,12 +1,15 @@
<template>
<div v-for="(item,index) in classList" :key="index">
<div>{{item.caption}}</div>
<div style="display: flex;flex-wrap: wrap;align-items: center;">
<div v-for="(item,index) in classList" :key="index" style="margin-right: 10px;cursor: pointer;">
<el-tag type="primary">{{item.caption}}</el-tag>
</div>
<el-button type="primary" link>加入班级</el-button>
</template>
<el-button type="primary" link @click="addClass">加入班级</el-button>
<AddClass ref="addClassRef" />
</div>
</template>
<script setup>
import {onMounted, ref} from "vue";
import AddClass from './addClass.vue'
const props = defineProps({
classList:{
type:Array,
@ -15,6 +18,10 @@
type:Array,
}
})
const addClassRef = ref()
const addClass = () => {
addClassRef.value.open()
}
onMounted(() => {
})

View File

@ -1,39 +1,41 @@
<template>
<div style="margin-left: 15px">
<el-dropdown @command="handleUserEduStage">
<span class="el-dropdown-link">
<el-button class="custom-button" type="default" round >{{ userStore.edustage }}
<el-icon><ArrowDown /></el-icon>
</el-button>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="幼儿园">幼儿园</el-dropdown-item>
<el-dropdown-item command="小学">小学</el-dropdown-item>
<el-dropdown-item command="初中">初中</el-dropdown-item>
<el-dropdown-item command="高中">高中</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<div style="margin-left: 15px">
<el-dropdown @command="handleUserEduSubject">
<span class="el-dropdown-link">
<el-button class="custom-button" type="default" round>{{ userStore.edusubject }}
<el-icon><ArrowDown /></el-icon>
</el-button>
</span>
<template #dropdown>
<el-dropdown-menu>
<template v-for="(item, index) in subjectList">
<el-dropdown-item v-if="item.edustage == userStore.edustage" :command="item.itemtitle">{{
item.itemtitle }}</el-dropdown-item>
<div style="display: flex;">
<div style="margin-left: 15px">
<el-dropdown @command="handleUserEduStage">
<span class="el-dropdown-link">
<el-button class="custom-button" type="default" round >{{ userStore.edustage }}
<el-icon><ArrowDown /></el-icon>
</el-button>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="幼儿园">幼儿园</el-dropdown-item>
<el-dropdown-item command="小学">小学</el-dropdown-item>
<el-dropdown-item command="初中">初中</el-dropdown-item>
<el-dropdown-item command="高中">高中</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-dropdown>
</div>
<div style="margin-left: 15px">
<el-dropdown @command="handleUserEduSubject">
<span class="el-dropdown-link">
<el-button class="custom-button" type="default" round>{{ userStore.edusubject }}
<el-icon><ArrowDown /></el-icon>
</el-button>
</span>
<template #dropdown>
<el-dropdown-menu>
<template v-for="(item, index) in subjectList">
<el-dropdown-item :command="item.itemtitle">{{
item.itemtitle }}</el-dropdown-item>
</template>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</template>
</template>
<script setup>
import useUserStore from '@/store/modules/user'
@ -51,6 +53,13 @@ const getSubject = () => {
subjectList.value = res.rows.filter(item => arr.includes(String(item.id))).map(items => items)
})
}
//
const handleUserEduStage = (item) => {
userStore.edustage = item
}
const handleUserEduSubject = (item) => {
userStore.edusubject = item
}
onMounted(() => {
getSubject()
console.log(userStore,'123')

View File

@ -80,9 +80,6 @@ onMounted(() => {
font-size: 28px;
font-weight: bold;
}
.infomation{
display: flex;
}
}
}
.list-group-item {

View File

@ -131,7 +131,7 @@ const getSubject = () => {
}
setTimeout(() => {
if (props.user.edudegree != '') {
if (userStore.user.edudegree != '') {
var upcaseName = [
'一年级',
'二年级',
@ -146,15 +146,15 @@ setTimeout(() => {
'高二',
'高三'
]
var d = parseInt(props.user.edudegree.replace('年级', ''))
var d = parseInt(userStore.user.edudegree.replace('年级', ''))
if (d <= 6) {
props.user.edustage = '小学'
userStore.user.edustage = '小学'
} else if (d >= 7 && d <= 9) {
props.user.edustage = '初中'
userStore.user.edustage = '初中'
} else if (d >= 9 && d <= 12) {
props.user.edustage = '高中'
userStore.user.edustage = '高中'
}
props.user.stagelabel = upcaseName[d - 1]
userStore.user.stagelabel = upcaseName[d - 1]
}
}, 1000)
@ -162,10 +162,10 @@ setTimeout(() => {
function submit() {
proxy.$refs.userRef.validate((valid) => {
if (valid) {
props.user.avatar = userStore.user.avatar
updateUserInfo(props.user).then((response) => {
userStore.user.avatar = userStore.user.avatar
updateUserInfo(userStore.user).then((response) => {
if(response.code == 200){
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
userStore.login({username:userStore.user.userName,password:userStore.user.plainpwd}).then(() => {
userStore.getInfo().then(res => {
if(res.code === 200){
let sessionSubject = {
@ -191,21 +191,20 @@ function submit() {
}
const semeterChange = (item) => {
if(item === '幼儿园'){
props.user.edusubject = ''
userStore.user.edusubject = ''
}
}
//
const getClassInfo = () => {
classList.value = []
debugger
listClassmain({ classuserid: props.user.userId, pageSize: 100, status: 'open' }).then(response => {
listClassmain({ classuserid: userStore.user.userId, pageSize: 100, status: 'open' }).then(response => {
classList.value = [...response.rows]
if(classList.value.length > 0){
currentIndex.value = 0
}
});
listClassmain({entpid: props.user.deptId, status: 'open', pageSize: 100}).then(response => {
listClassmain({entpid: userStore.user.deptId, status: 'open', pageSize: 100}).then(response => {
//
classesNotAMemberOf.value = [...response.rows]
classList.value.forEach(item => {
@ -249,9 +248,6 @@ function groupByCondition(arr, condition) {
return defaultLabel;
}
}
const addClass = () => {
dialogVisible.value = true
}
onMounted(() => {
getSubject()
getClassInfo()