提交 4048fa85 authored 作者: 龙菲's avatar 龙菲

新增我的共享模块

上级 0dbbf2a5
...@@ -20,4 +20,24 @@ export const getShare = params => { ...@@ -20,4 +20,24 @@ export const getShare = params => {
method: 'get', method: 'get',
params params
}) })
} }
\ No newline at end of file
// 获取我的分享的列表(个人使用)
export const getMyShareList = params => {
return request({
url: baseUrl + '/folder/share/shareList',
method: 'get',
params
})
}
// 分享管理列表(管理员使用)
export const getAdminShareList = params => {
return request({
url: baseUrl + '/folder/share/searchShareList',
method: 'get',
params
})
}
<?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="1692346371721" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1173" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M704 352H173.4l137.3-137.4a32 32 0 0 0-45.2-45.2L73.9 360.9a32 32 0 0 0 0 45.8l191.4 191.9a32 32 0 1 0 45.3-45.3L173.3 416H704a192 192 0 0 1 0 384h-320a32 32 0 1 0 0 64h320a256 256 0 0 0 0-512z" p-id="1174"></path></svg>
\ No newline at end of file
...@@ -116,13 +116,7 @@ export default { ...@@ -116,13 +116,7 @@ export default {
}, },
// 当前所在路径 // 当前所在路径
filePath() { filePath() {
console.log( return this.$route.query.filePath || "";
"-------------this.$route.query.filePath-------------",
this.$route.query.filePath
);
return this.$route.query.filePath
? this.$route.query.filePath
: "/我的创作";
}, },
// 文件查看模式 0列表模式 1网格模式 2 时间线模式 // 文件查看模式 0列表模式 1网格模式 2 时间线模式
fileModel() { fileModel() {
...@@ -134,22 +128,17 @@ export default { ...@@ -134,22 +128,17 @@ export default {
}, },
}, },
watch: { watch: {
filePath() { filePath(value) {
// debugger; if (value) {
// 当左侧菜单选择“全部”或“我的分享”,文件路径发生变化时,再重新获取文件列表
// if (this.$route.name === "File" && [0, 8].includes(this.fileType)) {
// this.setPageCount();
// this.getTableDataByType();
// }
this.setPageCount();
this.getTableDataByType();
},
fileType() {
if (this.$route.name === "File") {
this.setPageCount(); this.setPageCount();
this.getTableDataByType(); this.getTableDataByType();
} }
}, },
// 暂不监听fileType
// fileType() {
// this.setPageCount();
// this.getTableDataByType();
// },
// 监听文件查看模式 // 监听文件查看模式
fileModel() { fileModel() {
this.setPageCount(); this.setPageCount();
...@@ -206,49 +195,14 @@ export default { ...@@ -206,49 +195,14 @@ export default {
getTableDataByType() { getTableDataByType() {
this.loading = true; this.loading = true;
this.showFileList(); this.showFileList();
// console.log("type:", this.fileType);
// 分类型
// if (Number(this.fileType)) {
// switch (Number(this.fileType)) {
// case 6: {
// this.showFileRecovery(); // 回收站
// break;
// }
// case 8: {
// this.showMyShareFile(); // 我的分享
// break;
// }
// case 10: {
// this.showMyCreateFile(); // 我的创作
// break;
// }
// case 11: {
// this.showMyFavoriteFile(); // 模板管理
// break;
// }
// case 11: {
// this.showMyFavoriteFile(); // 我的收藏
// break;
// }
// case 12: {
// this.showMyNoteFile(); // 我的笔记
// break;
// }
// default: {
// this.showFileList();
// break;
// }
// }
// } else {
// // 全部文件
// this.showFileList();
// }
// this.$store.dispatch("showStorage");
}, },
/** /**
* 表格数据获取相关事件 | 获取当前路径下的文件列表 * 表格数据获取相关事件 | 获取当前路径下的文件列表
*/ */
showFileList() { showFileList() {
if (!this.filePath) {
return;
}
let data = { let data = {
fileType: this.fileType, fileType: this.fileType,
filePath: this.filePath, filePath: this.filePath,
...@@ -262,7 +216,6 @@ export default { ...@@ -262,7 +216,6 @@ export default {
} }
getFileListByPath(params).then((res) => { getFileListByPath(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("res.data", res.data);
this.fileList = res.data.records; this.fileList = res.data.records;
this.pageData.total = res.data.total; this.pageData.total = res.data.total;
this.loading = false; this.loading = false;
......
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
return { return {
// 上传组件配置项 // 上传组件配置项
options: { options: {
target: `${process.env.VUE_APP_BASE_API}/filetransfer/uploadfile`, // 上传文件-目标 URL target: `${process.env.VUE_APP_BASE_API}/v1/api/folder/transfer/uploadfile`, // 上传文件-目标 URL
chunkSize: 1024 * 1024, // 每个分片的大小 chunkSize: 1024 * 1024, // 每个分片的大小
fileParameterName: "file", // 上传文件时文件的参数名,默认 file fileParameterName: "file", // 上传文件时文件的参数名,默认 file
maxChunkRetries: 3, // 并发上传数,默认 3 maxChunkRetries: 3, // 并发上传数,默认 3
...@@ -146,7 +146,8 @@ export default { ...@@ -146,7 +146,8 @@ export default {
} }
}, },
headers: { headers: {
token: this.$common.getCookies(this.$qwConfig.tokenKeyName), Authorization:
"Bearer " + this.$common.getCookies(this.$qwConfig.tokenKeyName),
}, },
query() {}, query() {},
}, },
......
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
display: inline-block; display: inline-block;
padding: 0 8px; padding: 0 8px;
height: 100%; height: 100%;
font-size: 18px; font-size: 14px;
color: #5a5e66; color: #5a5e66;
vertical-align: text-bottom; vertical-align: text-bottom;
...@@ -192,7 +192,7 @@ export default { ...@@ -192,7 +192,7 @@ export default {
cursor: pointer; cursor: pointer;
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 10px; border-radius: 50%;
} }
.el-icon-caret-bottom { .el-icon-caret-bottom {
......
<template> <template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> <div
class="sidebar-logo-container"
:class="{ collapse: collapse }"
:style="{
backgroundColor:
sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground,
}"
>
<transition name="sidebarLogoFade"> <transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> <router-link
v-if="collapse"
key="collapse"
class="sidebar-logo-link"
to="/"
>
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> <h1
v-else
class="sidebar-title"
:style="{
color:
sideTheme === 'theme-dark'
? variables.logoTitleColor
: variables.logoLightTitleColor,
}"
>
{{ title }}
</h1>
</router-link> </router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> <router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> <h1
class="sidebar-title"
:style="{
color:
sideTheme === 'theme-dark'
? variables.logoTitleColor
: variables.logoLightTitleColor,
}"
>
{{ title }}
</h1>
</router-link> </router-link>
</transition> </transition>
</div> </div>
</template> </template>
<script> <script>
import logoImg from '@/assets/logo/logo.png' import logoImg from "@/assets/logo/logo.png";
import variables from '@/assets/styles/variables.scss' import variables from "@/assets/styles/variables.scss";
export default { export default {
name: 'SidebarLogo', name: "SidebarLogo",
props: { props: {
collapse: { collapse: {
type: Boolean, type: Boolean,
required: true required: true,
} },
}, },
computed: { computed: {
variables() { variables() {
return variables; return variables;
}, },
sideTheme() { sideTheme() {
return this.$store.state.settings.sideTheme return this.$store.state.settings.sideTheme;
} },
}, },
data() { data() {
return { return {
title: process.env.VUE_APP_TITLE, title: process.env.VUE_APP_TITLE,
logo: logoImg logo: logoImg,
} };
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -66,10 +101,10 @@ export default { ...@@ -66,10 +101,10 @@ export default {
width: 100%; width: 100%;
& .sidebar-logo { & .sidebar-logo {
width: 32px; width: 24px;
height: 32px; height: 24px;
vertical-align: middle; vertical-align: middle;
margin-right: 12px; margin-right: 8px;
} }
& .sidebar-title { & .sidebar-title {
...@@ -78,7 +113,7 @@ export default { ...@@ -78,7 +113,7 @@ export default {
color: #fff; color: #fff;
font-weight: 600; font-weight: 600;
line-height: 50px; line-height: 50px;
font-size: 14px; font-size: 16px;
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
vertical-align: middle; vertical-align: middle;
} }
......
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token' const TokenKey = 'token'
export function getToken() { export function getToken() {
return Cookies.get(TokenKey) return Cookies.get(TokenKey)
......
...@@ -34,7 +34,7 @@ const qwConfig = { ...@@ -34,7 +34,7 @@ const qwConfig = {
/** /**
* 存放 token 时的命名方式 * 存放 token 时的命名方式
*/ */
tokenKeyName: 'Admin-Token' tokenKeyName: 'token'
} }
export default qwConfig export default qwConfig
...@@ -43,21 +43,23 @@ service.interceptors.request.use(config => { ...@@ -43,21 +43,23 @@ service.interceptors.request.use(config => {
time: new Date().getTime() time: new Date().getTime()
} }
const sessionObj = cache.session.getJSON('sessionObj') const sessionObj = cache.session.getJSON('sessionObj')
if (sessionObj === undefined || sessionObj === null || sessionObj === '') { // 因为文件列表在监听变化,需要随时更新,暂时屏蔽以下逻辑
cache.session.setJSON('sessionObj', requestObj) // if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
} else { // cache.session.setJSON('sessionObj', requestObj)
const s_url = sessionObj.url; // 请求地址 // } else {
const s_data = sessionObj.data; // 请求数据 // const s_url = sessionObj.url; // 请求地址
const s_time = sessionObj.time; // 请求时间 // const s_data = sessionObj.data; // 请求数据
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 // const s_time = sessionObj.time; // 请求时间
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { // const interval = 500; // 间隔时间(ms),小于此时间视为重复提交
const message = '数据正在处理,请勿重复提交'; // if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
console.warn(`[${s_url}]: ` + message) // const message = '数据正在处理,请勿重复提交';
return Promise.reject(new Error(message)) // console.warn(`[${s_url}]: ` + message)
} else { // return Promise.reject(new Error(message))
cache.session.setJSON('sessionObj', requestObj) // } else {
} // cache.session.setJSON('sessionObj', requestObj)
} // }
// }
cache.session.setJSON('sessionObj', requestObj)
} }
return config return config
}, error => { }, error => {
......
//分享类型
export const shareTypeConstant = {
PUBLIC_SHARE: 0, //分享给公共社区
DEPT_SHARE: 1, //分享给部门
PERSONAL_SHARE: 2 //分享给个人
}
// 分享状态
export const shareStatusConstant = {
SHARED: 0, //已分享
EXPIRED: 1,//已失效
REVOKED: 2,//已撤销
}
\ No newline at end of file
<template> <template>
<div>我的共享</div> <div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="文件名称" prop="fileName">
<el-input
v-model="queryParams.fileName"
placeholder="请输入文件名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
clearable
/>
</el-form-item>
<el-form-item label="分享状态" prop="fileName">
<el-select
v-model="queryParams.shareStatus"
placeholder="请选择分享状态"
clearable
>
<el-option
v-for="item in dict.type.share_status"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button
>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-refresh"
size="mini"
@click="handleRefreshCache"
v-hasPermi="['system:dict:remove']"
>刷新缓存</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="shareList"
@selection-change="handleSelectionChange"
>
<el-table-column
label="文件名称"
align="center"
prop="fileName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="分享截止时间"
align="center"
prop="endTime"
width="180"
>
</el-table-column>
<el-table-column
label="分享类型"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.share_type"
:value="scope.row.shareType"
/>
</template>
</el-table-column>
<el-table-column label="分享状态" align="center" prop="status">
<template slot-scope="scope">
<el-tag :type="getShareStatusTagType(scope.row.shareStatus)"
><dict-tag
:options="dict.type.share_status"
:value="scope.row.shareStatus"
/></el-tag>
</template>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-link type="primary" style="margin-right: 16px">
<svg-icon icon-class="revoke"> </svg-icon>撤销分享
</el-link>
<el-link type="primary" icon="el-icon-view"> 预览 </el-link>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.currentPage"
:limit.sync="queryParams.pageCount"
@pagination="getList"
/>
</div>
</template> </template>
<script> <script>
export default {}; import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from "@/api/system/dict/type";
import { getMyShareList } from "@/api/user/share";
import { shareStatusConstant } from "./constant";
export default {
name: "myShare",
dicts: ["share_type", "share_status"],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 表格数据
shareList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 日期范围
dateRange: [],
// 查询参数
queryParams: {
currentPage: 1,
pageCount: 10,
fileName: "", //文件名称
shareStatus: "", //分享状态
},
// 分享状态常量
shareStatusConstant,
};
},
computed: {
getShareStatusTagType(shareStatus) {
return (shareStatus) => {
switch (shareStatus) {
case shareStatusConstant.SHARED: //已分享
return "success";
case shareStatusConstant.EXPIRED: //已失效
return "info";
case shareStatusConstant.REVOKED: //已撤销
return "warning";
}
};
},
},
created() {
this.getList();
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true;
getMyShareList(this.queryParams).then((res) => {
this.total = res.data.total;
this.loading = false;
this.shareList = res.data.records;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.currentPage = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加字典类型";
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
// 取消分享
handleCancelShare(row) {
console.log(row);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const dictId = row.dictId || this.ids;
getType(dictId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改字典类型";
});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal
.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
.then(function () {
return delType(dictIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/dict/type/export",
{
...this.queryParams,
},
`type_${new Date().getTime()}.xlsx`
);
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
this.$store.dispatch("dict/cleanDict");
});
},
},
};
</script> </script>
<style lang="scss" scoped></style>
...@@ -36,6 +36,7 @@ module.exports = { ...@@ -36,6 +36,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://222.85.214.245:9600`, target: `http://222.85.214.245:9600`,
// target: `http://172.24.100.56:9600`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论