Merge pull request 'zouyf_dev' (#221) from zouyf_dev into main

Reviewed-on: #221
This commit is contained in:
zouyf 2025-01-13 14:56:12 +08:00
commit e1c717eec4
2 changed files with 28 additions and 1 deletions

View File

@ -244,6 +244,13 @@ app.on('ready', () => {
loginWindow.show()
loginWindow.focus()
})
// 打印窗口
ipcMain.on('printPage', (event, printOptions) => {
//console.log("ipcMain-print-page")
mainWindow.webContents.print(printOptions, (success, failureReason) => {
if (!success) console.error(failureReason);
});
});
//打开作业窗口
ipcMain.on('openWindow', (e, data) => {

View File

@ -78,7 +78,7 @@
</div>
<div v-if="(currentRow.worktype == '科学实验' || classWorkForm.worktype == '科学实验')&& currentRow.id>0" class="page-center">
<div class="experiment-homework">
<ExperimentQuestion :expObj="classWorkForm.fileHomeworkList&&classWorkForm.fileHomeworkList[0]" @clickExpObj="getExpObj" />
<ExperimentQuestion :expObj="classWorkForm.fileHomeworkList&&classWorkForm.fileHomeworkList[0]" @clickExpObj="getExpObj" />
</div>
</div>
@ -161,6 +161,7 @@ const route = useRoute();
const router = useRouter()
const { proxy } = getCurrentInstance()
const useClassTaskStores = useClassTaskStore();
const { ipcRenderer } = require('electron')
const props = defineProps({
currentCourse: Object,
@ -841,6 +842,22 @@ const editWork = async (cform) =>{
}
}
// ,
const handlePrint = () => {
const printOptions = {
silent: false, //
printBackground: true, //
color: false, //
marginsType: 0, // 0: 1: 2:
pageSize: 'A4', //
//
};
console.log("print-page-click");
ipcRenderer.send('printPage', printOptions);
};
//----
@ -977,5 +994,8 @@ const editWork = async (cform) =>{
}
}
}
::v-deep img {
display: inline-block !important;
}
</style>