Compare commits

..

25 Commits

Author SHA1 Message Date
yangws 4596ce4911 Merge remote-tracking branch 'origin/main' into yangws 2024-09-23 17:30:05 +08:00
zhengdegang 83e985e0d6 Merge pull request 'zdg' (#257) from zdg into main
Reviewed-on: #257
2024-09-23 17:28:43 +08:00
zdg 20ca8f71d6 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into zdg 2024-09-23 17:27:42 +08:00
zdg c9292af67b 优化-下课和stroe监听相关bug 2024-09-23 17:26:44 +08:00
lyc fa6f61e3b3 Merge pull request 'lyc-dev' (#256) from lyc-dev into main 2024-09-23 17:24:35 +08:00
lyc bfa7cc4cd9 Merge branch 'main' into lyc-dev 2024-09-23 17:22:56 +08:00
lyc 852b92e1f3 首页跳转 2024-09-23 17:22:43 +08:00
lyc 47390723a7 Merge pull request '跳转修改' (#255) from lyc-dev into main 2024-09-23 16:50:23 +08:00
lyc 713a592bcf 跳转修改 2024-09-23 16:49:48 +08:00
yangws d1ae68d184 Merge remote-tracking branch 'origin/main' into yangws 2024-09-23 16:24:05 +08:00
lyc 3dc36cbc34 Merge pull request '生成图片地址修改' (#254) from lyc-dev into main 2024-09-23 13:01:46 +08:00
lyc 781829373a 生成图片地址修改 2024-09-23 13:01:13 +08:00
zhengdegang 776e77a88c Merge pull request 'zdg' (#253) from zdg into main
Reviewed-on: #253
2024-09-23 11:06:14 +08:00
zdg 7145658d13 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into zdg 2024-09-23 11:05:20 +08:00
zdg 372371e2f0 解决下课异常 2024-09-23 11:05:14 +08:00
lyc 2f49d42418 推出 提示正在上课 2024-09-23 10:38:21 +08:00
lyc 8b9cc3f1ee Merge pull request '推出 提示正在上课' (#252) from lyc-dev into main 2024-09-23 10:38:18 +08:00
zdg a05cf19e74 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into zdg 2024-09-23 10:14:31 +08:00
lyc a5ad6c2250 Merge pull request 'edit' (#251) from lyc-dev into main 2024-09-23 09:58:48 +08:00
lyc 60e31f4b43 edit 2024-09-23 09:58:47 +08:00
yangws e36ede941c Merge remote-tracking branch 'origin/main' into yangws 2024-09-23 09:32:35 +08:00
朱浩 27c7033522 Merge pull request 'yangws' (#249) from yangws into main
Reviewed-on: #249
2024-09-22 16:47:12 +08:00
lyc c2b54714ac Merge pull request '跳转增加bookid' (#248) from lyc-dev into main 2024-09-22 16:41:45 +08:00
lyc cafea2d719 跳转增加bookid 2024-09-22 16:41:49 +08:00
zdg 6935bec1e4 测试 2024-09-21 12:05:46 +08:00
10 changed files with 109 additions and 64 deletions

View File

@ -115,7 +115,7 @@ const outerAi = [
title: '生成图片',
secondTit: '文生图大模型',
img: new URL('../../../src/assets/images/ai-01.png', import.meta.url).href,
path: '/ais/aisd3'
path: '/ais/aiwenxinyige'
},
{
id: 2,

View File

@ -114,6 +114,7 @@ const emitChangeBook = async () => {
*/
let levelFirstId = null
let levelSecondId = null
let bookeId = curBook.data.id
if (curData.parentNode) {
levelFirstId = curData.parentNode.id
levelSecondId = curData.id
@ -121,7 +122,7 @@ const emitChangeBook = async () => {
levelFirstId = curData.id
levelSecondId = ''
}
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
emit('changeBook', data)
}
@ -206,6 +207,7 @@ const handleNodeClick = (data, node) => {
*/
let levelFirstId = null
let levelSecondId = null
let bookeId = curBook.data.id
if (nodeData.parentNode) {
levelFirstId = nodeData.parentNode.id
levelSecondId = nodeData.id
@ -213,7 +215,7 @@ const handleNodeClick = (data, node) => {
levelFirstId = nodeData.id
levelSecondId = ''
}
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
emit('nodeClick', curData)
@ -233,6 +235,7 @@ onMounted( async () => {
}
else{
curBook.data = useSubject.subjectList[0]
localStorage.setItem('curBook', JSON.stringify(curBook.data))
treeData.value = useSubject.treeData
}
//

View File

@ -102,8 +102,9 @@ const getTreeData = () => {
levelFirstId = curNode.id
levelSecondId = ''
}
let bookeId = curBookId
// 头部 教材分析、作业设计打开外部链接需要当前章节ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
// const data = {
// textBook: {

View File

@ -65,7 +65,7 @@
<script setup>
import { ref, watch, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessageBox } from 'element-plus'
import { ElMessageBox, ElMessage } from 'element-plus'
import { ArrowDown } from '@element-plus/icons-vue'
import WindowTools from '@/components/window-tools/index.vue'
import useUserStore from '@/store/modules/user'
@ -74,6 +74,10 @@ import outLink from '@/utils/linkConfig'
import logoIco from '@/assets/images/logo.png'
import { listEvaluation } from '@/api/classManage/index'
import { clearBookInfo } from '@/utils/ruoyi'
import { sessionStore } from '@/utils/store'
import { useToolState } from '@/store/modules/tool'
const toolState = useToolState();
let homeTitle = ref(import.meta.env.VITE_APP_TITLE)
const { ipcRenderer } = window.electron || {}
const userStore = useUserStore()
@ -166,6 +170,8 @@ function handleCommand(command) {
}
function logout() {
const hasClass = sessionStore.has('activeClass.id')
if (hasClass || toolState.isToolWin) return ElMessage.warning('当前正在上课,请先结结束上课')
ElMessageBox.confirm('确认退出系统吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',

View File

@ -5,6 +5,8 @@ const isNode = typeof require !== 'undefined' // 是否支持node函数
const { ipcRenderer } = isNode?require('electron'):{} // app使用
import { sessionStore } from '@/utils/store'
import CircularJSON from 'circular-json'
import _ from 'lodash'
// import { diff } from 'jsondiffpatch'
// const Remote = isNode?require('@electron/remote'):{} // 远程模块
@ -19,19 +21,14 @@ export function shareStorePlugin({store}) {
const storeName = mutation.storeId
// 用于多窗口共享(需要共享的状态名称)
const names = ['tool']
if (names.includes(storeName)) {
const { storeId: storeName, payload, events, type } = mutation // direct
// if (!Object.keys(payload).length) return
// if (type != 'direct' || !events || Array.isArray(events) || !events.key) return
stateSyncWatch(storeName, state) // 需要同步
}
if (names.includes(storeName)) stateSyncWatch(storeName, state) // 需要同步
})
// 暴露方法-手动同步
store.stateSync = (storeName, key, value) => {
const state = store.$state
if (!storeName && !!key && !!value) stateSync(storeName, key, value, state)
else stateSyncAll(store, state)
else stateSyncAll(store)
}
// 暴露方法-发送当前状态-新窗口
store.stateSyncInit = wid => stateSyncInit(wid, store)
@ -58,21 +55,42 @@ function stateSync(storeName, key, value, state) {
function stateSyncWatch(storeName, newState) {
const oldState = sessionStore.store // 旧数据
const diffData = findDifferences(oldState, newState)
// console.log('state-change-diffData', diffData)
if(!_.keys(diffData).length) return // 没有变化就终止执行
// 数据处理: 找出差异
console.log('state-change-diffData', diffData)
try {
let pinaValue = {} // store pina状态管理需要的数据格式
// 数据转换处理
for(const key in diffData) {
const value = diffData[key] || null
const newValue = {} // 重新组装pinia需要的数据 {a:{b:1}} 这种
const keyArr = key.split('.') || []
keyArr.reduce((o,c,i)=>{o[c] = i === keyArr.length-1 ? value : {};return o[c]}, newValue)
const jsonStr = JSON.stringify(newValue) // 从新组装-json数据
// 更新本地数据-session
// console.log('state-change-update:', key, value)
sessionStore.set(key, value)
// 通知主线程更新
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
// console.log('======',key, value, jsonStr )
// 合并数据 loadsh _.merge() 函数
_.merge(pinaValue, newValue)
}
// 数据处理: electron-store
const [key, value] = _.toPairs(pinaValue)[0] // 对象转换为数组 {a:1} toPairs [['a',1]]
// 无数据就终止执行
if (!key || !value) return
// 更新本地数据-session
// 直接获取当前最新值(整体更新)上面获取到value是差异值并不能知道删除还是新增
const newValAll = _.get(newState, key)
const oldValAll = sessionStore.get(key)
// 没变化也终止执行
if (_.isEqual(oldValAll, newValAll)) return
// 更新本地数据-session
sessionStore.set(key, newValAll)
// 数据处理: pina-store
const jsonStr = JSON.stringify(pinaValue) // 从新组装-json数据
// 通知主线程更新
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
// console.log('======',key, value, jsonStr )
} catch (error) {
console.log('state-change-error', error)
}

View File

@ -24,10 +24,11 @@ export const useToolState = defineStore('tool', {
actions: {
async resetDef() { // 重置数据-下课
this.model = 'select' // 悬浮球-当前模式
await sleep(20) // 休眠20ms
await sleep(50) // 休眠50ms
this.showBoardAll = false // 全屏画板-是否显示
await sleep(20) // 休眠20ms
await sleep(50) // 休眠50ms
this.isToolWin = false // 工具窗口是否打开
await sleep(50) // 休眠50ms
}
}
})

View File

@ -8,7 +8,7 @@
<div class="item-title">{{ item.name }}</div>
<div class="item-content">
<ul class="flex con-ul">
<li v-for="menu in item.list" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
<li v-for="menu in item.list" :key="menu.id" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
<i class="iconfont" :class="menu.icon"></i>
<span>{{ menu.name }}</span>
</li>
@ -47,13 +47,10 @@ import outLink from '@/utils/linkConfig'
import * as echarts from 'echarts'
import { useGetClassWork } from '@/hooks/useGetClassWork'
const router = useRouter()
const { ipcRenderer } = window.electron || {}
const type = ref(-1)
const chartDom = ref(null);
let chartInstance = null
const menuList = [{
name: '课程教学',
span: 24,
@ -63,38 +60,39 @@ const menuList = [{
name: '课标分析',
icon: 'icon-kecheng',
isOuter: true,
path: '/teaching/chatwithstandard'
path: '/teaching/chatwithstandard',
id: '1-1'
},
{
name: '教材分析',
icon: 'icon-jiaocaixuanze',
isOuter: true,
path: '/teaching/chatwithtextbook'
path: '/teaching/chatwithtextbook',
id: '1-2'
},
{
name: '考试分析',
icon: 'icon-kaoshi',
path: '/examReport'
path: '/examReport',
id: '1-3'
},
{
name: '学情分析',
icon: 'icon-xueqingfenxi',
disabled: true
disabled: true,
id: '1-4'
},
// {
// name: '',
// icon: 'icon-jiaoxuesheji',
// path: '/prepare'
// },
{
name: '教学实践',
icon: 'icon-jiaoxuefenxi',
path: '/prepare'
path: '/prepare',
id: '1-5'
},
{
name: '教学反思',
icon: 'icon-jiaoxuefansi',
disabled: true
disabled: true,
id: '1-6'
},
]
},
@ -107,27 +105,27 @@ const menuList = [{
name: '作业设计',
icon: 'icon-jiaoxuefansi',
isOuter: true,
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask'
//path: '/newClassTask'
//path: '/classTaskAssign'
//isOuter: true,
//path: '/teaching/classtaskassign?titleName=&&openDialog=newClassTask'
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask',
id: '2-1'
},
{
name: '作业布置',
icon: 'icon-xiezuo1',
isOuter: true,
path: '/teaching/classtaskassign?titleName=作业布置'
path: '/teaching/classtaskassign?titleName=作业布置',
id: '2-2'
},
{
name: '作业批改',
icon: 'icon-pigai',
path: '/classTask'
path: '/classTask',
id: '2-3'
},
{
name: '作业统计',
icon: 'icon-tongji',
disabled: true
disabled: true,
id: '2-4'
},
]
},
@ -139,41 +137,47 @@ const menuList = [{
{
name: '教学计划',
icon: 'icon-jiaoxuejihua',
disabled: true
disabled: true,
id: '3-1'
},
{
name: '教学组织',
icon: 'icon-organization-framework-line',
disabled: true
disabled: true,
id: '3-2'
},
{
name: '教学质量',
icon: 'icon-jiaoxuezhiliangfenxi',
disabled: true
disabled: true,
id: '3-3'
},
{
name: '教学反馈',
icon: 'icon-fankui',
disabled: true
disabled: true,
id: '3-4'
},
]
}
]
const clickMenu = ({isOuter, path, disabled}) =>{
const clickMenu = ({isOuter, path, disabled, id}) =>{
if(disabled) return
//
if(isOuter){
let configObj = outLink().getBaseData()
let fullPath = configObj.fullPath + path
if(path == '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask' || path == '/teaching/classtaskassign?titleName=作业布置'){
if(id == '1-2' || id == '2-1' || id == '2-2' ){
// ID
const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId'))
const { levelFirstId, levelSecondId, bookeId } = JSON.parse(localStorage.getItem('unitId'))
let unitId = levelSecondId ? levelSecondId : levelFirstId
fullPath = fullPath + `&unitId=${unitId}`
console.log(fullPath)
if(fullPath.indexOf('?') == -1){
fullPath += `?unitId=${unitId}&bookeId=${bookeId}`
}
else{
fullPath += `&unitId=${unitId}&bookeId=${bookeId}`
}
}
fullPath = fullPath.replaceAll('//', '/')
//

View File

@ -208,7 +208,8 @@ export default {
openFileWin(items) {
if (items.fileFlag === 'apt') {
console.log(this.curNode);
const path="/teaching/aptindex?id="+items.fileId + "&cataId=" + this.curNode.id;
let curBook = JSON.parse(localStorage.getItem('curBook'))
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + this.curNode.id + "&bookId=" + curBook.id;
let configObj = outLink().getBaseData()
let fullPath = configObj.fullPath + path
fullPath = fullPath.replaceAll('//', '/')

View File

@ -219,15 +219,15 @@ const sideChange = async o => {
}).then(async() => {
await imChatRef.value?.imChatObj?.imChat?.sendMsgClosed() //
// const elMsg = ElMessage.warning({duration:0,message:'...'})
// const elMsg = ElLoading.service({lock: true, text: '...', background: 'rgba(0, 0, 0, 0.7)'})
const elMsg = ElLoading.service({lock: true, text: '正在下课...', background: 'rgba(0, 0, 0, 0.7)'})
// 2
setTimeout(async() => {
// elMsg.close()
// toolStore.isToolWin = false
toolStore.resetDef() //
await imChatRef.value?.deleteGroup() //
await imChatRef.value?.logout() // 退im
await classManageApi.endClass(route.query.reservId)
elMsg.close()
ipcMsgSend('tool-sphere:close') //
}, 500);
@ -243,6 +243,7 @@ const sideChange = async o => {
// === ===
watchEffect(() => {
if (isOver.value) return // ,
// , : -
const show = !toolStore.isPdfWin && toolStore.showBoardAll
if (show != isShow.value) isShow.value = show

View File

@ -1,9 +1,15 @@
<template>
<canvas ref="canvasRef" />
<button @click="eraseTo">橡皮擦
<i class="iconfont icon-xiangpica"></i>
</button>
<button @click="close">销毁</button>
<canvas ref="canvasRef" style="pointer-events: none;" />
<div style="position: absolute;top: 0;" @click="test('click')"
@mouseenter="test('mouseenter')" @mousemove="test('mousemove')" @mouseleave="test('mouseleave')"
@touchstart="test('touchstart')" @touchmove="test('touchmove')" @touchend="test('touchend')"
@touchcancel="test('touchcancel')" @mousedown="test('mousedown')" @mouseup="test('mouseup')"
@mouseout="test('mouseout')" @mouseover="test('mouseover')" @mousewheel="test('mousewheel')">
<!-- <button @click="eraseTo">橡皮擦</button> -->
<!-- <i class="iconfont icon-xiangpica"></i> -->
<!-- <button @click="close">销毁</button> -->
<div style="width: 100px;height: 100px;background: #ffbcbc;">小星星</div>
</div>
</template>
<script setup>
@ -43,6 +49,10 @@ const eraseTo = () => { // 橡皮擦
// canvas.dispose()
}
const close = () => { FabricVue.removeCanvas() }
const test = (key, e) => {
console.log('event: ', key)
}
</script>
<style lang="scss" scoped>