修改考核材料信息

This commit is contained in:
yangjun 2024-12-13 13:21:42 +08:00
parent 5e5907f877
commit 66ecbdfce5
3 changed files with 71 additions and 100 deletions

View File

@ -1,10 +1,20 @@
<template>
<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">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="batchHandleKhcl" style="margin-left: 8px">上传考核材料</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
@ -52,7 +62,7 @@
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
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 { createConfirm, createMessage } = useMessage();
const registerModal = ref();

View File

@ -296,49 +296,49 @@ function edit(record) {
handleKcnr(formData.kcnr);
const parts = record.stuFilePath.split('.');
const filetype = parts[parts.length - 1];
console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
let wpsType = "w";
if(filetype=='doc' || filetype=='docx'){
showType.value = '1';
wpsType = "w";
}else if(filetype=='pdf'){
showType.value = '1';
wpsType = "f";
}else if(filetype=='ppt' || filetype=='pptx' ){
showType.value = '1';
wpsType = "p";
}else if(filetype=='xls' || filetype=='xlsx' ){
showType.value = '1';
wpsType = "s";
}
// const parts = record.stuFilePath.split('.');
// const filetype = parts[parts.length - 1];
// console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
// let wpsType = "w";
// if(filetype=='doc' || filetype=='docx'){
// showType.value = '1';
// wpsType = "w";
// }else if(filetype=='pdf'){
// showType.value = '1';
// wpsType = "f";
// }else if(filetype=='ppt' || filetype=='pptx' ){
// showType.value = '1';
// wpsType = "p";
// }else if(filetype=='xls' || filetype=='xlsx' ){
// showType.value = '1';
// wpsType = "s";
// }
if(showType.value == '1'){
const element = document.getElementById('wpsiframeid');
//
element.innerHTML = '';
const jssdk = WebOfficeSDK.init({
officeType: wpsType,
appId: 'SX20241118WSUGQN',
fileId: formData.stuId,
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()
})
}
// if(showType.value == '1'){
// const element = document.getElementById('wpsiframeid');
// //
// element.innerHTML = '';
// const jssdk = WebOfficeSDK.init({
// officeType: wpsType,
// appId: 'SX20241118WSUGQN',
// fileId: formData.stuId,
// 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()
// })
// }
});
}

View File

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