|
@@ -22,12 +22,12 @@
|
|
|
@change="changeCollegeMajor"
|
|
@change="changeCollegeMajor"
|
|
|
/>
|
|
/>
|
|
|
<a-select
|
|
<a-select
|
|
|
- v-model:value="formState.courseTypeName"
|
|
|
|
|
|
|
+ v-model:value="formState.resourceTypeName"
|
|
|
style="width: 200px; margin-left: 8px"
|
|
style="width: 200px; margin-left: 8px"
|
|
|
:options="courseTypeOptions"
|
|
:options="courseTypeOptions"
|
|
|
placeholder="请选择资源类型"
|
|
placeholder="请选择资源类型"
|
|
|
/>
|
|
/>
|
|
|
- <a-select v-model:value="formState.suffix" placeholder="课件格式" style="width: 200px; margin-left: 8px">
|
|
|
|
|
|
|
+ <a-select v-model:value="formState.suffix" placeholder="请选择资源格式" style="width: 200px; margin-left: 8px">
|
|
|
<a-select-option value="mp4">mp4</a-select-option>
|
|
<a-select-option value="mp4">mp4</a-select-option>
|
|
|
<a-select-option value="ppt">ppt</a-select-option>
|
|
<a-select-option value="ppt">ppt</a-select-option>
|
|
|
<a-select-option value="word">word</a-select-option>
|
|
<a-select-option value="word">word</a-select-option>
|
|
@@ -69,7 +69,7 @@
|
|
|
<template #bodyCell="{ column, text, record }">
|
|
<template #bodyCell="{ column, text, record }">
|
|
|
<template
|
|
<template
|
|
|
v-if="
|
|
v-if="
|
|
|
- ['fileName', 'collegeIdName', 'majorIdName', 'courseTypeName', 'suffix', 'uploadTime'].includes(
|
|
|
|
|
|
|
+ ['fileName', 'collegeIdName', 'majorIdName', 'resourceTypeName', 'suffix', 'uploadTime'].includes(
|
|
|
column.dataIndex
|
|
column.dataIndex
|
|
|
)
|
|
)
|
|
|
"
|
|
"
|
|
@@ -94,6 +94,15 @@
|
|
|
<a-badge status="error" text="已删除" />
|
|
<a-badge status="error" text="已删除" />
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template v-if="column.dataIndex === 'fileUrl'">
|
|
|
|
|
+ <!-- 动态图标 + 格式提示 -->
|
|
|
|
|
+ <a-tooltip :title="`${record.suffix || '未知'}`">
|
|
|
|
|
+ <component
|
|
|
|
|
+ :is="fileTypeIcons[record.suffix?.toLowerCase()] || fileTypeIcons['*']"
|
|
|
|
|
+ :style="{ fontSize: '24px', color: getIconColor(record.suffix) }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </a-tooltip>
|
|
|
|
|
+ </template>
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-else-if="column.key === 'action'">
|
|
<template v-else-if="column.key === 'action'">
|
|
|
<div class="editable-cell">
|
|
<div class="editable-cell">
|
|
@@ -115,7 +124,15 @@
|
|
|
<a href="javascript:;" @click="handleView(record)">播放</a>
|
|
<a href="javascript:;" @click="handleView(record)">播放</a>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
<a-menu-item>
|
|
<a-menu-item>
|
|
|
- <a href="javascript:;">下载</a>
|
|
|
|
|
|
|
+ <!-- <a href="javascript:;">下载</a> -->
|
|
|
|
|
+ <a
|
|
|
|
|
+ target="_blank"
|
|
|
|
|
+ style="display: block; color: inherit"
|
|
|
|
|
+ :href="$file.getDownloadFilePath3(record)"
|
|
|
|
|
+ :download="record.fileName"
|
|
|
|
|
+ >
|
|
|
|
|
+ 下载
|
|
|
|
|
+ </a>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
<a-menu-item v-if="formState.verifyStatus === '2'">
|
|
<a-menu-item v-if="formState.verifyStatus === '2'">
|
|
|
<a href="javascript:;" @click="edit(record)">编辑</a>
|
|
<a href="javascript:;" @click="edit(record)">编辑</a>
|
|
@@ -169,7 +186,7 @@
|
|
|
@getList="getList"
|
|
@getList="getList"
|
|
|
></resourceUpload>
|
|
></resourceUpload>
|
|
|
<!-- 发布模态框 -->
|
|
<!-- 发布模态框 -->
|
|
|
- <releaseModal v-if="releaseVisible" @close="releaseVisible = false" @confirm="confirm"></releaseModal>
|
|
|
|
|
|
|
+ <releaseModal v-if="releaseVisible" @close="releaseVisible = false" @confirm="releaseConfirm"></releaseModal>
|
|
|
</a-card>
|
|
</a-card>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -183,6 +200,17 @@
|
|
|
import auditModal from './auditModal.vue'
|
|
import auditModal from './auditModal.vue'
|
|
|
import CustomPagination from '@/components/customPagination.vue'
|
|
import CustomPagination from '@/components/customPagination.vue'
|
|
|
import tool from '@/utils/tool'
|
|
import tool from '@/utils/tool'
|
|
|
|
|
+ import {
|
|
|
|
|
+ FileOutlined,
|
|
|
|
|
+ FileImageOutlined,
|
|
|
|
|
+ FilePdfOutlined,
|
|
|
|
|
+ FileWordOutlined,
|
|
|
|
|
+ FileExcelOutlined,
|
|
|
|
|
+ FilePptOutlined,
|
|
|
|
|
+ FileTextOutlined,
|
|
|
|
|
+ FileZipOutlined,
|
|
|
|
|
+ PlaySquareOutlined
|
|
|
|
|
+ } from '@ant-design/icons-vue'
|
|
|
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
|
const { pageType } = defineProps({
|
|
const { pageType } = defineProps({
|
|
|
pageType: {
|
|
pageType: {
|
|
@@ -190,6 +218,34 @@
|
|
|
default: () => {}
|
|
default: () => {}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ const fileTypeIcons = {
|
|
|
|
|
+ // 图片类
|
|
|
|
|
+ jpg: 'FileImageOutlined',
|
|
|
|
|
+ jpeg: 'FileImageOutlined',
|
|
|
|
|
+ png: 'FileImageOutlined',
|
|
|
|
|
+ gif: 'FileImageOutlined',
|
|
|
|
|
+
|
|
|
|
|
+ // 文档类
|
|
|
|
|
+ pdf: 'FilePdfOutlined',
|
|
|
|
|
+ ppt: 'FilePptOutlined',
|
|
|
|
|
+ pptx: 'FilePptOutlined',
|
|
|
|
|
+ doc: 'FileWordOutlined',
|
|
|
|
|
+ docx: 'FileWordOutlined',
|
|
|
|
|
+ xls: 'FileExcelOutlined',
|
|
|
|
|
+ xlsx: 'FileExcelOutlined',
|
|
|
|
|
+ txt: 'FileTextOutlined',
|
|
|
|
|
+
|
|
|
|
|
+ // 视频类
|
|
|
|
|
+ mp4: 'PlaySquareOutlined',
|
|
|
|
|
+ mov: 'PlaySquareOutlined',
|
|
|
|
|
+
|
|
|
|
|
+ // 压缩包
|
|
|
|
|
+ zip: 'FileZipOutlined',
|
|
|
|
|
+ rar: 'FileZipOutlined',
|
|
|
|
|
+
|
|
|
|
|
+ // 默认图标
|
|
|
|
|
+ '*': 'FileOutlined'
|
|
|
|
|
+ }
|
|
|
// 数据源
|
|
// 数据源
|
|
|
const dataSource = ref([])
|
|
const dataSource = ref([])
|
|
|
//发布按钮状态
|
|
//发布按钮状态
|
|
@@ -215,7 +271,7 @@
|
|
|
verifyStatus: '0',
|
|
verifyStatus: '0',
|
|
|
resourcesId: null,
|
|
resourcesId: null,
|
|
|
majorIdName: null,
|
|
majorIdName: null,
|
|
|
- courseTypeName: null,
|
|
|
|
|
|
|
+ resourceTypeName: null,
|
|
|
suffix: null
|
|
suffix: null
|
|
|
})
|
|
})
|
|
|
// 添加选择状态
|
|
// 添加选择状态
|
|
@@ -282,14 +338,15 @@
|
|
|
key: 'verifyStatus'
|
|
key: 'verifyStatus'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: '操作',
|
|
|
|
|
|
|
+ title: '资源缩略图',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- key: 'action'
|
|
|
|
|
|
|
+ dataIndex: 'fileUrl',
|
|
|
|
|
+ key: 'fileUrl'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: '资源缩略图',
|
|
|
|
|
|
|
+ title: '操作',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- key: 'image'
|
|
|
|
|
|
|
+ key: 'action'
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
|
|
|
|
@@ -327,8 +384,8 @@
|
|
|
{
|
|
{
|
|
|
title: '资源类型',
|
|
title: '资源类型',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- dataIndex: 'courseTypeName',
|
|
|
|
|
- key: 'courseTypeName'
|
|
|
|
|
|
|
+ dataIndex: 'resourceTypeName',
|
|
|
|
|
+ key: 'resourceTypeName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '资源格式',
|
|
title: '资源格式',
|
|
@@ -348,14 +405,15 @@
|
|
|
key: 'verifyStatus'
|
|
key: 'verifyStatus'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: '操作',
|
|
|
|
|
|
|
+ title: '资源缩略图',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- key: 'action'
|
|
|
|
|
|
|
+ dataIndex: 'fileUrl',
|
|
|
|
|
+ key: 'fileUrl'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: '资源缩略图',
|
|
|
|
|
|
|
+ title: '操作',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- key: 'image'
|
|
|
|
|
|
|
+ key: 'action'
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
|
|
|
|
@@ -378,6 +436,15 @@
|
|
|
return []
|
|
return []
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ const getIconColor = (suffix) => {
|
|
|
|
|
+ const type = suffix?.toLowerCase()
|
|
|
|
|
+ if (['jpg', 'jpeg', 'png', 'gif'].includes(type)) return '#ff4d4f' // 图片红色
|
|
|
|
|
+ if (['pdf'].includes(type)) return '#f5222d' // PDF红色
|
|
|
|
|
+ if (['ppt', 'pptx'].includes(type)) return '#fa8c16' // PPT橙色
|
|
|
|
|
+ if (['doc', 'docx'].includes(type)) return '#1890ff' // Word蓝色
|
|
|
|
|
+ if (['xls', 'xlsx'].includes(type)) return '#52c41a' // Excel绿色
|
|
|
|
|
+ return '#666' // 默认灰色
|
|
|
|
|
+ }
|
|
|
const getListData = () => {
|
|
const getListData = () => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
let params = {
|
|
let params = {
|
|
@@ -386,7 +453,7 @@
|
|
|
verifyStatus: formState.verifyStatus,
|
|
verifyStatus: formState.verifyStatus,
|
|
|
fileName: formState.fileName,
|
|
fileName: formState.fileName,
|
|
|
majorIdName: formState.majorIdName?.join(','),
|
|
majorIdName: formState.majorIdName?.join(','),
|
|
|
- courseTypeName: formState.courseTypeName,
|
|
|
|
|
|
|
+ resourceTypeName: formState.resourceTypeName,
|
|
|
suffix: formState.suffix
|
|
suffix: formState.suffix
|
|
|
}
|
|
}
|
|
|
resourceAuditApi
|
|
resourceAuditApi
|
|
@@ -406,6 +473,7 @@
|
|
|
}
|
|
}
|
|
|
const getList = () => {
|
|
const getList = () => {
|
|
|
getListData()
|
|
getListData()
|
|
|
|
|
+ uploadModalVisible.value = false
|
|
|
}
|
|
}
|
|
|
//院系组织查询
|
|
//院系组织查询
|
|
|
const getOrgTreeSelector = () => {
|
|
const getOrgTreeSelector = () => {
|
|
@@ -429,7 +497,7 @@
|
|
|
searchValue.value = null
|
|
searchValue.value = null
|
|
|
formState.majorIdName = null
|
|
formState.majorIdName = null
|
|
|
formState.fileName = null
|
|
formState.fileName = null
|
|
|
- formState.courseTypeName = null
|
|
|
|
|
|
|
+ formState.resourceTypeName = null
|
|
|
formState.suffix = null
|
|
formState.suffix = null
|
|
|
getListData()
|
|
getListData()
|
|
|
}
|
|
}
|
|
@@ -467,7 +535,7 @@
|
|
|
selectedRows.value = dataSource.value.filter((item) => newSelectedKeys.includes(item.id))
|
|
selectedRows.value = dataSource.value.filter((item) => newSelectedKeys.includes(item.id))
|
|
|
}
|
|
}
|
|
|
//发布确定
|
|
//发布确定
|
|
|
- const confirm = (obj) => {
|
|
|
|
|
|
|
+ const releaseConfirm = (obj) => {
|
|
|
console.log(obj, selectedRows.value, '传回来的数据')
|
|
console.log(obj, selectedRows.value, '传回来的数据')
|
|
|
releaseVisible.value = false
|
|
releaseVisible.value = false
|
|
|
if (isPublishBulk.value) {
|
|
if (isPublishBulk.value) {
|
|
@@ -550,7 +618,7 @@
|
|
|
const handleRestore = (record) => {
|
|
const handleRestore = (record) => {
|
|
|
const params = {
|
|
const params = {
|
|
|
ids: record.id,
|
|
ids: record.id,
|
|
|
- verifyStatus: 1
|
|
|
|
|
|
|
+ verifyStatus: 0
|
|
|
}
|
|
}
|
|
|
resourceAuditApi
|
|
resourceAuditApi
|
|
|
.updateStatus(params)
|
|
.updateStatus(params)
|
|
@@ -593,9 +661,6 @@
|
|
|
console.error(err)
|
|
console.error(err)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 上传资源模态框
|
|
// 上传资源模态框
|