Compare commits

..

No commits in common. "b7dc08084003abab924b466ff65738a7c09d3385" and "41d6b35340d4b6da3a5e6ef8786dc7b1bfec6729" have entirely different histories.

18 changed files with 152 additions and 483 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "aix-win", "name": "aix-win",
"version": "2.5.0", "version": "2.1.21",
"description": "", "description": "",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "上海交大重庆人工智能研究院", "author": "上海交大重庆人工智能研究院",

View File

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

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 4723712 */ font-family: "iconfont"; /* Project id 4723712 */
src: url('iconfont.woff2?t=1730189025078') format('woff2'), src: url('iconfont.woff2?t=1730183338081') format('woff2'),
url('iconfont.woff?t=1730189025078') format('woff'), url('iconfont.woff?t=1730183338081') format('woff'),
url('iconfont.ttf?t=1730189025078') format('truetype'); url('iconfont.ttf?t=1730183338081') format('truetype');
} }
.iconfont { .iconfont {
@ -13,66 +13,6 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-renzheng-:before {
content: "\e623";
}
.icon-yijianfankui:before {
content: "\e8a1";
}
.icon-zuoyesheji:before {
content: "\e619";
}
.icon-jihua:before {
content: "\e601";
}
.icon-jiaocaixuanze:before {
content: "\e642";
}
.icon-xueqingfenxi:before {
content: "\e68a";
}
.icon-zuoyebuzhi:before {
content: "\e607";
}
.icon-zuoyepigai:before {
content: "\ec35";
}
.icon-tongji:before {
content: "\e68f";
}
.icon-zuzhi:before {
content: "\e63b";
}
.icon-zhiliang:before {
content: "\e643";
}
.icon-jiaoxueshijian:before {
content: "\e676";
}
.icon-kebiao:before {
content: "\e67a";
}
.icon-kaoshi:before {
content: "\eb14";
}
.icon-a-1_jiaoxuefansi:before {
content: "\e6cd";
}
.icon-xiayiye:before { .icon-xiayiye:before {
content: "\e68b"; content: "\e68b";
} }

File diff suppressed because one or more lines are too long

View File

@ -5,111 +5,6 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "7447571",
"name": "认证-01",
"font_class": "renzheng-",
"unicode": "e623",
"unicode_decimal": 58915
},
{
"icon_id": "2076317",
"name": " 意见反馈",
"font_class": "yijianfankui",
"unicode": "e8a1",
"unicode_decimal": 59553
},
{
"icon_id": "2468169",
"name": "作业指导书",
"font_class": "zuoyesheji",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "3865266",
"name": "计划",
"font_class": "jihua",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "4287869",
"name": "教材选择",
"font_class": "jiaocaixuanze",
"unicode": "e642",
"unicode_decimal": 58946
},
{
"icon_id": "4308245",
"name": "学情概览",
"font_class": "xueqingfenxi",
"unicode": "e68a",
"unicode_decimal": 59018
},
{
"icon_id": "5113507",
"name": "教学中心_作业批改",
"font_class": "zuoyebuzhi",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "5767879",
"name": "执行反馈",
"font_class": "zuoyepigai",
"unicode": "ec35",
"unicode_decimal": 60469
},
{
"icon_id": "8455509",
"name": "统计",
"font_class": "tongji",
"unicode": "e68f",
"unicode_decimal": 59023
},
{
"icon_id": "12732492",
"name": "组织",
"font_class": "zuzhi",
"unicode": "e63b",
"unicode_decimal": 58939
},
{
"icon_id": "18909227",
"name": "质量管理",
"font_class": "zhiliang",
"unicode": "e643",
"unicode_decimal": 58947
},
{
"icon_id": "21156217",
"name": "培训",
"font_class": "jiaoxueshijian",
"unicode": "e676",
"unicode_decimal": 58998
},
{
"icon_id": "33378945",
"name": "课程标准",
"font_class": "kebiao",
"unicode": "e67a",
"unicode_decimal": 59002
},
{
"icon_id": "35203493",
"name": "考试 (3)",
"font_class": "kaoshi",
"unicode": "eb14",
"unicode_decimal": 60180
},
{
"icon_id": "37027693",
"name": "教学反思",
"font_class": "a-1_jiaoxuefansi",
"unicode": "e6cd",
"unicode_decimal": 59085
},
{ {
"icon_id": "694110", "icon_id": "694110",
"name": "下一页", "name": "下一页",

View File

@ -2,20 +2,12 @@
<div class="page-aside"> <div class="page-aside">
<div> <div>
<div> <div>
<el-popover ref="popoverRef" placement="right" trigger="hover" popper-class="popoverStyle" :tabindex="999" > <el-popover ref="popoverRef" placement="right" trigger="hover" :width="120" popper-class="popoverStyle" >
<template #reference> <template #reference>
<div class="user-info">
<el-image class="user-img" :src="dev_api + userStore.user.avatar" /> <el-image class="user-img" :src="dev_api + userStore.user.avatar" />
<span>{{ userStore.user.nickName }}</span>
</div>
</template> </template>
<div class="head-aside"> <div class="head-aside">
<ul> <ul>
<li class="auth-li">
<i class="iconfont icon-renzheng-"></i>
<span class="mlr-5">学校认证</span>
<span class="gray">未认证</span>
</li>
<li @click="onUserTo('/profile')">个人中心</li> <li @click="onUserTo('/profile')">个人中心</li>
<li @click="onUserTo('/class')">班级中心</li> <li @click="onUserTo('/class')">班级中心</li>
<li @click="logout">退出登录</li> <li @click="logout">退出登录</li>
@ -43,9 +35,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="verson">V{{ version }}</div>
</div> </div>
</div> </div>
</template> </template>
@ -55,19 +45,14 @@ import { useRouter } from 'vue-router'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import pkc from "../../../../../package.json"
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
const dev_api = ref(import.meta.env.VITE_APP_BASE_API) const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
const userStore = useUserStore() const userStore = useUserStore()
console.log(userStore,'userStore')
const router = useRouter() const router = useRouter()
const currentRoute = ref('') const currentRoute = ref('')
const activeId = ref('/home') const activeId = ref('/home')
const version = ref(pkc.version)
const popoverRef = ref('') const popoverRef = ref('')
const headerMenus = [ const headerMenus = [
@ -161,35 +146,18 @@ const logout = () => {
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
font-size: 12px;
-webkit-app-region: no-drag;
ul{ ul{
width: 100%; width: 100%;
li{ li{
display: flex;
align-items: center;
justify-content: center;
width: 100%; width: 100%;
padding: 10px 0; padding: 10px 0;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
border-bottom: solid #d9dce2 1px; border-bottom: solid #d9dce2 1px;
.mlr-5{
margin: 0 5px;
}
.gray{
color: #a8aab1;
}
&:hover{ &:hover{
background: #d9dce2; background: #d9dce2;
} }
} }
.auth-li{
cursor: auto;
&:hover{
background: #fff;
}
}
} }
} }
</style> </style>
@ -203,19 +171,11 @@ const logout = () => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
.user-info{
display: flex;
flex-direction: column;
color: #fff;
align-items: center;
font-size: 12px;
.user-img{ .user-img{
width: 56px; width: 56px;
height: 56px; height: 56px;
border-radius: 50%; border-radius: 50%;
cursor: pointer; cursor: pointer;
margin-bottom: 10px;
}
} }
.aside-tab { .aside-tab {
@ -228,12 +188,12 @@ const logout = () => {
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
flex-direction: column; flex-direction: column;
padding: 8px 0; padding: 5px 0;
align-items: center; align-items: center;
color: #fff; color: #fff;
.text { .text {
font-size: 12px; font-size: 11px;
} }
.iconfont { .iconfont {
@ -264,9 +224,5 @@ const logout = () => {
} }
} }
} }
.verson{
color: #fff;
font-size: 12px;
margin-top: 5px;
}
</style> </style>

View File

@ -233,7 +233,6 @@ onMounted(() => {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 100%; width: 100%;
-webkit-app-region: drag;
.header-center{ .header-center{
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;

View File

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

View File

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

View File

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

View File

@ -1,26 +0,0 @@
<template>
<div v-for="(item,index) in classList" :key="index">
<div>{{item.caption}}</div>
</div>
<el-button type="primary" link>加入班级</el-button>
</template>
<script setup>
import {onMounted, ref} from "vue";
const props = defineProps({
classList:{
type:Array,
},
menuItems:{
type:Array,
}
})
onMounted(() => {
})
</script>
<style scoped>
</style>

View File

@ -1,73 +0,0 @@
<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>
</template>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</template>
<script setup>
import useUserStore from '@/store/modules/user'
import {ArrowDown} from '@element-plus/icons-vue'
import { onMounted,ref } from 'vue';
import { listEvaluation } from '@/api/subject/index'
const userStore = useUserStore().user
const subjectList = ref([])
//
const getSubject = () => {
//
if(!userStore.subject) return
listEvaluation({ itemkey: 'subject', pageSize: 500 }).then((res) => {
const arr = userStore.subject.split(',')
subjectList.value = res.rows.filter(item => arr.includes(String(item.id))).map(items => items)
})
}
onMounted(() => {
getSubject()
console.log(userStore,'123')
})
</script>
<style scoped>
.custom-button {
width: auto;
border: 1px solid rgb(59, 130, 246);
outline: none;
outline-offset: none;
padding: 0 24px;
}
.custom-button i {
margin-left: 8px; /* 调整图标与文字之间的间距 */
}
</style>

View File

@ -1,45 +1,105 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row :gutter="20" style="display: flex;flex-wrap: nowrap;justify-content: start">
<el-col :xs="24" style="min-width: 260px;max-width: 300px">
<el-card class="box-card">
<template v-slot:header>
<div class="clearfix">
<span>个人信息</span>
</div>
</template>
<div>
<div class="text-center"> <div class="text-center">
<userAvatar /> <userAvatar />
<div class="info">
<div class="info-name">{{ state.user.nickName }}</div>
<div class="infomation">
<selectClass/>
</div> </div>
<ul class="list-group list-group-striped">
<li class="list-group-item">
<div class="left-align">
<UserFilled class="UserFilled"/>
<span>用户名称</span>
</div> </div>
<div class="right-align">{{ state.user.userName }}</div>
</li>
<li class="list-group-item">
<div class="left-align">
<Cellphone class="Cellphone"/>
<span>手机号码</span>
</div> </div>
<el-row :gutter="20" style="display: flex;flex-wrap: nowrap;justify-content: start;width: 100%;"> <div class="right-align">{{ state.user.phonenumber }}</div>
<el-col :span="24" :xs="24"> </li>
<el-tabs v-model="activeTab"> <li class="list-group-item">
<div class="left-align">
<Message class="Message"/>
<span>身份证号</span>
</div>
<div class="right-align">{{ state.user.identity }}</div>
</li>
<li class="list-group-item">
<div class="left-align">
<Suitcase class="Suitcase"/>
<span>所属部门</span>
</div>
<div class="right-align" v-if="state.user.dept">
{{ state.user.dept.deptName }} / {{ state.postGroup }}
</div>
</li>
<li class="list-group-item">
<div class="left-align">
<Avatar class="Avatar"/>
<span>所属角色</span>
</div>
<div class="right-align">{{ state.roleGroup || '教师' }}</div>
</li>
<li class="list-group-item">
<div class="left-align">
<Calendar class="Calendar"/>
<span>创建日期</span>
</div>
<div class="right-align">{{ state.user.createTime }}</div>
</li>
<li class="list-group-item">
<div class="left-align">
<Paperclip class="Calendar"/>
<span>版本编号</span>
</div>
<div class="right-align">v{{version}}</div>
</li>
</ul>
</div>
</el-card>
</el-col>
<el-col :span="18" :xs="24">
<el-card> <el-card>
<el-tab-pane label="个人信息" name="userinfo"> <template v-slot:header>
<div class="clearfix">
<span>基本资料</span>
</div>
</template>
<el-tabs v-model="activeTab">
<el-tab-pane label="基本资料" name="userinfo">
<userInfo :user="state.user" /> <userInfo :user="state.user" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="修改密码" name="resetPwd"> <el-tab-pane label="修改密码" name="resetPwd">
<resetPwd /> <resetPwd />
</el-tab-pane> </el-tab-pane>
</el-card>
</el-tabs> </el-tabs>
</el-card>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script setup name="Profile"> <script setup name="Profile">
import { ref, reactive, onMounted } from 'vue' import { UserFilled, Cellphone, Message, Suitcase, Avatar, Calendar, Paperclip } from '@element-plus/icons-vue'
import { ref, reactive } from 'vue'
import userAvatar from './userAvatar.vue' import userAvatar from './userAvatar.vue'
import userInfo from './userInfo.vue' import userInfo from './userInfo.vue'
import resetPwd from './resetPwd.vue' import resetPwd from './resetPwd.vue'
import { getUserProfile } from '@/api/system/user' import { getUserProfile } from '@/api/system/user'
import pkc from "../../../../../package.json" import pkc from "../../../../../package.json"
//
import selectClass from './components/selectClass.vue'
const version = ref(pkc.version)
const version = ref(pkc.version)
const activeTab = ref('userinfo') const activeTab = ref('userinfo')
const state = reactive({ const state = reactive({
user: {}, user: {},
roleGroup: {}, roleGroup: {},
@ -55,9 +115,7 @@ async function getUser() {
}) })
} }
onMounted(() => { getUser()
getUser()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -67,23 +125,6 @@ onMounted(() => {
.text-center { .text-center {
margin-bottom: 15px; margin-bottom: 15px;
border-bottom: 1px solid #dddddd; border-bottom: 1px solid #dddddd;
display: flex;
align-items: center;
.info{
display: flex;
flex-direction: column;
justify-content: space-around;
height: 120px;
.info-name{
text-align: left;
padding-left: 18px;
font-size: 28px;
font-weight: bold;
}
.infomation{
display: flex;
}
}
} }
.list-group-item { .list-group-item {
display: flex; display: flex;

View File

@ -104,7 +104,6 @@ const cancle = () => {
.img-circle { .img-circle {
height: 120px; height: 120px;
width: auto; width: auto;
border-radius: 50%;
} }
.avatar-upload-preview { .avatar-upload-preview {
position:relative; position:relative;

View File

@ -1,34 +1,46 @@
<template> <template>
<el-form ref="userRef" :model="user" :rules="rules" label-width="150px"> <el-form ref="userRef" :model="user" :rules="rules" label-width="80px">
<el-form-item label="姓名" prop="nickName"> <el-form-item label="用户昵称" prop="nickName">
<el-input v-model="user.nickName" maxlength="30" /> <el-input v-model="user.nickName" maxlength="30" />
</el-form-item> </el-form-item>
<el-form-item label="账号/手机号码"> <el-form-item label="手机号码" prop="phonenumber">
{{ user.phonenumber }} <el-input v-model="user.phonenumber" maxlength="11" />
</el-form-item> </el-form-item>
<el-form-item label="所属学校" prop="identity"> <el-form-item label="身份证号" prop="identity">
<div style="display: flex;"> <el-input v-model="user.identity" maxlength="50" />
<div>{{ user.deptName }}</div>
<div>
<el-button type="primary" link>更改学校</el-button>
</div>
</div>
</el-form-item> </el-form-item>
<el-form-item label="身份角色"> <el-form-item label="性别" style="display: none">
{{ user.roleGroup || '教师' }} <el-radio-group v-model="user.sex">
<el-radio value="0"></el-radio>
<el-radio value="1"></el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="我的班级"> <el-form-item label="学段">
<ClassList :classList="classList"/> <el-radio-group v-model="user.edustage" @change="semeterChange">
<template v-for="(item,index) in semesterList" :key="index">
<el-radio :value="item.label">
{{item.label }}
</el-radio>
</template>
</el-radio-group>
</el-form-item>
<el-form-item label="任教学科">
<el-radio-group v-model="user.edusubject">
<template v-for="(item,index) in subjectList" :key="index">
<el-radio v-if="item.edustage == user.edustage" :value="item.itemtitle">
{{item.itemtitle }}
</el-radio>
</template>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button style="padding: 0 40px;" type="primary" @click="submit">保存</el-button> <el-button type="primary" @click="submit">保存</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
<script setup> <script setup>
import { ref, getCurrentInstance,onMounted,reactive } from 'vue' import { ref, getCurrentInstance,onMounted } from 'vue'
import {updateUserInfo } from '@/api/system/user' import {updateUserInfo } from '@/api/system/user'
import {getDept } from '@/api/login' import {getDept } from '@/api/login'
import { listEvaluation } from '@/api/subject/index' import { listEvaluation } from '@/api/subject/index'
@ -36,18 +48,7 @@ import useUserStore from '@/store/modules/user'
import {ElMessage} from 'element-plus' import {ElMessage} from 'element-plus'
import { clearBookInfo } from '@/utils/ruoyi' import { clearBookInfo } from '@/utils/ruoyi'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import {listClassmain} from '@/api/classManage/index'
//
import ClassList from './components/classList.vue'
//
const classList = ref([])
//
const classesNotAMemberOf = ref([])
//
const gradeTree = ref([])
//
const currentIndex = ref(0)
const props = defineProps({ const props = defineProps({
user: { user: {
type: Object type: Object
@ -58,7 +59,6 @@ const { proxy } = getCurrentInstance()
const userStore = useUserStore() const userStore = useUserStore()
// //
//
const semesterList = ref([ const semesterList = ref([
{ {
id:1, id:1,
@ -77,26 +77,7 @@ const semesterList = ref([
label:'高中' label:'高中'
}, },
]) ])
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 getTheSection = () => { const getTheSection = () => {
getDept({deptId:userStore.user.deptId}).then(res => { getDept({deptId:userStore.user.deptId}).then(res => {
@ -194,67 +175,8 @@ const semeterChange = (item) => {
props.user.edusubject = '' props.user.edusubject = ''
} }
} }
//
const getClassInfo = () => {
classList.value = []
debugger
listClassmain({ classuserid: props.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 => {
//
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;
}
}
const addClass = () => {
dialogVisible.value = true
}
onMounted(() => { onMounted(() => {
getSubject() getSubject()
getClassInfo()
getTheSection() getTheSection()
}) })
</script> </script>