提交 5c4617dc authored 作者: 龙菲's avatar 龙菲

增加为取消和批量取消分享;增加分享审核和批量审核

上级 1815c7b9
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/** /**
* 分享相关接口 * 分享相关接口
*/ */
import qs from 'qs'
import request from '@/utils/request' import request from '@/utils/request'
const baseUrl = '/v1/api' const baseUrl = '/v1/api'
...@@ -31,6 +32,16 @@ export const getMyShareList = params => { ...@@ -31,6 +32,16 @@ export const getMyShareList = params => {
}) })
} }
// 取消分享(个人使用)
export const removeShare = params => {
return request({
url: baseUrl + '/folder/share/removeShare',
method: 'get',
params
})
}
// 分享管理列表(管理员使用) // 分享管理列表(管理员使用)
export const getAdminShareList = params => { export const getAdminShareList = params => {
return request({ return request({
...@@ -41,3 +52,13 @@ export const getAdminShareList = params => { ...@@ -41,3 +52,13 @@ export const getAdminShareList = params => {
} }
// 分享审核(管理员使用)
export const verifyShare = data => {
return request({
url: baseUrl + '/folder/share/verifyShare',
method: 'post',
data: qs.stringify(data),
headers: { 'content-type': 'application/x-www-form-urlencoded' }
})
}
...@@ -50,8 +50,6 @@ ...@@ -50,8 +50,6 @@
valueKey="userId" valueKey="userId"
:paginationOption="setSelectPage" :paginationOption="setSelectPage"
/> />
<!-- {{ userListAllByLocal }} -->
<!-- <div v-if="form.shareType == 2">人员列表</div> -->
</el-form-item> </el-form-item>
<!-- <el-form-item label="链接有效期至" prop="endTime"> <!-- <el-form-item label="链接有效期至" prop="endTime">
<el-date-picker <el-date-picker
...@@ -73,7 +71,7 @@ ...@@ -73,7 +71,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
<el-form <!-- <el-form
v-if="shareIsSuccess" v-if="shareIsSuccess"
class="share-success-form" class="share-success-form"
:model="shareData" :model="shareData"
...@@ -100,7 +98,7 @@ ...@@ -100,7 +98,7 @@
:readonly="true" :readonly="true"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form> -->
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button <el-button
v-if="shareIsSuccess" v-if="shareIsSuccess"
...@@ -129,6 +127,12 @@ import store from "@/store/index.js"; ...@@ -129,6 +127,12 @@ import store from "@/store/index.js";
import { shareFile } from "@/api/qwFile"; import { shareFile } from "@/api/qwFile";
import { deptTreeSelect, listUser } from "@/api/system/user"; import { deptTreeSelect, listUser } from "@/api/system/user";
import PaginationSelector from "@/components/PaginationSelector"; import PaginationSelector from "@/components/PaginationSelector";
const shareTypeConstant = {
PUBLIC_SHARE: 0, //分享给公共社区
DEPT_SHARE: 1, //分享给部门
PERSONAL_SHARE: 2, //分享给个人
};
export default { export default {
name: "ShareFileDialog", name: "ShareFileDialog",
components: { components: {
...@@ -229,20 +233,20 @@ export default { ...@@ -229,20 +233,20 @@ export default {
return store.state.common.screenWidth; return store.state.common.screenWidth;
}, },
getChooseDataLabel() { getChooseDataLabel() {
if (this.form.shareType == 1) { if (this.form.shareType == shareTypeConstant.DEPT_SHARE) {
return "选择部门"; return "选择部门";
} else if (this.form.shareType == 2) { } else if (this.form.shareType == shareTypeConstant.PERSONAL_SHARE) {
return "选择个人"; return "选择个人";
} }
}, },
}, },
watch: { watch: {
"form.shareType"(value) { "form.shareType"(value) {
if (value == 1) { if (value == shareTypeConstant.DEPT_SHARE) {
this.getDeptTree(); this.getDeptTree();
// 清空人员的选择 // 清空人员的选择
this.clearCheckedUser(); this.clearCheckedUser();
} else if (value == 2) { } else if (value == shareTypeConstant.PERSONAL_SHARE) {
this.getUserList(); this.getUserList();
// 清空部门的选择 // 清空部门的选择
this.clearCheckedDept(); this.clearCheckedDept();
...@@ -289,8 +293,9 @@ export default { ...@@ -289,8 +293,9 @@ export default {
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.code == 200) { if (res.code == 200) {
this.shareData = res.data; // this.shareData = res.data;
this.shareIsSuccess = true; // this.shareIsSuccess = true;
this.$message.success("分享成功!");
this.callback("confirm"); this.callback("confirm");
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
......
...@@ -8,6 +8,7 @@ export const shareTypeConstant = { ...@@ -8,6 +8,7 @@ export const shareTypeConstant = {
// 分享状态 // 分享状态
export const shareStatusConstant = { export const shareStatusConstant = {
SHARED: 0, //已分享 SHARED: 0, //已分享
EXPIRED: 1,//已失效 IS_REVIEW: 1,//审核中 仅部门和社区需要审核,分享到个人不需要审核
REVOKED: 2,//已撤销 REVOKED: 2,//已撤销
REJECTED: 3,//已驳回
} }
\ No newline at end of file
...@@ -47,21 +47,20 @@ ...@@ -47,21 +47,20 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <div class="mb8">
<el-button <el-button
type="primary" type="primary"
plain plain
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click.native="handleMultiRevoke" @click.native="handleMultiRevoke"
><svg-icon icon-class="revoke" class="mr5"> </svg-icon>批量撤销分享</el-button >批量取消分享</el-button
> >
</el-col>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :showSearch.sync="showSearch"
@queryTable="getList" @queryTable="getList"
></right-toolbar> ></right-toolbar>
</el-row> </div>
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="shareList" :data="shareList"
...@@ -73,14 +72,17 @@ ...@@ -73,14 +72,17 @@
align="center" align="center"
prop="fileName" prop="fileName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/>
<el-table-column
label="分享截止时间"
align="center"
prop="endTime"
width="180"
> >
<template slot-scope="scope">
<div class="fileName">
<img :src="$file.setFileImg(scope.row)" />
<el-link @click="handleOpenFile(scope.row)">
{{ scope.row.fileName }}
</el-link>
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="分享类型" label="分享类型"
align="center" align="center"
...@@ -103,9 +105,9 @@ ...@@ -103,9 +105,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="备注" label="审核意见"
align="center" align="center"
prop="remark" prop="verifyDesc"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
...@@ -115,10 +117,21 @@ ...@@ -115,10 +117,21 @@
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" style="margin-right: 16px"> <el-link
<svg-icon icon-class="revoke"> </svg-icon>撤销分享 v-if="scope.row.shareStatus == shareStatusConstant.SHARED"
type="primary"
style="margin-right: 16px"
@click="handleCancelShare(scope.row.shareId)"
>
<svg-icon icon-class="revoke"> </svg-icon>取消分享
</el-link>
<el-link
type="primary"
icon="el-icon-view"
@click="handleOpenFile(scope.row)"
>
预览
</el-link> </el-link>
<el-link type="primary" icon="el-icon-view"> 预览 </el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -129,11 +142,37 @@ ...@@ -129,11 +142,37 @@
:limit.sync="queryParams.pageCount" :limit.sync="queryParams.pageCount"
@pagination="getList" @pagination="getList"
/> />
<el-dialog
title="批量取消"
:visible.sync="multiCancelVisible"
width="400px"
>
<div class="multi-verify">
<div class="text">
一共选择了{{ shareIdsArr.length }}条数据,是否确定批量取消分享?
</div>
<div class="buttons">
<el-button
size="mini"
type="primary"
icon="el-icon-check"
@click="handleSubmitMultiRemoveShare"
>确定</el-button
>
<el-button
size="mini"
type="text"
@click="handleCloseMultiRemoveShare"
>取消</el-button
>
</div>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getMyShareList } from "@/api/user/share"; import { getMyShareList, removeShare } from "@/api/user/share";
import { shareStatusConstant } from "./constant"; import { shareStatusConstant } from "./constant";
export default { export default {
...@@ -144,7 +183,7 @@ export default { ...@@ -144,7 +183,7 @@ export default {
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], shareIdsArr: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
...@@ -170,6 +209,9 @@ export default { ...@@ -170,6 +209,9 @@ export default {
}, },
// 分享状态常量 // 分享状态常量
shareStatusConstant, shareStatusConstant,
// 批量取消的弹窗可见性
multiCancelVisible: false,
shareIdsArr: [],
}; };
}, },
computed: { computed: {
...@@ -178,10 +220,12 @@ export default { ...@@ -178,10 +220,12 @@ export default {
switch (shareStatus) { switch (shareStatus) {
case shareStatusConstant.SHARED: //已分享 case shareStatusConstant.SHARED: //已分享
return "success"; return "success";
case shareStatusConstant.EXPIRED: //已失效 case shareStatusConstant.IS_REVIEW: //审核中
return "info"; return "primary";
case shareStatusConstant.REVOKED: //已撤销 case shareStatusConstant.REVOKED: //已撤销
return "warning"; return "info";
case shareStatusConstant.REJECTED: //已驳回
return "danger";
} }
}; };
}, },
...@@ -192,7 +236,7 @@ export default { ...@@ -192,7 +236,7 @@ export default {
methods: { methods: {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId); this.shareIdsArr = selection.map((item) => item.shareId);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
...@@ -225,15 +269,55 @@ export default { ...@@ -225,15 +269,55 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
// 取消分享 // 点击取消分享
handleCancelShare(row) { async handleCancelShare(fileIds) {
console.log(row); const params = {
fileIds,
};
let res = await removeShare(params);
if (res.code == 200) {
this.$message.success("取消分享成功!");
this.getList();
}
}, },
// 批量取消分享 // 批量取消分享
handleMultiRevoke(){ handleMultiRevoke() {
console.log(this.ids); this.multiCancelVisible = true;
},
} // 提交批量取消分享
handleSubmitMultiRemoveShare() {
const fileIds = this.shareIdsArr.join(",");
this.handleCancelShare(fileIds);
this.handleCloseMultiRemoveShare();
},
// 关闭批量取消分享
handleCloseMultiRemoveShare() {
this.multiCancelVisible = false;
},
// 点击打开文件
handleOpenFile(file) {
this.$file.handleFileNameClickNew(file);
},
}, },
}; };
</script> </script>
<style lang="scss" scoped>
.fileName {
display: flex;
justify-content: center;
align-items: center;
img {
width: 18px;
height: 18px;
object-fit: contain;
margin-right: 4px;
}
}
.multi-verify {
.buttons {
display: flex;
justify-content: flex-end;
margin-top: 16px;
}
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论