1.回收站功能前后端实现
2.文件管理前后端实现 3.样式未调整、功能初步测试通过
This commit is contained in:
@@ -2,9 +2,13 @@ package com.zyplayer.doc.data.repository.manage.mapper;
|
||||
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zyplayer.doc.data.repository.manage.param.PageFileQueryParam;
|
||||
import com.zyplayer.doc.data.repository.manage.vo.WikiPageFileInfoVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
@@ -17,4 +21,8 @@ public interface WikiPageFileMapper extends BaseMapper<WikiPageFile> {
|
||||
|
||||
@Update("update wiki_page_file set download_num=download_num+1 where id=#{id}")
|
||||
void addDownloadNum(@Param("id") Long id);
|
||||
|
||||
List<WikiPageFileInfoVo> getFileInfosVo(PageFileQueryParam pageFileQueryParam);
|
||||
|
||||
Long getFileInfoCount(PageFileQueryParam pageFileQueryParam);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.zyplayer.doc.data.repository.manage.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PageFileQueryParam {
|
||||
private String name;
|
||||
private String status;
|
||||
private String file;
|
||||
private String type;
|
||||
private int pageSize;
|
||||
private int current;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.zyplayer.doc.data.repository.manage.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件相关信息
|
||||
*
|
||||
* @author sh1yu
|
||||
* @since 2023-10-17
|
||||
*/
|
||||
@Data
|
||||
public class WikiPageFileInfoVo {
|
||||
private String id;
|
||||
private String name;
|
||||
private String size;
|
||||
private String uuid;
|
||||
private String user;
|
||||
private Date time ;
|
||||
private String status;
|
||||
private String type;
|
||||
private String file;
|
||||
}
|
||||
@@ -1,5 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zyplayer.doc.data.repository.manage.mapper.WikiPageFileMapper">
|
||||
|
||||
<select id="getFileInfosVo" resultType="com.zyplayer.doc.data.repository.manage.vo.WikiPageFileInfoVo">
|
||||
SELECT a.id as id,
|
||||
a.file_name as name,
|
||||
a.file_size as size,
|
||||
a.uuid as uuid,
|
||||
a.create_user_name as user,
|
||||
a.create_time as time ,
|
||||
a.del_flag as status,
|
||||
a.file_source as type,
|
||||
b.del_flag as file
|
||||
from wiki_page_file a left JOIN wiki_page b on a.page_id = b.id
|
||||
where a.del_flag != 2
|
||||
<if test="name != null and name != ''">
|
||||
and (
|
||||
a.file_name like #{name}
|
||||
)
|
||||
</if>
|
||||
<if test="status != null and status != '' and status != 9">
|
||||
and (
|
||||
a.del_flag = #{status}
|
||||
)
|
||||
</if>
|
||||
<if test="file != null and file != '' and file != 9">
|
||||
and (
|
||||
b.del_flag = #{file}
|
||||
)
|
||||
</if>
|
||||
<if test="type != null and type != '' and type != 0">
|
||||
and (
|
||||
a.file_source = #{type}
|
||||
)
|
||||
</if>
|
||||
order by b.id
|
||||
limit #{pageSize} offset #{current}
|
||||
</select>
|
||||
<select id="getFileInfoCount" resultType="java.lang.Long">
|
||||
SELECT count(*)
|
||||
from wiki_page_file a left JOIN wiki_page b on a.page_id = b.id
|
||||
where a.del_flag != 2
|
||||
<if test="name != null and name != ''">
|
||||
and (
|
||||
a.file_name like #{name}
|
||||
)
|
||||
</if>
|
||||
<if test="status != null and status != '' and status != 9">
|
||||
and (
|
||||
a.del_flag = #{status}
|
||||
)
|
||||
</if>
|
||||
<if test="file != null and file != '' and file != 9">
|
||||
and (
|
||||
b.del_flag = #{file}
|
||||
)
|
||||
</if>
|
||||
<if test="type != null and type != '' and type != 0">
|
||||
and (
|
||||
a.file_source = #{type}
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -5,6 +5,9 @@ export default {
|
||||
pageUpdate: (data) => request({url: '/zyplayer-doc-wiki/page/update', method: 'post', data: Qs.stringify(data)}),
|
||||
pageChangeParent: (data) => request({url: '/zyplayer-doc-wiki/page/changeParent', method: 'post', data: Qs.stringify(data)}),
|
||||
pageList: (data) => request({url: '/zyplayer-doc-wiki/page/list', method: 'post', data: Qs.stringify(data)}),
|
||||
deleted: (data) => request({url: '/zyplayer-doc-wiki/page/deleted', method: 'post', data: Qs.stringify(data)}),
|
||||
revert: (data) => request({url: '/zyplayer-doc-wiki/page/revert', method: 'post', data: Qs.stringify(data)}),
|
||||
destroy: (data) => request({url: '/zyplayer-doc-wiki/page/destroy', method: 'post', data: Qs.stringify(data)}),
|
||||
updatePage: (data) => request({url: '/zyplayer-doc-wiki/page/update', method: 'post', data: Qs.stringify(data)}),
|
||||
copyPage: (data) => request({url: '/zyplayer-doc-wiki/page/copy', method: 'post', data: Qs.stringify(data)}),
|
||||
movePage: (data) => request({url: '/zyplayer-doc-wiki/page/move', method: 'post', data: Qs.stringify(data)}),
|
||||
@@ -26,7 +29,9 @@ export default {
|
||||
updateSpace: (data) => request({url: '/zyplayer-doc-wiki/space/update', method: 'post', data: Qs.stringify(data)}),
|
||||
getPageUserAuthList: (data) => request({url: '/zyplayer-doc-wiki/page/auth/list', method: 'post', data: Qs.stringify(data)}),
|
||||
assignPageUserAuth: (data) => request({url: '/zyplayer-doc-wiki/page/auth/assign', method: 'post', data: Qs.stringify(data)}),
|
||||
destoryFile: (data) => request({url: '/zyplayer-doc-wiki/page/file/destory', method: 'post', data: Qs.stringify(data)}),
|
||||
deletePageFile: (data) => request({url: '/zyplayer-doc-wiki/page/file/delete', method: 'post', data: Qs.stringify(data)}),
|
||||
fileInfoList: (data) => request({url: '/zyplayer-doc-wiki/page/file/list', method: 'post', data: Qs.stringify(data)}),
|
||||
pageCommentList: (data) => request({url: '/zyplayer-doc-wiki/page/comment/list', method: 'post', data: Qs.stringify(data)}),
|
||||
updatePageComment: (data) => request({url: '/zyplayer-doc-wiki/page/comment/update', method: 'post', data: Qs.stringify(data)}),
|
||||
deletePageComment: (data) => request({url: '/zyplayer-doc-wiki/page/comment/delete', method: 'post', data: Qs.stringify(data)}),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="padding: 10px;height: 100%;box-sizing: border-box;background: #fafafa;">
|
||||
<div style="padding: 10px;height: 100%;box-sizing: border-box;background: #fafafa;position: relative">
|
||||
<div style="margin-bottom: 5px">
|
||||
<el-select :model-value="choiceSpace" filterable placeholder="选择空间" @change="spaceChangeEvents" style="width: 100%">
|
||||
<el-option-group label="" v-if="!props.readOnly">
|
||||
@@ -54,9 +54,9 @@
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
<div class="sidebar-tool-box">
|
||||
<div v-if="!props.readOnly" class="sidebar-tool-box">
|
||||
<span class="sidebar-tool-box-bottom">
|
||||
<a-divider />
|
||||
<span >
|
||||
<a-button type="text" @click="routeToFileCtl()">
|
||||
<template #icon><DatabaseOutlined /></template>
|
||||
文件管理
|
||||
@@ -78,6 +78,7 @@ import pageApi from '../../assets/api/page'
|
||||
import {useStoreDisplay} from "@/store/wikiDisplay";
|
||||
import {useStorePageData} from "@/store/pageData";
|
||||
import {DatabaseOutlined,DeleteOutlined} from '@ant-design/icons-vue';
|
||||
import {useStoreSpaceData} from "@/store/spaceData";
|
||||
|
||||
|
||||
let emit = defineEmits(['doGetPageList', 'spaceChangeEvents', 'setNowPageId'])
|
||||
@@ -91,7 +92,9 @@ let router = useRouter();
|
||||
let defaultProps = ref({children: 'children', label: 'name',});
|
||||
let wikiPage = ref({});
|
||||
let wikiPageTreeRef = ref();
|
||||
let storePage = useStorePageData();
|
||||
let storeDisplay = useStoreDisplay();
|
||||
let storeSpace = useStoreSpaceData();
|
||||
let props = defineProps({
|
||||
wikiPageList: Array,
|
||||
spaceOptions: Array,
|
||||
@@ -155,7 +158,6 @@ const filterPageNode = (value, data) => {
|
||||
const searchByKeywords = () => {
|
||||
wikiPageTreeRef.value.filter(searchKeywords.value)
|
||||
}
|
||||
let storePage = useStorePageData();
|
||||
const handleNodeClick = (data) => {
|
||||
//console.log('点击节点:', data, props.nowPageId)
|
||||
storeDisplay.showHeader = true
|
||||
@@ -197,7 +199,14 @@ defineExpose({searchByKeywords})
|
||||
</script>
|
||||
<style scoped>
|
||||
.sidebar-tool-box{
|
||||
text-align:center;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
}
|
||||
.sidebar-tool-box-bottom{
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<div>
|
||||
<span class="up-query-param-span">
|
||||
<a-form :model="queryParam" :label-col="2" :wrapper-col="3">
|
||||
<a-form :model="queryParam" :label-col="{span: 8}" :wrapper-col="{span: 16}">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="5">
|
||||
<a-form-item label="文件名">
|
||||
<a-input v-model:value="queryParam.name" placeholder="Basic usage" />
|
||||
<a-input v-model:value="queryParam.name" placeholder="请输入文件名"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="5">
|
||||
<a-form-item label="文件状态">
|
||||
<a-select ref="select" v-model:value="queryParam.status">
|
||||
<a-select-option value="0">全部</a-select-option>
|
||||
<a-select-option value="9">全部</a-select-option>
|
||||
<a-select-option value="1">未删除</a-select-option>
|
||||
<a-select-option value="2">已删除</a-select-option>
|
||||
</a-select>
|
||||
@@ -20,7 +20,7 @@
|
||||
<a-col :span="5">
|
||||
<a-form-item label="文档状态">
|
||||
<a-select ref="select" v-model:value="queryParam.file">
|
||||
<a-select-option value="0">全部</a-select-option>
|
||||
<a-select-option value="9">全部</a-select-option>
|
||||
<a-select-option value="1">未删除</a-select-option>
|
||||
<a-select-option value="2">已删除</a-select-option>
|
||||
</a-select>
|
||||
@@ -28,10 +28,7 @@
|
||||
</a-col>
|
||||
<a-col :span="5">
|
||||
<a-form-item label="文件类型">
|
||||
<a-select
|
||||
ref="select"
|
||||
v-model:value="queryParam.type"
|
||||
>
|
||||
<a-select ref="select" v-model:value="queryParam.type">
|
||||
<a-select-option value="0">全部</a-select-option>
|
||||
<a-select-option value="1">附件</a-select-option>
|
||||
<a-select-option value="2">文档内含附件</a-select-option>
|
||||
@@ -39,69 +36,236 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="4">
|
||||
<a-button type="primary" @click="onSubmit">查询</a-button>
|
||||
<a-button type="primary" @click="query">
|
||||
<template #icon><SearchOutlined/></template>
|
||||
查询
|
||||
</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</span>
|
||||
<a-divider/>
|
||||
<a-table :columns="columns" :data-source="table" :pagination="{ pageSize: 10 }" :scroll="{ x: 1200, y: 'calc(100vh - 280px)' }">
|
||||
<template v-slot:bodyCell="{ column, record ,index}">
|
||||
<span v-if="column.key === 'action'">
|
||||
<a-button @click="showDoc(record)">
|
||||
<template #icon><AimOutlined /></template>
|
||||
关联文档
|
||||
<a-button type="primary" danger @click="doDeleteSelected()">
|
||||
<template #icon>
|
||||
<DeleteFilled/>
|
||||
</template>
|
||||
删除选中文件
|
||||
</a-button>
|
||||
</span>
|
||||
<a-radio-group v-model:value="showStyle" size="large" button-style="solid" style="margin-left: 20px">
|
||||
<a-radio-button value="table">
|
||||
<TableOutlined/>
|
||||
列表展示
|
||||
</a-radio-button>
|
||||
<a-radio-button value="card">
|
||||
卡片展示
|
||||
<ProfileOutlined/>
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
<a-table v-if="showStyle === 'table'" :columns="columns" :data-source="table"
|
||||
:scroll="{ x: 1200, y: 'calc(100vh - 280px)' }" :row-selection="rowSelection" :pagination=false
|
||||
rowKey="id">
|
||||
<template v-slot:bodyCell="{ column, record ,index}">
|
||||
<a-tag v-if="column.dataIndex === 'size'" color="#f50">
|
||||
{{ sizeConvert(record.size) }}
|
||||
</a-tag>
|
||||
<a-tag v-if="column.dataIndex === 'status'" color="#f50">
|
||||
{{ statusDesc(record.status) }}
|
||||
</a-tag>
|
||||
<a-tag v-if="column.dataIndex === 'file'" color="#f50">
|
||||
{{ statusDesc(record.file) }}
|
||||
</a-tag>
|
||||
<a-tag v-if="column.dataIndex === 'type'" color="#f50">
|
||||
{{ typeDesc(record.type) }}
|
||||
</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
<div v-if="showStyle === 'card'">
|
||||
<span v-for="item in table" @click="mark(item)">
|
||||
<div v-if="item.type === '1'" :title="item.name">
|
||||
<a-descriptions title="文件名" bordered size="small"
|
||||
:column="{ xxl: 1, xl: 1, lg: 1, md: 1, sm: 1, xs: 1 }"
|
||||
style="width: 250px;height:350px">
|
||||
<a-descriptions-item label="文件名称">{{item.name}}</a-descriptions-item>
|
||||
<a-descriptions-item label="文件大小">{{sizeConvert(item.size)}}</a-descriptions-item>
|
||||
<a-descriptions-item label="文件状态">{{statusDesc(item.status)}}</a-descriptions-item>
|
||||
<a-descriptions-item label="文件状态">{{statusDesc(item.file)}}</a-descriptions-item>
|
||||
<a-descriptions-item label="文件类型">{{typeDesc(item.type)}}</a-descriptions-item>
|
||||
<a-descriptions-item label="上传者">{{item.user}}</a-descriptions-item>
|
||||
<a-descriptions-item label="上传时间">{{item.time}}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</div>
|
||||
<a-tabs v-if="item.type === '2'" v-model:activeKey="activeKey" @mouseenter="showImage()"
|
||||
@mouseleave="showDetail()">
|
||||
<a-tab-pane key='1' tab="图片页">
|
||||
<a-image :width="250" :height="300" :src="buildSrc(item.uuid)"/>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key='2' tab="详情页">
|
||||
<div style="width: 250px;height:300px;">
|
||||
<a-descriptions title="图像详情" bordered size="small"
|
||||
:column="{ xxl: 1, xl: 1, lg: 1, md: 1, sm: 1, xs: 1 }">
|
||||
<a-descriptions-item label="文件名称">{{item.name}}</a-descriptions-item>
|
||||
<a-descriptions-item label="文件大小">{{sizeConvert(item.size)}}</a-descriptions-item>
|
||||
<a-descriptions-item label="文件状态">{{statusDesc(item.status)}}</a-descriptions-item>
|
||||
<a-descriptions-item label="文件状态">{{statusDesc(item.file)}}</a-descriptions-item>
|
||||
<a-descriptions-item label="文件类型">{{typeDesc(item.type)}}</a-descriptions-item>
|
||||
<a-descriptions-item label="上传者">{{item.user}}</a-descriptions-item>
|
||||
<a-descriptions-item label="上传时间">{{item.time}}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
<template #renderTabBar="{ DefaultTabBar, ...props }"></template>
|
||||
</a-tabs>
|
||||
<CheckCircleTwoTone v-if="item.choose" twoToneColor="#52c41a" style="margin-right: 200px"/>
|
||||
<CheckCircleTwoTone v-else twoToneColor="#e5ecf7" style="margin-right: 200px"/>
|
||||
</span>
|
||||
</div>
|
||||
<a-pagination v-model:current="queryParam.current"
|
||||
:page-size-options="activeKey === 'card'?pageSizeOptionsCard:pageSizeOptions"
|
||||
:total="queryParam.total" :page-size="queryParam.pageSize" show-size-changer
|
||||
@showSizeChange="onShowSizeChange" @change="pageQuery">
|
||||
<template #buildOptionText="props">
|
||||
<span v-if="props.value !== '50'">{{ props.value }}条/页</span>
|
||||
<span v-else>全部</span>
|
||||
</template>
|
||||
</a-pagination>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {AimOutlined} from '@ant-design/icons-vue';
|
||||
import {ref} from "vue";
|
||||
import {
|
||||
AimOutlined,
|
||||
SearchOutlined,
|
||||
DeleteFilled,
|
||||
TableOutlined,
|
||||
ProfileOutlined,
|
||||
CheckCircleTwoTone
|
||||
} from '@ant-design/icons-vue';
|
||||
import {onMounted, ref} from "vue";
|
||||
import {mavonEditor} from "mavon-editor";
|
||||
import pageApi from '../../assets/api/page'
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
|
||||
let visible = ref(false)
|
||||
let showStyle = ref('table')
|
||||
let activeKey = ref('1')
|
||||
let pageSizeOptionsCard = ref(['4', '8']);
|
||||
let pageSizeOptions = ref(['10', '20']);
|
||||
let deleteQueue = ref([]);
|
||||
let queryParam = ref({
|
||||
current: 1,
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
name: '',
|
||||
status:'0',
|
||||
file:'0',
|
||||
status: '9',
|
||||
file: '9',
|
||||
type: '0'
|
||||
})
|
||||
let table = ref([
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward Kingsssssssssssssssssssssssssssssssssssss ', age: 32, address: 'London, Park Lane no. ',}
|
||||
]);
|
||||
let table = ref([]);
|
||||
let columns = ref([
|
||||
{title: '文件名称', dataIndex: 'name', width: '500',},
|
||||
{title: '文件大小', dataIndex: 'age', width: '100',},
|
||||
{title: '文件状态', dataIndex: 'address', width: '100',},
|
||||
{title: '文档状态', dataIndex: 'address', width: '100',},
|
||||
{title: '上传者', dataIndex: 'address', width: '150',},
|
||||
{title: '上传时间', dataIndex: 'address', width: '150',},
|
||||
{ title: '详情查看', key: 'action', fixed: 'right',width: '150',},
|
||||
{title: '文件大小', dataIndex: 'size', width: '100',},
|
||||
{title: '文件状态', dataIndex: 'status', width: '100',},
|
||||
{title: '文档状态', dataIndex: 'file', width: '100',},
|
||||
{title: '文档类型', dataIndex: 'type', width: '100',},
|
||||
{title: '上传者', dataIndex: 'user', width: '150',},
|
||||
{title: '上传时间', dataIndex: 'time', width: '150',},
|
||||
])
|
||||
const onSubmit = () => {
|
||||
onMounted(() => {
|
||||
query()
|
||||
})
|
||||
const rowSelection = {
|
||||
selectedRowKeys: deleteQueue,
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
deleteQueue.value = selectedRowKeys
|
||||
console.log(selectedRowKeys)
|
||||
},
|
||||
onSelect: (record, selected, selectedRows) => {
|
||||
//console.log(record, selected, selectedRows);
|
||||
},
|
||||
onSelectAll: (selected, selectedRows, changeRows) => {
|
||||
//console.log(selected, selectedRows, changeRows);
|
||||
},
|
||||
};
|
||||
|
||||
const statusDesc = (status) => {
|
||||
const statusMap = {
|
||||
0: '未删除',
|
||||
1: '已删除',
|
||||
}
|
||||
const showDoc = (record) => {
|
||||
return statusMap[status]
|
||||
}
|
||||
const typeDesc = (type) => {
|
||||
const typeMap = {
|
||||
1: '附件',
|
||||
2: '影像',
|
||||
}
|
||||
return typeMap[type]
|
||||
}
|
||||
const sizeConvert = (size) => {
|
||||
size = size / 1024 / 1024
|
||||
return size.toFixed(2) + 'M'
|
||||
}
|
||||
|
||||
const query = () => {
|
||||
pageApi.fileInfoList(queryParam.value).then((json) => {
|
||||
table.value = json.data || []
|
||||
queryParam.value.total = json.total
|
||||
})
|
||||
}
|
||||
const doDeleteSelected = () => {
|
||||
ElMessageBox.confirm("确认要删除选中的文件吗?删除后不可恢复!", '重要提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
if (showStyle.value === 'card') {
|
||||
let deleteList = [];
|
||||
let temp = table
|
||||
temp = temp.value.filter(item => (item.choose))
|
||||
temp.forEach(item => {
|
||||
deleteList.push(item.id)
|
||||
})
|
||||
pageApi.destoryFile({arr: deleteList}).then(() => {
|
||||
query()
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
pageApi.destoryFile({arr: deleteQueue.value}).then(() => {
|
||||
query()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const buildSrc = (uuid) => {
|
||||
return "zyplayer-doc-wiki/common/file?uuid=" + uuid;
|
||||
};
|
||||
const showImage = () => {
|
||||
activeKey.value = '2'
|
||||
};
|
||||
const showDetail = () => {
|
||||
activeKey.value = '1'
|
||||
};
|
||||
const pageQuery = () => {
|
||||
deleteQueue.value = []
|
||||
query()
|
||||
};
|
||||
const onShowSizeChange = (current, size) => {
|
||||
queryParam.value.pageSize = size;
|
||||
deleteQueue.value = []
|
||||
query()
|
||||
};
|
||||
const mark = (item) => {
|
||||
let choosed = item.choose;
|
||||
if (choosed === undefined) {
|
||||
choosed = false
|
||||
}
|
||||
item.choose = !choosed
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.up-query-param-span {
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-table :columns="columns" :data-source="table" :pagination="{ pageSize: 10 }" :scroll="{ y: 240 }">
|
||||
<a-table :columns="columns" :data-source="table" :pagination=false :scroll="{ y: 'calc(100vh - 170px)' }">
|
||||
<template v-slot:bodyCell="{ column, record ,index}">
|
||||
<span v-if="column.key === 'action'">
|
||||
<a-button @click="showFiles(record)">
|
||||
<template #icon><TableOutlined /></template>
|
||||
相关文件
|
||||
</a-button>
|
||||
<a-divider type="vertical"/>
|
||||
<a-button @click="revertConfirm(record)">
|
||||
<template #icon><UndoOutlined /></template>
|
||||
@@ -20,88 +16,91 @@
|
||||
</span>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<a-modal :open="visible" title="详情展示" :closable="false">
|
||||
<template #footer>
|
||||
<a-button key="Submit" type="primary" @click="handleOk">好的</a-button>
|
||||
<a-pagination v-model:current="queryParam.current"
|
||||
:page-size-options="pageSizeOptions"
|
||||
:total="queryParam.total" :page-size="queryParam.pageSize" show-size-changer
|
||||
@showSizeChange="onShowSizeChange" @change="initDeleted">
|
||||
<template #buildOptionText="props">
|
||||
<span v-if="props.value !== '50'">{{ props.value }}条/页</span>
|
||||
<span v-else>全部</span>
|
||||
</template>
|
||||
<a-carousel arrows>
|
||||
<template #nextArrow>
|
||||
<div class="custom-slick-arrow" style="right: 10px">
|
||||
<right-circle-outlined />
|
||||
</a-pagination>
|
||||
</div>
|
||||
</template>
|
||||
<div><h3>1</h3></div>
|
||||
<div><h3>2</h3></div>
|
||||
<div><h3>3</h3></div>
|
||||
<div><h3>4</h3></div>
|
||||
</a-carousel>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import {UndoOutlined,DeleteFilled,TableOutlined,RightCircleOutlined,} from '@ant-design/icons-vue';
|
||||
import {ref} from "vue";
|
||||
let visible = ref(false)
|
||||
let table = ref([
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',},
|
||||
{key: 321, name: 'Edward King ', age: 32, address: 'London, Park Lane no. ',}
|
||||
]);
|
||||
import {onBeforeUnmount, onMounted, ref} from "vue";
|
||||
import pageApi from '../../assets/api/page'
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {useStoreSpaceData} from "@/store/spaceData";
|
||||
import {useStorePageData} from "@/store/pageData";
|
||||
let storeSpace = useStoreSpaceData();
|
||||
let storePage = useStorePageData();
|
||||
let table = ref([]);
|
||||
let pageSizeOptions = ref(['10', '20']);
|
||||
|
||||
let columns = ref([
|
||||
{title: '名称', dataIndex: 'name', width: '50%' ,},
|
||||
{title: '删除日期', dataIndex: 'age', width: '15%',},
|
||||
{title: '操作者', dataIndex: 'address', width: '15%',},
|
||||
{title: '名称', dataIndex: 'name', width: '40%' ,},
|
||||
{title: '删除日期', dataIndex: 'updateTime', width: '17%',},
|
||||
{title: '操作者', dataIndex: 'updateUserName', width: '16%',},
|
||||
{title: '', key: 'action'},
|
||||
])
|
||||
const handleOk = (e) => {
|
||||
visible.value = false;
|
||||
}
|
||||
const showFiles = (record) => {
|
||||
visible.value = true;
|
||||
let queryParam = ref({
|
||||
current: 1,
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
spaceId: storeSpace.chooseSpaceId
|
||||
})
|
||||
onMounted(() => {
|
||||
initDeleted()
|
||||
})
|
||||
const onShowSizeChange = (current, size) => {
|
||||
queryParam.value.pageSize = size;
|
||||
initDeleted()
|
||||
};
|
||||
const initDeleted = () => {
|
||||
pageApi.deleted(queryParam.value).then((json) => {
|
||||
table.value = json.data || []
|
||||
queryParam.value.total = json.total
|
||||
})
|
||||
console.log()
|
||||
}
|
||||
|
||||
const revertConfirm = (record) => {
|
||||
ElMessageBox.confirm('确定要还原此文档吗(仅此文档,若父级文档不存在还原当前空间根目录)?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
let param = {pageId: record.id}
|
||||
pageApi.revert(param).then(() => {
|
||||
ElMessage.success('还原成功!')
|
||||
doGetPageList()
|
||||
initDeleted()
|
||||
})
|
||||
})
|
||||
}
|
||||
const doGetPageList = (parentId, node) => {
|
||||
let param = {spaceId: storeSpace.chooseSpaceId}
|
||||
pageApi.pageList(param).then((json) => {
|
||||
storePage.wikiPageList = json.data || []
|
||||
})
|
||||
}
|
||||
const destroy = (record) => {
|
||||
ElMessageBox.confirm('确定要物理删除此文档吗?(关联的文件不会被删除仅删除文档)', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
let param = {pageId: record.id}
|
||||
pageApi.destroy(param).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
doGetPageList()
|
||||
initDeleted()
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.ant-carousel :deep(.slick-slide) {
|
||||
text-align: center;
|
||||
height: 160px;
|
||||
line-height: 160px;
|
||||
background: #364d79;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ant-carousel :deep(.slick-arrow.custom-slick-arrow) {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
font-size: 25px;
|
||||
color: #fff;
|
||||
background-color: rgba(31, 45, 61, 0.11);
|
||||
opacity: 0.3;
|
||||
}
|
||||
.ant-carousel :deep(.custom-slick-arrow:before) {
|
||||
display: none;
|
||||
}
|
||||
.ant-carousel :deep(.custom-slick-arrow:hover) {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.ant-carousel :deep(.slick-slide h3) {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,6 +4,8 @@ import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.enums.PageFileSource;
|
||||
import com.zyplayer.doc.core.exception.ConfirmException;
|
||||
@@ -543,5 +545,49 @@ public class WikiPageController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/deleted")
|
||||
public ResponseJson<List<WikiPage>> deletedList(int spaceId,int current ,int pageSize) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("space_id", spaceId);
|
||||
queryWrapper.eq("del_flag",1);
|
||||
IPage<WikiPage> page = new Page<>(current, pageSize, false);
|
||||
wikiPageService.page(page, queryWrapper);
|
||||
page.setTotal(wikiPageService.count(queryWrapper));
|
||||
return DocResponseJson.ok(page);
|
||||
}
|
||||
@PostMapping("/destroy")
|
||||
public ResponseJson destroyPage(int pageId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||
updateWrapper.eq("id", pageId);
|
||||
updateWrapper.eq("del_flag",1);
|
||||
updateWrapper.set("del_flag",2);
|
||||
wikiPageService.update(updateWrapper);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
@PostMapping("/revert")
|
||||
public ResponseJson revertPage(int pageId) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||
updateWrapper.eq("id", pageId);
|
||||
updateWrapper.eq("del_flag",1);
|
||||
updateWrapper.set("del_flag",0);
|
||||
if (!canPageShow(pageId)) {
|
||||
updateWrapper.set("parent_id",0);
|
||||
}
|
||||
wikiPageService.update(updateWrapper);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
public boolean canPageShow(long pageId){
|
||||
WikiPage own = wikiPageService.getById(pageId);
|
||||
WikiPage parent = wikiPageService.getById(own.getParentId());
|
||||
if (null==parent||parent.getDelFlag() != 0){
|
||||
return false;
|
||||
}
|
||||
if ( parent.getParentId()!= 0){
|
||||
canPageShow(parent.getParentId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.zyplayer.doc.core.enums.PageFileSource;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
|
||||
import com.zyplayer.doc.data.repository.manage.vo.WikiPageFileInfoVo;
|
||||
import com.zyplayer.doc.wiki.batch.BatchDocImportManager;
|
||||
import com.zyplayer.doc.data.repository.manage.param.PageFileQueryParam;
|
||||
import com.zyplayer.doc.wiki.service.WikiPageFileServiceEx;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -16,7 +18,10 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -45,6 +50,30 @@ public class WikiPageFileController {
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
public ResponseJson<Object> list(PageFileQueryParam pageFileQueryParam) {
|
||||
List<WikiPageFileInfoVo> list = wikiPageFileServiceEx.list(pageFileQueryParam);
|
||||
DocResponseJson<Object> ok = DocResponseJson.ok(list);
|
||||
ok.setTotal(wikiPageFileServiceEx.total(pageFileQueryParam));
|
||||
return ok;
|
||||
}
|
||||
|
||||
@PostMapping("/destory")
|
||||
public ResponseJson<Object> destory( HttpServletRequest request) {
|
||||
ArrayList<Long> destoryList = new ArrayList<>();
|
||||
Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
String[] values = entry.getValue();
|
||||
if (values.length>0){
|
||||
String value = values[0];
|
||||
if (null!= value)
|
||||
destoryList.add(Long.parseLong(value));
|
||||
}
|
||||
}
|
||||
wikiPageFileServiceEx.destory(destoryList);
|
||||
return DocResponseJson.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/wangEditor/upload")
|
||||
public Map<String, Object> wangEditorUpload(WikiPageFile wikiPageFile, @RequestParam("files") MultipartFile file) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
@@ -70,5 +99,6 @@ public class WikiPageFileController {
|
||||
wikiPageFile.setFileSource(PageFileSource.UPLOAD_FILES.getSource());
|
||||
return wikiPageFileServiceEx.basicUpload(wikiPageFile, file);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,21 +2,25 @@ package com.zyplayer.doc.wiki.service;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserMessage;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.WikiPageFileMapper;
|
||||
import com.zyplayer.doc.data.repository.manage.vo.WikiPageFileInfoVo;
|
||||
import com.zyplayer.doc.data.repository.support.consts.DocSysType;
|
||||
import com.zyplayer.doc.data.repository.support.consts.UserMsgType;
|
||||
import com.zyplayer.doc.data.service.manage.UserMessageService;
|
||||
import com.zyplayer.doc.data.service.manage.WikiPageFileService;
|
||||
import com.zyplayer.doc.data.service.manage.WikiPageService;
|
||||
import com.zyplayer.doc.data.service.manage.WikiSpaceService;
|
||||
import com.zyplayer.doc.data.repository.manage.param.PageFileQueryParam;
|
||||
import com.zyplayer.doc.wiki.service.common.WikiPageAuthService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -24,6 +28,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -45,6 +50,7 @@ public class WikiPageFileServiceEx {
|
||||
private final WikiPageService wikiPageService;
|
||||
private final WikiPageAuthService wikiPageAuthService;
|
||||
private final UserMessageService userMessageService;
|
||||
private final WikiPageFileMapper wikiPageFileMapper;
|
||||
|
||||
public List<WikiPageFile> list(WikiPageFile wikiPageFile) {
|
||||
// TODO 检查space是否开放访问
|
||||
@@ -58,6 +64,22 @@ public class WikiPageFileServiceEx {
|
||||
return fileList;
|
||||
}
|
||||
|
||||
public List<WikiPageFileInfoVo> list(PageFileQueryParam pageFileQueryParam) {
|
||||
int offset = 0;
|
||||
int pageNum = pageFileQueryParam.getCurrent();
|
||||
if ( pageNum != 0) {
|
||||
offset = (pageNum - 1) * pageFileQueryParam.getPageSize();
|
||||
}
|
||||
pageFileQueryParam.setCurrent(offset);
|
||||
List<WikiPageFileInfoVo> fileInfosVo = wikiPageFileMapper.getFileInfosVo(pageFileQueryParam);
|
||||
return fileInfosVo;
|
||||
}
|
||||
|
||||
public Long total(PageFileQueryParam pageFileQueryParam) {
|
||||
Long total = wikiPageFileMapper.getFileInfoCount(pageFileQueryParam);
|
||||
return total;
|
||||
}
|
||||
|
||||
public String delete(WikiPageFile wikiPageFile) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
Long id = wikiPageFile.getId();
|
||||
@@ -150,4 +172,11 @@ public class WikiPageFileServiceEx {
|
||||
wikiPageFile.setFileUrl("zyplayer-doc-wiki/common/file?uuid=" + wikiPageFile.getUuid());
|
||||
return null;
|
||||
}
|
||||
|
||||
public void destory(ArrayList<Long> destoryList) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||
updateWrapper.in("id",destoryList);
|
||||
updateWrapper.set("del_flag",2);
|
||||
wikiPageFileService.update(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
25
zyplayer-doc-wiki/src/main/resources/dist/assets/main-c2baf885.js
vendored
Normal file
25
zyplayer-doc-wiki/src/main/resources/dist/assets/main-c2baf885.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,13 +5,13 @@
|
||||
<link rel="icon" href="./wiki-logo.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>WIKI文档管理系统</title>
|
||||
<script type="module" crossorigin src="./assets/main-da0e526c.js"></script>
|
||||
<script type="module" crossorigin src="./assets/main-c2baf885.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/highlight.js-1b0b64aa.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/vue-650a4d10.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/vendor-55144a54.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/vant-c4bb6f5f.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/vendor-05ab9032.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/vant-3a3a3bd1.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/wangeditor-564d5916.js">
|
||||
<link rel="stylesheet" href="./assets/style.cf8016a5.css">
|
||||
<link rel="stylesheet" href="./assets/style.2aff8dda.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Reference in New Issue
Block a user