# Conflicts:
#	src/renderer/src/layout/components/Aside.vue
This commit is contained in:
zhangxuelin 2024-10-30 15:08:25 +08:00
commit 9167751c6c
15 changed files with 276 additions and 507 deletions

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=1730256542457') format('woff2'),
url('iconfont.woff?t=1730256542457') format('woff'),
url('iconfont.ttf?t=1730256542457') format('truetype');
}
.iconfont {
@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-A:before {
content: "\e6ef";
}
.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,20 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "12688893",
"name": "A",
"font_class": "A",
"unicode": "e6ef",
"unicode_decimal": 59119
},
{
"icon_id": "5257347",
"name": "咽喉科-声音异常",
"font_class": "yanhouke-shengyinyichang",
"unicode": "e672",
"unicode_decimal": 58994
},
{
"icon_id": "7447571",
"name": "认证-01",

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 369 KiB

View File

@ -61,7 +61,6 @@ import pkc from "../../../../../package.json"
const { ipcRenderer } = window.electron || {}
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
const userStore = useUserStore()
console.log(userStore,'userStore')
const router = useRouter()
const currentRoute = ref('')
const activeId = ref('/home')
@ -94,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'
},
@ -151,7 +156,7 @@ const logout = () => {
</script>
<style>
<style lang="scss">
.el-popover.popoverStyle{
min-width:120px;
padding: 0;

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

@ -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,4 +1,5 @@
<template>
<div style="display: flex;">
<div style="margin-left: 15px">
<el-dropdown @command="handleUserEduStage">
<span class="el-dropdown-link">
@ -26,14 +27,15 @@
<template #dropdown>
<el-dropdown-menu>
<template v-for="(item, index) in subjectList">
<el-dropdown-item v-if="item.edustage == userStore.edustage" :command="item.itemtitle">{{
<el-dropdown-item :command="item.itemtitle">{{
item.itemtitle }}</el-dropdown-item>
</template>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</template>
</div>
</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()