|
|
@@ -74,7 +74,7 @@
|
|
|
<a-tooltip title="重命名" v-else-if="record.media_type === 4">
|
|
|
<EditOutlined style="margin-right: 10px;" @click="onClickRechristen(record)" />
|
|
|
</a-tooltip>
|
|
|
- <a-tooltip title="删除" v-else-if="record.media_type === 2">
|
|
|
+ <a-tooltip title="删除" >
|
|
|
<DeleteOutlined style="margin-right: 10px;" @click="onClickDelete(record)" />
|
|
|
</a-tooltip>
|
|
|
<a-tooltip title="压缩下载">
|
|
|
@@ -92,7 +92,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { reactive, onMounted } from 'vue';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
+import { message ,Modal} from 'ant-design-vue';
|
|
|
import { EditOutlined, DeleteOutlined, DownloadOutlined, AimOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons-vue';
|
|
|
import Search from './components/Search.vue';
|
|
|
import FileInfo from './components/FileInfo.vue';
|
|
|
@@ -102,7 +102,7 @@ import { apis } from '/@/api/custom';
|
|
|
import router from '/@/router/index';
|
|
|
import { downloadFile } from '/@/utils/common';
|
|
|
import { downloadMediaFile } from '/@/api/media';
|
|
|
-import { getWorkspaceId } from '/@/utils/index'
|
|
|
+import { getWorkspaceId } from '/@/utils/index';
|
|
|
|
|
|
interface State {
|
|
|
query: any,
|
|
|
@@ -253,12 +253,24 @@ const onClickBatchDownload = async () => {
|
|
|
|
|
|
// 点击批量删除
|
|
|
const onClickBatchDelete = async () => {
|
|
|
- const canDeleteList = state.list.filter(item => state.selectedRowKeys.includes(item.file_id) && item.media_type === 2);
|
|
|
+ const canDeleteList = state.list.filter(item => state.selectedRowKeys.includes(item.file_id));
|
|
|
const data = {
|
|
|
id: canDeleteList.map(item => item.file_id).join(',')
|
|
|
}
|
|
|
- await apis.batchDeletePicture(data);
|
|
|
- await fetchList()
|
|
|
+ Modal.confirm({
|
|
|
+ title: '删除',
|
|
|
+ content: '您确认删除文件吗?',
|
|
|
+ okType: 'danger',
|
|
|
+ onOk: async () => {
|
|
|
+ try {
|
|
|
+ await apis.batchDeletePicture(data);
|
|
|
+ message.success('删除成功');
|
|
|
+ await fetchList();
|
|
|
+ } catch (error) {
|
|
|
+ message.error('删除失败: ' + error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 点击搜索
|
|
|
@@ -332,10 +344,24 @@ const onClickSave = async (record: any) => {
|
|
|
|
|
|
// 点击删除
|
|
|
const onClickDelete = async (record: any) => {
|
|
|
+ console.log(record,"record");
|
|
|
const data = {
|
|
|
id: record.file_id
|
|
|
}
|
|
|
- await apis.batchDeletePicture(data);
|
|
|
+ Modal.confirm({
|
|
|
+ title: '删除',
|
|
|
+ content: '您确认删除文件吗?',
|
|
|
+ okType: 'danger',
|
|
|
+ onOk: async () => {
|
|
|
+ try {
|
|
|
+ await apis.batchDeletePicture(data);
|
|
|
+ message.success('删除成功');
|
|
|
+ await fetchList();
|
|
|
+ } catch (error) {
|
|
|
+ message.error('删除失败: ' + error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 点击下载
|