zouyf_dev #221

Merged
zouyf merged 5 commits from zouyf_dev into main 2025-01-13 14:56:14 +08:00
2 changed files with 28 additions and 1 deletions

View File

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

View File

@ -161,6 +161,7 @@ const route = useRoute();
const router = useRouter() const router = useRouter()
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const useClassTaskStores = useClassTaskStore(); const useClassTaskStores = useClassTaskStore();
const { ipcRenderer } = require('electron')
const props = defineProps({ const props = defineProps({
currentCourse: Object, currentCourse: Object,
@ -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> </style>