|
@@ -1,11 +1,11 @@
|
|
|
<template>
|
|
<template>
|
|
|
<a-card>
|
|
<a-card>
|
|
|
<!-- 标签页 -->
|
|
<!-- 标签页 -->
|
|
|
- <a-tabs v-model:activeKey="activeKey" @change="tabChange">
|
|
|
|
|
- <a-tab-pane key="unpublished" tab="未发布"></a-tab-pane>
|
|
|
|
|
- <a-tab-pane key="pending" tab="待审核"></a-tab-pane>
|
|
|
|
|
- <a-tab-pane key="published" tab="已发布"></a-tab-pane>
|
|
|
|
|
- <a-tab-pane key="recycle" tab="回收站"></a-tab-pane>
|
|
|
|
|
|
|
+ <a-tabs v-model:activeKey="formState.verifyStatus" @change="tabChange">
|
|
|
|
|
+ <a-tab-pane key="0" tab="未发布"></a-tab-pane>
|
|
|
|
|
+ <a-tab-pane key="1" tab="待审核"></a-tab-pane>
|
|
|
|
|
+ <a-tab-pane key="2" tab="已发布"></a-tab-pane>
|
|
|
|
|
+ <a-tab-pane key="4" tab="回收站"></a-tab-pane>
|
|
|
</a-tabs>
|
|
</a-tabs>
|
|
|
|
|
|
|
|
<!-- 搜索和操作区域 -->
|
|
<!-- 搜索和操作区域 -->
|
|
@@ -23,34 +23,44 @@
|
|
|
<!-- 表格 -->
|
|
<!-- 表格 -->
|
|
|
<a-table
|
|
<a-table
|
|
|
:columns="currentColumns"
|
|
:columns="currentColumns"
|
|
|
- :data-source="currentDataSource"
|
|
|
|
|
|
|
+ :data-source="dataSource"
|
|
|
:pagination="false"
|
|
:pagination="false"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ bordered
|
|
|
:row-key="(record) => record.id"
|
|
:row-key="(record) => record.id"
|
|
|
>
|
|
>
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
|
|
|
|
+ <template #bodyCell="{ column, text, record }">
|
|
|
|
|
+ <template
|
|
|
|
|
+ v-if="
|
|
|
|
|
+ ['fileName', 'collegeIdName', 'majorIdName', 'courseTypeName', 'suffix', 'uploadTime'].includes(
|
|
|
|
|
+ column.dataIndex
|
|
|
|
|
+ )
|
|
|
|
|
+ "
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="multiLine-ellipsis" :title="text">{{ text || '-' }}</div>
|
|
|
|
|
+ </template>
|
|
|
<!-- 状态列 -->
|
|
<!-- 状态列 -->
|
|
|
- <template v-if="column.key === 'status'">
|
|
|
|
|
- <span v-if="record.status === 'processing'">
|
|
|
|
|
|
|
+ <template v-if="column.key === 'verifyStatus'">
|
|
|
|
|
+ <span v-if="record.verifyStatus === '0'">
|
|
|
<a-badge status="processing" text="处理中" />
|
|
<a-badge status="processing" text="处理中" />
|
|
|
</span>
|
|
</span>
|
|
|
- <span v-else-if="record.status === 'uploaded'">
|
|
|
|
|
|
|
+ <span v-else-if="record.verifyStatus === 'uploaded'">
|
|
|
<a-badge status="success" text="已上传" />
|
|
<a-badge status="success" text="已上传" />
|
|
|
</span>
|
|
</span>
|
|
|
- <span v-else-if="record.status === 'pending'">
|
|
|
|
|
|
|
+ <span v-else-if="record.verifyStatus === '1'">
|
|
|
<a-badge status="default" text="待审核" />
|
|
<a-badge status="default" text="待审核" />
|
|
|
</span>
|
|
</span>
|
|
|
- <span v-else-if="record.status === 'published'">
|
|
|
|
|
|
|
+ <span v-else-if="record.verifyStatus === '2'">
|
|
|
<a-badge status="success" text="已发布" />
|
|
<a-badge status="success" text="已发布" />
|
|
|
</span>
|
|
</span>
|
|
|
- <span v-else-if="record.status === 'deleted'">
|
|
|
|
|
|
|
+ <span v-else-if="record.verifyStatus === '4'">
|
|
|
<a-badge status="error" text="已删除" />
|
|
<a-badge status="error" text="已删除" />
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
-
|
|
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-else-if="column.key === 'action'">
|
|
<template v-else-if="column.key === 'action'">
|
|
|
<div class="editable-cell">
|
|
<div class="editable-cell">
|
|
|
- <template v-if="activeKey === 'unpublished'">
|
|
|
|
|
|
|
+ <template v-if="formState.verifyStatus === '0'">
|
|
|
<a @click="handlePublish(record)">发布</a>
|
|
<a @click="handlePublish(record)">发布</a>
|
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
|
<a-dropdown>
|
|
<a-dropdown>
|
|
@@ -66,9 +76,6 @@
|
|
|
<a-menu-item>
|
|
<a-menu-item>
|
|
|
<a href="javascript:;">下载</a>
|
|
<a href="javascript:;">下载</a>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
- <a-menu-item>
|
|
|
|
|
- <a href="javascript:;">编辑</a>
|
|
|
|
|
- </a-menu-item>
|
|
|
|
|
<a-menu-item>
|
|
<a-menu-item>
|
|
|
<a href="javascript:;">删除</a>
|
|
<a href="javascript:;">删除</a>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
@@ -77,7 +84,7 @@
|
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <template v-else-if="activeKey === 'pending'">
|
|
|
|
|
|
|
+ <template v-else-if="formState.verifyStatus === '1'">
|
|
|
<a @click="handleAudit(record)">审核</a>
|
|
<a @click="handleAudit(record)">审核</a>
|
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
|
<a-dropdown>
|
|
<a-dropdown>
|
|
@@ -88,14 +95,20 @@
|
|
|
<template #overlay>
|
|
<template #overlay>
|
|
|
<a-menu>
|
|
<a-menu>
|
|
|
<a-menu-item>
|
|
<a-menu-item>
|
|
|
- <a href="javascript:;">查看</a>
|
|
|
|
|
|
|
+ <a href="javascript:;">播放</a>
|
|
|
|
|
+ </a-menu-item>
|
|
|
|
|
+ <a-menu-item>
|
|
|
|
|
+ <a href="javascript:;">下载</a>
|
|
|
|
|
+ </a-menu-item>
|
|
|
|
|
+ <a-menu-item>
|
|
|
|
|
+ <a href="javascript:;">删除</a>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
</a-menu>
|
|
|
</template>
|
|
</template>
|
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <template v-else-if="activeKey === 'published'">
|
|
|
|
|
|
|
+ <template v-else-if="formState.verifyStatus === '2'">
|
|
|
<a @click="handlePermission(record)">权限</a>
|
|
<a @click="handlePermission(record)">权限</a>
|
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
|
<a-dropdown>
|
|
<a-dropdown>
|
|
@@ -106,10 +119,13 @@
|
|
|
<template #overlay>
|
|
<template #overlay>
|
|
|
<a-menu>
|
|
<a-menu>
|
|
|
<a-menu-item>
|
|
<a-menu-item>
|
|
|
- <a href="javascript:;">查看</a>
|
|
|
|
|
|
|
+ <a href="javascript:;">播放</a>
|
|
|
|
|
+ </a-menu-item>
|
|
|
|
|
+ <a-menu-item>
|
|
|
|
|
+ <a href="javascript:;">下载</a>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
<a-menu-item>
|
|
<a-menu-item>
|
|
|
- <a href="javascript:;">编辑</a>
|
|
|
|
|
|
|
+ <a href="javascript:;" @click="edit(record)">编辑</a>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
<a-menu-item>
|
|
<a-menu-item>
|
|
|
<a href="javascript:;">删除</a>
|
|
<a href="javascript:;">删除</a>
|
|
@@ -119,7 +135,7 @@
|
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <template v-else-if="activeKey === 'recycle'">
|
|
|
|
|
|
|
+ <template v-else-if="formState.verifyStatus === '4'">
|
|
|
<a @click="handleRestore(record)">恢复</a>
|
|
<a @click="handleRestore(record)">恢复</a>
|
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
|
<a-dropdown>
|
|
<a-dropdown>
|
|
@@ -130,7 +146,13 @@
|
|
|
<template #overlay>
|
|
<template #overlay>
|
|
|
<a-menu>
|
|
<a-menu>
|
|
|
<a-menu-item>
|
|
<a-menu-item>
|
|
|
- <a href="javascript:;">彻底删除</a>
|
|
|
|
|
|
|
+ <a href="javascript:;">播放</a>
|
|
|
|
|
+ </a-menu-item>
|
|
|
|
|
+ <a-menu-item>
|
|
|
|
|
+ <a href="javascript:;">下载</a>
|
|
|
|
|
+ </a-menu-item>
|
|
|
|
|
+ <a-menu-item>
|
|
|
|
|
+ <a href="javascript:;">删除</a>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
</a-menu>
|
|
|
</template>
|
|
</template>
|
|
@@ -140,113 +162,104 @@
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
-
|
|
|
|
|
- <!-- 上传资源模态框 -->
|
|
|
|
|
- <a-modal v-model:visible="uploadModalVisible" title="上传资源" @ok="handleUploadOk" @cancel="handleUploadCancel">
|
|
|
|
|
- <a-upload
|
|
|
|
|
- :multiple="true"
|
|
|
|
|
- :before-upload="beforeUpload"
|
|
|
|
|
- :file-list="fileList"
|
|
|
|
|
- :remove="handleRemove"
|
|
|
|
|
- :on-change="handleChange"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="upload-area">
|
|
|
|
|
- <a-icon type="cloud-upload" style="font-size: 60px; color: #3ca9f5"></a-icon>
|
|
|
|
|
- <p>将文件拖到此处或点击上传</p>
|
|
|
|
|
- <p>按住Ctrl可同时多选,支持上传PPT/word/excel/pdf/mp4/zip/rar,单个文件不能超过2G</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- </a-upload>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 文件上传状态展示 -->
|
|
|
|
|
- <ul v-if="fileList.length">
|
|
|
|
|
- <li v-for="(file, index) in fileList" :key="index" class="file-item">
|
|
|
|
|
- <span>{{ file.name }}</span>
|
|
|
|
|
- <a-progress :percent="file.percent || 0" />
|
|
|
|
|
- <span v-if="file.status === 'done'">已完成</span>
|
|
|
|
|
- <span v-else-if="file.status === 'error'">上传失败</span>
|
|
|
|
|
- <span v-else-if="file.status === 'uploading'">上传中...</span>
|
|
|
|
|
- </li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- </a-modal>
|
|
|
|
|
- <releaseModal v-if="releaseVisible" @close="releaseVisible = false"></releaseModal>
|
|
|
|
|
|
|
+ <div class="dis-flex-end margin-top">
|
|
|
|
|
+ <CustomPagination
|
|
|
|
|
+ :total="pagination.total"
|
|
|
|
|
+ :current="pagination.pageNum"
|
|
|
|
|
+ :pageSize="pagination.pageSize"
|
|
|
|
|
+ :showQuickJumper="true"
|
|
|
|
|
+ :showSizeChanger="true"
|
|
|
|
|
+ :showTotal="(total) => `共 ${total} 条数据`"
|
|
|
|
|
+ @change="handlePageChange"
|
|
|
|
|
+ @showSizeChange="handlePageSizeChange"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- 资源上传模态框 -->
|
|
|
|
|
+ <resourceUpload
|
|
|
|
|
+ :visible="uploadModalVisible"
|
|
|
|
|
+ @close="uploadModalVisible = false"
|
|
|
|
|
+ @getList="getList"
|
|
|
|
|
+ ></resourceUpload>
|
|
|
|
|
+ <!-- 发布模态框 -->
|
|
|
|
|
+ <releaseModal
|
|
|
|
|
+ :isState="isState"
|
|
|
|
|
+ v-if="releaseVisible"
|
|
|
|
|
+ @close="releaseVisible = false"
|
|
|
|
|
+ @confirm="confirm"
|
|
|
|
|
+ ></releaseModal>
|
|
|
</a-card>
|
|
</a-card>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
- import { ref } from 'vue'
|
|
|
|
|
|
|
+ import { ref, onMounted } from 'vue'
|
|
|
import { DownOutlined } from '@ant-design/icons-vue'
|
|
import { DownOutlined } from '@ant-design/icons-vue'
|
|
|
- import { Modal, Upload } from 'ant-design-vue'
|
|
|
|
|
import releaseModal from './releaseModal.vue'
|
|
import releaseModal from './releaseModal.vue'
|
|
|
|
|
+ import resourceUpload from './resourceUpload.vue'
|
|
|
|
|
+ import resourceAuditApi from '@/api/resourceAudit.js'
|
|
|
|
|
+ import CustomPagination from '@/components/customPagination.vue'
|
|
|
|
|
+
|
|
|
|
|
+ import tool from '@/utils/tool'
|
|
|
|
|
+ const headers = ref({
|
|
|
|
|
+ token: tool.data.get('TOKEN')
|
|
|
|
|
+ })
|
|
|
|
|
+ const action = ref('http://192.168.31.80:9003/api/webapp/dev/file/uploadMinioReturnId')
|
|
|
// 数据源
|
|
// 数据源
|
|
|
- const dataSource = ref([
|
|
|
|
|
- {
|
|
|
|
|
- id: 1,
|
|
|
|
|
- name: '资源名称资源名称',
|
|
|
|
|
- format: 'mp4',
|
|
|
|
|
- uploadTime: '2020-11-25 23:26:08',
|
|
|
|
|
- status: 'processing', // processing, uploaded, pending, published, deleted
|
|
|
|
|
- department: '航空理论系',
|
|
|
|
|
- major: '商务服务',
|
|
|
|
|
- courseType: '选修'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 2,
|
|
|
|
|
- name: '资源名称资源名称',
|
|
|
|
|
- format: 'mp4',
|
|
|
|
|
- uploadTime: '2020-11-25 23:26:08',
|
|
|
|
|
- status: 'pending', // processing, uploaded, pending, published, deleted
|
|
|
|
|
- department: '航空理论系1',
|
|
|
|
|
- major: '商务服务',
|
|
|
|
|
- courseType: '选修'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 3,
|
|
|
|
|
- name: '资源名称资源名称',
|
|
|
|
|
- format: 'mp4',
|
|
|
|
|
- uploadTime: '2020-11-25 23:26:08',
|
|
|
|
|
- status: 'published', // processing, uploaded, pending, published, deleted
|
|
|
|
|
- department: '航空理论系2',
|
|
|
|
|
- major: '商务服务',
|
|
|
|
|
- courseType: '选修'
|
|
|
|
|
- }
|
|
|
|
|
- ])
|
|
|
|
|
|
|
+ const dataSource = ref([])
|
|
|
|
|
|
|
|
- // 当前激活的标签页
|
|
|
|
|
- const activeKey = ref('unpublished')
|
|
|
|
|
|
|
+ // const activeKey = ref('0')
|
|
|
//发布按钮状态
|
|
//发布按钮状态
|
|
|
const releaseVisible = ref(false)
|
|
const releaseVisible = ref(false)
|
|
|
|
|
+ const loading = ref(false) // 列表loading
|
|
|
|
|
+
|
|
|
|
|
+ const isState = ref(0) // 列表loading
|
|
|
|
|
|
|
|
// 搜索值
|
|
// 搜索值
|
|
|
const searchValue = ref('')
|
|
const searchValue = ref('')
|
|
|
|
|
|
|
|
|
|
+ const pagination = reactive({
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ total: 0
|
|
|
|
|
+ })
|
|
|
|
|
+ const formState = reactive({
|
|
|
|
|
+ fileName: null,
|
|
|
|
|
+ verifyStatus: '0',
|
|
|
|
|
+ resourcesId: null
|
|
|
|
|
+ })
|
|
|
// 列定义
|
|
// 列定义
|
|
|
const columnsUnpublished = [
|
|
const columnsUnpublished = [
|
|
|
{
|
|
{
|
|
|
title: '编号',
|
|
title: '编号',
|
|
|
- dataIndex: 'id',
|
|
|
|
|
- key: 'id'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ dataIndex: 'fileId',
|
|
|
|
|
+ key: 'fileId'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '资源名称',
|
|
title: '资源名称',
|
|
|
- dataIndex: 'name',
|
|
|
|
|
- key: 'name'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ dataIndex: 'fileName',
|
|
|
|
|
+ key: 'fileName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '课件格式',
|
|
title: '课件格式',
|
|
|
- dataIndex: 'format',
|
|
|
|
|
- key: 'format'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ dataIndex: 'suffix',
|
|
|
|
|
+ key: 'suffix'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '上传时间',
|
|
title: '上传时间',
|
|
|
dataIndex: 'uploadTime',
|
|
dataIndex: 'uploadTime',
|
|
|
|
|
+ align: 'center',
|
|
|
key: 'uploadTime'
|
|
key: 'uploadTime'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '状态',
|
|
title: '状态',
|
|
|
- key: 'status'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ key: 'verifyStatus'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '操作',
|
|
title: '操作',
|
|
|
|
|
+ align: 'center',
|
|
|
key: 'action'
|
|
key: 'action'
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -255,44 +268,53 @@
|
|
|
{
|
|
{
|
|
|
title: '编号',
|
|
title: '编号',
|
|
|
dataIndex: 'id',
|
|
dataIndex: 'id',
|
|
|
|
|
+ align: 'center',
|
|
|
key: 'id'
|
|
key: 'id'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '资源名称',
|
|
title: '资源名称',
|
|
|
- dataIndex: 'name',
|
|
|
|
|
- key: 'name'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ dataIndex: 'fileName',
|
|
|
|
|
+ key: 'fileName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '所属院系',
|
|
title: '所属院系',
|
|
|
- dataIndex: 'department',
|
|
|
|
|
- key: 'department'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ dataIndex: 'collegeIdName',
|
|
|
|
|
+ key: 'collegeIdName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '所属专业',
|
|
title: '所属专业',
|
|
|
- dataIndex: 'major',
|
|
|
|
|
- key: 'major'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ dataIndex: 'majorIdName',
|
|
|
|
|
+ key: 'majorIdName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '课程类型',
|
|
title: '课程类型',
|
|
|
- dataIndex: 'courseType',
|
|
|
|
|
- key: 'courseType'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ dataIndex: 'courseTypeName',
|
|
|
|
|
+ key: 'courseTypeName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '课件格式',
|
|
title: '课件格式',
|
|
|
- dataIndex: 'format',
|
|
|
|
|
- key: 'format'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ dataIndex: 'suffix',
|
|
|
|
|
+ key: 'suffix'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '上传时间',
|
|
title: '上传时间',
|
|
|
|
|
+ align: 'center',
|
|
|
dataIndex: 'uploadTime',
|
|
dataIndex: 'uploadTime',
|
|
|
key: 'uploadTime'
|
|
key: 'uploadTime'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '状态',
|
|
title: '状态',
|
|
|
- key: 'status'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ key: 'verifyStatus'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '操作',
|
|
title: '操作',
|
|
|
|
|
+ align: 'center',
|
|
|
key: 'action'
|
|
key: 'action'
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -301,35 +323,45 @@
|
|
|
const columnsRecycle = [...columnsPending]
|
|
const columnsRecycle = [...columnsPending]
|
|
|
|
|
|
|
|
const currentColumns = computed(() => {
|
|
const currentColumns = computed(() => {
|
|
|
- switch (activeKey.value) {
|
|
|
|
|
- case 'unpublished':
|
|
|
|
|
|
|
+ switch (formState.verifyStatus) {
|
|
|
|
|
+ case '0':
|
|
|
return columnsUnpublished
|
|
return columnsUnpublished
|
|
|
- case 'pending':
|
|
|
|
|
|
|
+ case '1':
|
|
|
return columnsPending
|
|
return columnsPending
|
|
|
- case 'published':
|
|
|
|
|
|
|
+ case '2':
|
|
|
return columnsPublished
|
|
return columnsPublished
|
|
|
- case 'recycle':
|
|
|
|
|
|
|
+ case '4':
|
|
|
return columnsRecycle
|
|
return columnsRecycle
|
|
|
default:
|
|
default:
|
|
|
return []
|
|
return []
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
- const currentDataSource = computed(() => {
|
|
|
|
|
- return dataSource.value.filter((item) => {
|
|
|
|
|
- if (activeKey.value === 'unpublished') {
|
|
|
|
|
- return ['processing', 'uploaded'].includes(item.status)
|
|
|
|
|
- } else if (activeKey.value === 'pending') {
|
|
|
|
|
- return item.status === 'pending'
|
|
|
|
|
- } else if (activeKey.value === 'published') {
|
|
|
|
|
- return item.status === 'published'
|
|
|
|
|
- } else if (activeKey.value === 'recycle') {
|
|
|
|
|
- return item.status === 'deleted'
|
|
|
|
|
- }
|
|
|
|
|
- return false
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const getListData = () => {
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ current: pagination.pageNum,
|
|
|
|
|
+ size: pagination.pageSize,
|
|
|
|
|
+ verifyStatus: formState.verifyStatus,
|
|
|
|
|
+ fileName: formState.fileName
|
|
|
|
|
+ }
|
|
|
|
|
+ resourceAuditApi
|
|
|
|
|
+ .page(params)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ console.log(res, '资源审核列表')
|
|
|
|
|
+ dataSource.value = res.data.records
|
|
|
|
|
+ pagination.total = res.data.total
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ dataSource.value = []
|
|
|
|
|
+ pagination.total = 0
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ const getList = () => {
|
|
|
|
|
+ getListData()
|
|
|
|
|
+ }
|
|
|
// 方法
|
|
// 方法
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
|
console.log('Search:', searchValue.value)
|
|
console.log('Search:', searchValue.value)
|
|
@@ -339,17 +371,41 @@
|
|
|
searchValue.value = ''
|
|
searchValue.value = ''
|
|
|
}
|
|
}
|
|
|
const tabChange = () => {
|
|
const tabChange = () => {
|
|
|
- // dataSource.value = []
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const handleUpload = () => {
|
|
|
|
|
- console.log('Upload Resource')
|
|
|
|
|
|
|
+ dataSource.value = []
|
|
|
|
|
+ getListData()
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ const publishedData = ref()
|
|
|
|
|
+ //发布
|
|
|
const handlePublish = (record) => {
|
|
const handlePublish = (record) => {
|
|
|
- console.log('Publish:', record)
|
|
|
|
|
|
|
+ publishedData.value = record
|
|
|
|
|
+ isState.value = 0
|
|
|
releaseVisible.value = true
|
|
releaseVisible.value = true
|
|
|
}
|
|
}
|
|
|
|
|
+ //发布确定
|
|
|
|
|
+ const confirm = (obj) => {
|
|
|
|
|
+ console.log(obj, '传回来的数据')
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ courseAuditId: publishedData.value.courseAuditId,
|
|
|
|
|
+ fileId: publishedData.value.fileId,
|
|
|
|
|
+ collegeId: publishedData.value.collegeId,
|
|
|
|
|
+ majorId: publishedData.value.majorId,
|
|
|
|
|
+ courseType: obj.courseType,
|
|
|
|
|
+ courseName: obj.courseName,
|
|
|
|
|
+ courseDesc: obj.courseDesc,
|
|
|
|
|
+ coverImageId: obj.coverImageId
|
|
|
|
|
+ }
|
|
|
|
|
+ resourceAuditApi
|
|
|
|
|
+ .release(params)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ console.log(res, '资源审核列表')
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ dataSource.value = []
|
|
|
|
|
+ pagination.total = 0
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
const handleAudit = (record) => {
|
|
const handleAudit = (record) => {
|
|
|
console.log('Audit:', record)
|
|
console.log('Audit:', record)
|
|
@@ -362,63 +418,36 @@
|
|
|
const handleRestore = (record) => {
|
|
const handleRestore = (record) => {
|
|
|
console.log('Restore:', record)
|
|
console.log('Restore:', record)
|
|
|
}
|
|
}
|
|
|
|
|
+ //课程编辑
|
|
|
|
|
+ const edit = (record) => {
|
|
|
|
|
+ console.log('Restore:', record)
|
|
|
|
|
+ releaseVisible.value = true
|
|
|
|
|
+ isState.value = 1
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 上传资源模态框
|
|
// 上传资源模态框
|
|
|
const uploadModalVisible = ref(false)
|
|
const uploadModalVisible = ref(false)
|
|
|
|
|
|
|
|
- // 文件列表
|
|
|
|
|
- const fileList = ref([])
|
|
|
|
|
|
|
|
|
|
// 显示上传模态框
|
|
// 显示上传模态框
|
|
|
const showUploadModal = () => {
|
|
const showUploadModal = () => {
|
|
|
uploadModalVisible.value = true
|
|
uploadModalVisible.value = true
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 关闭模态框
|
|
|
|
|
- const handleUploadCancel = () => {
|
|
|
|
|
- uploadModalVisible.value = false
|
|
|
|
|
- fileList.value = []
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 确认上传
|
|
|
|
|
- const handleUploadOk = () => {
|
|
|
|
|
- // 这里可以添加实际的上传逻辑
|
|
|
|
|
- console.log('Upload confirmed:', fileList.value)
|
|
|
|
|
- uploadModalVisible.value = false
|
|
|
|
|
- fileList.value = []
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 上传前的钩子函数
|
|
|
|
|
- const beforeUpload = (file) => {
|
|
|
|
|
- const isLt2G = file.size / 1024 / 1024 / 1024 < 2
|
|
|
|
|
- if (!isLt2G) {
|
|
|
|
|
- Modal.error({ content: '文件大小不能超过 2GB!' })
|
|
|
|
|
- }
|
|
|
|
|
- return isLt2G
|
|
|
|
|
|
|
+ // 翻页
|
|
|
|
|
+ const handlePageChange = (page) => {
|
|
|
|
|
+ pagination.pageNum = page
|
|
|
|
|
+ getListData()
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 移除文件
|
|
|
|
|
- const handleRemove = (file) => {
|
|
|
|
|
- const index = fileList.value.indexOf(file)
|
|
|
|
|
- const newFileList = fileList.value.slice()
|
|
|
|
|
- newFileList.splice(index, 1)
|
|
|
|
|
- fileList.value = newFileList
|
|
|
|
|
|
|
+ // 每页条数
|
|
|
|
|
+ const handlePageSizeChange = (pageNum, size) => {
|
|
|
|
|
+ pagination.pageNum = 1
|
|
|
|
|
+ pagination.pageSize = size
|
|
|
|
|
+ getListData()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 文件状态改变时的处理函数
|
|
|
|
|
- const handleChange = ({ file, fileList: newFileList }) => {
|
|
|
|
|
- fileList.value = newFileList
|
|
|
|
|
-
|
|
|
|
|
- if (file.status === 'uploading') {
|
|
|
|
|
- file.percent = 0
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (file.status === 'done') {
|
|
|
|
|
- Modal.success({ content: '文件上传成功' })
|
|
|
|
|
- } else if (file.status === 'error') {
|
|
|
|
|
- Modal.error({ content: '文件上传失败' })
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
|
+ getListData()
|
|
|
|
|
+ })
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|