|
|
@@ -9,82 +9,95 @@
|
|
|
<a-tab-pane key="4" tab="回收站"></a-tab-pane>
|
|
|
</a-tabs>
|
|
|
<!-- 搜索和操作区域 -->
|
|
|
- <a-row :gutter="12" style="margin-bottom: 16px">
|
|
|
- <a-col :span="18">
|
|
|
- <a-input v-model:value="formState.fileName" placeholder="请输入资源名称" style="width: 17%" />
|
|
|
- <a-cascader
|
|
|
- style="width: 17%; margin-left: 8px"
|
|
|
- v-model:value="majorIdName"
|
|
|
- :options="collegeMajorOptions"
|
|
|
- :fieldNames="{ label: 'name', value: 'id', children: 'children' }"
|
|
|
- placeholder="请选择院系"
|
|
|
- changeOnSelect
|
|
|
- @change="changeCollegeMajor"
|
|
|
- />
|
|
|
- <!-- <a-select
|
|
|
- v-model:value="formState.majorId"
|
|
|
- style="width: 150px; margin-left: 8px"
|
|
|
- :fieldNames="{ label: 'majorName', value: 'majorCode' }"
|
|
|
- :options="majorOptions"
|
|
|
- placeholder="请选择专业"
|
|
|
- /> -->
|
|
|
- <a-cascader
|
|
|
- style="width: 17%; margin-left: 8px"
|
|
|
- v-model:value="resourceName"
|
|
|
- :options="resourceTypeOptions"
|
|
|
- :fieldNames="{ label: 'name', value: 'id', children: 'children' }"
|
|
|
- placeholder="请选择资源类型"
|
|
|
- changeOnSelect
|
|
|
- @change="changeCollegeResource"
|
|
|
- />
|
|
|
- <!-- <a-select
|
|
|
- v-model:value="formState.resourceType"
|
|
|
- style="width: 150px; margin-left: 8px"
|
|
|
- :options="resourceTypeOptions"
|
|
|
- :fieldNames="{ label: 'name', value: 'id', children: 'children' }"
|
|
|
- placeholder="请选择资源类型"
|
|
|
- /> -->
|
|
|
- <a-select
|
|
|
- v-model:value="formState.suffix"
|
|
|
- style="width: 17%; margin-left: 8px"
|
|
|
- :options="fileformatOptions"
|
|
|
- :fieldNames="{ label: 'fileExtendName', value: 'fileExtendName', children: 'children' }"
|
|
|
- placeholder="请选择资源格式"
|
|
|
- />
|
|
|
- <a-select
|
|
|
- v-if="['0,3', '0', '3'].includes(formState.verifyStatus)"
|
|
|
- v-model:value="isVerifyStatus"
|
|
|
- placeholder="请选择资源状态"
|
|
|
- style="width: 17%; margin-left: 8px"
|
|
|
- >
|
|
|
- <a-select-option value="0">未发布</a-select-option>
|
|
|
- <a-select-option value="3">未通过</a-select-option>
|
|
|
- </a-select>
|
|
|
- <!-- <a-select
|
|
|
- v-model:value="formState.suffix"
|
|
|
- style="width: 200px; margin-left: 8px"
|
|
|
- :options="suffixTypeOptions"
|
|
|
- placeholder="请选择课件格式"
|
|
|
- /> -->
|
|
|
+ <a-card style="margin-bottom: 16px">
|
|
|
+ <!-- 第一行:名称、院系、类型 -->
|
|
|
+ <a-row :gutter="16" style="margin-bottom: 16px">
|
|
|
+ <a-col :span="6">
|
|
|
+ <span>名称:</span>
|
|
|
+ <a-input
|
|
|
+ v-model:value="formState.fileName"
|
|
|
+ placeholder="请输入名字"
|
|
|
+ style="width: calc(100% - 50px); margin-left: 8px"
|
|
|
+ />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <span>层级:</span>
|
|
|
+ <a-cascader
|
|
|
+ style="width: calc(100% - 50px); margin-left: 8px"
|
|
|
+ v-model:value="majorIdName"
|
|
|
+ :options="collegeMajorOptions"
|
|
|
+ :fieldNames="{ label: 'name', value: 'id', children: 'children' }"
|
|
|
+ placeholder="请选择"
|
|
|
+ changeOnSelect
|
|
|
+ @change="changeCollegeMajor"
|
|
|
+ />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <span>类型:</span>
|
|
|
+ <a-cascader
|
|
|
+ style="width: calc(100% - 50px); margin-left: 8px"
|
|
|
+ v-model:value="resourceName"
|
|
|
+ :options="resourceTypeOptions"
|
|
|
+ :fieldNames="{ label: 'name', value: 'id', children: 'children' }"
|
|
|
+ placeholder="请选择"
|
|
|
+ changeOnSelect
|
|
|
+ @change="changeCollegeResource"
|
|
|
+ />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6" style="text-align: right">
|
|
|
+ <a-button type="primary" @click="handleSearch">查询</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
|
|
|
- </a-col>
|
|
|
- <a-col :span="6" style="text-align: right">
|
|
|
- <a-button
|
|
|
- type="primary"
|
|
|
- style="margin-right: 8px"
|
|
|
- v-if="formState.verifyStatus === '0,3' && !pageType"
|
|
|
- @click="batchPublish"
|
|
|
- :disabled="selectedRowKeys.length === 0"
|
|
|
- >
|
|
|
- + 批量发布
|
|
|
- </a-button>
|
|
|
- <a-button type="primary" v-if="!pageType" @click="showUploadModal">+ 上传资源</a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <div>
|
|
|
- <a-button type="primary" style="margin-left: 0px" @click="handleSearch">查询</a-button>
|
|
|
- <a-button style="margin-left: 8px" @click="handleReset">重置</a-button>
|
|
|
- </div>
|
|
|
+ <!-- 第二行:状态、租户、创建人 -->
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col :span="6">
|
|
|
+ <span>状态:</span>
|
|
|
+ <a-select
|
|
|
+ v-if="['0,3', '0', '3'].includes(formState.verifyStatus)"
|
|
|
+ v-model:value="isVerifyStatus"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: calc(100% - 50px); margin-left: 8px"
|
|
|
+ >
|
|
|
+ <a-select-option value="0">未发布</a-select-option>
|
|
|
+ <a-select-option value="3">未通过</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <a-select
|
|
|
+ v-else
|
|
|
+ v-model:value="formState.suffix"
|
|
|
+ style="width: calc(100% - 50px); margin-left: 8px"
|
|
|
+ :options="fileformatOptions"
|
|
|
+ :fieldNames="{ label: 'fileExtendName', value: 'fileExtendName', children: 'children' }"
|
|
|
+ placeholder="请选择"
|
|
|
+ />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <span>租户:</span>
|
|
|
+ <a-input placeholder="请选择" style="width: calc(100% - 50px); margin-left: 8px" disabled />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <span>创建人:</span>
|
|
|
+ <a-input placeholder="请输入名字" style="width: calc(100% - 64px); margin-left: 8px" />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6" style="text-align: right">
|
|
|
+ <a-button @click="handleReset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row style="margin-top: 16px">
|
|
|
+ <a-col :span="24" style="text-align: left">
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ style="margin-right: 8px"
|
|
|
+ v-if="formState.verifyStatus === '0,3' && !pageType"
|
|
|
+ @click="batchPublish"
|
|
|
+ :disabled="selectedRowKeys.length === 0"
|
|
|
+ >
|
|
|
+ + 批量发布
|
|
|
+ </a-button>
|
|
|
+ <a-button type="primary" v-if="!pageType" @click="showUploadModal">+ 新增</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-card>
|
|
|
<!-- 表格 -->
|
|
|
<a-table
|
|
|
:columns="columnsPending"
|
|
|
@@ -94,7 +107,7 @@
|
|
|
bordered
|
|
|
:row-key="(record) => record.id"
|
|
|
:row-selection="rowSelection"
|
|
|
- :scroll="{ x: 1500, y: 300 }"
|
|
|
+ :scroll="{ x: 1300 }"
|
|
|
>
|
|
|
<template #bodyCell="{ column, text, record }">
|
|
|
<template
|
|
|
@@ -255,9 +268,9 @@
|
|
|
<!-- 发布模态框 -->
|
|
|
<releaseModal v-if="releaseVisible" @close="releaseVisible = false" @confirm="releaseConfirm"></releaseModal>
|
|
|
<div style="height: 20px"></div>
|
|
|
- <span>容量</span><span style="color: #6abe39"> {{bToGb(storageMin)}} GB</span><span> / </span><span style="color: red">{{bToGb(storageMax)}} GB</span>
|
|
|
+ <span>容量</span><span style="color: #6abe39"> {{ bToGb(storageMin) }} GB</span><span> / </span
|
|
|
+ ><span style="color: red">{{ bToGb(storageMax) }} GB</span>
|
|
|
</a-card>
|
|
|
-
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -556,20 +569,19 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- const bToMb = (b) =>{
|
|
|
+ const bToMb = (b) => {
|
|
|
if (typeof b !== 'number' || b < 0) {
|
|
|
- throw new Error('请输入有效的非负数字');
|
|
|
+ throw new Error('请输入有效的非负数字')
|
|
|
}
|
|
|
- return (b / (1024*1024)).toFixed(2); // 保留两位小数
|
|
|
+ return (b / (1024 * 1024)).toFixed(2) // 保留两位小数
|
|
|
}
|
|
|
- const bToGb = (b) =>{
|
|
|
+ const bToGb = (b) => {
|
|
|
if (typeof b !== 'number' || b < 0) {
|
|
|
- throw new Error('请输入有效的非负数字');
|
|
|
+ throw new Error('请输入有效的非负数字')
|
|
|
}
|
|
|
- return (b / (1024 * 1024 * 1024)).toFixed(2); // 保留两位小数
|
|
|
+ return (b / (1024 * 1024 * 1024)).toFixed(2) // 保留两位小数
|
|
|
}
|
|
|
|
|
|
-
|
|
|
const changeCollegeMajor = (value, selectedOptions) => {
|
|
|
console.log('Selected:', value, selectedOptions)
|
|
|
if (!value) {
|
|
|
@@ -910,7 +922,7 @@
|
|
|
getFileformat()
|
|
|
getResourceTypeTree()
|
|
|
getListData()
|
|
|
- getstorage().then(res => {
|
|
|
+ getstorage().then((res) => {
|
|
|
console.log('容量', res)
|
|
|
|
|
|
storageMin.value = res.data.storageSize
|