Compare commits
23 Commits
Author | SHA1 | Date |
---|---|---|
yangws | 8d85ad6ab6 | |
小杨 | 3c0e7777f8 | |
zhengdegang | a73a409776 | |
zdg | b6d1e03201 | |
zdg | 8d8b8d223c | |
zhengdegang | f47f305dc9 | |
zdg | 95fcd2445e | |
zdg | 4af2b5fc3a | |
朱浩 | 91e9468f41 | |
朱浩 | 16100d1ffa | |
yangws | a368925887 | |
小杨 | 9d29238017 | |
朱浩 | 2c90e96c5f | |
朱浩 | 90aafaba10 | |
朱浩 | 1d68bc6534 | |
朱浩 | 088eac287b | |
朱浩 | 934f561dee | |
朱浩 | 1326c5dd02 | |
朱浩 | 9c2c31e4b7 | |
朱浩 | 121cff7c2b | |
朱浩 | 2ad1ae4946 | |
朱浩 | f8f0646bde | |
朱浩 | ca6efb4d66 |
|
@ -0,0 +1,27 @@
|
||||||
|
# 页面标题
|
||||||
|
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,6 +6,11 @@ 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/*'
|
||||||
|
@ -47,8 +52,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,6 +13,11 @@ 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
|
||||||
|
@ -46,8 +51,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,6 +6,11 @@ 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/*'
|
||||||
|
@ -47,8 +52,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,6 +6,11 @@ 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/*'
|
||||||
|
@ -47,8 +52,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:
|
||||||
- '**/*'
|
# - '**/*'
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
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,6 +13,11 @@ 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
|
||||||
|
@ -46,8 +51,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:
|
||||||
- '**/*'
|
# - '**/*'
|
||||||
|
|
12
package.json
12
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win-ws",
|
"name": "aix-win-ws",
|
||||||
"version": "2.5.15",
|
"version": "2.5.16",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "上海交大重庆人工智能研究院",
|
"author": "上海交大重庆人工智能研究院",
|
||||||
|
@ -14,9 +14,11 @@
|
||||||
"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": "node updatePackageJsonName.js && electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml",
|
"build:prod": "node updatePackageJsonName.js && electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml --win",
|
||||||
|
"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"
|
||||||
|
@ -42,7 +44,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.0",
|
"aix-plugins-aitools": "^1.1.5",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"circular-json": "^0.5.9",
|
"circular-json": "^0.5.9",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
|
@ -54,14 +56,12 @@
|
||||||
"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",
|
||||||
|
@ -139,4 +139,4 @@
|
||||||
"vue-tsc": "^1.8.25",
|
"vue-tsc": "^1.8.25",
|
||||||
"windicss": "^3.5.6"
|
"windicss": "^3.5.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
After 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,12 +42,28 @@ if(!gotTheLock){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
let logoIco = import.meta.env.MODE==='yc'||import.meta.env.MODE==='yc2'?'../../resources/yc-logo.png':'../../resources/logo2.ico'
|
let logoIco = ""
|
||||||
|
|
||||||
|
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,
|
||||||
|
@ -277,14 +293,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,12 +8,13 @@
|
||||||
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'; 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'; 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:;" />
|
||||||
|
|
||||||
</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
File diff suppressed because it is too large
Load Diff
|
@ -41,7 +41,7 @@ export const enum ElementTypes {
|
||||||
*
|
*
|
||||||
* rotate: 渐变角度(线性渐变)
|
* rotate: 渐变角度(线性渐变)
|
||||||
*/
|
*/
|
||||||
export type GradientType = 'linear' | 'radial'
|
export type GradientType = 'linear' | 'radial' | 'image'
|
||||||
export type GradientColor = {
|
export type GradientColor = {
|
||||||
pos: number
|
pos: number
|
||||||
color: string
|
color: string
|
||||||
|
|
|
@ -46,11 +46,12 @@
|
||||||
:options="[
|
:options="[
|
||||||
{ label: '线性渐变', value: 'linear' },
|
{ label: '线性渐变', value: 'linear' },
|
||||||
{ label: '径向渐变', value: 'radial' },
|
{ label: '径向渐变', value: 'radial' },
|
||||||
|
{ label: '背景图', value: 'image' },
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-if="fillType === 'gradient'">
|
<template v-if="fillType === 'gradient' && gradient.type !== 'image'">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<GradientBar
|
<GradientBar
|
||||||
:value="gradient.colors"
|
:value="gradient.colors"
|
||||||
|
@ -206,6 +207,13 @@ 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,6 +33,8 @@
|
||||||
: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,6 +1,25 @@
|
||||||
<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-if="type === 'linear'"
|
v-else-if="type === 'linear'"
|
||||||
:id="id"
|
:id="id"
|
||||||
x1="0%"
|
x1="0%"
|
||||||
y1="0%"
|
y1="0%"
|
||||||
|
@ -10,20 +29,35 @@
|
||||||
>
|
>
|
||||||
<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 } from '../../../../types/slides'
|
import type { GradientColor, GradientType, PPTShapeElement } from '../../../../types/slides'
|
||||||
|
interface ImageSvg {
|
||||||
withDefaults(defineProps<{
|
src: string,
|
||||||
|
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,6 +42,8 @@
|
||||||
: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
|
||||||
|
|
|
@ -94,4 +94,19 @@ export const addFileToSC = (params) => {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
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'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 107 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.5 MiB |
|
@ -0,0 +1,135 @@
|
||||||
|
<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>
|
|
@ -5,7 +5,11 @@
|
||||||
<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="userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api + userStore.user.avatar" />
|
<el-image class="user-img" :src="img">
|
||||||
|
<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>
|
||||||
|
@ -65,6 +69,7 @@ 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('')
|
||||||
|
@ -75,6 +80,9 @@ 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 = () => {
|
||||||
|
@ -224,6 +232,11 @@ 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>
|
||||||
AI文枢{{ version }}
|
{{APP_TITLE}}{{ version }}
|
||||||
</div>
|
</div>
|
||||||
<div class="header-right">
|
<div class="header-right">
|
||||||
<WindowTools />
|
<WindowTools />
|
||||||
|
@ -29,6 +29,7 @@ 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()
|
||||||
|
|
|
@ -27,8 +27,8 @@ import customComponent from '@/components/common' // 自定义组件
|
||||||
import plugins from './plugins' // plugins插件
|
import plugins from './plugins' // plugins插件
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import aiAudio from 'aix-plugins-aitools' // 文字转语音插件
|
import aiAudio from 'aix-plugins-aitools' // 文字转语音插件
|
||||||
import '../../../node_modules/aix-plugins-aitools/aitools.css'
|
import '../../../node_modules/aix-plugins-aitools/aitools.css'
|
||||||
|
|
||||||
|
|
||||||
if(process.env.NODE_ENV != 'development') { // 非开发环境,将日志打印到日志文件
|
if(process.env.NODE_ENV != 'development') { // 非开发环境,将日志打印到日志文件
|
||||||
Object.assign(console, log.functions) // 渲染进程日志-控制台替换
|
Object.assign(console, log.functions) // 渲染进程日志-控制台替换
|
||||||
|
@ -55,6 +55,36 @@ 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
|
@ -0,0 +1,358 @@
|
||||||
|
// 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
|
@ -411,12 +411,14 @@ 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",
|
||||||
|
|
|
@ -0,0 +1,138 @@
|
||||||
|
/**
|
||||||
|
* 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 };
|
||||||
|
}
|
|
@ -6,14 +6,14 @@
|
||||||
<img style="margin: 0 auto;height:85px" src="@/assets/images/shenhe.png" alt="">
|
<img style="margin: 0 auto;height:85px" src="@/assets/images/shenhe.png" alt="">
|
||||||
<p style="color:#F59A23;font-size:22px">申请审核中</p>
|
<p style="color:#F59A23;font-size:22px">申请审核中</p>
|
||||||
<p style="color:#000;font-size:16px;font-weight:600">申请信息已提交,请耐心等待审核通过即可完成申请。</p>
|
<p style="color:#000;font-size:16px;font-weight:600">申请信息已提交,请耐心等待审核通过即可完成申请。</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="border:1px solid #000;margin-bottom:20px;background:#DFF0D8" v-if="userregister.value.auditStatus==1">
|
<div style="border:1px solid #000;margin-bottom:20px;background:#DFF0D8" v-if="userregister.value.auditStatus==1">
|
||||||
<div style="display: flex;align-items: center;justify-content: center;">
|
<div style="display: flex;align-items: center;justify-content: center;">
|
||||||
<el-result style="padding: 17px 35px;" icon="success"></el-result>
|
<el-result style="padding: 17px 35px;" icon="success"></el-result>
|
||||||
<p style="font-size:30px;color:#67C23A">审核通过</p>
|
<p style="font-size:30px;color:#67C23A">审核通过</p>
|
||||||
</div>
|
</div>
|
||||||
<p style="margin-bottom:10px;color:#439FFE; cursor: pointer" @click='chongxin'>重新认证</p>
|
<p style="margin-bottom:10px;color:#439FFE; cursor: pointer" @click='chongxin'>重新认证</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="border:1px solid #000;margin-bottom:20px;background:#F2DEDE" v-if="userregister.value.auditStatus==2">
|
<div style="border:1px solid #000;margin-bottom:20px;background:#F2DEDE" v-if="userregister.value.auditStatus==2">
|
||||||
<div style="display: flex;align-items: center;justify-content: center;">
|
<div style="display: flex;align-items: center;justify-content: center;">
|
||||||
<el-result style="padding: 17px 35px;" icon="error"></el-result>
|
<el-result style="padding: 17px 35px;" icon="error"></el-result>
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
<el-form-item label="申请人电话" >
|
<el-form-item label="申请人电话" >
|
||||||
{{ state.user.phonenumber }}
|
{{ state.user.phonenumber }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item >
|
<el-form-item >
|
||||||
<div style="width:100%;text-align: right;padding-right:100px">
|
<div style="width:100%;text-align: right;padding-right:100px">
|
||||||
<el-button style="width:150px" type="default" @click="closed">关闭</el-button>
|
<el-button style="width:150px" type="default" @click="closed">关闭</el-button>
|
||||||
|
@ -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 'element-china-area-data'
|
import { regionData, codeToText } from '@/plugins/china-area-data-json'
|
||||||
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'
|
||||||
|
@ -101,7 +101,7 @@ async function getUser() {
|
||||||
// response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
|
// response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
|
||||||
Object.assign(state.user,response.data)
|
Object.assign(state.user,response.data)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
const getSchoolList = () => {
|
const getSchoolList = () => {
|
||||||
school.deptTree().then(res=>{
|
school.deptTree().then(res=>{
|
||||||
|
@ -142,7 +142,7 @@ const submitForm = async (formEl) => {
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
ElMessage.success('提交成功')
|
ElMessage.success('提交成功')
|
||||||
await userStore.getDeptInfo()
|
await userStore.getDeptInfo()
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log('submit!')
|
console.log('submit!')
|
||||||
|
@ -165,7 +165,7 @@ const getregisterinfo=()=>{
|
||||||
isshwoBtn.value=false
|
isshwoBtn.value=false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 关闭
|
// 关闭
|
||||||
const closed=()=>{
|
const closed=()=>{
|
||||||
|
@ -192,4 +192,4 @@ onMounted(async () => {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -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 'element-china-area-data'
|
import { regionData, codeToText } from '@/plugins/china-area-data-json'
|
||||||
const ruleFormRef = ref(null)
|
const ruleFormRef = ref(null)
|
||||||
const activeIndex=ref(1)
|
const activeIndex=ref(1)
|
||||||
const ruleForm = reactive({
|
const ruleForm = reactive({
|
||||||
|
@ -352,7 +352,7 @@ const submitForm = async (formEl) => {
|
||||||
schoolSubject.value=[]
|
schoolSubject.value=[]
|
||||||
gradeTree.value=[]
|
gradeTree.value=[]
|
||||||
Object.assign(ruleForm, restValue);
|
Object.assign(ruleForm, restValue);
|
||||||
dialogVisible.value=false
|
dialogVisible.value=false
|
||||||
activeIndex.value=1
|
activeIndex.value=1
|
||||||
}else{
|
}else{
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
<div class="box-item desc">
|
<div class="box-item desc" style="flex: 1">
|
||||||
<div class="welcome">
|
<div class="welcome">
|
||||||
<p>欢迎登录 {{ homeTitle }}</p>
|
<p>欢迎登录 {{ homeTitle }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
<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>
|
||||||
|
|
|
@ -0,0 +1,458 @@
|
||||||
|
<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,6 +69,7 @@
|
||||||
<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>
|
||||||
|
@ -94,7 +95,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} from "element-plus";
|
import {ElMessage, ElMessageBox} 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";
|
||||||
|
@ -102,6 +103,7 @@ 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 // 用户信息
|
||||||
|
@ -302,6 +304,8 @@ const pgDialog = ref({ // 弹窗-进度条
|
||||||
|
|
||||||
const fileInput = ref(null)
|
const fileInput = ref(null)
|
||||||
|
|
||||||
|
let pptMedia = {} // ppt媒体数据
|
||||||
|
|
||||||
const openFilePicker = () =>{
|
const openFilePicker = () =>{
|
||||||
fileInput.value.click();
|
fileInput.value.click();
|
||||||
}
|
}
|
||||||
|
@ -315,9 +319,13 @@ 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
|
||||||
const resPptJson = await PPTXFileToJson(file)
|
pptMedia = {} // 清空媒体数据
|
||||||
|
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)
|
||||||
|
@ -389,42 +397,66 @@ 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)
|
||||||
// console.log('isBase64', o, isBase64)
|
let onLineUrl = '' // 线上地址
|
||||||
if (isBase64) {
|
if (!!o.zipPath) onLineUrl = pptMedia[o.zipPath] || '' // 是否已上传过
|
||||||
const bolb = commUtils.base64ToBlob(o.src)
|
if (onLineUrl) o.src = onLineUrl // 已存在线上地址直接赋值
|
||||||
const fileName = Date.now() + '.png'
|
else { // 不存在重新上传
|
||||||
const file = commUtils.blobToFile(bolb, fileName)
|
if (isBase64) { // 相同资源处理
|
||||||
// o.src = fileName
|
const url = await getOnlineFileUrl(o.src)
|
||||||
// console.log('file', file)
|
url && o.zipPath && (pptMedia[o.zipPath] = url) // 缓存
|
||||||
const formData = new FormData()
|
} else if (isBlobUrl) { // 视频和音频
|
||||||
formData.append('file', file)
|
const res = await fetch(o.src)
|
||||||
const res = await Api_server.Other.uploadFile(formData)
|
const blob = await res.blob()
|
||||||
if (res && res.code == 200){
|
const url = await getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3')
|
||||||
const url = res?.url
|
URL.revokeObjectURL(o.src) // 释放内存
|
||||||
url &&(o.src = url)
|
|
||||||
}
|
|
||||||
} else if (isBlobUrl) { // 视频和音频
|
|
||||||
const res = await fetch(o.src)
|
|
||||||
const blob = await res.blob()
|
|
||||||
const fileName = o.type=='video'? Date.now() + '.mp4':Date.now() + '.mp3'
|
|
||||||
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,7 +18,9 @@
|
||||||
{{ 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(',')" :key="index1" type="success" effect="dark" style="margin-left: 5px">{{item1}}</el-tag>
|
<el-tag v-for="(item1, index1) in item.fileTag.split(',')"
|
||||||
|
@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>
|
||||||
|
@ -282,6 +284,71 @@ 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: '确认',
|
||||||
|
@ -291,24 +358,7 @@ export default {
|
||||||
inputErrorMessage: '请输入最多五个字的标签,不能携带标点符号'
|
inputErrorMessage: '请输入最多五个字的标签,不能携带标点符号'
|
||||||
})
|
})
|
||||||
.then(({ value }) => {
|
.then(({ value }) => {
|
||||||
let fileTagList = []
|
this.editTagMsg('add', item, value, 0)
|
||||||
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,7 +289,8 @@ export default {
|
||||||
{ color: '#5cb87a', percentage: 100 }, // 绿色
|
{ color: '#5cb87a', percentage: 100 }, // 绿色
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
pptMedia: {} // ppt媒体数据
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -561,6 +562,7 @@ 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 => {
|
||||||
|
@ -590,53 +592,81 @@ 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)
|
||||||
// console.log('isBase64', o, isBase64)
|
let onLineUrl = '' // 线上地址
|
||||||
if (isBase64) {
|
if (!!o.zipPath) onLineUrl = this.pptMedia[o.zipPath] || '' // 是否已上传过
|
||||||
const bolb = commUtils.base64ToBlob(o.src)
|
if (onLineUrl) o.src = onLineUrl // 已存在线上地址直接赋值
|
||||||
const fileName = Date.now() + '.png'
|
else { // 不存在重新上传
|
||||||
const file = commUtils.blobToFile(bolb, fileName)
|
if (isBase64) { // 相同资源处理
|
||||||
// o.src = fileName
|
const url = await this.getOnlineFileUrl(o.src)
|
||||||
// console.log('file', file)
|
url && o.zipPath && (this.pptMedia[o.zipPath] = url) // 缓存
|
||||||
const formData = new FormData()
|
} else if (isBlobUrl) { // 视频和音频
|
||||||
formData.append('file', file)
|
const res = await fetch(o.src)
|
||||||
const res = await Api_server.Other.uploadFile(formData)
|
const blob = await res.blob()
|
||||||
if (res && res.code == 200){
|
const url = await this.getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3')
|
||||||
const url = res?.url
|
URL.revokeObjectURL(o.src) // 释放内存
|
||||||
url &&(o.src = url)
|
|
||||||
}
|
|
||||||
} else if (isBlobUrl) { // 视频和音频
|
|
||||||
const res = await fetch(o.src)
|
|
||||||
const blob = await res.blob()
|
|
||||||
const fileName = o.type=='video'? Date.now() + '.mp4':Date.now() + '.mp3'
|
|
||||||
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);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
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
|
||||||
const resPptJson = await PPTXFileToJson(file)
|
this.pptMedia = {} // 清空媒体数据
|
||||||
|
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)
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
<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
|
||||||
|
@ -19,7 +24,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, reactive} from 'vue'
|
import {ref, reactive, onMounted} 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'
|
||||||
|
@ -31,10 +36,12 @@ 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: userStore.user.avatar ==='/img/avatar-default.jpg' || userStore.user.avatar ==='/images/img-avatar.png' ? defaultUserImg : dev_api.value + userStore.user.avatar, // 裁剪图片的地址
|
img: '', // 裁剪图片的地址
|
||||||
autoCrop: true, // 是否默认生成截图框
|
autoCrop: true, // 是否默认生成截图框
|
||||||
autoCropWidth: 400, // 默认生成截图框宽度
|
autoCropWidth: 400, // 默认生成截图框宽度
|
||||||
autoCropHeight: 400, // 默认生成截图框高度
|
autoCropHeight: 400, // 默认生成截图框高度
|
||||||
|
@ -70,12 +77,19 @@ 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>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<p style="margin-bottom:10px;font-size:18px;font-weight:600">申请信息已驳回,请重新提交申请信息。</p>
|
<p style="margin-bottom:10px;font-size:18px;font-weight:600">申请信息已驳回,请重新提交申请信息。</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box-item" :style="userregister.value?'':'margin-top:30px'" >
|
<div class="box-item" :style="userregister.value?'':'margin-top:30px'" >
|
||||||
<el-form ref="ruleFormRef" label-width="auto" :rules="rules" :model="ruleForm" size="large" >
|
<el-form ref="ruleFormRef" label-width="auto" :rules="rules" :model="ruleForm" size="large" >
|
||||||
<el-form-item label="学校名称" prop="schoolName" >
|
<el-form-item label="学校名称" prop="schoolName" >
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<el-form-item label="经办人电话" >
|
<el-form-item label="经办人电话" >
|
||||||
{{ state.user.phonenumber }}
|
{{ state.user.phonenumber }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item >
|
<el-form-item >
|
||||||
<div style="display:flex;align-items:center;justify-content: space-between;padding-right:100px; width: 100%;">
|
<div style="display:flex;align-items:center;justify-content: space-between;padding-right:100px; width: 100%;">
|
||||||
<div style="display:flex;align-items:center;">
|
<div style="display:flex;align-items:center;">
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
<el-button style="width:150px" type="primary" @click="submitForm(ruleFormRef)" v-if="isshwoBtn">确定</el-button>
|
<el-button style="width:150px" type="primary" @click="submitForm(ruleFormRef)" v-if="isshwoBtn">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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 'element-china-area-data'
|
import { regionData, codeToText } from '@/plugins/china-area-data-json'
|
||||||
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'
|
||||||
|
@ -158,7 +158,7 @@ const submitForm = async (formEl) => {
|
||||||
if(!ruleForm.istrue) {
|
if(!ruleForm.istrue) {
|
||||||
ElMessage.error('请勾选以上信息真实有效的复选框')
|
ElMessage.error('请勾选以上信息真实有效的复选框')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const araname = codeToText[ruleForm.address[0]] + '-' + codeToText[ruleForm.address[1]] + '-' + codeToText[ruleForm.address[2]];
|
const araname = codeToText[ruleForm.address[0]] + '-' + codeToText[ruleForm.address[1]] + '-' + codeToText[ruleForm.address[2]];
|
||||||
const form={
|
const form={
|
||||||
schoolName:ruleForm.schoolName,
|
schoolName:ruleForm.schoolName,
|
||||||
|
@ -170,7 +170,7 @@ const submitForm = async (formEl) => {
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
ElMessage.success('提交成功')
|
ElMessage.success('提交成功')
|
||||||
await userStore.getDeptInfo()
|
await userStore.getDeptInfo()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -190,7 +190,7 @@ onMounted(() => {
|
||||||
getregisterinfo()
|
getregisterinfo()
|
||||||
getSchoolList()
|
getSchoolList()
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ onMounted(() => {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination style="margin-top:10px;float: right;" background layout="prev, pager, next" @size-change="handleSizeChange"
|
<el-pagination style="margin-top:10px;float: right;" background layout="prev, pager, next" @size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange" :default-page-size="searchValue.pageSize" v-model:current-page="searchValue.pageNum" :total="total" />
|
@current-change="handleCurrentChange" :default-page-size="searchValue.pageSize" v-model:current-page="searchValue.pageNum" :total="total" />
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="dialogVisible"
|
v-model="dialogVisible"
|
||||||
title="加入学校审核"
|
title="加入学校审核"
|
||||||
|
@ -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 'element-china-area-data'
|
import { regionData, codeToText } from '@/plugins/china-area-data-json'
|
||||||
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()
|
||||||
|
@ -150,7 +150,7 @@ const getList = () =>{
|
||||||
const area=formattedAddress()
|
const area=formattedAddress()
|
||||||
searchValue.area=area
|
searchValue.area=area
|
||||||
let obj= filterNullProperties(searchValue)
|
let obj= filterNullProperties(searchValue)
|
||||||
|
|
||||||
school.auditlist(obj).then(res=>{
|
school.auditlist(obj).then(res=>{
|
||||||
tableData.value=res.rows
|
tableData.value=res.rows
|
||||||
total.value=res.total
|
total.value=res.total
|
||||||
|
@ -194,4 +194,4 @@ onMounted(()=>{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -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:"";
|
res = res&&res!=='prod'?"-" + res:"";
|
||||||
packageJson.name = "aix-win-ws" + res
|
packageJson.name = "aix-win-ws" + res
|
||||||
|
|
||||||
// 将修改后的内容写回package.json文件
|
// 将修改后的内容写回package.json文件
|
||||||
|
|
Loading…
Reference in New Issue