This commit is contained in:
zdg 2024-07-26 14:26:00 +08:00
parent 1004567103
commit 6c6c08abf6
5 changed files with 26 additions and 12 deletions

View File

@ -172,11 +172,13 @@ onMounted(async () => {
fabriccanvas.value = new fabric.Canvas('pdf-fabric') fabriccanvas.value = new fabric.Canvas('pdf-fabric')
fabriccanvas.value.setWidth(595) fabriccanvas.value.setWidth(595)
fabriccanvas.value.isDrawingMode = true fabriccanvas.value.isDrawingMode = true
fabriccanvas.value.freeDrawingBrush.color = 'red' fabriccanvas.value.freeDrawingBrush.color = '#A33AFE'
fabriccanvas.value.freeDrawingCursor = 'default'
fabriccanvas1.value = new fabric.Canvas('pdf-fabric1') fabriccanvas1.value = new fabric.Canvas('pdf-fabric1')
fabriccanvas1.value.isDrawingMode = true fabriccanvas1.value.isDrawingMode = true
fabriccanvas1.value.freeDrawingBrush.color = 'red' fabriccanvas1.value.freeDrawingBrush.color = '#A33AFE'
fabriccanvas1.value.freeDrawingCursor = 'default'
fabriccanvas1.value.setWidth(595) fabriccanvas1.value.setWidth(595)
emit('update:numPagesTotal', pdf.numPages) emit('update:numPagesTotal', pdf.numPages)
initPdf() initPdf()

View File

@ -158,10 +158,19 @@ const eventHandles = (type, win) => {
publicMethods(on) // 加载公共方法 publicMethods(on) // 加载公共方法
break} break}
case 'open-PDF': { case 'open-PDF': {
// 最小化窗口 // 最小化窗口 minimize()
Remote.ipcMain.once('open-PDF:minimize', () => {win.minimize()}) Remote.ipcMain.once('open-PDF:minimize', () => {win.destroy()})
break} break}
default: default:
break break
} }
} }
const taskHandles = () => {
// // 设置任务栏上下文菜单
// const contextMenu = new Remote.Menu()
// contextMenu.append(new Remote.MenuItem({
// label: '关闭',
// click: () => {Remote.app.quit()}
// }))
}

View File

@ -12,7 +12,7 @@
<el-button class="btn" @click="handleOutLink('gk')">高考研读</el-button> <el-button class="btn" @click="handleOutLink('gk')">高考研读</el-button>
<el-button class="btn" @click="handleOutLink('aiModel')">教学大模型</el-button> <el-button class="btn" @click="handleOutLink('aiModel')">教学大模型</el-button>
</div> </div>
<el-button type="primary" class="to-class-btn"> <el-button type="primary" class="to-class-btn" @click="openLesson">
<i class="iconfont icon-lingdang"></i>上课</el-button> <i class="iconfont icon-lingdang"></i>上课</el-button>
</div> </div>
<div class="prepare-body-header"> <div class="prepare-body-header">
@ -260,10 +260,13 @@ export default {
cookieData: {...(configObj.data)} cookieData: {...(configObj.data)}
}) })
}, },
// PDF-
navtoPdf() { navtoPdf() {
const params = { url: '/classBegins/index' } createWindow('open-PDF', { url: '/classBegins/index' })
createWindow('open-PDF', params) },
// -
openLesson() {
createWindow('tool-sphere', { url: '/tool/sphere' })
} }
} }
} }

View File

@ -16,7 +16,7 @@
</div> </div>
<!-- 上传弹窗 --> <!-- 上传弹窗 -->
<uploadDialog v-model="isDialogOpen" @submitFile="submitFile" /> <uploadDialog v-model="isDialogOpen" @submitFile="submitFile" />
<el-button @click="testClick">测试</el-button> <!-- <el-button @click="testClick">测试</el-button> -->
</template> </template>
<script setup> <script setup>
@ -42,8 +42,7 @@ onMounted(async () => {
// console.log('', res) // console.log('', res)
}) })
const testClick = async() => { const testClick = async() => {
const params = { url: '/tool/sphere' } const win = await createWindow('tool-sphere', { url: '/tool/sphere' })
const win = await createWindow('tool-sphere', params)
console.log('消息返回:', win) console.log('消息返回:', win)
} }
// //

View File

@ -6,12 +6,13 @@
// //
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { FabricVue } from '@/plugins/fabric' import { FabricVue } from '@/plugins/fabric'
import { useBoardStore } from '@/store/modules/draw' import { useBoardStore, useDrawStore } from '@/store/modules/draw'
const canvasRef = ref(null) const canvasRef = ref(null)
onMounted(async() => { onMounted(async() => {
if (canvasRef.value) { if (canvasRef.value) {
useBoardStore().backgroundColor = 'transparent' useBoardStore().backgroundColor = 'transparent'
useDrawStore().drawColors = ['red']
const option = { freeDrawingCursor: 'default' } const option = { freeDrawingCursor: 'default' }
await FabricVue.initCanvas(canvasRef.value, option) await FabricVue.initCanvas(canvasRef.value, option)
// FabricVue.canvas.backgroundColor = 'transparent' // FabricVue.canvas.backgroundColor = 'transparent'