Compare commits
No commits in common. "6c717ea345190eedb7bc83cd8bab8713965caa02" and "cc1faa7f88e03a66b1203e1045ece63f4475af52" have entirely different histories.
6c717ea345
...
cc1faa7f88
|
@ -42,7 +42,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, nextTick, toRaw, reactive,watch } from 'vue';
|
import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { listEvaluation } from '@/api/subject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
|
|
||||||
|
@ -102,11 +102,21 @@ const getSubjectContent = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
let data;
|
let data;
|
||||||
const { rows } = await listEvaluation(params)
|
if (localStorage.getItem('evaluationList')) {
|
||||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||||
evaluationList.value = rows
|
data = evaluationList.value
|
||||||
data = rows
|
treeLoading.value = false
|
||||||
treeLoading.value = false
|
}
|
||||||
|
else {
|
||||||
|
try {
|
||||||
|
const { rows } = await listEvaluation(params)
|
||||||
|
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||||
|
evaluationList.value = rows
|
||||||
|
data = rows
|
||||||
|
} finally {
|
||||||
|
treeLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//获取教材版本
|
//获取教材版本
|
||||||
await getSubject()
|
await getSubject()
|
||||||
|
@ -256,10 +266,14 @@ const transData = (data) => {
|
||||||
|
|
||||||
//获取教材
|
//获取教材
|
||||||
const getSubject = async () => {
|
const getSubject = async () => {
|
||||||
|
if (localStorage.getItem('subjectList')) {
|
||||||
const { rows } = await listEvaluation({ itemkey: "version", pageSize: 500 })
|
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||||
subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject)
|
}
|
||||||
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
else {
|
||||||
|
const { rows } = await listEvaluation({ itemkey: "version", pageSize: 500 })
|
||||||
|
subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject && isHaveUnit(item.id))
|
||||||
|
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
||||||
|
}
|
||||||
|
|
||||||
// 默认第一个
|
// 默认第一个
|
||||||
if(!subjectList.value.length) return
|
if(!subjectList.value.length) return
|
||||||
|
@ -270,11 +284,11 @@ const getSubject = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// const isHaveUnit = (id) => {
|
const isHaveUnit = (id) => {
|
||||||
// return evaluationList.value.some(item => {
|
return evaluationList.value.some(item => {
|
||||||
// return item.rootid == id
|
return item.rootid == id
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleNodeClick = (data, node) => {
|
const handleNodeClick = (data, node) => {
|
||||||
|
@ -305,9 +319,7 @@ const handleNodeClick = (data, node) => {
|
||||||
currentNode.data = curData
|
currentNode.data = curData
|
||||||
emit('nodeClick', curData)
|
emit('nodeClick', curData)
|
||||||
}
|
}
|
||||||
watch(() => userStore.edusubject, () => {
|
|
||||||
console.log(userStore.edusubject,'userStore.edusubject')
|
|
||||||
})
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSubjectContent()
|
getSubjectContent()
|
||||||
})
|
})
|
||||||
|
|
|
@ -118,11 +118,18 @@ const getSubjectContent = async () => {
|
||||||
entpcourseedituserid: userId,
|
entpcourseedituserid: userId,
|
||||||
pageSize: 500
|
pageSize: 500
|
||||||
}
|
}
|
||||||
|
|
||||||
let data;
|
let data;
|
||||||
const { rows } = await listEvaluation(params)
|
if (localStorage.getItem('evaluationList')) {
|
||||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||||
evaluationList.value = rows
|
data = evaluationList.value
|
||||||
data = rows
|
}
|
||||||
|
else {
|
||||||
|
const { rows } = await listEvaluation(params)
|
||||||
|
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||||
|
evaluationList.value = rows
|
||||||
|
data = rows
|
||||||
|
}
|
||||||
|
|
||||||
//获取教材版本
|
//获取教材版本
|
||||||
getSubject()
|
getSubject()
|
||||||
|
@ -421,4 +428,4 @@ onMounted(() => {
|
||||||
color: #409EFF;
|
color: #409EFF;
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -31,7 +31,7 @@ export const constantRoutes = [
|
||||||
path: '/prepare',
|
path: '/prepare',
|
||||||
component: () => import('@/views/prepare/index.vue'),
|
component: () => import('@/views/prepare/index.vue'),
|
||||||
name: 'prepare',
|
name: 'prepare',
|
||||||
meta: {title: '备课'}
|
meta: {title: '备课',keepAlive:true}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/teach',
|
path: '/teach',
|
||||||
|
|
|
@ -169,13 +169,13 @@ export default {
|
||||||
setTimeout(this.initReserv, 500)
|
setTimeout(this.initReserv, 500)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// activated() {
|
activated() {
|
||||||
// if (this.uploadData.textbookId !== null) {
|
if (this.uploadData.textbookId !== null) {
|
||||||
// this.asyncAllFile()
|
this.asyncAllFile()
|
||||||
// this.initHomeWork()
|
this.initHomeWork()
|
||||||
// this.initReserv()
|
this.initReserv()
|
||||||
// }
|
}
|
||||||
// },
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initReserv() {
|
initReserv() {
|
||||||
getSelfReserv().then((res) => {
|
getSelfReserv().then((res) => {
|
||||||
|
@ -424,7 +424,6 @@ export default {
|
||||||
},
|
},
|
||||||
// 根据教材章节单元ID 查询作业列表所需ID
|
// 根据教材章节单元ID 查询作业列表所需ID
|
||||||
getChapterId() {
|
getChapterId() {
|
||||||
console.log(this.userStore,'this.userStore')
|
|
||||||
return listEntpcourse({
|
return listEntpcourse({
|
||||||
evalid: this.uploadData.levelSecondId,
|
evalid: this.uploadData.levelSecondId,
|
||||||
edituserid: this.userStore.userId,
|
edituserid: this.userStore.userId,
|
||||||
|
|
|
@ -34,8 +34,6 @@
|
||||||
import { ref, getCurrentInstance } from 'vue'
|
import { ref, getCurrentInstance } from 'vue'
|
||||||
import { updateUserProfile } from '@/api/system/user'
|
import { updateUserProfile } from '@/api/system/user'
|
||||||
import { listEvaluation } from '@/api/subject/index'
|
import { listEvaluation } from '@/api/subject/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
import {ElMessage} from 'element-plus'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
user: {
|
user: {
|
||||||
|
@ -44,7 +42,6 @@ const props = defineProps({
|
||||||
})
|
})
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const userStore = useUserStore()
|
|
||||||
|
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
||||||
|
@ -99,17 +96,7 @@ function submit() {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log(props.user)
|
console.log(props.user)
|
||||||
updateUserProfile(props.user).then((response) => {
|
updateUserProfile(props.user).then((response) => {
|
||||||
if(response.code == 200){
|
proxy.$modal.msgSuccess('修改成功')
|
||||||
userStore.getInfo().then(res => {
|
|
||||||
if(res.code === 200){
|
|
||||||
ElMessage.success('修改成功')
|
|
||||||
}else{
|
|
||||||
ElMessage.error(response.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
ElMessage.error(response.msg)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue