Compare commits
6 Commits
a8dbd41bdb
...
7a18c1927a
Author | SHA1 | Date |
---|---|---|
小杨 | 7a18c1927a | |
lyc | bc8b80e7d7 | |
lyc | 923d0f1f9a | |
lyc | 01f32869ba | |
lyc | 61be71674c | |
yangws | 52521e1e97 |
|
@ -18,6 +18,5 @@ const size = ref('default')
|
|||
text-align: center;
|
||||
color: #2c3e50;
|
||||
width: 100%;
|
||||
/* height: 100vh; */
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -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
|
@ -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",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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>
|
|
@ -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{
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<template>
|
||||
<div>
|
||||
算力
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
|
@ -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>
|
|
@ -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(() => {
|
||||
|
||||
})
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -80,9 +80,6 @@ onMounted(() => {
|
|||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.infomation{
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-group-item {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue