修改bug

This commit is contained in:
yangjun 2025-01-06 08:54:25 +08:00
parent c1c10ed4fe
commit 2f496b8b8c
5 changed files with 296 additions and 405 deletions

View File

@ -642,6 +642,17 @@ function uploadFn(customRequestData) {
let fileSize = file.size; let fileSize = file.size;
let uploadPromiseList = []; let uploadPromiseList = [];
console.log("🚀 ~ uploadFn ~ fileSize:", fileSize)
if(fileSize>1024*1024*20){
let jjj = {success:false,code:0,message:'文件大小不能超过200M请重新上传',result:null,timestamp:new Date().getTime()}
setTimeout(() => {
onError(jjj, jjj, file);
}, 1000);
return;
}
if (fileSize <= chunkSize) { if (fileSize <= chunkSize) {
let formData = new FormData(); let formData = new FormData();
Object.keys(data).forEach((key) => { Object.keys(data).forEach((key) => {

View File

@ -175,11 +175,11 @@
function handleChangeCheckCode() { function handleChangeCheckCode() {
formData.inputCode = ''; formData.inputCode = '';
//TODO mock //TODO mock
randCodeData.checkKey = 1629428467008; //new Date().getTime(); // randCodeData.checkKey = 1629428467008; //new Date().getTime();
getCodeInfo(randCodeData.checkKey).then((res) => { // getCodeInfo(randCodeData.checkKey).then((res) => {
randCodeData.randCodeImage = res; // randCodeData.randCodeImage = res;
randCodeData.requestCodeSuccess = true; // randCodeData.requestCodeSuccess = true;
}); // });
} }
/** /**

View File

@ -199,11 +199,11 @@
function handleChangeCheckCode() { function handleChangeCheckCode() {
formData.inputCode = ''; formData.inputCode = '';
randCodeData.checkKey = 1629428467008; // randCodeData.checkKey = 1629428467008;
getCodeInfo(randCodeData.checkKey).then((res) => { // getCodeInfo(randCodeData.checkKey).then((res) => {
randCodeData.randCodeImage = res; // randCodeData.randCodeImage = res;
randCodeData.requestCodeSuccess = true; // randCodeData.requestCodeSuccess = true;
}); // });
} }
/** /**

View File

@ -47,7 +47,7 @@
</div> </div>
<a-col :span="24" v-if="formData.wwtgl" class="wrapper-back"> <a-col :span="24" v-if="formData.wwtgl" class="wrapper-back">
<div class="wrapper-title">查重设置</div> <div class="wrapper-title">查重设置</div>
<a-form-item layout="inline" style="margin-left: 100px"> <a-form-item layout="inline" class="ccsz-main">
<a-form-item label="检测通过率" :labelCol="labelCol3" :wrapperCol="wrapperCol3"> <a-form-item label="检测通过率" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<span style="padding: 7px 10px"></span> <span style="padding: 7px 10px"></span>
<a-input-number v-model:value="formData.wwtgl" placeholder="检测通过率" style="width: 60%" :max="100" :min="0" disabled> <a-input-number v-model:value="formData.wwtgl" placeholder="检测通过率" style="width: 60%" :max="100" :min="0" disabled>
@ -81,7 +81,7 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-show="formData.pyContent || formData.pyFilePath|| formData.score"> <a-col v-if="formData.pyContent || formData.pyFilePath">
<div class="wrapper-back"> <div class="wrapper-back">
<div class="wrapper-title">批阅信息</div> <div class="wrapper-title">批阅信息</div>
<a-row> <a-row>
@ -96,9 +96,6 @@
<a-button type="primary" style="margin-left: 10px" @click="downLoad(formData.pyFilePath)">下载</a-button> <a-button type="primary" style="margin-left: 10px" @click="downLoad(formData.pyFilePath)">下载</a-button>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24" v-show="showType == '1'">
<div class="wps-iframe" id="wpsiframeid" style="width:100%;height: 500px;"></div>
</a-col>
</a-row> </a-row>
</div> </div>
</a-col> </a-col>
@ -158,12 +155,8 @@ import { useRouter } from 'vue-router';
import dayjs, { Dayjs } from 'dayjs'; import dayjs, { Dayjs } from 'dayjs';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'; import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import WebOfficeSDK from '/@/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.es'
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
// //
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const { query } = unref(currentRoute); const { query } = unref(currentRoute);
@ -173,7 +166,6 @@ const props = defineProps({
formData: { type: Object, default: () => {} }, formData: { type: Object, default: () => {} },
formBpm: { type: Boolean, default: true }, formBpm: { type: Boolean, default: true },
}); });
const showType = ref<string>('0');
const formRef = ref(); const formRef = ref();
const useForm = Form.useForm; const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']); const emit = defineEmits(['register', 'ok']);
@ -291,61 +283,11 @@ function add() {
* 编辑 * 编辑
*/ */
function edit(record) { function edit(record) {
console.log("🚀 ~ edit ~ record:", record)
nextTick(() => { nextTick(() => {
resetFields(); resetFields();
// //
Object.assign(formData, record); Object.assign(formData, record);
handleKcnr(formData.kcnr); 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";
}
if(showType.value == '1'){
const element = document.getElementById('wpsiframeid');
console.log('userStore.getUserInfo',userStore.getUserInfo)
formData.id = '1863389832580046849';
//
element.innerHTML = '';
const jssdk = WebOfficeSDK.init({
officeType: wpsType,
appId: 'SX20241118WSUGQN',
// fileId: formData.stuId,
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: userStore.getUserInfo.username
})
}
}); });
} }
@ -443,11 +385,30 @@ defineExpose({
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.antd-modal-form { //
min-height: 300px !important; @media (max-width: 768px) {
overflow-y: auto; .ccsz-main{}
padding: 24px 24px 24px 24px;
.antd-modal-form {
min-height: 300px !important;
overflow-y: auto;
padding: 5px 5px 5px 5px;
}
} }
//
@media (min-width: 769px) {
.ccsz-main{
margin-left: 100px;
}
.antd-modal-form {
min-height: 300px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
}
.spanSm { .spanSm {
top: -22px; top: -22px;
position: inherit; position: inherit;

View File

@ -2,60 +2,52 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<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 :push="leftSpan - 1" :span="0" :lg="{ span: 1 }"> <a-col :span="12">
<!-- <a-button style="margin-left: 28px;" type="primary" @click="changeSpan" size="small">{{ leftSpan == 12? '放大' : '缩小' }}</a-button> --> <div v-if="showType=='1'">
<img v-show="leftSpan == 12" @click="changeSpan" style="width: 25px;margin-left: 50px;cursor: pointer;" <iframe id="pdfPreviewIframe" :src="ylurl" frameborder="0" width="100%" height="550px" scrolling="auto"></iframe>
src="/resource/img/toright.png" />
<img v-show="leftSpan != 12" @click="changeSpan" style="width: 25px;margin-left: 50px;cursor: pointer;"
src="/resource/img/toleft.png" />
</a-col>
</a-row>
<a-row>
<a-col :xs="24" :lg="leftSpan">
<div v-show="showType == '1'">
<div class="wps-iframe" id="wpsiframeid" style="width:100%;height: 500px;"></div>
</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>
</div> </div>
<div class="image-container"> <div class="image-container">
<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 ref="videoPlayer" :controls="controls" :autoplay="autoplay" :loop="loop" :src="videoUrl" <video
@loadedmetadata="playVideoInFullscreen"> ref="videoPlayer"
:controls="controls"
:autoplay="autoplay"
:loop="loop"
:src="videoUrl"
@loadedmetadata="playVideoInFullscreen"
>
</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 :xs="24" :lg="rightSpan"> <a-col :span="12">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="作业名称"> <a-form-item label="作业名称">
{{ zyInfo.title }} {{zyInfo.title}}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="学生姓名"> <a-form-item label="学生姓名">
{{ formData.studentName }} {{formData.studentName}}
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学生学号">
{{ formData.createBy }}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="评分" v-bind="validateInfos.score"> <a-form-item label="评分" v-bind="validateInfos.score">
<a-input-number v-model:value="formData.score" style="width: 100%" placeholder="请填写评分"></a-input-number> <a-input-number v-model:value="formData.score" style="width: 100%" placeholder="请填写评分" ></a-input-number>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -65,12 +57,11 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="批阅附件" v-bind="validateInfos.pyFilePath"> <a-form-item label="批阅附件" v-bind="validateInfos.pyFilePath">
<j-upload v-model:value="formData.pyFilePath" maxCount="1" :text="`上传批阅附件`" <j-upload v-model:value="formData.pyFilePath" maxCount="1" :text="`上传批阅附件`" style="background: #ededed; " :forceAcceptVerify="true" ></j-upload>
style="background: #ededed; " :forceAcceptVerify="true"></j-upload>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24" style="text-align: center;" v-if="disabled"> <a-col :span="24" style="text-align: center;" v-if="disabled">
<div> <div >
<a-button type="primary" @click="submitForm">保存</a-button> <a-button type="primary" @click="submitForm">保存</a-button>
<a-button type="primary" @click="submitNextForm" style="margin-left: 10px;">保存并下一个</a-button> <a-button type="primary" @click="submitNextForm" style="margin-left: 10px;">保存并下一个</a-button>
</div> </div>
@ -84,116 +75,95 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, onUnmounted } from 'vue'; import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted,onUnmounted } from 'vue';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { getValueType } from '/@/utils'; import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyInfoStudent.api'; import { saveOrUpdate } from '../ZyInfoStudent.api';
import { Form } from 'ant-design-vue'; import { Form } from 'ant-design-vue';
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue'; import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
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'
import { useUserStore } from '/@/store/modules/user';
const leftSpan = ref(12) const props = defineProps({
const rightSpan = ref(12) formDisabled: { type: Boolean, default: false },
const userStore = useUserStore(); formData: { type: Object, default: ()=>{} },
const props = defineProps({ formBpm: { type: Boolean, default: true }
formDisabled: { type: Boolean, default: false }, });
formData: { type: Object, default: () => { } }, const formRef = ref();
formBpm: { type: Boolean, default: true } const useForm = Form.useForm;
}); const emit = defineEmits(['register', 'ok', 'ok2']);
const formRef = ref(); const formData = reactive<Record<string, any>>({
const useForm = Form.useForm; id: '',
const emit = defineEmits(['register', 'ok', 'ok2']); score: '',
const formData = reactive<Record<string, any>>({ pyContent: '',
id: '', pyFilePath: '',
score: '', });
pyContent: '', const { createMessage } = useMessage();
pyFilePath: '', const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
}); const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const { createMessage } = useMessage(); const confirmLoading = ref<boolean>(false);
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } }); const showType = ref<string>('0');
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } }); const ylurl = ref<string>('');
const confirmLoading = ref<boolean>(false);
const showType = ref<string>('1');
const ylurl = ref<string>('');
const rotationAngle = ref(0); const rotationAngle = ref(0);
const zyInfo = ref<any>({}); const zyInfo = ref<any>({});
const globSetting = useGlobSetting(); const globSetting = useGlobSetting();
const baseApiUrl = globSetting.domainUrl; const baseApiUrl = globSetting.domainUrl;
const videoPlayer = ref(null); const videoPlayer = ref(null);
const videoOpen = ref<boolean>(false); const videoOpen = ref<boolean>(false);
const controls = ref(true); const controls = ref(true);
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>({});
const record_ = ref(null)
function changeSpan() {
console.log('leftSpan', leftSpan.value)
console.log('rightSpan', rightSpan.value)
if (leftSpan.value == 12) {
leftSpan.value = 18
rightSpan.value = 6
} else {
leftSpan.value = 12
rightSpan.value = 12
}
console.log('leftSpan--》', leftSpan.value)
console.log('rightSpan--》', rightSpan.value)
edit(record_.value)
}
// //
const validatorRules = { const validatorRules = {
score: [{ required: true, message: '请输入分数!' }], score: [{ required: true, message: '请输入分数!' }],
}; };
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
// //
const disabled = computed(() => { const disabled = computed(()=>{
if (props.formBpm === true) { if(props.formBpm === true){
if (props.formData.disabled === false) { if(props.formData.disabled === false){
return false; return false;
} else { }else{
return true; return true;
}
} }
} return props.formDisabled;
return props.formDisabled; });
});
function handleJyfz(record) { function handleJyfz(record){
console.log(`🚀 ~ handleJyfz ~ record:`, record) console.log(`🚀 ~ handleJyfz ~ record:`, record)
// if(zyInfo.score){ // if(zyInfo.score){
// if(parseInt(record) > parseInt(zyInfo.score)){ // if(parseInt(record) > parseInt(zyInfo.score)){
// createMessage.warning('!'); // createMessage.warning('!');
// formData.score = zyInfo.score; // formData.score = zyInfo.score;
// } // }
// }else{ // }else{
// if(parseInt(record) > 100){ // if(parseInt(record) > 100){
// createMessage.warning('100!'); // createMessage.warning('100!');
// formData.score = zyInfo.score; // formData.score = zyInfo.score;
// } // }
// } // }
if(parseInt(record) > 100){
createMessage.warning('评分不能超过100分!');
formData.score = '';
}
if(parseInt(record) < 0){
createMessage.warning('评分不能低于0分!');
formData.score = '';
}
if (parseInt(record) > 100) {
createMessage.warning('评分不能超过100分!');
formData.score = '';
} }
if (parseInt(record) < 0) {
createMessage.warning('评分不能低于0分!');
formData.score = '';
}
}
function rotateImage() { function rotateImage() {
rotationAngle.value += 90; // 90 rotationAngle.value += 90; // 90
} }
@ -201,97 +171,56 @@ function rotateImage() {
function rotateImage2() { function rotateImage2() {
rotationAngle.value -= 90; // 90 rotationAngle.value -= 90; // 90
} }
/** /**
* 新增 * 新增
*/ */
function add() { function add() {
edit({}); edit({});
} }
/** /**
* 编辑 * 编辑
*/ */
function edit(record) { function edit(record) {
record_.value = record formData.pyContent = ''
showType.value = '1'; nextTick(() => {
formData.pyContent = '' resetFields();
nextTick(() => {
resetFields();
defHttp.get({ url: '/zyInfo/zyInfo/queryById', params: { id: record.mainId } }).then(res => { defHttp.get({url:'/zyInfo/zyInfo/queryById',params:{id:record.mainId}}).then(res=>{
console.log(`🚀 ~ defHttp.get ~ res:`, res) console.log(`🚀 ~ defHttp.get ~ res:`, res)
zyInfo.value = res; zyInfo.value = res;
})
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";
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') {
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";
} 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 = '1863389832580046849';
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: userStore.getUserInfo.username
}) })
} const parts = record.filePath.split('.');
const filetype = parts[parts.length - 1];
console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
var file = getFileAccessHttpUrl(record.filePath);
ylurl.value = file;
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';
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("🚀 ~ nextTick ~ userStore.getUserInfo.id:", userStore.getUserInfo.id) console.log('视频预览-----》',url);
console.log("🚀 ~ nextTick ~ userStore.getUserInfo.id:", userStore.getUserInfo.id) // videoOpen.value = true;
console.log("🚀 ~ nextTick ~ userStore.getUserInfo.id:", userStore.getUserInfo.id) videoUrl.value = url;
}
// --------------------------------------------------------
}else{
showType.value = '0';
}
//
Object.assign(formData, record);
});
}
// --------------------------------------------------------
const playVideo = () => { const playVideo = () => {
videoPlayer.value.play(); videoPlayer.value.play();
}; };
@ -308,7 +237,7 @@ const handleFullScreenChange = () => {
} }
}; };
function videoHandleCancel() { function videoHandleCancel(){
pauseVideo(); pauseVideo();
videoOpen.value = false; videoOpen.value = false;
} }
@ -321,9 +250,9 @@ onUnmounted(() => {
}); });
// //
function handleVideo(three) { function handleVideo(three){
let url = getFileAccessHttpUrl(three.filePath); let url = getFileAccessHttpUrl(three.filePath);
console.log('视频预览-----》', url); console.log('视频预览-----》',url);
videoOpen.value = true; videoOpen.value = true;
videoUrl.value = url; videoUrl.value = url;
playVideoInFullscreen(); playVideoInFullscreen();
@ -334,7 +263,7 @@ function handleVideo(three) {
} }
// -------------------------------------------------------- // --------------------------------------------------------
const playVideoInFullscreen = async () => { const playVideoInFullscreen = async () => {
if (videoPlayer.value) { if (videoPlayer.value) {
try { try {
// 使DOM // 使DOM
@ -345,140 +274,130 @@ const playVideoInFullscreen = async () => {
} }
}; };
/** /**
* 提交数据 * 提交数据
*/ */
async function submitForm() { async function submitForm() {
// //
await validate(); await validate();
confirmLoading.value = true; confirmLoading.value = true;
const isUpdate = ref<boolean>(false); const isUpdate = ref<boolean>(false);
// //
let model = formData; let model = formData;
if (model.id) { if (model.id) {
isUpdate.value = true; isUpdate.value = true;
} }
// //
for (let data in model) { for (let data in model) {
// //
if (model[data] instanceof Array) { if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data); let valueType = getValueType(formRef.value.getProps, data);
// //
if (valueType === 'string') { if (valueType === 'string') {
model[data] = model[data].join(','); model[data] = model[data].join(',');
}
} }
} }
defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editPiyue',params:model}).then(res =>{
emit('ok');
})
.finally(() => {
confirmLoading.value = false;
});
// await saveOrUpdate(model, isUpdate.value)
// .then((res) => {
// if (res.success) {
// createMessage.success(res.message);
// emit('ok');
// } else {
// createMessage.warning(res.message);
// }
// })
// .finally(() => {
// confirmLoading.value = false;
// });
} }
defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editPiyue', params: model }).then(res => { /**
emit('ok'); * 提交数据并下一个
}) */
.finally(() => { async function submitNextForm() {
confirmLoading.value = false; //
}); await validate();
// await saveOrUpdate(model, isUpdate.value) confirmLoading.value = true;
// .then((res) => { const isUpdate = ref<boolean>(false);
// if (res.success) { //
// createMessage.success(res.message); let model = formData;
// emit('ok'); if (model.id) {
// } else { isUpdate.value = true;
// createMessage.warning(res.message); }
// } //
// }) for (let data in model) {
// .finally(() => { //
// confirmLoading.value = false; if (model[data] instanceof Array) {
// }); let valueType = getValueType(formRef.value.getProps, data);
} //
if (valueType === 'string') {
/** model[data] = model[data].join(',');
* 提交数据并下一个 }
*/
async function submitNextForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
} }
} }
await defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editPiyue',params:model}).then(res =>{
emit('ok2');
})
await defHttp.get({url:'/zyInfoStudent/zyInfoStudent/getList2',params:{column:'createTime',order:'asc',pageNo:1,pageSize:10,ywid:zyInfo.value.id,rwbh:zyInfo.value.rwbh,queryType:5}}).then(res =>{
console.log(`🚀 ~ awaitdefHttp.post ~ res:`, res)
var list = res.records;
if(list.length>0){
edit(list[0])
}else{
createMessage.warning('已批阅完毕,暂无下一条批阅数据!');
}
})
.finally(() => {
confirmLoading.value = false;
});
} }
await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editPiyue', params: model }).then(res => { defineExpose({
emit('ok2'); add,
}) edit,
submitForm,
});
await defHttp.get({ url: '/zyInfoStudent/zyInfoStudent/getList2', params: { column: 'createTime', order: 'asc', pageNo: 1, pageSize: 10, ywid: zyInfo.value.id, rwbh: zyInfo.value.rwbh, queryType: 5 } }).then(res => {
console.log(`🚀 ~ awaitdefHttp.post ~ res:`, res)
var list = res.records;
if (list.length > 0) {
edit(list[0])
} else {
createMessage.warning('已批阅完毕,暂无下一条批阅数据!');
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.antd-modal-form { .antd-modal-form {
min-height: 150px !important; min-height: 150px !important;
overflow-y: auto; overflow-y: auto;
padding: 24px 24px 24px 24px; padding: 24px 24px 24px 24px;
} }
.video-container {
.video-container {
text-align: center; text-align: center;
} }
video { video {
display: block; display: block;
max-width: 100%; max-width: 100%; /* 确保视频宽度不超过其容器宽度 */
/* 确保视频宽度不超过其容器宽度 */
} }
.image-container { .image-container {
padding: 10px; padding: 10px;
width: 100%; width:100%; /* 设置容器宽度 */
/* 设置容器宽度 */ height: auto; /* 设置容器高度 */
height: auto; overflow: hidden; /* 隐藏溢出的部分 */
/* 设置容器高度 */
overflow: hidden;
/* 隐藏溢出的部分 */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.rotated-image { .rotated-image {
max-width: 100%; max-width: 100%; /* 最大宽度为容器宽度 */
/* 最大宽度为容器宽度 */ max-height: 100%; /* 最大高度为容器高度 */
max-height: 100%; object-fit: contain; /* 保持图片内容不失真 */
/* 最大高度为容器高度 */ transform: rotate(90deg); /* 假设图片已经旋转90度 */
object-fit: contain;
/* 保持图片内容不失真 */
transform: rotate(90deg);
/* 假设图片已经旋转90度 */
} }
</style> </style>