Compare commits

..

No commits in common. "main" and "2.5.9" have entirely different histories.
main ... 2.5.9

132 changed files with 2941 additions and 52144 deletions

View File

@ -17,7 +17,6 @@ VITE_APP_RES_FILE_PATH = 'https://file.ysaix.com:7868/src/assets/textbook/booktx
VITE_APP_BUILD_BASE_PATH = 'https://file.ysaix.com:7868/' VITE_APP_BUILD_BASE_PATH = 'https://file.ysaix.com:7868/'
# websocket 地址 # websocket 地址
# VITE_APP_WS_URL = 'wss://prev.ysaix.com:7868'
VITE_APP_WS_URL = 'wss://file.ysaix.com:7868' VITE_APP_WS_URL = 'wss://file.ysaix.com:7868'
# VITE_APP_WS_URL = 'ws://192.168.2.16:7865' # VITE_APP_WS_URL = 'ws://192.168.2.16:7865'

View File

@ -1,8 +1,6 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 文枢课堂 VITE_APP_TITLE = 文枢课堂
VITE_APP_ID = 'aix-win-ws'
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'

View File

@ -1,7 +1,5 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 永川中小学AI教学系统 VITE_APP_TITLE = 文枢课堂
VITE_APP_ID = 'aix-win-ws-yc'
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'

View File

@ -1,8 +1,6 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 实训教学 VITE_APP_TITLE = 实训教学
VITE_APP_ID = 'aix-win-ws-yc2'
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'

27
.env.yy
View File

@ -1,27 +0,0 @@
# 页面标题
VITE_APP_TITLE = 育人酉数平台
VITE_APP_ID = 'aix-win-ws-yy'
# 生产环境配置
VITE_APP_ENV = 'production'
# AIx融合数字管理系统/生产环境
VITE_APP_BASE_API = 'https://prev.ysaix.com:7868/prod-api'
VITE_APP_DOMAIN = 'prev.ysaix.com'
VITE_APP_UPLOAD_API = 'https://prev.ysaix.com:7868/prod-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip
VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktxt/'
VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/'
# websocket 地址
VITE_APP_WS_URL = 'wss://prev.ysaix.com:7868'
# 是否显示开发工具
VITE_SHOW_DEV_TOOLS = 'false'

View File

@ -6,11 +6,6 @@ directories:
win: win:
executableName: 文枢课堂 executableName: 文枢课堂
icon: resources/logo2.ico icon: resources/logo2.ico
target:
- target: nsis
arch:
- x64
- ia32
files: files:
- '!**/.vscode/*' - '!**/.vscode/*'
- '!src/*' - '!src/*'
@ -52,8 +47,8 @@ publish:
electronDownload: electronDownload:
mirror: https://npmmirror.com/mirrors/electron/ mirror: https://npmmirror.com/mirrors/electron/
# 额外依赖打包到输出目录 # 额外依赖打包到输出目录
#extraFiles: extraFiles:
# - from: ./node_modules/im_electron_sdk/lib/ - from: ./node_modules/im_electron_sdk/lib/
# to: ./resources to: ./resources
# filter: filter:
# - '**/*' - '**/*'

View File

@ -13,11 +13,6 @@ asarUnpack:
win: win:
executableName: AIx executableName: AIx
icon: resources/logo2.ico icon: resources/logo2.ico
target:
- target: nsis
arch:
- x64
- ia32
nsis: nsis:
oneClick: false oneClick: false
allowToChangeInstallationDirectory: true allowToChangeInstallationDirectory: true
@ -51,8 +46,8 @@ publish:
electronDownload: electronDownload:
mirror: https://npmmirror.com/mirrors/electron/ mirror: https://npmmirror.com/mirrors/electron/
# 额外依赖打包到输出目录 # 额外依赖打包到输出目录
#extraFiles: extraFiles:
# - from: ./node_modules/im_electron_sdk/lib/ - from: ./node_modules/im_electron_sdk/lib/
# to: ./resources to: ./resources
# filter: filter:
# - '**/*' - '**/*'

View File

@ -1,16 +1,11 @@
appId: com.electron.app.yc appId: com.electron.app.yc
productName: 永川中小学AI教学系统 productName: 文枢课堂
directories: directories:
output: dist output: dist
buildResources: build buildResources: build
win: win:
executableName: 永川中小学AI教学系统 executableName: 文枢课堂
icon: resources/yc-logo.png icon: resources/yc-logo.png
target:
- target: nsis
arch:
- x64
- ia32
files: files:
- '!**/.vscode/*' - '!**/.vscode/*'
- '!src/*' - '!src/*'
@ -22,7 +17,7 @@ asarUnpack:
nsis: nsis:
oneClick: false oneClick: false
allowToChangeInstallationDirectory: true allowToChangeInstallationDirectory: true
artifactName: ${name}-${version}-setup.${ext} artifactName: ${name}-yc-${version}-setup.${ext}
shortcutName: ${productName} shortcutName: ${productName}
uninstallDisplayName: ${productName} uninstallDisplayName: ${productName}
createDesktopShortcut: always createDesktopShortcut: always
@ -52,8 +47,8 @@ publish:
electronDownload: electronDownload:
mirror: https://npmmirror.com/mirrors/electron/ mirror: https://npmmirror.com/mirrors/electron/
# 额外依赖打包到输出目录 # 额外依赖打包到输出目录
#extraFiles: extraFiles:
# - from: ./node_modules/im_electron_sdk/lib/ - from: ./node_modules/im_electron_sdk/lib/
# to: ./resources to: ./resources
# filter: filter:
# - '**/*' - '**/*'

View File

@ -6,11 +6,6 @@ directories:
win: win:
executableName: 实训教学 executableName: 实训教学
icon: resources/yc-logo.png icon: resources/yc-logo.png
target:
- target: nsis
arch:
- x64
- ia32
files: files:
- '!**/.vscode/*' - '!**/.vscode/*'
- '!src/*' - '!src/*'
@ -22,7 +17,7 @@ asarUnpack:
nsis: nsis:
oneClick: false oneClick: false
allowToChangeInstallationDirectory: true allowToChangeInstallationDirectory: true
artifactName: ${name}-${version}-setup.${ext} artifactName: ${name}-ycsx-${version}-setup.${ext}
shortcutName: ${productName} shortcutName: ${productName}
uninstallDisplayName: ${productName} uninstallDisplayName: ${productName}
createDesktopShortcut: always createDesktopShortcut: always
@ -52,8 +47,8 @@ publish:
electronDownload: electronDownload:
mirror: https://npmmirror.com/mirrors/electron/ mirror: https://npmmirror.com/mirrors/electron/
# 额外依赖打包到输出目录 # 额外依赖打包到输出目录
#extraFiles: extraFiles:
# - from: ./node_modules/im_electron_sdk/lib/ - from: ./node_modules/im_electron_sdk/lib/
# to: ./resources to: ./resources
# filter: filter:
# - '**/*' - '**/*'

View File

@ -1,59 +0,0 @@
appId: com.electron.app.yy
productName: 育人酉数平台
directories:
output: dist
buildResources: build
win:
executableName: 育人酉数平台
icon: resources/yy-logo.png
target:
- target: nsis
arch:
- x64
- ia32
files:
- '!**/.vscode/*'
- '!src/*'
- '!electron.vite.config.{js,ts,mjs,cjs}'
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
asarUnpack:
- resources/**
nsis:
oneClick: false
allowToChangeInstallationDirectory: true
artifactName: ${name}-${version}-setup.${ext}
shortcutName: ${productName}
uninstallDisplayName: ${productName}
createDesktopShortcut: always
mac:
entitlementsInherit: build/entitlements.mac.plist
extendInfo:
- NSCameraUsageDescription: Application requests access to the device's camera.
- NSMicrophoneUsageDescription: Application requests access to the device's microphone.
- NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
- NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
notarize: false
dmg:
artifactName: ${name}-${version}.${ext}
linux:
target:
- AppImage
- snap
- deb
maintainer: electronjs.org
category: Utility
appImage:
artifactName: ${name}-${version}.${ext}
npmRebuild: false
publish:
provider: generic
url: https://prev.ysaix.com:7868/src/assets/smarttalkyy/
electronDownload:
mirror: https://npmmirror.com/mirrors/electron/
# 额外依赖打包到输出目录
#extraFiles:
# - from: ./node_modules/im_electron_sdk/lib/
# to: ./resources
# filter:
# - '**/*'

View File

@ -13,11 +13,6 @@ asarUnpack:
win: win:
executableName: AIx executableName: AIx
icon: resources/logo2.ico icon: resources/logo2.ico
target:
- target: nsis
arch:
- x64
- ia32
nsis: nsis:
oneClick: false oneClick: false
allowToChangeInstallationDirectory: true allowToChangeInstallationDirectory: true
@ -51,8 +46,8 @@ publish:
electronDownload: electronDownload:
mirror: https://npmmirror.com/mirrors/electron/ mirror: https://npmmirror.com/mirrors/electron/
# 额外依赖打包到输出目录 # 额外依赖打包到输出目录
#extraFiles: extraFiles:
# - from: ./node_modules/im_electron_sdk/lib/ - from: ./node_modules/im_electron_sdk/lib/
# to: ./resources to: ./resources
# filter: filter:
# - '**/*' - '**/*'

View File

@ -35,7 +35,7 @@ export default defineConfig({
target: 'http://27.128.240.72:7865', target: 'http://27.128.240.72:7865',
// target: 'https://prev.ysaix.com:7868/prod-api/', // target: 'https://prev.ysaix.com:7868/prod-api/',
// target: 'http://36.134.181.164:7863', // target: 'http://36.134.181.164:7863',
// target: 'http://192.168.2.237:7865', // target: 'http://192.168.0.102:7865',
changeOrigin: true, changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '') rewrite: (p) => p.replace(/^\/dev-api/, '')
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "aix-win-ws", "name": "aix-win-ws",
"version": "2.5.16", "version": "2.5.8",
"description": "", "description": "",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "上海交大重庆人工智能研究院", "author": "上海交大重庆人工智能研究院",
@ -10,15 +10,14 @@
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
"start": "electron-vite preview", "start": "electron-vite preview",
"dev": "electron-vite dev", "dev": "electron-vite dev",
"build": "electron-vite build",
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"build:unpack": "npm run build && electron-builder --dir", "build:unpack": "npm run build && electron-builder --dir",
"build:dev": "npm run build && electron-builder --win --config ./electron-builder-test.yml", "build:dev": "npm run build && electron-builder --win --config ./electron-builder-test.yml",
"build:test": "node updatePackageJsonName.js && electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml", "build:test": "electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml",
"build:prod": "node updatePackageJsonName.js && electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml --win", "build:prod": "electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml",
"build:prod32": "node updatePackageJsonName.js && electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml --win --ia32", "build:yc": "electron-vite build --mode yc && electron-builder --win --config ./electron-builder-yc.yml",
"build:yc": "node updatePackageJsonName.js && electron-vite build --mode yc && electron-builder --win --config ./electron-builder-yc.yml", "build:yc2": "electron-vite build --mode yc2 && electron-builder --win --config ./electron-builder-yc2.yml",
"build:yc2": "node updatePackageJsonName.js && electron-vite build --mode yc2 && electron-builder --win --config ./electron-builder-yc2.yml",
"build:yy": "node updatePackageJsonName.js && electron-vite build --mode yy && electron-builder --win --config ./electron-builder-yy.yml",
"build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml", "build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml",
"build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml", "build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml",
"build:linux": "npm run build && electron-builder --linux" "build:linux": "npm run build && electron-builder --linux"
@ -37,14 +36,12 @@
"@electron/remote": "^2.1.2", "@electron/remote": "^2.1.2",
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
"@icon-park/vue-next": "^1.4.2", "@icon-park/vue-next": "^1.4.2",
"@kangc/v-md-editor": "^2.3.18",
"@tinymce/tinymce-vue": "5.1.1", "@tinymce/tinymce-vue": "5.1.1",
"@vitejs/plugin-vue-jsx": "^4.0.0", "@vitejs/plugin-vue-jsx": "^4.0.0",
"@vue-office/docx": "^1.6.2", "@vue-office/docx": "^1.6.2",
"@vue-office/excel": "^1.7.11", "@vue-office/excel": "^1.7.11",
"@vue-office/pdf": "^2.0.2", "@vue-office/pdf": "^2.0.2",
"@vueuse/core": "^10.11.0", "@vueuse/core": "^10.11.0",
"aix-plugins-aitools": "^1.1.5",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"circular-json": "^0.5.9", "circular-json": "^0.5.9",
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
@ -56,12 +53,14 @@
"electron-log": "^5.1.7", "electron-log": "^5.1.7",
"electron-store": "8.0.0", "electron-store": "8.0.0",
"electron-updater": "^6.1.7", "electron-updater": "^6.1.7",
"element-china-area-data": "^6.1.0",
"element-plus": "^2.8.0", "element-plus": "^2.8.0",
"fabric": "^5.3.0", "fabric": "^5.3.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"hfmath": "^0.0.2", "hfmath": "^0.0.2",
"html-to-image": "^1.11.11", "html-to-image": "^1.11.11",
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"im_electron_sdk": "^8.0.5904",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"jsencrypt": "^3.3.2", "jsencrypt": "^3.3.2",
"jsondiffpatch": "0.6.0", "jsondiffpatch": "0.6.0",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

View File

@ -13,34 +13,6 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
const appTempFilePath = userDataPath + '\\tempFile\\' const appTempFilePath = userDataPath + '\\tempFile\\'
let Spark = new SparkMD5.ArrayBuffer() let Spark = new SparkMD5.ArrayBuffer()
ipcMain.on('remove-local-file-list', (e, list) => {
let filePath = appRootFilePath
for (let i = 0; i < list.length; i++) {
let item = list[i];
if (!isAccess(filePath + item.fileNewName)) {
e.reply('remove-local-file-list-not', item)
continue
}
try {
fs.unlinkSync(filePath + item.fileNewName);
console.log(`${filePath} 已成功删除`);
} catch (err) {
console.error(`删除文件时出错:`, err);
e.reply('remove-local-file-list-error', item)
}
}
e.reply('remove-local-file-list-reply')
})
const isAccess = (filePath) => {
try {
fs.accessSync(filePath);
return true
} catch (err) {
return false
}
}
ipcMain.on('upload-file-change', (e, { id, fileNewName, cookie, fileType }) => { ipcMain.on('upload-file-change', (e, { id, fileNewName, cookie, fileType }) => {
let filePath = appRootFilePath + fileNewName let filePath = appRootFilePath + fileNewName
//执行更新,上传文件 //执行更新,上传文件
@ -86,6 +58,7 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
} }
//倒数十秒提交更改,十秒之内有继续修改则重置倒数 //倒数十秒提交更改,十秒之内有继续修改则重置倒数
uploadId = setTimeout(() => { uploadId = setTimeout(() => {
console.log(223)
//执行更新,上传文件 //执行更新,上传文件
let formData = new FormData() let formData = new FormData()
formData.append('id', id) formData.append('id', id)
@ -116,12 +89,8 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
function getFileMsg(path) { function getFileMsg(path) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try {
const stats = fs.statSync(path) const stats = fs.statSync(path)
resolve(stats.mtime.getTime()) return resolve(stats.mtime.getTime())
}catch (e) {
reject(e)
}
}) })
} }
@ -334,20 +303,17 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
}, },
onDownloadCancelled: async () => { onDownloadCancelled: async () => {
console.log("取消") console.log("取消")
resolve({type:"取消了下载"}) reject({type:"取消了下载"})
}, },
onDownloadInterrupted: async () => { onDownloadInterrupted: async () => {
console.log('中断') console.log('中断')
resolve({type:"下载被中断"}) reject({type:"下载被中断"})
}, },
onError: (err, data) => { onError: (err, data) => {
console.log(err.toString()) console.log(err.toString())
resolve({type:"下载出错",err}) reject({type:"下载出错",err})
} }
} }
}).catch(err=>{
console.log(err)
resolve({type:"下载出错",err})
}) })
}) })
} }
@ -359,11 +325,6 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
//下载文件 //下载文件
ipcMain.on('download-file-default', (e, { url, fileName }) => { ipcMain.on('download-file-default', (e, { url, fileName }) => {
console.log(url, fileName)
if (!url) {
e.reply('download-file-default' + fileName, false)
return;
}
createFolder('selfFile') createFolder('selfFile')
.then(async () => { .then(async () => {
const browserWindow = BrowserWindow.getFocusedWindow() const browserWindow = BrowserWindow.getFocusedWindow()
@ -399,7 +360,6 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
}) })
}) })
.catch((error) => { .catch((error) => {
console.log(error)
e.reply('download-file-default' + fileName, false) e.reply('download-file-default' + fileName, false)
}) })
}) })

View File

@ -4,7 +4,7 @@ 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 Logger from './logger' // 日志封装 import Logger from './logger' // 日志封装
// import chat from './chat' // chat封装 import chat from './chat' // chat封装
import Store from './store' // Store封装 import Store from './store' // Store封装
import updateInit from './update' import updateInit from './update'
@ -42,28 +42,12 @@ if(!gotTheLock){
} }
}) })
} }
let logoIco = "" let logoIco = import.meta.env.MODE==='yc'||import.meta.env.MODE==='yc2'?'../../resources/yc-logo.png':'../../resources/logo2.ico'
switch (import.meta.env.MODE) {
case 'yc':
logoIco = '../../resources/yc-logo.png'
break
case 'yc2':
logoIco = '../../resources/yc-logo.png'
break
case 'yy':
logoIco = '../../resources/yy-logo.png'
break
default:
logoIco = '../../resources/logo2.ico'
break
}
//登录窗口 //登录窗口
function createLoginWindow() { function createLoginWindow() {
if (loginWindow) return if (loginWindow) return
loginWindow = new BrowserWindow({ loginWindow = new BrowserWindow({
// width: import.meta.env.MODE==='yc'||import.meta.env.MODE==='yc2'?1060:888, width: import.meta.env.MODE==='yc'||import.meta.env.MODE==='yc2'?1060:888,
width: 1060,
height: 520, height: 520,
show: false, show: false,
frame: false, frame: false,
@ -260,13 +244,6 @@ app.on('ready', () => {
loginWindow.show() loginWindow.show()
loginWindow.focus() loginWindow.focus()
}) })
// 打印窗口
ipcMain.on('printPage', (event, printOptions) => {
//console.log("ipcMain-print-page")
mainWindow.webContents.print(printOptions, (success, failureReason) => {
if (!success) console.error(failureReason);
});
});
//打开作业窗口 //打开作业窗口
ipcMain.on('openWindow', (e, data) => { ipcMain.on('openWindow', (e, data) => {
@ -293,14 +270,14 @@ app.on('window-all-closed', () => {
// 监听全局事件 // 监听全局事件
function handleAll() { function handleAll() {
// const chatInstance = chat.initialize() // im-chat 实例 const chatInstance = chat.initialize() // im-chat 实例
// 新窗口创建-监听 // 新窗口创建-监听
ipcMain.handle('new-window', (e, data) => { ipcMain.handle('new-window', (e, data) => {
const { id, type } = data const { id, type } = data
const win = BrowserWindow.fromId(id) const win = BrowserWindow.fromId(id)
win.type = type // 绑定独立标识 win.type = type // 绑定独立标识
remote.enable(win.webContents) // 开启远程服务 remote.enable(win.webContents) // 开启远程服务
// chatInstance.enable(win.webContents) // 开启im-chat chatInstance.enable(win.webContents) // 开启im-chat
console.log(`主进程 [${type}]: 窗口注册-远程代理-完毕(${Date.now()})`) console.log(`主进程 [${type}]: 窗口注册-远程代理-完毕(${Date.now()})`)
}) })
// 用于监听-状态管理变化-同步所有窗口 // 用于监听-状态管理变化-同步所有窗口

View File

@ -1,10 +1,10 @@
import { contextBridge } from 'electron' import { contextBridge } from 'electron'
import { electronAPI } from '@electron-toolkit/preload' import { electronAPI } from '@electron-toolkit/preload'
// import TimRender from 'im_electron_sdk/dist/renderer' // im渲染部分实例 import TimRender from 'im_electron_sdk/dist/renderer' // im渲染部分实例
// Custom APIs for renderer // Custom APIs for renderer
const api = { const api = {
preloadPath: __dirname, // 当前preload地址 preloadPath: __dirname, // 当前preload地址
// getTimRender: () => new TimRender(), // im渲染部分实例 getTimRender: () => new TimRender(), // im渲染部分实例
} }
// Use `contextBridge` APIs to expose Electron APIs to // Use `contextBridge` APIs to expose Electron APIs to
// renderer only if context isolation is enabled, otherwise // renderer only if context isolation is enabled, otherwise

View File

@ -8,13 +8,12 @@
http-equiv="Content-Security-Policy" http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
/> --> /> -->
<meta http-equiv="Content-Security-Policy" content="connect-src * blob: data:; frame-src 'self' *; default-src 'self' https://wzyzoss.eos-chongqing-3.cmecloud.cn/; script-src 'self' 'unsafe-eval' http://www.wiris.net 'unsafe-inline'; script-src-elem 'self' https://sdk.amazonaws.com; style-src 'self' 'unsafe-inline' http://www.wiris.net; media-src * blob:;img-src * 'self' data: blob:;font-src 'self' http://www.wiris.net data:;" /> <meta http-equiv="Content-Security-Policy" content="connect-src * blob: data:; frame-src 'self' *; default-src 'self' https://wzyzoss.eos-chongqing-3.cmecloud.cn/; script-src 'self' 'unsafe-eval' http://www.wiris.net 'unsafe-inline'; style-src 'self' 'unsafe-inline' http://www.wiris.net; media-src * blob:;img-src * 'self' data: blob:;font-src 'self' http://www.wiris.net;" />
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<!-- <script src="https://sdk.amazonaws.com/js/aws-sdk-2.100.0.min.js"></script>-->
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
</body> </body>
</html> </html>

5430
src/renderer/public/aaa.pdf Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
<svg style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6511">
<path d="M512 34.133333c263.466667 0 477.866667 214.4 477.866667 477.866667S775.466667 989.866667 512 989.866667 34.133333 775.466667 34.133333 512 248.533333 34.133333 512 34.133333M512 0C229.333333 0 0 229.333333 0 512s229.333333 512 512 512 512-229.333333 512-512S794.666667 0 512 0z" fill="#87C1FF" p-id="6512"></path><path d="M505.173333 611.62666667c100.053333 0 181.333333-80.64 181.333334-180.053333 0-99.2-81.28-180.053333-181.333334-180.053334-100.053333 0-181.333333 80.64-181.333333 180.053334s81.28 180.053333 181.333333 180.053333zM579.84 661.54666667h-135.893333c-126.293333 0-229.12 102.4-229.12 228.053333v13.44c0 65.706667 101.12 65.706667 229.12 65.706667h135.893333c122.88 0 229.12 0 229.12-65.706667v-13.44c0-125.653333-102.826667-228.053333-229.12-228.053333z" fill="#87C1FF" p-id="6513"></path>
</svg>

Before

Width:  |  Height:  |  Size: 1006 B

View File

@ -1 +0,0 @@
<svg viewBox="0 0 58 44" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path id="path" d="M57.25 3.64C56.64 3.33 56.37 3.91 56.01 4.21C55.89 4.3 55.79 4.43 55.68 4.54C54.79 5.52 53.74 6.16 52.37 6.08C50.38 5.97 48.67 6.61 47.16 8.16C46.84 6.24 45.77 5.1 44.15 4.36C43.3 3.98 42.45 3.6 41.85 2.77C41.44 2.17 41.32 1.51 41.12 0.86C40.98 0.47 40.85 0.07 40.41 0C39.93 -0.07 39.74 0.34 39.55 0.68C38.8 2.09 38.5 3.64 38.53 5.2C38.6 8.73 40.06 11.54 42.96 13.54C43.29 13.76 43.38 13.99 43.27 14.33C43.08 15.02 42.84 15.68 42.63 16.37C42.5 16.81 42.3 16.91 41.84 16.72C40.25 16.04 38.87 15.04 37.65 13.82C35.59 11.79 33.72 9.54 31.39 7.78C30.85 7.37 30.3 6.99 29.73 6.63C27.36 4.28 30.05 2.35 30.67 2.12C31.32 1.88 30.89 1.06 28.79 1.06C26.69 1.07 24.77 1.79 22.31 2.75C21.96 2.89 21.58 3 21.19 3.08C18.97 2.65 16.66 2.56 14.24 2.83C9.7 3.35 6.07 5.54 3.4 9.27C0.19 13.76 -0.56 18.87 0.36 24.19C1.33 29.8 4.14 34.44 8.46 38.07C12.94 41.84 18.1 43.68 23.98 43.33C27.56 43.12 31.54 42.63 36.02 38.76C37.16 39.33 38.34 39.56 40.31 39.74C41.83 39.88 43.29 39.66 44.43 39.42C46.2 39.04 46.08 37.37 45.43 37.06C40.24 34.6 41.38 35.6 40.34 34.79C42.98 31.6 46.96 28.3 48.52 17.59C48.64 16.74 48.54 16.2 48.52 15.51C48.51 15.09 48.6 14.93 49.07 14.88C50.38 14.73 51.64 14.37 52.8 13.72C56.16 11.84 57.52 8.77 57.84 5.08C57.89 4.51 57.83 3.93 57.25 3.64ZM27.91 36.83C22.88 32.8 20.44 31.47 19.43 31.53C18.49 31.59 18.65 32.68 18.86 33.4C19.08 34.11 19.36 34.6 19.76 35.22C20.03 35.63 20.22 36.24 19.48 36.7C17.86 37.72 15.04 36.35 14.91 36.29C11.63 34.32 8.89 31.72 6.95 28.16C5.09 24.74 4 21.07 3.82 17.16C3.78 16.21 4.05 15.88 4.97 15.7C6.19 15.48 7.44 15.43 8.66 15.61C13.8 16.37 18.17 18.71 21.84 22.42C23.94 24.53 25.52 27.06 27.15 29.52C28.89 32.14 30.75 34.63 33.13 36.68C33.97 37.4 34.64 37.94 35.28 38.34C33.35 38.56 30.12 38.61 27.91 36.83ZM30.33 21.02C30.33 20.6 30.66 20.26 31.07 20.26C31.17 20.26 31.25 20.28 31.33 20.31C31.43 20.35 31.53 20.41 31.6 20.49C31.73 20.63 31.81 20.82 31.81 21.02C31.81 21.44 31.48 21.77 31.06 21.77C30.65 21.77 30.33 21.44 30.33 21.02ZM37.82 24.93C37.34 25.14 36.86 25.31 36.4 25.33C35.68 25.36 34.9 25.07 34.48 24.71C33.82 24.14 33.35 23.83 33.15 22.84C33.06 22.42 33.11 21.77 33.19 21.4C33.36 20.6 33.17 20.08 32.61 19.61C32.16 19.23 31.58 19.12 30.95 19.12C30.72 19.12 30.5 19.02 30.34 18.93C30.07 18.8 29.86 18.47 30.06 18.05C30.13 17.92 30.45 17.6 30.53 17.54C31.38 17.04 32.37 17.2 33.29 17.58C34.14 17.93 34.78 18.58 35.7 19.5C36.65 20.61 36.82 20.91 37.35 21.74C37.78 22.39 38.16 23.06 38.43 23.83C38.59 24.3 38.38 24.7 37.82 24.93Z" fill="#4D6BFE" fill-opacity="1.000000" fill-rule="nonzero"></path></svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,8 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body_1" width="96" height="97">
<g transform="matrix(1.3333334 0 0 1.3333334 0 0)">
<image x="0" y="0" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABhCAYAAAApxKSdAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAT2SURBVHhe7Z0/stowEMYp04UuZahSZqjSZYYmXQqKpEtBn+IxSZcm3ABuQG7wuAFH4AgcgSMQfcp7xDYf9uKVZOt5d+bXyJYt76c/K9mIkdlwbOyYOKaOmWPuWBRYOlaJwL2K90ZZUCaAMqKs2RoKj4daOx4dR8fJcc4MlPngwDNANIgEcXppqNW/HXA2e5iXBERB5eqFGGiyewcr6BDAs8MHyQ3qD9nxVbaOZC3iwZFjn54CdMPRDIOr1fpmMGgHbw244BAG2FDAV8FEQIRjzr+fICJYzdeBsbK1COb8MLRuCeb8cGDydtfyBmZ67EJGe+BTkWEdh13A0COaNVvXEw/4trYrwkyOZTTCgZVVahb1pAGhKW0F1veng7YCq/3pQFhaMiw3sBONeJQiIrwjZScZ8YDPL2bLzOmBzy9mL1jSA597Q0jEThgm48k/2LHw+EU6DAbs4LD48HAe/TydR7/O//m2jy0GPnWx+H/0aV12fJEfTpS3M55PD3zvJwXsYGvm8/m5yXa7Hc3bluPx+HTlehuPx+W87xfc8UW+H8t5wuEnZH8KCUFYLBZPj3vb9nvXvEneNkjuB9tut9f5vz5yp1d5M73Oqwefs/i3+Oxga1ILIK39kwnpz9HPM4dXQUup5tXjBQg+B0gpgKr2A3QvzOFV4gjg5wJZC4DrSIzWfiDtgt7NeX4dXoDgi3CpBIBTJXaz9oOPK+7wKq+jhKPwfb4CwLESm81qwshXLiqqxv9VPtcIqCNfAaS1X3SfulaAQRoisXx68hVAWvtRFpb/Ama6xRaAQRl8cWNDnIG3iBeAHVCRQgBJ6IlzWN4S6NshQrxa3gRNVBFbAMn1YY21vx/QRBWxBQhW+/sBTVQRU4AXVvsBTVQRUwDka7KMaj+giSpiCSANPafTKAtnsaCJKmIJIAk9VysX05O8PYYmqoghgKT2bzYbmrfn0EQVMQSoq/2Hw8Hfk+XLAJqoQiLA6XTyIkjB+beMnQ/W63UO4wFNVCERIKWh9dxcju4emqiibwLAEJr2tDXQRBV9FACGbqyHLYEmquhagLqlCowNrMwdQhNVdCkAnI+5QJ3VvqBJD01U0aUAuHeTAD1rBTRRRVcCLJdLf/8mATAWVMvcITRRRUoB4EzMgIuDa5MAsB4NxjRRhUQAzF7RF7cFIeXVZ4ZPSATANVjeDqCJKiQCxOyHTQAT4B5oogoT4C5oogoT4C5oogoT4C5oooquBcB8oMlMgIgCSO5vApgAz+T5bWgdGQmQ78e5dZgAJoAUE6BjvABZ/0aMkZEA+f9Ij5GbANn/ULtKRgLsHCZAh/gfagffK8IEEOP3igi+W4oJIMbvloI9a9jB1pgAYvzGfdi1iR004nPZwNX2jEvPZc84WPC5gNGInwM8m+0bmp7SvqG2cV96sFtxybCfMTvRCI9fhKta8AmZcRMf/1cNIZFFQ/FB7b/5r0rWCuLjlx9uGVpB8Bc0xgXa91fNIqJ40L6f2cbBLmC0Bz4VG7oiC0vDIep6qmb/qhSG2qinyZDRQtP2qJz/bNYS2gGfXS03tDUT4T6C1Pyq4YLBd1p/gWCZ+fKiJYbZbJmDsbK0xBzT0BqCf86SMaj1wbsciWHWPOS3aXh2/2K9a4P6mOkNYfKGARbdcLAIJ7RBDHzqgkJi0IYoOc4lUGY4G8+AyoV1nMCD62j0F2POfFZ8DMaTAAAAAElFTkSuQmCC" preserveAspectRatio="none" width="72" height="72.75"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 220 KiB

File diff suppressed because one or more lines are too long

View File

@ -38,12 +38,12 @@ export class Classcourse {
if (isCourse) { if (isCourse) {
// 连接socket // 连接socket
ChatWs.id = classcourse.timgroupid // 群组id ChatWs.id = classcourse.timgroupid // 群组id
// if (!ChatWs.ws) { if (!ChatWs.ws) {
// ChatWs.init().then(_ => { ChatWs.init().then(_ => {
// isPublic && ChatWs.sendMsg('open', {id: classcourse.id}) isPublic && ChatWs.sendMsg('open', {id: classcourse.id})
// // isPublic && console.log('socket-开课消息-已发送') // isPublic && console.log('socket-开课消息-已发送')
// }) })
// } }
this.classcourse = classcourse // 课堂信息 this.classcourse = classcourse // 课堂信息
this.id = classcourse.id // 课堂id this.id = classcourse.id // 课堂id
// 如果课堂信息有paging则更新当前页码 // 如果课堂信息有paging则更新当前页码

View File

@ -1,47 +0,0 @@
export default class gridPic {
private static Instance: gridPic | null = null;
private gridPicRef: any = null;
constructor(elRef?: any) {
if (elRef) {
this.gridPicRef = elRef;
}
if (!gridPic.Instance) {
gridPic.Instance = this;
}
return gridPic.Instance;
}
// 初始化
init(elRef) {
if (elRef) {
this.gridPicRef = elRef;
}
return this;
}
addPIc(data) {
if (this.gridPicRef && this.gridPicRef.value && typeof this.gridPicRef.value.addPic === 'function') {
this.gridPicRef.value.addPic(data);
}
return this;
}
// 静态方法 - 初始化
static init(elRef) {
if (!gridPic.Instance) {
gridPic.Instance = new gridPic(elRef);
} else {
gridPic.Instance.init(elRef);
}
return gridPic.Instance;
}
// 静态方法 - 打开推图上屏幕
static addPIc(data) {
if (gridPic.Instance) {
return gridPic.Instance.addPIc(data);
}
return null;
}
}

View File

@ -97,30 +97,14 @@ export class PPTApi {
}) })
} }
/**
* @description slide
* @param slides
* @param slideAll
* @returns
*/
static async addSlideServer(slides: object[], slideAll: object[]) {
const resource = sessionStore.get('curr.resource')||{}
for(const slide of slides){
slide.id = resource.id // 覆盖默认随机id
await this.addSlide(slide)
}
await this.batchUpdateSlides(slideAll, true) // 批量更新-排序
return PPTApi.getSlideList(resource.id) // 更新幻灯片列表以及活动相关
}
// 新增幻灯片 // 新增幻灯片
static addSlide(data: object): Promise<Boolean> { static addSlide(data: object): Promise<Boolean> {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const enpt = sessionStore.get('curr.entp')||{} const enpt = sessionStore.get('curr.entp')||{}
// const resource = sessionStore.get('curr.resource')||{} const resource = sessionStore.get('curr.resource')||{}
const {id, ...content} = data const {id, ...content} = data
const params = { const params = {
parentid: id, parentid: resource.id,
entpid: userStore.user.deptId, entpid: userStore.user.deptId,
entpcourseid: enpt.id, entpcourseid: enpt.id,
ppttype: 'file', ppttype: 'file',
@ -142,7 +126,7 @@ export class PPTApi {
// msgUtils.msgSuccess('新增成功') // msgUtils.msgSuccess('新增成功')
this.isUpdate = false // 新增后会触发监听,不再更新数据 this.isUpdate = false // 新增后会触发监听,不再更新数据
resolve(true) resolve(true)
} else msgUtils.msgError('新增失败');reject(false) } else msgUtils.msgError('新增失败');resolve(false)
}) })
} }
/** /**
@ -163,8 +147,12 @@ export class PPTApi {
const currInd = toRaw(slidesStore.slideIndex) // 当前页索引-new const currInd = toRaw(slidesStore.slideIndex) // 当前页索引-new
const oldInd = oldData.findIndex(o => o.id == currentSlide.id) // 当前页索引-old const oldInd = oldData.findIndex(o => o.id == currentSlide.id) // 当前页索引-old
const isBatch = oldVal && oldVal.length && currInd != oldInd // 是否批量更新-排序 const isBatch = oldVal && oldVal.length && currInd != oldInd // 是否批量更新-排序
if (isAdd) return // 新增-这里不处理 状态管理-处理 if (isAdd) { // 新增的幻灯片(id 为非数字,说明是新增的幻灯片)
// 防抖-更新 const bool = await this.addSlide(currentSlide)
bool && await this.batchUpdateSlides(newData, true) // 批量更新-排序
const resource = sessionStore.get('curr.resource')||{}
await PPTApi.getSlideList(resource.id)
} else { // 防抖-更新
if (!this.isUpdate) return this.isUpdate = true // 下次更新数据 if (!this.isUpdate) return this.isUpdate = true // 下次更新数据
if (isBatch) { // 批量更新-排序 if (isBatch) { // 批量更新-排序
this.batchUpdateSlides(newData, true) this.batchUpdateSlides(newData, true)
@ -176,6 +164,7 @@ export class PPTApi {
Utils.mxThrottle(() => {this.updateSlide(params)}, 200, 2) Utils.mxThrottle(() => {this.updateSlide(params)}, 200, 2)
} }
} }
}
// 更新幻灯片 isThum 是否更新缩略图 // 更新幻灯片 isThum 是否更新缩略图
static updateSlide(data: object, isThum = true): Promise<Boolean> { static updateSlide(data: object, isThum = true): Promise<Boolean> {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
@ -285,7 +274,6 @@ export class PPTApi {
static toRousrceUrl =async (o:any) => { static toRousrceUrl =async (o:any) => {
const formData = new FormData() const formData = new FormData()
formData.append('file', o) formData.append('file', o)
formData.append('ral', true)
const res = await Api_server.Other.uploadFile(formData) const res = await Api_server.Other.uploadFile(formData)
if (res && res.code == 200){ if (res && res.code == 200){
const url = res?.url const url = res?.url

View File

@ -132,8 +132,6 @@ export class MsgEnum {
MSG_dz : 'dz', MSG_dz : 'dz',
/** @desc: 疑惑 */ /** @desc: 疑惑 */
MSG_yh : 'yh', MSG_yh : 'yh',
/** @desc: 推图片上屏 */
MSG_pushSreen_ImgList : 'pushSreen_ImgList',
// === 新定义-消息头 === // === 新定义-消息头 ===
/** @desc: 课程创建-待开课 */ /** @desc: 课程创建-待开课 */
MSG_0000: 0x0000, MSG_0000: 0x0000,

View File

@ -2,7 +2,7 @@
* @description * @description
*/ */
import { watch, render } from 'vue' import { watch } from 'vue'
import { PPTApi } from './index' import { PPTApi } from './index'
import * as store from '../store' import * as store from '../store'
import { sessionStore } from '@/utils/store' // electron-store 状态管理 import { sessionStore } from '@/utils/store' // electron-store 状态管理
@ -12,10 +12,9 @@ import Classcourse from './classcourse' // 课程相关
import msgUtils from '@/plugins/modal' // 消息工具 import msgUtils from '@/plugins/modal' // 消息工具
import * as dialogUtils from '@/utils/dialog' // 弹窗-函数 import * as dialogUtils from '@/utils/dialog' // 弹窗-函数
import { Homework } from './index' // api-作业相关 import { Homework } from './index' // api-作业相关
import emitter from '@/utils/mitt' //mitt 事件总线 // import emitter from '@/utils/mitt' //mitt 事件总线
import useExecPlay from '../views/Screen/hooks/useExecPlay' // 播放控制 import useExecPlay from '../views/Screen/hooks/useExecPlay' // 播放控制
import hooksUpvote from './upvote' // 点赞-工具 import hooksUpvote from './upvote' // 点赞-工具
import gridPic from './gridPic' // 上屏-工具
/** /**
* @description * @description
@ -99,8 +98,6 @@ export default () => {
} }
break break
case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页 case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页
render(null, document.body) //移除弹窗
emitter.emit('closegridPic') //如果有推图片窗口 就关闭
const slideIndex = content?.current || 0 const slideIndex = content?.current || 0
const type = content?.animation // 上下动作 const type = content?.animation // 上下动作
const steps = content?.animationSteps // 动画步骤 const steps = content?.animationSteps // 动画步骤
@ -131,10 +128,6 @@ export default () => {
case MsgEnum.HEADS.MSG_yh: // 疑惑 case MsgEnum.HEADS.MSG_yh: // 疑惑
hooksUpvote.trigger(2) hooksUpvote.trigger(2)
break break
case MsgEnum.HEADS.MSG_pushSreen_ImgList: // 推图片上屏
const imgArray = content.ImgList.map((obj) => obj.url);
emitter.emit('opengridPic',{arr:imgArray}) // 打开推图片上屏窗口
break
case MsgEnum.HEADS.MSG_0010: // 备用 case MsgEnum.HEADS.MSG_0010: // 备用
break break
default: default:

View File

@ -1,8 +1,6 @@
import { ref } from 'vue' import { ref } from 'vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
// import { parse, type Shape, type Element, type ChartItem } from 'pptxtojson' import { parse, type Shape, type Element, type ChartItem } from 'pptxtojson'
// import { parse, utils, fill as fillUtil } from '@/plugins/pptTojson'
import { parse, fill as fillUtil, type Shape, type Element, type ChartItem } from '@/plugins/pptTojson'
import { nanoid } from 'nanoid' import { nanoid } from 'nanoid'
import { useSlidesStore } from '../store' import { useSlidesStore } from '../store'
import { decrypt } from '../utils/crypto' import { decrypt } from '../utils/crypto'
@ -11,7 +9,6 @@ import useAddSlidesOrElements from '../hooks/useAddSlidesOrElements'
import useSlideHandler from '../hooks/useSlideHandler' import useSlideHandler from '../hooks/useSlideHandler'
import message from '../utils/message' import message from '../utils/message'
import { getSvgPathRange } from '../utils/svgPathParser' import { getSvgPathRange } from '../utils/svgPathParser'
import { calculatePathDimensions } from '@/utils/ppt/svgUtils'
import type { import type {
Slide, Slide,
TableCellStyle, TableCellStyle,
@ -78,18 +75,57 @@ const parseLineElement = (el: Shape) => {
return data return data
} }
export default () => {
// PPT json二次加工处理 const exporting = ref(false)
const parsePptJsonSlides = (slides: Slide[]|any, zip) => {
return new Promise(async (resolve, reject) => { // 导入pptist文件
const importSpecificFile = (files: FileList, cover = false) => {
const file = files[0]
const reader = new FileReader()
reader.addEventListener('load', () => {
try { try {
const slides = JSON.parse(decrypt(reader.result as string))
if (cover) {
slidesStore.updateSlideIndex(0)
slidesStore.setSlides(slides)
}
else if (isEmptySlide.value) slidesStore.setSlides(slides)
else addSlidesFromData(slides)
}
catch {
message.error('无法正确读取 / 解析该文件')
}
})
reader.readAsText(file)
}
// 导入PPTX文件
const importPPTXFile = (files: FileList) => {
const file = files[0]
if (!file) return
exporting.value = true
const shapeList: ShapePoolItem[] = [] const shapeList: ShapePoolItem[] = []
for (const item of SHAPE_LIST) { for (const item of SHAPE_LIST) {
shapeList.push(...item.children) shapeList.push(...item.children)
} }
const reader = new FileReader()
reader.onload = async e => {
const json = await parse(e.target!.result as ArrayBuffer)
const ratio = 96 / 72 const ratio = 96 / 72
const newSlides: Slide[] = [] const width = json.size.width
for (const item of slides) {
slidesStore.setViewportSize(width * ratio)
const slides: Slide[] = []
for (const item of json.slides) {
const { type, value } = item.fill const { type, value } = item.fill
let background: SlideBackground let background: SlideBackground
if (type === 'image') { if (type === 'image') {
@ -127,7 +163,7 @@ const parsePptJsonSlides = (slides: Slide[]|any, zip) => {
background, background,
} }
const parseElements = async (elements: Element[]) => { const parseElements = (elements: Element[]) => {
for (const el of elements) { for (const el of elements) {
const originWidth = el.width || 1 const originWidth = el.width || 1
const originHeight = el.height || 1 const originHeight = el.height || 1
@ -183,7 +219,6 @@ const parsePptJsonSlides = (slides: Slide[]|any, zip) => {
rotate: el.rotate, rotate: el.rotate,
flipH: el.isFlipH, flipH: el.isFlipH,
flipV: el.isFlipV, flipV: el.isFlipV,
zipPath: el.zipPath,
}) })
} }
else if (el.type === 'audio') { else if (el.type === 'audio') {
@ -200,7 +235,6 @@ const parsePptJsonSlides = (slides: Slide[]|any, zip) => {
color: theme.value.themeColor, color: theme.value.themeColor,
loop: false, loop: false,
autoplay: false, autoplay: false,
zipPath: el.zipPath,
}) })
} }
else if (el.type === 'video') { else if (el.type === 'video') {
@ -214,7 +248,6 @@ const parsePptJsonSlides = (slides: Slide[]|any, zip) => {
top: el.top, top: el.top,
rotate: 0, rotate: 0,
autoplay: false, autoplay: false,
zipPath: el.zipPath,
}) })
} }
else if (el.type === 'shape') { else if (el.type === 'shape') {
@ -292,34 +325,6 @@ const parsePptJsonSlides = (slides: Slide[]|any, zip) => {
element.viewBox = [maxX || originWidth, maxY || originHeight] element.viewBox = [maxX || originWidth, maxY || originHeight]
} }
} }
// auth: zdg
if (el.fill) {
const { type, ...opt } = el.fill
if (type === 'gradient') { // 线性渐变色
element.gradient = {
type: 'linear',
colors: opt.colors.map(item => ({
...item,
pos: parseInt(item.pos),
})),
rotate: opt.rot,
}
} else if (type == 'image') { // 背景图填充
const pathPos = calculatePathDimensions(element.path)
const url = opt.picBase64 || (!!zip ? await fillUtil.getPicFillBase64(opt.zipPath, zip) : '')
element.gradient = {
type: 'image',
image: {
src: url,
width: opt.w||el.width,
height: opt.h||el.height,
path_W: Math.round(pathPos.width), // 获取path 的宽高
path_h: Math.round(pathPos.height), // 获取path 的宽高
...opt
}
}
}
}
if (element.path) slide.elements.push(element) if (element.path) slide.elements.push(element)
} }
@ -463,91 +468,18 @@ const parsePptJsonSlides = (slides: Slide[]|any, zip) => {
}) })
} }
else if (el.type === 'group' || el.type === 'diagram') { else if (el.type === 'group' || el.type === 'diagram') {
const elements = el.elements.map(_el => { const elements = el.elements.map(_el => ({
const isGroup = el.type === 'group' // 子级是否为分组
const isFlipH = !!(_el.isFlipH ^ el.isFlipH) // 水平翻转(分组有值进行异或运算)
const isFlipV = !!(_el.isFlipV ^ el.isFlipV) // 垂直翻转(分组有值进行异或运算)
const isPleft = el.isFlipH_def // 是否父级翻转-改变子元素坐标left
const isPtop = el.isFlipV_def // 是否父级翻转-改变子元素坐标top
const left = originLeft + (isPleft ? originWidth - _el.left - _el.width : _el.left)
const top = originTop + (isPtop ? originHeight - _el.top - _el.height : _el.top)
return {
..._el, ..._el,
left, left: _el.left + originLeft,
top, top: _el.top + originTop,
isFlipH, }))
isFlipV, parseElements(elements)
isFlipH_def: _el.isFlipH, // 保留默认
isFlipV_def: _el.isFlipV, // 保留默认
}
})
await parseElements(elements)
} }
} }
} }
// 设置默认翻转默认属性 parseElements(item.elements)
item.elements.forEach(o => { o.isFlipH_def = o.isFlipH; o.isFlipV_def = o.isFlipV }) slides.push(slide)
item.bgElements.forEach(o => { o.isFlipH_def = o.isFlipH; o.isFlipV_def = o.isFlipV })
item.bgElements.length && await parseElements(item.bgElements) // 加载当前幻灯片对应的母版
item.elements.length && await parseElements(item.elements) // 加载当前幻灯片
newSlides.push(slide)
} }
resolve(newSlides)
} catch (error) {
reject(error)
}
})
}
export default () => {
const exporting = ref(false)
// 导入pptist文件
const importSpecificFile = (files: FileList, cover = false) => {
const file = files[0]
const reader = new FileReader()
reader.addEventListener('load', () => {
try {
const slides = JSON.parse(decrypt(reader.result as string))
if (cover) {
slidesStore.updateSlideIndex(0)
slidesStore.setSlides(slides)
}
else if (isEmptySlide.value) slidesStore.setSlides(slides)
else addSlidesFromData(slides)
}
catch {
message.error('无法正确读取 / 解析该文件')
}
})
reader.readAsText(file)
}
// 导入PPTX文件
const importPPTXFile = (files: FileList) => {
const file = files[0]
if (!file) return
exporting.value = true
const shapeList: ShapePoolItem[] = []
for (const item of SHAPE_LIST) {
shapeList.push(...item.children)
}
const reader = new FileReader()
reader.onload = async e => {
const json = await parse(e.target!.result as ArrayBuffer)
const ratio = 96 / 72
const width = json.size.width
slidesStore.setViewportSize(width * ratio)
// json数据二次加工
const slides = await parsePptJsonSlides(json.slides, json.zip)
slidesStore.updateSlideIndex(0) slidesStore.updateSlideIndex(0)
slidesStore.setSlides(slides) slidesStore.setSlides(slides)
exporting.value = false exporting.value = false
@ -597,9 +529,7 @@ export const PPTXFileToJson = (data: File|ArrayBuffer) => {
} }
// 开始解析 // 开始解析
const json = await parse(fileArrayBuffer).catch((err) => { const json = await parse(fileArrayBuffer)
reject(err)
})
const ratio = 96 / 72 const ratio = 96 / 72
const width = json.size.width const width = json.size.width
@ -607,7 +537,365 @@ export const PPTXFileToJson = (data: File|ArrayBuffer) => {
resData.def = json // 保留原始数据 resData.def = json // 保留原始数据
resData.width = width * ratio resData.width = width * ratio
resData.ratio = slidesStore.viewportRatio resData.ratio = slidesStore.viewportRatio
resData.slides = await parsePptJsonSlides(json.slides, json.zip)
const slides: Slide[] = []
for (const item of json.slides) {
const { type, value } = item.fill
let background: SlideBackground
if (type === 'image') {
background = {
type: 'image',
image: {
src: value.picBase64,
size: 'cover',
},
}
}
else if (type === 'gradient') {
background = {
type: 'gradient',
gradient: {
type: 'linear',
colors: value.colors.map(item => ({
...item,
pos: parseInt(item.pos),
})),
rotate: value.rot,
},
}
}
else {
background = {
type: 'solid',
color: value,
}
}
const slide: Slide = {
id: nanoid(10),
elements: [],
background,
}
const parseElements = (elements: Element[]) => {
for (const el of elements) {
const originWidth = el.width || 1
const originHeight = el.height || 1
const originLeft = el.left
const originTop = el.top
el.width = el.width * ratio
el.height = el.height * ratio
el.left = el.left * ratio
el.top = el.top * ratio
if (el.type === 'text') {
const textEl: PPTTextElement = {
type: 'text',
id: nanoid(10),
width: el.width,
height: el.height,
left: el.left,
top: el.top,
rotate: el.rotate,
defaultFontName: theme.value.fontName,
defaultColor: theme.value.fontColor,
content: convertFontSizePtToPx(el.content, ratio),
lineHeight: 1,
outline: {
color: el.borderColor,
width: el.borderWidth,
style: el.borderType,
},
fill: el.fillColor,
vertical: el.isVertical,
}
if (el.shadow) {
textEl.shadow = {
h: el.shadow.h * ratio,
v: el.shadow.v * ratio,
blur: el.shadow.blur * ratio,
color: el.shadow.color,
}
}
slide.elements.push(textEl)
}
else if (el.type === 'image') {
slide.elements.push({
type: 'image',
id: nanoid(10),
src: el.src,
width: el.width,
height: el.height,
left: el.left,
top: el.top,
fixedRatio: true,
rotate: el.rotate,
flipH: el.isFlipH,
flipV: el.isFlipV,
})
}
else if (el.type === 'audio') {
slide.elements.push({
type: 'audio',
id: nanoid(10),
src: el.blob,
width: el.width,
height: el.height,
left: el.left,
top: el.top,
rotate: 0,
fixedRatio: false,
color: theme.value.themeColor,
loop: false,
autoplay: false,
})
}
else if (el.type === 'video') {
slide.elements.push({
type: 'video',
id: nanoid(10),
src: (el.blob || el.src)!,
width: el.width,
height: el.height,
left: el.left,
top: el.top,
rotate: 0,
autoplay: false,
})
}
else if (el.type === 'shape') {
if (el.shapType === 'line' || /Connector/.test(el.shapType)) {
// 从返回对象中解构出 xx 函数并调用
const lineElement = parseLineElement(el)
slide.elements.push(lineElement)
}
else {
const shape = shapeList.find(item => item.pptxShapeType === el.shapType)
const vAlignMap: { [key: string]: ShapeTextAlign } = {
'mid': 'middle',
'down': 'bottom',
'up': 'top',
}
const element: PPTShapeElement = {
type: 'shape',
id: nanoid(10),
width: el.width,
height: el.height,
left: el.left,
top: el.top,
viewBox: [200, 200],
path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',
fill: el.fillColor || 'none',
fixedRatio: false,
rotate: el.rotate,
outline: {
color: el.borderColor,
width: el.borderWidth,
style: el.borderType,
},
text: {
content: convertFontSizePtToPx(el.content, ratio),
defaultFontName: theme.value.fontName,
defaultColor: theme.value.fontColor,
align: vAlignMap[el.vAlign] || 'middle',
},
flipH: el.isFlipH,
flipV: el.isFlipV,
}
if (el.shadow) {
element.shadow = {
h: el.shadow.h * ratio,
v: el.shadow.v * ratio,
blur: el.shadow.blur * ratio,
color: el.shadow.color,
}
}
if (shape) {
element.path = shape.path
element.viewBox = shape.viewBox
if (shape.pathFormula) {
element.pathFormula = shape.pathFormula
element.viewBox = [el.width, el.height]
const pathFormula = SHAPE_PATH_FORMULAS[shape.pathFormula]
if ('editable' in pathFormula && pathFormula.editable) {
element.path = pathFormula.formula(el.width, el.height, pathFormula.defaultValue)
element.keypoints = pathFormula.defaultValue
}
else element.path = pathFormula.formula(el.width, el.height)
}
}
if (el.shapType === 'custom') {
if (el.path!.indexOf('NaN') !== -1) element.path = ''
else {
element.special = true
element.path = el.path!
const { maxX, maxY } = getSvgPathRange(element.path)
element.viewBox = [maxX || originWidth, maxY || originHeight]
}
}
if (element.path) slide.elements.push(element)
}
}
else if (el.type === 'table') {
const row = el.data.length
const col = el.data[0].length
const style: TableCellStyle = {
fontname: theme.value.fontName,
color: theme.value.fontColor,
}
const data: TableCell[][] = []
for (let i = 0; i < row; i++) {
const rowCells: TableCell[] = []
for (let j = 0; j < col; j++) {
const cellData = el.data[i][j]
let textDiv: HTMLDivElement | null = document.createElement('div')
textDiv.innerHTML = cellData.text
const p = textDiv.querySelector('p')
const align = p?.style.textAlign || 'left'
const span = textDiv.querySelector('span')
const fontsize = span?.style.fontSize ? (parseInt(span?.style.fontSize) * ratio).toFixed(1) + 'px' : ''
const fontname = span?.style.fontFamily || ''
const color = span?.style.color || cellData.fontColor
rowCells.push({
id: nanoid(10),
colspan: cellData.colSpan || 1,
rowspan: cellData.rowSpan || 1,
text: textDiv.innerText,
style: {
...style,
align: ['left', 'right', 'center'].includes(align) ? (align as 'left' | 'right' | 'center') : 'left',
fontsize,
fontname,
color,
bold: cellData.fontBold,
backcolor: cellData.fillColor,
},
})
textDiv = null
}
data.push(rowCells)
}
const colWidths: number[] = new Array(col).fill(1 / col)
slide.elements.push({
type: 'table',
id: nanoid(10),
width: el.width,
height: el.height,
left: el.left,
top: el.top,
colWidths,
rotate: 0,
data,
outline: {
width: el.borderWidth || 2,
style: el.borderType,
color: el.borderColor || '#eeece1',
},
cellMinHeight: 36,
})
}
else if (el.type === 'chart') {
let labels: string[]
let legends: string[]
let series: number[][]
if (el.chartType === 'scatterChart' || el.chartType === 'bubbleChart') {
labels = el.data[0].map((item, index) => `坐标${index + 1}`)
legends = ['X', 'Y']
series = el.data
}
else {
const data = el.data as ChartItem[]
labels = Object.values(data[0].xlabels)
legends = data.map(item => item.key)
series = data.map(item => item.values.map(v => v.y))
}
const options: ChartOptions = {}
let chartType: ChartType = 'bar'
switch (el.chartType) {
case 'barChart':
case 'bar3DChart':
chartType = 'bar'
if (el.barDir === 'bar') chartType = 'column'
if (el.grouping === 'stacked' || el.grouping === 'percentStacked') options.stack = true
break
case 'lineChart':
case 'line3DChart':
if (el.grouping === 'stacked' || el.grouping === 'percentStacked') options.stack = true
chartType = 'line'
break
case 'areaChart':
case 'area3DChart':
if (el.grouping === 'stacked' || el.grouping === 'percentStacked') options.stack = true
chartType = 'area'
break
case 'scatterChart':
case 'bubbleChart':
chartType = 'scatter'
break
case 'pieChart':
case 'pie3DChart':
chartType = 'pie'
break
case 'radarChart':
chartType = 'radar'
break
case 'doughnutChart':
chartType = 'ring'
break
default:
}
slide.elements.push({
type: 'chart',
id: nanoid(10),
chartType: chartType,
width: el.width,
height: el.height,
left: el.left,
top: el.top,
rotate: 0,
themeColors: [theme.value.themeColor],
textColor: theme.value.fontColor,
data: {
labels,
legends,
series,
},
options,
})
}
else if (el.type === 'group' || el.type === 'diagram') {
const elements = el.elements.map(_el => ({
..._el,
left: _el.left + originLeft,
top: _el.top + originTop,
}))
parseElements(elements)
}
}
}
parseElements(item.elements)
slides.push(slide)
}
resData.slides = slides
resolve(resData) resolve(resData)
}) })
} }

View File

@ -1,6 +1,5 @@
import { useScreenStore, useSlidesStore, useClasscourseStore } from '../store' import { useScreenStore, useSlidesStore, useClasscourseStore } from '../store'
import { enterFullscreen, exitFullscreen, isFullscreen } from '../utils/fullscreen' import { enterFullscreen, exitFullscreen, isFullscreen } from '../utils/fullscreen'
import { sessionStore } from '@/utils/store' // electron-store 状态管理
import ChatWs from '@/plugins/socket' // 聊天socket import ChatWs from '@/plugins/socket' // 聊天socket
export default () => { export default () => {
@ -26,9 +25,6 @@ export default () => {
if (!!classcourse) { //DOTO 有课堂,执行退相关操作 if (!!classcourse) { //DOTO 有课堂,执行退相关操作
console.log('退出放映状态') console.log('退出放映状态')
ChatWs?.close() // 关闭ws ChatWs?.close() // 关闭ws
sessionStore.delete('curr.classcourse') // 清除课堂信息
sessionStore.delete('curr.resource') // 清除课件信息
sessionStore.delete('curr.isPublic') // 清除公屏状态
setTimeout(() => { setTimeout(() => {
window.close() // 关闭窗口 window.close() // 关闭窗口
}, 1000) }, 1000)

View File

@ -148,8 +148,7 @@ export const useSlidesStore = defineStore('slides', {
this.workItem = list this.workItem = list
}, },
async addSlide(slide: Slide | Slide[]) { addSlide(slide: Slide | Slide[]) {
const { PPTApi } = await import('../api/index')
const slides = Array.isArray(slide) ? slide : [slide] const slides = Array.isArray(slide) ? slide : [slide]
for (const slide of slides) { for (const slide of slides) {
if (slide.sectionTag) delete slide.sectionTag if (slide.sectionTag) delete slide.sectionTag
@ -157,8 +156,6 @@ export const useSlidesStore = defineStore('slides', {
const addIndex = this.slideIndex + 1 const addIndex = this.slideIndex + 1
this.slides.splice(addIndex, 0, ...slides) this.slides.splice(addIndex, 0, ...slides)
this.slideIndex = addIndex this.slideIndex = addIndex
// 添加到服务器
PPTApi.addSlideServer(slides, this.slides)
}, },
updateSlide(props: Partial<Slide>, slideId?: string) { updateSlide(props: Partial<Slide>, slideId?: string) {
const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex

View File

@ -41,7 +41,7 @@ export const enum ElementTypes {
* *
* rotate: 渐变角度线 * rotate: 渐变角度线
*/ */
export type GradientType = 'linear' | 'radial' | 'image' export type GradientType = 'linear' | 'radial'
export type GradientColor = { export type GradientColor = {
pos: number pos: number
color: string color: string

View File

@ -5,21 +5,14 @@
</header> </header>
<div class="flex material-list" v-loading="loading"> <div class="flex material-list" v-loading="loading">
<div class="flex material-item" v-for="item in list" :key="item.id" > <div class="flex material-item" v-for="item in list" :key="item.id" >
<div class="flex material-item"> <div class="flex">
<el-image v-if="item.fileType.indexOf('image')!=-1" :src="fileUrl(item)" class="img" /> <el-image :src="fileUrl(item)" class="img" />
<svg v-if="item.fileType.indexOf('video')!=-1" class="icon file-icon" aria-hidden="true" :style="{ 'font-size': 100 + 'px' }"> <el-text truncated>{{ item.fileShowName }}</el-text>
<use :xlink:href="'#icon-video'"></use>
</svg>
<svg class="icon file-icon" v-if="item.fileType.indexOf('audio')!=-1" aria-hidden="true" :style="{ 'font-size': 100 + 'px' }">
<use :xlink:href="'#icon-mp'"></use>
</svg>
<div class="texts">{{ item.fileShowName }}</div>
<!-- <el-text truncated>{{ item.fileShowName }}</el-text> -->
</div> </div>
<el-button style="margin-left: 10px;" type="primary" @click="onInsert(item)">插入</el-button> <el-button type="primary" @click="onInsert(item)">插入</el-button>
</div> </div>
<el-empty description="暂无素材" v-if="!list.length" /> <el-empty description="暂无素材" v-if="!list.length" />
</div> </div>
</template> </template>
<script setup> <script setup>
@ -44,7 +37,7 @@ let params = {
pageSize: 500 pageSize: 500
} }
const suffixAry = [ 'jpeg','jpg','png','gif','mp3','mp4','avi','mov',"wav"] const suffixAry = [ 'jpeg','jpg','png','gif','mp3','mp4','avi','mov']
const videoSuffix = ['mp3','mp4','avi','mov'] const videoSuffix = ['mp3','mp4','avi','mov']
const list = ref([]) const list = ref([])
const loading = ref(false) const loading = ref(false)
@ -55,7 +48,6 @@ const init = () => {
if(res.rows && res.rows.length){ if(res.rows && res.rows.length){
// //
list.value = res.rows.filter( item => suffixAry.indexOf(getFileSuffix(item.fileShowName)) != -1) list.value = res.rows.filter( item => suffixAry.indexOf(getFileSuffix(item.fileShowName)) != -1)
console.log(list.value)
} }
}) })
} }
@ -72,19 +64,16 @@ const fileUrl = computed(() => (item) =>{
// //
const onInsert = async (item) =>{ const onInsert = async (item) =>{
loading.value = true loading.value = true
const res = await fetch(item.fileFullPath)
const bolb = await res.blob()
const file = commUtils.blobToFile(bolb, item.fileShowName)
// const res = await fetch(item.fileFullPath)
// const bolb = await res.blob()
// const file = commUtils.blobToFile(bolb, item.fileShowName)
const data=item.fileFullPath
try { try {
console.log('item', item) const data = await PPTApi.toRousrceUrl(file)
// const data = await PPTApi.toRousrceUrl(file)
if(videoSuffix.indexOf(getFileSuffix(item.fileShowName)) != -1){ if(videoSuffix.indexOf(getFileSuffix(item.fileShowName)) != -1){
emit('insertMaterial',{ type: 'video', data }) emit('insertMaterial',{ type: 'video', data })
}else if(item.fileType.indexOf('audio') != -1){ }
emit('insertMaterial',{ type: 'audio', data }) else{
}else{
emit('insertMaterial',{ type: 'img', data }) emit('insertMaterial',{ type: 'img', data })
} }
} finally { } finally {
@ -136,17 +125,11 @@ onMounted(() => {
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
font-size: 14px; font-size: 14px;
justify-content: space-between;
.img{ .img{
width: 100px; width: 100px;
height: 100px; height: 100px;
margin-right: 20px; margin-right: 20px;
} }
} }
.texts{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 600px;
}
</style> </style>

View File

@ -287,8 +287,6 @@ const insertMaterial = async (item: MaterialParams) =>{
const { type, data } = item const { type, data } = item
if(type == 'video'){ if(type == 'video'){
createVideoElement(data) createVideoElement(data)
}else if(type == 'audio'){
createAudioElement(data)
} }
else{ else{
createImageElement(data) createImageElement(data)

View File

@ -16,7 +16,7 @@
<PopoverMenuItem>导入 pptx 文件</PopoverMenuItem> <PopoverMenuItem>导入 pptx 文件</PopoverMenuItem>
</FileInput> </FileInput>
<PopoverMenuItem @click="setDialogForExport('pptx')">导出文件</PopoverMenuItem> --> <PopoverMenuItem @click="setDialogForExport('pptx')">导出文件</PopoverMenuItem> -->
<!-- <PopoverMenuItem @click="resetSlides(); mainMenuVisible = false">重置幻灯片</PopoverMenuItem> --> <PopoverMenuItem @click="resetSlides(); mainMenuVisible = false">重置幻灯片</PopoverMenuItem>
<!-- <PopoverMenuItem @click="goLink('https://github.com/pipipi-pikachu/PPTist/issues')">意见反馈</PopoverMenuItem> --> <!-- <PopoverMenuItem @click="goLink('https://github.com/pipipi-pikachu/PPTist/issues')">意见反馈</PopoverMenuItem> -->
<!-- <PopoverMenuItem @click="goLink('https://github.com/pipipi-pikachu/PPTist/blob/master/doc/Q&A.md')">常见问题</PopoverMenuItem> --> <!-- <PopoverMenuItem @click="goLink('https://github.com/pipipi-pikachu/PPTist/blob/master/doc/Q&A.md')">常见问题</PopoverMenuItem> -->
<PopoverMenuItem @click="mainMenuVisible = false; hotkeyDrawerVisible = true">快捷操作</PopoverMenuItem> <PopoverMenuItem @click="mainMenuVisible = false; hotkeyDrawerVisible = true">快捷操作</PopoverMenuItem>

View File

@ -95,8 +95,8 @@
style="width: 65%;" style="width: 65%;"
:options="[ :options="[
{ label: '主动触发', value: 'click' }, { label: '主动触发', value: 'click' },
// { label: '', value: 'meantime' }, { label: '与上一动画同时', value: 'meantime' },
// { label: '', value: 'auto' }, { label: '上一动画之后', value: 'auto' },
]" ]"
/> />
</div> </div>

View File

@ -88,7 +88,7 @@ import Button from '../../../../components/Button.vue'
import ButtonGroup from '../../../../components/ButtonGroup.vue' import ButtonGroup from '../../../../components/ButtonGroup.vue'
import Popover from '../../../../components/Popover.vue' import Popover from '../../../../components/Popover.vue'
import NumberInput from '../../../../components/NumberInput.vue' import NumberInput from '../../../../components/NumberInput.vue'
import { PPTApi } from '../../../../api'
const shapeClipPathOptions = CLIPPATHS const shapeClipPathOptions = CLIPPATHS
const ratioClipOptions = [ const ratioClipOptions = [
{ {
@ -221,14 +221,10 @@ const presetImageClip = (shape: string, ratio = 0) => {
const replaceImage = (files: FileList) => { const replaceImage = (files: FileList) => {
const imageFile = files[0] const imageFile = files[0]
if (!imageFile) return if (!imageFile) return
PPTApi.toRousrceUrl(imageFile).then(data=>{ getImageDataURL(imageFile).then(dataURL => {
const props = { src: data } const props = { src: dataURL }
updateImage(props) updateImage(props)
}) })
// getImageDataURL(imageFile).then(dataURL => {
// const props = { src: dataURL }
// updateImage(props)
// })
} }
// //

View File

@ -46,12 +46,11 @@
:options="[ :options="[
{ label: '线性渐变', value: 'linear' }, { label: '线性渐变', value: 'linear' },
{ label: '径向渐变', value: 'radial' }, { label: '径向渐变', value: 'radial' },
{ label: '背景图', value: 'image' },
]" ]"
/> />
</div> </div>
<template v-if="fillType === 'gradient' && gradient.type !== 'image'"> <template v-if="fillType === 'gradient'">
<div class="row"> <div class="row">
<GradientBar <GradientBar
:value="gradient.colors" :value="gradient.colors"
@ -207,13 +206,6 @@ const updateFillType = (type: 'gradient' | 'fill') => {
const updateGradient = (gradientProps: Partial<Gradient>) => { const updateGradient = (gradientProps: Partial<Gradient>) => {
if (!gradient.value) return if (!gradient.value) return
const _gradient = { ...gradient.value, ...gradientProps } const _gradient = { ...gradient.value, ...gradientProps }
if (!_gradient.colors) {
_gradient.colors = [
{ pos: 0, color: '#fff' },
{ pos: 100, color: '#fff' },
]
_gradient.rotate = 0
}
updateElement({ gradient: _gradient }) updateElement({ gradient: _gradient })
} }
const updateGradientColors = (color: string) => { const updateGradientColors = (color: string) => {

View File

@ -47,10 +47,8 @@
<IconListView class="tool-btn" v-tooltip="'演讲者视图'" @click="changeViewMode('presenter')" /> <IconListView class="tool-btn" v-tooltip="'演讲者视图'" @click="changeViewMode('presenter')" />
<IconOffScreenOne class="tool-btn" v-tooltip="'退出全屏'" v-if="fullscreenState" @click="manualExitFullscreen()" /> <IconOffScreenOne class="tool-btn" v-tooltip="'退出全屏'" v-if="fullscreenState" @click="manualExitFullscreen()" />
<IconFullScreenOne class="tool-btn" v-tooltip="'进入全屏'" v-else @click="enterFullscreen()" /> <IconFullScreenOne class="tool-btn" v-tooltip="'进入全屏'" v-else @click="enterFullscreen()" />
<Hands class="tool-btn" v-if="classcourse" v-tooltip="'课堂点名'" @click="ToolHandle('named')" /> <IconPower class="tool-btn" v-tooltip="'结束放映'" @click="exitScreening()" />
<Share class="tool-btn" v-if="classcourse" v-tooltip="'分享'" @click="ShareCode()" /> <IconPower class="tool-btn close" v-if="chat.groupid" v-tooltip="'结束课堂'" @click="exitCourse()" />
<IconPower class="tool-btn" v-if="!classcourse" v-tooltip="'结束放映'" @click="exitScreening()" />
<IconPower class="tool-btn" v-else v-tooltip="'结束课堂'" @click="exitCourse()" size="30" fill="#d0021b" strokeLinecap="butt" />
</div> </div>
<div :class="['tools-icon',{opacity:iconHide}]" @click.stop="toolTrigger('icon')"> <div :class="['tools-icon',{opacity:iconHide}]" @click.stop="toolTrigger('icon')">
<circle-double-down v-if="rightToolsVisible" theme="outline" size="30" fill="#409EFF"/> <circle-double-down v-if="rightToolsVisible" theme="outline" size="30" fill="#409EFF"/>
@ -77,8 +75,7 @@ import WritingBoardTool from './WritingBoardTool.vue'
import CountdownTimer from './CountdownTimer.vue' import CountdownTimer from './CountdownTimer.vue'
import emitter from '@/utils/mitt'; import emitter from '@/utils/mitt';
import Chat from '../../api/chat' // import Chat from '../../api/chat' //
import { CircleDoubleDown, CircleDoubleUp, Share, Hands } from '@icon-park/vue-next' // icon-park import { CircleDoubleDown, CircleDoubleUp } from '@icon-park/vue-next' // icon-park
import { ShareCode, ToolHandle } from '@/utils/ppt' // ppt
const props = defineProps<{ const props = defineProps<{
changeViewMode: (mode: 'base' | 'presenter') => void changeViewMode: (mode: 'base' | 'presenter') => void
@ -105,7 +102,6 @@ const {
execPrev, execPrev,
execNext, execNext,
animationIndex, animationIndex,
turning,
} = useExecPlay() } = useExecPlay()
const { slideWidth, slideHeight } = useSlideSize() const { slideWidth, slideHeight } = useSlideSize()
const { exitScreening } = useScreening() const { exitScreening } = useScreening()
@ -202,7 +198,7 @@ const contextmenus = (): ContextmenuItem[] => {
}, },
] ]
} }
//
const toolTrigger = (type:string) => { const toolTrigger = (type:string) => {
const curT = Date.now() const curT = Date.now()
if (curT - timer.value < 200) return if (curT - timer.value < 200) return

View File

@ -10,13 +10,9 @@
<IconOffScreenOne class="tool-icon" v-else /> <IconOffScreenOne class="tool-icon" v-else />
<span>{{ fullscreenState ? '退出全屏' : '全屏' }}</span> <span>{{ fullscreenState ? '退出全屏' : '全屏' }}</span>
</div> </div>
<template v-if="classcourse">
<div class="tool-btn" @click="ToolHandle('named')"><Hands class="tool-icon" /><span>课堂点名</span></div>
<div class="tool-btn" @click="ShareCode()"><Share class="tool-icon" /><span>分享</span></div>
</template>
<Divider class="divider" /> <Divider class="divider" />
<div class="tool-btn" v-if="!classcourse" @click="exitScreening()"><IconPower class="tool-icon" /><span>结束放映</span></div> <div class="tool-btn" @click="exitScreening()"><IconPower class="tool-icon" /><span>结束放映</span></div>
<div class="tool-btn" v-else @click="exitCourse()" size="30" fill="#d0021b" strokeLinecap="butt"><IconPower class="tool-icon" /><span>结束课堂</span></div> <div class="tool-btn close" @click="exitCourse()" v-if="chat.groupid"><IconPower class="tool-icon" /><span>结束课堂</span></div>
</div> </div>
<div class="content"> <div class="content">
@ -82,7 +78,6 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Share, Hands } from '@icon-park/vue-next' // icon-park
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue' import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useSlidesStore, useClasscourseStore } from '../../store' import { useSlidesStore, useClasscourseStore } from '../../store'
@ -102,7 +97,6 @@ import CountdownTimer from './CountdownTimer.vue'
import Divider from '../../components/Divider.vue' import Divider from '../../components/Divider.vue'
import emitter from '@/utils/mitt'; import emitter from '@/utils/mitt';
import Chat from '../../api/chat' // import Chat from '../../api/chat' //
import { ShareCode, ToolHandle } from '@/utils/ppt' // ppt
const props = defineProps<{ const props = defineProps<{
changeViewMode: (mode: 'base' | 'presenter') => void changeViewMode: (mode: 'base' | 'presenter') => void
@ -131,7 +125,7 @@ const { slideWidth, slideHeight } = useSlideSize(slideListWrapRef)
const { exitScreening } = useScreening() const { exitScreening } = useScreening()
const { slidesLoadLimit } = useLoadSlides() const { slidesLoadLimit } = useLoadSlides()
const { fullscreenState, manualExitFullscreen } = useFullscreen() const { fullscreenState, manualExitFullscreen } = useFullscreen()
const chatApi:any = Chat() // const chat:any = Chat() //
const remarkFontSize = ref(16) const remarkFontSize = ref(16)
const currentSlideRemark = computed(() => { const currentSlideRemark = computed(() => {
@ -140,20 +134,15 @@ const currentSlideRemark = computed(() => {
// //
const turnSlideTo = (index: number, e: PointerEvent) => { const turnSlideTo = (index: number, e: PointerEvent) => {
const preInd = slideIndex.value //
console.log('课堂信息', classcourse, index)
if (!!classcourse.value) return
turnSlideToIndex(index) turnSlideToIndex(index)
if (!!classcourse.value) {//
if (preInd == index) return
const animationSteps = 0
const animation = index > preInd?'Nextsteps':'Previoustep'
const msg = { current:index, animation, animationSteps}
chatApi.slideFlapping(msg)
}
} }
// //
const exitCourse = async () => { const exitCourse = async () => {
// console.log('', chat) // console.log('', chat)
await chatApi.exitCourse() // await chat.exitCourse() //
exitScreening() // exitScreening() //
} }

View File

@ -28,9 +28,8 @@ export default (isLoader?: boolean = true) => {
// 执行元素动画 isAsync 为 true 时,异步执行,否则同步执行 // 执行元素动画 isAsync 为 true 时,异步执行,否则同步执行
const runAnimation = (isAsync: boolean) => { const runAnimation = (isAsync: boolean) => {
return new Promise((resolve, reject) => {
// 正在执行动画时,禁止其他新的动画开始 // 正在执行动画时,禁止其他新的动画开始
if (inAnimation.value && !isAsync) return resolve() if (inAnimation.value && !isAsync) return
const { animations, autoNext } = formatedAnimations.value[animationIndex.value] const { animations, autoNext } = formatedAnimations.value[animationIndex.value]
animationIndex.value += 1 animationIndex.value += 1
@ -61,7 +60,7 @@ export default (isLoader?: boolean = true) => {
elRef.classList.add(animationName, `${ANIMATION_CLASS_PREFIX}animated`) elRef.classList.add(animationName, `${ANIMATION_CLASS_PREFIX}animated`)
// 执行动画结束,将“退场”以外的动画状态清除 // 执行动画结束,将“退场”以外的动画状态清除
const handleAnimationEnd = async() => { const handleAnimationEnd = () => {
if (animation.type !== 'out') { if (animation.type !== 'out') {
elRef.style.removeProperty('--animate-duration') elRef.style.removeProperty('--animate-duration')
elRef.classList.remove(animationName, `${ANIMATION_CLASS_PREFIX}animated`) elRef.classList.remove(animationName, `${ANIMATION_CLASS_PREFIX}animated`)
@ -71,13 +70,11 @@ export default (isLoader?: boolean = true) => {
endAnimationCount += 1 endAnimationCount += 1
if (endAnimationCount === animations.length) { if (endAnimationCount === animations.length) {
inAnimation.value = false inAnimation.value = false
if (autoNext) await runAnimation() if (autoNext) runAnimation()
resolve() // 执行完成
} }
} }
elRef.addEventListener('animationend', handleAnimationEnd, { once: true }) elRef.addEventListener('animationend', handleAnimationEnd, { once: true })
} }
})
} }
if (isLoader) { // 加载相关钩子 if (isLoader) { // 加载相关钩子
onMounted(() => { onMounted(() => {
@ -150,7 +147,7 @@ export default (isLoader?: boolean = true) => {
} }
inAnimation.value = false inAnimation.value = false
} }
const execNext = async(isAsync: boolean) => { const execNext = (isAsync: boolean) => {
if (formatedAnimations.value.length && animationIndex.value < formatedAnimations.value.length) { if (formatedAnimations.value.length && animationIndex.value < formatedAnimations.value.length) {
runAnimation(isAsync) runAnimation(isAsync)
} }
@ -219,17 +216,9 @@ export default (isLoader?: boolean = true) => {
// 向上翻页/向下翻页 // 向上翻页/向下翻页
const turning = async (e, type) => { const turning = async (e, type) => {
e.preventDefault() // 阻止默认事件 e.preventDefault() // 阻止默认事件
window.scrollTo(0, 0) // 滚动到顶部 if (type === 'prev') execPrev()
const isCourse = !!classcourseStore.classcourse else if (type === 'next') execNext()
if (type === 'prev') { if (classcourseStore.classcourse) { // 上课中
if (!isCourse) execPrev() // 上一步
else { // 上课状态: 上一步 动作变成 上一页
const current = slideIndex.value
if (current <= 0) return throttleMassage('已经是第一页了')
turnSlideToIndex(current - 1) // 翻页: 上一页
}
} else if (type === 'next') execNext()
if (isCourse) { // 上课中
const current = slideIndex.value const current = slideIndex.value
const animationSteps = animationIndex.value const animationSteps = animationIndex.value
const animation = type == 'next'?'Nextsteps':'Previoustep' const animation = type == 'next'?'Nextsteps':'Previoustep'
@ -296,6 +285,5 @@ export default (isLoader?: boolean = true) => {
execPrev, execPrev,
execNext, execNext,
animationIndex, animationIndex,
turning,
} }
} }

View File

@ -4,22 +4,13 @@
<PresenterView :changeViewMode="changeViewMode" v-else-if="viewMode === 'presenter'" /> <PresenterView :changeViewMode="changeViewMode" v-else-if="viewMode === 'presenter'" />
<!-- 点赞组件 --> <!-- 点赞组件 -->
<upvote-vue ref="upvoteRef" type="2"></upvote-vue> <upvote-vue ref="upvoteRef" type="2"></upvote-vue>
<!-- <div style="z-index: 999;position: absolute;top:10px">
<!-- 推图上屏弹窗 --> </div> -->
<el-dialog
v-model="dialogVisible"
:fullscreen="true"
class="gridPicRefdiv"
style="overflow: hidden;"
:show-close="false"
>
<grid-pic ref="gridPicRef" style="height:100%;" @clear="clearchidrenPic"></grid-pic>
</el-dialog>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, onUnmounted, ref , nextTick} from 'vue' import { onMounted, onUnmounted, ref } from 'vue'
import { KEYS } from '../../configs/hotkey' import { KEYS } from '../../configs/hotkey'
import useScreening from '../../hooks/useScreening' import useScreening from '../../hooks/useScreening'
import hooksUpvote from '../../api/upvote' // - import hooksUpvote from '../../api/upvote' // -
@ -27,13 +18,9 @@ import hooksUpvote from '../../api/upvote' // 点赞-工具
import BaseView from './BaseView.vue' import BaseView from './BaseView.vue'
import PresenterView from './PresenterView.vue' import PresenterView from './PresenterView.vue'
import upvoteVue from '@/views/tool/components/upvote.vue' // - import upvoteVue from '@/views/tool/components/upvote.vue' // -
import gridPic from '@/components/grid-pic/index.vue' //
import emitter from '@/utils/mitt' //mitt 线
const viewMode = ref<'base' | 'presenter'>('base') const viewMode = ref<'base' | 'presenter'>('base')
const dialogVisible = ref(false)
const gridPicRef:any= ref(null)
const changeViewMode = (mode: 'base' | 'presenter') => { const changeViewMode = (mode: 'base' | 'presenter') => {
viewMode.value = mode viewMode.value = mode
} }
@ -48,23 +35,6 @@ const keydownListener = (e: KeyboardEvent) => {
if (key === KEYS.ESC) exitScreening() if (key === KEYS.ESC) exitScreening()
} }
const clearchidrenPic= ()=> {
dialogVisible.value = false
}
//
emitter.on('opengridPic', async (data:object)=> {
if(gridPicRef.value) gridPicRef.value.clearPic()
dialogVisible.value = true
await nextTick();
gridPicRef.value.addPic(data.arr)
});
//
emitter.on('closegridPic', ()=> {
if(!gridPicRef.value) return
gridPicRef.value.clearPic()
dialogVisible.value = false
});
onMounted(() => document.addEventListener('keydown', keydownListener)) onMounted(() => document.addEventListener('keydown', keydownListener))
onUnmounted(() => document.removeEventListener('keydown', keydownListener)) onUnmounted(() => document.removeEventListener('keydown', keydownListener))
</script> </script>
@ -76,8 +46,4 @@ onUnmounted(() => document.removeEventListener('keydown', keydownListener))
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
:deep(.gridPicRefdiv .el-dialog__body){
height: 100% !important;
}
</style> </style>

View File

@ -33,8 +33,6 @@
:type="elementInfo.gradient.type" :type="elementInfo.gradient.type"
:colors="elementInfo.gradient.colors" :colors="elementInfo.gradient.colors"
:rotate="elementInfo.gradient.rotate" :rotate="elementInfo.gradient.rotate"
:image="elementInfo.gradient.image"
:info="elementInfo"
/> />
</defs> </defs>
<g <g

View File

@ -1,25 +1,6 @@
<template> <template>
<!-- auth:zdg 增加图片 -->
<pattern
v-if="type === 'image'"
:id="id"
:x="image?.stretch?.l || 0"
:y="image?.stretch?.t || 0"
:width="image?.path_W||'100%'"
:height="image?.path_h||'100%'"
:style="image.rotWithShape==0?'transform:rotate('+(-info.rotate)+'deg)' : ''"
patternUnits="userSpaceOnUse">
<image
:width="image?.path_W||200"
:height="image?.path_h||200"
:href="image.src"
:opacity="image.opacity"
preserveAspectRatio="none"
/>
</pattern>
<!-- auth:zdg 默认 线性渐变 -->
<linearGradient <linearGradient
v-else-if="type === 'linear'" v-if="type === 'linear'"
:id="id" :id="id"
x1="0%" x1="0%"
y1="0%" y1="0%"
@ -29,35 +10,20 @@
> >
<stop v-for="(item, index) in colors" :key="index" :offset="`${item.pos}%`" :stop-color="item.color" /> <stop v-for="(item, index) in colors" :key="index" :offset="`${item.pos}%`" :stop-color="item.color" />
</linearGradient> </linearGradient>
<!-- auth:zdg 默认 径向渐变 -->
<radialGradient :id="id" v-else> <radialGradient :id="id" v-else>
<stop v-for="(item, index) in colors" :key="index" :offset="`${item.pos}%`" :stop-color="item.color" /> <stop v-for="(item, index) in colors" :key="index" :offset="`${item.pos}%`" :stop-color="item.color" />
</radialGradient> </radialGradient>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { GradientColor, GradientType, PPTShapeElement } from '../../../../types/slides' import type { GradientColor, GradientType } from '../../../../types/slides'
interface ImageSvg {
src: string, withDefaults(defineProps<{
width: number,
height: number,
zipPath: string,
opacity: number,
rotWithShape: string,
stretch?: {
l?: number,
t?: number,
r?: number,
b?: number
}
}
const data = withDefaults(defineProps<{
id: string id: string
type: GradientType type: GradientType
colors?: GradientColor[] colors: GradientColor[]
rotate?: number, rotate?: number
image?: ImageSvg,
info?: PPTShapeElement
}>(), { }>(), {
rotate: 0, rotate: 0,
}) })

View File

@ -42,8 +42,6 @@
:type="elementInfo.gradient.type" :type="elementInfo.gradient.type"
:colors="elementInfo.gradient.colors" :colors="elementInfo.gradient.colors"
:rotate="elementInfo.gradient.rotate" :rotate="elementInfo.gradient.rotate"
:image="elementInfo.gradient.image"
:info="elementInfo"
/> />
</defs> </defs>
<g <g

View File

@ -15,7 +15,7 @@ const size = ref('default')
font-family: Avenir, Helvetica, Arial, sans-serif; font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
/* text-align: center; */ text-align: center;
color: #2c3e50; color: #2c3e50;
width: 100%; width: 100%;
} }

View File

@ -71,14 +71,6 @@ export function updateClassworkeval(data) {
}) })
} }
export function updateClassworkevalList(data) {
return request({
url: '/education/classworkeval/updateList',
method: 'put',
data: data
})
}
// 修改classworkdata // 修改classworkdata
export function updateClassworkdata(data) { export function updateClassworkdata(data) {
return request({ return request({
@ -88,15 +80,6 @@ export function updateClassworkdata(data) {
}) })
} }
// 批阅后, 待所有学生都批改完成后自动结束当前作业为[已完成]
export function updateClassWorkDataAutoFinish(data) {
return request({
url: '/education/classworkdata/updAutoFinish',
method: 'put',
data: data
})
}
// 修改classwork // 修改classwork
export function updateClasswork(data) { export function updateClasswork(data) {
return request({ return request({

View File

@ -136,17 +136,3 @@ export function getJYPath(url,config) {
params: config.params params: config.params
}) })
} }
/**
* @desc: 百度识图转发
* @return: {*}
* @param {*} data
*/
export function getOcrContent(data) {
return request({
url: '/ocr/exam',
method: 'post',
data: data
})
}

View File

@ -79,34 +79,3 @@ export const getModelInfo = (params) => {
params params
}) })
} }
// 上传tts语音
export const aitts = (data) => {
return request({
url: '/aitts/createTts',
method: 'post',
data
})
}
// 语音关联课
export const addFileToSC = (params) => {
return request({
url: '/smarttalk/file/addFileToSC',
method: 'post',
params
})
}
//EOS生成表单上传的签名
export const createSignature = (data) => {
return request({
url: '/eos/createSignature',
method: 'post',
data
})
}
//EOS生成本地上传的临时签名
export const sessionToken = () => {
return request({
url: '/eos/sessionToken',
method: 'get'
})
}

View File

@ -118,44 +118,4 @@ export function docList(params) {
}) })
} }
// 删除 doc ai文档
export function removeDoc(id) {
return request({
url: '/education/doc/' + id,
method: 'delete',
})
}
// 保存教学大纲
export function addSyllabus(data) {
return request({
url: '/education/generate',
method: 'post',
data
})
}
// 获取保存的大纲列表
export function syllabusList(params) {
return request({
url: '/education/generate/list',
method: 'get',
params
})
}
// 删除大纲
export function removeSyllabus(id) {
return request({
url: '/education/generate/' + id,
method: 'delete',
})
}
export function editSyllabus(data) {
return request({
url: '/education/generate',
method: 'put',
data
})
}

View File

@ -102,28 +102,4 @@ export function setPaging(data) {
data data
}) })
} }
/**
* 获取分享码(邀请码)
* @param {*} id 课堂id
* @returns
*/
export function getShareCode(id) {
return request({
url: '/education/classcourse/refresh/code',
method: 'post',
data: { id }
})
}
/**
* 课堂点名
* @param {*} timgroupid 群id
* @returns
*/
export function rollCall(timgroupid) {
return request({
url: '/education/classcourse/roll/call',
method: 'post',
data: { timgroupid }
})
}

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 4723712 */ font-family: "iconfont"; /* Project id 4723712 */
src: url('iconfont.woff2?t=1735483000546') format('woff2'), src: url('iconfont.woff2?t=1734337029245') format('woff2'),
url('iconfont.woff?t=1735483000546') format('woff'), url('iconfont.woff?t=1734337029245') format('woff'),
url('iconfont.ttf?t=1735483000546') format('truetype'); url('iconfont.ttf?t=1734337029245') format('truetype');
} }
.iconfont { .iconfont {
@ -13,10 +13,6 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-chuangzuo:before {
content: "\e6cc";
}
.icon-yinle:before { .icon-yinle:before {
content: "\e6c9"; content: "\e6c9";
} }

File diff suppressed because one or more lines are too long

View File

@ -5,13 +5,6 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "39170417",
"name": "创作",
"font_class": "chuangzuo",
"unicode": "e6cc",
"unicode_decimal": 59084
},
{ {
"icon_id": "11819186", "icon_id": "11819186",
"name": "音乐", "name": "音乐",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 MiB

View File

@ -1,135 +0,0 @@
<template>
<!-- <form @submit.prevent="submitForm" enctype="multipart/form-data">-->
<form action="https://wzyzoss.eos-chongqing-3.cmecloud.cn" method="post" enctype="multipart/form-data">
<!-- action 是具体要上传的地址 -->
<!--
上传后文件Object:
<input type="input" name="key" :value="uploadData.key" placeholder="文件名" style="width: 400px"/><br/><br/>
ACL
<input type="hidden" name="acl" :value="uploadData.acl" placeholder="文件 ACL" style="width: 400px"/><br/><br/>
Content-Type:
<input type="input" name="Content-Type" :value="uploadData['Content-Type']" placeholder="文件类型" style="width: 400px"/><br/><br/>
X-Amz-Credential
<input type="text" name="X-Amz-Credential" :value="uploadData['x-amz-credential']" placeholder="X-Amz-Credential从后端程序返回中获取" style="width: 400px"/><br/><br/>
X-Amz-Algorithm
<input type="text" name="X-Amz-Algorithm" :value="uploadData['x-amz-algorithm']" placeholder="X-Amz-Algorithm 从后端程序返回中获取" style="width: 400px"/><br/><br/>
X-Amz-Date
<input type="text" name="X-Amz-Date" :value="uploadData['x-amz-date']" placeholder="X-Amz-Date 从后端程序返回中获取" style="width: 400px"><br/><br/>
Policy
<input type="text" name="Policy" :value="uploadData.policy" placeholder="Policy 从后端程序返回中获取" style="width: 400px"/><br/><br/>
X-Amz-Signature
<input type="text" name="X-Amz-Signature" :value="uploadData['x-amz-signature']" placeholder="X-Amz-Signature 从后端程序返回中获取" style="width: 400px"/><br/><br/>
-->
选择文件Object
<input type="file" name="file" @change="handleFileChange" style="width: 400px"/> <br/><br/>
<input type="submit" name="submit" value="上传到 EOS" style="width: 400px"/><br/><br/>
<el-button @click="uploadFile">上传</el-button>
</form>
</template>
<script setup>
import {ref, onMounted} from "vue"
import {createSignature, sessionToken} from "@/api/file";
import axios from "axios"
const url = "https://wzyzoss.eos-chongqing-3.cmecloud.cn"
const uploadData = ref({
"bucket": "wzyzoss",
"x-amz-date": "20250113T061000Z",
"x-amz-signature": "2d6fba9f27544bfc7414d660e2e73aafdaf02fe3de45e68f59d580276239cd07",
"acl": "private",
"x-amz-algorithm": "AWS4-HMAC-SHA256",
"key": "wzyzossa",
"x-amz-credential": "07ICFAF4IWWZP6RH0WCG/20250113/us-east-1/s3/aws4_request",
"Content-Type": null,
"policy": "eyJleHBpcmF0aW9uIjoiMjAyNS0wMS0xM1QwNzoxMDowMC42NzVaIiwiY29uZGl0aW9ucyI6W3sieC1hbXotZGF0ZSI6IjIwMjUwMTEzVDA2MTAwMFoifSx7ImFjbCI6InByaXZhdGUifSx7ImJ1Y2tldCI6Ind6eXpvc3MifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInd6eXpvc3NhIl0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCJudWxsIl0seyJ4LWFtei1hbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJ4LWFtei1jcmVkZW50aWFsIjoiMDdJQ0ZBRjRJV1daUDZSSDBXQ0cvMjAyNTAxMTMvdXMtZWFzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDEsMTAwMDAwXV19"
})
const submitForm = ()=> {
let formData = new FormData();
for (const formDataKey in formData) {
formData.append(formDataKey, formData[formDataKey]);
}
axios.post(url, formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(response => {
console.log('表单提交成功,服务器响应:', response.data);
})
.catch(error => {
console.log('表单提交失败:', error);
});
}
const S3Data = {
apiVersion: "2006-03-01",
accessKeyId: "2UYNH48SKS4O3WB4W4OI", // access key ID
secretAccessKey: "spwk4vcPbQUa3n7H8AwOFWqhK712XUX23CrUlwC8", // secret access key
endpoint: "eos-chongqing-3.cmecloud.cn",
signatureVersion: "v2",
sslEnabled: true // HTTPS
}
let selectedFile = null
const handleFileChange = (event)=> {
//
selectedFile = event.target.files[0];
}
const uploadMessage = ref(null)
const uploadFile = ()=>{
if (selectedFile) {
console.log(S3Data)
// AWS.S3
const s3 = new AWS.S3(S3Data);
let params = {
Key: selectedFile.name,
Bucket: "wzyzoss",
ContentType: selectedFile.type,
Body: selectedFile
}
console.log(params)
s3.putObject(params, function (err, data) {
console.log(err,data)
});
}
}
onMounted(()=>{
console.log(AWS)
/*createSignature({objectName:"123.jpg",contentType:"image/png"}).then(res=>{
uploadData.value = res.body
})*/
sessionToken().then(res=>{
uploadMessage.value = res.data
console.log(res.data)
S3Data.accessKeyId = res.data.accessKeyId
// S3Data.accessKeyId = "kzOm2cc7nT12ao907Tc"
S3Data.secretAccessKey = res.data.secretAccessKey
// S3Data.secretAccessKey = "MYXV8Z3UKZVQETFNKQKLJQA67II6E3YEY8RODCV"
S3Data.endpoint = res.data.endPoint
S3Data.sessionToken = res.data.sessionToken
// S3Data.sessionToken = "zPpRolsWE3n7fbmqdt/tzyoSeYULFedptLuKdnJBag5X9y73fitu93WPLMMqYQzYTR+mg86jxs3IQJjOpgFRShdiNB2/mWRvfyeEZ3xo6cRMYnFXSLASIxCyvAH48pH6Z1pI3NuqtaZzlx7zdeoHYCskOuzBXoLhxN1cCXTg3AEZqQ0K4v1RcPIi4cD/YE+XCa+V7DjYU2Bs9zxZ4I52wXOtdnTg9Gj+MwfT+CywOio="
S3Data.apiVersion = "2006-03-01"
})
})
</script>
<style scoped lang="scss">
</style>

View File

@ -1,240 +0,0 @@
<template>
<div>
<div style="height: auto; display: flex">
<div style="flex: 1">
<div class="audio-container">
<aiAudio
@saveClick="saveClick"
ref="audioRef"
:audioSrc="audioSrc"
@auditionClick="auditionClick"
></aiAudio>
</div>
</div>
<div style="background: #fff; height: 85vh; min-width: 364px; margin-left: 20px;overflow: hidden;">
<div style="padding: 0 20px; height: 100%;">
<el-tabs v-model="activeTab" class="prepare-tabs">
<el-tab-pane label="素材" name="素材">
<div class="prepare-body-header">
<div>
<label style="font-size: 15px"
>{{
currentFileList.filter(
(ite) => ite.fileFlag !== 'apt' && ite.fileFlag !== '课件'
).length
}}个文件</label
>&nbsp;
<!-- <el-popover placement="top-start" :width="250" trigger="hover">
<template #default>
<div>
<el-button
v-if="lastAsyncAllTime"
type="success"
size="small"
:icon="Check"
circle
/>
{{ lastAsyncAllTime ? toTimeText(lastAsyncAllTime) + '同步成功' : '' }}
</div>
</template>
<template #reference>
<el-button size="small" text @click="asyncAllFile">
<el-icon v-loading="asyncAllFileVisiable">
<Refresh />
</el-icon>
{{ asyncAllFileVisiable ? '同步中' : '云同步' }}
</el-button>
</template>
</el-popover> -->
<!-- <el-button size="small" @click="isDialogOpen = true">上传资料</el-button>
<el-button size="small" @click="reloadFiles">资源重载</el-button> -->
</div>
</div>
<el-checkbox-group
v-model="checkFileList"
class="prepare-body-main"
:style="{ 'margin-bottom': checkFileList.length > 0 ? '40px' : '0' }"
>
<file-list-item
v-for="(item, index) in currentSCFileList"
:key="index"
:item="item"
:index="index"
@on-delete="deleteSuccess"
>
</file-list-item>
</el-checkbox-group>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</div>
</template>
<script>
import { useRoute } from 'vue-router'
import { getSmarttalkPage, moveSmarttalk, creatAPT } from '@/api/file'
import FileListItem from '@/views/prepare/container/file-list-item.vue'
import { parseCataByNode, creatPPT, asyncLocalFile, removeLocalFiles } from '@/utils/talkFile'
import { uploadPicture } from '@/api/aiGeneratedImage/index.js'
import { aitts, addFileToSC } from '@/api/file/index.js'
export default {
components: {
FileListItem
},
props: {},
data() {
return {
activeTab: '素材',
currentFileList: [],
uploadData: {},
checkFileList: [],
isLoading: false,
lastAsyncAllTime: '',
audioSrc: null,
filedata: null
}
},
computed: {
isCheckAll() {
return (
this.checkFileList.length > 0 && this.checkFileList.length === this.currentSCFileList.length
)
},
currentSCFileList() {
// return this.currentFileList.filter((item) => item.fileFlag !== 'apt' && item.fileFlag !== '')
return this.currentFileList.filter((item) => !['apt', 'aippt'].includes(item.fileFlag))
}
},
methods: {
deleteSuccess(item) {
this.asyncAllFile() //
},
auditionClick(requestData) {
this.$refs.audioRef.startLoading = true
aitts(requestData)
.then((res) => {
console.log(res)
if (res.code == 200) {
this.audioSrc = res.data.fullUrl
this.filedata = res.data
this.$refs.audioRef.startLoading = false
} else {
this.$message.error(res.msg)
this.$refs.audioRef.startLoading = false
}
})
.catch((err) => {
this.$refs.audioRef.startLoading = false
})
},
saveClick(requestData) {
this.$refs.audioRef.saveLoading = true
aitts(requestData)
.then((res) => {
if (res.code == 200) {
this.filedata = res.data
const saveObj = {
textbookId: this.uploadData.textbookId,
levelFirstId: this.uploadData.levelFirstId,
levelSecondId: this.uploadData.levelSecondId,
fileSource: this.uploadData.fileSource,
fileRoot: this.uploadData.fileRoot,
fileShowName: this.filedata.uploadTime+'音频.' + this.filedata.fileSuffix,
fileFlag: '素材',
fileId: this.filedata.id
}
addFileToSC(saveObj)
.then((resone) => {
this.$message.success('上传成功')
this.asyncAllFile()
this.$refs.audioRef.saveLoading = false
})
.catch((err) => {
this.$refs.audioRef.saveLoading = false
})
} else {
this.$message.error(res.msg)
this.$refs.audioRef.saveLoading = false
}
})
.catch((err) => {
console.log(err)
this.$refs.audioRef.saveLoading = false
})
},
asyncAllFile() {
this.isLoading = true
return getSmarttalkPage({
...this.uploadData,
orderByColumn: 'createTime',
isAsc: 'desc',
pageSize: 500
})
.then(async (res) => {
this.currentFileList = [...res.rows].filter((item) => item.fileType === 'audio/wav')
this.isLoading = false
this.lastAsyncAllTime = new Date()
localStorage.setItem('lastAsyncAllTime', this.lastAsyncAllTime)
this.asyncAllFileVisiable = true
for (let i = 0; i < this.currentFileList.length; i++) {
let item = this.currentFileList[i]
if (item.fileFlag === 'apt') continue
if (item.fileFlag === 'aippt') continue
await asyncLocalFile(item)
}
this.asyncAllFileVisiable = false
return Promise.resolve()
})
.catch(() => {
this.isLoading = false
return Promise.resolve()
})
},
onMoveSingleFile(item) {
this.moveFile = [item]
this.isMoveDialogOpen = true
},
deleteTalk(item) {
let index = this.currentFileList.indexOf(item)
this.currentFileList.splice(index, 1)
},
//
openSet(row) {
// row list
this.rows = [row]
this.setDialog = true
}
},
mounted() {
const route = useRoute()
this.uploadData = route.query
// this.dataset_id = route.query.datasetId;
// this.courseName = route.query.coursetitle;
// this.levelFirstId = route.query.levelFirstId;
// this.levelSecondId = route.query.levelSecondId;
// this.textbookId = route.query.textbookId;
this.asyncAllFile() //
},
beforeDestroy() {}
}
</script>
<style scoped scss>
:deep(.prepare-item-info-title) {
line-height: 30px;
}
.prepare-body-main{
overflow-y: auto;
height: 74vh;
}
:deep(.audio-container .content-main){
height: 85vh !important ;
}
:deep(.audio-container .content-main div:nth-of-type(1)){
display: flex;
flex: 1;
}
</style>

View File

@ -10,23 +10,8 @@
<el-tree :data="treeData" accordion :props="defaultProps" node-key="id" <el-tree :data="treeData" accordion :props="defaultProps" node-key="id"
:default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current :default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current
@node-click="handleNodeClick"> @node-click="handleNodeClick">
<template #default="{ node, data }"> <template #default="{ node }">
<div v-if="props.isClassTask && (data.bookId == '' || data.bookId == '0')" class="tree-label-wrap"> <span :title="node.label" class="tree-label">{{ node.label }}</span>
<el-tooltip effect="light" placement="right" >
<template #content> {{ node.label }}<br /><span style="color: red;">-该单元章节无自主试题-</span> </template>
<div class="tree-label" style="color: #A5B3CA" >
{{ node.label }}
</div>
</el-tooltip>
</div>
<div v-else class="tree-label-wrap">
<el-tooltip effect="light" placement="right" >
<template #content> {{ node.label }}</template>
<div class="tree-label">
{{ node.label }}
</div>
</el-tooltip>
</div>
</template> </template>
</el-tree> </el-tree>
</div> </div>
@ -44,9 +29,8 @@
<div class="textbook-container"> <div class="textbook-container">
<el-scrollbar height="450px"> <el-scrollbar height="450px">
<div <div class="textbook-item flex" v-for="item in subjectList" :class="curBook.data.id == item.id ? 'active-item' : ''"
v-for="item in subjectList" :key="item.id" class="textbook-item flex" :key="item.id" @click="changeBook(item)">
:class="curBook.data.id == item.id ? 'active-item' : ''" @click="changeBook(item)">
<img v-if="item.avartar" :src="item.avartar.indexOf('http') === 0 ? item.avartar : BaseUrl + item.avartar" class="textbook-img" alt=""> <img v-if="item.avartar" :src="item.avartar.indexOf('http') === 0 ? item.avartar : BaseUrl + item.avartar" class="textbook-img" alt="">
<div v-else class="textbook-img"> <div v-else class="textbook-img">
<i class="iconfont icon-jiaocaixuanze" style="font-size: 40px;"></i> <i class="iconfont icon-jiaocaixuanze" style="font-size: 40px;"></i>
@ -67,13 +51,6 @@ import useUserStore from '@/store/modules/user'
const userStore = useUserStore() const userStore = useUserStore()
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
const props = defineProps({
// []使()
isClassTask: {
default: false
},
})
const isStadium = () => { const isStadium = () => {
let roles = userStore.user.roles let roles = userStore.user.roles
return roles.some(item => item.roleKey === 'stadium') return roles.some(item => item.roleKey === 'stadium')
@ -201,7 +178,6 @@ const handleNodeClick = (data) => {
sessionStore.set('subject.curNode', nodeData) sessionStore.set('subject.curNode', nodeData)
emit('nodeClick', curData) emit('nodeClick', curData)
} }
onMounted( async () => { onMounted( async () => {
treeLoading.value = true treeLoading.value = true
try{ try{
@ -341,8 +317,7 @@ onMounted( async () => {
} }
} }
.tree-label-wrap, .tree-label { .tree-label {
max-width: 100%;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@ -26,7 +26,6 @@ const getFileTypeIcon = () => {
doc: 'icon-word', doc: 'icon-word',
docx: 'icon-word', docx: 'icon-word',
mp4: 'icon-video', mp4: 'icon-video',
wav: 'icon-mp',
mov: 'icon-mov', mov: 'icon-mov',
avi: 'icon-avi', avi: 'icon-avi',
jpeg: 'icon-jpeg', jpeg: 'icon-jpeg',

View File

@ -16,15 +16,15 @@
<draggable handle=".header-btn" :draggable="false" item-key="backgroundColor" v-model="gridPicList" class="grid-pic-wrap" :style="getGrid"> <draggable handle=".header-btn" :draggable="false" item-key="backgroundColor" v-model="gridPicList" class="grid-pic-wrap" :style="getGrid">
<template #item="{ element, index }"> <template #item="{ element, index }">
<div class="grid-pic-item" :key="element.backgroundColor" :style="getWH(element,index)"> <div class="grid-pic-item" :key="element.backgroundColor" :style="getWH(element,index)">
<div class="delete-btn" @click="()=>{gridPicList.splice(index,1);if(!gridPicList.length) emits('clear')} ">X</div> <div class="delete-btn" @click="gridPicList.splice(index,1)">X</div>
<div class="header-btn"></div> <div class="header-btn"></div>
<ViewerItem :gridPicList="gridPicList" :index="index" :images="element"></ViewerItem> <ViewerItem :gridPicList="gridPicList" :index="index" :images="element"></ViewerItem>
</div> </div>
</template> </template>
</draggable> </draggable>
<div class="grid-pic-toolbar"> <div v-if="showToolbar" class="grid-pic-toolbar">
<el-input v-if="showToolbar" style="width: 500px" v-model="inputValue" type="text" /> <el-input style="width: 500px" v-model="inputValue" type="text" />
<el-button v-if="showToolbar" class="add-btn" @click="pushPic"> <el-button class="add-btn" @click="pushPic">
添加 添加
</el-button> </el-button>
<el-button class="add-btn" @click="clearPic"> <el-button class="add-btn" @click="clearPic">
@ -53,7 +53,7 @@
const props = defineProps({ const props = defineProps({
showToolbar: { showToolbar: {
type: Boolean, type: Boolean,
default: false default: true
} }
}) })
// //
@ -149,26 +149,20 @@
addPic(src) addPic(src)
} }
// //
const addPic = (data) => { const addPic = (src) => {
let list = Array.isArray(data)?data:[data] if (gridPicList.value.length >= 9) {
if (gridPicList.value.length + list.length > 9) {
console.log("超出九个图片") console.log("超出九个图片")
emits('outIndex') emits('outIndex')
return return
} }
let listArr = [];
for (let i = 0; i < list.length; i++) {
let src = list[i]
if (!src) { if (!src) {
console.log("图片链接不能为空") console.log("图片链接不能为空")
return; return;
} }
listArr.push({ gridPicList.value.push({
src: src, src: src,
backgroundColor: getRandomColor() backgroundColor: getRandomColor()
}) })
}
gridPicList.value.push(...listArr)
inputValue.value = '' inputValue.value = ''
} }
// //

View File

@ -140,8 +140,5 @@ watch(props.images, (newValue, oldValue) => {
.viewer-item-wrap{ .viewer-item-wrap{
width: 100%; width: 100%;
height: 100%; height: 100%;
:deep(.viewer-canvas img) {
display: block !important;
}
} }
</style> </style>

View File

@ -2,45 +2,34 @@
<el-dialog v-model="isDialog" :show-close="false" width="900" append-to-body destroy-on-close> <el-dialog v-model="isDialog" :show-close="false" width="900" append-to-body destroy-on-close>
<template #header> <template #header>
<div class="custom-header flex"> <div class="custom-header flex">
<span>选择</span> <span>选择{{ title }}</span>
<i class="iconfont icon-guanbi" @click="isDialog = false"></i> <i class="iconfont icon-guanbi" @click="isDialog = false"></i>
</div> </div>
</template> </template>
<div class="dialog-content" v-loading="loading"> <div class="dialog-content">
<div class="content-list"> <div class="content-list">
<el-empty description="暂无数据" v-if="!fileList.length" /> <ul>
<el-radio-group v-model="curFileId"> <li v-for="(item, index) in fileList" :class="activeIndex == index ? 'li-active' : ''"
<el-row> @click="clickItem(index, item)">
<el-col :span="12" v-for="item in fileList" :key="item.id"> <el-image class="img" :src="url" />
<el-radio :value="item.id"> <el-button type="primary" class="prev-btn" @click.stop="onPrevItem(item)">预览</el-button>
<el-text class="w-50" truncated>{{ item.fileName }}</el-text> <el-text truncated>{{ item.fileName }}</el-text>
<div class="flex items-center"> </li>
<el-button type="primary" link v-if="isPrev(item).value" @click="onPrevItem(item)" </ul>
>预览</el-button
>
<el-button type="danger" link @click="removeItem(item)">删除</el-button>
</div>
</el-radio>
</el-col>
</el-row>
</el-radio-group>
</div> </div>
</div> </div>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-upload <el-upload class="upload-demo" :action="uploadFileUrl" :limit="1" :show-file-list="false" :headers="headers"
class="upload-demo" :on-success="onSuccess">
:action="uploadFileUrl"
:limit="1"
:show-file-list="false"
:headers="headers"
:on-success="onSuccess"
>
<el-button type="primary">上传</el-button> <el-button type="primary">上传</el-button>
</el-upload> </el-upload>
<div> <div>
<el-button @click="isDialog = false">取消</el-button> <el-button @click="isDialog = false">取消</el-button>
<el-button type="primary" @click="handleDialog"> 确定 </el-button> <el-button type="primary" @click="isDialog = false">
确定
</el-button>
</div> </div>
</div> </div>
</template> </template>
@ -52,18 +41,21 @@
<i class="iconfont icon-guanbi" @click="prevVisible = false"></i> <i class="iconfont icon-guanbi" @click="prevVisible = false"></i>
</div> </div>
</template> </template>
<div style="height: calc(100vh - 120px); text-align: center;"> <div style="height: calc(100vh - 120px);">
<template v-if="getFileSuffix(prevItem.fileUrl) == 'pdf'"> <template v-if="getFileSuffix(prevItem.fileUrl) == 'pdf'">
<iframe :src="prevItem.fileUrl" frameborder="0" width="100%" height="100%"></iframe> <iframe :src="prevItem.fileUrl"
frameborder="0" width="100%" height="100%"></iframe>
</template> </template>
<template v-else> <template v-else>
<el-image :src="prevItem.fileUrl" style="height: 100%" /> <el-image :src="prevItem.fileUrl" style="height:100%"/>
</template> </template>
</div> </div>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<div></div> <div></div>
<el-button type="primary" @click="prevVisible = false"> 关闭 </el-button> <el-button type="primary" @click="prevVisible = false">
关闭
</el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
@ -71,19 +63,20 @@
<script setup> <script setup>
import { ref, computed, onMounted, reactive } from 'vue' import { ref, computed, onMounted, reactive } from 'vue'
import { completion, addDoc, docList, removeDoc } from '@/api/mode/index.js' import { completion, addDoc, docList } from '@/api/mode/index.js'
import { getToken } from '@/utils/auth' import { getToken } from "@/utils/auth";
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import { dataSetJson } from '@/utils/comm.js' import { dataSetJson } from '@/utils/comm.js'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { getFileSuffix } from '@/utils/ruoyi.js' import { getFileSuffix } from '@/utils/ruoyi.js'
import emitter from '@/utils/mitt' import emitter from '@/utils/mitt';
import { cloneDeep } from 'lodash'
const userInfo = useUserStore().user const userInfo = useUserStore().user
const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + '/common/upload') const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload");
const headers = ref({ Authorization: 'Bearer ' + getToken() }) const headers = ref({ Authorization: "Bearer " + getToken() });
const url = 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F11044b08-04c1-41a0-a453-1fd20b58a614%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1732953359&t=7ab1d1b3a903db85b1149914407aea35'
const isDialog = defineModel() const isDialog = defineModel()
const prevVisible = ref(false) const prevVisible = ref(false)
@ -95,14 +88,36 @@ const props = defineProps({
} }
}) })
const title = computed(() => {
if (props.modeType == 1) return '课标';
if (props.modeType == 2) return '教材';
if (props.modeType == 3) return '考试';
})
const isPrev = (item) => { const radio = ref(1)
return computed(() => { const radioList = ref([
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'webp'].includes(getFileSuffix(item.fileUrl)) { label: '浏览研读', value: 1 },
{ label: '跨学科研读', value: 2 },
{ label: '跨学段研读', value: 3 },
{ label: '课标修订研读', value: 4 },
{ label: '自由研读', value: 5 },
])
const list = ref([
{
name: '高中语文课程标准',
url
}
])
const changeRadio = () => {
list.value = []
for (let i = 0; i < Math.floor(Math.random() * 5) + 1; i++) {
list.value.push({
name: '高中语文课程标准',
url
}) })
}
} }
const activeIndex = ref(0)
const curFileId = ref(0)
const dataset_id = ref('') const dataset_id = ref('')
@ -128,79 +143,43 @@ const onSuccess = async (response) => {
const { msg } = await addDoc(docData) const { msg } = await addDoc(docData)
ElMessage.success(msg) ElMessage.success(msg)
getList() getList()
} }
const curNode = reactive({}) const curNode = reactive({})
// doc ai
const fileList = ref([]) const fileList = ref([])
const curFile = reactive({}) const curFile = reactive({})
const getList = () => { const getList = () => {
docList({ docList({
createUser: userInfo.userId, userId: userInfo.userId,
datasetId: dataset_id.value dataset_id: dataset_id.value
}).then((res) => { }).then(res => {
fileList.value = [...res.rows] fileList.value = [...res.rows]
if(res.rows.length){
Object.assign(curFile, fileList.value[0]) Object.assign(curFile, fileList.value[0])
curFileId.value = fileList.value[0].id
}
}) })
} }
const clickItem = (index, item) => {
// activeIndex.value = index
const loading = ref(false) Object.assign(curFile, item)
const removeItem = (item) => { emitter.emit('changeCurFile', item)
ElMessageBox.confirm('确定要删除?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
loading.value = true
removeDoc(item.id)
.then(() => {
ElMessage.success('操作成功')
getList()
})
.finally(() => {
loading.value = false
})
})
.catch(() => {})
} }
//
const prevItem = reactive({}) const prevItem = reactive({})
const onPrevItem = (item) => { const onPrevItem = (item) => {
Object.assign(prevItem, item) Object.assign(prevItem, item)
prevVisible.value = true prevVisible.value = true
} }
//
const handleDialog = () => {
isDialog.value = false
const item = fileList.value.find((item) => item.id == curFileId.value)
Object.assign(curFile, item)
emitter.emit('changeCurFile', item)
// pdf
if (getFileSuffix(curFile.fileUrl) == 'pdf') {
let data = cloneDeep(curFile)
emitter.emit('changePdfUrl', data)
}
}
onMounted(() => { onMounted(() => {
let data = sessionStore.get('subject.curNode') let data = sessionStore.get('subject.curNode')
Object.assign(curNode, data) Object.assign(curNode, data);
// "-" // "-"
let jsonKey = `考试-${curNode.edustage}-${curNode.edusubject}` let jsonKey = `考试-${curNode.edustage}-${curNode.edusubject}`
dataset_id.value = dataSetJson[jsonKey] dataset_id.value = dataSetJson[jsonKey]
getList() getList()
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.custom-header { .custom-header {
@ -219,6 +198,45 @@ onMounted(() => {
.content-list { .content-list {
padding-top: 10px; padding-top: 10px;
ul {
display: flex;
flex-wrap: wrap;
li {
width: 130px;
display: flex;
flex-direction: column;
font-size: 13px;
padding: 10px;
cursor: pointer;
border-radius: 5px;
overflow: hidden;
margin-right: 20px;
margin-bottom: 10px;
position: relative;
overflow: hidden;
.img {
width: 100%;
height: 130px;
border: solid #ccc 1px;
margin-bottom: 10px;
}
&:hover {
background: #E0EAFF;
}
&:hover .prev-btn {
transform: translate(-50%, -40px)
}
}
.li-active {
background: #E0EAFF;
}
}
} }
} }
@ -228,7 +246,13 @@ onMounted(() => {
justify-content: space-between; justify-content: space-between;
} }
:deep(.el-radio__label) { .prev-btn {
display: flex; position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) translateY(-110px);
/* 按钮初始位置在容器外 */
transition: transform 0.3s ease-in-out;
/* 设置过渡效果 */
} }
</style> </style>

View File

@ -2,9 +2,8 @@
<div class="container-left-page flex"> <div class="container-left-page flex">
<div class="container-left-header flex"> <div class="container-left-header flex">
<el-button link @click="onClick"> <el-button link @click="onClick">
{{ curNode.edustage }}{{ curNode.edusubject {{ curNode.edustage }}{{ curNode.edusubject }}{{ type == 1 ? '课标研读' : type == 2 ? '教材分析' : '考试分析' }}<i
}}{{ type == 1 ? '课标研读' : type == 2 ? '教材分析' : '考试分析' class="iconfont icon-xiangxia"></i>
}}<i v-if="type == 3" class="iconfont icon-xiangxia"></i>
</el-button> </el-button>
</div> </div>
<div class="container-left-pdf"> <div class="container-left-pdf">
@ -21,7 +20,6 @@ import { ref, onMounted, nextTick, reactive } from 'vue'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import PDF from '@/components/PdfJs/index.vue' import PDF from '@/components/PdfJs/index.vue'
import LeftDialog from './left-dialog.vue' import LeftDialog from './left-dialog.vue'
import emitter from '@/utils/mitt'
const props = defineProps(['type']) const props = defineProps(['type'])
@ -31,12 +29,6 @@ const onClick = () => {
showDialog.value = true showDialog.value = true
} }
emitter.on('changePdfUrl', async (data) => {
pdfUrl.value = ''
await nextTick()
pdfUrl.value = data.fileUrl
})
// PDF // PDF
const pdfUrl = ref('') const pdfUrl = ref('')
const curNode = reactive({}) const curNode = reactive({})
@ -44,15 +36,16 @@ onMounted(async () => {
await nextTick() await nextTick()
// //
let nodeData = sessionStore.get('subject.curNode') let nodeData = sessionStore.get('subject.curNode')
Object.assign(curNode, nodeData) Object.assign(curNode, nodeData);
let data = sessionStore.get('subject.curBook') let data = sessionStore.get('subject.curBook')
let fileurl = data.fileurl let fileurl = data.fileurl
if (props.type == 1) { if(props.type == 1){
fileurl = `${data.edustage}-${data.edusubject}-课标.txt` fileurl = `${data.edustage}-${data.edusubject}-课标.txt`
} }
if (fileurl == '') return if(fileurl == '') return
pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt', '.pdf') pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt', '.pdf')
}) })
</script> </script>
@ -60,7 +53,6 @@ onMounted(async () => {
.container-left-page { .container-left-page {
height: 100%; height: 100%;
flex-direction: column; flex-direction: column;
.container-left-header { .container-left-header {
height: 45px; height: 45px;
background: #fff; background: #fff;

View File

@ -16,7 +16,7 @@
</el-dropdown> </el-dropdown>
<div class="flex"> <div class="flex">
<el-select v-model="curMode" placeholder="Select" class="mr-4 w-30"> <el-select v-model="curMode" placeholder="Select" class="mr-4 w-30">
<el-option v-for="item in modeOptions" :key="item.value" :disabled="item.disabled" :label="item.label" :value="item.value" /> <el-option v-for="item in modeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-button type="danger" link :disabled="!(templateList.length)" @click="removeItem(curTemplate, false)"> <el-button type="danger" link :disabled="!(templateList.length)" @click="removeItem(curTemplate, false)">
删除 删除
@ -104,12 +104,6 @@ import { cloneDeep } from 'lodash'
const props = defineProps(['type']) const props = defineProps(['type'])
const { user } = useUserStore() const { user } = useUserStore()
const params = reactive(
{
prompt: '',
dataset_id: ''
}
)
const curMode = ref(2) const curMode = ref(2)
const modeOptions = ref([ const modeOptions = ref([
{ {
@ -118,8 +112,7 @@ const modeOptions = ref([
}, },
{ {
label: '知识库模型', label: '知识库模型',
value: 2, value: 2
disabled: false
} }
]) ])
@ -295,7 +288,12 @@ const onEdit = (index, item) => {
} }
// //
const params = reactive(
{
prompt: '',
dataset_id: ''
}
)
const prompt = ref('') const prompt = ref('')
// //
@ -346,8 +344,6 @@ const againResult = async (index, item) => {
} }
} }
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
// //
const getCompletion = async () => { const getCompletion = async () => {
isStarted.value = new Array(childTempList.length).fill(false) isStarted.value = new Array(childTempList.length).fill(false)
@ -376,7 +372,6 @@ const getCompletion = async () => {
conversationId: conversation_id.value, conversationId: conversation_id.value,
stream: false stream: false
}) })
await delay(1000); // 1
data = res.data data = res.data
} }
// //
@ -485,18 +480,7 @@ onMounted(() => {
getTemplateList() getTemplateList()
let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}` let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}`
params.dataset_id = dataSetJson[jsonKey] params.dataset_id = dataSetJson[jsonKey]
if(!params.dataset_id){
curMode.value = 1
modeOptions.value.forEach(item => {
if(item.value == 2){
item.disabled = true
}
})
}
// ID // ID
conversation_id.value = localStorage.getItem('conversation_id') conversation_id.value = localStorage.getItem('conversation_id')
if (!conversation_id.value) { if (!conversation_id.value) {

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="whiteboart-container" :style="{ height: height + 'px' }"> <div class="whiteboart-container" :style="{ height: height + 'px' }">
<div class="canvasBox" ref="box" @mouseenter.capture="handleMouseEnter" @mouseleave.capture="handleMouseLeave"></div> <div class="canvasBox" ref="box"></div>
<div class="footerLeft" @click.stop <div class="footerLeft" @click.stop
:style="type == 'design' ? ['top: 10px', 'justify-content: space-between'] : ['bottom: 10px', 'justify-content: center']"> :style="type == 'design' ? ['top: 10px', 'justify-content: space-between'] : ['bottom: 10px', 'justify-content: center']">
@ -123,7 +123,7 @@
<!-- 边框样式 --> <!-- 边框样式 -->
<div class="blockBox"> <div class="blockBox">
<el-dropdown @command="updateStyle('lineDash', $event)" placement="top"> <el-dropdown @command="updateStyle('lineDash', $event)" placement="top">
<el-button><el-image :src="borderStyleImg" <el-button><el-image src="../../../src/assets/images/borderstyle.png"
style="width: 14px; height: 14px"></el-image></el-button> style="width: 14px; height: 14px"></el-image></el-button>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
@ -278,7 +278,7 @@
</template> </template>
<script setup> <script setup>
import { onMounted, onBeforeUnmount, ref, getCurrentInstance, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue' import { onMounted, ref, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue'
import TinyWhiteboard from 'whiteboard_lyc' import TinyWhiteboard from 'whiteboard_lyc'
import ColorPicker from './components/ColorPicker.vue' import ColorPicker from './components/ColorPicker.vue'
import { import {
@ -303,10 +303,8 @@ import {
import Contextmenu from './components/Contextmenu.vue' import Contextmenu from './components/Contextmenu.vue'
import { fontFamilyList, fontSizeList } from './constants' import { fontFamilyList, fontSizeList } from './constants'
const borderStyleImg = new URL('../../../src/assets/images/borderstyle.png', import.meta.url).href
const borderImg = new URL('../../../src/assets/images/borderwidth.png', import.meta.url).href const borderImg = new URL('../../../src/assets/images/borderwidth.png', import.meta.url).href
const pointerImg = new URL('../../../src/assets/images/mouse-pointer.png', import.meta.url).href const pointerImg = new URL('../../../src/assets/images/mouse-pointer.png', import.meta.url).href
const { proxy } = getCurrentInstance()
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
@ -509,7 +507,6 @@ const backToCenter = () => {
app.scrollToCenter() app.scrollToCenter()
} }
// //
const showFit = () => { const showFit = () => {
let elementList = app.elements.elementList let elementList = app.elements.elementList
@ -703,6 +700,8 @@ const getCanvasBlob = async () =>{
}) })
} }
watch(() => props.data, (newVal) => { watch(() => props.data, (newVal) => {
if (newVal) { if (newVal) {
setCanvasData(newVal) setCanvasData(newVal)
@ -714,13 +713,6 @@ watch(() => props.data, (newVal) => {
// dom // dom
onMounted(() => { onMounted(() => {
init();
})
/**
* 初始化画布内容
*/
const init = () => {
// //
app = new TinyWhiteboard({ app = new TinyWhiteboard({
container: box.value, container: box.value,
@ -742,7 +734,6 @@ const init = () => {
}) })
// //
app.on('activeElementChange', element => { app.on('activeElementChange', element => {
console.log('点击元素 监听 activeElementChange-----------')
if (activeElement.value) { if (activeElement.value) {
activeElement.value.off('elementRotateChange', onElementRotateChange) activeElement.value.off('elementRotateChange', onElementRotateChange)
} }
@ -790,39 +781,7 @@ const init = () => {
app.resize() app.resize()
}, 300) }, 300)
}) })
} })
const isMyCanvas = ref(false); //
const handleKeyDown=(event)=> {
// console.log(':', event.key);
// console.log(isMyCanvas.value,'??????????')
if(isMyCanvas.value == false){
event.stopPropagation();
// console.log(':', event.key);
}
}
/**
* 鼠标进入事件
*/
const handleMouseEnter = () => {
console.log('进入白板')
isMyCanvas.value = true;
document.addEventListener('keydown', handleKeyDown, true);
}
/**
* 课堂展示-鼠标离开白板监听事件该事件是避免选中状态在其他地方点击后退删除等事件会删除白板内选中的元素
*/
const handleMouseLeave = () => {
console.log('离开白板')
// --
app.cancelActiveElement()
//
isMyCanvas.value = false;
//
document.addEventListener('keydown', handleKeyDown, true);
};
// //
defineExpose({ defineExpose({
@ -832,7 +791,7 @@ defineExpose({
getCanvasJson, getCanvasJson,
getCanvasBase64, getCanvasBase64,
setCanvasData, setCanvasData,
getCanvasBlob, getCanvasBlob
}) })
</script> </script>

View File

@ -1,7 +1,5 @@
import { listEntpcoursework,getEvaluationclue } from '@/api/classTask'; import { listEntpcoursework,getEvaluationclue } from '@/api/classTask';
import { processList } from '@/hooks/useProcessList'; import { processList } from '@/hooks/useProcessList';
import useClassTaskStore from '@/store/modules/classTask'
const useClassTaskStores = useClassTaskStore();
const isJson = (str) => { const isJson = (str) => {
if (typeof str == 'string') { if (typeof str == 'string') {
@ -116,14 +114,6 @@ export const editListItem = (row, courseObj) => {
} }
else if (row.worktype == '科学实验') { else if (row.worktype == '科学实验') {
if(isJson(row.workcodes)){ if(isJson(row.workcodes)){
// 同步更新实验内部的科目信息
if (row.worktag && row.worktag.indexOf('-') > -1){
const eduInfo = row.worktag.split('-');
useClassTaskStores.experimentObj.edustage = eduInfo[0];
useClassTaskStores.experimentObj.edusubject = eduInfo[1];
useClassTaskStores.experimentObj.updateEduInfo = row.worktag;
}
// 更新科学实验内容
classtaskObj.fileHomeworkList = JSON.parse(row.workcodes); classtaskObj.fileHomeworkList = JSON.parse(row.workcodes);
// //
// console.log('科学实验', classtaskObj); // console.log('科学实验', classtaskObj);

View File

@ -299,28 +299,21 @@ export const processList = (row, aloneOption=false) => {
if(!aloneOption && j%2== 0){ if(!aloneOption && j%2== 0){
tmp += '</div>'; tmp += '</div>';
} }
row[i].workdescFormat = tmp; row[i].workdescFormat = tmp
// 处理[答案显示] - 转换ABCD // 处理[答案显示] - 转换ABCD
let arr2Char = workAnswerArr let arr2Char = workAnswerArr
.map((item) => { .map((item) => {
return String.fromCharCode(65 + Number(item)) return String.fromCharCode(65 + Number(item))
}) })
.join(''); .join('')
row[i].workanswerFormat = arr2Char; row[i].workanswerFormat = arr2Char
} else if (row[i].worktype == '填空题') { } else if (row[i].worktype == '填空题') {
// 处理[选项显示] - 填空题中无选项, 故置空 // 处理[选项显示] - 填空题中无选项, 故置空
row[i].workdescFormat = ''; row[i].workdescFormat = ''
// 处理[答案显示] - 逗号连接 // 处理[答案显示] - 逗号连接
row[i].workanswerFormat = workAnswerArr.join('、')
// 当[答案显示]为 [<div] 开头时,不再需逗号连接(一般为自主上传, 当前答案每个自带div标签)
let linkChar = '、';
if (workAnswerArr.length != 0 && workAnswerArr[0].indexOf('<div') == 0) {
linkChar = '';
}
row[i].workanswerFormat = workAnswerArr.join(linkChar);
} else if (row[i].worktype == '判断题') { } else if (row[i].worktype == '判断题') {
// 处理[选项显示] - 判断题中无选项, 故置空 // 处理[选项显示] - 判断题中无选项, 故置空
row[i].workdescFormat = '' row[i].workdescFormat = ''
@ -328,7 +321,7 @@ export const processList = (row, aloneOption=false) => {
// 处理[答案显示] - 1-正常 0-错误 // 处理[答案显示] - 1-正常 0-错误
const answer = workAnswerArr const answer = workAnswerArr
.map((item) => { .map((item) => {
return DICT_TRUE_OR_FALSE.TRUE.includes(item) ? '正确' : DICT_TRUE_OR_FALSE.FALSE.includes(item)?'错误':item; return item === '1' ? '正确' : '错误'
}) })
.join('、') .join('、')
row[i].workanswerFormat = answer row[i].workanswerFormat = answer
@ -341,8 +334,3 @@ export const processList = (row, aloneOption=false) => {
} }
} }
} }
const DICT_TRUE_OR_FALSE = {
TRUE: ['正确', '对', '√', '1'],
FALSE: ['错误', '错', '×', '0'],
};

View File

@ -5,11 +5,7 @@
<el-popover ref="popoverRef" placement="right" trigger="hover" popper-class="popoverStyle" :tabindex="999" > <el-popover ref="popoverRef" placement="right" trigger="hover" popper-class="popoverStyle" :tabindex="999" >
<template #reference> <template #reference>
<div class="user-info"> <div class="user-info">
<el-image class="user-img" :src="img"> <el-image class="user-img" :src="userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api + userStore.user.avatar" />
<template #error>
<img :src="route_path + userStore.user.avatar">
</template>
</el-image>
<span>{{ userStore.user.nickName }}</span> <span>{{ userStore.user.nickName }}</span>
</div> </div>
</template> </template>
@ -64,12 +60,10 @@ import useUserStore from '@/store/modules/user'
import pkc from "../../../../../package.json" import pkc from "../../../../../package.json"
import defaultUserImg from '@/assets/images/img-avatar.png' import defaultUserImg from '@/assets/images/img-avatar.png'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import {toLinkLeftWeb} from "@/utils/tool"
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
const dev_api = ref(import.meta.env.VITE_APP_BASE_API) const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
const route_path = ref(import.meta.env.VITE_APP_BUILD_BASE_PATH)
const userStore = useUserStore() const userStore = useUserStore()
const router = useRouter() const router = useRouter()
const currentRoute = ref('') const currentRoute = ref('')
@ -80,9 +74,6 @@ const activeId = ref('/home')
const version = ref(pkc.version) const version = ref(pkc.version)
const popoverRef = ref('') const popoverRef = ref('')
//
const img = ref('')
const defaultImg = ['/img/avatar-default.jpg','/images/img-avatar.png','/src/assets/images/img-avatar.png']
// //
const isStadium = () => { const isStadium = () => {
@ -127,14 +118,6 @@ const headerMenus = isStadium() ?[{
icon: 'icon-kechengziyuan1', icon: 'icon-kechengziyuan1',
path: '/resource/index' path: '/resource/index'
}, },
{
name: '科学',
id: 4,
icon: 'icon-kechengziyuan1',
path: '/scientific/index',
// path: 'https://res.bakclass.com/resource/laboratoryIndex',
// type: 'webview', //
},
] ]
const sideBottomMenu = [ const sideBottomMenu = [
@ -175,17 +158,10 @@ const computedregistertype = computed(() => {
} }
}) })
const clickMenu = (item) => { const clickMenu = ({ id, disabled, path }) => {
const { id, disabled, path, type } = item
if (disabled) return if (disabled) return
if (type == 'webview') { //
toLinkLeftWeb(item.path)
} else if (type == 'link') {
window.open(path)
} else {
activeId.value = id activeId.value = id
router.push(path) router.push(path)
}
} }
const onUserTo = (path) =>{ const onUserTo = (path) =>{
@ -232,11 +208,6 @@ const logout = () => {
onMounted(() => { onMounted(() => {
userStore.getDeptInfo() userStore.getDeptInfo()
// getregisterinfo() // getregisterinfo()
if(defaultImg.includes(userStore.user.avatar)){
img.value = defaultUserImg
}else{
img.value = dev_api.value + userStore.user.avatar
}
}) })
</script> </script>
@ -358,7 +329,6 @@ onMounted(() => {
color: #fff; color: #fff;
font-size: 12px; font-size: 12px;
margin-top: 5px; margin-top: 5px;
text-align: center;
} }
.pointer-events{ .pointer-events{
pointer-events: none; pointer-events: none;

View File

@ -11,7 +11,7 @@
<span class="ml-5">{{ curNode.itemtitle }}</span> <span class="ml-5">{{ curNode.itemtitle }}</span>
</div> </div>
<div class="header-center" v-else> <div class="header-center" v-else>
{{APP_TITLE}}{{ version }} AI文枢{{ version }}
</div> </div>
<div class="header-right"> <div class="header-right">
<WindowTools /> <WindowTools />
@ -29,7 +29,6 @@ import pkc from "../../../../../package.json"
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
const version = ref(pkc.version) const version = ref(pkc.version)
const APP_TITLE = import.meta.env.VITE_APP_TITLE
// //
const router = useRouter() const router = useRouter()

View File

@ -10,15 +10,6 @@ import './assets/iconfont/iconfont'
import 'virtual:windi.css' import 'virtual:windi.css'
import request from "@/utils/request"; import request from "@/utils/request";
//v-md-editor
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
// 引入你所使用的主题 此处以 github 主题为例
import githubTheme from '@kangc/v-md-editor/lib/theme/github';
import '@kangc/v-md-editor/lib/theme/style/github.css';
// highlightjs
import hljs from 'highlight.js';
import { store } from '@/store' import { store } from '@/store'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
@ -26,9 +17,6 @@ import log from 'electron-log/renderer' // 渲染进程日志-文件记录
import customComponent from '@/components/common' // 自定义组件 import customComponent from '@/components/common' // 自定义组件
import plugins from './plugins' // plugins插件 import plugins from './plugins' // plugins插件
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import aiAudio from 'aix-plugins-aitools' // 文字转语音插件
import '../../../node_modules/aix-plugins-aitools/aitools.css'
if(process.env.NODE_ENV != 'development') { // 非开发环境,将日志打印到日志文件 if(process.env.NODE_ENV != 'development') { // 非开发环境,将日志打印到日志文件
Object.assign(console, log.functions) // 渲染进程日志-控制台替换 Object.assign(console, log.functions) // 渲染进程日志-控制台替换
@ -51,40 +39,6 @@ app.config.globalProperties.$requestGetJYW = (url,config)=>{
import Icon from '@/AixPPTist/src/plugins/icon' import Icon from '@/AixPPTist/src/plugins/icon'
import Directive from '@/AixPPTist/src/plugins/directive' import Directive from '@/AixPPTist/src/plugins/directive'
VMdPreview.use(githubTheme, {
Hljs: hljs,
});
(function () {
//!['development', 'mock'].includes(process.env.NODE_ENV)&&
if (import.meta.env.VITE_SHOW_DEV_TOOLS==='false') {
['log', 'warn', 'error', 'info'].forEach((item) => {
console[item] = (function (func) {
const res = localStorage.getItem('debug');
if (res === 'GMV_desk') {
return func;
}
return function () {};
})(console[item]);
});
}
})()
let script = document.createElement('script');
if (process.env.NODE_ENV !== 'development') {
const isNode = typeof require !== 'undefined' // 是否支持node函数
const path = isNode?require('path'):{}
// 设置 src 属性
script.src = path.join(__dirname, "/lib/build/aws-sdk-2.100.0.min.js");
}else {
script.src = "https://sdk.amazonaws.com/js/aws-sdk-2.100.0.min.js";
}
// 设置 async 属性,让脚本异步加载
script.async = false;
// 将 script 元素添加到文档的 head 元素中
document.head.appendChild(script);
app.use(router) app.use(router)
.use(store) .use(store)
.use(ElementPlus, { locale: zhLocale }) .use(ElementPlus, { locale: zhLocale })
@ -92,8 +46,6 @@ app.use(router)
.use(plugins) .use(plugins)
.use(Icon) .use(Icon)
.use(Directive) .use(Directive)
.use(aiAudio)
.use(VMdPreview)
.mount('#app') .mount('#app')
const isStadium = (user) => { const isStadium = (user) => {

File diff suppressed because it is too large Load Diff

View File

@ -1,358 +0,0 @@
// import type { number } from "echarts"
export interface Shadow {
h: number
v: number
blur: number
color: string
}
export interface Shape {
type: 'shape'
left: number
top: number
width: number
height: number
borderColor: string
borderWidth: number
borderType: 'solid' | 'dashed' | 'dotted'
borderStrokeDasharray: string
shadow?: Shadow
fillColor: string
content: string
isFlipV: boolean
isFlipH: boolean
rotate: number
shapType: string
vAlign: string
path?: string
name: string
}
export interface Text {
type: 'text'
left: number
top: number
width: number
height: number
borderColor: string
borderWidth: number
borderType: 'solid' | 'dashed' | 'dotted'
borderStrokeDasharray: string
shadow?: Shadow
fillColor: string
isFlipV: boolean
isFlipH: boolean
isVertical: boolean
rotate: number
content: string
vAlign: string
name: string
}
export interface Image {
type: 'image'
left: number
top: number
width: number
height: number
src: string
rotate: number
isFlipH: boolean
isFlipV: boolean
}
export interface TableCell {
text: string
rowSpan?: number
colSpan?: number
vMerge?: number
hMerge?: number
fillColor?: string
fontColor?: string
fontBold?: boolean
}
export interface Table {
type: 'table'
left: number
top: number
width: number
height: number
data: TableCell[][]
borderColor: string
borderWidth: number
borderType: 'solid' | 'dashed' | 'dotted'
}
export type ChartType = 'lineChart' |
'line3DChart' |
'barChart' |
'bar3DChart' |
'pieChart' |
'pie3DChart' |
'doughnutChart' |
'areaChart' |
'area3DChart' |
'scatterChart' |
'bubbleChart' |
'radarChart' |
'surfaceChart' |
'surface3DChart' |
'stockChart'
export interface ChartValue {
x: string
y: number
}
export interface ChartXLabel {
[key: string]: string
}
export interface ChartItem {
key: string
values: ChartValue[]
xlabels: ChartXLabel
}
export type ScatterChartData = [number[], number[]]
export interface CommonChart {
type: 'chart'
left: number
top: number
width: number
height: number
data: ChartItem[]
chartType: Exclude<ChartType, 'scatterChart' | 'bubbleChart'>
barDir?: 'bar' | 'col'
marker?: boolean
holeSize?: string
grouping?: string
style?: string
}
export interface ScatterChart {
type: 'chart'
left: number
top: number
width: number
height: number
data: ScatterChartData,
chartType: 'scatterChart' | 'bubbleChart'
}
export type Chart = CommonChart | ScatterChart
export interface Video {
type: 'video'
left: number
top: number
width: number
height: number
blob?: string
src?: string
}
export interface Audio {
type: 'audio'
left: number
top: number
width: number
height: number
blob: string
}
export interface Diagram {
type: 'diagram'
left: number
top: number
width: number
height: number
elements: (Shape | Text)[]
}
export interface Math {
type: 'math'
left: number
top: number
width: number
height: number
latex: string
}
export type BaseElement = Shape | Text | Image | Table | Chart | Video | Audio | Diagram | Math
export interface Group {
type: 'group'
left: number
top: number
width: number
height: number
rotate: number
elements: BaseElement[]
}
export type Element = BaseElement | Group
export interface SlideColorFill {
type: 'color'
value: string
}
export interface SlideImageFill {
type: 'image'
value: {
picBase64: string
opacity: number
}
}
export interface SlideGradientFill {
type: 'gradient'
value: {
rot: number
colors: {
pos: string
color: string
}[]
}
}
export type SlideFill = SlideColorFill | SlideImageFill | SlideGradientFill
export interface Slide {
fill: SlideFill
elements: Element[]
note: string
}
export interface Options {
slideFactor?: number
fontsizeFactor?: number
}
export const parse: (file: ArrayBuffer, options?: Options) => Promise<{
slides: Slide[]
size: {
width: number
height: number
}
}>
/** zdg: 新内容 */
export const align = {
getHorizontalAlign?: (t,e,r,n) => string
getVerticalAlign?: (t,e,r,n) => string
}
export const border = {
getBorder?: (t,e,r) => string
}
export const chart = {
getChartInfo?: (t) => string
}
export const color = {
applyHueMod?: (t) => string
applyLumMod?: (t) => string
applyLumOff?: (t) => string
applySatMod?: (t) => string
applyShade?: (t) => string
applyTint?: (t) => string
getColorName2Hex?: (t) => string
hslToRgb?: (t) => string
hueToRgb?: (t) => string
}
export const fontStyle = {
getFontBold?: (t) => string
getFontColor?: (t) => string
getFontDecoration?: (t) => string
getFontDecorationLine?: (t) => string
getFontItalic?: (t) => string
getFontShadow?: (t) => string
getFontSize?: (t) => string
getFontSpace?: (t) => string
getFontSubscript?: (t) => string
getFontType?: (t) => string
}
export const fill = {
getBgGradientFill?: (bgPr, phClr, slideMasterContent, warpObj) => string|object|null
getBgPicFill?: (bgPr, sorce, warpObj) => object|null
getFillType?: (node) => string
getPicFill?: (type, node, warpObj) => string|null|undefined
getPicFillBase64?: (zipPath, zipObj) => string|null|undefined
getShapeFill?: (node, isSvgMode, warpObj) => object|null
getShapeFillBg?: (node, source, warpObj) => object<{zipPath:string,opacity:number}>|null
getSlideBackgroundFill?: (warpObj) => object<{type: string, value: string}>
getSolidFill?: (solidFill, clrMap, phClr, warpObj) => string
}
export const math = {
findOMath?: (t) => string
latexFormart?: (t) => string
parseAccent?: (t) => string
parseBar?: (t) => string
parseBox?: (t) => string
parseDelimiter?: (t) => string
parseEqArr?: (t) => string
parseFraction?: (t) => string
parseFunction?: (t) => string
parseGroupChr?: (t) => string
parseLimit?: (t) => string
parseMatrix?: (t) => string
parseNary?: (t) => string
parseOMath?: (t) => string
parseRadical?: (t) => string
parseSubscript?: (t) => string
parseSuperscript?: (t) => string
}
export const position = {
getPosition?: (t) => string
getPt?: (t) => string
getSize?: (t) => string
}
export const readXmlFile = {
readXmlFile?: (t) => string
simplifyLostLess?: (t) => string
}
export const schemeColor = {
getSchemeColorFromTheme?: (t) => string
}
export const shadow = {
getShadow?: (t) => string
}
export const shape = {
getCustomShapePath?: (t) => string
shapeArc?: (t) => string
}
export const table = {
getTableBorders?: (t) => string
getTableCellParams?: (t) => string
getTableRowParams?: (t) => string
}
export const text = {
genSpanElement?: (t) => string
genTextBody?: (t) => string
getListType?: (t) => string
}
export const utils = {
angleToDegrees?: (t) => string
base64ArrayBuffer?: (t) => string
eachElement?: (t) => string
escapeHtml?: (t) => string
extractFileExtension?: (t) => string
getMimeType?: (t) => string
getTextByPathList?: (t) => string
isVideoLink?: (t) => string
toHex?: (t) => string
}
export const genChart: (node, warpObj) => object
export const genDiagram: (node, warpObj) => object
export const genShape: (node, slideLayoutSpNode, slideMasterSpNode, name, type, warpObj) => object
export const genTable: (node, warpObj) => object
export const getContentTypes: (zip) => object
export const getNote: (noteContent) => string
export const getSlideInfo: (zip) => object
export const getSlideLayoutEl: (warpObj, isPh) => Array
export const indexNodes: (content) => object
export const loadTheme: (zip) => object|null
export const processCxnSpNode: (node, warpObj) => object
export const processGraphicFrameNode: (node, warpObj, source) => string
export const processGroupSpNode: (node, warpObj, source) => object|null
export const processMathNode: (t) => string
export const processNodesInSlide: (t) => string
export const processPicNode: (t) => string
export const processSingleSlide: (t) => string
export const processSpNode: (t) => string

File diff suppressed because it is too large Load Diff

View File

@ -90,24 +90,12 @@ export const constantRoutes = [
name: 'questionUpload', name: 'questionUpload',
meta: { title: '习题上传', showBread: true } meta: { title: '习题上传', showBread: true }
}, },
{
path: 'groupTestPaper',
component: () => import('@/views/classTask/groupTestPaper/index.vue'),
name: 'groupTestPaper',
meta: { title: '自动组卷', showBread: true }
},
{ {
path: 'aiKolors', path: 'aiKolors',
component: () => import('@/components/ai-kolors/index.vue'), component: () => import('@/components/ai-kolors/index.vue'),
name: 'aiKolors', name: 'aiKolors',
meta: { title: '文生图片', showBread: true } meta: { title: '文生图片', showBread: true }
}, },
{
path: 'aiVoice',
component: () => import('@/components/ai-voice/index.vue'),
name: 'aiVoice',
meta: { title: '语音生成', showBread: true }
},
] ]
}, },
@ -227,18 +215,6 @@ const dynamicRoutes = [
} }
] ]
}, },
{
path: '/scientific',
component: Layout,
children: [
{
path: 'index',
component: () => import('@/views/scientific/index.vue'),
name: 'scientific',
meta: { title: '科学' },
}
]
},
{ {
path: '/hashrate', path: '/hashrate',
component: Layout, component: Layout,

View File

@ -2,16 +2,13 @@ import { defineStore } from 'pinia'
import { } from '@/api/classTask/index.js' import { } from '@/api/classTask/index.js'
import { listClassmain } from '@/api/classManage/index' import { listClassmain } from '@/api/classManage/index'
import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo" import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo"
import { listEvaluation } from '@/api/subject'
import { getBindlist, listKnowlegepointFormat } from '@/api/education/knowledgePoint'
const useClassTaskStore = defineStore('classTask',{ const useClassTaskStore = defineStore('classTask',{
state: () => ({ state: () => ({
experimentObj:{ experimentObj:{
edustage: '小学', // 教育阶段 edustage: '小学', // 教育阶段
edusubject: '数学', // 学科 edusubject: '', // 学科
experimentList: [], // 实验科目列表 experimentList: [], // 实验科目列表
updateEduInfo: '小学-数学', //实际需上传的学段+学科信息(用于上传及回显实验内的学段学科)
}, },
isOpenQuestUploadView: false, // 是否打开习题上传的页面 isOpenQuestUploadView: false, // 是否打开习题上传的页面
classListIds: [], classListIds: [],
@ -40,7 +37,6 @@ const useClassTaskStore = defineStore('classTask',{
{label: '2021', value: '2021'}, {label: '2021', value: '2021'},
{label: '2020', value: '2020'}, {label: '2020', value: '2020'},
], // 习题查询条件 - 年份 ], // 习题查询条件 - 年份
entpCourseWorkPointList: [], // 习题查询条件 - 知识点
}), }),
actions: { actions: {
listClassmain(params) { listClassmain(params) {
@ -72,36 +68,6 @@ const useClassTaskStore = defineStore('classTask',{
console.error('更新第三方题源+题型err:', error); console.error('更新第三方题源+题型err:', error);
}); });
}, },
// 根据学科和学段获取知识点
initJYPoint(params) {
/**
* 格式化知识点: 分两种情况
* 1. 语文/英语: 获取学科下的所有知识点(该学科对应无章节与知识点绑定, 故只获取全知识点)
* 2. 其他: 获取当前章节下的所有知识点
*/
this.entpCourseWorkPointList = [];
let id = params.levelSecondId!='' ? params.levelSecondId : params.levelFirstId;
if( params.edusubject == '语文' || params.edusubject == '英语'){
id = params.textbookId;
listEvaluation({ edusubject: params.edusubject, edustage: params.edustage, itemkey: "subject", pageSize: 10 }).then((res => {
id = res.rows[0]?.id;
if (id) {
listKnowlegepointFormat({evalId: id, pageNum: 1, pageSize: 5000,}).then(res => {
this.entpCourseWorkPointList = formatKnowledgePoint(res.rows);
console.log('1.entpCourseWorkPointList->', this.entpCourseWorkPointList);
});
}
}))
}else{
getBindlist({ eid: id }).then(res => {
if (res.data && res.data.length > 0) {
this.entpCourseWorkPointList = res.data;
console.log('2.entpCourseWorkPointList->', this.entpCourseWorkPointList);
}
})
}
},
}, },
persist: true persist: true
}) })
@ -142,20 +108,3 @@ const getJYCT = (params) => {
}) })
}) })
} }
/**
* @desc: 遍历原知识点数据, 将title字段转为knowTitle以供knowledgePointProps进行tree的格式转换显示
* @return: {*}
* @param {*} list
*/
const formatKnowledgePoint = (list) => {
list.forEach(item => {
if (item.title && item.title != '') {
item.knowTitle = item.title;
}
if (item.children && Array.isArray(item.children)) {
formatKnowledgePoint(item.children);
}
});
return list;
};

View File

@ -395,11 +395,7 @@ export const dataSetJson = {
"课标-高中-英语": "e889fcac9fd011efb22a0242ac140006", "课标-高中-英语": "e889fcac9fd011efb22a0242ac140006",
"课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006", "课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
"课标-高中-地理": "270516829fd111efb13c0242ac140006", "课标-高中-地理": "270516829fd111efb13c0242ac140006",
"课标-高中-物理": "3865b5afc68211ef90890242ac140002",
"课标-高中-化学": "013d0c52c68311ef84220242ac140002",
"课标-高中-政治": "a2f0b247b85d11ef84290242ac140005", "课标-高中-政治": "a2f0b247b85d11ef84290242ac140005",
"教材-高中-物理": "3865b5afc68211ef90890242ac140002",
"教材-高中-化学": "013d0c52c68311ef84220242ac140002",
"教材-高中-语文": "cee3062a9fcf11efa6910242ac140006", "教材-高中-语文": "cee3062a9fcf11efa6910242ac140006",
"教材-高中-生物": "fb5d01d59fd011ef9bb90242ac140006", "教材-高中-生物": "fb5d01d59fd011ef9bb90242ac140006",
"教材-高中-历史": "f2f6c1fb9fd011ef98740242ac140006", "教材-高中-历史": "f2f6c1fb9fd011ef98740242ac140006",
@ -407,54 +403,11 @@ export const dataSetJson = {
"教材-高中-数学": "e03aa4fe9fd011ef91270242ac140006", "教材-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
"教材-高中-地理": "270516829fd111efb13c0242ac140006", "教材-高中-地理": "270516829fd111efb13c0242ac140006",
"教材-高中-政治": "a2f0b247b85d11ef84290242ac140005", "教材-高中-政治": "a2f0b247b85d11ef84290242ac140005",
"考试-小学-语文": "570f7ed2cc9d11ef9e070242ac140002",
"考试-小学-数学": "983270b8cc9d11efbbd80242ac140002",
"考试-小学-英语": "d5f80e4ccc9d11ef96fa0242ac140002",
"课标-小学-信息科技": "2fe08c7ad18911efbeaa0242ac140002",
"课标-小学-科学": "935cfec8bf6a11ef98950242ac140006", "课标-小学-科学": "935cfec8bf6a11ef98950242ac140006",
"课标-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002", "课标-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002",
"课标-小学-语文": "f76f1aa5bf7111ef90c80242ac140002", "课标-小学-语文": "f76f1aa5bf7111ef90c80242ac140002",
"课标-小学-道德": "8da87869cbd711ef92280242ac140002",
"课标-小学-英语": "dc963316cbd811ef8d820242ac140002",
"课标-小学-劳动": "fc047d81cbdc11efa1740242ac140002",
"教材-小学-信息科技": "2fe08c7ad18911efbeaa0242ac140002",
"教材-小学-科学": "935cfec8bf6a11ef98950242ac140006", "教材-小学-科学": "935cfec8bf6a11ef98950242ac140006",
"教材-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002", "教材-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002",
"教材-小学-语文": "f76f1aa5bf7111ef90c80242ac140002", "教材-小学-语文": "f76f1aa5bf7111ef90c80242ac140002",
"教材-小学-道德": "8da87869cbd711ef92280242ac140002",
"教材-小学-英语": "dc963316cbd811ef8d820242ac140002",
"教材-小学-劳动": "fc047d81cbdc11efa1740242ac140002",
"教材-初中-道德与法治": "df9f3ccccbdd11ef9e550242ac140002",
"教材-初中-语文": "3770ad18cbde11efadaa0242ac140002",
"教材-初中-数学": "8cc0a799cbde11ef8b440242ac140002",
"教材-初中-英语": "07b58ca2cbdf11efaa180242ac140002",
"教材-初中-物理": "86f2c018cbf211ef9d6a0242ac140002",
"教材-初中-化学": "c7b34790cbf211ef92350242ac140002",
"教材-初中-生物": "083ac3edcbf311efaad30242ac140002",
"教材-初中-地理": "7ee584e1cbf311efbd270242ac140002",
"教材-初中-历史": "8ae07971cbf411ef81e70242ac140002",
"教材-初中-信息技术": "ca476233cbf411efa9860242ac140002",
"课标-初中-道德与法治": "df9f3ccccbdd11ef9e550242ac140002",
"课标-初中-语文": "3770ad18cbde11efadaa0242ac140002",
"课标-初中-数学": "8cc0a799cbde11ef8b440242ac140002",
"课标-初中-英语": "07b58ca2cbdf11efaa180242ac140002",
"课标-初中-物理": "86f2c018cbf211ef9d6a0242ac140002",
"课标-初中-化学": "c7b34790cbf211ef92350242ac140002",
"课标-初中-生物": "083ac3edcbf311efaad30242ac140002",
"课标-初中-地理": "7ee584e1cbf311efbd270242ac140002",
"课标-初中-历史": "8ae07971cbf411ef81e70242ac140002",
"课标-初中-信息技术": "ca476233cbf411efa9860242ac140002",
"考试-初中-语文": "6be6d201cc0111ef89100242ac140002",
"考试-初中-数学": "d764b539cc0111ef8f1b0242ac140002",
"考试-初中-英语": "3477cff7cc9911efbfa50242ac140002",
"考试-初中-政治": "7ac981d8cc9a11efa5dc0242ac140002",
"考试-初中-历史": "c058a33acc9a11efb7f00242ac140002",
"考试-初中-地理": "5548224ecc9b11efa76d0242ac140002",
"考试-初中-生物": "206c5fd3cc9c11ef990f0242ac140002",
"考试-初中-物理": "93039442cc9c11ef89b10242ac140002",
"考试-初中-化学": "f8d78002cc9c11efbbf60242ac140002",
"鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm" "鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm"
} }

View File

@ -106,22 +106,6 @@ const getBackGroundV2 = async () => {
throw error; throw error;
} }
}; };
const createOutlineV2 = async (data) => {
try {
const response = await request({
url:"/api/aipptV2/createOutlineV2",
method: "POST",
data
});
console.log("createOutline response:", response);
return response.data;
} catch (error) {
console.error("请求失败:", error);
throw error;
}
};
const createPPTV2 = async (data) => { const createPPTV2 = async (data) => {
try { try {
const response = await req("/api/aipptV2/createV2", "POST", data); const response = await req("/api/aipptV2/createV2", "POST", data);
@ -133,18 +117,6 @@ const createPPTV2 = async (data) => {
throw error; throw error;
} }
}; };
const createPptByOutline = async (data) => {
try {
const response = await req("/api/aipptV2/createPptByOutline", "POST", data);
console.log("createOutline response:", response);
return response.data;
} catch (error) {
console.error("请求失败:", error);
throw error;
}
};
const getProgressV2 = async (id) => { const getProgressV2 = async (id) => {
try { try {
const response = await req(`/api/aipptV2/progressV2?sid=${id}`, "GET"); const response = await req(`/api/aipptV2/progressV2?sid=${id}`, "GET");
@ -155,4 +127,4 @@ const getProgressV2 = async (id) => {
} }
}; };
export { createOutline, getBackGround, createPPT, getProgress, getBackGroundV2, createOutlineV2, createPPTV2, getProgressV2, createByOutline, createPptByOutline }; export { createOutline, getBackGround, createPPT, getProgress, getBackGroundV2, createPPTV2, getProgressV2, createByOutline };

View File

@ -1,16 +1,11 @@
/** /**
* ppt 相关方法 * ppt 转换为图片
*/ */
import { h, render, getCurrentInstance } from 'vue' import { h, render, getCurrentInstance } from 'vue'
import { toPng, toJpeg } from 'html-to-image' // 引入html-to-image库 import { toPng, toJpeg } from 'html-to-image' // 引入html-to-image库
import { PPTXFileToJson } from "@/AixPPTist/src/hooks/useImport" import { PPTXFileToJson } from "@/AixPPTist/src/hooks/useImport"
import ThumbnailSlide from '@/AixPPTist/src/views/components/ThumbnailSlide/index.vue' import ThumbnailSlide from '@/AixPPTist/src/views/components/ThumbnailSlide/index.vue'
import { useSlidesStore } from '@/AixPPTist/src/store' import { useSlidesStore } from '@/AixPPTist/src/store'
import * as ElementPlus from 'element-plus'
import { sessionStore } from '@/utils/store' // electron-store 状态管理
import { getStaticUrl } from '@/utils/tool' // 工具类
import * as Http_Classcourse from '@/api/teaching/classcourse' // api接口
// 延时 // 延时
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
@ -90,121 +85,3 @@ export const pptToImg = async(file, options) => {
const { slides } = await PPTXFileToJson(file) const { slides } = await PPTXFileToJson(file)
return slidesToImg(slides, options) return slidesToImg(slides, options)
} }
/**
* 课堂-分享码
*/
export const ShareCode = async(code, cb) => {
let shareCode
if (typeof code =='string') shareCode = code
else { // 自动获取邀请码
const classcourse = sessionStore.get('curr.classcourse') // 课堂信息
if (!classcourse) return ElementPlus.ElMessage.warning('没有课堂信息')
const isRefresh = typeof code == 'boolean' && code // 是否刷新邀请码
shareCode = classcourse.shareCode
if (!shareCode || isRefresh) { // 获取邀请码
const res = await Http_Classcourse.getShareCode(classcourse.id)
shareCode = res.msg
// 更新邀请码
sessionStore.set('curr.classcourse.shareCode', shareCode)
}
}
const msg = h('div', [
h('h1', [`我的邀请码:`, h('b',{style:{color:'#F56C6C',fontSize:'1.5em'}}, shareCode)]),
h('div', {style:{color:'#E6A23C',fontSize:'13px'}}, `该邀请码1小时内有效请在学生端填写邀请码后即可进入课堂。`)
])
return ElementPlus.ElMessageBox.alert(msg, '分享课程', {
confirmButtonText: '更新',
cancelButtonText: '关闭',
showCancelButton: true,
beforeClose: (action, instance, done) => {
if (action =='confirm') { // 更新
if (!!cb) { // 回调
cb({ h, instance, action, done }, done) && done()
} else { // 默认更新
ShareCode(true)
done()
}
} else done()
}
}).catch(() => {})
}
/**
* 提示框
* @param {*} msg 内容
* @param {*} title 标题
* @param {*} option 配置
* @param {*} cb 关闭前回调 ({ h, instance, action, done }, done)
* @returns
*/
export const Alert = async (msg, title, option, cb) => {
try {
if (typeof msg == 'function') msg = await msg(h)
return await ElementPlus.ElMessageBox.alert(msg, title, {
confirmButtonText: '确认',
cancelButtonText: '关闭',
showCancelButton: true,
beforeClose: (action, instance, done) => {
if (action == 'confirm') { // 确认
if (!!cb) { // 回调
cb({ h, instance, action, done }, done) && done()
} else { // 默认确认
done()
}
} else done()
},
...option,
})
} catch { }
}
/**
* 课堂工具栏-钩子
*/
export const ToolType = {
/** 分享码 */
SHARE_CODE: 'shareCode',
/** 课堂点名 */
NAMED: 'named',
}
export const ToolHandle = async(type, data, cb) => {
const classcourse = sessionStore.get('curr.classcourse') // 课堂信息
switch (type) {
case ToolType.SHARE_CODE:
return ShareCode(data, cb)
case ToolType.NAMED: {
if (!classcourse) return ElementPlus.ElMessage.warning('没有课堂信息!')
const avatar = getStaticUrl('/icon/avatar.svg')
const timgroupid = classcourse.timgroupid
if (!timgroupid) return ElementPlus.ElMessage.warning('没有课堂群信息!')
// 课堂点名
const res = await Http_Classcourse.rollCall(timgroupid)
if (!(res && res.code == 200 && res.data)) return ElementPlus.ElMessage.warning('点名失败!')
const userList = res?.data || []
const refresh = () => { ToolHandle(ToolType.NAMED); return true }
Alert(h => {
const attr_0 = {style:{display:'flex',gap:'10px', cursor:'pointer'}}
const attr_1 = { style:{display:'inline-flex',alignItems:'center',gap:'10px',padding:'5px 10px'}}
const attr_2 = { src: avatar, style: { width: '50px', height: '50px' }}
const attr_3 = { style: { fontSize: '20px', fontWeight: 'bold', color: '#409EFF' }}
const attr_4 = { style: { fontSize: '12px' }}
const userList_H = userList.map(o => {
attr_1.title = o.name
attr_4.style.color = o.online ? '#67C23A' : '#F56C6C'
return h('div', attr_1, [
h('img', attr_2),
h('div', [
h('p', attr_3, o.name),
h('span', attr_4, o.online?'在线':'离线')
])
])
})
return h('div', attr_0, userList_H)
}, '课堂点名', { confirmButtonText: '刷新' }, refresh)
break;
}
default:
break
}
}

View File

@ -1,138 +0,0 @@
/**
* svg 相关工具类
* @module svgUtils
* import { svgUtils } from '@/utils/svgUtils'
* @author: zdg
*/
// zdg: 计算路径的边界
export const calculatePathDimensions = (d) => {
let minX = Infinity;
let maxX = -Infinity;
let minY = Infinity;
let maxY = -Infinity;
let currentX = 0;
let currentY = 0;
const commandRegex = /([A-Za-z])([^A-Za-z]+)/g;
let match;
while ((match = commandRegex.exec(d))!== null) {
const type = match[1];
const params = match[2].trim().split(/\s+|,/).map(Number);
switch (type) {
case 'M': // 移动到
currentX = params[0];
currentY = params[1];
break;
case 'L': // 直线到
currentX = params[0];
currentY = params[1];
break;
case 'H': // 水平直线
currentX = params[0];
break;
case 'V': // 垂直直线
currentY = params[0];
break;
case 'C': // 三次贝塞尔曲线
for (let i = 0; i < params.length; i += 6) {
const control1X = params[i];
const control1Y = params[i + 1];
const control2X = params[i + 2];
const control2Y = params[i + 3];
const endX = params[i + 4];
const endY = params[i + 5];
// 更新边界
if (control1X < minX) minX = control1X;
if (control1X > maxX) maxX = control1X;
if (control1Y < minY) minY = control1Y;
if (control1Y > maxY) maxY = control1Y;
if (control2X < minX) minX = control2X;
if (control2X > maxX) maxX = control2X;
if (control2Y < minY) minY = control2Y;
if (control2Y > maxY) maxY = control2Y;
if (endX < minX) minX = endX;
if (endX > maxX) maxX = endX;
if (endY < minY) minY = endY;
if (endY > maxY) maxY = endY;
currentX = endX;
currentY = endY;
}
break;
case 'S': // 光滑三次贝塞尔曲线
for (let i = 0; i < params.length; i += 4) {
const controlX = params[i];
const controlY = params[i + 1];
const endX = params[i + 2];
const endY = params[i + 3];
// 更新边界
if (controlX < minX) minX = controlX;
if (controlX > maxX) maxX = controlX;
if (controlY < minY) minY = controlY;
if (controlY > maxY) maxY = controlY;
if (endX < minX) minX = endX;
if (endX > maxX) maxX = endX;
if (endY < minY) minY = endY;
if (endY > maxY) maxY = endY;
currentX = endX;
currentY = endY;
}
break;
case 'Q': // 二次贝塞尔曲线
for (let i = 0; i < params.length; i += 4) {
const controlX = params[i];
const controlY = params[i + 1];
const endX = params[i + 2];
const endY = params[i + 3];
// 更新边界
if (controlX < minX) minX = controlX;
if (controlX > maxX) maxX = controlX;
if (controlY < minY) minY = controlY;
if (controlY > maxY) maxY = controlY;
if (endX < minX) minX = endX;
if (endX > maxX) maxX = endX;
if (endY < minY) minY = endY;
if (endY > maxY) maxY = endY;
currentX = endX;
currentY = endY;
}
break;
case 'T': // 光滑二次贝塞尔曲线
for (let i = 0; i < params.length; i += 2) {
const endX = params[i];
const endY = params[i + 1];
// 更新边界
if (endX < minX) minX = endX;
if (endX > maxX) maxX = endX;
if (endY < minY) minY = endY;
if (endY > maxY) maxY = endY;
currentX = endX;
currentY = endY;
}
break;
case 'A': // 椭圆弧
const endX = params[5];
const endY = params[6];
// 更新边界
if (endX < minX) minX = endX;
if (endX > maxX) maxX = endX;
if (endY < minY) minY = endY;
if (endY > maxY) maxY = endY;
currentX = endX;
currentY = endY;
break;
case 'Z': // 闭合路径
// 闭合路径不影响边界,这里不需要额外操作
break;
default:
console.error(`Unknown command: ${type}`);
break;
}
if (currentX < minX) minX = currentX;
if (currentX > maxX) maxX = currentX;
if (currentY < minY) minY = currentY;
if (currentY > maxY) maxY = currentY;
}
const width = maxX - minX;
const height = maxY - minY;
return { width, height };
}

View File

@ -1,5 +1,3 @@
import {ElMessage} from "element-plus";
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
export const asyncLocalFile = (item) => { export const asyncLocalFile = (item) => {
@ -17,9 +15,6 @@ export const asyncLocalFile = (item) => {
fileName: item.fileNewName fileName: item.fileNewName
}) })
ipcRenderer.once('download-file-default' + item.fileNewName, (e, isSuccess) => { ipcRenderer.once('download-file-default' + item.fileNewName, (e, isSuccess) => {
if (isSuccess == false) {
ElMessage.error(`${item.fileShowName}下载失败!`)
}
item.async = isSuccess item.async = isSuccess
resolve() resolve()
}) })
@ -117,24 +112,3 @@ export const creatAIPPT = (name, url, uploadData) => {
}) })
}) })
} }
export const removeLocalFiles = async (list) => {
return new Promise((resolve, reject) => {
ipcRenderer.send('remove-local-file-list', JSON.parse(JSON.stringify(list)))
ipcRenderer.removeListener('remove-local-file-list-error', removeLocalFileListError)
ipcRenderer.removeListener('remove-local-file-list-not', removeLocalFileListNot)
ipcRenderer.on('remove-local-file-list-error', removeLocalFileListError)
ipcRenderer.on('remove-local-file-list-not', removeLocalFileListNot)
ipcRenderer.once('remove-local-file-list-reply', (e, res) => {
resolve(res)
})
})
}
function removeLocalFileListError(e, item) {
ElMessage.error(`${item.fileShowName}删除失败`)
}
function removeLocalFileListNot(e, item) {
ElMessage.error(`${item.fileShowName}删除失败,并没有该文件!`)
}

View File

@ -9,8 +9,11 @@
<div style="font-size: 16px;font-weight: bold;color: #000;text-align: left;margin-bottom: 5px">可用分组</div> <div style="font-size: 16px;font-weight: bold;color: #000;text-align: left;margin-bottom: 5px">可用分组</div>
<div class="groupList"> <div class="groupList">
<template v-for="(item,index) in groupList" :key="index"> <template v-for="(item,index) in groupList" :key="index">
<el-card <el-card style="width: 20%;
class="card_div" margin-right: 10px;
margin-bottom: 10px;
cursor: pointer;
position: relative;"
v-if="item.parentid === 0" v-if="item.parentid === 0"
@mouseenter="cardEnter(item,index)" @mouseenter="cardEnter(item,index)"
@mouseleave="cardLeave(item,index)" @mouseleave="cardLeave(item,index)"
@ -388,7 +391,6 @@ watch(()=> props.classId,()=> {
.groupList{ .groupList{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap:10px;
} }
.card-row { .card-row {
font-size: 12px; font-size: 12px;
@ -413,10 +415,4 @@ watch(()=> props.classId,()=> {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.card_div{
width: calc(20% - 10px);
margin-bottom: 10px;
cursor: pointer;
position: relative;
}
</style> </style>

View File

@ -1,69 +1,14 @@
<template> <template>
<el-card style="width: 100%;height: 100%"> <el-card style="width: 100%;height: 100%">
<el-descriptions <el-descriptions :column="1">
class="margin-top" <el-descriptions-item label="班级名称">{{ classInfo.caption }}</el-descriptions-item>
:column="6" <el-descriptions-item label="教师">
:size="size"
border
>
<el-descriptions-item :span="2" :width="120">
<template #label>
<div class="cell-item">
<el-icon :style="iconStyle">
<user />
</el-icon>
班级名称
</div>
</template>
{{ classInfo.caption }}
</el-descriptions-item>
<el-descriptions-item :span="2" :width="120">
<template #label>
<div class="cell-item">
<el-icon :style="iconStyle">
<tickets />
</el-icon>
学段
</div>
</template>
{{ currentGrade }}
</el-descriptions-item>
<el-descriptions-item :span="2" :width="120">
<template #label>
<div class="cell-item">
<el-icon :style="iconStyle">
<location />
</el-icon>
年级
</div>
</template>
{{ currentGradeName }}
</el-descriptions-item>
<el-descriptions-item :span="2" :width="120">
<template #label>
<div class="cell-item">
<el-icon :style="iconStyle">
<iphone />
</el-icon>
学生人数
</div>
</template>
{{ classInfo.classstudentcount || 0 }}
</el-descriptions-item>
<el-descriptions-item :span="4" :width="120">
<template #label>
<div class="cell-item">
<el-icon :style="iconStyle">
<office-building />
</el-icon>
教师
</div>
</template>
<template v-if="classInfo.teacher.length > 0"> <template v-if="classInfo.teacher.length > 0">
<el-tag style="margin-right: 5px;margin-bottom: 5px;" type="primary" v-for="(item, index) in classInfo.teacher" :key="index">{{item.name}}</el-tag> <el-tag style="margin-right: 5px;margin-bottom: 5px;" type="primary" v-for="(item, index) in classInfo.teacher" :key="index">{{item.name}}</el-tag>
</template> </template>
<template v-else>{{ classInfo.teachername }}</template> <template v-else>{{ classInfo.teachername }}</template>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="学生人数">{{ classInfo.classstudentcount || 0 }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
</template> </template>
@ -72,7 +17,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,ref} from 'vue' import {reactive,onMounted,nextTick,watch} from 'vue'
import delClassDemo from '@/store/modules/delClass' import delClassDemo from '@/store/modules/delClass'
const props = defineProps({ const props = defineProps({
classId: { classId: {
@ -86,36 +31,6 @@
}) })
const isDelClass = delClassDemo() const isDelClass = delClassDemo()
const userStore = useUserStore().user const userStore = useUserStore().user
//
const currentGradeName = ref('')
//
const currentGrade = ref('')
//
const gradeDataList = reactive([
[
{ label: '一年级', agekey: 1, checked: false, current: 1 },
{ label: '二年级', agekey: 2, checked: false, current: 1 },
{ label: '三年级', agekey: 3, checked: false, current: 1 },
{ label: '四年级', agekey: 4, checked: false, current: 1 },
{ label: '五年级', agekey: 5, checked: false, current: 1 },
{ label: '六年级', agekey: 6, checked: false, current: 1 },
],
[
{ label: '初一', agekey: 7, checked: false, current: 2 },
{ label: '初二', agekey: 8, checked: false, current: 2 },
{ label: '初三', agekey: 9, checked: false, current: 2 },
],
[
{ label: '高一', agekey: 10, checked: false, current: 3 },
{ label: '高二', agekey: 11, checked: false, current: 3 },
{ label: '高三', agekey: 12, checked: false, current: 3 },
],
])
const gradeData = reactive([
{current:1, label:'小学',},
{current:2, label:'初中',},
{current:3, label:'高中',},
])
// //
const deleteClassRoom = () => { const deleteClassRoom = () => {
ElMessageBox.alert('确认删除该班级?', { ElMessageBox.alert('确认删除该班级?', {
@ -138,14 +53,6 @@
if(props.classId){ if(props.classId){
getClassmain(props.classId).then(response => { getClassmain(props.classId).then(response => {
Object.assign(classInfo,response.data) Object.assign(classInfo,response.data)
//
const flatGradeDataList = gradeDataList.flat();
//
const currentIndex = flatGradeDataList.findIndex(item => item.agekey === Number(response.data.agekey));
currentGradeName.value = flatGradeDataList[currentIndex].label
const current = flatGradeDataList[currentIndex].current
currentGrade.value = gradeData.find(item => item.current === current).label
console.log(classInfo,'classInfo');
listClassuser({classid:props.classId,pageSize:100}).then(res => { listClassuser({classid:props.classId,pageSize:100}).then(res => {
classInfo.teacher = res.rows.filter(item => item.inrole === 'teacher') classInfo.teacher = res.rows.filter(item => item.inrole === 'teacher')
classInfo.student = res.rows.filter(item => item.inrole === 'student') classInfo.student = res.rows.filter(item => item.inrole === 'student')
@ -164,14 +71,5 @@
</script> </script>
<style scoped> <style scoped>
.el-descriptions {
margin-top: 20px;
}
.cell-item {
display: flex;
align-items: center;
}
.margin-top {
margin-top: 20px;
}
</style> </style>

View File

@ -435,7 +435,7 @@ import useUserStore from '@/store/modules/user'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
// import { Plus } from '@element-plus/icons-vue' // import { Plus } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import { getClassworkdata, updateClassworkevalList, updateClassWorkDataAutoFinish } from '@/api/classTask' import { updateClassworkeval, updateClassworkdata, getClassworkdata } from '@/api/classTask'
import { getTimeDate } from '@/utils/date' import { getTimeDate } from '@/utils/date'
import ReFilePreview from '@/components/refile-preview/index.vue' import ReFilePreview from '@/components/refile-preview/index.vue'
import { quizStrToList } from '@/utils/comm'; import { quizStrToList } from '@/utils/comm';
@ -890,12 +890,12 @@ const onSubmit = () => {
updatedate: getTimeDate(),// = year+'-'+month+'-'+day+' '+hh+':'+mm; updatedate: getTimeDate(),// = year+'-'+month+'-'+day+' '+hh+':'+mm;
}; };
// //
updateClassWorkDataAutoFinish(formd).then(res => { updateClassworkdata(formd).then(res => {
}) })
// //
const queryList = []; classWorkFormScore.teacherRating &&
classWorkFormScore.teacherRating && classWorkFormScore.teacherRating.map((item, index) => { classWorkFormScore.teacherRating.map((item, index) => {
const queryParams = { const queryParams = {
id: item.id, id: item.id,
teacherRating: item.score, // teacherRating: item.score, //
@ -903,32 +903,13 @@ const onSubmit = () => {
teacherremark: classWorkFormScore.teacherremark, // teacherremark: classWorkFormScore.teacherremark, //
timestamp: getTimeDate() // timestamp: getTimeDate() //
} }
queryList.push(queryParams) console.log(queryParams)
}) updateClassworkeval(queryParams).then((res) => {
//console.log('queryList->', queryList)
updateClassworkevalList(queryList).then((res) => {
// if(res.code == 200){ // if(res.code == 200){
// //
// } // }
}) })
})
//
// classWorkFormScore.teacherRating &&
// classWorkFormScore.teacherRating.map((item, index) => {
// const queryParams = {
// id: item.id,
// teacherRating: item.score, //
// rating: classWorkFormScore.rating, //
// teacherremark: classWorkFormScore.teacherremark, //
// timestamp: getTimeDate() //
// }
// console.log(queryParams)
// updateClassworkeval(queryParams).then((res) => {
// // if(res.code == 200){
// //
// // }
// })
// })
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '提交成功!' message: '提交成功!'

View File

@ -55,7 +55,6 @@
<el-col :span="11"> <el-col :span="11">
<el-form-item label="知识点" label-width="70"> <el-form-item label="知识点" label-width="70">
<el-cascader <el-cascader
disabled
v-model="entpCourseWorkQueryParams.point" v-model="entpCourseWorkQueryParams.point"
clearable clearable
style="width: 100%" style="width: 100%"
@ -173,7 +172,7 @@
<!-- 非习题训练常规作业 --> <!-- 非习题训练常规作业 -->
<div v-if="classWorkForm.worktype!='习题训练'"> <div v-if="classWorkForm.worktype!='习题训练'">
<div :style="{ 'overflow': 'auto'}"> <div :style="{ 'overflow': 'auto'}">
<!-- <template v-if="classWorkForm.worktype!='常规作业'"> <template v-if="classWorkForm.worktype!='常规作业'">
<template v-for="(item, index) in workResource.teachResourceList" :key="item"> <template v-for="(item, index) in workResource.teachResourceList" :key="item">
<div v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;"> <div v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;">
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;"> <div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
@ -194,7 +193,7 @@
</div> </div>
</div> </div>
</template> </template>
</template> --> </template>
<template v-if="classWorkForm.worktype =='常规作业'"> <template v-if="classWorkForm.worktype =='常规作业'">
<div v-loading="fileLoading" class="upload-homework"> <div v-loading="fileLoading" class="upload-homework">
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/> <FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
@ -286,7 +285,6 @@ import { updateClasswork, listEvaluationclue, listClassworkeval,delClassworkeval
import { listEvaluation } from '@/api/subject' import { listEvaluation } from '@/api/subject'
import { listEntpcoursefile } from '@/api/education/entpcoursefile' import { listEntpcoursefile } from '@/api/education/entpcoursefile'
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint"; import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
import { isJson } from "@/utils/comm";
import { useGetHomework } from '@/hooks/useGetHomework' import { useGetHomework } from '@/hooks/useGetHomework'
@ -461,13 +459,12 @@ const client = new Apis('/paht');
*/ */
const t = function(name, time) { const t = function(name, time) {
return new Promise(resolve => { return new Promise(resolve => {
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
const queryForm = { const queryForm = {
// //
currentPage: paginationParams.pageNum, currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize, pageSize: paginationParams.pageSize,
// //
eid: evalId, // id eid: props.bookobj.levelSecondId,
sectionName: props.bookobj.coursetitle, sectionName: props.bookobj.coursetitle,
edusubject: userStore.edusubject, edusubject: userStore.edusubject,
edustage: userStore.edustage, edustage: userStore.edustage,
@ -560,13 +557,10 @@ const getQueryFromEvaluationclue = () => {
} }
if (clueres.rows[i].childlist != '') { if (clueres.rows[i].childlist != '') {
const tmpJson = '['+clueres.rows[i].childlist+']'; clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
if (isJson(tmpJson)){
clueres.rows[i].childArray = JSON.parse(tmpJson);
for (var j=0; j<clueres.rows[i].childArray.length; j++) { for (var j=0; j<clueres.rows[i].childArray.length; j++) {
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, ''); clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
} }
}
} else { } else {
clueres.rows[i].childArray = {}; clueres.rows[i].childArray = {};
} }
@ -996,8 +990,6 @@ const initPageParams = () => {
onMounted(async() => { onMounted(async() => {
//
getEntpCourseWorkPointList();
}) })
// const refreshData = () => { // const refreshData = () => {
@ -1024,9 +1016,9 @@ const debounceQueryData = debounce(() => {
// //
handleQueryFromEntpCourseWork(0); handleQueryFromEntpCourseWork(0);
// //
//getQueryFromEvaluationclue(); getQueryFromEvaluationclue();
// //
//getEntpCourseWorkPointList(); getEntpCourseWorkPointList();
}, 1000); }, 1000);
watch(() => props.propsformobj.uniquekey, (newVal) => { watch(() => props.propsformobj.uniquekey, (newVal) => {
@ -1035,20 +1027,8 @@ watch(() => props.propsformobj.uniquekey, (newVal) => {
classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; // classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; //
} }
}) })
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
//watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => {
watch([
() => props.bookobj.levelFirstId,
() => props.bookobj.levelSecondId
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
console.log(props.bookobj,'课程选择') console.log(props.bookobj,'课程选择')
// , ,
if (props.bookobj.levelSecondId == '') {
workResource.entpCourseWorkList = [];
return;
}
debounceQueryData(); debounceQueryData();
}) })

View File

@ -1,195 +0,0 @@
<template>
<div class="page-testpaper">
<div class="page-center">
<el-tabs v-model="activeAptTab" style="height: 100%;">
<el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst">
<SearchQuestion :bookobj="courseObj" @addQuizItem="handleClassWorkQuizItemAdd" />
</el-tab-pane>
<!-- <el-tab-pane label="校本题库" name="校本题库" class="prepare-center-xbtk">
<SchoolQuestion />
</el-tab-pane> -->
<el-tab-pane label="个人题库" name="个人题库" class="prepare-center-grst">
<MyQuestion :bookobj="courseObj" @addQuizItem="handleClassWorkQuizItemAdd"/>
</el-tab-pane>
</el-tabs>
</div>
<div class="page-right">
<p>{{ classWorkForm.quizlist.length }} <span>进入组卷中心</span></p>
<div v-for="(item, index) in classWorkForm.worktypeList" :key="index" class="page-right-item">
<span>{{ item.key }}: {{ item.value }}</span> <span @click="handleDeleteQuizItem(item)">删除</span>
</div>
</div>
</div>
</template>
<script setup>
import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick, defineEmits } from 'vue'
import { ElMessage } from 'element-plus'
import { cloneDeep } from 'lodash'
import { processList } from '@/hooks/useProcessList'
import MyQuestion from '@/views/classTask/newClassTaskAssign/myQuestion/index.vue'
import SearchQuestion from '@/views/classTask/newClassTaskAssign/searchQuestion/index.vue'
import { useGetHomework } from '@/hooks/useGetHomework'
import { sessionStore } from '@/utils/store'
import { useRouter, useRoute } from 'vue-router'
import useUserStore from '@/store/modules/user'
import useClassTaskStore from '@/store/modules/classTask'
const userStore = useUserStore().user
const route = useRoute();
const router = useRouter()
const { proxy } = getCurrentInstance()
const emits = defineEmits(['getData'])
const props = defineProps({
currentCourse: Object,
})
const propsQueryCourseObj = route.query.courseObj;//
const courseObj = reactive({
// : id,id,id,
textbookId: '',
levelFirstId: '',
levelSecondId: '',
coursetitle:'',
node: null, //
//
})
const activeAptTab = ref("自主搜题");
let classWorkForm = reactive({
id: '',// ,
uniquekey: '',// , //
worktype: '',// '', //
worktypeList: [],// '', //
title: '',// //
quizlist: [],// //
}); //
onMounted(() => {
if(propsQueryCourseObj){
if(JSON.parse(propsQueryCourseObj)){
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj //
courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId //
courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId //
courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (/)
courseObj.node = JSON.parse(propsQueryCourseObj).node; //
}
}
})
/**
* 添加作业
* @param entpcourseworkid
*/
const handleClassWorkQuizItemAdd = (row) => {
var exist = false;
for (var i=0; i< classWorkForm.quizlist.length; i++) {
if (classWorkForm.quizlist[i].id == row.id) {
exist = true;
break;
}
}
if (exist == false) {
// getEntpcoursework(entpcourseworkid).then(res => {
// //res.data.titletext = res.data.title.replace(/<[^>]+>/g, '');
// //
// if(res.data.score == null){
// res.data.score = 4;
// }
// classWorkForm.quizlist.push(res.data);
// //
// processList(classWorkForm.quizlist);
// })
// TODO
classWorkForm.quizlist.push(row);
//
processList(classWorkForm.quizlist);
console.log(classWorkForm.quizlist)
//
classWorkForm.quizlist && classWorkForm.quizlist.forEach(item => {
if(!classWorkForm.worktypeList.some(i => i.key.includes(item.worktype))){
const num = classWorkForm.quizlist.filter(_item => _item.key == item.worktype).length
const obj = {
key: item.worktype,
value: num
}
classWorkForm.worktypeList.push(obj)
}
})
console.log(classWorkForm.worktypeList)
} else {
ElMessage('试题已经存在')
}
}
/**
* 删除作业类型试题
* @param row
*/
const handleDeleteQuizItem = (row) => {
for (var i=0; i< classWorkForm.worktypeList.length; i++) {
if (classWorkForm.worktypeList[i].key == row.key) {
classWorkForm.worktypeList.splice(i, 1);
break;
}
}
for (var j=0; j< classWorkForm.quizlist.length; j++) {
if (classWorkForm.quizlist[j].worktype == row.key) {
classWorkForm.quizlist.splice(j, 1);
break;
}
}
}
watch(() => props.currentCourse, (newVal, oldVal) => {
},{deep:true})
</script>
<style scoped lang="scss">
.page-testpaper {
height: 100%;
display: flex;
flex-direction: row;
.page-center{
flex: 1;
//min-width: calc(100% - 675px);
height: 100%;
padding: 0 5px;
margin: 0 5px;
overflow: hidden;
border-radius: 10px;
background-color: white;
.prepare-center-zzst{
height: 100%;
display: flex;
flex-direction: column;
}
.prepare-center-xbtk{
height: 100%;
}
.prepare-center-grst{
height: 100%;
}
}
.page-right{
flex: 1;
}
}
</style>

View File

@ -38,7 +38,6 @@ const items = shallowRef([
// { title: 'AI', description: 'AI', icon: '#icon-jiqiren_o',type:'danger' }, // { title: 'AI', description: 'AI', icon: '#icon-jiqiren_o',type:'danger' },
{ title: '习题上传', description: '自己上传个人题库。', icon: '#icon-shangchuan',type:'danger' }, { title: '习题上传', description: '自己上传个人题库。', icon: '#icon-shangchuan',type:'danger' },
{ title: '科学实验', description: '学生完成虚拟仿真实验,并提交实验结果。', icon: '#icon-shangchuan',type:'primary' }, { title: '科学实验', description: '学生完成虚拟仿真实验,并提交实验结果。', icon: '#icon-shangchuan',type:'primary' },
// { title: '', description: '', icon: '#icon-shangchuan',type:'primary' },
]); ]);
const handleClick = (item) => { const handleClick = (item) => {

View File

@ -36,24 +36,16 @@ const props = defineProps({
}) })
const value = ref('') const value = ref('')
const updateLabel = (val) => {
value.value = val;
}
const onSelectOption = (option) => {
classTaskStore.updateEduInfo = `${classTaskStore.edustage}-${classTaskStore.edusubject}`;
console.log('updateEduInfo->', classTaskStore.updateEduInfo);
console.log(option,'选择的实验课-------')
emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0])
}
onMounted(() => { onMounted(() => {
}) })
defineExpose({ const onSelectOption = (option) => {
updateLabel console.log(option,'选择的实验课-------')
}) emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0])
}
</script> </script>
<style scoped> <style scoped>

View File

@ -56,7 +56,7 @@ const subjectList = ref([])
const chooseGrade= ref({}) const chooseGrade= ref({})
const expList = ref([]) // const expList = ref([]) //
const checkList = ref([])// const checkList = ref([])//
const isLoaded = ref(false);
// //
const getSubject = () => { const getSubject = () => {
@ -80,15 +80,8 @@ const getSubject = () => {
}) })
}) })
console.log(subjectList,'subjectList'); console.log(subjectList,'subjectList');
// //
const edusubject = useClassTaskStore().experimentObj.edusubject; handleUserEduStage(useClassTaskStore().experimentObj.edustage)
handleUserEduStage(useClassTaskStore().experimentObj.edustage);
// , , .
useClassTaskStore().experimentObj.edusubject = edusubject;
// []
isLoaded.value = true;
//console.log('----');
} }
// //
const isExpList = (edusubject) => { const isExpList = (edusubject) => {
@ -115,8 +108,7 @@ const isExpList = (edusubject) => {
// //
const handleUserEduStage = (item) => { const handleUserEduStage = (item) => {
// userStore.edustage = item // userStore.edustage = item
useClassTaskStore().experimentObj.edustage = item; useClassTaskStore().experimentObj.edustage = item
// //
expList.value = [] expList.value = []
if(item === '小学'){ if(item === '小学'){
@ -125,11 +117,10 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '小学'); const newSubjectList = subjectList.value.filter(item => item.edustage === '小学');
for(let i in newSubjectList){ for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle const name = newSubjectList[i].itemtitle
if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){ if(isExpList(name)){
//useClassTaskStore().experimentObj.edusubject = name; useClassTaskStore().experimentObj.edusubject = name;
// //
handleUserEduSubject(name) handleUserEduSubject(name)
break;
} }
} }
}else if(item === '初中'){ }else if(item === '初中'){
@ -138,11 +129,10 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '初中'); const newSubjectList = subjectList.value.filter(item => item.edustage === '初中');
for(let i in newSubjectList){ for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle const name = newSubjectList[i].itemtitle
if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){ if(isExpList(name)){
//useClassTaskStore().experimentObj.edusubject = name; useClassTaskStore().experimentObj.edusubject = name;
// //
handleUserEduSubject(name) handleUserEduSubject(name)
break;
} }
} }
}else if(item === '高中'){ }else if(item === '高中'){
@ -151,11 +141,10 @@ const handleUserEduStage = (item) => {
const newSubjectList = subjectList.value.filter(item => item.edustage === '高中'); const newSubjectList = subjectList.value.filter(item => item.edustage === '高中');
for(let i in newSubjectList){ for(let i in newSubjectList){
const name = newSubjectList[i].itemtitle const name = newSubjectList[i].itemtitle
if(isExpList(name) && useClassTaskStore().experimentObj.edusubject===name){ if(isExpList(name)){
//useClassTaskStore().experimentObj.edusubject = name; useClassTaskStore().experimentObj.edusubject = name;
// //
handleUserEduSubject(name) handleUserEduSubject(name)
break;
} }
} }
} }
@ -188,59 +177,10 @@ const handleUserEduSubject = (item) => {
// emit('experlist',checkList.value) // emit('experlist',checkList.value)
} }
const updateCheckList = async () => {
try {
await waitForSubjectData();
//console.log('-------', );
//console.log('experimentObj-> ', useClassTaskStore().experimentObj);
//
const edustage = useClassTaskStore().experimentObj.edustage;
if(edustage === '小学'){
chooseGrade.value = jsonData.data.primary
}else if(edustage === '初中'){
chooseGrade.value = jsonData.data.junior
}else if(edustage === '高中'){
chooseGrade.value = jsonData.data.senior
}
expList.value = chooseGrade.value
const edusubject = useClassTaskStore().experimentObj.edusubject;
handleUserEduSubject(edusubject);
} catch (error) {
console.error(error);
}
}
const waitForSubjectData = () => {
return new Promise((resolve, reject) => {
let timeoutId;
let intervalId;
const checkIsLoaded = () => {
if (isLoaded.value) {
clearInterval(intervalId);
clearTimeout(timeoutId);
resolve();
}
};
intervalId = setInterval(checkIsLoaded, 100);
timeoutId = setTimeout(() => {
clearInterval(intervalId);
reject(new Error('该作业-等待[科学实验]学科学段初始化超时'));
}, 5000);
});
};
onMounted(() => { onMounted(() => {
getSubject() getSubject()
}) })
defineExpose({
updateCheckList
})
</script> </script>
<style scoped> <style scoped>
.custom-button { .custom-button {

View File

@ -3,10 +3,10 @@
<div class="activeExp-header"> <div class="activeExp-header">
<div class="infomation" v-if="isStadium() !== true" > <div class="infomation" v-if="isStadium() !== true" >
<!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> --> <!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> -->
<selectClass ref="selectClassRef"/> <selectClass v-if="!isSubject" />
</div> </div>
<div> <div>
<selectExperiment ref="selectExperimentRef" @selectItem="getExperimentListItem" /> <selectExperiment @selectItem="getExperimentListItem" />
</div> </div>
</div> </div>
<div ref="mainDiv" class="activeExp-main" style="overflow: auto"> <div ref="mainDiv" class="activeExp-main" style="overflow: auto">
@ -19,7 +19,7 @@
<script setup> <script setup>
import { Search } from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
//import html2canvas from 'html2canvas'; //import html2canvas from 'html2canvas';
import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick } from 'vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import useClassTaskStore from '@/store/modules/classTask' import useClassTaskStore from '@/store/modules/classTask'
import selectClass from './components/selectClass.vue' // import selectClass from './components/selectClass.vue' //
@ -44,8 +44,6 @@ const props = defineProps({
// //
// const experimentList = ref([]); // const experimentList = ref([]);
const activeExp = ref({}); const activeExp = ref({});
const selectExperimentRef = ref();
const selectClassRef = ref();
const isStadium = () => { const isStadium = () => {
let roles = userStore.roles let roles = userStore.roles
@ -84,13 +82,6 @@ const getExperimentListItem = (val) => {
watch(() => props.expObj.fileurl, (newVal, oldVal) => { watch(() => props.expObj.fileurl, (newVal, oldVal) => {
console.log(props.expObj,'科学实验科目') console.log(props.expObj,'科学实验科目')
activeExp.value = props.expObj; activeExp.value = props.expObj;
//
nextTick(() => {
selectClassRef.value.updateCheckList();
selectExperimentRef.value.updateLabel(props.expObj.label);
})
}) })
</script> </script>

View File

@ -1,25 +1,27 @@
<template> <template>
<div class="page"> <div class="page">
<div class="page-top" v-if="!isShow"> <div class="page-top" v-if="!isShow">
<div> <div class="page-top-left">
<el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button> <el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button>
<el-button type="success" @click="handleTaskAssignToAllClass()">批量推送</el-button> <el-button type="success" @click="handleTaskAssignToAllClass()">批量推送</el-button>
</div> </div>
<div style="margin-left: 20px;"> <div v-if="currentRow.id > 0" class="page-top-right">
<div v-if="currentRow.id > 0"> <el-button type="primary" @click="handleNewAllClass" :icon="Plus">设计新作业</el-button>
<el-button type="primary" @click="handleNewAllClass"><i class="iconfont icon-fanhui"></i>返回 设计作业</el-button>
</div>
<div v-else>
<span style="font-size: 14px; color: red">温馨提示选择下列作业类型可进行作业设计</span>
</div>
</div> </div>
</div> </div>
<div class="page-resource"> <div class="page-resource">
<div class="page-left" v-if="!isShow"> <div class="page-left" v-if="!isShow">
<el-table ref="taskTable" v-loading="tasklist_loading" :data="taskList" :tree-props="{ checkStrictly: true }" <el-table
row-key="id" style="width: 100%;height: 100%; border: 1px solid #dcdfe6;border-radius: 3px;flex:1" ref="taskTable"
highlight-current-row @current-change="handleCurrentChange"> v-loading="tasklist_loading"
<el-table-column type="selection" min-width="2%" align="center" :selectable="selectable" /> :data="taskList"
:tree-props="{checkStrictly: true}"
row-key="id"
style="width: 100%;height: 100%; border: 1px solid #dcdfe6;border-radius: 3px;flex:1"
highlight-current-row
@current-change="handleCurrentChange"
>
<el-table-column type="selection" min-width="2%" align="center" :selectable="selectable"/>
<el-table-column label="作业布置" min-width="15%" align="center"> <el-table-column label="作业布置" min-width="15%" align="center">
<template #default="scope"> <template #default="scope">
<div style="height: 100px;cursor: pointer"> <div style="height: 100px;cursor: pointer">
@ -29,13 +31,11 @@
<span>{{ scope.row.uniquekey }}</span> <span>{{ scope.row.uniquekey }}</span>
</div> </div>
<div class="pageleft-table-top" style="display: flex;justify-content: space-between"> <div class="pageleft-table-top" style="display: flex;justify-content: space-between">
<el-tag style="padding:0 2px" :type="scope.row.workclass" size="default">{{ scope.row.worktype <el-tag style="padding:0 2px" :type="scope.row.workclass" size="default">{{ scope.row.worktype }}</el-tag>
}}</el-tag>
<el-text size="small" style="color:#ccc;white-space:nowrap">{{ scope.row.timestamp }}</el-text> <el-text size="small" style="color:#ccc;white-space:nowrap">{{ scope.row.timestamp }}</el-text>
</div> </div>
<div class="pageleft-table-cont"> <div class="pageleft-table-cont">
<div :title="scope.row.worktag || scope.row.title" class="ellipsis "> {{ scope.row.worktype == <div :title="scope.row.worktag || scope.row.title" class="ellipsis "> {{ scope.row.worktype == "课堂展示" ? scope.row.worktag : scope.row.title }}</div>
"课堂展示" ? scope.row.worktag : scope.row.title }}</div>
</div> </div>
</div> </div>
<svg class="icon iconfont" aria-hidden="true"> <svg class="icon iconfont" aria-hidden="true">
@ -53,8 +53,7 @@
<Right @itemClick="handleItemClick" /> <Right @itemClick="handleItemClick" />
</div> </div>
<div v-if="(currentRow.worktype == '习题训练' || classWorkForm.worktype == '习题训练') && currentRow.id > 0" <div v-if="(currentRow.worktype == '习题训练' || classWorkForm.worktype == '习题训练') && currentRow.id>0" class="page-center">
class="page-center">
<el-tabs v-model="activeAptTab" style="height: 100%;"> <el-tabs v-model="activeAptTab" style="height: 100%;">
<el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst"> <el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst">
<SearchQuestion :bookobj="courseObj" @addQuiz="handleClassWorkQuizAdd" /> <SearchQuestion :bookobj="courseObj" @addQuiz="handleClassWorkQuizAdd" />
@ -63,65 +62,60 @@
<SchoolQuestion /> <SchoolQuestion />
</el-tab-pane> --> </el-tab-pane> -->
<el-tab-pane label="个人题库" name="个人题库" class="prepare-center-grst"> <el-tab-pane label="个人题库" name="个人题库" class="prepare-center-grst">
<MyQuestion :bookobj="courseObj" @addQuiz="handleClassWorkQuizAdd" /> <MyQuestion :bookobj="courseObj" @addQuiz="handleClassWorkQuizAdd"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<div v-if="(currentRow.worktype == '课堂展示' || classWorkForm.worktype == '课堂展示') && currentRow.id > 0" <div v-if="(currentRow.worktype == '课堂展示' || classWorkForm.worktype == '课堂展示') && currentRow.id>0" class="page-center">
class="page-center">
<div v-loading="boardLoading" class="board-wrap" style="height: 100%; flex: 1; overflow: hidden;"> <div v-loading="boardLoading" class="board-wrap" style="height: 100%; flex: 1; overflow: hidden;">
<whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false" <!-- <whiteboard v-if="isShowBoard" ref="boardref" :height="mainHeight - 150" :isShowSave="false" :data="whiteboardObj"/> -->
:data="classWorkForm.whiteboardObj" /> <whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false" :data="classWorkForm.whiteboardObj"/>
</div> </div>
</div> </div>
<div v-if="(currentRow.worktype == '常规作业' || classWorkForm.worktype == '常规作业') && currentRow.id > 0" <div v-if="(currentRow.worktype == '常规作业' || classWorkForm.worktype == '常规作业')&& currentRow.id>0" class="page-center">
class="page-center">
<div v-loading="fileLoading" class="upload-homework"> <div v-loading="fileLoading" class="upload-homework">
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" <FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
:fileType="['mp3', 'mp4', 'doc', 'docx', 'xlsx', 'xls', 'pdf', 'ppt', 'pptx', 'jpg', 'jpeg', 'gif', 'png', 'txt']" />
</div> </div>
</div> </div>
<div v-if="(currentRow.worktype == '科学实验' || classWorkForm.worktype == '科学实验') && currentRow.id > 0" <div v-if="(currentRow.worktype == '科学实验' || classWorkForm.worktype == '科学实验')&& currentRow.id>0" class="page-center">
class="page-center">
<div class="experiment-homework"> <div class="experiment-homework">
<ExperimentQuestion :expObj="classWorkForm.fileHomeworkList&&classWorkForm.fileHomeworkList[0]" @clickExpObj="getExpObj" /> <ExperimentQuestion :expObj="classWorkForm.fileHomeworkList&&classWorkForm.fileHomeworkList[0]" @clickExpObj="getExpObj" />
</div> </div>
</div> </div>
<div v-if="currentRow.id > 0" class="page-right"> <div v-if="currentRow.id>0 " class="page-right">
<div class="prepare-top"> <div class="prepare-top" >
<span>作业详情说明</span> <el-button v-if="currentRow.id != 1 " type="success" @click="openSet(currentRow,'item')"> </el-button>
<el-button v-if="currentRow.id != 1" type="success" @click="openSet(currentRow, 'item')"> </el-button>
<el-button type="primary" @click="handleClassWorkSave"> </el-button> <el-button type="primary" @click="handleClassWorkSave"> </el-button>
</div> </div>
<div class="prepare-con"> <div class="prepare-con" >
<el-form ref="classWorkFormRef" :model="classWorkForm" label-width="90" <el-form
style=" height: 100%; overflow: hidden;display: flex;flex-direction: column;"> ref="classWorkFormRef"
<div> :model="classWorkForm"
label-width="90"
style=" height: 100%; overflow: hidden;display: flex;flex-direction: column;"
>
<div >
<el-form-item label="作业名称"> <el-form-item label="作业名称">
<el-input v-model="classWorkForm.uniquekey" type="text" placeholder="请输入作业名称" /> <el-input v-model="classWorkForm.uniquekey" type="text" placeholder="请输入作业名称"/>
</el-form-item> </el-form-item>
<el-form-item label="作业说明" style="margin: 10px 0;"> <el-form-item label="作业说明" style="margin: 10px 0;">
<el-input v-if="classWorkForm.worktype != '课堂展示'" v-model="classWorkForm.title" style="width: 400px" <el-input v-if="classWorkForm.worktype != '课堂展示'" v-model="classWorkForm.title" style="width: 400px" placeholder="请输入作业说明"/>
placeholder="请输入作业说明" />
<!-- 课堂展示 这里字段不一样 --> <!-- 课堂展示 这里字段不一样 -->
<el-input v-if="classWorkForm.worktype == '课堂展示'" v-model="classWorkForm.question" type="textarea" <el-input v-if="classWorkForm.worktype == '课堂展示'" v-model="classWorkForm.question" type="textarea" placeholder="请输入作业说明" />
placeholder="请输入作业说明" />
</el-form-item> </el-form-item>
</div> </div>
<div v-if="classWorkForm.worktype == '习题训练'" class="pageRight-list"> <div v-if="classWorkForm.worktype == '习题训练'" class="pageRight-list">
<div <div :style="{height: '100%', 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
:style="{ height: '100%', 'overflow': 'auto', 'border': '1px dotted blue', 'border-radius': '5px', 'background-color': '#f7f7f7' }"> <template v-for="(item,index) in classWorkForm.quizlist" :key="item.id">
<template v-for="(item, index) in classWorkForm.quizlist" :key="item.id">
<div style="margin: 5px; background-color: white; text-align: left;"> <div style="margin: 5px; background-color: white; text-align: left;">
<div v-html="item.titleFormat" style="padding: 15px 20px 5px 20px"></div> <div v-html="item.titleFormat" style="padding: 15px 20px 5px 20px"></div>
<div style="display: flex;"> <div style="display: flex;">
<el-form-item label="分值"> <el-form-item label="分值">
<el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number> <el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number >
</el-form-item> </el-form-item>
<div style="margin-left: auto; padding: 0px 20px"><el-button size="small" type="danger" <div style="margin-left: auto; padding: 0px 20px"><el-button size="small" type="danger" @click="handleClassWorkFormQuizRemove(index)">删除</el-button></div>
@click="handleClassWorkFormQuizRemove(index)">删除</el-button></div>
</div> </div>
</div> </div>
</template> </template>
@ -133,8 +127,7 @@
</div> </div>
<!-- 推送作业的配置对话框 --> <!-- 推送作业的配置对话框 -->
<SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :rows="rowsList" @on-close="closeHomework" <SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :rows="rowsList" @on-close="closeHomework" @on-success="successHomework"/>
@on-success="successHomework" />
</div> </div>
</template> </template>
<script setup> <script setup>
@ -143,9 +136,9 @@ import { ElMessage } from 'element-plus'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
import { Plus, Delete } from '@element-plus/icons-vue' import { Plus, Delete } from '@element-plus/icons-vue'
import { delClasswork } from '@/api/teaching/classwork' import { delClasswork } from '@/api/teaching/classwork'
import { listEntpcoursework, listEntpcourseworkNew, getEntpcoursework } from '@/api/education/entpCourseWork' import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
import { addClassworkReturnId } from '@/api/teaching/classwork' import { addClassworkReturnId } from '@/api/teaching/classwork'
import { updateClasswork, listEvaluationclue, listClassworkeval, delClassworkeval, addClassworkeval, updateClassworkeval } from '@/api/classTask' import { updateClasswork, listEvaluationclue, listClassworkeval,delClassworkeval,addClassworkeval,updateClassworkeval } from '@/api/classTask'
import { processList } from '@/hooks/useProcessList' import { processList } from '@/hooks/useProcessList'
import { editListItem } from '@/hooks/useClassTask' import { editListItem } from '@/hooks/useClassTask'
@ -169,7 +162,6 @@ const route = useRoute();
const router = useRouter() const router = useRouter()
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const useClassTaskStores = useClassTaskStore(); const useClassTaskStores = useClassTaskStore();
const { ipcRenderer } = require('electron')
const props = defineProps({ const props = defineProps({
currentCourse: Object, currentCourse: Object,
@ -178,17 +170,13 @@ const emits = defineEmits(['getData'])
// ppt // ppt
const isShow = ref(false) const isShow = ref(false)
const propsQueryTask = {
id: route.query.classTaskId, // id
isInit: false, //
}
const propsQueryCourseObj = route.query.courseObj;// const propsQueryCourseObj = route.query.courseObj;//
const courseObj = reactive({ const courseObj = reactive({
// : id,id,id, // : id,id,id,
textbookId: '', textbookId: '',
levelFirstId: '', levelFirstId: '',
levelSecondId: '', levelSecondId: '',
coursetitle: '', coursetitle:'',
node: null, // node: null, //
// //
}) })
@ -203,7 +191,7 @@ const setDialog = ref(false); // 推送配置 弹窗
const rowsList = ref([]) // const rowsList = ref([]) //
const entpcourseid = ref('') // id const entpcourseid = ref('') // id
const currentRow = ref({ id: 0 }); // -- const currentRow = ref({id:0}); // --
// ------- // -------
const boardLoading = ref(false); const boardLoading = ref(false);
@ -211,18 +199,18 @@ const boardLoading = ref(false);
const fileLoading = ref(false); // loading const fileLoading = ref(false); // loading
onMounted(() => { onMounted(() => {
//console.log("----onMounted-------"); console.log("----onMounted-------")
currentRow.value.id = 0 currentRow.value.id = 0
if (propsQueryCourseObj) { if(propsQueryCourseObj){
if (JSON.parse(propsQueryCourseObj)) { if(JSON.parse(propsQueryCourseObj)){
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj // courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj //
courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId // courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId //
courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId // courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId //
courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (/) courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (/)
courseObj.node = JSON.parse(propsQueryCourseObj).node; // courseObj.node = JSON.parse(propsQueryCourseObj).node; //
} }
} else { }else{
if (props.currentCourse) { if(props.currentCourse){
courseObj.textbookId = props.currentCourse.textbookId // courseObj.textbookId = props.currentCourse.textbookId //
courseObj.levelFirstId = props.currentCourse.levelFirstId // courseObj.levelFirstId = props.currentCourse.levelFirstId //
courseObj.levelSecondId = props.currentCourse.levelSecondId // courseObj.levelSecondId = props.currentCourse.levelSecondId //
@ -230,11 +218,11 @@ onMounted(() => {
courseObj.node = props.currentCourse.node; // courseObj.node = props.currentCourse.node; //
classWorkForm.worktype = props.currentCourse.worktype classWorkForm.worktype = props.currentCourse.worktype
currentRow.value = { currentRow.value = {
id: props.currentCourse.id, id:props.currentCourse.id,
worktype: props.currentCourse.worktype worktype:props.currentCourse.worktype
} }
isShow.value = true; isShow.value = true;
} else { }else{
isShow.value = false; isShow.value = false;
} }
} }
@ -243,8 +231,8 @@ onMounted(() => {
}) })
// //
const isInToMyQuestion = () => { const isInToMyQuestion = () => {
console.log('isOpenQuestUploadView', useClassTaskStores.isOpenQuestUploadView); console.log('isOpenQuestUploadView',useClassTaskStores.isOpenQuestUploadView);
if (useClassTaskStores.isOpenQuestUploadView) { if(useClassTaskStores.isOpenQuestUploadView){
useClassTaskStores.isOpenQuestUploadView = false; useClassTaskStores.isOpenQuestUploadView = false;
currentRow.value.id = 1; // currentRow.value.id = 1; //
@ -262,7 +250,7 @@ const isInToMyQuestion = () => {
} }
} }
watch(() => props.currentCourse, (newVal, oldVal) => { watch(() => props.currentCourse, (newVal, oldVal) => {
if (newVal) { if(newVal){
courseObj.textbookId = newVal.textbookId // courseObj.textbookId = newVal.textbookId //
courseObj.levelFirstId = newVal.levelFirstId // courseObj.levelFirstId = newVal.levelFirstId //
courseObj.levelSecondId = newVal.levelSecondId // courseObj.levelSecondId = newVal.levelSecondId //
@ -270,15 +258,15 @@ watch(() => props.currentCourse, (newVal, oldVal) => {
courseObj.node = newVal.node; // courseObj.node = newVal.node; //
classWorkForm.worktype = newVal.worktype classWorkForm.worktype = newVal.worktype
currentRow.value = { currentRow.value = {
id: props.currentCourse.id, id:props.currentCourse.id,
worktype: props.currentCourse.worktype worktype:props.currentCourse.worktype
} }
} }
console.log(newVal, 'newval'); console.log(newVal,'newval');
}, { deep: true }) },{deep:true})
// ------------ // ------------
const getExpObj = (obj) => { const getExpObj = (obj)=>{
// obj:{ // obj:{
// fileurl: "https://phet.colorado.edu/sims/html/number-compare/latest/number-compare_zh_CN.html" // fileurl: "https://phet.colorado.edu/sims/html/number-compare/latest/number-compare_zh_CN.html"
// label: "" // label: ""
@ -289,14 +277,10 @@ const getExpObj = (obj) => {
//------------ //------------
const handleItemClick = (itemName) => { const handleItemClick = (itemName) => {
console.log('itemName', itemName); console.log('itemName', itemName);
if (itemName == '习题上传') { if(itemName == '习题上传'){
router.push({ path: '/model/questionUpload', query: { courseObj: JSON.stringify(courseObj) } }); router.push({ path: '/model/questionUpload', query: { courseObj: JSON.stringify(courseObj) } });
return; return;
} }
if (itemName == '自主组卷') {
router.push({ path: '/model/groupTestPaper', query: { courseObj: JSON.stringify(courseObj) } });
return;
}
currentRow.value.id = 1; // currentRow.value.id = 1; //
/** /**
@ -305,7 +289,7 @@ const handleItemClick = (itemName) => {
* 课堂展示 * 课堂展示
* 常规作业 * 常规作业
*/ */
const typeName = itemName == "自主搜题" || itemName == "校本题库" || itemName == "个人题库" ? "习题训练" : itemName; const typeName = itemName == "自主搜题" || itemName == "校本题库"|| itemName == "个人题库" ? "习题训练" : itemName;
activeAptTab.value = itemName; activeAptTab.value = itemName;
// //
classWorkForm.id = 0; classWorkForm.id = 0;
@ -322,13 +306,13 @@ const handleItemClick = (itemName) => {
//----------------------- //-----------------------
const selectable = (row, index) => { const selectable=(row, index)=>{
return row.status == '10'; return row.status == '10';
}; };
/** /**
* 获取 entpcourseid 获取作业列表 * 获取 entpcourseid 获取作业列表
*/ */
const initHomeWork = async () => { const initHomeWork = async()=> {
tasklist_loading.value = true; tasklist_loading.value = true;
// const { res, chapterId } = await useGetHomework(courseObj.node); // const { res, chapterId } = await useGetHomework(courseObj.node);
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode')); const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
@ -336,16 +320,6 @@ const initHomeWork = async () => {
console.log('res', res); console.log('res', res);
entpcourseid.value = chapterId; entpcourseid.value = chapterId;
taskList.value = res; taskList.value = res;
// , id
const taskId = propsQueryTask?.id ?? 0;
if (!propsQueryTask.isInit && taskId != 0) {
const activeRow = taskList.value.find(o => o.id == taskId);
if (activeRow) {
propsQueryTask.isInit = true; //
taskTable.value.setCurrentRow(activeRow);
handleCurrentChange(activeRow);
}
}
tasklist_loading.value = false; tasklist_loading.value = false;
} }
@ -367,10 +341,10 @@ const handleNewAllClass = () => {
/** /**
* 删除按钮操作 * 删除按钮操作
* */ * */
const handleDelete = () => { const handleDelete =() => {
let rows = proxy.$refs.taskTable.getSelectionRows(); let rows = proxy.$refs.taskTable.getSelectionRows();
if (rows.length > 0) { if (rows.length > 0) {
proxy.$modal.confirm('是否确认选中的学习任务?').then(() => { proxy.$modal.confirm('是否确认选中的学习任务?').then(()=> {
let ids = []; let ids = [];
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
ids.push(rows[i].id); ids.push(rows[i].id);
@ -386,8 +360,8 @@ const handleDelete = () => {
}, 1500); }, 1500);
proxy.$modal.msgSuccess("删除成功"); proxy.$modal.msgSuccess("删除成功");
}).catch(() => { }) }).catch(() => {})
} else { }else{
proxy.$modal.alertWarning("请选择删除项") proxy.$modal.alertWarning("请选择删除项")
} }
}; };
@ -398,12 +372,12 @@ const handleDelete = () => {
const handleTaskAssignToAllClass = () => { const handleTaskAssignToAllClass = () => {
let rows = proxy.$refs.taskTable.getSelectionRows(); let rows = proxy.$refs.taskTable.getSelectionRows();
if (rows.length > 0) { if (rows.length > 0) {
proxy.$modal.confirm('是否确认推送选中的学习任务?').then(() => { proxy.$modal.confirm('是否确认推送选中的学习任务?').then(()=> {
}).then(() => { }).then(() => {
// //
openSet(rows, 'list'); openSet(rows,'list');
}).catch(() => { }) }).catch(() => {})
} else { }else{
return proxy.$modal.alertWarning("请选择需要推送的任务!"); return proxy.$modal.alertWarning("请选择需要推送的任务!");
} }
} }
@ -412,12 +386,12 @@ const handleTaskAssignToAllClass = () => {
* //list * //list
*/ */
// //
const openSet = (row, type) => { const openSet=(row, type)=> {
if (type == 'list') { if(type == 'list'){
// row rows // row rows
rowsList.value = row; rowsList.value = row;
setDialog.value = true; setDialog.value = true;
} else { }else{
// row row, // row row,
rowsList.value = [row]; rowsList.value = [row];
setDialog.value = true; setDialog.value = true;
@ -426,7 +400,7 @@ const openSet = (row, type) => {
/** /**
* 关闭布置作业窗口 * 关闭布置作业窗口
*/ */
const closeHomework = () => { const closeHomework = () => {
rowsList.value = []; rowsList.value = [];
setDialog.value = false; setDialog.value = false;
} }
@ -441,6 +415,7 @@ const successHomework = () => {
initHomeWork(); initHomeWork();
}) })
} }
// -------------------- // --------------------
let classWorkForm = reactive({ let classWorkForm = reactive({
id: '',// cloneDeep(props.propsformobj.id), id: '',// cloneDeep(props.propsformobj.id),
@ -469,14 +444,12 @@ let propsformobj = reactive({
*/ */
const handleCurrentChange = (val) => { const handleCurrentChange = (val) => {
console.log(val, '选中的布置作业') console.log(val,'???????????')
if (val && val.id > 0) { if(val && val.id >0 ) {
currentRow.value.id = 1; currentRow.value.id = 1;
const typeName = val.worktype == "习题训练" ? "自主搜题" : "";
activeAptTab.value = typeName;
classWorkForm.worktype = val.worktype; // classWorkForm.worktype = val.worktype; //
editListItem(val, courseObj).then((obj) => { editListItem(val, courseObj).then((obj) => {
if (obj) { if(obj){
propsformobj = obj; propsformobj = obj;
// //
classWorkForm.id = obj.id; classWorkForm.id = obj.id;
@ -498,7 +471,7 @@ const handleCurrentChange = (val) => {
*/ */
const handleClassWorkQuizAdd = (entpcourseworkid) => { const handleClassWorkQuizAdd = (entpcourseworkid) => {
var exist = false; var exist = false;
for (var i = 0; i < classWorkForm.quizlist.length; i++) { for (var i=0; i< classWorkForm.quizlist.length; i++) {
if (classWorkForm.quizlist[i].id == entpcourseworkid) { if (classWorkForm.quizlist[i].id == entpcourseworkid) {
exist = true; exist = true;
break; break;
@ -508,7 +481,7 @@ const handleClassWorkQuizAdd = (entpcourseworkid) => {
getEntpcoursework(entpcourseworkid).then(res => { getEntpcoursework(entpcourseworkid).then(res => {
//res.data.titletext = res.data.title.replace(/<[^>]+>/g, ''); //res.data.titletext = res.data.title.replace(/<[^>]+>/g, '');
// //
if (res.data.score == null) { if(res.data.score == null){
res.data.score = 4; res.data.score = 4;
} }
classWorkForm.quizlist.push(res.data); classWorkForm.quizlist.push(res.data);
@ -520,14 +493,14 @@ const handleClassWorkQuizAdd = (entpcourseworkid) => {
} }
} }
/** 右侧资源删除按钮 习题list */ /** 右侧资源删除按钮 习题list */
const handleClassWorkFormQuizRemove = (index) => { const handleClassWorkFormQuizRemove = (index) =>{
classWorkForm.quizlist.splice(index, 1); classWorkForm.quizlist.splice(index, 1);
} }
/** /**
* 作业设计-提交 * 作业设计-提交
*/ */
const handleClassWorkSave = async () => { const handleClassWorkSave = async () => {
await nextTick(); // DOM await nextTick(); // DOM
proxy.$refs["classWorkFormRef"].validate(async valid => { proxy.$refs["classWorkFormRef"].validate(async valid => {
if (valid) { if (valid) {
@ -558,11 +531,11 @@ const handleClassWorkSave = async () => {
entpcourseworklist: '', // list entpcourseworklist: '', // list
}; };
if (cform.uniquekey.trim() == '') return ElMessage({ type: 'warning', message: '作业名称不能为空!' }); if(cform.uniquekey.trim() == '') return ElMessage({ type: 'warning', message: '作业名称不能为空!'});
// [] newWorkSpaceEdit true // [] newWorkSpaceEdit true
if (isShow.value === false) { if(isShow.value === false){
if (classWorkForm.id != '') {// id if(classWorkForm.id != '' ) {// id
editWork(cform); // editWork(cform); //
return; return;
} }
@ -576,11 +549,11 @@ const handleClassWorkSave = async () => {
// //
cform.worktag = classWorkForm.question; cform.worktag = classWorkForm.question;
cform.title = classWorkForm.title; cform.title = classWorkForm.title;
cform.workcodes = JSON.stringify({ json: canvasJson, base64: canvasBase64 }); cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
cform.entpcourseworklist = JSON.stringify([{ 'id': -1, 'score': '10' }]); cform.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
try { try {
addClassworkReturnId(cform).then((res) => { addClassworkReturnId(cform).then((res) => {
ElMessage({ type: 'success', message: '作业设计成功!' }); ElMessage({ type: 'success', message: '作业设计成功!'});
// //
classWorkForm.worktype = "课堂展示"; classWorkForm.worktype = "课堂展示";
classWorkForm.uniquekey = '';// classWorkForm.uniquekey, // classWorkForm.uniquekey = '';// classWorkForm.uniquekey, //
@ -592,21 +565,21 @@ const handleClassWorkSave = async () => {
classWorkForm.chooseWorkLists = []; // list classWorkForm.chooseWorkLists = []; // list
classWorkForm.whiteboardObj = ''; // ? // classWorkForm.whiteboardObj = ''; // ? //
classWorkForm.id = res classWorkForm.id = res
emits('getData', classWorkForm) emits('getData',classWorkForm)
boardLoading.value = false boardLoading.value = false
}) })
} finally { } finally {
boardLoading.value = false boardLoading.value = false
} }
} }
else if (classWorkForm.worktype === "常规作业") { else if(classWorkForm.worktype === "常规作业"){
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!' }); if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
fileLoading.value = true fileLoading.value = true
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.entpcourseworklist = JSON.stringify([{ 'id': -2, 'score': '10' }]); cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
try { try {
addClassworkReturnId(cform).then((res) => { addClassworkReturnId(cform).then((res) => {
ElMessage({ type: 'success', message: '作业设计成功!' }); ElMessage({ type: 'success', message: '作业设计成功!'});
// //
classWorkForm.worktype = "常规作业"; classWorkForm.worktype = "常规作业";
classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, // classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, //
@ -618,22 +591,21 @@ const handleClassWorkSave = async () => {
classWorkForm.whiteboardObj = ''; // ? // classWorkForm.whiteboardObj = ''; // ? //
classWorkForm.fileHomeworkList = []; // list classWorkForm.fileHomeworkList = []; // list
classWorkForm.id = res classWorkForm.id = res
emits('getData', classWorkForm) emits('getData',classWorkForm)
fileLoading.value = false fileLoading.value = false
}) })
} finally { } finally {
fileLoading.value = false fileLoading.value = false
} }
} }
else if (classWorkForm.worktype === "科学实验") { else if(classWorkForm.worktype === "科学实验"){
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!' }); if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!'});
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo; // , [-] cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); // cform.entpcourseworklist = JSON.stringify([{'id':-3, 'score': '10'}]);
cform.entpcourseworklist = JSON.stringify([{ 'id': -3, 'score': '10' }]);
try { try {
console.log(cform, '科学实验') console.log(cform,'科学实验')
addClassworkReturnId(cform).then((res) => { addClassworkReturnId(cform).then((res) => {
ElMessage({ type: 'success', message: '作业设计成功!' }); ElMessage({ type: 'success', message: '作业设计成功!'});
// //
classWorkForm.worktype = "科学实验"; classWorkForm.worktype = "科学实验";
classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, // classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, //
@ -645,10 +617,10 @@ const handleClassWorkSave = async () => {
classWorkForm.whiteboardObj = ''; // ? // classWorkForm.whiteboardObj = ''; // ? //
classWorkForm.fileHomeworkList = []; // list classWorkForm.fileHomeworkList = []; // list
classWorkForm.id = res classWorkForm.id = res
emits('getData', classWorkForm) emits('getData',classWorkForm)
// TODO // TODO
}) })
} finally { } finally{
// //
} }
} }
@ -656,14 +628,14 @@ const handleClassWorkSave = async () => {
// //
var ll = []; var ll = [];
if (classWorkForm.worktype === "习题训练") { if (classWorkForm.worktype === "习题训练") {
for (var i = 0; i < classWorkForm.quizlist.length; i++) { for (var i=0; i< classWorkForm.quizlist.length; i++) {
// //
ll.push({ 'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score }); ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
} }
} else if (classWorkForm.worktype === "框架梳理") { }else if( classWorkForm.worktype === "框架梳理") {
classWorkForm.chooseWorkLists.filter((item) => { classWorkForm.chooseWorkLists.filter((item) => {
if (item.worktype === classWorkForm.worktype) { if (item.worktype === classWorkForm.worktype) {
ll.push({ 'id': item.id, 'score': item.score }); ll.push({'id':item.id, 'score': item.score});
} }
}) })
} }
@ -673,11 +645,11 @@ const handleClassWorkSave = async () => {
} else { } else {
cform.entpcourseworklist = ''; cform.entpcourseworklist = '';
} }
console.log(cform, '提交的数据'); console.log(cform,'提交的数据');
if (cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!' }); if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
addClassworkReturnId(cform).then(res => { addClassworkReturnId(cform).then(res => {
ElMessage({ type: 'success', message: '作业设计成功!' }); ElMessage({ type: 'success', message: '作业设计成功!'});
// //
classWorkForm.worktype = "习题训练"; classWorkForm.worktype = "习题训练";
classWorkForm.uniquekey = '',// props.propsformobj.uniquekey, // classWorkForm.uniquekey = '',// props.propsformobj.uniquekey, //
@ -688,7 +660,7 @@ const handleClassWorkSave = async () => {
classWorkForm.chooseWorkLists = []; classWorkForm.chooseWorkLists = [];
classWorkForm.whiteboardObj = ''; // ? // classWorkForm.whiteboardObj = ''; // ? //
classWorkForm.id = res classWorkForm.id = res
emits('getData', classWorkForm) emits('getData',classWorkForm)
// refresh the list // refresh the list
// //
// this.getClassWorkAllList(); // this.getClassWorkAllList();
@ -697,9 +669,9 @@ const handleClassWorkSave = async () => {
} }
console.log('该清空左侧列表数据了'); console.log('该清空左侧列表数据了');
// //
if (isShow.value) { if(isShow.value){
currentRow.value.id = 1; currentRow.value.id = 1;
} else { }else{
currentRow.value.id = 0; currentRow.value.id = 0;
} }
initHomeWork(); initHomeWork();
@ -720,9 +692,9 @@ const handleClassWorkSave = async () => {
* 编辑作业内容 * 编辑作业内容
* @param cform 表单数据 * @param cform 表单数据
*/ */
const editWork = async (cform) => { const editWork = async (cform) =>{
// //
cform.id = classWorkForm.id; cform.id= classWorkForm.id;
// 0. // 0.
if (classWorkForm.worktype == '习题训练') { if (classWorkForm.worktype == '习题训练') {
@ -730,15 +702,15 @@ const editWork = async (cform) => {
ElMessage.error('请先添加作业资源!'); ElMessage.error('请先添加作业资源!');
return; return;
} }
} else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') { }else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
// //
if (classWorkForm.worktype == '课堂展示') { if(classWorkForm.worktype == '课堂展示'){
// //
} else { }else{
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!' }); if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
} }
} else if (classWorkForm.worktype == '科学实验') { }else if( classWorkForm.worktype == '科学实验') {
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验科目!' }); if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验科目!'});
} }
else { else {
if (classWorkForm.chooseWorkLists.length == 0) { if (classWorkForm.chooseWorkLists.length == 0) {
@ -750,13 +722,13 @@ const editWork = async (cform) => {
// //
if (classWorkForm.worktype == '习题训练') { if (classWorkForm.worktype=='习题训练'){
// 1. // 1.
let needUplEval = false; let needUplEval = false;
if (classWorkForm.quizlist.length != propsformobj.quizlist.length) { if (classWorkForm.quizlist.length != propsformobj.quizlist.length) {
needUplEval = true; needUplEval = true;
} else { }else {
// //
needUplEval = classWorkForm.quizlist.some(cur => needUplEval = classWorkForm.quizlist.some(cur =>
!propsformobj.quizlist.some(last => !propsformobj.quizlist.some(last =>
@ -770,7 +742,7 @@ const editWork = async (cform) => {
// : , , // : , ,
// 2.1.workidid // 2.1.workidid
let arrEvalids = []; let arrEvalids = [];
const wevalres = await listClassworkeval({ 'workid': classWorkForm.id }); const wevalres = await listClassworkeval({'workid': classWorkForm.id});
wevalres.rows.forEach(element => { wevalres.rows.forEach(element => {
arrEvalids.push(element.id); arrEvalids.push(element.id);
}); });
@ -780,22 +752,21 @@ const editWork = async (cform) => {
const delRes = await delClassworkeval(ids); const delRes = await delClassworkeval(ids);
// 2.3. // 2.3.
for (let i = 0; i < classWorkForm.quizlist.length; i++) { for(let i=0; i< classWorkForm.quizlist.length; i++){
const addRes = await addClassworkeval({ const addRes = await addClassworkeval({
'workid': classWorkForm.id, 'workid': classWorkForm.id,
'entpcourseworkid': classWorkForm.quizlist[i].id, 'entpcourseworkid': classWorkForm.quizlist[i].id,
'workdataid': 0, 'workdataid': 0,
'score': classWorkForm.quizlist[i].score 'score': classWorkForm.quizlist[i].score}
}
); );
} }
} }
// 3.- // 3.-
} }
else if (classWorkForm.worktype == '框架梳理') { else if (classWorkForm.worktype=='框架梳理') {
// 1.workidid // 1.workidid
const wevalres = await listClassworkeval({ 'workid': classWorkForm.id }); const wevalres = await listClassworkeval({'workid': classWorkForm.id});
if (wevalres.rows.length == 0) { if (wevalres.rows.length == 0) {
ElMessage.error('未找到原框架梳理任务,请或退出重试'); ElMessage.error('未找到原框架梳理任务,请或退出重试');
return; return;
@ -805,7 +776,7 @@ const editWork = async (cform) => {
let needUplEval = false; let needUplEval = false;
if (classWorkForm.chooseWorkLists.length !== propsformobj.chooseWorkLists.length) { if (classWorkForm.chooseWorkLists.length !== propsformobj.chooseWorkLists.length) {
needUplEval = true; needUplEval = true;
} else { }else {
// //
needUplEval = classWorkForm.chooseWorkLists.some(cur => needUplEval = classWorkForm.chooseWorkLists.some(cur =>
!propsformobj.chooseWorkLists.some(last => !propsformobj.chooseWorkLists.some(last =>
@ -823,32 +794,29 @@ const editWork = async (cform) => {
let res = await updateClassworkeval(uplParams); let res = await updateClassworkeval(uplParams);
} }
} }
else if (classWorkForm.worktype == '课堂展示') { else if (classWorkForm.worktype=='课堂展示') {
let canvasJson = proxy.$refs.boardref.getCanvasJson() let canvasJson = proxy.$refs.boardref.getCanvasJson()
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64() let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
cform.workcodes = JSON.stringify({ json: canvasJson, base64: canvasBase64 }); cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
cform.worktag = classWorkForm.question; cform.worktag = classWorkForm.question;
} }
else if (classWorkForm.worktype == '常规作业') { else if (classWorkForm.worktype=='常规作业') {
// 1. (, ) // 1. (, )
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
} }
else if (classWorkForm.worktype == '科学实验') { //TODO fileHomeworkList else if (classWorkForm.worktype=='科学实验') { //TODO fileHomeworkList
// 1. (, ) // 1. (, )
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo;
} }
// 3. // 3.
let res = await updateClasswork(cform); let res = await updateClasswork(cform);
if (res.code == 200) { if (res.code == 200) {
ElMessage.success('更新成功'); ElMessage.success('更新成功');
taskList.value = [];
// //
if (isShow.value) { if(isShow.value){
currentRow.value.id = 1; currentRow.value.id = 1;
} else { }else{
handleNewAllClass();
currentRow.value.id = 0; currentRow.value.id = 0;
} }
initHomeWork(); initHomeWork();
@ -857,22 +825,6 @@ const editWork = async (cform) => {
} }
} }
// ,
const handlePrint = () => {
const printOptions = {
silent: false, //
printBackground: true, //
color: false, //
marginsType: 0, // 0: 1: 2:
pageSize: 'A4', //
//
};
console.log("print-page-click");
ipcRenderer.send('printPage', printOptions);
};
//---- //----
@ -880,33 +832,29 @@ const handlePrint = () => {
<style scoped lang="scss"> <style scoped lang="scss">
.page { .page {
height: 100%; height: 100%;
.page-top { .page-top {
height: 50px; height: 50px;
margin-bottom: 5px; margin-bottom: 5px;
padding: 0 10px; padding: 0 10px;
display: flex; display: flex;
flex-direction: row; justify-content: space-between;
background-color: white; background-color: white;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06); box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
align-items: center; align-items: center;
} }
.page-resource { .page-resource {
user-select: none; user-select: none;
height: calc(100% - 55px); height: calc(100% - 55px);
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
:deep(.el-tabs__nav) { :deep(.el-tabs__nav) {
.el-tabs__item { .el-tabs__item{
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
} }
} }
.page-left { .page-left {
width: 240px; width: 240px;
background-color: white; background-color: white;
@ -919,7 +867,6 @@ const handlePrint = () => {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.pageleft-table-cont { .pageleft-table-cont {
height: 35px; height: 35px;
// width: 100%; // width: 100%;
@ -928,30 +875,21 @@ const handlePrint = () => {
// overflow: hidden; // overflow: hidden;
// flex-direction: row; // flex-direction: row;
// text-overflow: ellipsis; // text-overflow: ellipsis;
width: 100%; width: 100%; /* 设置容器的宽度 */
/* 设置容器的宽度 */ overflow: hidden; /* 隐藏超出容器的部分 */
overflow: hidden; white-space: nowrap; /* 防止文本换行 */
/* 隐藏超出容器的部分 */ text-overflow: ellipsis; /* 超出部分显示省略号 */
white-space: nowrap;
/* 防止文本换行 */
text-overflow: ellipsis;
/* 超出部分显示省略号 */
.ellipsis { .ellipsis {
width: 100%; width: 100%;
text-align: left; text-align: left;
overflow: hidden; overflow: hidden; /* 隐藏超出容器的部分 */
/* 隐藏超出容器的部分 */ white-space: nowrap; /* 防止文本换行 */
white-space: nowrap; text-overflow: ellipsis; /* 超出部分显示省略号 */
/* 防止文本换行 */
text-overflow: ellipsis;
/* 超出部分显示省略号 */
} }
} }
} }
.page-center{
.page-center {
flex: 1; flex: 1;
//min-width: calc(100% - 675px); //min-width: calc(100% - 675px);
height: 100%; height: 100%;
@ -961,34 +899,31 @@ const handlePrint = () => {
border-radius: 10px; border-radius: 10px;
background-color: white; background-color: white;
.prepare-center-zzst { .prepare-center-zzst{
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.prepare-center-xbtk{
.prepare-center-xbtk {
height: 100%; height: 100%;
} }
.prepare-center-grst{
.prepare-center-grst {
height: 100%; height: 100%;
} }
.upload-homework { .upload-homework{
padding: 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.experiment-homework { .experiment-homework{
padding: 15px; padding: 15px;
height: 100%; height: 100%;
} }
} }
.page-right { .page-right {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
@ -1000,17 +935,15 @@ const handlePrint = () => {
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06); box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.prepare-top { .prepare-top {
display: flex; display: flex;
height: 40px; height: 40px;
margin: 0 10px; margin: 0 10px;
border-bottom: 2px solid #e5e7eb; border-bottom: 2px solid #e5e7eb;
align-items: center; align-items: center;
justify-content: space-between; justify-content: flex-end;
} }
.prepare-con{
.prepare-con {
height: 100%; height: 100%;
padding: 5px 10px; padding: 5px 10px;
overflow: hidden; overflow: hidden;
@ -1028,8 +961,5 @@ const handlePrint = () => {
} }
} }
} }
::v-deep img {
display: inline-block !important;
}
</style> </style>

View File

@ -17,13 +17,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" :offset="2">
<el-button v-if="!props.isHtml2canvas" type="primary" @click="goToQuestUpload()">添加习题</el-button>
</el-col>
</el-row>
<!-- 习题筛选2 -->
<el-row style="width: 100%; height: 50px;">
<el-col :span="7"> <el-col :span="7">
<el-form-item label="年份" label-width="70"> <el-form-item label="年份" label-width="70">
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择"> <el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择">
@ -31,6 +24,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<!-- 习题筛选2 -->
<el-row style="width: 100%; height: 50px;">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="关键词" label-width="70"> <el-form-item label="关键词" label-width="70">
<el-input <el-input
@ -43,6 +39,9 @@
<el-col :span="5"> <el-col :span="5">
<el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button> <el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button>
</el-col> </el-col>
<el-col :span="5">
<el-button v-if="!props.isHtml2canvas" type="primary" @click="goToQuestUpload()">添加习题</el-button>
</el-col>
</el-row> </el-row>
<!-- 习题表格 --> <!-- 习题表格 -->
<div class="page-table" > <div class="page-table" >
@ -130,7 +129,6 @@ import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue"; import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue";
import { useHandleData } from "@/hooks/useHandleData"; import { useHandleData } from "@/hooks/useHandleData";
import { processList } from '@/hooks/useProcessList'; import { processList } from '@/hooks/useProcessList';
import { isJson } from "@/utils/comm";
import { debounce } from '@/utils/comm' import { debounce } from '@/utils/comm'
@ -256,7 +254,6 @@ function Apis(key) {
const client = new Apis('/paht'); const client = new Apis('/paht');
const t = function(name, time) { const t = function(name, time) {
return new Promise(resolve => { return new Promise(resolve => {
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
const queryForm = { const queryForm = {
// //
worktype: entpCourseWorkQueryParams.worktype.label, worktype: entpCourseWorkQueryParams.worktype.label,
@ -269,7 +266,7 @@ const t = function(name, time) {
// //
edustage: userStore.edustage, // this.userStore.edustage, edustage: userStore.edustage, // this.userStore.edustage,
edusubject: userStore.edusubject, // this.userStore.edusubject, edusubject: userStore.edusubject, // this.userStore.edusubject,
eid: evalId, // id eid: props.bookobj.levelSecondId, // this.activeParams.lession.id,
status: "1", status: "1",
editUserId: userStore.userId, editUserId: userStore.userId,
//orderby: 'concat(worktype,timestamp) DESC', //orderby: 'concat(worktype,timestamp) DESC',
@ -329,13 +326,10 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
} }
//console.log("clueres.rows[i].childlist",clueres.rows[i].childlist); //console.log("clueres.rows[i].childlist",clueres.rows[i].childlist);
if (clueres.rows[i].childlist != '') { if (clueres.rows[i].childlist != '') {
const tmpJson = '['+clueres.rows[i].childlist+']'; clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
if (isJson(tmpJson)){
clueres.rows[i].childArray = JSON.parse(tmpJson);
for (var j=0; j<clueres.rows[i].childArray.length; j++) { for (var j=0; j<clueres.rows[i].childArray.length; j++) {
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, ''); clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
} }
}
} else { } else {
clueres.rows[i].childArray = {}; clueres.rows[i].childArray = {};
} }
@ -488,16 +482,8 @@ const debounceQueryData = debounce(() => {
}, 1000); }, 1000);
watch([ watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
() => props.bookobj.levelFirstId,
() => props.bookobj.levelSecondId
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
console.log(props.bookobj,'课程选择') console.log(props.bookobj,'课程选择')
// , ,
if (props.bookobj.levelSecondId == '') {
workResource.entpCourseWorkList = [];
return;
}
debounceQueryData(); debounceQueryData();
}) })

View File

@ -43,7 +43,7 @@
</div> </div>
<!-- orc 使用说明 --> <!-- orc 使用说明 -->
<div class="import-manual-explain"> <div class="import-manual-explain">
<p>orc 使用说明填空题暂无法整题识别</p> <p>orc 使用说明</p>
<p>1本地浏览 </p> <p>1本地浏览 </p>
<p>2获取剪贴板图片 </p> <p>2获取剪贴板图片 </p>
<p>3整题识别可识别整张图片自动填充到对应内容 </p> <p>3整题识别可识别整张图片自动填充到对应内容 </p>
@ -127,7 +127,7 @@ const courseObj = reactive({
const activeAptTab = ref("人工录入"); const activeAptTab = ref("人工录入");
// false - api true - json // false - api true - json
const OCR_WORK_TEST = true; const OCR_WORK_TEST = false;
// [] // []
const cropOption = reactive({ const cropOption = reactive({
img: '', // url , base64, blob img: '', // url , base64, blob

Some files were not shown because too many files have changed in this diff Show More