修改bug

This commit is contained in:
yangjun 2024-08-05 10:02:34 +08:00
parent b4a7b8f07e
commit 4bd1531ef5
9 changed files with 776 additions and 705 deletions

View File

@ -28,30 +28,30 @@
</template>
<script lang="ts" setup>
import { ref, reactive, computed, watch, nextTick, createApp, unref } from 'vue';
import { Icon } from '/@/components/Icon';
import { getToken } from '/@/utils/auth';
import { uploadUrl, baseUploadUrl } from '/@/api/common/api';
import { propTypes } from '/@/utils/propTypes';
import { useMessage } from '/@/hooks/web/useMessage';
import { createImgPreview } from '/@/components/Preview/index';
import { useAttrs } from '/@/hooks/core/useAttrs';
import { useDesign } from '/@/hooks/web/useDesign';
import { UploadTypeEnum } from './upload.data';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import UploadItemActions from './components/UploadItemActions.vue';
import { defHttp } from '/@/utils/http/axios';
import { buildUUID } from '/@/utils/uuid';
import CryptoJS from 'crypto-js';
import { ref, reactive, computed, watch, nextTick, createApp, unref } from 'vue';
import { Icon } from '/@/components/Icon';
import { getToken } from '/@/utils/auth';
import { uploadUrl, baseUploadUrl } from '/@/api/common/api';
import { propTypes } from '/@/utils/propTypes';
import { useMessage } from '/@/hooks/web/useMessage';
import { createImgPreview } from '/@/components/Preview/index';
import { useAttrs } from '/@/hooks/core/useAttrs';
import { useDesign } from '/@/hooks/web/useDesign';
import { UploadTypeEnum } from './upload.data';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import UploadItemActions from './components/UploadItemActions.vue';
import { defHttp } from '/@/utils/http/axios';
import { buildUUID } from '/@/utils/uuid';
import CryptoJS from 'crypto-js';
import { downloadFile as ajaxDownloadFileFn } from '/@/api/common/api';
import { downloadFile as ajaxDownloadFileFn } from '/@/api/common/api';
const spinning = ref<boolean>(false);
const { createMessage, createConfirm } = useMessage();
const { prefixCls } = useDesign('j-upload');
const attrs = useAttrs();
const emit = defineEmits(['change', 'update:value']);
const props = defineProps({
const spinning = ref<boolean>(false);
const { createMessage, createConfirm } = useMessage();
const { prefixCls } = useDesign('j-upload');
const attrs = useAttrs();
const emit = defineEmits(['change', 'update:value']);
const props = defineProps({
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
text: propTypes.string.def('上传'),
fileType: propTypes.string.def(UploadTypeEnum.all),
@ -83,24 +83,24 @@
//biz
getBizParam: propTypes.object.def({}),
disabled: propTypes.bool.def(false),
});
});
const otherData = ref<Object>({});
const otherClass = ref<Object>({});
const otherData = ref<Object>({});
const otherClass = ref<Object>({});
const headers = reactive({
const headers = reactive({
'X-Access-Token': getToken(),
});
const fileList = ref<any[]>([]);
const uploadGoOn = ref<boolean>(true);
// refs
const containerRef = ref();
//
const isMaxCount = computed(() => props.maxCount > 0 && fileList.value.length >= props.maxCount);
//
const isImageMode = computed(() => props.fileType === UploadTypeEnum.image);
// props attrs
const bindProps = computed(() => {
});
const fileList = ref<any[]>([]);
const uploadGoOn = ref<boolean>(true);
// refs
const containerRef = ref();
//
const isMaxCount = computed(() => props.maxCount > 0 && fileList.value.length >= props.maxCount);
//
const isImageMode = computed(() => props.fileType === UploadTypeEnum.image);
// props attrs
const bindProps = computed(() => {
const bind: any = Object.assign({}, props, unref(attrs));
bind.name = 'file';
bind.listType = isImageMode.value ? 'picture-card' : 'text';
@ -109,7 +109,7 @@
//update-begin-author:taoyan date:20220407 for: beforeUpload return false
if (!bind.beforeUpload) {
bind.beforeUpload = onBeforeUpload;
} else if(!bind.forceBeforeUploadFn){
} else if (!bind.forceBeforeUploadFn) {
//使
bind.beforeUpload = onBeforeUpload;
}
@ -119,9 +119,9 @@
bind.accept = 'image/*';
}
return bind;
});
});
watch(
watch(
() => props.value,
(val) => {
if (Array.isArray(val)) {
@ -135,34 +135,34 @@
}
},
{ immediate: true }
);
);
watch(fileList, () => nextTick(() => addActionsListener()), { immediate: true });
watch(fileList, () => nextTick(() => addActionsListener()), { immediate: true });
const loadBizFn = (params) => defHttp.get({ url: '/ktgl/kcKetangbiao/getBizPath', params }, { isTransformResponse: false })
const loadBizFn = (params) => defHttp.get({ url: '/ktgl/kcKetangbiao/getBizPath', params }, { isTransformResponse: false });
function loadBiz(param){
function loadBiz(param) {
otherData.value.loading = true;
// otherClass.value = { 'upload-disabled': true, }
loadBizFn(param).then(res => {
loadBizFn(param).then((res) => {
//otherData.value
if(res.success){
if (res.success) {
otherData.value.biz = res.result;
}else{
} else {
delete otherData.value.biz;
}
// otherClass.value = {}
delete otherData.value.loading;
});
}
}
watch(() => props.getBizParam,
watch(
() => props.getBizParam,
(param, oldParam) => {
if(JSON.stringify(param) != JSON.stringify(oldParam)){
if (JSON.stringify(param) != JSON.stringify(oldParam)) {
nextTick(() => {
console.log(`🚀 ~ props.isGetBiz:`, props.isGetBiz, bindProps.value.disabled, loadBiz);
if(props.isGetBiz && !bindProps.value.disabled){
if (props.isGetBiz && !bindProps.value.disabled) {
//
nextTick(() => {
loadBiz(param);
@ -172,12 +172,12 @@
}
},
{ immediate: true }
);
);
const antUploadItemCls = 'ant-upload-list-item';
const antUploadItemCls = 'ant-upload-list-item';
// Listener
function addActionsListener() {
// Listener
function addActionsListener() {
if (!isImageMode.value) {
return;
}
@ -191,10 +191,10 @@
uploadItem.addEventListener('mouseover', onAddActionsButton);
}
}
}
}
//
function onAddActionsButton(event) {
//
function onAddActionsButton(event) {
const getUploadItem = () => {
for (const path of event.path) {
if (path.classList.contains(antUploadItemCls)) {
@ -226,10 +226,10 @@
actions[0].appendChild(div);
uploadItem.setAttribute('data-has-actions', 'true');
uploadItem.removeEventListener('mouseover', onAddActionsButton);
}
}
//
function parsePathsValue(paths) {
//
function parsePathsValue(paths) {
if (!paths || paths.length == 0) {
fileList.value = [];
return;
@ -246,10 +246,10 @@
});
}
fileList.value = list;
}
}
//
function parseArrayValue(array) {
//
function parseArrayValue(array) {
if (!array || array.length == 0) {
fileList.value = [];
return;
@ -266,10 +266,10 @@
});
}
fileList.value = list;
}
}
//
function onBeforeUpload(file) {
//
function onBeforeUpload(file) {
uploadGoOn.value = true;
if (isImageMode.value) {
if (file.type.indexOf('image') < 0) {
@ -279,15 +279,17 @@
}
}
//()
if(props.forceAcceptVerify){
if (props.forceAcceptVerify) {
let fileName = file?.name;
if(fileName.indexOf('.')){
let suffix = fileName.split('.')[1];
console.log('👩‍⚕️', fileName);
if (fileName.indexOf('.')) {
let suffix = fileName.split('.').pop().toLowerCase();
console.log('🤶', suffix);
let fileTypes = unref(bindProps).accept;
if(fileTypes){
if(fileTypes.indexOf(',')){
if (fileTypes) {
if (fileTypes.indexOf(',')) {
let typeList = fileTypes.split(',');
if(typeList.indexOf('.' + suffix) == -1){
if (typeList.indexOf('.' + suffix) == -1) {
createMessage.warning('请上传【*' + typeList.join(',*') + '】格式的文件');
uploadGoOn.value = false;
return false;
@ -299,13 +301,13 @@
// beforeUpload
if (typeof props.beforeUpload === 'function') {
return props.beforeUpload(file, unref(bindProps), () => uploadGoOn.value = false );
return props.beforeUpload(file, unref(bindProps), () => (uploadGoOn.value = false));
}
return true;
}
}
//
function onRemove() {
//
function onRemove() {
if (props.removeConfirm) {
return new Promise((resolve) => {
createConfirm({
@ -318,10 +320,10 @@
});
}
return true;
}
}
// uploadchange
function onFileChange(info) {
// uploadchange
function onFileChange(info) {
if (!info.file.status && uploadGoOn.value === false) {
info.fileList.pop();
}
@ -367,16 +369,16 @@
fileSize: item.size,
};
newFileList.push(fileJson);
}else{
} else {
return;
}
}
emitValue(newFileList);
}
}
}
}
function handlePathChange() {
function handlePathChange() {
let uploadFiles = fileList.value;
let path = '';
if (!uploadFiles || uploadFiles.length == 0) {
@ -394,24 +396,24 @@
path = pathList.join(',');
}
emitValue(path);
}
}
//
function onFilePreview(file) {
//
function onFilePreview(file) {
if (isImageMode.value) {
createImgPreview({ imageList: [file.url], maskClosable: true });
} else {
// window.open(file.url);
openWindowWithLoading(file.url);
}
}
}
/**
/**
* 自定义下载事件带加载中
*/
function openWindowWithLoading(url){
function openWindowWithLoading(url) {
spinning.value = true;
let fileName = url.substring(url.lastIndexOf("/")+1);
let fileName = url.substring(url.lastIndexOf('/') + 1);
let uploadAxiosHttpConfig = {
// * * 60
timeout: 60 * 60 * 1000,
@ -420,9 +422,17 @@
//
apiUrl: '',
//
isTransformResponse: false
}
ajaxDownloadFileFn(url, fileName, {}, () => { spinning.value = false; }, uploadAxiosHttpConfig);
isTransformResponse: false,
};
ajaxDownloadFileFn(
url,
fileName,
{},
() => {
spinning.value = false;
},
uploadAxiosHttpConfig
);
//spinning.value = false;
// let xhr = new XMLHttpRequest();
// xhr.open('GET',url,true);
@ -448,60 +458,60 @@
// }
// spinning.value = false;
// }
}
}
function emitValue(value) {
function emitValue(value) {
emit('change', value);
emit('update:value', value);
}
}
function uidGenerator() {
function uidGenerator() {
return '-' + parseInt(Math.random() * 10000 + 1, 10);
}
}
function getFileName(path) {
function getFileName(path) {
if (path.lastIndexOf('\\') >= 0) {
let reg = new RegExp('\\\\', 'g');
path = path.replace(reg, '/');
}
return path.substring(path.lastIndexOf('/') + 1);
}
}
// //md5
// function calculateFileMd5(file) {
// return new Promise((resolve, reject) => {
// const reader = new FileReader();
// // onload
// reader.onload = function (event) {
// const arrayBufferView = event.target.result;
// // ArrayBufferWordArray
// const wordArray = CryptoJS.lib.WordArray.create(arrayBufferView);
// // MD5
// const md5Hash = CryptoJS.MD5(wordArray).toString();
// resolve(md5Hash);
// };
// // onerror
// reader.onerror = function () {
// reject('Failed to read file');
// };
// //
// reader.readAsArrayBuffer(file);
// });
// }
// //md5
// function calculateFileMd5(file) {
// return new Promise((resolve, reject) => {
// const reader = new FileReader();
// // onload
// reader.onload = function (event) {
// const arrayBufferView = event.target.result;
// // ArrayBufferWordArray
// const wordArray = CryptoJS.lib.WordArray.create(arrayBufferView);
// // MD5
// const md5Hash = CryptoJS.MD5(wordArray).toString();
// resolve(md5Hash);
// };
// // onerror
// reader.onerror = function () {
// reject('Failed to read file');
// };
// //
// reader.readAsArrayBuffer(file);
// });
// }
/**
/**
* 计算文件md5分批次计算挺慢的支持大文件
*/
function calFileMd5(file){
function calFileMd5(file) {
return new Promise((resolve, reject) => {
let md5 = CryptoJS.algo.MD5.create();
//
let reader = new FileReader();
let step = 1024* 1024;
let step = 1024 * 1024;
let total = file.size;
let cuLoaded = 0;
let time=1;
console.info("文件大小:" + file.size);
let time = 1;
console.info('文件大小:' + file.size);
//
reader.onload = (e) => {
//console.log(""+time+"");
@ -519,11 +529,11 @@
resolve(hash + buildUUID());
}
time++;
}
};
reader.onerror = (e) => {
console.error('读取文件MD5出现错误 =>',e);
console.error('读取文件MD5出现错误 =>', e);
reject(e);
}
};
//
readBlob(0);
//
@ -533,18 +543,15 @@
reader.readAsArrayBuffer(blob);
}
});
}
}
function calFileUid(file){
function calFileUid(file) {
return new Promise((resolve, reject) => {
resolve(buildUUID());
});
}
}
//
//
// function upSearch(data){
// return new Promise((resolve,reject)=>{
// setTimeout(()=>{
@ -585,30 +592,29 @@
//limitUp([1,2,3,4,5,6,7,8], 3)
async function limitPromise(promises, limit) {
const results = [];
async function limitPromise(promises, limit) {
const results = []
for(let i=0; i<=promises.length; i+=limit) {
const tasks = []
for (let i = 0; i <= promises.length; i += limit) {
const tasks = [];
// Promise.all
for(const promise of promises.slice(i, i + limit)) {
tasks.push(promise)
for (const promise of promises.slice(i, i + limit)) {
tasks.push(promise);
}
// await
const result = await Promise.all(tasks)
results.push(...result)
const result = await Promise.all(tasks);
results.push(...result);
}
return results
}
return results;
}
// 5m
const chunkSize = 5 * 1024 * 1024;
// 5m
const chunkSize = 5 * 1024 * 1024;
const runBatchNum = 20;
const runBatchNum = 20;
const uploadAxiosHttpConfig = {
const uploadAxiosHttpConfig = {
// * * 60
timeout: 60 * 60 * 1000,
//
@ -616,62 +622,64 @@
//
apiUrl: baseUploadUrl,
//
isTransformResponse: false
}
isTransformResponse: false,
};
const defUploadFn = (params) => defHttp.post({ url: '/sys/common/upload', params }, uploadAxiosHttpConfig );
const defUploadFn = (params) => defHttp.post({ url: '/sys/common/upload', params }, uploadAxiosHttpConfig);
const bigFileUploadInit = (params) => defHttp.post({ url: '/sys/common/sectionUpload/init', params }, uploadAxiosHttpConfig );
const bigFileUploadInit = (params) => defHttp.post({ url: '/sys/common/sectionUpload/init', params }, uploadAxiosHttpConfig);
const bigFileUploadUpload = (params) => defHttp.post({ url: '/sys/common/sectionUpload/upload', params }, uploadAxiosHttpConfig );
const bigFileUploadUpload = (params) => defHttp.post({ url: '/sys/common/sectionUpload/upload', params }, uploadAxiosHttpConfig);
const bigFileUploadEnd = (params) => defHttp.post({ url: '/sys/common/sectionUpload/end', params }, uploadAxiosHttpConfig)
const bigFileUploadEnd = (params) => defHttp.post({ url: '/sys/common/sectionUpload/end', params }, uploadAxiosHttpConfig);
/**
/**
* 自定义文件上传方法小于5m的走默认上传大于5m的走切片上传
*/
function uploadFn(customRequestData){
function uploadFn(customRequestData) {
const { data, file, onProgress, onSuccess, onError } = customRequestData; // a-upload
let fileSize = file.size;
let uploadPromiseList = [];
if(fileSize <= chunkSize){
if (fileSize <= chunkSize) {
let formData = new FormData();
Object.keys(data).forEach(key => {
Object.keys(data).forEach((key) => {
formData.append(key, data[key]);
});
formData.append('file', file);
//
defUploadFn(formData).then(res => {
defUploadFn(formData)
.then((res) => {
console.log(`🚀 ~ 传统直传 - defUploadFn ~ res:`, res);
if(res.success){
onProgress({ percent: 100 }, file) //
onSuccess(res, file) //
if (res.success) {
onProgress({ percent: 100 }, file); //
onSuccess(res, file); //
} else {
onError(res, res, file);
}
}).catch(err => {
})
.catch((err) => {
console.log(`🚀 ~ 传统直传 - defUploadFn ~ err:`, err);
onError(err, err, file);
});
} else {
//
const chunkCount = Math.ceil(fileSize / chunkSize);
console.log("文件大小:",(file.size / 1024 / 1024) + "Mb","分片数:",chunkCount);
console.log('文件大小:', file.size / 1024 / 1024 + 'Mb', '分片数:', chunkCount);
//md5
console.log('第一步计算文件的md5',calFileMd5, file);
calFileMd5(file).then(fileMd5 => {
console.log('第一步计算文件的md5', calFileMd5, file);
calFileMd5(file).then((fileMd5) => {
console.log(`🚀 ~ 文件的md5是:`, fileMd5);
const initUploadParams = { chunkCount, fileMd5 , ...data, };
const initUploadParams = { chunkCount, fileMd5, ...data };
let successNum = 0;
let taskAllList = [];
//
console.log('第二步根据md5创建文件夹', initUploadParams);
bigFileUploadInit(initUploadParams).then(res => {
bigFileUploadInit(initUploadParams).then((res) => {
console.log('第三步,准备切片文件', res);
if(res.success){
if (res.success) {
onProgress({ percent: 0 }, file); //
//
for (let i = 1; i <= chunkCount; i++) {
@ -679,94 +687,96 @@
partNumber: i,
...initUploadParams,
file: null,
}
};
//
let start = (i - 1) * chunkSize
let start = (i - 1) * chunkSize;
//
let end = Math.min(fileSize, start + chunkSize)
let end = Math.min(fileSize, start + chunkSize);
//byte
let _chunkFile = file.slice(start, end)
console.log("第四步,开始准备文件第" + i + "个分片" + ",切片范围从" + start + "到" + end)
let _chunkFile = file.slice(start, end);
console.log('第四步,开始准备文件第' + i + '个分片' + ',切片范围从' + start + '到' + end);
uploadParams.file = _chunkFile;
let uploadFormData = new FormData();
Object.keys(uploadParams).forEach(key => {
Object.keys(uploadParams).forEach((key) => {
uploadFormData.append(key, uploadParams[key]);
});
console.log('第五步,准备切片文件上传参数', uploadFormData);
taskAllList.push(new Promise((resolve, reject) => {
taskAllList.push(
new Promise((resolve, reject) => {
console.log('第六步,准备切片文件上传前,', uploadFormData);
bigFileUploadUpload(uploadFormData).then(res => {
bigFileUploadUpload(uploadFormData)
.then((res) => {
console.log('第七步,切片文件上传后,', uploadFormData, res);
if(res.success) {
if (res.success) {
successNum++;
let percent = Number(Number(successNum/chunkCount*100).toFixed(0))
onProgress({ percent }, file) //
let percent = Number(Number((successNum / chunkCount) * 100).toFixed(0));
onProgress({ percent }, file); //
resolve(res);
}else{
} else {
reject(res);
}
}).catch(err => {
reject(err)
})
.catch((err) => {
reject(err);
});
}));
})
);
}
//,20
console.log('第八步,全部切片,根据指定线程数执行,', limitPromise, taskAllList);
limitPromise(taskAllList, runBatchNum).then(resList => {
limitPromise(taskAllList, runBatchNum)
.then((resList) => {
console.log('第九步,全部切片,根据指定线程数执行完成后的结果,', resList);
//
let endUploadParams = {
...initUploadParams,
fileName: file.name,
}
};
console.log('第十步,全部切片,发生合并指令,', endUploadParams);
bigFileUploadEnd(endUploadParams).then(res => {
bigFileUploadEnd(endUploadParams)
.then((res) => {
console.log(`第十一步 ~ 合并返回值 defHttp.post ~ res:`, res);
//
if(res.success){
onProgress({ percent: 100 }, file) //
onSuccess(res, file) //
if (res.success) {
onProgress({ percent: 100 }, file); //
onSuccess(res, file); //
} else {
onError(res, res, file);
}
}).catch(err => {
})
.catch((err) => {
console.error(`🚀 ~ 合并出现错误! defHttp.post ~ err:`, err);
onError(err, err, file);
});
})
}).catch(err => {
.catch((err) => {
console.error(`🚀 ~ 全部完成后其中有错误limitPromise ~ err:`, err);
//
onError(err, err, file);
});
}
//return
})
})
});
});
}
// Promise.all(uploadPromiseList).then(resList => {
// });
}
}
defineExpose({
defineExpose({
addActionsListener,
});
});
</script>
<style lang="less">
//noinspection LessUnresolvedVariable
@prefix-cls: ~'@{namespace}-j-upload';
//noinspection LessUnresolvedVariable
@prefix-cls: ~'@{namespace}-j-upload';
.@{prefix-cls} {
.@{prefix-cls} {
&-container {
position: relative;
@ -834,14 +844,14 @@
}
}
}
}
}
.example {
.example {
text-align: center;
background: rgba(0, 0, 0, 0);
border-radius: 4px;
position: absolute;
left: 50%;
top: 50%;
}
}
</style>

View File

@ -6,7 +6,7 @@
<a-tabs v-model:activeKey="activeKey" style="padding: 10px">
<a-tab-pane key="1" tab="未读">
<div style="width: 100%; text-align: right; ">
<RouterLink target='_blank' to="/site/teacherYiyueMore">查看更多</RouterLink>
<RouterLink target='_blank' to="/site/teacherWeiduMore">查看更多</RouterLink>
</div>
<div style="min-height: 70px">
<a-row>

View File

@ -8,7 +8,7 @@
<a-layout-content>
<a-card class="rowGutter" id="jcgkkDom">
<template #title>
<div style="font-size: 24px; font-weight: bold">读信息</div>
<div style="font-size: 24px; font-weight: bold">读信息</div>
</template>
<a-row :gutter="[16, 16]" style="margin-top: 20px">
<a-col v-for="(item, index) in listData" :key="index" :span="24">
@ -17,7 +17,7 @@
<div style="margin-top: 5px">{{ index + 1 }}{{ item.content }}</div>
</a-col>
<a-col :span="2" style="text-align: right">
<a-button type="primary" @click="openKecheng(item)" style="margin-left: 10px">已读</a-button>
<a-button type="primary" @click="openKecheng(item)" style="margin-left: 10px">查看</a-button>
</a-col>
</a-row>
</a-col>

View File

@ -380,7 +380,7 @@ import { Input, Popover, Pagination, Empty, Affix as aAffix } from 'ant-design-v
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { useRouter } from 'vue-router';
import { randomString, simpleDebounce, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { randomString, simpleDebounce, getFileAccessHttpUrl, baseApiUrl } from '/@/utils/common/compUtils';
import { useFileList } from '/@/components/jeecg/comment/useComment';
import draggable from 'vuedraggable';
@ -391,6 +391,11 @@ import stuIndex from './stuIndex.vue';
import { downloadFile as ajaxDownloadFileFn } from '/@/api/common/api';
import zykYylistPage from '/@/views/zyk/ZykInfoYinyongModal.vue';
import Base64 from 'crypto-js/enc-base64';
import { dataURLtoBlob, urlToBase64 } from '/@/utils/file/base64Conver';
import UTF8 from 'crypto-js/enc-utf8';
import { encryptByBase64 } from '/@/utils/cipher';
const spinning = ref<boolean>(false);
//
const { currentRoute } = useRouter();
@ -416,6 +421,8 @@ const videoOpen = ref<boolean>(false);
const controls = ref(true);
const autoplay = ref(false);
const loop = ref(false);
// domain
let onlinePreviewDomain = '';
const playVideoInFullscreen = async () => {
console.log('💋', videoPlayer);
@ -472,7 +479,7 @@ enum Api {
delThree = '/teachingunitcontent/kcTeachingUnitContentThree/delete',
}
function handleView(urlPath){
function handleView(urlPath) {
// var url = 'http://127.0.0.1:8080/file/test.txt'; //访
// window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(base64Encode(url)));
}
@ -801,20 +808,47 @@ function editThreePage(two, three, threeIndex) {
threePageData.value = { two, three, threeIndex };
}
function viewThreePage(three) {
async function viewThreePage(three) {
console.log('🙇‍♂️', three);
if (three.value.type == 'video') {
if (three.type == 'video') {
handleVideo(three);
} else if (three.value.type == 'document') {
} else if (three.type == 'document') {
// var file = 'https://kczxcs.nenu.edu.cn/jeecg-boot/temp/0731_1722673666833.docx';
// var file = baseApiUrl + "/"+three.filePath;
// console.log('🤬', file);
// let url = getFileAccessHttpUrl(encodeURIComponent(file));
// var t2 = encryptByBase64(url);
// window.open('https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(t2));
} else if (three.value.type == 'richText') {
// var file = 'https://kczxcs.nenu.edu.cn/jeecg-boot/temp/ylhpsf.pdf';
var file = baseApiUrl + "/"+three.filePath;
console.log('🤬', file);
// let url = getFileAccessHttpUrl(encodeURIComponent(file));
// var t2 = encryptByBase64(url);
window.open('https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file)));
} else if (three.type == 'richText') {
threePageOpen.value = true;
threePageDisableSubmit.value = true;
threePageData.value = { three };
}
}
const getViewFileDomain = () => defHttp.get({ url: '/sys/comment/getFileViewDomain' });
/**
* 初始化domain
*/
async function initViewDomain() {
if (!onlinePreviewDomain) {
onlinePreviewDomain = await getViewFileDomain();
}
if (!onlinePreviewDomain.startsWith('http')) {
onlinePreviewDomain = 'http://' + onlinePreviewDomain;
}
}
function delThree(e, two, three) {
stop(e);
delThreeFetch({ id: three.id }).then((res) => {

View File

@ -213,12 +213,13 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { useRouter } from 'vue-router';
import { randomString, simpleDebounce, getFileAccessHttpUrl } from '/@/utils/common/compUtils'
import { randomString, simpleDebounce, getFileAccessHttpUrl, baseApiUrl } from '/@/utils/common/compUtils'
import draggable from 'vuedraggable';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
import downloadAssembly from '/@/views/zy/jiaoXueDanYuanNeiRong/downloadAssembly.vue';
import { encryptByBase64 } from '/@/utils/cipher';
//
const { currentRoute } = useRouter();
@ -550,11 +551,19 @@ function handleVideo(three){
}
function viewThreePage(three) {
if (three.type == 'video') {
handleVideo(three);
} else if (three.type == 'document') {
var file = baseApiUrl + "/"+three.filePath;
window.open('https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file)));
} else if (three.type == 'richText') {
threePageOpen.value = true;
threePageDisableSubmit.value = true;
threePageData.value = { three };
}
}
function threePageHandleOk(){
threePageOpen.value = false;
}

View File

@ -35,7 +35,7 @@
<a-col :span="24" class="zyCon">
<span style="text-align: left;width:50%;display: block;float:left;">作业得分{{ item.stuscore ? item.stuscore : '未评' }}</span>
<span style="text-align: right;width:50%;display: block;float:left;" class="wpopen" v-if="handleSfkshp(item)" @click="handleHpfs(item)">互评分数:{{ item.xshpfs ? item.xshpfs : '未评' }}</span>
<span style="text-align: left;width:50%;display: block;float:left;" v-if="handleSfkshp(item)">绩效分数{{ item.jxfs ? item.jxfs : '未评' }}</span>
<span style="text-align: left;width:50%;display: block;float:left;" v-if="handleSfkshp(item)">互评奖励{{ item.jxfs ? item.jxfs : '未评' }}</span>
<span style="text-align: right;width:50%;display: block;float:left;">总分:{{ item.zzdf ? item.zzdf : '未评' }}</span>
</a-col>
<a-col :span="24" class="zyCon">

View File

@ -113,7 +113,8 @@ d<template>
<a-form-item label="作业要求" v-bind="validateInfos.content">
<j-editor v-model:value="zyInfo.content" v-if="zyyqShow" @blur="handleZyyqShow(0)" />
<div style="color: #777777" v-html="zyInfo.content" v-if="!zyyqShow"></div>
<div @click="handleZyyqShow(1)"><span style="cursor: pointer; color: #18a689">温馨提示点击可编辑作业要求</span></div>
<div @click="handleZyyqShow(1)" class="tishi" v-if="zyInfo.xshpkg == '1'">温馨提示点击可编辑作业要求</div>
<!-- <div @click="handleZyyqShow(1)"><span style="cursor: pointer; color: #18a689">温馨提示点击可编辑作业要求</span></div> -->
</a-form-item>
</a-col>
<a-col :span="24">
@ -143,6 +144,7 @@ d<template>
<a-col :span="24">
<div class="region">
<div class="region-title">学生互评</div>
<div style="float:right;margin-right:8px;" v-if="zyInfo.xshpkg == '1'"><span style="color:#18a689; cursor: pointer;" @click="handleHpsf">预览互评算法</span></div>
<a-form-item label="学生互评">
<div class="tishi" v-if="zyInfo.xshpkg == '1'">温馨提示每份作业至少互评3次每个学生互评5份作业</div>
<j-dict-select-tag
@ -183,7 +185,7 @@ d<template>
style="margin-top: 15px"
/> -->
</a-form-item>
<a-form-item label="互评开始时间" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<a-form-item label="互评开始时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-date-picker
placeholder="请选择互评开始时间"
v-model:value="zyInfo.xshpkssj"
@ -194,7 +196,7 @@ d<template>
style="width: 100%"
/>
</a-form-item>
<a-form-item label="互评结束时间" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<a-form-item label="互评结束时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-date-picker
placeholder="请选择互评结束时间"
v-model:value="zyInfo.xshpjssj"
@ -249,7 +251,7 @@ d<template>
</a-form-item>
</div>
</a-col>
<a-col :span="24" style="text-align: left; margin-top: 10px; margin-bottom: 40px; margin-left: 140px">
<a-col :span="24" style="text-align: center; margin-top: 10px; margin-bottom: 40px; ">
<a-button type="primary" @click="submitForm">保存</a-button>
<a-button type="primary" @click="reloadZy" style="margin-left: 15px">返回</a-button>
</a-col>
@ -1154,7 +1156,7 @@ const columnsCcjg = [
},
},
{
title: '查重率',
title: '查重率%',
dataIndex: 'percentage',
key: 'percentage',
},

View File

@ -94,7 +94,7 @@ export const newcolumns: BasicColumn[] = [
slots: { customRender: 'xshpfsaction' },
},
{
title: '绩效分',
title: '互评奖励',
align: "center",
dataIndex: 'jxzf',
},

View File

@ -1,6 +1,11 @@
<template>
<div style="background: #fff; margin: 10px 0;padding:10px;">
<div style="text-align: right;width:100%;"><a-button type="primary" @click="handleback">返回</a-button></div>
<div style="width:100%;">
<a-row>
<a-col :span="12" style="text-align: left;"><span style="color:#18a689; cursor: pointer;" @click="handleHpsf">预览互评算法</span></a-col>
<a-col :span="12" style="text-align: right;"><a-button type="primary" @click="handleback">返回</a-button></a-col>
</a-row>
</div>
<a-tabs v-model:activeKey="activeKey" @change="handleChange">
<a-tab-pane key="1" tab="待互评">
<ZyInfoStudentHpList ref="dhpPage"/>
@ -20,9 +25,12 @@ import { ref, reactive, onMounted, unref } from 'vue';
import ZyInfoStudentHpList from '/@/views/zy/zyInfoStudentHp/ZyInfoStudentHpList.vue'
import ZyInfoStudentHpYpyList from '/@/views/zy/zyInfoStudentHp/ZyInfoStudentHpYpyList.vue'
import ZyInfoStudentHpMyhpfsList from '/@/views/zy/zyInfoStudentHp/ZyInfoStudentHpMyhpfsList.vue'
import { useGlobSetting } from '/@/hooks/setting';
import { useRouter } from 'vue-router';
import { defHttp } from '/@/utils/http/axios';
const globSetting = useGlobSetting();
const baseApiUrl = globSetting.domainUrl;
var activeKey = ref('1');
const dhpPage = ref();
const yhpPage = ref();
@ -42,6 +50,14 @@ function handleChange(record) {
wdhpPage.value.reload();
}
}
//
function handleHpsf(){
// openByUrl({url:'/downPath/ylhpsf.pdf',target: '_blank',fileName:'.pdf'})
// window.open(pdfUrl.value, '_blank');
// window.open(require('../../../downPath/ylhpsf.pdf'), '_blank');
window.open(baseApiUrl+'/temp/ylhpsf.pdf');
}
function handleback(){
var href = "/stuzy/studentDqzy";
router.push({path:href,query: {rwbh,xqxn,type,teano}});