修改:测试修改权限处理
This commit is contained in:
parent
a5335b9e9c
commit
094ae8aeec
@ -247,4 +247,12 @@ export default {
|
||||
params
|
||||
})
|
||||
},
|
||||
// 是否允许下载
|
||||
isAllowDownload: function(params) {
|
||||
return request({
|
||||
url: '/isAllowDownload',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
@ -1622,6 +1622,8 @@ export default {
|
||||
this.getFileList()
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
this.newFolderLoading = false
|
||||
})
|
||||
} else {
|
||||
this.newFolderLoading = false
|
||||
@ -2221,6 +2223,9 @@ export default {
|
||||
}
|
||||
}).then(() => {
|
||||
this.$refs.fileListTable.clearSelection()
|
||||
}).catch(() => {
|
||||
this.renameLoading = false
|
||||
this.editingIndex = -1
|
||||
})
|
||||
},
|
||||
// 更多操作(多选)
|
||||
@ -2652,17 +2657,20 @@ export default {
|
||||
row = this.$refs.fileListTable.tableSelectData[0]
|
||||
}
|
||||
}
|
||||
this.shareDialog = true
|
||||
this.shareFileName = row.name
|
||||
api.generate({
|
||||
userId: row.userId,
|
||||
fileId: row.id,
|
||||
isFolder: row.isFolder
|
||||
}).then(res => {
|
||||
this.shareDialog = true
|
||||
if (res.data) {
|
||||
this.shareLink = window.location.origin + '/s?s=' + res.data
|
||||
this.generateShareLinkLoading = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.shareDialog = false
|
||||
this.generateShareLinkLoading = false
|
||||
})
|
||||
},
|
||||
// 复制分享链接
|
||||
@ -2733,6 +2741,8 @@ export default {
|
||||
// 移除列表
|
||||
this.removeSelectItme()
|
||||
}
|
||||
}).catch(()=>{
|
||||
this.rowContextData.isFavorite = !isFavorite
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
|
||||
@ -319,6 +319,15 @@
|
||||
},
|
||||
onFileSuccess(rootFile, file, response) {
|
||||
const res = JSON.parse(response)
|
||||
if(!res.data){
|
||||
this.$message({
|
||||
message: res.message,
|
||||
type: 'error'
|
||||
})
|
||||
this.uploader.cancel()
|
||||
this.close()
|
||||
return;
|
||||
}
|
||||
const data = res.data
|
||||
// 服务器自定义的错误(即虽返回200,但是是错误的情况),这种错误是Uploader无法拦截的
|
||||
if (!data.upload) {
|
||||
|
||||
@ -36,7 +36,6 @@
|
||||
class="simtext-dialog"
|
||||
v-dialogDrag="{ dialogWidthPercent: dialogWidthPercent}">
|
||||
<div slot="title" class="simtext-header-title">
|
||||
<!--<span class="title-name">{{file.name}}</span>-->
|
||||
<span><file-path-nav class="title-name" :path="filePathNav" @loadPath="loadPath"></file-path-nav></span>
|
||||
<div class="title-extension">
|
||||
<el-button v-if="isShowUpdateBtn" @click="saveAll(false)" :class="lightTheme?'':'dark-button'" size="small" :loading="updating">保存所有</el-button>
|
||||
@ -681,7 +680,9 @@
|
||||
that.modifyMsg = undefined
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.updating = false
|
||||
})
|
||||
},
|
||||
// 全屏
|
||||
fullScreen() {
|
||||
|
||||
@ -100,7 +100,6 @@ export default {
|
||||
handleNodeClick(node){
|
||||
this.valueTitle = node[this.props.label]
|
||||
this.valueId = node[this.props.value]
|
||||
this.$emit('getValue',this.valueId)
|
||||
this.defaultExpandedKey = []
|
||||
this.$refs.treeSelect.blur()
|
||||
this.$emit('input', this.valueId)
|
||||
@ -111,7 +110,7 @@ export default {
|
||||
this.valueId = null
|
||||
this.defaultExpandedKey = []
|
||||
this.clearSelected()
|
||||
this.$emit('getValue',null)
|
||||
this.$emit('input', '')
|
||||
},
|
||||
/* 清空选中样式 */
|
||||
clearSelected(){
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
<div class="table-temp">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:max-height="tableMaxHeight"
|
||||
row-key="id"
|
||||
border
|
||||
size="medium"
|
||||
@ -81,6 +82,10 @@ export default {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
lessClientHeight: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
tableHeader: {
|
||||
type: Array,
|
||||
default: function() {
|
||||
@ -106,6 +111,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableMaxHeight: document.documentElement.clientHeight,
|
||||
multipleSelection: [],
|
||||
newPagination: {
|
||||
pageIndex: 0,
|
||||
@ -114,7 +120,17 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.setMaxHeight()
|
||||
let that = this
|
||||
window.onresize = function (){
|
||||
that.setMaxHeight()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setMaxHeight(){
|
||||
this.tableMaxHeight = document.documentElement.clientHeight - this.lessClientHeight
|
||||
},
|
||||
// 多选操作
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
@ -135,11 +151,11 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
//后端排序
|
||||
// 后端排序
|
||||
sortChange(column) {
|
||||
//调用父组件方法
|
||||
this.$emit('sortChange', { backData: column });
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -64,7 +64,7 @@ function setMenuList(next, to){
|
||||
store.dispatch('user/setMenuList').then((res) => {
|
||||
const to = window.location.pathname
|
||||
if(findPath(res.data, to)){
|
||||
next({path: to})
|
||||
next(window.location.pathname + window.location.search)
|
||||
} else {
|
||||
next({path: store.getters.menuList[0].path})
|
||||
}
|
||||
@ -82,10 +82,15 @@ function setMenuList(next, to){
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function findPath(menuList, to, parentPath){
|
||||
for( let i = 0; i < menuList.length - 1; i++) {
|
||||
for( let i = 0; i < menuList.length; i++) {
|
||||
const menu = menuList[i]
|
||||
if(menu.menuType > 0){
|
||||
continue
|
||||
}
|
||||
if(menu.children && menu.children.length > 0){
|
||||
return findPath(menu.children, to, menu.path)
|
||||
if(findPath(menu.children, to, menu.path)){
|
||||
return true
|
||||
}
|
||||
}
|
||||
if(parentPath){
|
||||
menu.path = parentPath + '/' + menu.path
|
||||
|
||||
@ -49,7 +49,7 @@ const actions = {
|
||||
return new Promise( (resolve,reject) => {
|
||||
menuApi.menuTree({userId: state.userId}).then((res) => {
|
||||
state.menuList = getMenuTree(res.data);
|
||||
commit('SET_MENU_LIST',state.menuList);
|
||||
commit('SET_MENU_LIST', state.menuList);
|
||||
resetRouter(state.menuList)
|
||||
router.options.routes = router.options.routes.concat(state.menuList);
|
||||
resolve(res)
|
||||
@ -134,6 +134,7 @@ const actions = {
|
||||
}
|
||||
|
||||
function getMenuTree(menuList) {
|
||||
menuList = menuList.filter(menu => menu.menuType === 0)
|
||||
return menuList.map(menu => {
|
||||
let router = {}
|
||||
if(menu.children && menu.children.length){
|
||||
@ -158,6 +159,7 @@ function getMenuTree(menuList) {
|
||||
|
||||
function findChildren(childrenMenu){
|
||||
let children = []
|
||||
childrenMenu = childrenMenu.filter(menu => menu.menuType === 0)
|
||||
childrenMenu.forEach(menu => {
|
||||
let router = {
|
||||
path: menu.path,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
@import "src/styles/index";
|
||||
a {
|
||||
color: #1890ff;
|
||||
text-decoration: none;
|
||||
@ -16,7 +17,7 @@ a:hover {
|
||||
}
|
||||
/deep/.box-card {
|
||||
margin: 0 auto;
|
||||
max-width: 1140px;
|
||||
max-width: 1240px;
|
||||
min-width: 640px;
|
||||
.clearfix {
|
||||
font-size: 16px;
|
||||
@ -30,6 +31,9 @@ a:hover {
|
||||
}
|
||||
}
|
||||
}
|
||||
/deep/.el-card__body {
|
||||
padding: 15px;
|
||||
}
|
||||
.table-search-header{
|
||||
/deep/.el-card__header {
|
||||
padding: 18px 20px 0;
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import fileApi from '@/api/file-api'
|
||||
|
||||
export default {
|
||||
|
||||
baseUrl: '/api',
|
||||
@ -20,15 +22,19 @@ export default {
|
||||
window.open(url, '_blank')
|
||||
},
|
||||
download: function(username, file) {
|
||||
let url = `${this.baseUrl}/file/${username}${file.path}${file.name}?o=download`
|
||||
window.open(url, '_self')
|
||||
fileApi.isAllowDownload().then(() => {
|
||||
let url = `${this.baseUrl}/file/${username}${file.path}${file.name}?o=download`
|
||||
window.open(url, '_self')
|
||||
})
|
||||
},
|
||||
publicDownload: function(shareId, file) {
|
||||
let url = `${this.baseUrl}/public/s/download/${file.id}/${shareId}`
|
||||
window.open(url, '_self')
|
||||
},
|
||||
packageDownload: function(fileIds, token) {
|
||||
window.open(`${this.baseUrl}/packageDownload?fileIds=${fileIds}&jmal-token=${token}`, '_self')
|
||||
fileApi.isAllowDownload().then(() => {
|
||||
window.open(`${this.baseUrl}/packageDownload?fileIds=${fileIds}&jmal-token=${token}`, '_self')
|
||||
})
|
||||
},
|
||||
publicPackageDownload: function(shareId, fileIds) {
|
||||
window.open(`${this.baseUrl}/public/s/packageDownload?shareId=${shareId}&fileIds=${fileIds}`, '_self')
|
||||
|
||||
@ -439,11 +439,8 @@ export default {
|
||||
.wailian {
|
||||
margin-left: 8px;
|
||||
}
|
||||
/deep/.el-card__body {
|
||||
min-width: 1080px;
|
||||
}
|
||||
/deep/ .el-dialog__body {
|
||||
padding: 0 20px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
/deep/ .el-table-alone-page {
|
||||
tbody .el-table__row:hover {
|
||||
|
||||
@ -149,7 +149,7 @@ export default {
|
||||
updateSetting(this.form).then((res)=> {
|
||||
this.$message.success("保存成功!")
|
||||
}).catch(()=> {
|
||||
this.$message.error("保存失败!")
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,11 +55,15 @@ export default {
|
||||
this.syncLoading = true
|
||||
settingApi.sync({username: this.$store.state.user.name}).then(() => {
|
||||
this.syncLoading = false
|
||||
}).catch(() => {
|
||||
this.syncLoading = false
|
||||
})
|
||||
},
|
||||
webpChange(webpEnabled) {
|
||||
settingApi.disabledWebp({userId: this.$store.state.user.userId, disabled: !webpEnabled}).then(() => {
|
||||
webpEnabled ? this.$message.success('webp 以启用') : this.$message.warning('webp 以禁用')
|
||||
}).catch(() => {
|
||||
this.webpEnabled = !this.webpEnabled
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,19 @@
|
||||
</el-col>
|
||||
<el-col :sm="12">
|
||||
<el-form-item label="权限标识:" prop="authority">
|
||||
<el-input placeholder="请输入权限标识" v-model="form.authority" />
|
||||
<el-select
|
||||
v-model="form.authority"
|
||||
placeholder="请选择权限标识"
|
||||
clearable
|
||||
:popper-append-to-body="false"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in authorityList"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序号:" prop="sortNumber">
|
||||
<el-input-number v-model="form.sortNumber" controls-position="right" :min="0"></el-input-number>
|
||||
@ -78,6 +90,7 @@
|
||||
<table-list
|
||||
:has-selection="false"
|
||||
:tableData="dataList"
|
||||
:less-client-height="210"
|
||||
:loading="loading"
|
||||
:tableHeader="tableHeader"
|
||||
:pagination="pagination"
|
||||
@ -106,6 +119,7 @@ export default {
|
||||
return {
|
||||
title: "角色管理",
|
||||
dataList: [],
|
||||
authorityList: [],
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
dialogTitle: '',
|
||||
@ -183,6 +197,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getMenuTree()
|
||||
this.getAuthorityList()
|
||||
this.resize()
|
||||
},
|
||||
methods: {
|
||||
@ -206,6 +221,11 @@ export default {
|
||||
this.pagination = data.backData;
|
||||
this.getMenuTree()
|
||||
},
|
||||
getAuthorityList() {
|
||||
menuApi.authorityList().then(res => {
|
||||
this.authorityList = res.data
|
||||
})
|
||||
},
|
||||
getMenuTree(){
|
||||
this.loading = true
|
||||
menuApi.menuTree({
|
||||
@ -353,4 +373,7 @@ export default {
|
||||
/deep/ .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
/deep/.box-card {
|
||||
max-width: 1440px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -18,15 +18,19 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog width="400px" title="分配权限" :visible.sync="dialogAuthVisible">
|
||||
<el-tree
|
||||
ref="authTree"
|
||||
:data="menuList"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
:default-checked-keys="menuCheckedList"
|
||||
:props="{value: 'id', label: 'name'}">
|
||||
</el-tree>
|
||||
<el-scrollbar>
|
||||
<el-tree
|
||||
style="max-height: 50vh"
|
||||
ref="authTree"
|
||||
:data="menuList"
|
||||
:check-strictly="true"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
:default-checked-keys="menuCheckedList"
|
||||
:props="{value: 'id', label: 'name'}">
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="dialogAuthVisible = false">取 消</el-button>
|
||||
<el-button size="small" type="primary" :loading="updateLoading" @click.native.prevent="saveAuth()">保 存</el-button>
|
||||
@ -64,6 +68,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<table-list
|
||||
:less-client-height="290"
|
||||
:tableData="dataList"
|
||||
:loading="loading"
|
||||
:tableHeader="tableHeader"
|
||||
@ -237,8 +242,12 @@ export default {
|
||||
this.dialogAuthVisible = true
|
||||
const findIndex = this.dataList.findIndex(data => data.id === roleId)
|
||||
const role = this.dataList[findIndex]
|
||||
this.form.id = role.id
|
||||
this.menuCheckedList = role.menuIds
|
||||
this.form = role
|
||||
if(this.$refs.authTree){
|
||||
this.$refs.authTree.setCheckedKeys(role.menuIds)
|
||||
} else {
|
||||
this.menuCheckedList = role.menuIds
|
||||
}
|
||||
},
|
||||
handleEdit(id) {
|
||||
this.editMove = 2
|
||||
@ -322,7 +331,6 @@ export default {
|
||||
},
|
||||
onError() {
|
||||
this.updateLoading = false
|
||||
this.dialogAuthVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user