Compare commits
10 Commits
59be0c07d1
...
e6a0859f87
Author | SHA1 | Date |
---|---|---|
yangws | e6a0859f87 | |
zhengdegang | 3d8dc4320d | |
zdg | 1518d9c3ae | |
lyc | 23878f5843 | |
lyc | 144da0ace9 | |
zhengdegang | 46098aa733 | |
zdg | 13e755bb9a | |
zdg | b5ce949172 | |
zdg | d033c217d6 | |
yangws | edfdf8b9ad |
|
@ -13,11 +13,6 @@ asarUnpack:
|
||||||
win:
|
win:
|
||||||
executableName: AIx
|
executableName: AIx
|
||||||
icon: resources/logo2.ico
|
icon: resources/logo2.ico
|
||||||
extraFiles:
|
|
||||||
- from: ./node_modules/im_electron_sdk/lib/
|
|
||||||
to: ./resources
|
|
||||||
filter:
|
|
||||||
- '**/*'
|
|
||||||
nsis:
|
nsis:
|
||||||
oneClick: false
|
oneClick: false
|
||||||
allowToChangeInstallationDirectory: true
|
allowToChangeInstallationDirectory: true
|
||||||
|
@ -50,3 +45,9 @@ publish:
|
||||||
url: https://file.ysaix.com:7868/src/assets/smarttalk/
|
url: https://file.ysaix.com:7868/src/assets/smarttalk/
|
||||||
electronDownload:
|
electronDownload:
|
||||||
mirror: https://npmmirror.com/mirrors/electron/
|
mirror: https://npmmirror.com/mirrors/electron/
|
||||||
|
# 额外依赖打包到输出目录
|
||||||
|
extraFiles:
|
||||||
|
- from: ./node_modules/im_electron_sdk/lib/
|
||||||
|
to: ./resources
|
||||||
|
filter:
|
||||||
|
- '**/*'
|
||||||
|
|
14
package.json
14
package.json
|
@ -30,6 +30,7 @@
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"electron-dl-manager": "^3.0.0",
|
"electron-dl-manager": "^3.0.0",
|
||||||
"electron-log": "^5.1.7",
|
"electron-log": "^5.1.7",
|
||||||
|
"electron-store": "8.0.0",
|
||||||
"electron-updater": "^6.1.7",
|
"electron-updater": "^6.1.7",
|
||||||
"element-plus": "^2.7.6",
|
"element-plus": "^2.7.6",
|
||||||
"fabric": "^5.3.0",
|
"fabric": "^5.3.0",
|
||||||
|
@ -63,18 +64,5 @@
|
||||||
"vite-plugin-windicss": "^1.9.3",
|
"vite-plugin-windicss": "^1.9.3",
|
||||||
"vue": "^3.4.30",
|
"vue": "^3.4.30",
|
||||||
"windicss": "^3.5.6"
|
"windicss": "^3.5.6"
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"win": {
|
|
||||||
"extraFiles": [
|
|
||||||
{
|
|
||||||
"from": "./node_modules/im_electron_sdk/lib/",
|
|
||||||
"to": "./resources",
|
|
||||||
"filter": [
|
|
||||||
"**/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,17 @@ import { join } from 'path'
|
||||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||||
import icon from '../../resources/icon.png?asset'
|
import icon from '../../resources/icon.png?asset'
|
||||||
import File from './file'
|
import File from './file'
|
||||||
import chat from './chat' // chat封装
|
import chat from './chat' // chat封装
|
||||||
|
import Store from './store' // Store封装
|
||||||
|
import updateInit from './update'
|
||||||
|
|
||||||
// 代理 electron/remote
|
// 代理 electron/remote
|
||||||
// 第一步:引入remote
|
// 第一步:引入remote
|
||||||
import remote from '@electron/remote/main'
|
import remote from '@electron/remote/main'
|
||||||
// 第二步: 初始化remote
|
// 第二步: 初始化remote
|
||||||
remote.initialize()
|
remote.initialize()
|
||||||
import updateInit from './update'
|
// 持久化数据-初始化
|
||||||
|
Store.initialize()
|
||||||
|
|
||||||
File({ app, shell, BrowserWindow, ipcMain })
|
File({ app, shell, BrowserWindow, ipcMain })
|
||||||
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
|
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/**
|
||||||
|
* @description 解决 主进程|渲染进程 数据共享
|
||||||
|
*/
|
||||||
|
import Store from 'electron-store' // 持久化存储
|
||||||
|
|
||||||
|
// 设置ipc与渲染器通信
|
||||||
|
Store.initRenderer()
|
||||||
|
|
||||||
|
// 默认共享数据
|
||||||
|
const defaultData = {
|
||||||
|
model: 'select', // 悬浮球-当前模式
|
||||||
|
showBoardAll: false, // 全屏画板-是否显示
|
||||||
|
isPdfWin: false, // pdf窗口是否打开
|
||||||
|
isToolWin: false, // 工具窗口是否打开
|
||||||
|
curSubjectNode: {
|
||||||
|
data: {}, // 当前教材节点 (包含当前教材 单元)
|
||||||
|
querySearch: {} // 查询资源所需参数
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
export function initialize(){
|
||||||
|
const store = new Store({
|
||||||
|
name: 'cache-store', // 存储文件名
|
||||||
|
fileExtension: 'ini', // 文件后缀名
|
||||||
|
encryptionKey: 'Eihrjwi7h104h2Kub423' // 数据加密-防止用户直接改配置
|
||||||
|
})
|
||||||
|
store.clear() // 先清除-所有缓存数据
|
||||||
|
store.set(defaultData) // 初始化-默认数据
|
||||||
|
return store
|
||||||
|
}
|
||||||
|
export default { initialize }
|
|
@ -163,6 +163,10 @@ const handleNodeClick = (data,node) => {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
titleName.value = `${useStore.user.edustage}-${useStore.user.edusubject}`
|
titleName.value = `${useStore.user.edustage}-${useStore.user.edusubject}`
|
||||||
treeLoading.value = true
|
treeLoading.value = true
|
||||||
|
//存在查看无课程的情况,两秒后关闭loading框
|
||||||
|
setTimeout(() => {
|
||||||
|
treeLoading.value = false
|
||||||
|
},2000)
|
||||||
})
|
})
|
||||||
//监听数据变化
|
//监听数据变化
|
||||||
watch(() => useThird,() => {
|
watch(() => useThird,() => {
|
||||||
|
|
|
@ -34,6 +34,7 @@ const getSubject = (value) => {
|
||||||
const currentIndex = gradeList.findIndex(item => item.value === value)
|
const currentIndex = gradeList.findIndex(item => item.value === value)
|
||||||
getSubjects({stage:value}).then(res => {
|
getSubjects({stage:value}).then(res => {
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
|
if(res.data.length === 0) return
|
||||||
subjectList.value = res.data.map(item => {
|
subjectList.value = res.data.map(item => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
|
|
|
@ -250,10 +250,10 @@ const onSubmit = (formEl) => {
|
||||||
saveByClassWorkArray({
|
saveByClassWorkArray({
|
||||||
classworkarray: JSON.stringify(ary)
|
classworkarray: JSON.stringify(ary)
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then((res) => {
|
||||||
setLoading.value = false
|
setLoading.value = false
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success('操作成功')
|
||||||
emit('on-success')
|
emit('on-success', res.data)
|
||||||
cloneDialog(formEl)
|
cloneDialog(formEl)
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
class="flex"
|
class="flex"
|
||||||
:style="{'color' : item.color}"
|
:style="{'color' : item.color}"
|
||||||
:class="currentRoute === item.url ? 'active-li' : ''"
|
:class="currentRoute === item.url ? 'active-li' : ''"
|
||||||
@click="handleOutLink(item.url,item.type)"
|
@click="handleOutLink(item.url,item.type, item.name)"
|
||||||
>
|
>
|
||||||
<i :class="item.img"></i>
|
<i :class="item.img"></i>
|
||||||
<span class="text">{{ item.name }}</span>
|
<span class="text">{{ item.name }}</span>
|
||||||
|
@ -57,6 +57,7 @@ import WindowTools from '@/components/window-tools/index.vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import routerStore from '@/store/modules/route'
|
import routerStore from '@/store/modules/route'
|
||||||
import outLink from '@/utils/linkConfig'
|
import outLink from '@/utils/linkConfig'
|
||||||
|
|
||||||
const routeHeader = routerStore()
|
const routeHeader = routerStore()
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
@ -64,7 +65,7 @@ const router = useRouter()
|
||||||
const currentRoute = ref('')
|
const currentRoute = ref('')
|
||||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
||||||
|
|
||||||
const handleOutLink = (path, type) => {
|
const handleOutLink = (path, type, name) => {
|
||||||
if (!path) return
|
if (!path) return
|
||||||
if (type === 'hash') {
|
if (type === 'hash') {
|
||||||
router.push(path)
|
router.push(path)
|
||||||
|
@ -73,6 +74,11 @@ const handleOutLink = (path, type) => {
|
||||||
let configObj = outLink().getBaseData()
|
let configObj = outLink().getBaseData()
|
||||||
let fullPath = configObj.fullPath + path
|
let fullPath = configObj.fullPath + path
|
||||||
fullPath = fullPath.replaceAll('//', '/')
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
|
const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId'))
|
||||||
|
let unitId = levelSecondId ? levelSecondId :levelFirstId
|
||||||
|
if(name == '教材分析' || name == '高考研究'){
|
||||||
|
fullPath += `?unitId=${unitId}`
|
||||||
|
}
|
||||||
// 通知主进程
|
// 通知主进程
|
||||||
ipcRenderer.send('openWindow', {
|
ipcRenderer.send('openWindow', {
|
||||||
key: path,
|
key: path,
|
||||||
|
|
|
@ -6,12 +6,14 @@
|
||||||
// Remote.app.getAppPath() E:\njys-work\AIx_Smarttalk\dist\win-unpacked\resources\app.asar
|
// Remote.app.getAppPath() E:\njys-work\AIx_Smarttalk\dist\win-unpacked\resources\app.asar
|
||||||
// path.join(__dirname) 根目录 E:\njys-work\AIx_Smarttalk\dist\win-unpacked\resources\app.asar\out\renderer
|
// path.join(__dirname) 根目录 E:\njys-work\AIx_Smarttalk\dist\win-unpacked\resources\app.asar\out\renderer
|
||||||
|
|
||||||
const isNode = typeof require !== 'undefined' // 是否支持node函数
|
const isNode = typeof require !== 'undefined' // 是否支持node函数
|
||||||
const path = isNode?require('path'):{}
|
const path = isNode?require('path'):{}
|
||||||
const Remote = isNode?require('@electron/remote'):{}
|
const Remote = isNode?require('@electron/remote'):{}
|
||||||
const { ipcRenderer } = isNode?require('electron'):window.electron || {}
|
const { ipcRenderer } = isNode?require('electron'):window.electron || {}
|
||||||
const API = isNode?window.api:{} // preload-api
|
const API = isNode?window.api:{} // preload-api
|
||||||
import { useToolState } from '@/store/modules/tool' // 获取store状态
|
import { useToolState } from '@/store/modules/tool' // 获取store状态
|
||||||
|
const Store = isNode?require('electron-store'):null // 持久化存储
|
||||||
|
|
||||||
// 常用变量
|
// 常用变量
|
||||||
const BaseUrl = isNode?process.env['ELECTRON_RENDERER_URL']+'/#':''
|
const BaseUrl = isNode?process.env['ELECTRON_RENDERER_URL']+'/#':''
|
||||||
const isDev = isNode?process.env.NODE_ENV !== 'production':''
|
const isDev = isNode?process.env.NODE_ENV !== 'production':''
|
||||||
|
@ -19,6 +21,12 @@ const toolState = useToolState() // 获取store状态
|
||||||
|
|
||||||
// 暴露Remote中的属性
|
// 暴露Remote中的属性
|
||||||
export const ipcMain = Remote?.ipcMain || {}
|
export const ipcMain = Remote?.ipcMain || {}
|
||||||
|
// 暴露Store存储对象
|
||||||
|
export const store = Store ? new Store({
|
||||||
|
name: 'cache-store', // 存储文件名
|
||||||
|
fileExtension: 'ini', // 文件后缀名
|
||||||
|
encryptionKey: 'Eihrjwi7h104h2Kub423' // 数据加密-防止用户直接改配置
|
||||||
|
}) : {}
|
||||||
/**
|
/**
|
||||||
* 获取静态资源,开发和生产环境
|
* 获取静态资源,开发和生产环境
|
||||||
* @param {*} url
|
* @param {*} url
|
||||||
|
|
|
@ -422,7 +422,6 @@ export default {
|
||||||
this.uploadData.levelSecondId = cata[1]
|
this.uploadData.levelSecondId = cata[1]
|
||||||
this.uploadData.levelThirdId = cata[2]
|
this.uploadData.levelThirdId = cata[2]
|
||||||
this.uploadData.textbookId = data.textBook.curBookId
|
this.uploadData.textbookId = data.textBook.curBookId
|
||||||
const toolStore = useToolState()
|
|
||||||
toolStore.curSubjectNode.data = data
|
toolStore.curSubjectNode.data = data
|
||||||
toolStore.curSubjectNode.querySearch = this.uploadData
|
toolStore.curSubjectNode.querySearch = this.uploadData
|
||||||
this.initHomeWork()
|
this.initHomeWork()
|
||||||
|
|
|
@ -70,6 +70,8 @@ const getData = (data) => {
|
||||||
levelSecondId
|
levelSecondId
|
||||||
}
|
}
|
||||||
sourceStore.handleQuery()
|
sourceStore.handleQuery()
|
||||||
|
// 头部 教材分析打开外部链接需要当前章节ID
|
||||||
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||||
}
|
}
|
||||||
const getDataOther = (data) => {
|
const getDataOther = (data) => {
|
||||||
sourceStore.thirdQuery.chapterId = data.chapterId
|
sourceStore.thirdQuery.chapterId = data.chapterId
|
||||||
|
|
|
@ -111,9 +111,10 @@ const closeHomework = async() => {
|
||||||
ipcMsgSend('tool-sphere:set:ignore', true)
|
ipcMsgSend('tool-sphere:set:ignore', true)
|
||||||
}
|
}
|
||||||
// 推送成功
|
// 推送成功
|
||||||
const successHomework = ()=>{
|
const successHomework = (data)=>{
|
||||||
|
// console.log('推送成功', data)
|
||||||
// 发送im消息-推送作业(app|平板)
|
// 发送im消息-推送作业(app|平板)
|
||||||
ipcMsgInvoke('im-chat:msg', curRow.value.id, MsgEnum.HEADS.MSG_0016)
|
ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016)
|
||||||
}
|
}
|
||||||
// 章节目录change
|
// 章节目录change
|
||||||
const changeChapter = async (data)=>{
|
const changeChapter = async (data)=>{
|
||||||
|
|
Loading…
Reference in New Issue