提交 41138649 authored 作者: 龙菲's avatar 龙菲

联调新建文件接口;新建共享管理

上级 4048fa85
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import request from '@/utils/request' import request from '@/utils/request'
const baseUrl = '/v1/api' const baseUrl = '/v1/api'
export const getBookList = params => { export const getBookMarkList = params => {
return request({ return request({
url: baseUrl + '/doc/bookmark/mine', url: baseUrl + '/doc/bookmark/mine',
method: 'get', method: 'get',
......
...@@ -73,9 +73,7 @@ export default { ...@@ -73,9 +73,7 @@ export default {
}, },
watch: { watch: {
$route(value) { $route(value) {
// console.log(123, value);
const { filePath } = value.query; const { filePath } = value.query;
// debugger;
let filePathList = filePath ? filePath.split("/") : []; let filePathList = filePath ? filePath.split("/") : [];
let res = []; // 返回结果数组 let res = []; // 返回结果数组
let _path = []; // 存放祖先路径 let _path = []; // 存放祖先路径
...@@ -103,7 +101,6 @@ export default { ...@@ -103,7 +101,6 @@ export default {
// }); // });
} }
} }
console.log("res", res);
this.breadCrumbList = res; this.breadCrumbList = res;
}, },
}, },
...@@ -153,13 +150,11 @@ export default { ...@@ -153,13 +150,11 @@ export default {
* 点击面包屑导航栏空白处 * 点击面包屑导航栏空白处
*/ */
handleClickBreadCrumbSelf() { handleClickBreadCrumbSelf() {
if (this.fileType === 0) {
this.inputFilePath = this.filePath; this.inputFilePath = this.filePath;
this.isShowInput = true; this.isShowInput = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.filePathInputRef.focus(); this.$refs.filePathInputRef.focus();
}); });
}
}, },
/** /**
* 路径输入框失去焦点或用户按下回车时触发 * 路径输入框失去焦点或用户按下回车时触发
...@@ -177,24 +172,28 @@ export default { ...@@ -177,24 +172,28 @@ export default {
}, },
// 获取文件参数 // 获取文件参数
getRouteQuery(item) { getRouteQuery(item) {
let routeName = this.$route.name; // debugger;
if (routeName === "Share") { // let routeName = this.$route.name;
// 当前是查看他人分享列表的页面 // if (routeName === "Share") {
return { query: { filePath: item.path } }; // // 当前是查看他人分享列表的页面
} else if (this.fileType === 8) { // return { query: { filePath: item.path } };
// 当前是我的已分享列表页面 // } else if (this.fileType === 8) {
// // 当前是我的已分享列表页面
// return {
// query: {
// fileType: 8,
// filePath: item.path,
// shareBatchNum:
// item.path === "/" ? undefined : this.$route.query.shareBatchNum, // 当查看的是根目录,批次号置空
// },
// };
// } else {
// // 网盘页面
// return { query: { filePath: item.path, fileType: item.fileType } };
// }
return { return {
query: { query: { filePath: item.path, fileType: this.$route.query.fileType },
fileType: 8,
filePath: item.path,
shareBatchNum:
item.path === "/" ? undefined : this.$route.query.shareBatchNum, // 当查看的是根目录,批次号置空
},
}; };
} else {
// 网盘页面
return { query: { filePath: item.path, fileType: 0 } };
}
}, },
}, },
}; };
......
...@@ -459,7 +459,7 @@ export default { ...@@ -459,7 +459,7 @@ export default {
font-size: 16px; font-size: 16px;
&:hover { &:hover {
color: $Primary; color: $theme-blue;
} }
} }
} }
...@@ -510,7 +510,7 @@ export default { ...@@ -510,7 +510,7 @@ export default {
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background: $PrimaryHover; background: $PrimaryHover;
color: $Primary; color: $theme-blue;
} }
i { i {
margin-right: 8px; margin-right: 8px;
......
...@@ -145,7 +145,6 @@ export default { ...@@ -145,7 +145,6 @@ export default {
}, },
// 监听搜索文件 // 监听搜索文件
searchFileName() { searchFileName() {
console.log("searchFileName");
this.setPageCount(); this.setPageCount();
this.getTableDataByType(); this.getTableDataByType();
}, },
......
...@@ -618,7 +618,7 @@ export default { ...@@ -618,7 +618,7 @@ export default {
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background: $PrimaryHover; background: $PrimaryHover;
color: $Primary; color: $theme-blue;
} }
i { i {
margin-right: 8px; margin-right: 8px;
......
...@@ -185,6 +185,10 @@ export default { ...@@ -185,6 +185,10 @@ export default {
return store.getters.remainderStorageValue; return store.getters.remainderStorageValue;
}, },
}, },
// created() {
// // debugger;
// console.log(123);
// },
methods: { methods: {
// 隐藏拖拽上传遮罩 // 隐藏拖拽上传遮罩
hideUploadMask(e) { hideUploadMask(e) {
...@@ -200,15 +204,15 @@ export default { ...@@ -200,15 +204,15 @@ export default {
this.$qwConfig.tokenKeyName this.$qwConfig.tokenKeyName
); );
switch (this.uploadWay) { switch (this.uploadWay) {
case 1: { case 0: {
this.$refs.uploadBtn.$el.click(); this.$refs.uploadBtn.$el.click();
break; break;
} }
case 2: { case 1: {
this.$refs.uploadDirBtn.$el.click(); this.$refs.uploadDirBtn.$el.click();
break; break;
} }
case 3: { case 2: {
this.pasteImg.src = ""; this.pasteImg.src = "";
this.pasteImg.name = ""; this.pasteImg.name = "";
this.pasteImgObj = null; this.pasteImgObj = null;
...@@ -456,7 +460,7 @@ export default { ...@@ -456,7 +460,7 @@ export default {
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: $Primary; color: $theme-blue;
} }
} }
......
...@@ -217,7 +217,7 @@ export default { ...@@ -217,7 +217,7 @@ export default {
justify-content: space-between; justify-content: space-between;
&:hover { &:hover {
color: $Primary; color: $theme-blue;
} }
.name { .name {
...@@ -235,7 +235,7 @@ export default { ...@@ -235,7 +235,7 @@ export default {
.video-item.active { .video-item.active {
background: #000; background: #000;
color: $Primary; color: $theme-blue;
} }
} }
} }
......
...@@ -73,12 +73,12 @@ export default { ...@@ -73,12 +73,12 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0; padding: 0;
color: $Primary; color: $theme-blue;
// 播放按钮 // 播放按钮
::v-deep .vjs-big-play-button { ::v-deep .vjs-big-play-button {
border-radius: 50%; border-radius: 50%;
border: 6px solid $Primary; border: 6px solid $theme-blue;
left: calc(50% - 1em); left: calc(50% - 1em);
top: calc(50% - 1em); top: calc(50% - 1em);
width: 2.5em; width: 2.5em;
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
::v-deep .vjs-volume-level, ::v-deep .vjs-volume-level,
::v-deep .vjs-play-progress, ::v-deep .vjs-play-progress,
::v-deep .vjs-slider-bar { ::v-deep .vjs-slider-bar {
background: $Primary; background: $theme-blue;
} }
// 控制条按钮的大小 // 控制条按钮的大小
......
...@@ -103,6 +103,7 @@ export default { ...@@ -103,6 +103,7 @@ export default {
watch: { watch: {
// 文件平铺模式 排序-文件夹在前 // 文件平铺模式 排序-文件夹在前
fileList(newValue) { fileList(newValue) {
console.log("fileList-newValue", newValue);
this.fileListSorted = [...newValue] this.fileListSorted = [...newValue]
.sort((pre, next) => { .sort((pre, next) => {
return next.isDir - pre.isDir; return next.isDir - pre.isDir;
...@@ -119,6 +120,13 @@ export default { ...@@ -119,6 +120,13 @@ export default {
this.$store.commit("changeSelectedFiles", newValue); this.$store.commit("changeSelectedFiles", newValue);
this.$store.commit("changeIsBatchOperation", newValue.length !== 0); this.$store.commit("changeIsBatchOperation", newValue.length !== 0);
}, },
fileListSorted: {
handler(value) {
console.log("监听fileListSorted", value);
},
deep: true,
immediate: true,
},
}, },
methods: { methods: {
/** /**
......
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
>上传<i class="el-icon-arrow-down el-icon--right"></i >上传<i class="el-icon-arrow-down el-icon--right"></i
></el-button> ></el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="handleUploadFileBtnClick(1)" <el-dropdown-item @click.native="handleUploadFileBtnClick(0)"
>上传文件</el-dropdown-item >上传文件</el-dropdown-item
> >
<el-dropdown-item @click.native="handleUploadFileBtnClick(2)" <el-dropdown-item @click.native="handleUploadFileBtnClick(1)"
>上传文件夹</el-dropdown-item >上传文件夹</el-dropdown-item
> >
<el-dropdown-item <el-dropdown-item
@click.native="handleUploadFileBtnClick(3)" @click.native="handleUploadFileBtnClick(2)"
title="截图粘贴或拖拽上传" title="截图粘贴或拖拽上传"
:disabled="screenWidth <= 520" :disabled="screenWidth <= 520"
>拖拽上传</el-dropdown-item >拖拽上传</el-dropdown-item
...@@ -488,11 +488,7 @@ export default { ...@@ -488,11 +488,7 @@ export default {
* @param {string} value 搜索内容 * @param {string} value 搜索内容
*/ */
handleSearchInputChange(value) { handleSearchInputChange(value) {
if (value === "") {
this.$emit("getTableDataByType");
} else {
this.$emit("getSearchFileList", value); this.$emit("getSearchFileList", value);
}
}, },
/** /**
* 网格模式下,批量操作状态切换 * 网格模式下,批量操作状态切换
...@@ -505,6 +501,7 @@ export default { ...@@ -505,6 +501,7 @@ export default {
* @param {number} label 0 列表 1 网格 2 时间线 * @param {number} label 0 列表 1 网格 2 时间线
*/ */
handleFileDisplayModelChange(label) { handleFileDisplayModelChange(label) {
// debugger;
this.fileGroupLable = label; this.fileGroupLable = label;
// 关闭右键菜单事件 // 关闭右键菜单事件
this.$openBox.contextMenu.close(); this.$openBox.contextMenu.close();
...@@ -571,7 +568,7 @@ export default { ...@@ -571,7 +568,7 @@ export default {
font-size: 16px; font-size: 16px;
&:hover { &:hover {
color: $Primary; color: $theme-blue;
} }
} }
} }
...@@ -585,7 +582,7 @@ export default { ...@@ -585,7 +582,7 @@ export default {
} }
.model-icon.active { .model-icon.active {
color: $Primary; color: $theme-blue;
} }
.refresh-icon, .refresh-icon,
...@@ -597,12 +594,12 @@ export default { ...@@ -597,12 +594,12 @@ export default {
color: $SecondaryText; color: $SecondaryText;
&:hover { &:hover {
color: $Primary; color: $theme-blue;
} }
} }
.batch-icon.active { .batch-icon.active {
color: $Primary; color: $theme-blue;
} }
} }
......
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
padding-top: 8px; padding-top: 8px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: $Primary; color: $theme-blue;
} }
} }
} }
......
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
} }
.el-tree-node.is-current > .el-tree-node__content { .el-tree-node.is-current > .el-tree-node__content {
color: $Primary; color: $theme-blue;
} }
} }
} }
......
...@@ -267,7 +267,7 @@ export default { ...@@ -267,7 +267,7 @@ export default {
} }
.el-tree-node.is-current > .el-tree-node__content { .el-tree-node.is-current > .el-tree-node__content {
color: $Primary; color: $theme-blue;
} }
} }
} }
......
...@@ -210,7 +210,7 @@ export default { ...@@ -210,7 +210,7 @@ export default {
} }
.el-tree-node.is-current > .el-tree-node__content { .el-tree-node.is-current > .el-tree-node__content {
color: $Primary; color: $theme-blue;
} }
} }
} }
......
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
} }
.el-tree-node.is-current > .el-tree-node__content { .el-tree-node.is-current > .el-tree-node__content {
color: $Primary; color: $theme-blue;
} }
} }
} }
......
...@@ -20,6 +20,9 @@ const fileFunction = { ...@@ -20,6 +20,9 @@ const fileFunction = {
* @returns {string} 文件大小(带单位) * @returns {string} 文件大小(带单位)
*/ */
calculateFileSize(size, isInteger = false) { calculateFileSize(size, isInteger = false) {
if (size == null)
return 0 + 'KB'
const B = 1024 const B = 1024
const KB = Math.pow(1024, 2) const KB = Math.pow(1024, 2)
const MB = Math.pow(1024, 3) const MB = Math.pow(1024, 3)
...@@ -344,9 +347,9 @@ const fileFunction = { ...@@ -344,9 +347,9 @@ const fileFunction = {
flag = true flag = true
} }
console.log(123, row); console.log(123, row);
const { fileId, identifier } = row const { fileId } = row
const params = { const params = {
fileId: identifier, fileId: fileId,
flag flag
} }
getViewUrlDbPath(params).then(res => { getViewUrlDbPath(params).then(res => {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<svg-icon icon-class="add-border"></svg-icon> <svg-icon icon-class="add-border"></svg-icon>
<div class="right"> <div class="right">
<div class="text">新建文档</div> <div class="text">新建文档</div>
<div class="subtitle">从空文本起草</div> <div class="subtitle">从空文本或模板起草</div>
</div> </div>
</div> </div>
</el-card> </el-card>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<el-card <el-card
shadow="never" shadow="never"
class="cursor-pointer" class="cursor-pointer"
@click.native="handleUploadFile(0)" @click.native="handleUploadFile"
> >
<div class="content"> <div class="content">
<svg-icon icon-class="word-border"></svg-icon> <svg-icon icon-class="word-border"></svg-icon>
...@@ -144,83 +144,32 @@ export default { ...@@ -144,83 +144,32 @@ export default {
let res = await getNearCreation(params); let res = await getNearCreation(params);
this.createList = res.data; this.createList = res.data;
}, },
/** // 上传文件
* 上传文件按钮点击事件 handleUploadFile() {
* @description 通过Bus通信,开启全局上传文件流程 const uploadFileParams = { filePath: "/我的创作", isDir: 0 }; // 上传文件组件参数
* @param {boolean} uploadWay 上传方式 0-文件上传 1-文件夹上传 2-粘贴图片或拖拽上传 // debugger;
*/
handleUploadFile(uploadWay) {
this.$openDialog.authWeChat({}).then((res) => {
switch (res) {
case "confirm": {
this.$common.goAccount("/settings/account");
break;
}
case "go": {
this.$openBox.uploadFile({ this.$openBox.uploadFile({
params: this.uploadFileParams, params: uploadFileParams,
uploadWay, uploadWay: 0, //0-文件上传 1-文件夹上传 2-粘贴图片或拖拽上传
serviceEl: this, serviceEl: this,
callType: 1, // callType 调用此服务的方式:1 - 顶部栏,2 - 右键菜单 callType: 2, // callType 调用此服务的方式:1 - 顶部栏,2 - 右键菜单
});
break;
}
}
}); });
}, },
// 创建文件 // 创建文件
handleCreateFile() { handleCreateFile() {
// const _this = this; this.$openDialog
const formData = new FormData(); .addFileByTemplate({
// 目前仅支持创建文档 extendName: "docx",
formData.append("filetype", fileTypes.WORD); })
newfile(formData).then((res) => { .then((res) => {
// instance.confirmButtonLoading = false; // if (res === "confirm") {
// done(); // this.$emit("getTableDataByType");
// _this.$parent.$parent.showDialog = false;
const resolve = this.$router.resolve({
path: "/write",
query: {
wpsUrl: res.redirect_url,
},
});
window.open(resolve.href);
});
// if (e === undefined) {
// // 目前仅支持创建文档
// formData.append("filetype", fileTypes.WORD);
// newfile(formData).then((res) => {
// // instance.confirmButtonLoading = false;
// // done();
// // _this.$parent.$parent.showDialog = false;
// const resolve = this.$router.resolve({
// path: "/write",
// query: {
// wpsUrl: res.redirect_url,
// },
// });
// window.open(resolve.href);
// });
// } else {
// formData.append("templateId", e);
// newfileTemplate(formData).then((res) => {
// instance.confirmButtonLoading = false;
// done();
// _this.$parent.$parent.showDialog = false;
// let resolve = _this.$router.resolve({
// path: "/write",
// query: {
// wpsUrl: res.redirect_url,
// },
// });
// window.open(resolve.href);
// });
// } // }
});
}, },
// 点击表格某一行 // 点击表格某一行
handleClickName(row) { handleClickName(row) {
console.log("row", row); console.log("row", row);
openFile(row, this, localStorage);
}, },
handleToCreate() { handleToCreate() {
this.$router.push("/mine/myCreate"); this.$router.push("/mine/myCreate");
...@@ -232,6 +181,9 @@ export default { ...@@ -232,6 +181,9 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cursor-pointer {
cursor: pointer;
}
::v-deep .el-card__body { ::v-deep .el-card__body {
.el-upload { .el-upload {
width: 100%; width: 100%;
......
//分享类型
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">
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="shareList">
<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 { getAdminShareList } from "@/api/user/share";
</script> import { shareStatusConstant } from "./constant";
<style></style> 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;
getAdminShareList(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.resetForm("queryForm");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.currentPage = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 取消分享
handleCancelShare(row) {
console.log(row);
},
},
};
</script>
...@@ -32,11 +32,19 @@ ...@@ -32,11 +32,19 @@
<div :span="19" class="right"> <div :span="19" class="right">
<div class="single-article"> <div class="single-article">
<el-row class="info"> <el-row class="info">
<el-col :span="8" class="center">{{ currentFile.name }}</el-col> <el-col :span="16">
<el-col :span="8" class="center">{{ currentFile.author }}</el-col> <el-row>
<el-col :span="8" class="center" <el-col class="info-title">
><el-button type="text">查看原文</el-button></el-col {{ currentFile.name }}
> </el-col>
<el-col>
<span class="info-author">
作者: {{ currentFile.author }}
</span>
<el-button type="text">查看原文</el-button>
</el-col>
</el-row>
</el-col>
</el-row> </el-row>
<div class="card-group"> <div class="card-group">
...@@ -71,7 +79,7 @@ ...@@ -71,7 +79,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getBookList, getBookMark } from "@/api/doc/bookMark"; import { getBookMarkList, getBookMark } from "@/api/doc/bookMark";
import { mockNote } from "./mockNote"; import { mockNote } from "./mockNote";
export default { export default {
data() { data() {
...@@ -107,10 +115,10 @@ export default { ...@@ -107,10 +115,10 @@ export default {
}, },
methods: { methods: {
async loadBookMarkList() { async loadBookMarkList() {
let res = await getBookList(); let res = await getBookMarkList();
console.log(res); console.log(res);
if (res.result) { if (res.data) {
this.markList = res.result; this.markList = res.data;
} }
}, },
// 点击文章 // 点击文章
...@@ -178,11 +186,14 @@ export default { ...@@ -178,11 +186,14 @@ export default {
//文章基本信息 //文章基本信息
.info { .info {
padding: 16px; padding: 16px;
border-bottom: 1px solid #e7e7e7;
margin-bottom: 8px; margin-bottom: 8px;
.center { .info-title {
display: flex; color: #333;
justify-content: center; font-size: 18px;
font-weight: bold;
}
.info-author {
margin-right: 18px;
} }
} }
.card-group { .card-group {
......
...@@ -48,61 +48,13 @@ ...@@ -48,61 +48,13 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain 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" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click.native="handleMultiRevoke"
v-hasPermi="['system:dict:remove']" ><svg-icon icon-class="revoke" class="mr5"> </svg-icon>批量撤销分享</el-button
>删除</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> </el-col>
<right-toolbar <right-toolbar
...@@ -115,6 +67,7 @@ ...@@ -115,6 +67,7 @@
:data="shareList" :data="shareList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" />
<el-table-column <el-table-column
label="文件名称" label="文件名称"
align="center" align="center"
...@@ -180,14 +133,6 @@ ...@@ -180,14 +133,6 @@
</template> </template>
<script> <script>
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from "@/api/system/dict/type";
import { getMyShareList } from "@/api/user/share"; import { getMyShareList } from "@/api/user/share";
import { shareStatusConstant } from "./constant"; import { shareStatusConstant } from "./constant";
...@@ -245,6 +190,12 @@ export default { ...@@ -245,6 +190,12 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 查询字典类型列表 */ /** 查询字典类型列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -261,14 +212,7 @@ export default { ...@@ -261,14 +212,7 @@ export default {
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.resetForm("queryForm");
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined,
};
this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -281,83 +225,15 @@ export default { ...@@ -281,83 +225,15 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); 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) { handleCancelShare(row) {
console.log(row); console.log(row);
}, },
/** 修改按钮操作 */ // 批量取消分享
handleUpdate(row) { handleMultiRevoke(){
this.reset(); console.log(this.ids);
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>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论