Compare commits
No commits in common. "main" and "2.5.15-yc" have entirely different histories.
27
.env.yy
27
.env.yy
|
@ -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'
|
|
|
@ -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:
|
||||||
# - '**/*'
|
- '**/*'
|
||||||
|
|
|
@ -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:
|
||||||
# - '**/*'
|
- '**/*'
|
||||||
|
|
|
@ -6,11 +6,6 @@ directories:
|
||||||
win:
|
win:
|
||||||
executableName: 永川中小学AI教学系统
|
executableName: 永川中小学AI教学系统
|
||||||
icon: resources/yc-logo.png
|
icon: resources/yc-logo.png
|
||||||
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:
|
||||||
# - '**/*'
|
- '**/*'
|
||||||
|
|
|
@ -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/*'
|
||||||
|
@ -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:
|
||||||
# - '**/*'
|
- '**/*'
|
||||||
|
|
|
@ -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:
|
|
||||||
# - '**/*'
|
|
|
@ -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:
|
||||||
# - '**/*'
|
- '**/*'
|
||||||
|
|
10
package.json
10
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win-ws",
|
"name": "aix-win-ws",
|
||||||
"version": "2.5.16",
|
"version": "2.5.15",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "上海交大重庆人工智能研究院",
|
"author": "上海交大重庆人工智能研究院",
|
||||||
|
@ -14,11 +14,9 @@
|
||||||
"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": "node updatePackageJsonName.js && 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": "node updatePackageJsonName.js && 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": "node updatePackageJsonName.js && 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": "node updatePackageJsonName.js && 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"
|
||||||
|
@ -44,7 +42,7 @@
|
||||||
"@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",
|
"aix-plugins-aitools": "^1.1.0",
|
||||||
"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 +54,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 |
|
@ -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()})`)
|
||||||
})
|
})
|
||||||
// 用于监听-状态管理变化-同步所有窗口
|
// 用于监听-状态管理变化-同步所有窗口
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 data:;" />
|
||||||
|
|
||||||
</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>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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,则更新当前页码
|
||||||
|
|
|
@ -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)
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -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
|
||||||
|
|
|
@ -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) => {
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
})
|
})
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -95,18 +95,3 @@ export const addFileToSC = (params) => {
|
||||||
params
|
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'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
|
@ -118,14 +118,6 @@ export function docList(params) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除 doc ai文档
|
|
||||||
export function removeDoc(id) {
|
|
||||||
return request({
|
|
||||||
url: '/education/doc/' + id,
|
|
||||||
method: 'delete',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存教学大纲
|
// 保存教学大纲
|
||||||
export function addSyllabus(data) {
|
export function addSyllabus(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 107 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.5 MiB |
|
@ -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>
|
|
|
@ -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>
|
|
@ -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;
|
||||||
|
|
|
@ -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('')
|
||||||
|
|
||||||
// 重新研读
|
// 重新研读
|
||||||
|
@ -485,18 +483,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) {
|
||||||
|
|
|
@ -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>
|
||||||
|
@ -69,7 +65,6 @@ 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 +75,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 = () => {
|
||||||
|
@ -232,11 +224,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>
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -55,36 +55,6 @@ VMdPreview.use(githubTheme, {
|
||||||
Hljs: hljs,
|
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 })
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
@ -90,12 +90,6 @@ 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'),
|
||||||
|
|
|
@ -411,14 +411,12 @@ export const dataSetJson = {
|
||||||
"考试-小学-语文": "570f7ed2cc9d11ef9e070242ac140002",
|
"考试-小学-语文": "570f7ed2cc9d11ef9e070242ac140002",
|
||||||
"考试-小学-数学": "983270b8cc9d11efbbd80242ac140002",
|
"考试-小学-数学": "983270b8cc9d11efbbd80242ac140002",
|
||||||
"考试-小学-英语": "d5f80e4ccc9d11ef96fa0242ac140002",
|
"考试-小学-英语": "d5f80e4ccc9d11ef96fa0242ac140002",
|
||||||
"课标-小学-信息科技": "2fe08c7ad18911efbeaa0242ac140002",
|
|
||||||
"课标-小学-科学": "935cfec8bf6a11ef98950242ac140006",
|
"课标-小学-科学": "935cfec8bf6a11ef98950242ac140006",
|
||||||
"课标-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002",
|
"课标-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002",
|
||||||
"课标-小学-语文": "f76f1aa5bf7111ef90c80242ac140002",
|
"课标-小学-语文": "f76f1aa5bf7111ef90c80242ac140002",
|
||||||
"课标-小学-道德": "8da87869cbd711ef92280242ac140002",
|
"课标-小学-道德": "8da87869cbd711ef92280242ac140002",
|
||||||
"课标-小学-英语": "dc963316cbd811ef8d820242ac140002",
|
"课标-小学-英语": "dc963316cbd811ef8d820242ac140002",
|
||||||
"课标-小学-劳动": "fc047d81cbdc11efa1740242ac140002",
|
"课标-小学-劳动": "fc047d81cbdc11efa1740242ac140002",
|
||||||
"教材-小学-信息科技": "2fe08c7ad18911efbeaa0242ac140002",
|
|
||||||
"教材-小学-科学": "935cfec8bf6a11ef98950242ac140006",
|
"教材-小学-科学": "935cfec8bf6a11ef98950242ac140006",
|
||||||
"教材-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002",
|
"教材-小学-数学": "3c4e298fbf7911ef8e8b0242ac140002",
|
||||||
"教材-小学-语文": "f76f1aa5bf7111ef90c80242ac140002",
|
"教材-小学-语文": "f76f1aa5bf7111ef90c80242ac140002",
|
||||||
|
|
|
@ -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 };
|
|
||||||
}
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
|
|
@ -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) => {
|
||||||
|
|
|
@ -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,59 @@
|
||||||
<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 ref="boardref" height="100%" width="100%" :isShowSave="false" :data="classWorkForm.whiteboardObj" />
|
||||||
: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 +126,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 +135,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 +161,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,
|
||||||
|
@ -188,7 +179,7 @@ const courseObj = reactive({
|
||||||
textbookId: '',
|
textbookId: '',
|
||||||
levelFirstId: '',
|
levelFirstId: '',
|
||||||
levelSecondId: '',
|
levelSecondId: '',
|
||||||
coursetitle: '',
|
coursetitle:'',
|
||||||
node: null, // 选择的课程节点
|
node: null, // 选择的课程节点
|
||||||
//
|
//
|
||||||
})
|
})
|
||||||
|
@ -203,7 +194,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);
|
||||||
|
@ -213,16 +204,16 @@ 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 +221,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 +234,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 +253,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 +261,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 +280,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 +292,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 +309,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'));
|
||||||
|
@ -338,9 +325,9 @@ const initHomeWork = async () => {
|
||||||
taskList.value = res;
|
taskList.value = res;
|
||||||
// 判断当前是否存在其他页面跳转编辑, 如果初次且存在id,则选中该任务
|
// 判断当前是否存在其他页面跳转编辑, 如果初次且存在id,则选中该任务
|
||||||
const taskId = propsQueryTask?.id ?? 0;
|
const taskId = propsQueryTask?.id ?? 0;
|
||||||
if (!propsQueryTask.isInit && taskId != 0) {
|
if (!propsQueryTask.isInit && taskId!=0){
|
||||||
const activeRow = taskList.value.find(o => o.id == taskId);
|
const activeRow = taskList.value.find(o => o.id == taskId);
|
||||||
if (activeRow) {
|
if (activeRow){
|
||||||
propsQueryTask.isInit = true; // 清空避免重新保存后再次选中该任务
|
propsQueryTask.isInit = true; // 清空避免重新保存后再次选中该任务
|
||||||
taskTable.value.setCurrentRow(activeRow);
|
taskTable.value.setCurrentRow(activeRow);
|
||||||
handleCurrentChange(activeRow);
|
handleCurrentChange(activeRow);
|
||||||
|
@ -367,10 +354,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 +373,8 @@ const handleDelete = () => {
|
||||||
}, 1500);
|
}, 1500);
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
|
||||||
}).catch(() => { })
|
}).catch(() => {})
|
||||||
} else {
|
}else{
|
||||||
proxy.$modal.alertWarning("请选择删除项")
|
proxy.$modal.alertWarning("请选择删除项")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -398,12 +385,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 +399,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 +413,7 @@ const openSet = (row, type) => {
|
||||||
/**
|
/**
|
||||||
* 关闭布置作业窗口
|
* 关闭布置作业窗口
|
||||||
*/
|
*/
|
||||||
const closeHomework = () => {
|
const closeHomework = () => {
|
||||||
rowsList.value = [];
|
rowsList.value = [];
|
||||||
setDialog.value = false;
|
setDialog.value = false;
|
||||||
}
|
}
|
||||||
|
@ -469,14 +456,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 +483,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 +493,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 +505,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 +543,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 +561,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 +577,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 +603,22 @@ 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.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 +630,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 +641,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 +658,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 +673,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 +682,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 +705,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 +715,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 +735,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 +755,7 @@ const editWork = async (cform) => {
|
||||||
// 说明: 因试题分值也需修改, 故无法通过按钮的增长删除来处理, 故将原作业全部删除后再重新添加
|
// 说明: 因试题分值也需修改, 故无法通过按钮的增长删除来处理, 故将原作业全部删除后再重新添加
|
||||||
// 2.1.先查询该workid下所有的id
|
// 2.1.先查询该workid下所有的id
|
||||||
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 +765,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.先查询该workid下所有的id
|
// 1.先查询该workid下所有的id
|
||||||
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 +789,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,17 +807,17 @@ 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;
|
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo;
|
||||||
|
@ -845,9 +829,9 @@ const editWork = async (cform) => {
|
||||||
ElMessage.success('更新成功');
|
ElMessage.success('更新成功');
|
||||||
taskList.value = [];
|
taskList.value = [];
|
||||||
// 清空左侧 选中的布置列表 并刷新列表
|
// 清空左侧 选中的布置列表 并刷新列表
|
||||||
if (isShow.value) {
|
if(isShow.value){
|
||||||
currentRow.value.id = 1;
|
currentRow.value.id = 1;
|
||||||
} else {
|
}else{
|
||||||
handleNewAllClass();
|
handleNewAllClass();
|
||||||
currentRow.value.id = 0;
|
currentRow.value.id = 0;
|
||||||
}
|
}
|
||||||
|
@ -857,22 +841,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 +848,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 +883,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 +891,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 +915,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 +951,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 +977,5 @@ const handlePrint = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::v-deep img {
|
|
||||||
display: inline-block !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
<el-table-column align="left" width="100">
|
<el-table-column align="left" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-if="props.isHtml2canvas" type="primary" @click="captureScreenshot(scope.row.id)">选取该题</el-button>
|
<el-button v-if="props.isHtml2canvas" type="primary" @click="captureScreenshot(scope.row.id)">选取该题</el-button>
|
||||||
<el-button v-else type="primary" @click="handleClassWorkQuizAdd(scope.row, scope.row.id)">添加</el-button>
|
<el-button v-else type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -126,7 +126,7 @@ import useUserStore from '@/store/modules/user'
|
||||||
import useClassTaskStore from '@/store/modules/classTask'
|
import useClassTaskStore from '@/store/modules/classTask'
|
||||||
|
|
||||||
// 定义要发送的emit事件
|
// 定义要发送的emit事件
|
||||||
let emit = defineEmits(['addQuiz', 'addQuizImgBs64', "addQuizItem"])
|
let emit = defineEmits(['addQuiz', 'addQuizImgBs64'])
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const {
|
const {
|
||||||
|
@ -420,13 +420,11 @@ const getPaginationList = async ( page, limit ) => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加资源
|
* 添加资源
|
||||||
* @param rw - 试题itemINFO
|
* @param fromsrc - 试题来源
|
||||||
* @param entpcourseworkid
|
* @param entpcourseworkid
|
||||||
*/
|
*/
|
||||||
const handleClassWorkQuizAdd = (row, entpcourseworkid) => {
|
const handleClassWorkQuizAdd = (fromsrc, entpcourseworkid) => {
|
||||||
emit('addQuiz', entpcourseworkid);
|
emit('addQuiz', entpcourseworkid);
|
||||||
emit('addQuizItem', row); // TODO 暂时使用,后面修改逻辑---添加到 自主组卷
|
|
||||||
|
|
||||||
// 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) {
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
<script setup >
|
<script setup >
|
||||||
import { ref, reactive, onMounted ,watch} from 'vue'
|
import { ref, reactive, onMounted ,watch} from 'vue'
|
||||||
import { regionData, codeToText } from '@/plugins/china-area-data-json'
|
import { regionData, codeToText } from 'element-china-area-data'
|
||||||
import { getUserProfile } from '@/api/system/user'
|
import { getUserProfile } from '@/api/system/user'
|
||||||
import {getDept} from '@/api/login'
|
import {getDept} from '@/api/login'
|
||||||
import {school} from '@/api/apiService'
|
import {school} from '@/api/apiService'
|
||||||
|
|
|
@ -114,7 +114,7 @@ import { ref, defineExpose, reactive ,onMounted} from 'vue'
|
||||||
import {captchaImg,sendCode,deptTree,getDept,listClassmain,listEvaluation,signIn, retrievePwd} from '@/api/login'
|
import {captchaImg,sendCode,deptTree,getDept,listClassmain,listEvaluation,signIn, retrievePwd} from '@/api/login'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import {setToken, removeToken } from '@/utils/auth'
|
import {setToken, removeToken } from '@/utils/auth'
|
||||||
import { regionData, codeToText } from '@/plugins/china-area-data-json'
|
import { regionData, codeToText } from 'element-china-area-data'
|
||||||
const ruleFormRef = ref(null)
|
const ruleFormRef = ref(null)
|
||||||
const activeIndex=ref(1)
|
const activeIndex=ref(1)
|
||||||
const ruleForm = reactive({
|
const ruleForm = reactive({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
<div class="box-item desc" style="flex: 1">
|
<div class="box-item desc">
|
||||||
<div class="welcome">
|
<div class="welcome">
|
||||||
<p>欢迎登录 {{ homeTitle }}</p>
|
<p>欢迎登录 {{ homeTitle }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<ycLogin v-if="buildMode === 'yc'||buildMode === 'yc2'">
|
<ycLogin v-if="buildMode === 'yc'||buildMode === 'yc2'">
|
||||||
</ycLogin>
|
</ycLogin>
|
||||||
<yyLogin v-else-if="buildMode === 'yy'">
|
|
||||||
</yyLogin>
|
|
||||||
<defultLogin v-else>
|
<defultLogin v-else>
|
||||||
</defultLogin>
|
</defultLogin>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import ycLogin from './yc-login.vue'
|
import ycLogin from './yc-login.vue'
|
||||||
import yyLogin from './yy-login.vue'
|
|
||||||
import defultLogin from './defult-login.vue'
|
import defultLogin from './defult-login.vue'
|
||||||
const buildMode = import.meta.env.MODE
|
const buildMode = import.meta.env.MODE
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,458 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="login-container">
|
|
||||||
<div class="login-yc">
|
|
||||||
<img class="welcome-img" :src="leftBg1" />
|
|
||||||
</div>
|
|
||||||
<div class="box-item login" v-if="isRegister">
|
|
||||||
<WindowTools :is-has-max="false" />
|
|
||||||
<div style="display: flex;justify-content: center;"><img class="title-logo" :src="yylogo" /></div>
|
|
||||||
<div class="login-title">育人酉数平台</div>
|
|
||||||
<el-form ref="formRef" class="login-form" :model="loginForm" :rules="rules" size="large">
|
|
||||||
<el-form-item prop="username">
|
|
||||||
<el-input v-model.trim="loginForm.username" placeholder="请输入用户名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item prop="password" style="margin-bottom: 15px">
|
|
||||||
<el-input v-model="loginForm.password" autocomplete="on" type="password" placeholder="请输入密码" />
|
|
||||||
</el-form-item>
|
|
||||||
<div class="flex mb-5">
|
|
||||||
<el-checkbox v-model="loginForm.rememberMe">记住密码</el-checkbox>
|
|
||||||
<!-- <el-checkbox >阅读并同意《xxx》</el-checkbox> -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-form-item style="margin-bottom: 20px">
|
|
||||||
<el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)">登录</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;">
|
|
||||||
<a class="hover:text-sky-500" style="margin-right: 10px;" @click="gotoreRegister">注册账号</a>
|
|
||||||
</div>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box-item login" v-else>
|
|
||||||
<WindowTools :is-has-max="false" />
|
|
||||||
<div class="login-title">账号注册</div>
|
|
||||||
<el-form ref="ruleFormRef" class="login-form" :model="ruleForm" label-width="auto" :rules="rules" size="large">
|
|
||||||
<el-form-item label="手机号" prop="username">
|
|
||||||
<el-input v-model="ruleForm.username" placeholder="请输入手机号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="验证码" prop="smsCode" style="display: flex">
|
|
||||||
<el-input style="width:185px" v-model="ruleForm.smsCode" placeholder="请输入验证码" /><el-button style="margin-left:10px;width:100px" :disabled="codeName=='发送验证码'?false:true" type="primary" @click="sendyzm">{{ codeName }}</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="密码" prop="password" >
|
|
||||||
<el-input autocomplete="on" type="password" v-model="ruleForm.password" placeholder="请输入密码" />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
|
||||||
<el-button class="btn" type="primary" @click="RegisterForm(ruleFormRef)">立即注册</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;">
|
|
||||||
<a class="hover:text-sky-500" style="margin-right: 10px;" @click="gotoLogin"> 《 返回登录 </a>
|
|
||||||
</div>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-dialog v-model="showDownLoading" width="500" :show-close="false" :close-on-click-modal="false"
|
|
||||||
:close-on-press-escape="false" align-center>
|
|
||||||
<el-progress :text-inside="true" :stroke-width="22" :percentage="downloadProp" :show-text="false"
|
|
||||||
status="success" />
|
|
||||||
</el-dialog>
|
|
||||||
<el-dialog
|
|
||||||
v-model="isImg"
|
|
||||||
title="人机验证"
|
|
||||||
width="500"
|
|
||||||
style=" -webkit-app-region: no-drag;"
|
|
||||||
>
|
|
||||||
<span>根据图片回答相关问题1</span>
|
|
||||||
<div style="display: flex;align-items: center;;margin-top:30px">
|
|
||||||
<img :src="isPeopleImg" style="width:200px;height:60px;cursor: pointer;" alt="" srcset="" @click="refreshImg">
|
|
||||||
<el-input v-model="ruleForm.imgCode" style="width: 250px;height:40px;margin-left:20px" placeholder="请根据图片填入答案" />
|
|
||||||
</div>
|
|
||||||
<div style="display: flex;justify-content: center;margin-top:30px">
|
|
||||||
<el-button type="primary" @click="sbmitImg">确定</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
<!--选择学科-->
|
|
||||||
<SelectSubject v-model="isSubject" :login-data="loginForm" />
|
|
||||||
<!--注册弹框-->
|
|
||||||
<Register ref="RegModel"></Register>
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import { onMounted, reactive, ref } from 'vue'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
import WindowTools from '@/components/window-tools/index.vue'
|
|
||||||
import SelectSubject from '@/components/select-subject/index.vue'
|
|
||||||
import Register from './components/Register.vue'
|
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
import {sendcode,instructorregister,getCodeImg} from '@/api/login'
|
|
||||||
import yylogo from '@/assets/images/login/yy-logo.png'
|
|
||||||
import leftBg1 from '@/assets/images/login/yy_bacg.jpg'
|
|
||||||
const { session } = require('@electron/remote')
|
|
||||||
const buildMode = import.meta.env.MODE
|
|
||||||
const downloadProp = ref(0)
|
|
||||||
const showDownLoading = ref(false)
|
|
||||||
const { ipcRenderer } = window.electron || {}
|
|
||||||
const formRef = ref()
|
|
||||||
const userStore = useUserStore()
|
|
||||||
const btnLoading = ref(false)
|
|
||||||
const isSubject = ref(false)
|
|
||||||
const RegModel = ref(false)
|
|
||||||
const isRegister = ref(true)
|
|
||||||
const ruleFormRef = ref(null)
|
|
||||||
const codeName=ref('发送验证码')
|
|
||||||
const timer=ref(null)
|
|
||||||
const isImg=ref(false)
|
|
||||||
const isPeopleImg=ref(null)
|
|
||||||
const type=ref(1) // 1注册 2找回密码
|
|
||||||
const resImg = reactive({ imgData: {} });
|
|
||||||
|
|
||||||
//表单
|
|
||||||
const loginForm = reactive({
|
|
||||||
username: '',
|
|
||||||
password: '',
|
|
||||||
rememberMe: false
|
|
||||||
})
|
|
||||||
// 注册表单
|
|
||||||
const ruleForm = reactive({
|
|
||||||
|
|
||||||
})
|
|
||||||
//表单规则
|
|
||||||
const rules = reactive({
|
|
||||||
username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
|
|
||||||
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }],
|
|
||||||
smsCode: [{ required: true, trigger: 'blur', message: '请输入您的验证码' }],
|
|
||||||
})
|
|
||||||
|
|
||||||
let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
|
||||||
let homeTitle = ref(import.meta.env.VITE_APP_TITLE)
|
|
||||||
ipcRenderer.on('update-app-progress', (e, prop) => {
|
|
||||||
downloadProp.value = prop
|
|
||||||
showDownLoading.value = prop !== 100
|
|
||||||
})
|
|
||||||
const gotoreRegister=()=>{
|
|
||||||
codeName.value='发送验证码'
|
|
||||||
if(timer.value){
|
|
||||||
clearInterval(timer.value);
|
|
||||||
}
|
|
||||||
isRegister.value=false
|
|
||||||
}
|
|
||||||
// 刷新
|
|
||||||
const refreshImg=()=>{
|
|
||||||
getCodeImg().then(res=>{
|
|
||||||
isPeopleImg.value='data:image/jpg;base64,'+res.img
|
|
||||||
resImg.imgData=res
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 提交人机验证
|
|
||||||
const sbmitImg=()=>{
|
|
||||||
if(ruleForm.imgCode){
|
|
||||||
// {mobile:ruleForm.phoneNumber,code:ruleForm.imgCode,uuid:resImg.imgData.uuid}
|
|
||||||
const { username:username,imgCode:code } = ruleForm
|
|
||||||
const params = {
|
|
||||||
username, code,
|
|
||||||
uuid: resImg.imgData.uuid,
|
|
||||||
source:4
|
|
||||||
}
|
|
||||||
sendcode(params).then(res=>{
|
|
||||||
if(res.code==200){
|
|
||||||
ElMessage.success('短信发送成功')
|
|
||||||
ruleForm.Code=res.data
|
|
||||||
isImg.value=false
|
|
||||||
codeName.value=60
|
|
||||||
timer.value=setInterval(()=>{
|
|
||||||
codeName.value--
|
|
||||||
if(codeName.value==0){
|
|
||||||
codeName.value='发送验证码'
|
|
||||||
clearInterval(timer.value);
|
|
||||||
}
|
|
||||||
},1000)
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
ElMessage.error('请根据图片输入验证码')
|
|
||||||
}
|
|
||||||
//
|
|
||||||
}
|
|
||||||
// 发送验证码
|
|
||||||
const sendyzm=()=>{
|
|
||||||
if(ruleForm.username){
|
|
||||||
const pattern = /^1[3-9]\d{9}$/;
|
|
||||||
if( pattern.test(ruleForm.username) ){
|
|
||||||
|
|
||||||
getCodeImg().then(res=>{
|
|
||||||
if(res.code==200){
|
|
||||||
ruleForm.imgCode=null
|
|
||||||
isPeopleImg.value='data:image/jpg;base64,'+res.img
|
|
||||||
isImg.value=true
|
|
||||||
resImg.imgData=res
|
|
||||||
// codeName.value=60
|
|
||||||
// timer.value=setInterval(()=>{
|
|
||||||
// codeName.value--
|
|
||||||
// if(codeName.value==0){
|
|
||||||
// codeName.value='发送验证码'
|
|
||||||
// clearInterval(timer.value);
|
|
||||||
// }
|
|
||||||
// },1000)
|
|
||||||
}else{
|
|
||||||
ElMessage.error(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
ElMessage.error('请输入正确的手机号码')
|
|
||||||
}
|
|
||||||
// captchaImg({mobile:ruleForm.phoneNumber}).then(res=>{
|
|
||||||
// console.log('res->', res)
|
|
||||||
// })
|
|
||||||
}else{
|
|
||||||
ElMessage.error('请输入手机号码')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 打开弹窗
|
|
||||||
const RegisterModel = type => {
|
|
||||||
RegModel.value.OpenModel(type)
|
|
||||||
}
|
|
||||||
//登录
|
|
||||||
const submitForm = async (formEl) => {
|
|
||||||
if (!formEl) return
|
|
||||||
await formEl.validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
btnLoading.value = true
|
|
||||||
|
|
||||||
// 勾选了需要记住密码设置在 cookie 中设置记住用户名和密码
|
|
||||||
if (loginForm.rememberMe) {
|
|
||||||
await setCookie('username', loginForm.username)
|
|
||||||
await setCookie('password', encrypt(loginForm.password))
|
|
||||||
await setCookie('rememberMe', loginForm.rememberMe.toString())
|
|
||||||
} else {
|
|
||||||
// 否则移除
|
|
||||||
await session.defaultSession.clearStorageData({
|
|
||||||
origin: curWinUrl,
|
|
||||||
storages: ['cookies']
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
await userStore.login(loginForm)
|
|
||||||
await userStore.getInfo()
|
|
||||||
if (userStore.user.edustage || userStore.user.edusubject || isStadium(userStore.user)) {
|
|
||||||
ElMessage.success('登录成功')
|
|
||||||
ipcRenderer && ipcRenderer.send('openMainWindow')
|
|
||||||
} else {
|
|
||||||
isSubject.value = true
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
btnLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const isStadium = (user) => {
|
|
||||||
let roles = user.roles
|
|
||||||
return roles.some(item => item.roleKey === 'stadium')
|
|
||||||
}
|
|
||||||
|
|
||||||
const getCookie = async () => {
|
|
||||||
const username = (await getCookieDetail('username'))[0]
|
|
||||||
const password = (await getCookieDetail('password'))[0]
|
|
||||||
const rememberMe = (await getCookieDetail('rememberMe'))[0]
|
|
||||||
loginForm.username = username ? username.value : loginForm.username
|
|
||||||
loginForm.password = password ? decrypt(password.value) : loginForm.password
|
|
||||||
loginForm.rememberMe = rememberMe ? Boolean(rememberMe.value) : false
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取cookie
|
|
||||||
const getCookieDetail = (name) => {
|
|
||||||
return session.defaultSession.cookies.get({ url: curWinUrl, name })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置cookie
|
|
||||||
const setCookie = (name, value) => {
|
|
||||||
// 30天过期
|
|
||||||
let Days = 30
|
|
||||||
let times = Math.round(Date.now() / 1000) + Days * 24 * 60 * 60
|
|
||||||
const cookie = {
|
|
||||||
url: curWinUrl,
|
|
||||||
name,
|
|
||||||
value,
|
|
||||||
expirationDate: times
|
|
||||||
}
|
|
||||||
return session.defaultSession.cookies.set(cookie)
|
|
||||||
}
|
|
||||||
const gotoLogin = () => {
|
|
||||||
codeName.value='发送验证码'
|
|
||||||
if (timer.value){
|
|
||||||
clearInterval(timer.value);
|
|
||||||
}
|
|
||||||
if (ruleFormRef.value) ruleFormRef.value.resetFields()
|
|
||||||
isRegister.value = true
|
|
||||||
}
|
|
||||||
// 注册
|
|
||||||
const RegisterForm = async (formEl) => {
|
|
||||||
if (!formEl) return
|
|
||||||
await formEl.validate((valid, fields) => {
|
|
||||||
if (valid) {
|
|
||||||
instructorregister(ruleForm).then(res=>{
|
|
||||||
if(res.code==200){
|
|
||||||
ElMessage.success('您已注册成功')
|
|
||||||
if (ruleFormRef.value) ruleFormRef.value.resetFields()
|
|
||||||
gotoLogin()
|
|
||||||
}else{
|
|
||||||
ElMessage.error(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
console.log('submit!')
|
|
||||||
} else {
|
|
||||||
console.log('error submit!', fields)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
onMounted(() => {
|
|
||||||
localStorage.clear()
|
|
||||||
sessionStore.set('subject', {
|
|
||||||
bookList: null,
|
|
||||||
curBook: null,
|
|
||||||
curNode: null,
|
|
||||||
defaultExpandedKeys: [],
|
|
||||||
subjectTree: []
|
|
||||||
})
|
|
||||||
getCookie()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.login-container {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
-webkit-app-region: drag;
|
|
||||||
|
|
||||||
.login-yc{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
img{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.box-item {
|
|
||||||
width: 370px;
|
|
||||||
height: 520px;
|
|
||||||
|
|
||||||
&.desc {
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 12px 0px 0px 12px;
|
|
||||||
box-shadow: 0px 16px 73px 8px rgba(203, 203, 203, 0.2);
|
|
||||||
padding: 23px 25px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
background-color: #003b94;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.login {
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 0px 12px 12px 0px;
|
|
||||||
padding: 34px 42px;
|
|
||||||
position: relative;
|
|
||||||
.title-logo{
|
|
||||||
width: 100px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.welcome {
|
|
||||||
padding-top: 35px;
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: #ffffff;
|
|
||||||
line-height: 25px;
|
|
||||||
letter-spacing: 0.26px;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 26px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.welcome-img {
|
|
||||||
margin-top: 20px;
|
|
||||||
width: 350px;
|
|
||||||
height: 350px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-title {
|
|
||||||
font-size: 20px;
|
|
||||||
text-align: center;
|
|
||||||
color: #1e1e1e;
|
|
||||||
margin-bottom: 35px;
|
|
||||||
margin-top: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-title {
|
|
||||||
font-size: 20px;
|
|
||||||
text-align: center;
|
|
||||||
color: #1e1e1e;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
margin-top: 5px;
|
|
||||||
font-width: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-title2 {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-form {
|
|
||||||
-webkit-app-region: no-drag;
|
|
||||||
|
|
||||||
.captcha-input {
|
|
||||||
width: 60%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.captcha-img {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title-bottom{
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
font-size: 14px;
|
|
||||||
color: rgba(0, 0, 0, 0.45);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: 350px;
|
|
||||||
height: 50px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 700;
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
line-height: 50px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-tool {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
-webkit-app-region: no-drag;
|
|
||||||
|
|
||||||
span {
|
|
||||||
padding: 5px 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 40px;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -69,7 +69,6 @@
|
||||||
<div class="content-body-right-item-text">{{item.name}}</div>
|
<div class="content-body-right-item-text">{{item.name}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <Eos></Eos>-->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -95,7 +94,7 @@ import { sessionStore } from '@/utils/store'
|
||||||
import {listEntpcourse} from "@/api/teaching/classwork";
|
import {listEntpcourse} from "@/api/teaching/classwork";
|
||||||
import {addEntpcoursefileReturnId, getEntpcoursefile} from "@/api/education/entpcoursefile";
|
import {addEntpcoursefileReturnId, getEntpcoursefile} from "@/api/education/entpcoursefile";
|
||||||
import {createWindow, toLinkLeftWeb, getStaticUrl} from "@/utils/tool";
|
import {createWindow, toLinkLeftWeb, getStaticUrl} from "@/utils/tool";
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import {PPTXFileToJson} from "@/AixPPTist/src/hooks/useImport";
|
import {PPTXFileToJson} from "@/AixPPTist/src/hooks/useImport";
|
||||||
import * as API_entpcoursefile from "@/api/education/entpcoursefile";
|
import * as API_entpcoursefile from "@/api/education/entpcoursefile";
|
||||||
import msgUtils from "@/plugins/modal";
|
import msgUtils from "@/plugins/modal";
|
||||||
|
@ -103,7 +102,6 @@ import * as commUtils from "@/utils/comm";
|
||||||
import * as Api_server from "@/api/apiService"; // 学科名字文生图
|
import * as Api_server from "@/api/apiService"; // 学科名字文生图
|
||||||
import useClassTaskStore from '@/store/modules/classTask'
|
import useClassTaskStore from '@/store/modules/classTask'
|
||||||
import { slidesToImg } from '@/utils/ppt' // ppt相关工具
|
import { slidesToImg } from '@/utils/ppt' // ppt相关工具
|
||||||
import Eos from "@/components/FileUpload/Eos.vue"
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const userStore = useUserStore().user // 用户信息
|
const userStore = useUserStore().user // 用户信息
|
||||||
|
@ -304,8 +302,6 @@ const pgDialog = ref({ // 弹窗-进度条
|
||||||
|
|
||||||
const fileInput = ref(null)
|
const fileInput = ref(null)
|
||||||
|
|
||||||
let pptMedia = {} // ppt媒体数据
|
|
||||||
|
|
||||||
const openFilePicker = () =>{
|
const openFilePicker = () =>{
|
||||||
fileInput.value.click();
|
fileInput.value.click();
|
||||||
}
|
}
|
||||||
|
@ -319,13 +315,9 @@ const handleFileChange = ()=> {
|
||||||
}
|
}
|
||||||
// ppt文件转PPT线上数据
|
// ppt文件转PPT线上数据
|
||||||
const createAIPPTByFile = async (file)=> {
|
const createAIPPTByFile = async (file)=> {
|
||||||
pgDialog.value.visible = true
|
// pgDialog.value.visible = true
|
||||||
pgDialog.value.pg.percentage = 0
|
// pgDialog.value.pg.percentage = 0
|
||||||
pptMedia = {} // 清空媒体数据
|
const resPptJson = await PPTXFileToJson(file)
|
||||||
const resPptJson = await PPTXFileToJson(file).catch(() => {
|
|
||||||
ElMessageBox.alert('PPT文件转换失败!请点击素材右侧...下载文件后打开另存为PPTX文件格式再进行导入!')
|
|
||||||
pgDialog.value.visible = false
|
|
||||||
})
|
|
||||||
const { def, slides, ...content } = resPptJson
|
const { def, slides, ...content } = resPptJson
|
||||||
// 生成缩略图
|
// 生成缩略图
|
||||||
const thumbnails = await slidesToImg(slides, content.width)
|
const thumbnails = await slidesToImg(slides, content.width)
|
||||||
|
@ -397,66 +389,42 @@ const createAIPPTByFile = async (file)=> {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 将图片|音频|视频 转换为线上地址
|
|
||||||
const getOnlineFileUrl = (data, name) => {
|
|
||||||
return new Promise(async (resolve, reject) => {
|
|
||||||
let file
|
|
||||||
if (data instanceof Blob) { // blob类型判断
|
|
||||||
const fileName = Date.now() + `.${name||'png'}`
|
|
||||||
file = commUtils.blobToFile(data, fileName)
|
|
||||||
} else if (data instanceof File) { // file类型判断
|
|
||||||
file = data
|
|
||||||
} else { // 其他类型 base64
|
|
||||||
const blob = commUtils.base64ToBlob(data)
|
|
||||||
const fileName = Date.now() + `.${name||'png'}`
|
|
||||||
file = commUtils.blobToFile(blob, fileName)
|
|
||||||
}
|
|
||||||
const formData = new FormData()
|
|
||||||
formData.append('file', file)
|
|
||||||
const res = await Api_server.Other.uploadFile(formData)
|
|
||||||
if (res && res.code == 200){
|
|
||||||
resolve(res?.url)
|
|
||||||
} else { // 失败
|
|
||||||
reject(res?.msg||'上传失败')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const toRousrceUrl = async (o) => {
|
const toRousrceUrl = async (o) => {
|
||||||
if (!!o.src) { // 如果有src就转换
|
if (!!o.src) { // 如果有src就转换
|
||||||
const isBase64 = /^data:image\/(\w+);base64,/.test(o.src)
|
const isBase64 = /^data:image\/(\w+);base64,/.test(o.src)
|
||||||
const isBlobUrl = /^blob:/.test(o.src)
|
const isBlobUrl = /^blob:/.test(o.src)
|
||||||
let onLineUrl = '' // 线上地址
|
// console.log('isBase64', o, isBase64)
|
||||||
if (!!o.zipPath) onLineUrl = pptMedia[o.zipPath] || '' // 是否已上传过
|
if (isBase64) {
|
||||||
if (onLineUrl) o.src = onLineUrl // 已存在线上地址直接赋值
|
const bolb = commUtils.base64ToBlob(o.src)
|
||||||
else { // 不存在重新上传
|
const fileName = Date.now() + '.png'
|
||||||
if (isBase64) { // 相同资源处理
|
const file = commUtils.blobToFile(bolb, fileName)
|
||||||
const url = await getOnlineFileUrl(o.src)
|
// o.src = fileName
|
||||||
url && o.zipPath && (pptMedia[o.zipPath] = url) // 缓存
|
// console.log('file', file)
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('file', file)
|
||||||
|
const res = await Api_server.Other.uploadFile(formData)
|
||||||
|
if (res && res.code == 200){
|
||||||
|
const url = res?.url
|
||||||
|
url &&(o.src = url)
|
||||||
|
}
|
||||||
} else if (isBlobUrl) { // 视频和音频
|
} else if (isBlobUrl) { // 视频和音频
|
||||||
const res = await fetch(o.src)
|
const res = await fetch(o.src)
|
||||||
const blob = await res.blob()
|
const blob = await res.blob()
|
||||||
const url = await getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3')
|
const fileName = o.type=='video'? Date.now() + '.mp4':Date.now() + '.mp3'
|
||||||
URL.revokeObjectURL(o.src) // 释放内存
|
const file = commUtils.blobToFile(blob, fileName)
|
||||||
|
// o.src = fileName
|
||||||
|
// console.log('file', file)
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('file', file)
|
||||||
|
const ress = await Api_server.Other.uploadFile(formData)
|
||||||
|
if (ress && ress.code == 200){
|
||||||
|
const url = ress?.url
|
||||||
url &&(o.src = url)
|
url &&(o.src = url)
|
||||||
url && o.zipPath && (pptMedia[o.zipPath] = url) // 缓存
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理元素为shape 可能存在背景图等
|
|
||||||
const isBg = o?.gradient?.type == 'image' && !!o?.gradient?.image
|
|
||||||
if (isBg) {
|
|
||||||
const {src, zipPath} = o.gradient.image || {}
|
|
||||||
let onLineUrl = '' // 线上地址
|
|
||||||
if (!!zipPath) onLineUrl = pptMedia[zipPath] || '' // 是否已上传过
|
|
||||||
if (onLineUrl) o.gradient.image.src = onLineUrl // 已存在线上地址直接赋值
|
|
||||||
else { // 重新上传
|
|
||||||
const url = await getOnlineFileUrl(src)
|
|
||||||
o.gradient.image.src = url
|
|
||||||
url && zipPath && (pptMedia[zipPath] = url) // 缓存
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (o?.background?.image) await toRousrceUrl(o.background.image)
|
if (o?.background?.image) await toRousrceUrl(o.background.image)
|
||||||
if(o?.elements){
|
if(o?.elements){
|
||||||
for (let element of o.elements) {
|
for (let element of o.elements) {
|
||||||
|
|
|
@ -18,9 +18,7 @@
|
||||||
{{ item.fileShowName.substring(0, item.fileShowName.lastIndexOf('.')) }}
|
{{ item.fileShowName.substring(0, item.fileShowName.lastIndexOf('.')) }}
|
||||||
<el-tag type="danger" effect="dark">{{item.fileShowName.substring(item.fileShowName.lastIndexOf('.')+1)}}</el-tag>
|
<el-tag type="danger" effect="dark">{{item.fileShowName.substring(item.fileShowName.lastIndexOf('.')+1)}}</el-tag>
|
||||||
<template v-if="item.fileTag">
|
<template v-if="item.fileTag">
|
||||||
<el-tag v-for="(item1, index1) in item.fileTag.split(',')"
|
<el-tag v-for="(item1, index1) in item.fileTag.split(',')" :key="index1" type="success" effect="dark" style="margin-left: 5px">{{item1}}</el-tag>
|
||||||
@close="deleteTag(item, item1, index1)" closable :key="index1"
|
|
||||||
@click.stop="editTag(item, item1, index1)" type="success" effect="dark" style="margin-left: 5px">{{item1}}</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -284,71 +282,6 @@ export default {
|
||||||
})
|
})
|
||||||
// this.$emit('on-start-class', item)
|
// this.$emit('on-start-class', item)
|
||||||
},
|
},
|
||||||
editTagMsg(type, item, value, index) {
|
|
||||||
let fileTagList = []
|
|
||||||
if (!item.fileTag) {
|
|
||||||
item.fileTag="";
|
|
||||||
fileTagList = [];
|
|
||||||
}else {
|
|
||||||
fileTagList = item.fileTag.split(',');
|
|
||||||
}
|
|
||||||
let message = '';
|
|
||||||
switch (type) {
|
|
||||||
case 'add':
|
|
||||||
fileTagList.push(value);
|
|
||||||
message = '添加成功!';
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
fileTagList.splice(index, 1);
|
|
||||||
message = '删除成功!';
|
|
||||||
break;
|
|
||||||
case 'edit':
|
|
||||||
fileTagList[index] = value;
|
|
||||||
message = '修改成功!';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
item.fileTagList = fileTagList;
|
|
||||||
item.fileTag = fileTagList.join(",")
|
|
||||||
updateSmarttalk({ id: item.id, fileTag: item.fileTag, fileShowName: item.fileShowName }).then((res) => {
|
|
||||||
if (res.data === true) {
|
|
||||||
ElMessage({
|
|
||||||
type: 'success',
|
|
||||||
message: message
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deleteTag(item, item1, index) {
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
'是否确认删除这个标签?',
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then(() => {
|
|
||||||
this.editTagMsg('delete', item, "", index)
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
editTag(item, item1, index) {
|
|
||||||
console.log(item, item1, index)
|
|
||||||
ElMessageBox.prompt('请输入新的标签', '修改标签', {
|
|
||||||
confirmButtonText: '确认',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
inputValue: item1,
|
|
||||||
inputPattern: /^[a-zA-Z0-9\u4e00-\u9fa5]{1,5}$/,
|
|
||||||
inputErrorMessage: '请输入最多五个字的标签,不能携带标点符号'
|
|
||||||
})
|
|
||||||
.then(({ value }) => {
|
|
||||||
this.editTagMsg('edit', item, value, index)
|
|
||||||
}).catch(() => {})
|
|
||||||
},
|
|
||||||
editTalk(item) {
|
editTalk(item) {
|
||||||
ElMessageBox.prompt('请输入新的标签', '添加标签', {
|
ElMessageBox.prompt('请输入新的标签', '添加标签', {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
@ -358,7 +291,24 @@ export default {
|
||||||
inputErrorMessage: '请输入最多五个字的标签,不能携带标点符号'
|
inputErrorMessage: '请输入最多五个字的标签,不能携带标点符号'
|
||||||
})
|
})
|
||||||
.then(({ value }) => {
|
.then(({ value }) => {
|
||||||
this.editTagMsg('add', item, value, 0)
|
let fileTagList = []
|
||||||
|
if (!item.fileTag) {
|
||||||
|
item.fileTag="";
|
||||||
|
fileTagList = [];
|
||||||
|
}else {
|
||||||
|
fileTagList = item.fileTag.split(',');
|
||||||
|
}
|
||||||
|
fileTagList.push(value);
|
||||||
|
item.fileTagList = fileTagList;
|
||||||
|
item.fileTag = fileTagList.join(",")
|
||||||
|
updateSmarttalk({ id: item.id, fileTag: item.fileTag, fileShowName: item.fileShowName }).then((res) => {
|
||||||
|
if (res.data === true) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: `添加成功!`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
},
|
},
|
||||||
|
|
|
@ -289,8 +289,7 @@ export default {
|
||||||
{ color: '#5cb87a', percentage: 100 }, // 绿色
|
{ color: '#5cb87a', percentage: 100 }, // 绿色
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
pptMedia: {} // ppt媒体数据
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -562,7 +561,6 @@ export default {
|
||||||
},
|
},
|
||||||
importPPT(item) {
|
importPPT(item) {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
// item.fileFullPath = "https://wzyzoss.eos-chongqing-3.cmecloud.cn/2025/1/14/c4d8ae796fc74417aefe017a49388962.ppt"
|
|
||||||
fetch(item.fileFullPath)
|
fetch(item.fileFullPath)
|
||||||
.then(res => res.arrayBuffer())
|
.then(res => res.arrayBuffer())
|
||||||
.then(buffer => {
|
.then(buffer => {
|
||||||
|
@ -592,66 +590,43 @@ export default {
|
||||||
this.createAIPPTByFile(file, this.currentNode.itemtitle + '.aippt')
|
this.createAIPPTByFile(file, this.currentNode.itemtitle + '.aippt')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 将图片|音频|视频 转换为线上地址
|
|
||||||
getOnlineFileUrl(data, name){
|
|
||||||
return new Promise(async (resolve, reject) => {
|
|
||||||
let file
|
|
||||||
if (data instanceof Blob) { // blob类型判断
|
|
||||||
const fileName = Date.now() + `.${name||'png'}`
|
|
||||||
file = commUtils.blobToFile(data, fileName)
|
|
||||||
} else if (data instanceof File) { // file类型判断
|
|
||||||
file = data
|
|
||||||
} else { // 其他类型 base64
|
|
||||||
const blob = commUtils.base64ToBlob(data)
|
|
||||||
const fileName = Date.now() + `.${name||'png'}`
|
|
||||||
file = commUtils.blobToFile(blob, fileName)
|
|
||||||
}
|
|
||||||
const formData = new FormData()
|
|
||||||
formData.append('file', file)
|
|
||||||
const res = await Api_server.Other.uploadFile(formData)
|
|
||||||
if (res && res.code == 200){
|
|
||||||
resolve(res?.url)
|
|
||||||
} else { // 失败
|
|
||||||
reject(res?.msg||'上传失败')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async toRousrceUrl(o) {
|
async toRousrceUrl(o) {
|
||||||
if (!!o.src) { // 如果有src就转换
|
if (!!o.src) { // 如果有src就转换
|
||||||
const isBase64 = /^data:image\/(\w+);base64,/.test(o.src)
|
const isBase64 = /^data:image\/(\w+);base64,/.test(o.src)
|
||||||
const isBlobUrl = /^blob:/.test(o.src)
|
const isBlobUrl = /^blob:/.test(o.src)
|
||||||
let onLineUrl = '' // 线上地址
|
// console.log('isBase64', o, isBase64)
|
||||||
if (!!o.zipPath) onLineUrl = this.pptMedia[o.zipPath] || '' // 是否已上传过
|
if (isBase64) {
|
||||||
if (onLineUrl) o.src = onLineUrl // 已存在线上地址直接赋值
|
const bolb = commUtils.base64ToBlob(o.src)
|
||||||
else { // 不存在重新上传
|
const fileName = Date.now() + '.png'
|
||||||
if (isBase64) { // 相同资源处理
|
const file = commUtils.blobToFile(bolb, fileName)
|
||||||
const url = await this.getOnlineFileUrl(o.src)
|
// o.src = fileName
|
||||||
url && o.zipPath && (this.pptMedia[o.zipPath] = url) // 缓存
|
// console.log('file', file)
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('file', file)
|
||||||
|
const res = await Api_server.Other.uploadFile(formData)
|
||||||
|
if (res && res.code == 200){
|
||||||
|
const url = res?.url
|
||||||
|
url &&(o.src = url)
|
||||||
|
}
|
||||||
} else if (isBlobUrl) { // 视频和音频
|
} else if (isBlobUrl) { // 视频和音频
|
||||||
const res = await fetch(o.src)
|
const res = await fetch(o.src)
|
||||||
const blob = await res.blob()
|
const blob = await res.blob()
|
||||||
const url = await this.getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3')
|
const fileName = o.type=='video'? Date.now() + '.mp4':Date.now() + '.mp3'
|
||||||
URL.revokeObjectURL(o.src) // 释放内存
|
const file = commUtils.blobToFile(blob, fileName)
|
||||||
|
// o.src = fileName
|
||||||
|
// console.log('file', file)
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('file', file)
|
||||||
|
const ress = await Api_server.Other.uploadFile(formData)
|
||||||
|
if (ress && ress.code == 200){
|
||||||
|
const url = ress?.url
|
||||||
url &&(o.src = url)
|
url &&(o.src = url)
|
||||||
url && o.zipPath && (this.pptMedia[o.zipPath] = url) // 缓存
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 处理元素为shape 可能存在背景图等
|
|
||||||
const isBg = o?.gradient?.type == 'image' && !!o?.gradient?.image
|
|
||||||
if (isBg) {
|
|
||||||
const {src, zipPath} = o.gradient.image || {}
|
|
||||||
let onLineUrl = '' // 线上地址
|
|
||||||
if (!!zipPath) onLineUrl = this.pptMedia[zipPath] || '' // 是否已上传过
|
|
||||||
if (onLineUrl) o.gradient.image.src = onLineUrl // 已存在线上地址直接赋值
|
|
||||||
else { // 重新上传
|
|
||||||
const url = await this.getOnlineFileUrl(src)
|
|
||||||
o.gradient.image.src = url
|
|
||||||
url && zipPath && (this.pptMedia[zipPath] = url) // 缓存
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (o?.background?.image) await this.toRousrceUrl(o.background.image)
|
if (o?.background?.image) await this.toRousrceUrl(o.background.image)
|
||||||
|
// if (o?.elements) o.elements.forEach(async o => {await this.toRousrceUrl(o)})
|
||||||
if(o?.elements){
|
if(o?.elements){
|
||||||
for (let element of o.elements) {
|
for (let element of o.elements) {
|
||||||
await this.toRousrceUrl(element);
|
await this.toRousrceUrl(element);
|
||||||
|
@ -661,12 +636,7 @@ export default {
|
||||||
async createAIPPTByFile(file,fileShowName) {
|
async createAIPPTByFile(file,fileShowName) {
|
||||||
this.pgDialog.visible = true
|
this.pgDialog.visible = true
|
||||||
this.pgDialog.pg.percentage = 0
|
this.pgDialog.pg.percentage = 0
|
||||||
this.pptMedia = {} // 清空媒体数据
|
const resPptJson = await PPTXFileToJson(file)
|
||||||
const resPptJson = await PPTXFileToJson(file).catch(() => {
|
|
||||||
ElMessageBox.alert('PPT文件转换失败!请点击素材右侧...下载文件后打开另存为PPTX文件格式再进行导入!')
|
|
||||||
this.pgDialog.visible = false
|
|
||||||
})
|
|
||||||
if (!resPptJson) return
|
|
||||||
const { def, slides, ...content } = resPptJson
|
const { def, slides, ...content } = resPptJson
|
||||||
// 生成缩略图
|
// 生成缩略图
|
||||||
const thumbnails = await slidesToImg(slides, content.width)
|
const thumbnails = await slidesToImg(slides, content.width)
|
||||||
|
|
|
@ -22,11 +22,13 @@
|
||||||
|
|
||||||
<!-- 裁剪按钮-->
|
<!-- 裁剪按钮-->
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<label for="submit">
|
<el-button style="margin-right: 20px">选择</el-button>
|
||||||
<div class="lBut"><span>选择</span></div>
|
<input
|
||||||
</label>
|
class="upload"
|
||||||
<input class="upload" id="submit" accept=".png, .jpg, .jpeg" type="file" style="display: none;" @change="uploadImg" />
|
type="file"
|
||||||
<!-- <el-button style="margin-right: 20px;cursor:pointer">选择</el-button> -->
|
accept=".png, .jpg, .jpeg"
|
||||||
|
@change="uploadImg"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-button @click="cancle">取消</el-button>
|
<el-button @click="cancle">取消</el-button>
|
||||||
<el-button @click="sureSava">提交</el-button>
|
<el-button @click="sureSava">提交</el-button>
|
||||||
|
@ -214,7 +216,6 @@ export default {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
cursor: pointer;
|
|
||||||
> .upload {
|
> .upload {
|
||||||
display: block;
|
display: block;
|
||||||
width: 60px;
|
width: 60px;
|
||||||
|
@ -223,7 +224,6 @@ export default {
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,22 +265,4 @@ export default {
|
||||||
background-color: rgba(43, 43, 43, 0.7215686275);
|
background-color: rgba(43, 43, 43, 0.7215686275);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.lBut{
|
|
||||||
width: 87px;
|
|
||||||
height: 32px;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.15;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 8px 10px;
|
|
||||||
margin-right: 10px;
|
|
||||||
transition: all 0.5s;
|
|
||||||
white-space: nowrap;
|
|
||||||
background-color: #409eff;
|
|
||||||
color: white;
|
|
||||||
border: 1px solid #409eff;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="user-info-head" @click="editCropper()">
|
<div class="user-info-head" @click="editCropper()">
|
||||||
<!-- <img :src="options.img" title="点击上传头像" class="img-circle img-lg" /> -->
|
<img :src="options.img" title="点击上传头像" class="img-circle img-lg" />
|
||||||
<el-image class="user-img" :src="options.img" style="width: 120px;">
|
|
||||||
<template #error>
|
|
||||||
<img :src="route_path + userStore.user.avatar">
|
|
||||||
</template>
|
|
||||||
</el-image>
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="open"
|
v-model="open"
|
||||||
append-to-body
|
append-to-body
|
||||||
|
@ -24,7 +19,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, reactive, onMounted} from 'vue'
|
import {ref, reactive} from 'vue'
|
||||||
import { uploadAvatar } from '@/api/system/user'
|
import { uploadAvatar } from '@/api/system/user'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
@ -36,12 +31,10 @@ const userStore = useUserStore()
|
||||||
const open = ref(false)
|
const open = ref(false)
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
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 defaultImg = ['/img/avatar-default.jpg','/images/img-avatar.png','/src/assets/images/img-avatar.png']
|
|
||||||
|
|
||||||
//图片裁剪数据
|
//图片裁剪数据
|
||||||
const options = reactive({
|
const options = reactive({
|
||||||
img: '', // 裁剪图片的地址
|
img: userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api.value + userStore.user.avatar, // 裁剪图片的地址
|
||||||
autoCrop: true, // 是否默认生成截图框
|
autoCrop: true, // 是否默认生成截图框
|
||||||
autoCropWidth: 400, // 默认生成截图框宽度
|
autoCropWidth: 400, // 默认生成截图框宽度
|
||||||
autoCropHeight: 400, // 默认生成截图框高度
|
autoCropHeight: 400, // 默认生成截图框高度
|
||||||
|
@ -77,19 +70,12 @@ function uploadImg(data) {
|
||||||
|
|
||||||
/** 关闭窗口 */
|
/** 关闭窗口 */
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
// options.img = userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api.value + userStore.user.avatar
|
options.img = userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api.value + userStore.user.avatar
|
||||||
options.visible = false
|
options.visible = false
|
||||||
}
|
}
|
||||||
const cancle = () => {
|
const cancle = () => {
|
||||||
open.value = false
|
open.value = false
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
|
||||||
if(defaultImg.includes(userStore.user.avatar)){
|
|
||||||
options.img = defaultUserImg
|
|
||||||
}else{
|
|
||||||
options.img = dev_api.value + userStore.user.avatar
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
<script setup >
|
<script setup >
|
||||||
import { ref, reactive, onMounted,watch } from 'vue'
|
import { ref, reactive, onMounted,watch } from 'vue'
|
||||||
import { regionData, codeToText } from '@/plugins/china-area-data-json'
|
import { regionData, codeToText } from 'element-china-area-data'
|
||||||
import { getUserProfile } from '@/api/system/user'
|
import { getUserProfile } from '@/api/system/user'
|
||||||
import {getDept} from '@/api/login'
|
import {getDept} from '@/api/login'
|
||||||
import {school} from '@/api/apiService'
|
import {school} from '@/api/apiService'
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { school } from '@/api/apiService';
|
import { school } from '@/api/apiService';
|
||||||
import { ref, reactive, onMounted ,computed} from 'vue'
|
import { ref, reactive, onMounted ,computed} from 'vue'
|
||||||
import { regionData, codeToText } from '@/plugins/china-area-data-json'
|
import { regionData, codeToText } from 'element-china-area-data'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
|
@ -22,22 +22,24 @@
|
||||||
<el-empty v-else description="请选择符合您需要的教学模式,生成教学大纲" />
|
<el-empty v-else description="请选择符合您需要的教学模式,生成教学大纲" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <EditDialog v-model="isEdit" :item="editItem" :index="editIndex" /> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, onUnmounted } from 'vue'
|
import { ref, reactive, onMounted, onUnmounted } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
|
import EditDialog from './edit-dialog.vue'
|
||||||
import emitter from '@/utils/mitt'
|
import emitter from '@/utils/mitt'
|
||||||
import * as commUtils from '@/utils/comm.js'
|
import * as commUtils from '@/utils/comm.js'
|
||||||
import { createChart, sendChart } from '@/api/ai/index'
|
import { createChart, sendChart } from '@/api/ai/index'
|
||||||
import { completion, addSyllabus, removeSyllabus, modelList } from '@/api/mode/index.js'
|
import { completion, addSyllabus, removeSyllabus, editSyllabus, modelList } from '@/api/mode/index.js'
|
||||||
import { createOutlineV2 } from '@/utils/ppt-request.js'
|
import { createOutlineV2 } from '@/utils/ppt-request.js'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
|
|
||||||
const curMode = ref(2)
|
const curMode = ref(2)
|
||||||
|
const isEdit = ref(false)
|
||||||
|
|
||||||
const { user } = useUserStore()
|
const { user } = useUserStore()
|
||||||
|
|
||||||
|
@ -48,8 +50,7 @@ const modeOptions = ref([
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '知识库模型',
|
label: '知识库模型',
|
||||||
value: 2,
|
value: 2
|
||||||
disabled: false
|
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -113,17 +114,14 @@ const createAi = async () => {
|
||||||
|
|
||||||
data = res.data
|
data = res.data
|
||||||
}
|
}
|
||||||
|
markeDownAnswer.value = data.answer
|
||||||
|
|
||||||
const res = await createOutlineV2({ query: data.answer })
|
const res = await createOutlineV2({ query: data.answer })
|
||||||
|
|
||||||
markeDownAnswer.value = data.answer
|
|
||||||
let outline = JSON.stringify({
|
let outline = JSON.stringify({
|
||||||
json: res.outline,
|
json: res.outline,
|
||||||
markdown: data.answer
|
markdown: data.answer
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
Object.assign(curItem, {...curItem, outline})
|
Object.assign(curItem, {...curItem, outline})
|
||||||
|
|
||||||
emitter.emit('onResult', curItem)
|
emitter.emit('onResult', curItem)
|
||||||
|
@ -133,6 +131,47 @@ const createAi = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 编辑大纲
|
||||||
|
// const editItem = reactive({})
|
||||||
|
// const editIndex = ref(0)
|
||||||
|
// const onEdit = (item, index)=>{
|
||||||
|
|
||||||
|
// let obj = null
|
||||||
|
// if(index == -1){
|
||||||
|
// obj = {
|
||||||
|
// title: answer.title,
|
||||||
|
// subTitle: answer.subTitle
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// obj = cloneDeep(item)
|
||||||
|
// }
|
||||||
|
// editIndex.value = index
|
||||||
|
// isEdit.value = true
|
||||||
|
// Object.assign(editItem, obj)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// emitter.on('editItem', (item) =>{
|
||||||
|
// if(editIndex.value == -1){
|
||||||
|
// answer.title = item.title
|
||||||
|
// answer.subTitle = item.subTitle
|
||||||
|
// }else{
|
||||||
|
// answer.chapters[editIndex.value] = item
|
||||||
|
// }
|
||||||
|
// let data = cloneDeep(curItem)
|
||||||
|
|
||||||
|
// data.outline = JSON.stringify(cloneDeep(answer))
|
||||||
|
// loading.value = true
|
||||||
|
|
||||||
|
// editSyllabus(data).then( res =>{
|
||||||
|
// curItem.outline = answer
|
||||||
|
// emitter.emit('onResult', curItem)
|
||||||
|
// ElMessage.success('操作成功')
|
||||||
|
// }).finally( ()=>{
|
||||||
|
// loading.value = false
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
// 保存模板
|
// 保存模板
|
||||||
const onSaveTemp = async (outline) => {
|
const onSaveTemp = async (outline) => {
|
||||||
let modelIds = selectedData.value.map(item => item.id).join(',')
|
let modelIds = selectedData.value.map(item => item.id).join(',')
|
||||||
|
@ -167,6 +206,8 @@ const delAnswer = () => {
|
||||||
markeDownAnswer.value = ''
|
markeDownAnswer.value = ''
|
||||||
|
|
||||||
emitter.emit('resetSelect')
|
emitter.emit('resetSelect')
|
||||||
|
|
||||||
|
// window.location.reload();
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
|
|
||||||
|
@ -208,14 +249,6 @@ onMounted(() => {
|
||||||
// 框架设计 用课标的dataset_id
|
// 框架设计 用课标的dataset_id
|
||||||
let jsonKey = `课标-${data.edustage}-${data.edusubject}`
|
let jsonKey = `课标-${data.edustage}-${data.edusubject}`
|
||||||
params.dataset_id = commUtils.dataSetJson[jsonKey]
|
params.dataset_id = commUtils.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')
|
||||||
|
|
|
@ -7,7 +7,7 @@ const packageJsonPath = path.join(__dirname, 'package.json');
|
||||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
||||||
console.log(env)
|
console.log(env)
|
||||||
let res = env.npm_lifecycle_event.replace("build", "").replace(":", "");
|
let res = env.npm_lifecycle_event.replace("build", "").replace(":", "");
|
||||||
res = res&&res!=='prod'?"-" + res:"";
|
res = res?"-" + res:"";
|
||||||
packageJson.name = "aix-win-ws" + res
|
packageJson.name = "aix-win-ws" + res
|
||||||
|
|
||||||
// 将修改后的内容写回package.json文件
|
// 将修改后的内容写回package.json文件
|
||||||
|
|
Loading…
Reference in New Issue