lyc-dev #100
|
@ -5,7 +5,7 @@
|
||||||
<span>{{ curBookName }}</span>
|
<span>{{ curBookName }}</span>
|
||||||
<i class="iconfont icon-xiangyou"></i>
|
<i class="iconfont icon-xiangyou"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="book-list">
|
<div class="book-list" v-loading="treeLoading">
|
||||||
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
||||||
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNode" highlight-current
|
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNode" highlight-current
|
||||||
@node-click="handleNodeClick">
|
@node-click="handleNodeClick">
|
||||||
|
@ -60,6 +60,8 @@ const defaultProps = {
|
||||||
label: 'label',
|
label: 'label',
|
||||||
class: 'textbook-tree'
|
class: 'textbook-tree'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const treeLoading = ref(false)
|
||||||
//当前教材ID
|
//当前教材ID
|
||||||
const curBookId = ref(-1)
|
const curBookId = ref(-1)
|
||||||
//当前教材名称
|
//当前教材名称
|
||||||
|
@ -82,6 +84,7 @@ const refTree = ref(null)
|
||||||
|
|
||||||
//获取教材下面的单元内容
|
//获取教材下面的单元内容
|
||||||
const getSubjectContent = async () => {
|
const getSubjectContent = async () => {
|
||||||
|
treeLoading.value = true
|
||||||
const params = {
|
const params = {
|
||||||
edusubject,
|
edusubject,
|
||||||
edustage,
|
edustage,
|
||||||
|
@ -93,12 +96,17 @@ const getSubjectContent = async () => {
|
||||||
if (localStorage.getItem('evaluationList')) {
|
if (localStorage.getItem('evaluationList')) {
|
||||||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||||
data = evaluationList.value
|
data = evaluationList.value
|
||||||
|
treeLoading.value = false
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const { rows } = await listEvaluation(params)
|
try {
|
||||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
const { rows } = await listEvaluation(params)
|
||||||
evaluationList.value = rows
|
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||||
data = rows
|
evaluationList.value = rows
|
||||||
|
data = rows
|
||||||
|
} finally {
|
||||||
|
treeLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取教材版本
|
//获取教材版本
|
||||||
|
|
|
@ -54,7 +54,7 @@ const rules = reactive({
|
||||||
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }]
|
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
let curWinUrl;
|
let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH;
|
||||||
|
|
||||||
//登录
|
//登录
|
||||||
const submitForm = async (formEl) => {
|
const submitForm = async (formEl) => {
|
||||||
|
@ -131,9 +131,7 @@ const setCookie = (name, value) => {
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 当前窗口URL
|
localStorage.clear()
|
||||||
curWinUrl = BrowserWindow.getFocusedWindow().webContents.getURL()
|
|
||||||
|
|
||||||
getCookie()
|
getCookie()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue