提交 13b7cbf6 authored 作者: matian's avatar matian

资源类型增加zip

上级 bc2fb40c
...@@ -8,7 +8,7 @@ const props: any = defineProps<{ ...@@ -8,7 +8,7 @@ const props: any = defineProps<{
tabIndex: string tabIndex: string
}>() }>()
const fileType = ['doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'mp3', 'mp4', 'png', 'jpeg', 'jpg', 'rar'] const fileType = ['doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'mp3', 'mp4', 'png', 'jpeg', 'jpg', 'rar', 'zip']
const bytesToSize = (bytes: number) => { const bytesToSize = (bytes: number) => {
if (bytes === 0) return '0 B' if (bytes === 0) return '0 B'
...@@ -31,7 +31,7 @@ const bytesToSize = (bytes: number) => { ...@@ -31,7 +31,7 @@ const bytesToSize = (bytes: number) => {
<div class="info">学习人次:{{ props.data.learn_count }}人次</div> <div class="info">学习人次:{{ props.data.learn_count }}人次</div>
</div> </div>
<img <img
:src="`https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/${props.data.type}.png`" :src="`https://webapp-pub.ezijing.com/center_resource/${props.data.type}.png`"
v-if="fileType.includes(props.data.type)" v-if="fileType.includes(props.data.type)"
/> />
<el-icon class="item-info-icon" v-else> <el-icon class="item-info-icon" v-else>
......
...@@ -179,45 +179,48 @@ const handleDrop = (startNode: any, endNode: any, position: any) => { ...@@ -179,45 +179,48 @@ const handleDrop = (startNode: any, endNode: any, position: any) => {
const imgUrl = (node: any) => { const imgUrl = (node: any) => {
if (node.data.resource_type === '1') { if (node.data.resource_type === '1') {
// 章节 // 章节
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/chapter_img.png' return 'https://webapp-pub.ezijing.com/center_resource/chapter_img.png'
} else if (node.data.resource_type === '2') { } else if (node.data.resource_type === '2') {
// 视频 // 视频
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/mp4_img.png' return 'https://webapp-pub.ezijing.com/center_resource/mp4_img.png'
} else if (node.data.resource_type === '3') { } else if (node.data.resource_type === '3') {
// 作业 // 作业
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/homework.png' return 'https://webapp-pub.ezijing.com/center_resource/homework.png'
} else if (node.data.resource_type === '4' || node.data.resource_type === '10' || node.data.resource_type === '11') { } else if (node.data.resource_type === '4' || node.data.resource_type === '10' || node.data.resource_type === '11') {
if (node.data.resource?.url.includes('pptx') || node.data.resource?.url.includes('ppt')) { if (node.data.resource?.url.includes('pptx') || node.data.resource?.url.includes('ppt')) {
// 其他资源 // 其他资源
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/pptx_img.png' return 'https://webapp-pub.ezijing.com/center_resource/pptx_img.png'
} else if (node.data.resource?.url.includes('rar')) { } else if (node.data.resource?.url.includes('rar')) {
// 其他资源 // 其他资源
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/rar_img.png' return 'https://webapp-pub.ezijing.com/center_resource/rar_img.png'
} else if (node.data.resource?.url.includes('zip')) {
// 其他资源
return 'https://webapp-pub.ezijing.com/center_resource/zip_img.png'
} else if (node.data.resource?.url.includes('mp3')) { } else if (node.data.resource?.url.includes('mp3')) {
// 其他资源 // 其他资源
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/mp3_img.png' return 'https://webapp-pub.ezijing.com/center_resource/mp3_img.png'
} else if (node.data.resource?.url.includes('mp4')) { } else if (node.data.resource?.url.includes('mp4')) {
// 其他资源 // 其他资源
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/mp4_img.png' return 'https://webapp-pub.ezijing.com/center_resource/mp4_img.png'
} else if (node.data.resource?.url.includes('docx') || node.data.resource?.url.includes('doc')) { } else if (node.data.resource?.url.includes('docx') || node.data.resource?.url.includes('doc')) {
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/docx_img.png' return 'https://webapp-pub.ezijing.com/center_resource/docx_img.png'
} else if (node.data.resource?.url.includes('xls') || node.data.resource?.url.includes('xlsx')) { } else if (node.data.resource?.url.includes('xls') || node.data.resource?.url.includes('xlsx')) {
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/xls_img.png' return 'https://webapp-pub.ezijing.com/center_resource/xls_img.png'
} else if ( } else if (
node.data.resource?.url.includes('png') || node.data.resource?.url.includes('png') ||
node.data.resource?.url.includes('jpeg') || node.data.resource?.url.includes('jpeg') ||
node.data.resource?.url.includes('jpg') node.data.resource?.url.includes('jpg')
) { ) {
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/jpg_img.png' return 'https://webapp-pub.ezijing.com/center_resource/jpg_img.png'
} else if (node.data.resource?.url.includes('pdf')) { } else if (node.data.resource?.url.includes('pdf')) {
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/pdf_img.png' return 'https://webapp-pub.ezijing.com/center_resource/pdf_img.png'
} }
} else if (node.data.resource_type === '6') { } else if (node.data.resource_type === '6') {
// 直播 // 直播
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/live_img.png' return 'https://webapp-pub.ezijing.com/center_resource/live_img.png'
} else if (node.data.resource_type === '9') { } else if (node.data.resource_type === '9') {
// 考试 // 考试
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/test_img.png' return 'https://webapp-pub.ezijing.com/center_resource/test_img.png'
} }
} }
const nodeType = (node: any) => { const nodeType = (node: any) => {
...@@ -245,6 +248,7 @@ const nodeType = (node: any) => { ...@@ -245,6 +248,7 @@ const nodeType = (node: any) => {
} }
const handleNodeExpand = (data: any) => { const handleNodeExpand = (data: any) => {
defaultExpandedKeys.value = [data.id] defaultExpandedKeys.value = [data.id]
console.log(defaultExpandedKeys.value)
} }
const handleNodeCollapse = () => { const handleNodeCollapse = () => {
defaultExpandedKeys.value = [] defaultExpandedKeys.value = []
......
...@@ -154,7 +154,7 @@ const changeProtocol = (data: any) => { ...@@ -154,7 +154,7 @@ const changeProtocol = (data: any) => {
<div class="upload-video"> <div class="upload-video">
<div class="upload-box"> <div class="upload-box">
<AppUpload <AppUpload
accept=".doc,.docx,.xls,.xlsx,.pdf,.ppt,.pptx,.mp3,.mp4,.png,.jpeg,.jpg,.rar" accept=".doc,.docx,.xls,.xlsx,.pdf,.ppt,.pptx,.mp3,.mp4,.png,.jpeg,.jpg,.rar,.zip"
:limit="1" :limit="1"
v-model="form.file" v-model="form.file"
></AppUpload> ></AppUpload>
...@@ -162,7 +162,7 @@ const changeProtocol = (data: any) => { ...@@ -162,7 +162,7 @@ const changeProtocol = (data: any) => {
</div> </div>
</div> </div>
<div class="tips"> <div class="tips">
文件支持格式包含:doc docx xls xlsx pdf ppt pptx mp3 mp4 png jpeg jpg rar,大小不超过200M 文件支持格式包含:doc docx xls xlsx pdf ppt pptx mp3 mp4 png jpeg jpg rar zip,大小不超过200M
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论