This commit is contained in:
1378012178@qq.com 2024-12-13 15:38:47 +08:00
commit 387813728f
3 changed files with 71 additions and 100 deletions

View File

@ -1,10 +1,20 @@
<template> <template>
<div> <div>
<a-row>
<a-col :span="5">
<a-button type="primary" preIcon="ant-design:export-outlined" @click="batchHandleKhcl" style="margin-left: 8px">上传考核材料</a-button>
</a-col>
<a-col :span="18">
<span style="color:red;font-weight: 700;">温馨提示学生未完成的测验和教师还未评分如文件题的测验无法上传如需上传需所有学生完成测验且教师完成评分如文件题</span>
</a-col>
</a-row>
<!--引用表格--> <!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection"> <BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题--> <!--插槽:table标题-->
<template #tableTitle> <template #tableTitle>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="batchHandleKhcl" style="margin-left: 8px">上传考核材料</a-button>
</template> </template>
<!--操作栏--> <!--操作栏-->
<template #action="{ record }"> <template #action="{ record }">
@ -52,7 +62,7 @@
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
const { rwbh,xqxn,type,teano } = query;// const { rwbh,xqxn,type,teano } = query;//
const queryParam = ref<any>({qpublish:'2',rwbh}); const queryParam = ref<any>({qpublish:'1,2',rwbh});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
const { createConfirm, createMessage } = useMessage(); const { createConfirm, createMessage } = useMessage();
const registerModal = ref(); const registerModal = ref();

View File

@ -296,49 +296,49 @@ function edit(record) {
handleKcnr(formData.kcnr); handleKcnr(formData.kcnr);
const parts = record.stuFilePath.split('.'); // const parts = record.stuFilePath.split('.');
const filetype = parts[parts.length - 1]; // const filetype = parts[parts.length - 1];
console.log(`🚀 ~ nextTick ~ filetype:`, filetype) // console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
let wpsType = "w"; // let wpsType = "w";
if(filetype=='doc' || filetype=='docx'){ // if(filetype=='doc' || filetype=='docx'){
showType.value = '1'; // showType.value = '1';
wpsType = "w"; // wpsType = "w";
}else if(filetype=='pdf'){ // }else if(filetype=='pdf'){
showType.value = '1'; // showType.value = '1';
wpsType = "f"; // wpsType = "f";
}else if(filetype=='ppt' || filetype=='pptx' ){ // }else if(filetype=='ppt' || filetype=='pptx' ){
showType.value = '1'; // showType.value = '1';
wpsType = "p"; // wpsType = "p";
}else if(filetype=='xls' || filetype=='xlsx' ){ // }else if(filetype=='xls' || filetype=='xlsx' ){
showType.value = '1'; // showType.value = '1';
wpsType = "s"; // wpsType = "s";
} // }
if(showType.value == '1'){ // if(showType.value == '1'){
const element = document.getElementById('wpsiframeid'); // const element = document.getElementById('wpsiframeid');
// // //
element.innerHTML = ''; // element.innerHTML = '';
const jssdk = WebOfficeSDK.init({ // const jssdk = WebOfficeSDK.init({
officeType: wpsType, // officeType: wpsType,
appId: 'SX20241118WSUGQN', // appId: 'SX20241118WSUGQN',
fileId: formData.stuId, // fileId: formData.stuId,
mount:document.querySelector('.wps-iframe'), // mount:document.querySelector('.wps-iframe'),
commonOptions: { // commonOptions: {
isShowDocMap: false, // // isShowDocMap: false, //
isShowTopArea: false, // // isShowTopArea: false, //
isShowHeader: false, // // isShowHeader: false, //
isBrowserViewFullscreen: true, // // isBrowserViewFullscreen: true, //
isIframeViewFullscreen: true, // iframe // isIframeViewFullscreen: true, // iframe
acceptVisualViewportResizeEvent: true // WebOffice VisualViewport // acceptVisualViewportResizeEvent: true // WebOffice VisualViewport
}, // },
wordOptions: { // wordOptions: {
isShowDocMap: false, // // isShowDocMap: false, //
isBestScale: true, // // isBestScale: true, //
isShowBottomStatusBar: false, // // isShowBottomStatusBar: false, //
} // }
//token: getToken() // //token: getToken()
}) // })
} // }
}); });
} }

View File

@ -3,10 +3,10 @@
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<div v-show="showType=='1'"> <div v-if="showType=='1'">
<div class="wps-iframe" id="wpsiframeid" style="width:100%;height: 500px;"></div> <iframe id="pdfPreviewIframe" :src="ylurl" frameborder="0" width="100%" height="550px" scrolling="auto"></iframe>
</div> </div>
<div v-if="showType=='2'"> <div v-else-if="showType=='2'">
<div style="padding: 10px 20px;"> <div style="padding: 10px 20px;">
<a-button type="primary" @click="rotateImage">顺时针旋转</a-button> <a-button type="primary" @click="rotateImage">顺时针旋转</a-button>
<a-button type="primary" @click="rotateImage2" style="margin-left: 20px;">逆时针旋转</a-button> <a-button type="primary" @click="rotateImage2" style="margin-left: 20px;">逆时针旋转</a-button>
@ -16,7 +16,7 @@
<img :src="ylurl" :style="{ transform: 'rotate(' + rotationAngle + 'deg)' }" class="rotated-image"/> <img :src="ylurl" :style="{ transform: 'rotate(' + rotationAngle + 'deg)' }" class="rotated-image"/>
</div> </div>
</div> </div>
<div v-if="showType=='3'"> <div v-else-if="showType=='3'">
<div class="video-container"> <div class="video-container">
<video <video
ref="videoPlayer" ref="videoPlayer"
@ -29,9 +29,9 @@
</video> </video>
</div> </div>
</div> </div>
<!-- <div v-else> <div v-else>
<a-button type="primary">下载文件</a-button> <a-button type="primary">下载文件</a-button>
</div> --> </div>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-row> <a-row>
@ -86,7 +86,6 @@
import { useGlobSetting } from '/@/hooks/setting'; import { useGlobSetting } from '/@/hooks/setting';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'; import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { getToken } from '/@/utils/auth'; import { getToken } from '/@/utils/auth';
import WebOfficeSDK from './wpsApi/web-office-sdk-solution-v2.0.7.es'
const props = defineProps({ const props = defineProps({
formDisabled: { type: Boolean, default: false }, formDisabled: { type: Boolean, default: false },
@ -106,7 +105,7 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } }); const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } }); const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false); const confirmLoading = ref<boolean>(false);
const showType = ref<string>('1'); const showType = ref<string>('0');
const ylurl = ref<string>(''); const ylurl = ref<string>('');
const rotationAngle = ref(0); const rotationAngle = ref(0);
const zyInfo = ref<any>({}); const zyInfo = ref<any>({});
@ -119,7 +118,6 @@ const videoOpen = ref<boolean>(false);
const autoplay = ref(false) const autoplay = ref(false)
const loop = ref(false); const loop = ref(false);
const videoUrl = ref<String>(''); const videoUrl = ref<String>('');
const jssdkInfo = ref<any>({});
// //
@ -184,7 +182,6 @@ function rotateImage2() {
* 编辑 * 编辑
*/ */
function edit(record) { function edit(record) {
showType.value = '1';
formData.pyContent = '' formData.pyContent = ''
nextTick(() => { nextTick(() => {
resetFields(); resetFields();
@ -196,69 +193,33 @@ function rotateImage2() {
const parts = record.filePath.split('.'); const parts = record.filePath.split('.');
const filetype = parts[parts.length - 1]; const filetype = parts[parts.length - 1];
console.log(`🚀 ~ nextTick ~ filetype:`, filetype) console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
// var file = getFileAccessHttpUrl(record.filePath);
// ylurl.value = file;
let wpsType = "w";
if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' ){
showType.value = '2';
var file = getFileAccessHttpUrl(record.filePath); var file = getFileAccessHttpUrl(record.filePath);
ylurl.value = file; ylurl.value = file;
}else if(filetype=='doc' || filetype=='docx'){ if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' ){
showType.value = '2';
}else if(filetype=='doc' || filetype=='docx' || filetype=='pdf'){
showType.value = '1'; showType.value = '1';
wpsType = "w"; var file2 = getFileAccessHttpUrl(record.pdfPath);
}else if(filetype=='pdf'){ let url2 = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(file2);
showType.value = '1'; ylurl.value = url2;
wpsType = "f";
}else if(filetype=='ppt' || filetype=='pptx' ){
showType.value = '1';
wpsType = "p";
}else if(filetype=='xls' || filetype=='xlsx' ){
showType.value = '1';
wpsType = "s";
}else if(filetype=='mp4'|| filetype=='avi'|| filetype=='mp3'|| filetype=='wav'){ }else if(filetype=='mp4'|| filetype=='avi'|| filetype=='mp3'|| filetype=='wav'){
showType.value = '3'; showType.value = '3';
let url = getFileAccessHttpUrl(record.filePath); let url = getFileAccessHttpUrl(record.filePath);
console.log('视频预览-----》',url); console.log('视频预览-----》',url);
// videoOpen.value = true; // videoOpen.value = true;
videoUrl.value = url; videoUrl.value = url;
}else{ }else{
showType.value = '0'; showType.value = '0';
} }
// //
Object.assign(formData, record); Object.assign(formData, record);
// formData.id = '1858776554910433282';
console.log("🚀 ~ nextTick ~ formData.id:", formData.id)
if(showType.value == '1'){//
const element = document.getElementById('wpsiframeid');
//
element.innerHTML = '';
const jssdk = WebOfficeSDK.init({
officeType: wpsType,
appId: 'SX20241118WSUGQN',
fileId: formData.id,
mount:document.querySelector('.wps-iframe'),
commonOptions: {
isShowDocMap: false, //
// isShowTopArea: false, //
// isShowHeader: false, //
isBrowserViewFullscreen: true, //
isIframeViewFullscreen: true, // iframe
acceptVisualViewportResizeEvent: true // WebOffice VisualViewport
},
wordOptions: {
isShowDocMap: false, //
isBestScale: true, //
isShowBottomStatusBar: false, //
}
//token: getToken()
})
}
}); });
} }
// -------------------------------------------------------- // --------------------------------------------------------
const playVideo = () => { const playVideo = () => {
videoPlayer.value.play(); videoPlayer.value.play();