|
|
@@ -5,7 +5,6 @@
|
|
|
<a-col :span="12">
|
|
|
<a-select v-model:value="selectedOption" style="width: 100px" placeholder="请选择">
|
|
|
<a-select-option value="all">全部</a-select-option>
|
|
|
- <!-- 其他选项... -->
|
|
|
</a-select>
|
|
|
<a-input-search
|
|
|
v-model:value="searchKeyword"
|
|
|
@@ -20,9 +19,10 @@
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
|
|
|
- <!-- 左侧内容 -->
|
|
|
- <a-row type="flex">
|
|
|
- <a-col :span="14" class="left-content">
|
|
|
+ <!-- 主要内容区 -->
|
|
|
+ <a-row :gutter="[16, 16]">
|
|
|
+ <!-- 左侧内容 -->
|
|
|
+ <a-col :xs="24" :lg="14" class="left-content">
|
|
|
<!-- 存储空间 -->
|
|
|
<div class="storage-space">
|
|
|
<div id="storage-chart" style="width: 200px; height: 250px"></div>
|
|
|
@@ -64,12 +64,12 @@
|
|
|
</a-col>
|
|
|
|
|
|
<!-- 右侧内容 -->
|
|
|
- <a-col :span="10" class="right-content">
|
|
|
+ <a-col :xs="24" :lg="10" class="right-content">
|
|
|
<h3>浏览历史</h3>
|
|
|
<ul class="history-list">
|
|
|
<li v-for="(history, index) in historyList" :key="index">
|
|
|
- <span class="history-time">{{ history.date }}</span>
|
|
|
- <span class="history-file">{{ history.file }}</span>
|
|
|
+ <span class="history-time">{{ history.time }}</span>
|
|
|
+ <span class="history-file">{{ history.fileName }}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</a-col>
|
|
|
@@ -80,13 +80,14 @@
|
|
|
<script setup>
|
|
|
import * as echarts from 'echarts'
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
+import resourceOverviewApi from '@/api/resourceOverview.js'
|
|
|
// import { ARow, ACol, ASelect, ASelectOption, AInputSearch, AButton } from 'ant-design-vue'
|
|
|
|
|
|
// 响应式数据
|
|
|
const totalCapacity = ref(20)
|
|
|
-const usedCapacity = ref(2)
|
|
|
-const availableCapacity = ref(18)
|
|
|
-const resourceTotal = ref(36)
|
|
|
+const usedCapacity = ref(2) //已使用内容
|
|
|
+const availableCapacity = ref(18) //可用内存
|
|
|
+const resourceTotal = ref(36) //资源总量
|
|
|
const resourceStats = ref([
|
|
|
{ width: '44%', color: '#5470c6' },
|
|
|
{ width: '6%', color: '#91cc75' },
|
|
|
@@ -100,16 +101,17 @@ const resourceLabels = ref([
|
|
|
{ text: '文档:9', color: '#fac858' },
|
|
|
{ text: '其他:9', color: '#c4ccd3' }
|
|
|
])
|
|
|
-const historyList = ref([
|
|
|
- { date: '2024-09-24 16:12:24', file: '现代教育技术应用-6.mp4' },
|
|
|
- { date: '2024-09-24 13:38:52', file: '怎样写出较高水平的学术文章.mp4' },
|
|
|
- { date: '2024-09-23 16:44:14', file: 'etl.yml' },
|
|
|
- { date: '2024-09-23 13:53:59', file: '学术论文书写套路.mp4' },
|
|
|
- { date: '2024-09-23 13:53:55', file: '怎样找到值得研究的问题.mp4' },
|
|
|
- { date: '2024-09-21 14:56:16', file: '第一讲 当代艺术概况.pptx' },
|
|
|
- { date: '2024-09-21 14:08:57', file: '论文汇总.xlsx' },
|
|
|
- { date: '2024-09-20 12:03:35', file: '现代教育技术应用-6-字幕.srt' }
|
|
|
-])
|
|
|
+// const historyList = ref([
|
|
|
+// { date: '2024-09-24 16:12:24', file: '现代教育技术应用-6.mp4' },
|
|
|
+// { date: '2024-09-24 13:38:52', file: '怎样写出较高水平的学术文章.mp4' },
|
|
|
+// { date: '2024-09-23 16:44:14', file: 'etl.yml' },
|
|
|
+// { date: '2024-09-23 13:53:59', file: '学术论文书写套路.mp4' },
|
|
|
+// { date: '2024-09-23 13:53:55', file: '怎样找到值得研究的问题.mp4' },
|
|
|
+// { date: '2024-09-21 14:56:16', file: '第一讲 当代艺术概况.pptx' },
|
|
|
+// { date: '2024-09-21 14:08:57', file: '论文汇总.xlsx' },
|
|
|
+// { date: '2024-09-20 12:03:35', file: '现代教育技术应用-6-字幕.srt' }
|
|
|
+// ])
|
|
|
+const historyList = ref([])
|
|
|
|
|
|
// 搜索相关数据
|
|
|
const selectedOption = ref('all')
|
|
|
@@ -119,6 +121,34 @@ const searchKeyword = ref('')
|
|
|
const applyExpansion = () => {
|
|
|
console.log('申请扩容')
|
|
|
}
|
|
|
+// 方法
|
|
|
+const getLists = () => {
|
|
|
+ resourceOverviewApi
|
|
|
+ .getList({ type: 'upload' })
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res, '资源概括数据')
|
|
|
+ historyList.value = res.data
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+}
|
|
|
+//存储空间数据
|
|
|
+const getQueryList = () => {
|
|
|
+ resourceOverviewApi
|
|
|
+ .queryList()
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res, '存储空间数据')
|
|
|
+ resourceTotal.value = res.totalSize
|
|
|
+ availableCapacity.value = res.remainStorageSize
|
|
|
+ usedCapacity.value = Number(res.totalFileSize)
|
|
|
+ totalCapacity.value = res.totalStorageSize
|
|
|
+ initChart()
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
console.log('搜索:', selectedOption.value, searchKeyword.value)
|
|
|
@@ -127,7 +157,8 @@ const handleSearch = () => {
|
|
|
|
|
|
// 生命周期钩子
|
|
|
onMounted(() => {
|
|
|
- initChart()
|
|
|
+ getQueryList()
|
|
|
+ getLists()
|
|
|
})
|
|
|
|
|
|
// 图表初始化
|
|
|
@@ -170,8 +201,7 @@ const initChart = () => {
|
|
|
myChart.setOption(option)
|
|
|
}
|
|
|
</script>
|
|
|
-
|
|
|
- <style scoped>
|
|
|
+<style scoped>
|
|
|
.dashboard-container {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
@@ -258,4 +288,48 @@ const initChart = () => {
|
|
|
.marginright5 {
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
+
|
|
|
+/* 响应式调整 */
|
|
|
+@media (max-width: 768px) {
|
|
|
+ .left-content,
|
|
|
+ .right-content {
|
|
|
+ padding: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .storage-space {
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: flex-start;
|
|
|
+ }
|
|
|
+
|
|
|
+ #storage-chart {
|
|
|
+ width: 150px;
|
|
|
+ height: 150px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .storage-info p {
|
|
|
+ margin: 5px 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .resource-stats {
|
|
|
+ height: 15px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .resource-labels > span {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .history-list li {
|
|
|
+ padding-left: 15px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .history-time {
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .history-file {
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|