Compare commits
No commits in common. "799dbed6763b94485c20f47745c0669f17d5308c" and "f80e7dee2a41e85ae1514e8f30d3ef66bdbb15c3" have entirely different histories.
799dbed676
...
f80e7dee2a
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win",
|
"name": "aix-win",
|
||||||
"version": "1.0.7",
|
"version": "1.0.5",
|
||||||
"description": "An Electron application with Vue",
|
"description": "An Electron application with Vue",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "example.com",
|
"author": "example.com",
|
||||||
|
|
|
@ -250,9 +250,7 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
||||||
onDownloadStarted: async ({ id, item, webContents }) => {
|
onDownloadStarted: async ({ id, item, webContents }) => {
|
||||||
// Do something with the download id
|
// Do something with the download id
|
||||||
},
|
},
|
||||||
onDownloadProgress: async ({ id, item, percentCompleted }) => {
|
onDownloadProgress: async ({ id, item, percentCompleted }) => {},
|
||||||
e.reply('download-file-default-prog' + fileName, percentCompleted)
|
|
||||||
},
|
|
||||||
onDownloadCompleted: async ({ id, item }) => {
|
onDownloadCompleted: async ({ id, item }) => {
|
||||||
console.log('完成')
|
console.log('完成')
|
||||||
e.reply('download-file-default' + fileName, true)
|
e.reply('download-file-default' + fileName, true)
|
||||||
|
|
|
@ -252,9 +252,9 @@ function handleAll() {
|
||||||
// curWin.webContents.send('pinia-state-set', storeName, jsonStr)
|
// curWin.webContents.send('pinia-state-set', storeName, jsonStr)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// console.log('pinia-state-init', jsonStr)
|
console.log('pinia-state-init', jsonStr)
|
||||||
const win = BrowserWindow.fromId(wid)
|
const win = BrowserWindow.fromId(wid)
|
||||||
// console.log(win)
|
console.log(win)
|
||||||
win.webContents.send('pinia-state-set', storeName, jsonStr)
|
win.webContents.send('pinia-state-set', storeName, jsonStr)
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -42,11 +42,6 @@ const updateInit = (win) => {
|
||||||
logger.error('检查更新失败')
|
logger.error('检查更新失败')
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听下载进度
|
|
||||||
autoUpdater.on('download-progress', (progressObj) => {
|
|
||||||
win.webContents.send('update-app-progress', progressObj.percent);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 跟新下载完毕
|
// 跟新下载完毕
|
||||||
autoUpdater.on('update-downloaded', () => {
|
autoUpdater.on('update-downloaded', () => {
|
||||||
dialog
|
dialog
|
||||||
|
|
|
@ -130,46 +130,3 @@ export function addStudentmainByNameArray(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//新增课程预约
|
|
||||||
export function addSmartClassReserv(data) {
|
|
||||||
return request({
|
|
||||||
url: '/smarttalk/classReserv/addSmartClassReserv',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//修改课程预约
|
|
||||||
export function updateSmartClassReserv(data) {
|
|
||||||
return request({
|
|
||||||
url: '/smarttalk/classReserv/updateSmartClassReserv',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//查询课程预约
|
|
||||||
export function getSelfReserv() {
|
|
||||||
return request({
|
|
||||||
url: '/smarttalk/classReserv/getSelfReserv',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function deleteSmartReserv(id) {
|
|
||||||
return request({
|
|
||||||
url: '/smarttalk/classReserv/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function startClass(id) {
|
|
||||||
return request({
|
|
||||||
url: '/smarttalk/classReserv/startClass',
|
|
||||||
method: 'get',
|
|
||||||
params: {id}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function endClass(id) {
|
|
||||||
return request({
|
|
||||||
url: '/smarttalk/classReserv/endClass',
|
|
||||||
method: 'get',
|
|
||||||
params: {id}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 2794390 */
|
font-family: "iconfont"; /* Project id 2794390 */
|
||||||
src: url('iconfont.woff2?t=1723452423265') format('woff2'),
|
src: url('iconfont.woff2?t=1723186593107') format('woff2'),
|
||||||
url('iconfont.woff?t=1723452423265') format('woff'),
|
url('iconfont.woff?t=1723186593107') format('woff'),
|
||||||
url('iconfont.ttf?t=1723452423265') format('truetype'),
|
url('iconfont.ttf?t=1723186593107') format('truetype'),
|
||||||
url('iconfont.svg?t=1723452423265#iconfont') format('svg');
|
url('iconfont.svg?t=1723186593107#iconfont') format('svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
|
@ -14,10 +14,6 @@
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-zanwushuju:before {
|
|
||||||
content: "\e655";
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-xiangzuo:before {
|
.icon-xiangzuo:before {
|
||||||
content: "\e64d";
|
content: "\e64d";
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,13 +5,6 @@
|
||||||
"css_prefix_text": "icon-",
|
"css_prefix_text": "icon-",
|
||||||
"description": "",
|
"description": "",
|
||||||
"glyphs": [
|
"glyphs": [
|
||||||
{
|
|
||||||
"icon_id": "9689424",
|
|
||||||
"name": "暂无数据",
|
|
||||||
"font_class": "zanwushuju",
|
|
||||||
"unicode": "e655",
|
|
||||||
"unicode_decimal": 58965
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"icon_id": "6176588",
|
"icon_id": "6176588",
|
||||||
"name": "向左",
|
"name": "向左",
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
/>
|
/>
|
||||||
<missing-glyph />
|
<missing-glyph />
|
||||||
|
|
||||||
<glyph glyph-name="zanwushuju" unicode="" d="M876.202667 543.445333H147.882667L0 282.752V-42.666667h1024v325.376l-147.797333 260.736z m-234.112-263.637333c0-70.485333-58.197333-127.658667-130.090667-127.658667-71.893333 0-130.133333 57.173333-130.133333 127.658667H61.098667L179.541333 501.76H844.373333l118.442667-221.952H642.133333zM500.138667 810.666667h44.629333v-157.610667h-44.629333V810.666667zM197.290667 732.416l31.573333 31.018667L342.272 651.946667l-31.573333-31.018667-113.493334 111.445333z m491.52-80.512l113.493333 111.445333 31.573333-30.976-113.493333-111.445333-31.573333 30.976z" horiz-adv-x="1024" />
|
|
||||||
|
|
||||||
<glyph glyph-name="xiangzuo" unicode="" d="M774.89 725L399.08 380.75l375.81-344.21a39.28 39.28 0 0 0 13.11-29c0-36.51-48.19-54.79-76.38-29L335.8 322.8c-34.94 32-34.94 83.9 0 115.9l375.82 344.22c28.19 25.81 76.38 7.53 76.38-29A39.3 39.3 0 0 0 774.89 725z" horiz-adv-x="1024" />
|
<glyph glyph-name="xiangzuo" unicode="" d="M774.89 725L399.08 380.75l375.81-344.21a39.28 39.28 0 0 0 13.11-29c0-36.51-48.19-54.79-76.38-29L335.8 322.8c-34.94 32-34.94 83.9 0 115.9l375.82 344.22c28.19 25.81 76.38 7.53 76.38-29A39.3 39.3 0 0 0 774.89 725z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
<glyph glyph-name="kechengziyuan1" unicode="" d="M530.299631 315.712191a54.537462 54.537462 0 0 0-34.299976 12.187492L19.862486 563.299519l-3.749997 3.749997a55.187462 55.187462 0 0 0 0 77.949946l3.749997 3.749998L495.687155 883.836796A54.537462 54.537462 0 0 0 530.299631 895.999288a54.562462 54.562462 0 0 0 34.299976-12.162492l476.137169-235.424836 3.749997-3.749998a55.199962 55.199962 0 0 0 0-77.949945l-3.749997-3.749998-476.137169-235.399836a54.562462 54.562462 0 0 0-34.299976-11.849992z m-455.874683 289.999798l455.874683-225.449843 455.874683 225.437343-455.874683 225.749843z m0 0M530.299631 94.012346a54.574962 54.574962 0 0 0-34.299976 12.162491L24.537483 339.149675a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-234.849836 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.174978 31.174978 0 0 0 27.749981-55.812461L564.599607 105.862337a54.562462 54.562462 0 0 0-34.299976-11.849991z m0 0M530.299631-128a54.862462 54.862462 0 0 0-34.299976 12.149992L24.537483 116.46233a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-233.862337 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.724978 31.724978 0 1 0 27.749981-57.06246L564.599607-115.850008a55.199962 55.199962 0 0 0-34.299976-12.149992z m0 0" horiz-adv-x="1060" />
|
<glyph glyph-name="kechengziyuan1" unicode="" d="M530.299631 315.712191a54.537462 54.537462 0 0 0-34.299976 12.187492L19.862486 563.299519l-3.749997 3.749997a55.187462 55.187462 0 0 0 0 77.949946l3.749997 3.749998L495.687155 883.836796A54.537462 54.537462 0 0 0 530.299631 895.999288a54.562462 54.562462 0 0 0 34.299976-12.162492l476.137169-235.424836 3.749997-3.749998a55.199962 55.199962 0 0 0 0-77.949945l-3.749997-3.749998-476.137169-235.399836a54.562462 54.562462 0 0 0-34.299976-11.849992z m-455.874683 289.999798l455.874683-225.449843 455.874683 225.437343-455.874683 225.749843z m0 0M530.299631 94.012346a54.574962 54.574962 0 0 0-34.299976 12.162491L24.537483 339.149675a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-234.849836 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.174978 31.174978 0 0 0 27.749981-55.812461L564.599607 105.862337a54.562462 54.562462 0 0 0-34.299976-11.849991z m0 0M530.299631-128a54.862462 54.862462 0 0 0-34.299976 12.149992L24.537483 116.46233a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-233.862337 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.724978 31.724978 0 1 0 27.749981-57.06246L564.599607-115.850008a55.199962 55.199962 0 0 0-34.299976-12.149992z m0 0" horiz-adv-x="1060" />
|
||||||
|
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 262 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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;
|
||||||
|
if (localStorage.getItem('evaluationList')) {
|
||||||
|
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||||
|
data = evaluationList.value
|
||||||
|
treeLoading.value = false
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
try {
|
||||||
const { rows } = await listEvaluation(params)
|
const { rows } = await listEvaluation(params)
|
||||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||||
evaluationList.value = rows
|
evaluationList.value = rows
|
||||||
data = rows
|
data = rows
|
||||||
|
} finally {
|
||||||
treeLoading.value = false
|
treeLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//获取教材版本
|
//获取教材版本
|
||||||
await getSubject()
|
await getSubject()
|
||||||
|
@ -256,10 +266,14 @@ const transData = (data) => {
|
||||||
|
|
||||||
//获取教材
|
//获取教材
|
||||||
const getSubject = async () => {
|
const getSubject = async () => {
|
||||||
|
if (localStorage.getItem('subjectList')) {
|
||||||
|
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||||
|
}
|
||||||
|
else {
|
||||||
const { rows } = await listEvaluation({ itemkey: "version", pageSize: 500 })
|
const { rows } = await listEvaluation({ itemkey: "version", pageSize: 500 })
|
||||||
subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject)
|
subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject && isHaveUnit(item.id))
|
||||||
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
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()
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, onMounted, defineEmits } from 'vue';
|
import { ref, watch, defineProps, onMounted, defineEmits } from 'vue';
|
||||||
const placeholder = ref('')
|
const placeholder = ref('')
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
|
@ -118,11 +118,18 @@ const getSubjectContent = async () => {
|
||||||
entpcourseedituserid: userId,
|
entpcourseedituserid: userId,
|
||||||
pageSize: 500
|
pageSize: 500
|
||||||
}
|
}
|
||||||
|
|
||||||
let data;
|
let data;
|
||||||
|
if (localStorage.getItem('evaluationList')) {
|
||||||
|
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||||
|
data = evaluationList.value
|
||||||
|
}
|
||||||
|
else {
|
||||||
const { rows } = await listEvaluation(params)
|
const { rows } = await listEvaluation(params)
|
||||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||||
evaluationList.value = rows
|
evaluationList.value = rows
|
||||||
data = rows
|
data = rows
|
||||||
|
}
|
||||||
|
|
||||||
//获取教材版本
|
//获取教材版本
|
||||||
getSubject()
|
getSubject()
|
||||||
|
|
|
@ -1,125 +0,0 @@
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
import { homeworklist, listEntpcourse } from '@/api/teaching/classwork'
|
|
||||||
import { addEntpcourse } from '@/api/teaching/classwork'
|
|
||||||
|
|
||||||
const userStore = useUserStore()
|
|
||||||
// 当前选中教材章节节点
|
|
||||||
let curNode = null
|
|
||||||
// 查询作业列表所需要的ID
|
|
||||||
let chapterId = null
|
|
||||||
|
|
||||||
export const useGetHomework = async (node) => {
|
|
||||||
/**
|
|
||||||
* node
|
|
||||||
*/
|
|
||||||
if (!node) return
|
|
||||||
curNode = node
|
|
||||||
|
|
||||||
// 获取查询作业列表所需ID
|
|
||||||
let { rows } = await getChapterId()
|
|
||||||
if (rows.length > 0) {
|
|
||||||
chapterId = rows[0].id
|
|
||||||
} else {
|
|
||||||
// 没有则 传教新的entpcourse 再次查询
|
|
||||||
await createEntpcourse()
|
|
||||||
let { rows } = await getChapterId()
|
|
||||||
chapterId = rows[0].id
|
|
||||||
}
|
|
||||||
|
|
||||||
return await getHomeWorkList()
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据教材章节ID 查询作业列表所需ID
|
|
||||||
const getChapterId = () => {
|
|
||||||
return listEntpcourse({
|
|
||||||
evalid: curNode.id ? curNode.id : curNode.parentNode.id,
|
|
||||||
edituserid: userStore.user.userId,
|
|
||||||
pageSize: 500
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建新的entpcourse
|
|
||||||
const createEntpcourse = () => {
|
|
||||||
// 参照 web AIx 传入参数
|
|
||||||
var cform = {}
|
|
||||||
cform.entpid = userStore.user.deptId
|
|
||||||
cform.level = 1
|
|
||||||
cform.parentid = 0
|
|
||||||
cform.dictid = 0
|
|
||||||
cform.evalid = curNode.id
|
|
||||||
cform.evalparentid = 0
|
|
||||||
cform.edusubject = curNode.edusubject
|
|
||||||
cform.edudegree = curNode.edudegree
|
|
||||||
cform.edustage = curNode.edustage
|
|
||||||
cform.coursetype = '课标学科'
|
|
||||||
cform.coursetitle = curNode.itemtitle
|
|
||||||
cform.coursedesc = ''
|
|
||||||
cform.status = ''
|
|
||||||
cform.dflag = 0
|
|
||||||
cform.edituserid = userStore.user.userId
|
|
||||||
cform.createblankfile = 'yes'
|
|
||||||
return addEntpcourse(cform)
|
|
||||||
}
|
|
||||||
|
|
||||||
const getHomeWorkList = async () => {
|
|
||||||
return await homeworklist({
|
|
||||||
entpcourseid: chapterId,
|
|
||||||
edituserid: userStore.user.userId,
|
|
||||||
pageSize: 100
|
|
||||||
}).then((res) => {
|
|
||||||
//以下代码 参照AIx web端 作业布置
|
|
||||||
let list = []
|
|
||||||
for (var i = 0; i < res.rows.length; i++) {
|
|
||||||
res.rows[i].taskconfig = []
|
|
||||||
|
|
||||||
// 找child
|
|
||||||
for (var j = 0; j < res.rows.length; j++) {
|
|
||||||
if (res.rows[j].parentid == res.rows[i].id) {
|
|
||||||
var ss = []
|
|
||||||
if (res.rows[j].classworkdatastudentids != null) {
|
|
||||||
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
|
|
||||||
}
|
|
||||||
var js = {
|
|
||||||
id: res.rows[j].id,
|
|
||||||
classid: res.rows[j].classid,
|
|
||||||
classcaption: res.rows[j].classcaption,
|
|
||||||
parentid: 0,
|
|
||||||
worktype: '',
|
|
||||||
workkey: res.rows[j].workkey,
|
|
||||||
worktag: '',
|
|
||||||
entpcourseid: 0,
|
|
||||||
evalid: 0,
|
|
||||||
edusubject: '',
|
|
||||||
edudegree: '',
|
|
||||||
workdate: '',
|
|
||||||
title: '',
|
|
||||||
workcodes: '',
|
|
||||||
studentlist: ss,
|
|
||||||
deaddate: res.rows[j].deaddate,
|
|
||||||
timelength: res.rows[j].timelength,
|
|
||||||
weights: res.rows[j].weights,
|
|
||||||
feedtype: res.rows[j].feedtype
|
|
||||||
}
|
|
||||||
res.rows[i].taskconfig.push(js)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.rows[i].fileShowName = res.rows[i].uniquekey
|
|
||||||
|
|
||||||
// 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现
|
|
||||||
// 2024-05-15,酉阳,jackyshen
|
|
||||||
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
|
|
||||||
list.push(res.rows[i])
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果是习题训练任务,则检查一共有多少道
|
|
||||||
if (res.rows[i].entpcourseworklist != '') {
|
|
||||||
res.rows[i].entpcourseworklistarray = JSON.parse('[' + res.rows[i].entpcourseworklist + ']')
|
|
||||||
} else {
|
|
||||||
res.rows[i].entpcourseworklistarray = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -35,7 +35,6 @@
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
|
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
|
||||||
<el-dropdown-item @click="changePage('/classReserv')">课程预约</el-dropdown-item>
|
|
||||||
<el-dropdown-item @click="changePage('/class')">班级中心</el-dropdown-item>
|
<el-dropdown-item @click="changePage('/class')">班级中心</el-dropdown-item>
|
||||||
<el-dropdown-item divided command="logout">
|
<el-dropdown-item divided command="logout">
|
||||||
<span>退出登录</span>
|
<span>退出登录</span>
|
||||||
|
|
|
@ -44,8 +44,8 @@ function stateSync(storeName, key, value) {
|
||||||
// 同步数据-发送给主线程-全量更新
|
// 同步数据-发送给主线程-全量更新
|
||||||
function stateSyncAll(store) {
|
function stateSyncAll(store) {
|
||||||
const storeName = store.$id
|
const storeName = store.$id
|
||||||
const jsonStr = circularSafeStringify(store.$state)
|
const jsonStr = JSON.stringify(store.$state)
|
||||||
console.log('state-change', jsonStr, storeName)
|
// console.log('state-change', jsonStr, storeName)
|
||||||
// 通知主线程更新
|
// 通知主线程更新
|
||||||
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
||||||
}
|
}
|
||||||
|
@ -61,32 +61,21 @@ function stateSyncInit(wid, store) {
|
||||||
// 同步数据-接收主线程消息
|
// 同步数据-接收主线程消息
|
||||||
function stateChange(store) {
|
function stateChange(store) {
|
||||||
const storeName = store.$id
|
const storeName = store.$id
|
||||||
ipcRenderer?.on('pinia-state-set', (e, sName, jsonStr) => {
|
// 设置更新 store-state 数据状态
|
||||||
if (sName == storeName) { // 更新对应数据
|
const setStateData = (jsonStr) => {
|
||||||
// console.log('state-set', jsonStr, sName)
|
const curJson = JSON.stringify(store.$state) // 当前数据
|
||||||
const curJson = circularSafeStringify(store.$state) // 当前数据
|
|
||||||
const isUp = curJson != jsonStr // 不同的时候才写入,不然会导致触发数据变化监听,导致死循环
|
const isUp = curJson != jsonStr // 不同的时候才写入,不然会导致触发数据变化监听,导致死循环
|
||||||
if (!isUp) return
|
if (!isUp) return
|
||||||
const stateJson = JSON.parse(jsonStr) // 新数据
|
const stateJson = JSON.parse(jsonStr) // 新数据
|
||||||
|
// console.log('setStateData', stateJson)
|
||||||
// 更新状态
|
// 更新状态
|
||||||
store.$patch(stateJson)
|
store.$patch(stateJson)
|
||||||
// 您可以通过将其 $state 属性设置为新对象来替换 Store 的整个状态
|
// 您可以通过将其 $state 属性设置为新对象来替换 Store 的整个状态
|
||||||
// store.$state = stateJson
|
// store.$state = stateJson
|
||||||
}
|
}
|
||||||
|
// 消息监听
|
||||||
|
ipcRenderer?.on('pinia-state-set', (e, sName, jsonStr) => {
|
||||||
|
// console.log('pinia-state-set', sName, jsonStr)
|
||||||
|
sName == storeName && setStateData(jsonStr) // 更新对应数据
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//解决JSON.stringify嵌套循环产生的bug
|
|
||||||
const circularSafeStringify = (obj) => {
|
|
||||||
const cache = new Set();
|
|
||||||
return JSON.stringify(obj, (key, value) => {
|
|
||||||
if (typeof value === "object" && value !== null) {
|
|
||||||
if (cache.has(value)) {
|
|
||||||
// 当前对象已经存在于缓存中,说明存在循环引用,返回占位符或其他处理方式
|
|
||||||
return "[Circular Reference]";
|
|
||||||
}
|
|
||||||
cache.add(value);
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -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',
|
||||||
|
@ -45,12 +45,6 @@ export const constantRoutes = [
|
||||||
name: 'profile',
|
name: 'profile',
|
||||||
meta: {title: '个人中心'}
|
meta: {title: '个人中心'}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/classReserv',
|
|
||||||
component: () => import('@/views/classManage/classReserv.vue'),
|
|
||||||
name: 'classReserv',
|
|
||||||
meta: {title: '课程预约'}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/class',
|
path: '/class',
|
||||||
component: () => import('@/views/classManage/index.vue'),
|
component: () => import('@/views/classManage/index.vue'),
|
||||||
|
|
|
@ -9,10 +9,6 @@ export const useToolState = defineStore('tool', {
|
||||||
showBoardAll: false, // 全屏画板-是否显示
|
showBoardAll: false, // 全屏画板-是否显示
|
||||||
isPdfWin: false, // pdf窗口是否打开
|
isPdfWin: false, // pdf窗口是否打开
|
||||||
isToolWin: false, // 工具窗口是否打开
|
isToolWin: false, // 工具窗口是否打开
|
||||||
curSubjectNode: {
|
|
||||||
data: {}, // 当前教材节点 (包含当前教材 单元)
|
|
||||||
querySearch: {} // 查询资源所需参数
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {listClassmain, listClassuser, addClassgroup, listClassgroup, delClassgroup,getClassgroup,updateClassgroup} from '@/api/classManage/index'
|
import {listClassmain, listClassuser, addClassgroup, listClassgroup, delClassgroup,getClassgroup,updateClassgroup} from '@/api/classManage/index'
|
||||||
import {ref, onMounted, reactive, watch} from 'vue'
|
import {ref, onMounted, reactive, defineProps, watch} from 'vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
import { getClassmain,listClassuser,leaveClass} from '@/api/classManage/index'
|
import { getClassmain,listClassuser,leaveClass} from '@/api/classManage/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import {reactive,onMounted,nextTick,watch} from 'vue'
|
import {reactive,onMounted,defineProps,nextTick,watch} from 'vue'
|
||||||
import delClassDemo from '@/store/modules/delClass'
|
import delClassDemo from '@/store/modules/delClass'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
classId: {
|
classId: {
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-container class="class-reserv-wrap">
|
|
||||||
<div class="class-reserv-tabs">
|
|
||||||
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
|
|
||||||
</div>
|
|
||||||
<div class="class-reserv-body">
|
|
||||||
<reserv-item
|
|
||||||
v-for="(item, index) in activeDataList"
|
|
||||||
v-show="tabActive === '进行中'"
|
|
||||||
:key="index"
|
|
||||||
:item="item"
|
|
||||||
@open-edit="reservDialog.openDialog(item)"
|
|
||||||
@delete-reserv="deleteReserv(item)"
|
|
||||||
></reserv-item>
|
|
||||||
<reserv-item
|
|
||||||
v-for="(item, index) in doneDataList"
|
|
||||||
v-show="tabActive === '已结束'"
|
|
||||||
:key="index"
|
|
||||||
:item="item"
|
|
||||||
></reserv-item>
|
|
||||||
</div>
|
|
||||||
<reserv ref="reservDialog"></reserv>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, onMounted, computed, watch } from 'vue'
|
|
||||||
import { getSelfReserv } from '@/api/classManage'
|
|
||||||
import ReservItem from '@/views/classManage/reserv-item.vue'
|
|
||||||
import Reserv from '@/views/prepare/container/reserv.vue'
|
|
||||||
import { useToolState } from '@/store/modules/tool'
|
|
||||||
const reservDialog = ref(null)
|
|
||||||
const tabOptions = ref(['进行中', '已结束'])
|
|
||||||
const tabActive = ref('进行中')
|
|
||||||
const dataList = ref([])
|
|
||||||
|
|
||||||
const activeDataList = computed(() => {
|
|
||||||
return dataList.value.filter((item) => {
|
|
||||||
return item.status !== '已结束'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
const deleteReserv = (item) => {
|
|
||||||
dataList.value = dataList.value.filter((is) => {
|
|
||||||
return is.id !== item.id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const doneDataList = computed(() => {
|
|
||||||
return dataList.value.filter((item) => {
|
|
||||||
return item.status === '已结束'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
const toolStore = useToolState()
|
|
||||||
watch(
|
|
||||||
() => toolStore.isToolWin,
|
|
||||||
(newD, oldD) => {
|
|
||||||
getSelfReserv().then((res) => {
|
|
||||||
dataList.value = [...res.data]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
)
|
|
||||||
onMounted(() => {
|
|
||||||
getSelfReserv().then((res) => {
|
|
||||||
dataList.value = res.data
|
|
||||||
})
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.class-reserv-wrap {
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 15px 30px;
|
|
||||||
.class-reserv-tabs {
|
|
||||||
width: 30%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.class-reserv-body {
|
|
||||||
height: 100%;
|
|
||||||
flex: 1;
|
|
||||||
overflow: auto;
|
|
||||||
padding: 10px 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,133 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="class-reserv-item">
|
|
||||||
<div class="class-reserv-item-img">
|
|
||||||
<img :src="basePath + item.bookImg" alt="封面" />
|
|
||||||
</div>
|
|
||||||
<div class="class-reserv-item-body">
|
|
||||||
<div class="class-reserv-item-title1">
|
|
||||||
<label>{{ item.className }}</label>
|
|
||||||
<el-tag style="margin-left: 5px" type="primary"> {{ item.classType }}</el-tag>
|
|
||||||
<el-tag style="margin-left: 5px" type="primary"> {{ item.classSubject }}</el-tag>
|
|
||||||
</div>
|
|
||||||
<div class="class-reserv-item-title2">
|
|
||||||
{{ item.classDay }} {{ item.startTime }} ~ {{ item.classDay }} {{ item.endTime }}
|
|
||||||
{{ item.createUserName }}老师
|
|
||||||
</div>
|
|
||||||
<div class="class-reserv-item-title3">
|
|
||||||
<span v-for="(tag, index) in item.classItemList" :key="index" style="margin-left: 5px">
|
|
||||||
{{ index === 0 ? tag.name : '、' + tag.name }}</span
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="class-reserv-item-tool">
|
|
||||||
<el-button v-if="item.status !== '已结束'" type="primary" @click="startClassR(item)"
|
|
||||||
>上课</el-button
|
|
||||||
>
|
|
||||||
<el-button v-if="item.status === '未开始'" @click="openEdit">编辑</el-button>
|
|
||||||
<!-- <el-button v-if="item.status === '上课中'" type="info" @click="endClassR(item)"
|
|
||||||
>下课</el-button
|
|
||||||
>-->
|
|
||||||
<el-button type="danger" @click="deleteReserv">删除</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { useToolState } from '@/store/modules/tool'
|
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
import { createWindow } from '@/utils/tool'
|
|
||||||
import { deleteSmartReserv, startClass, endClass } from '@/api/classManage'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { listEntpcourse } from '@/api/teaching/classwork'
|
|
||||||
const emit = defineEmits(['openEdit', 'deleteReserv'])
|
|
||||||
const props = defineProps({
|
|
||||||
item: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const basePath = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
|
||||||
const openEdit = () => {
|
|
||||||
emit('openEdit', props.item)
|
|
||||||
}
|
|
||||||
const deleteReserv = () => {
|
|
||||||
deleteSmartReserv([props.item.id]).then((res) => {
|
|
||||||
if (res.data === true) {
|
|
||||||
ElMessage({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
emit('deleteReserv', props.item)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const startClassR = (item) => {
|
|
||||||
startClass(item.id).then((res) => {
|
|
||||||
if (res.data === true) {
|
|
||||||
item.status = '上课中'
|
|
||||||
openLesson()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const toolStore = useToolState()
|
|
||||||
// 上课-工具类悬浮
|
|
||||||
const openLesson = () => {
|
|
||||||
if (toolStore.isToolWin) return ElMessage.error('您当前已开始上课,请勿重复操作')
|
|
||||||
startClass(props.item.id)
|
|
||||||
listEntpcourse({
|
|
||||||
evalid: props.item.ex2,
|
|
||||||
edituserid: useUserStore().user.userId,
|
|
||||||
pageSize: 500
|
|
||||||
}).then(res=>{
|
|
||||||
if (res.rows[0].id) {
|
|
||||||
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res.rows[0].id + "&reservId=" + props.item.id })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const endClassR = (item) => {
|
|
||||||
endClass(item.id).then((res) => {
|
|
||||||
if (res.data === true) {
|
|
||||||
ElMessage({
|
|
||||||
message: '下课成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
item.status = '已结束'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.class-reserv-item {
|
|
||||||
display: flex;
|
|
||||||
background-color: white;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 5px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
.class-reserv-item-img {
|
|
||||||
width: 80px;
|
|
||||||
padding-left: 20px;
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.class-reserv-item-body {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
text-align: left;
|
|
||||||
padding-left: 30px;
|
|
||||||
font-size: 14px;
|
|
||||||
.class-reserv-item-title1 {
|
|
||||||
flex: 1;
|
|
||||||
label {
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.class-reserv-item-tool {
|
|
||||||
margin-left: 15px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -112,7 +112,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {addStudentmain, listClassuser,updateStudentmain,getClassmain,getStudentmain,leaveClass,removeStudentDataAll,addStudentmainByNameArray} from '@/api/classManage/index'
|
import {addStudentmain, listClassuser,updateStudentmain,getClassmain,getStudentmain,leaveClass,removeStudentDataAll,addStudentmainByNameArray} from '@/api/classManage/index'
|
||||||
import {ref, onMounted, reactive, nextTick, watch} from 'vue'
|
import {ref, onMounted, reactive, nextTick, defineProps, watch} from 'vue'
|
||||||
import {ElMessage,ElMessageBox} from "element-plus";
|
import {ElMessage,ElMessageBox} from "element-plus";
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import * as XLSX from 'xlsx'
|
import * as XLSX from 'xlsx'
|
||||||
|
|
|
@ -7,47 +7,24 @@
|
||||||
<img class="welcome-img" :src="leftBg2" />
|
<img class="welcome-img" :src="leftBg2" />
|
||||||
</div>
|
</div>
|
||||||
<div class="box-item login">
|
<div class="box-item login">
|
||||||
<WindowTools :is-has-max="false" />
|
<WindowTools :isHasMax="false" />
|
||||||
<div class="login-title">账号登录</div>
|
<div class="login-title">账号登录</div>
|
||||||
<el-form ref="formRef" class="login-form" :model="loginForm" :rules="rules" size="large">
|
<el-form ref="formRef" class="login-form" :model="loginForm" :rules="rules" size="large">
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model.trim="loginForm.username" placeholder="请输入用户名" />
|
<el-input v-model.trim="loginForm.username" placeholder="请输入用户名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password" style="margin-bottom: 15px">
|
<el-form-item prop="password" style="margin-bottom: 15px">
|
||||||
<el-input
|
<el-input v-model="loginForm.password" autocomplete="on" type="password" placeholder="请输入密码" />
|
||||||
v-model="loginForm.password"
|
|
||||||
autocomplete="on"
|
|
||||||
type="password"
|
|
||||||
placeholder="请输入密码"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-checkbox v-model="loginForm.rememberMe" class="flex mb-5">记住密码</el-checkbox>
|
<el-checkbox class="flex mb-5" v-model="loginForm.rememberMe">记住密码</el-checkbox>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)"
|
<el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)">登录</el-button>
|
||||||
>登录</el-button
|
|
||||||
>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog
|
|
||||||
v-model="showDownLoading"
|
|
||||||
width="500"
|
|
||||||
:show-close="false"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
:close-on-press-escape="false"
|
|
||||||
align-center
|
|
||||||
>
|
|
||||||
<el-progress
|
|
||||||
:text-inside="true"
|
|
||||||
:stroke-width="22"
|
|
||||||
:percentage="downloadProp"
|
|
||||||
:show-text="false"
|
|
||||||
status="success"
|
|
||||||
/>
|
|
||||||
</el-dialog>
|
|
||||||
<!--选择学科-->
|
<!--选择学科-->
|
||||||
<SelectSubject v-model="isSubject" :login-data="loginForm" @on-success="successEditSubject" />
|
<SelectSubject v-model="isSubject" :loginData="loginForm" @onSuccess="successEditSubject"/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from 'vue'
|
import { onMounted, reactive, ref } from 'vue'
|
||||||
|
@ -59,8 +36,7 @@ import WindowTools from '@/components/window-tools/index.vue'
|
||||||
import SelectSubject from '@/components/select-subject/index.vue'
|
import SelectSubject from '@/components/select-subject/index.vue'
|
||||||
|
|
||||||
const { session } = require('@electron/remote')
|
const { session } = require('@electron/remote')
|
||||||
const downloadProp = ref(0)
|
|
||||||
const showDownLoading = ref(false)
|
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
@ -79,11 +55,7 @@ const rules = reactive({
|
||||||
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }]
|
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH;
|
||||||
ipcRenderer.on('update-app-progress', (e, prop) => {
|
|
||||||
downloadProp.value = prop
|
|
||||||
showDownLoading.value = prop !== 100
|
|
||||||
})
|
|
||||||
|
|
||||||
//登录
|
//登录
|
||||||
const submitForm = async (formEl) => {
|
const submitForm = async (formEl) => {
|
||||||
|
@ -111,9 +83,11 @@ const submitForm = async (formEl) => {
|
||||||
if (userStore.user.edustage || userStore.user.edusubject) {
|
if (userStore.user.edustage || userStore.user.edusubject) {
|
||||||
ElMessage.success('登录成功')
|
ElMessage.success('登录成功')
|
||||||
ipcRenderer && ipcRenderer.send('openMainWindow')
|
ipcRenderer && ipcRenderer.send('openMainWindow')
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
isSubject.value = true
|
isSubject.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
btnLoading.value = false
|
btnLoading.value = false
|
||||||
}
|
}
|
||||||
|
@ -144,7 +118,7 @@ const getCookieDetail = (name) => {
|
||||||
// 设置cookie
|
// 设置cookie
|
||||||
const setCookie = (name, value) => {
|
const setCookie = (name, value) => {
|
||||||
// 30天过期
|
// 30天过期
|
||||||
let Days = 30
|
let Days = 30;
|
||||||
let times = Math.round(Date.now() / 1000) + Days * 24 * 60 * 60
|
let times = Math.round(Date.now() / 1000) + Days * 24 * 60 * 60
|
||||||
const cookie = {
|
const cookie = {
|
||||||
url: curWinUrl,
|
url: curWinUrl,
|
||||||
|
@ -155,6 +129,8 @@ const setCookie = (name, value) => {
|
||||||
return session.defaultSession.cookies.set(cookie)
|
return session.defaultSession.cookies.set(cookie)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
localStorage.clear()
|
localStorage.clear()
|
||||||
getCookie()
|
getCookie()
|
||||||
|
|
|
@ -94,14 +94,13 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<!-- 判断是不是自己创建的课件-->
|
<div class="item-popover-item">
|
||||||
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
|
|
||||||
<el-button text @click="editTalk(item, index)">
|
<el-button text @click="editTalk(item, index)">
|
||||||
<i class="iconfont icon-bianji"></i>
|
<i class="iconfont icon-bianji"></i>
|
||||||
<span>重命名</span>
|
<span>重命名</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
|
<div class="item-popover-item">
|
||||||
<el-button text @click="deleteTalk(item)">
|
<el-button text @click="deleteTalk(item)">
|
||||||
<i class="iconfont icon-shanchu"></i>
|
<i class="iconfont icon-shanchu"></i>
|
||||||
<span>删除</span>
|
<span>删除</span>
|
||||||
|
@ -141,7 +140,6 @@ import { asyncLocalFile } from '@/utils/talkFile'
|
||||||
import { toTimeText } from '@/utils/date'
|
import { toTimeText } from '@/utils/date'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file'
|
import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file'
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
|
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
export default {
|
export default {
|
||||||
|
@ -164,13 +162,11 @@ export default {
|
||||||
emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null },
|
emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
listenList: [],
|
listenList: []
|
||||||
userInfo:{}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
editTalk(item) {
|
editTalk(item) {
|
||||||
console.log(item,this.userInfo,'this.userInfo')
|
|
||||||
ElMessageBox.prompt('请输入新的名称', '重命名', {
|
ElMessageBox.prompt('请输入新的名称', '重命名', {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
|
@ -257,9 +253,6 @@ export default {
|
||||||
deleteHomework(item){
|
deleteHomework(item){
|
||||||
this.$emit('on-delhomework', item)
|
this.$emit('on-delhomework', item)
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.userInfo = useUserStore().user
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -77,42 +77,20 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineExpose, onMounted, reactive, computed, watch } from 'vue'
|
import { ref, defineExpose, onMounted, reactive, computed } from 'vue'
|
||||||
import { addSmartClassReserv, updateSmartClassReserv, listClassmain } from '@/api/classManage'
|
import { listClassmain } from '@/api/classManage'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
const emit = defineEmits(['addSuccess'])
|
|
||||||
const props = defineProps({
|
|
||||||
bookId: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
currentNode: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const ruleFormDialog = ref(null)
|
const ruleFormDialog = ref(null)
|
||||||
const nowType = ref('add')
|
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const centerDialogVisible = ref(false)
|
const centerDialogVisible = ref(false)
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
name: '',
|
name: '',
|
||||||
type: '常规课',
|
type: '常规课',
|
||||||
day: '',
|
day: '',
|
||||||
time: [],
|
time: '',
|
||||||
resource: [],
|
resource: [],
|
||||||
classRoom: ''
|
classRoom: ''
|
||||||
})
|
})
|
||||||
const updateForm = ref({})
|
|
||||||
watch(
|
|
||||||
() => props.currentNode,
|
|
||||||
(newValue, oldValue) => {
|
|
||||||
form.name = newValue.label
|
|
||||||
}
|
|
||||||
)
|
|
||||||
const ruleForm = reactive({
|
const ruleForm = reactive({
|
||||||
name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }],
|
||||||
day: [{ required: true, message: '请选择上课日期', trigger: 'change' }],
|
day: [{ required: true, message: '请选择上课日期', trigger: 'change' }],
|
||||||
|
@ -143,29 +121,17 @@ const locationOptions = [
|
||||||
const locationMessage = computed(() => {
|
const locationMessage = computed(() => {
|
||||||
return locationOptions.find((item) => item.value === form.type).message
|
return locationOptions.find((item) => item.value === form.type).message
|
||||||
})
|
})
|
||||||
const openDialog = (data) => {
|
const openDialog = () => {
|
||||||
if (data) {
|
|
||||||
updateForm.value = data
|
|
||||||
nowType.value = 'update'
|
|
||||||
form.name = data.className
|
|
||||||
form.type = data.classType
|
|
||||||
form.day = data.classDay
|
|
||||||
form.time = [data.startTime, data.endTime]
|
|
||||||
form.resource = data.classList.split(',').map((item) => parseInt(item))
|
|
||||||
form.classRoom = data.classRoom
|
|
||||||
}
|
|
||||||
centerDialogVisible.value = true
|
centerDialogVisible.value = true
|
||||||
}
|
}
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
ruleFormDialog.value.resetFields()
|
ruleFormDialog.value.resetFields()
|
||||||
centerDialogVisible.value = false
|
centerDialogVisible.value = false
|
||||||
form.name = props.currentNode.label
|
|
||||||
}
|
}
|
||||||
const classList = ref([])
|
const classList = ref([])
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
listClassmain({ classuserid: userStore.userId, pageSize: 100, status: 'open' }).then(
|
listClassmain({ classuserid: userStore.userId, pageSize: 100, status: 'open' }).then(
|
||||||
(response) => {
|
(response) => {
|
||||||
console.log(response)
|
|
||||||
classList.value = [...response.rows]
|
classList.value = [...response.rows]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -175,73 +141,10 @@ const submitForm = async () => {
|
||||||
if (!formEl) return
|
if (!formEl) return
|
||||||
await formEl.validate((valid) => {
|
await formEl.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (nowType.value === 'update') {
|
|
||||||
updateClassReserv(form)
|
|
||||||
} else {
|
|
||||||
addClassReserv(form)
|
|
||||||
}
|
|
||||||
centerDialogVisible.value = false
|
centerDialogVisible.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const updateClassReserv = (formData) => {
|
|
||||||
let ids = formData.resource.join(',')
|
|
||||||
let param = {
|
|
||||||
className: formData.name,
|
|
||||||
classType: formData.type,
|
|
||||||
classDay: formData.day,
|
|
||||||
startTime: formData.time[0],
|
|
||||||
endTime: formData.time[1],
|
|
||||||
classList: ids,
|
|
||||||
classRoom: formData.classRoom,
|
|
||||||
id: updateForm.value.id
|
|
||||||
}
|
|
||||||
updateSmartClassReserv(param).then((res) => {
|
|
||||||
if (res.data === true) {
|
|
||||||
closeDialog()
|
|
||||||
ElMessage({
|
|
||||||
type: 'success',
|
|
||||||
message: '修改预约成功!'
|
|
||||||
})
|
|
||||||
Object.assign(updateForm.value, param)
|
|
||||||
} else {
|
|
||||||
ElMessage({
|
|
||||||
type: 'error',
|
|
||||||
message: res.message
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const addClassReserv = (formData) => {
|
|
||||||
let ids = formData.resource.join(',')
|
|
||||||
let param = {
|
|
||||||
className: formData.name,
|
|
||||||
classType: formData.type,
|
|
||||||
classDay: formData.day,
|
|
||||||
startTime: formData.time[0],
|
|
||||||
endTime: formData.time[1],
|
|
||||||
classList: ids,
|
|
||||||
classRoom: formData.classRoom,
|
|
||||||
classSubject: props.currentNode.edusubject,
|
|
||||||
ex1: props.bookId,
|
|
||||||
ex2: props.currentNode.id
|
|
||||||
}
|
|
||||||
addSmartClassReserv(param).then((res) => {
|
|
||||||
if (res.data === true) {
|
|
||||||
closeDialog()
|
|
||||||
ElMessage({
|
|
||||||
type: 'success',
|
|
||||||
message: '预约成功!'
|
|
||||||
})
|
|
||||||
emit('addSuccess')
|
|
||||||
} else {
|
|
||||||
ElMessage({
|
|
||||||
type: 'error',
|
|
||||||
message: res.message
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
openDialog,
|
openDialog,
|
||||||
closeDialog
|
closeDialog
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogVisible" center top="10vh" width="600px" :show-close="false" append-to-body
|
<el-dialog v-model="dialogVisible" center top="10vh" width="600px" :show-close="false" append-to-body
|
||||||
style="border-radius: 10px; padding: 10px 15px;">
|
:z-index="999999" style="border-radius: 10px; padding: 10px 15px;">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="homerwork-header flex">
|
<div class="homerwork-header flex">
|
||||||
<span>{{ title }}</span>
|
<span>{{ title }}</span>
|
||||||
|
@ -288,6 +288,7 @@ export default {
|
||||||
modelValue(val) {
|
modelValue(val) {
|
||||||
this.dialogVisible = val
|
this.dialogVisible = val
|
||||||
if (val) {
|
if (val) {
|
||||||
|
console.log(this.row,10000)
|
||||||
this.getGradeList()
|
this.getGradeList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,10 +492,11 @@ export default {
|
||||||
|
|
||||||
// 打开PDF-课件
|
// 打开PDF-课件
|
||||||
async navtoPdf() {
|
async navtoPdf() {
|
||||||
|
const toolStore = useToolState()
|
||||||
// if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
|
// if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
|
||||||
let path = await this.getBookPathFromServer()
|
let path = await this.getBookPathFromServer()
|
||||||
// path=path.replace(/^.*[\\\/]/, '');
|
path=path.replace(/^.*[\\\/]/, '');
|
||||||
// console.log(path)
|
console.log(path)
|
||||||
// console.log(this.uploadData.textbookId)
|
// console.log(this.uploadData.textbookId)
|
||||||
createWindow('open-PDF', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId+'&path='+ path })
|
createWindow('open-PDF', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId+'&path='+ path })
|
||||||
},
|
},
|
||||||
|
|
|
@ -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)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -36,13 +36,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-btns" @click.stop>
|
<div class="item-btns" @click.stop>
|
||||||
<!-- 只有自己创建的课件可以修改名称-->
|
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="bottom-end"
|
placement="bottom-end"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
popper-class="custom-popover"
|
popper-class="custom-popover"
|
||||||
:visible="item.showPopover"
|
:visible="item.showPopover"
|
||||||
v-if="Number(item.createUserId) === userInfo.userId"
|
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button link type="primary">
|
<el-button link type="primary">
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<h3 class="title">{{ lesson }}</h3>
|
<h3 class="title">{{ lesson }}</h3>
|
||||||
<div class="grade">{{ usertore.edusubject }}</div>
|
<div class="grade">{{ usertore.edusubject }}</div>
|
||||||
</div>
|
</div>
|
||||||
<i class="iconfont icon-xiangyou" @click="showLeft = !showLeft"></i>
|
<!-- <i class="iconfont icon-xiangyou"></i> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="homework-list" v-loading="loading">
|
<div class="homework-list" v-loading="loading">
|
||||||
<el-scrollbar height="360px">
|
<el-scrollbar height="360px">
|
||||||
|
@ -42,26 +42,22 @@
|
||||||
</div>
|
</div>
|
||||||
<el-button color="#349d44" @click="sendHomework(item)">推送</el-button>
|
<el-button color="#349d44" @click="sendHomework(item)">推送</el-button>
|
||||||
</li>
|
</li>
|
||||||
<div class="no-data flex" v-if="!dataList.length && !resourceList.length">
|
|
||||||
<i class="iconfont icon-zanwushuju"></i>
|
|
||||||
<span>暂无数据</span>
|
|
||||||
</div>
|
|
||||||
</ul>
|
</ul>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<SetHomework v-model="setDialog" :title="'推送作业'" :entpcourseid="entpcourseid" :row="curRow"
|
<SetHomework v-model="setDialog" :title="'推送作业'" :entpcourseid="entpcourseid" :row="curRow"
|
||||||
@on-close="closeHomework" />
|
@on-close="closeHomework" />
|
||||||
</div>
|
</div>
|
||||||
<div class="homework flex" v-else>
|
<div class="homework" @click="showLeft = !showLeft" v-else>
|
||||||
<div class="unit-top flex">
|
<div class="unit-top flex">
|
||||||
<div class="unit-top-left" @click="showLeft = !showLeft">
|
<div class="unit-top-left">
|
||||||
<i class="iconfont icon-xiangzuo"></i>
|
<i class="iconfont icon-xiangzuo"></i>
|
||||||
<span>返回</span>
|
<span>返回</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="unit-top-center">选择目录</span>
|
<span class="unit-top-center">选择目录</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="unit-content">
|
<div>
|
||||||
<Lesson @changeChapter="changeChapter" />
|
<!-- <Lesson/> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -76,12 +72,10 @@ import { homeworklist } from '@/api/teaching/classwork'
|
||||||
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
||||||
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
||||||
import FileImage from '@/components/file-image/index.vue'
|
import FileImage from '@/components/file-image/index.vue'
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
|
||||||
import { ipcMsgSend } from '@/utils/tool'
|
import { ipcMsgSend } from '@/utils/tool'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import { asyncLocalFile } from '@/utils/talkFile'
|
import { asyncLocalFile } from '@/utils/talkFile'
|
||||||
import Lesson from './lesson.vue';
|
import Lesson from './lesson.vue';
|
||||||
import { parseCataByNode } from '@/utils/talkFile'
|
|
||||||
|
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -114,28 +108,13 @@ const closeHomework = () => {
|
||||||
setDialog.value = false
|
setDialog.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const changeChapter = async (data)=>{
|
|
||||||
const res = await useGetHomework(data)
|
|
||||||
dataList.value = res
|
|
||||||
let cata = parseCataByNode(data)
|
|
||||||
|
|
||||||
toolStore.curSubjectNode.querySearch.levelFirstId = cata[0]
|
|
||||||
toolStore.curSubjectNode.querySearch.levelSecondId = cata[1]
|
|
||||||
lesson.value = data.label
|
|
||||||
showLeft.value = !showLeft.value
|
|
||||||
getResource()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取资源数据
|
// 获取资源数据
|
||||||
const getResource = () => {
|
const getResource = () => {
|
||||||
let querySearch = toRaw(toolStore.curSubjectNode).querySearch
|
let data = toRaw(toolStore.curSubjectNode)
|
||||||
|
data.orderByColumn = 'uploadTime'
|
||||||
querySearch.orderByColumn = 'uploadTime'
|
data.isAsc = 'desc'
|
||||||
querySearch.isAsc = 'desc'
|
data.pageSize = 500
|
||||||
querySearch.pageSize = 500
|
getSmarttalkPage(data).then(res => {
|
||||||
|
|
||||||
getSmarttalkPage(querySearch).then(res => {
|
|
||||||
resourceList.value = res.rows
|
resourceList.value = res.rows
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -231,9 +210,9 @@ onMounted(() => {
|
||||||
entpcourseid.value = route.query.entpcourseid
|
entpcourseid.value = route.query.entpcourseid
|
||||||
lesson.value = route.query.label
|
lesson.value = route.query.label
|
||||||
getHomework()
|
getHomework()
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
getResource()
|
getResource()
|
||||||
},5000)
|
}, 5000)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -245,9 +224,8 @@ onMounted(() => {
|
||||||
|
|
||||||
.homework {
|
.homework {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.homework-content {
|
.homework-content {
|
||||||
|
@ -339,18 +317,6 @@ onMounted(() => {
|
||||||
.unit-top-center{
|
.unit-top-center{
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.unit-content{
|
|
||||||
height: calc(100% - 50px);
|
|
||||||
}
|
|
||||||
.no-data{
|
|
||||||
padding-top: 30px;
|
|
||||||
color: #d7d7d7;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
color: 12px;
|
|
||||||
.icon-zanwushuju{
|
|
||||||
font-size: 50px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<el-scrollbar>
|
|
||||||
<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="currentNodeId" highlight-current
|
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
|
||||||
@node-click="handleNodeClick">
|
@node-click="handleNodeClick">
|
||||||
|
@ -8,16 +7,14 @@
|
||||||
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-scrollbar>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, nextTick, markRaw, toRaw } from 'vue'
|
import { ref, onMounted, nextTick, markRaw, toRaw } from 'vue'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import { parseCataByNode } from '@/utils/talkFile'
|
|
||||||
|
|
||||||
const emit = defineEmits(['changeChapter'])
|
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
const treeData = ref([])
|
const treeData = ref([])
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
@ -46,9 +43,12 @@ const getTreeData = () => {
|
||||||
//下册
|
//下册
|
||||||
let volumeTwo = evaluationList.value.filter(item => item.level == 1 && item.semester == '下册')
|
let volumeTwo = evaluationList.value.filter(item => item.level == 1 && item.semester == '下册')
|
||||||
//数据过滤
|
//数据过滤
|
||||||
|
console.log(volumeOne,1)
|
||||||
|
console.log(volumeTwo,2)
|
||||||
let upData = transData(volumeOne)
|
let upData = transData(volumeOne)
|
||||||
let downData = transData(volumeTwo)
|
let downData = transData(volumeTwo)
|
||||||
|
console.log(upData)
|
||||||
|
console.log(downData)
|
||||||
if(upData.length && downData.length){
|
if(upData.length && downData.length){
|
||||||
treeData.value = [...upData,...downData]
|
treeData.value = [...upData,...downData]
|
||||||
}
|
}
|
||||||
|
@ -61,50 +61,28 @@ const getTreeData = () => {
|
||||||
}
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
let defaultKey
|
let defaultKey
|
||||||
if(toolStore.curSubjectNode.querySearch.levelSecondId){
|
if(toolStore.curSubjectNode.levelSecondId){
|
||||||
defaultKey = toolStore.curSubjectNode.querySearch.levelSecondId
|
defaultKey = toolStore.curSubjectNode.levelSecondId
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
defaultKey = toolStore.curSubjectNode.querySearch.levelFirstId
|
defaultKey = toolStore.curSubjectNode.levelFirstId
|
||||||
}
|
}
|
||||||
currentNodeId.value = defaultKey
|
defaultExpandedKeys.value = defaultKey
|
||||||
|
// currentNode.data = getLastLevelData(treeData.value)[0]
|
||||||
|
// currentNodeId.value = getLastLevelData(treeData.value)[0].id
|
||||||
|
// currentNodeName.value = getLastLevelData(treeData.value)[0].label
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleNodeClick = (data, node) => {
|
const handleNodeClick = ()=>{}
|
||||||
/**
|
|
||||||
* data : 当前节点数据
|
|
||||||
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
|
|
||||||
*/
|
|
||||||
|
|
||||||
const nodeData = data;
|
|
||||||
const parentNode = node.parent.data;
|
|
||||||
|
|
||||||
if (Array.isArray(parentNode)) {
|
|
||||||
nodeData.parentNode = null
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
nodeData.parentNode = parentNode
|
|
||||||
}
|
|
||||||
|
|
||||||
emit('changeChapter', toRaw(nodeData))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 根据教材章节单元ID 查询作业列表所需ID
|
|
||||||
const getChapterId = () => {
|
|
||||||
return listEntpcourse({
|
|
||||||
evalid: this.uploadData.levelSecondId,
|
|
||||||
edituserid: this.userStore.userId,
|
|
||||||
pageSize: 500
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const transData = (data) => {
|
const transData = (data) => {
|
||||||
let ary = []
|
let ary = []
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
let obj = {}
|
let obj = {}
|
||||||
|
console.log(item.rootid, '==========>',curBookId.value)
|
||||||
if (item.rootid == curBookId.value) {
|
if (item.rootid == curBookId.value) {
|
||||||
obj.label = item.itemtitle
|
obj.label = item.itemtitle
|
||||||
obj.id = item.id
|
obj.id = item.id
|
||||||
|
@ -136,36 +114,16 @@ const transData = (data) => {
|
||||||
|
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
setTimeout(()=>{
|
// console.log(toolStore.curSubjectNode,111)
|
||||||
let data = toRaw(toolStore.curSubjectNode)
|
|
||||||
curBookId.value = data.data.textBook.curBookId
|
// let data = toRaw(toolStore.curSubjectNode)
|
||||||
getTreeData()
|
// console.log(data,222)
|
||||||
},500)
|
|
||||||
|
|
||||||
|
// curBookId.value = toolStore.curSubjectNode.textbookId
|
||||||
|
// getTreeData()
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped></style>
|
||||||
.el-tree{
|
|
||||||
background-color: #121212
|
|
||||||
}
|
|
||||||
:deep(.el-tree-node) {
|
|
||||||
.el-tree-node__content {
|
|
||||||
height: 45px;
|
|
||||||
color: #EFEFEF;
|
|
||||||
//#368FFF
|
|
||||||
&:hover {
|
|
||||||
background-color: #272728;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content) {
|
|
||||||
background-color: #121212 !important;
|
|
||||||
color: #409EFF
|
|
||||||
}
|
|
||||||
:deep(.el-scrollbar__view){
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -38,8 +38,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
// 功能说明:electron 悬浮球
|
// 功能说明:electron 悬浮球
|
||||||
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { endClass } from '@/api/classManage'
|
|
||||||
import logo from '@root/resources/icon.png' // logo
|
import logo from '@root/resources/icon.png' // logo
|
||||||
import boardVue from './components/board.vue' // 画板-子组件
|
import boardVue from './components/board.vue' // 画板-子组件
|
||||||
import sideVue from './components/side.vue' // 画板-子组件
|
import sideVue from './components/side.vue' // 画板-子组件
|
||||||
|
@ -49,7 +48,6 @@ import vDrag from './directive/drag' // 自定义指令-拖拽
|
||||||
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
||||||
import { useToolState } from '@/store/modules/tool' // 数据状态-缓存
|
import { useToolState } from '@/store/modules/tool' // 数据状态-缓存
|
||||||
import { ipcMsgSend, ipcHandle, ipcMain, ipcMsgInvoke } from '@/utils/tool' // 相关工具
|
import { ipcMsgSend, ipcHandle, ipcMain, ipcMsgInvoke } from '@/utils/tool' // 相关工具
|
||||||
const route = useRoute();
|
|
||||||
const tabActive = ref('select') // 工具栏当前选中项
|
const tabActive = ref('select') // 工具栏当前选中项
|
||||||
const isFold = ref(false) // 折叠工具栏
|
const isFold = ref(false) // 折叠工具栏
|
||||||
const isDrag = ref(false) // 开始拖拽
|
const isDrag = ref(false) // 开始拖拽
|
||||||
|
@ -127,7 +125,6 @@ const sideChange = o => {
|
||||||
break
|
break
|
||||||
case 'over': // 下课
|
case 'over': // 下课
|
||||||
toolStore.isToolWin = false
|
toolStore.isToolWin = false
|
||||||
endClass(route.query.reservId)
|
|
||||||
ipcMsgSend('tool-sphere:close')
|
ipcMsgSend('tool-sphere:close')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -135,6 +132,7 @@ const sideChange = o => {
|
||||||
|
|
||||||
// === 监听器 ===
|
// === 监听器 ===
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
console.log('工具:', toolStore)
|
||||||
// 不同的时候, 更新值: 是否显示-画板
|
// 不同的时候, 更新值: 是否显示-画板
|
||||||
const show = !toolStore.isPdfWin && toolStore.showBoardAll
|
const show = !toolStore.isPdfWin && toolStore.showBoardAll
|
||||||
if (show != isShow.value) isShow.value = show
|
if (show != isShow.value) isShow.value = show
|
||||||
|
|
Loading…
Reference in New Issue