Browse Source

媒体管理-详情

李富豪 1 year ago
parent
commit
602d9252a9

+ 2 - 1
Web/src/api/media.ts

@@ -8,6 +8,7 @@ export const getMediaFiles = async function (wid: string, pagination: { page: nu
   const result = await request.get(url)
   return result.data
 }
+
 // Download Media File
 export const downloadMediaFile = async function (workspaceId: string, fileId: string): Promise<any> {
   const url = `${HTTP_PREFIX}/files/${workspaceId}/file/${fileId}/url`
@@ -23,4 +24,4 @@ export const downloadMediaFile = async function (workspaceId: string, fileId: st
   } else {
     return result.data
   }
-}
+}

+ 0 - 1
Web/src/assets/media/picture.svg

@@ -1 +0,0 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1719905467401" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10546" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M930.936471 0C992.978824 0 1024 31.021176 1024 93.063529v837.872942c0 62.042353-31.021176 93.063529-93.063529 93.063529H93.063529C31.021176 1024 0 992.978824 0 930.936471V93.063529C0 31.021176 31.021176 0 93.063529 0h837.872942zM601.630118 384.722824a15.811765 15.811765 0 0 0-13.70353 7.318588l-147.57647 231.303529-67.282824-65.867294a15.811765 15.811765 0 0 0-24.18447 2.379294l-101.797648 149.624471a15.811765 15.811765 0 0 0 13.101177 24.69647h524.468706a15.811765 15.811765 0 0 0 13.733647-23.732706l-183.416471-317.801411a15.811765 15.811765 0 0 0-13.342117-7.920941z m-244.254118-93.816471a79.811765 79.811765 0 1 0 0 159.593412 79.811765 79.811765 0 0 0 0-159.593412z" p-id="10547" fill="#c0c6d1"></path></svg>

+ 0 - 1
Web/src/assets/media/video.svg

@@ -1 +0,0 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1719905321017" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5358" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M450.048 213.504L305.152 42.496H140.8l144.896 170.496h164.352z m426.496 0L731.648 42.496h-164.352l144.896 170.496h164.352z m-212.992 0L518.656 42.496H354.304l144.896 170.496h164.352z m274.944-171.008h-157.696l144.896 170.496h76.8V106.496c0-36.352-27.648-64-64-64z m-846.848 0h-6.144c-36.352 0-64 27.648-64 64v106.496h215.552L91.648 42.496zM21.504 917.504c0 36.352 27.648 64 64 64h853.504c36.352 0 64-27.648 64-64V256H21.504v661.504z m340.992-469.504c0-36.352 29.696-53.248 64-53.248 10.752 0 23.552 2.048 34.304 8.704l243.2 140.8a60.416 60.416 0 0 1 0 106.496L460.8 791.552c-10.752 6.656-21.504 8.704-34.304 8.704-34.304 0-64-16.896-64-53.248V448z" fill="#c0c6d1" p-id="5359"></path></svg>

+ 3 - 4
Web/src/components/devices/changeRecord/components/Search.vue

@@ -3,11 +3,10 @@
     <a-col>
       <a-form ref="formRef" layout="inline" :model="formModel" :colon="false">
         <a-form-item name="date">
-          <a-range-picker v-model:value="formModel.date" />
+          <a-range-picker style="width: 250px;" v-model:value="formModel.date" />
         </a-form-item>
         <a-form-item name="device_name">
-          <a-select style="width: 200px;margin-right: 10px;" placeholder="请选择设备型号"
-            v-model:value="formModel.device_name">
+          <a-select style="width: 200px;" placeholder="请选择设备型号" v-model:value="formModel.device_name">
             <a-select-option value="1">
               1
             </a-select-option>
@@ -23,7 +22,7 @@
           </a-select>
         </a-form-item>
         <a-form-item name="keyword">
-          <a-input style="width: 200px;margin-right: 10px;" placeholder="项目名称、设备SN" v-model:value="formModel.keyword" />
+          <a-input style="width: 200px;" placeholder="项目名称、设备SN" v-model:value="formModel.keyword" />
         </a-form-item>
         <a-form-item>
           <a-button style="margin-right: 10px;" @click="handleClicSekarch">

+ 4 - 5
Web/src/components/devices/deviceList/components/Search.vue

@@ -26,14 +26,14 @@
           如何绑定机场?
         </a>
       </a-popover>
-      <a-button type="primary" danger v-if="selectedRowKeys.length" @click="onClickDelete">
+      <a-button type="primary" danger :disabled="!selectedRowKeys.length" @click="onClickDelete">
         删除
       </a-button>
     </a-col>
     <a-col>
       <a-form ref="formRef" layout="inline" :model="formModel" :colon="false">
         <a-form-item name="status">
-          <a-select style="width: 200px;margin-right: 10px;" placeholder="请选择状态" v-model:value="formModel.status">
+          <a-select style="width: 200px;" placeholder="请选择状态" v-model:value="formModel.status">
             <a-select-option value="1">
               1
             </a-select-option>
@@ -49,8 +49,7 @@
           </a-select>
         </a-form-item>
         <a-form-item name="device_name">
-          <a-select style="width: 200px;margin-right: 10px;" placeholder="请选择设备型号"
-            v-model:value="formModel.device_name">
+          <a-select style="width: 200px;" placeholder="请选择设备型号" v-model:value="formModel.device_name">
             <a-select-option value="1">
               1
             </a-select-option>
@@ -66,7 +65,7 @@
           </a-select>
         </a-form-item>
         <a-form-item name="keyword">
-          <a-input style="width: 200px;margin-right: 10px;" placeholder="设备SN、设备名称" v-model:value="formModel.keyword" />
+          <a-input style="width: 200px;" placeholder="设备SN、设备名称" v-model:value="formModel.keyword" />
         </a-form-item>
         <a-form-item>
           <a-button style="margin-right: 10px;" @click="handleClicSekarch">

+ 4 - 5
Web/src/components/devices/feedbackRecord/components/Search.vue

@@ -3,10 +3,10 @@
     <a-col>
       <a-form ref="formRef" layout="inline" :model="formModel" :colon="false">
         <a-form-item name="date">
-          <a-range-picker v-model:value="formModel.date" />
+          <a-range-picker style="width: 250px;" v-model:value="formModel.date" />
         </a-form-item>
         <a-form-item name="status">
-          <a-select style="width: 200px;margin-right: 10px;" placeholder="请选择状态" v-model:value="formModel.status">
+          <a-select style="width: 200px;" placeholder="请选择状态" v-model:value="formModel.status">
             <a-select-option value="1">
               1
             </a-select-option>
@@ -22,7 +22,7 @@
           </a-select>
         </a-form-item>
         <a-form-item name="device_name">
-          <a-select style="width: 200px;margin-right: 10px;" placeholder="请选择反馈人" v-model:value="formModel.device_name">
+          <a-select style="width: 200px;" placeholder="请选择反馈人" v-model:value="formModel.device_name">
             <a-select-option value="1">
               1
             </a-select-option>
@@ -38,8 +38,7 @@
           </a-select>
         </a-form-item>
         <a-form-item name="keyword">
-          <a-input style="width: 200px;margin-right: 10px;" placeholder="设备SN、设备异常描述"
-            v-model:value="formModel.keyword" />
+          <a-input style="width: 200px;" placeholder="设备SN、设备异常描述" v-model:value="formModel.keyword" />
         </a-form-item>
         <a-form-item>
           <a-button style="margin-right: 10px;" @click="handleClicSekarch">

+ 53 - 0
Web/src/pages/page-web/projects/media/detail/components/ImageModal.vue

@@ -0,0 +1,53 @@
+<template>
+  <a-modal title="图片详情" width="100%" wrapClassName="full-modal" :footer="null" v-model:visible="visible"
+    @cancel="onClose">
+    <a-row>
+      <a-col flex="auto">
+        <a-image-preview-group>
+          <a-image :width="200" src="https://aliyuncdn.antdv.com/vue.png" />
+          <a-image :width="200" src="https://aliyuncdn.antdv.com/logo.png" />
+        </a-image-preview-group>
+      </a-col>
+      <a-col flex="200px">
+        2313211323123123123
+      </a-col>
+    </a-row>
+  </a-modal>
+</template>
+
+<script lang="ts" setup>
+interface Props {
+  visible: boolean,
+  onClose: () => void,
+};
+
+const props = withDefaults(defineProps<Props>(), {
+
+});
+</script>
+
+<style lang="scss">
+.full-modal {
+  .ant-modal {
+    max-width: 100%;
+    top: 0;
+    padding-bottom: 0;
+    margin: 0;
+  }
+
+  .ant-modal-header {
+    background: #1b1b1b;
+  }
+
+  .ant-modal-content {
+    display: flex;
+    flex-direction: column;
+    height: calc(100vh);
+    background: #1b1b1b;
+  }
+
+  .ant-modal-body {
+    flex: 1;
+  }
+}
+</style>

+ 134 - 0
Web/src/pages/page-web/projects/media/detail/components/Search.vue

@@ -0,0 +1,134 @@
+<template>
+  <a-row style="margin-bottom: 20px;" justify="space-between">
+    <a-col style="display: flex;">
+      <a-upload name="file" :multiple="true">
+        <a-button type="primary" @click="onClickDownload">
+          上传合成文件
+        </a-button>
+      </a-upload>
+      <a-button style="margin: 0 10px;" type="primary" :disabled="!selectedRowKeys.length" @click="onClickDownload">
+        压缩下载
+      </a-button>
+      <a-button type="primary" danger :disabled="!selectedRowKeys.length" @click="onClickDelete">
+        删除
+      </a-button>
+    </a-col>
+    <a-col>
+      <a-form ref="formRef" layout="inline" :model="formModel" :colon="false">
+        <a-form-item name="date">
+          <a-range-picker style="width: 250px;" v-model:value="formModel.date" />
+        </a-form-item>
+        <a-form-item name="status">
+          <a-select style="width: 200px;" placeholder="请选择媒体类型" v-model:value="formModel.status">
+            <a-select-option value="1">
+              1
+            </a-select-option>
+            <a-select-option value="2">
+              2
+            </a-select-option>
+            <a-select-option value="3">
+              3
+            </a-select-option>
+            <a-select-option value="4">
+              4
+            </a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item name="keyword">
+          <a-input style="width: 200px;" placeholder="文件名称" v-model:value="formModel.keyword" />
+        </a-form-item>
+        <a-form-item>
+          <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+            <template #icon>
+              <SearchOutlined />
+            </template>
+          </a-button>
+          <a-button @click="handleClickReset">
+            <template #icon>
+              <ReloadOutlined />
+            </template>
+          </a-button>
+        </a-form-item>
+      </a-form>
+    </a-col>
+  </a-row>
+  <a-modal v-model:visible="state.visible" title="设备绑定码" :footer="null">
+    <div>
+      请在 Pilot2 机场部署流程-云服务配置中,以组织ID和设备绑定码来绑定机场设备。
+    </div>
+    <div class="modal-item">
+      <div class="modal-item-title">
+        项目名称
+      </div>
+      <div>
+        上海展域航空技术有限公司
+      </div>
+    </div>
+    <div class="modal-item">
+      <div class="modal-item-title">
+        设备绑定码
+      </div>
+      <div>
+        PB97VR
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive } from 'vue';
+import { SearchOutlined, ReloadOutlined } from '@ant-design/icons-vue';
+
+interface Props {
+  selectedRowKeys: string[],
+  onClickDownload: () => Promise<any>,
+  onClickSearch: (query: any) => Promise<any>,
+  onClickReset: (query: any) => Promise<any>,
+};
+
+const props = withDefaults(defineProps<Props>(), {
+
+});
+
+const formRef = ref();
+
+const formModel = reactive({
+  date: [],
+  status: undefined,
+  device_name: undefined,
+  keyword: '',
+})
+
+const state = reactive({
+  visible: false,
+})
+
+// 点击查询
+const handleClicSekarch = async () => {
+  const values = formRef.value?.getFieldsValue();
+  await props.onClickSearch(values);
+}
+
+// 点击重置
+const handleClickReset = async () => {
+  formRef.value?.resetFields();
+  const values = formRef.value?.getFieldsValue();
+  await props.onClickReset(values);
+}
+</script>
+
+<style lang="scss" scoped>
+.popover {
+  width: 200px;
+}
+
+.modal-item {
+  display: flex;
+  margin-top: 20px;
+
+  &-title {
+    width: 100px;
+    font-weight: bold;
+  }
+}
+</style>

+ 316 - 3
Web/src/pages/page-web/projects/media/detail/index.vue

@@ -1,11 +1,324 @@
 <template>
-  <div>
-    这是媒体详情
+  <div class="mediaDetail">
+    <Search :selectedRowKeys="state.selectedRowKeys" :onClickDownload="onClickBatchDownload"
+      :onClickSearch="async () => { }" :onClickReset="async () => { }" />
+    <div style="background: #FFFFFF;padding: 20px;">
+      <div class="mediaDetail-info">
+        <div class="mediaDetail-info-left">
+          <div style="color: #7C7C7C;cursor: pointer;" @click="onClickGoBack">
+            媒体文件
+          </div>
+          <div style="margin: 0 10px;">
+            /
+          </div>
+          <div>
+            {{ 'DJI_20240624143929_0112_V.JPG' }}
+          </div>
+        </div>
+        <div class="mediaDetail-info-right">
+          <div class="mediaDetail-info-right-text">
+            <div>
+              已选/全部:
+            </div>
+            <div>
+              0/175
+            </div>
+          </div>
+          <a-button style="padding:0 5px;" :type="state.mode === 'table' ? 'primary' : 'default'"
+            :ghost="state.mode === 'table'" size="small" @click="state.mode = 'table'">
+            <MenuOutlined />
+          </a-button>
+          <a-button style="padding:0 5px;" :type="state.mode === 'list' ? 'primary' : 'default'"
+            :ghost="state.mode === 'list'" size="small" @click="state.mode = 'list'">
+            <AppstoreOutlined />
+          </a-button>
+        </div>
+      </div>
+      <div class="mediaDetail-table" v-if="state.mode === 'table'">
+        <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="file_id"
+          :loading="state.listLoading" :columns="columns" :dataSource="state.list" :rowClassName="rowClassName"
+          :pagination="paginationConfig"
+          :rowSelection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
+          <!-- 文件夹名称 -->
+          <template #file_name="{ record }">
+            <a-tooltip :title="record.file_name">
+              <div class="fileName" @click="onClickLookFile(record)">
+                <div>
+                  <img :src="record" v-if="1">
+                  <img :src="record" v-else>
+                </div>
+                <div>
+                  {{ record.file_name }}
+                </div>
+              </div>
+            </a-tooltip>
+          </template>
+          <!-- 操作 -->
+          <template #action="{ record }">
+            <div class="flex-align-center flex-row" style="color: #2d8cf0">
+              <a-tooltip title="照片位置" v-if="1">
+                <EnvironmentOutlined style="margin-right: 10px;" @click="onClickTrajectory" />
+              </a-tooltip>
+              <a-tooltip title="重命名" v-else-if="1">
+                <EditOutlined style="margin-right: 10px;" @click="onClickTrajectory" />
+              </a-tooltip>
+              <a-tooltip title="删除" v-else-if="1">
+                <DeleteOutlined style="margin-right: 10px;" @click="onClickTrajectory" />
+              </a-tooltip>
+              <a-tooltip title="压缩下载">
+                <DownloadOutlined @click="onClickDownload(record)" />
+              </a-tooltip>
+            </div>
+          </template>
+        </a-table>
+      </div>
+      <div class="mediaDetail-list" v-else>
+        <a-list :grid="{ gutter: 16, xs: 1, sm: 2, md: 3, lg: 4, xl: 8, xxl: 12 }" :loading="state.listLoading"
+          :dataSource="state.list" :pagination="paginationConfig">
+          <template #renderItem="{ item }">
+            <a-list-item>
+              <a-card hoverable @click="onClickFile(item)">
+                <template #cover>
+                  <div style="display: flex;justify-content:center;align-items: center;">
+                    <img style="width: 70%;" :src="fileSrc" />
+                  </div>
+                </template>
+                <a-card-meta>
+                  <template #description>
+                    <div>
+                      {{ item.file_name }}
+                    </div>
+                  </template>
+                </a-card-meta>
+              </a-card>
+            </a-list-item>
+          </template>
+        </a-list>
+      </div>
+    </div>
   </div>
+  <ImageModal :visible="state.imageModalVisible" :onClose="imageModalOnClickClose" />
 </template>
 
 <script lang="ts" setup>
+import { reactive, onMounted } from 'vue';
+import { MenuOutlined, AppstoreOutlined, EditOutlined, DeleteOutlined, DownloadOutlined, EnvironmentOutlined } from '@ant-design/icons-vue';
+import Search from './components/Search.vue';
+import ImageModal from './components/ImageModal.vue';
+import { getMediaFiles, downloadMediaFile } from '/@/api/media';
+import { downloadFile } from '/@/utils/common';
+import router from '/@/router/index';
 
+interface State {
+  workspaceId: string,
+  listLoading: boolean,
+  list: any[],
+  selectedRowKeys: string[],
+  mode: 'table' | 'list',
+  imageModalVisible: boolean,
+};
+
+const state: State = reactive({
+  workspaceId: localStorage.getItem('workspace_id') || '',
+  listLoading: false,
+  list: [],
+  selectedRowKeys: [],
+  mode: 'table',
+  imageModalVisible: false,
+})
+
+const paginationConfig = reactive({
+  pageSizeOptions: ['20', '50', '100'],
+  showQuickJumper: true,
+  showSizeChanger: true,
+  pageSize: 20,
+  current: 1,
+  total: 0,
+  onChange: async (current: number) => {
+    paginationConfig.current = current;
+    await fetchList();
+  },
+  onShowSizeChange: async (current: number, pageSize: number) => {
+    paginationConfig.pageSize = pageSize;
+    await fetchList();
+  }
+})
+
+const fetchList = async () => {
+  state.listLoading = true;
+  try {
+    const res = await getMediaFiles(state.workspaceId, { page: paginationConfig.current, page_size: paginationConfig.pageSize });
+    state.list = res.data.list;
+    paginationConfig.current = res.data.pagination.page;
+    paginationConfig.pageSize = res.data.pagination.page_size;
+    paginationConfig.total = res.data.pagination.total;
+  } catch (e) {
+    console.error(e);
+  } finally {
+    state.listLoading = false;
+  }
+}
+
+onMounted(async () => {
+  await fetchList();
+})
+
+const columns = [
+  {
+    title: '文件名称',
+    dataIndex: 'file_name',
+    width: 250,
+    ellipsis: true,
+    sorter: (a: any, b: any) => a.file_name.localeCompare(b.file_name),
+    slots: { customRender: 'file_name' }
+  },
+  {
+    title: '拍摄负载',
+    dataIndex: 'payload',
+    width: 150,
+    ellipsis: true,
+  },
+  {
+    title: '容量大小',
+    dataIndex: 'is_original',
+    width: 150,
+    ellipsis: true,
+  },
+  {
+    title: '创建时间',
+    dataIndex: 'create_time',
+    width: 200,
+    sorter: (a: any, b: any) => a.create_time.localeCompare(b.create_time),
+  },
+  {
+    title: '媒体类型',
+    dataIndex: 'create_time',
+    width: 150,
+  },
+  {
+    title: '照片类型',
+    dataIndex: 'create_time',
+    width: 150,
+  },
+  {
+    title: '操作',
+    dataIndex: 'actions',
+    fixed: 'right',
+    width: 80,
+    slots: { customRender: 'action' },
+  },
+]
+
+const rowClassName = (record: any, index: number) => {
+  const className = []
+  if ((index & 1) === 0) {
+    className.push('table-striped')
+  }
+  return className.toString().replaceAll(',', ' ')
+}
+
+// 点击批量下载
+const onClickBatchDownload = async () => {
+  console.log(state.selectedRowKeys, '点击批量下载');
+}
+
+// 点击返回
+const onClickGoBack = () => {
+  router.push({ path: '/media' })
+}
+
+// 勾选
+const onSelectChange = (selectedRowKeys: string[]) => {
+  state.selectedRowKeys = selectedRowKeys;
+}
+
+// 点击查看文件
+const onClickLookFile = (record: any) => {
+  state.imageModalVisible = true;
+}
+
+// 图片弹出层-点击关闭
+const imageModalOnClickClose = () => {
+  state.imageModalVisible = false;
+}
+
+// 点击下载
+const onClickDownload = async (record: any) => {
+  state.listLoading = true;
+  try {
+    const res = await downloadMediaFile(state.workspaceId, record.file_id);
+    if (!res) {
+      return
+    }
+    const data = new Blob([res]);
+    downloadFile(data, record.file_name);
+  } catch (e) {
+    console.error(e);
+  } finally {
+    state.listLoading = false;
+  }
+}
+
+// 点击轨迹回放
+const onClickTrajectory = () => {
+  router.push({ path: '/trajectory' })
+}
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss">
+.mediaDetail {
+  padding: 20px;
+
+  &-info {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
+
+    &-left {
+      display: flex;
+      align-items: center;
+    }
+
+    &-right {
+      display: flex;
+      align-items: center;
+
+      &-text {
+        display: flex;
+        align-items: center;
+        margin-right: 20px;
+      }
+    }
+  }
+
+  .fileName {
+    display: flex;
+    align-items: center;
+    cursor: pointer;
+
+    img {
+      width: 36px;
+      height: 36px;
+      margin-right: 5px;
+    }
+  }
+}
+
+.ant-table {
+  border-top: 1px solid rgb(0, 0, 0, 0.06);
+  border-bottom: 1px solid rgb(0, 0, 0, 0.06);
+}
+
+.ant-table-tbody tr td {
+  border: 0;
+}
+
+.table-striped {
+  background-color: #f7f9fa;
+}
+
+.ant-card-body {
+  padding: 0 10px 10px;
+}
+</style>

+ 3 - 4
Web/src/pages/page-web/projects/media/index/components/Search.vue

@@ -11,7 +11,7 @@
           <a-range-picker style="width: 250px;" v-model:value="formModel.date" />
         </a-form-item>
         <a-form-item name="status">
-          <a-select style="width: 200px;margin-right: 10px;" placeholder="请选择任务类型" v-model:value="formModel.status">
+          <a-select style="width: 200px;" placeholder="请选择任务类型" v-model:value="formModel.status">
             <a-select-option value="1">
               1
             </a-select-option>
@@ -27,8 +27,7 @@
           </a-select>
         </a-form-item>
         <a-form-item name="device_name">
-          <a-select style="width: 200px;margin-right: 10px;" placeholder="请选择拍摄负载"
-            v-model:value="formModel.device_name">
+          <a-select style="width: 200px;" placeholder="请选择拍摄负载" v-model:value="formModel.device_name">
             <a-select-option value="1">
               1
             </a-select-option>
@@ -44,7 +43,7 @@
           </a-select>
         </a-form-item>
         <a-form-item name="keyword">
-          <a-input style="width: 200px;margin-right: 10px;" placeholder="文件夹名称" v-model:value="formModel.keyword" />
+          <a-input style="width: 200px;" placeholder="文件夹名称" v-model:value="formModel.keyword" />
         </a-form-item>
         <a-form-item>
           <a-button style="margin-right: 10px;" @click="handleClicSekarch">

+ 8 - 10
Web/src/pages/page-web/projects/media/index/index.vue

@@ -5,9 +5,7 @@
     <div style="background: #FFFFFF;padding: 20px;">
       <div class="mediaList-info">
         <div>
-          <a-button type="primary" v-if="state.mode === 'table'">
-            全选
-          </a-button>
+          媒体文件
         </div>
         <div class="mediaList-info-right">
           <div class="mediaList-info-right-text">
@@ -31,7 +29,8 @@
       <div class="mediaList-table" v-if="state.mode === 'table'">
         <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="file_id"
           :loading="state.listLoading" :columns="columns" :dataSource="state.list" :rowClassName="rowClassName"
-          :pagination="paginationConfig" :rowSelection="rowSelection">
+          :pagination="paginationConfig"
+          :rowSelection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
           <!-- 文件夹名称 -->
           <template #file_name="{ record }">
             <a-tooltip :title="record.file_name">
@@ -209,12 +208,6 @@ const rowClassName = (record: any, index: number) => {
   return className.toString().replaceAll(',', ' ')
 }
 
-const rowSelection = {
-  onChange: (selectedRowKeys: string[]) => {
-    state.selectedRowKeys = selectedRowKeys;
-  },
-}
-
 // 点击批量下载
 const onClickBatchDownload = async () => {
   console.log(state.selectedRowKeys, '点击批量下载');
@@ -225,6 +218,11 @@ const onClickFile = (record: any) => {
   router.push({ path: `/media/${record.file_id}` })
 }
 
+// 勾选
+const onSelectChange = (selectedRowKeys: string[]) => {
+  state.selectedRowKeys = selectedRowKeys;
+}
+
 // 点击下载
 const onClickDownload = async (record: any) => {
   state.listLoading = true;