Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
b9348f13
提交
b9348f13
authored
11月 29, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 我分享的没有及时刷新
上级
44fd7104
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
164 行增加
和
138 行删除
+164
-138
index.vue
frontend/src/views/panel/GrantAuth/ShareHead/index.vue
+11
-6
index.vue
frontend/src/views/panel/GrantAuth/dept/index.vue
+43
-47
index.vue
frontend/src/views/panel/GrantAuth/index.vue
+0
-2
index.vue
frontend/src/views/panel/GrantAuth/role/index.vue
+46
-35
shareTree.vue
frontend/src/views/panel/GrantAuth/shareTree.vue
+18
-12
index.vue
frontend/src/views/panel/GrantAuth/user/index.vue
+44
-34
PanelMain.vue
frontend/src/views/panel/list/PanelMain.vue
+2
-2
没有找到文件。
frontend/src/views/panel/GrantAuth/ShareHead/index.vue
浏览文件 @
b9348f13
...
...
@@ -7,22 +7,20 @@
</el-col>
<el-col
:span=
"8"
style=
"text-overflow:ellipsis;overflow: hidden;white-space: nowrap;font-size: 14px"
>
<span>
{{
$t
(
'panel.when_share'
)
+
': '
+
(
granterTime
?
new
Date
(
granterTime
).
format
(
'yyyy
年-MM月-dd日
'
)
:
''
)
}}
</span>
<span>
{{
$t
(
'panel.when_share'
)
+
': '
+
(
granterTime
?
new
Date
(
granterTime
).
format
(
'yyyy
-MM-dd hh:mm:ss
'
)
:
''
)
}}
</span>
</el-col>
<el-col
:span=
"8"
style=
"text-overflow:ellipsis;overflow: hidden;white-space: nowrap;font-size: 14px"
>
<
el-link
type=
"primary"
disabled
class=
"share-checked"
>
<!--
<el-checkbox
v-model=
"checked"
disabled
>
组织
</el-checkbox>
--
>
<
!-- 分享维度提醒 先注释 因为后面有可能还是需要的 --
>
<!--
<el-link
type=
"primary"
disabled
class=
"share-checked"
>
{{
$t
(
'panel.org'
)
}}
</el-link>
<el-link
type=
"success"
disabled
class=
"share-checked"
>
<!--
<el-checkbox
v-model=
"checked"
disabled
>
角色
</el-checkbox>
-->
{{
$t
(
'panel.role'
)
}}
</el-link>
<el-link
type=
"info"
disabled
class=
"share-checked"
>
<!--
<el-checkbox
v-model=
"checked"
disabled
>
用户
</el-checkbox>
-->
{{
$t
(
'panel.user'
)
}}
</el-link>
</el-link>
-->
</el-col>
</el-row>
<el-row
style=
"display: flex;"
>
...
...
@@ -68,6 +66,7 @@
<
script
>
import
GrantAuth
from
'../index'
import
{
shareTargets
,
removeShares
}
from
'@/api/panel/share'
import
bus
from
'@/utils/bus'
export
default
{
name
:
'ShareHead'
,
components
:
{
GrantAuth
},
...
...
@@ -135,7 +134,13 @@ export default {
this
.
granterTime
=
item
.
createTime
return
item
}).
sort
((
a
,
b
)
=>
b
.
type
-
a
.
type
)
if
(
!
this
.
dynamicTags
||
this
.
dynamicTags
.
length
===
0
)
{
this
.
afterRemoveAll
()
}
})
},
afterRemoveAll
()
{
bus
.
$emit
(
'refresh-my-share-out'
)
}
}
}
...
...
frontend/src/views/panel/GrantAuth/dept/index.vue
浏览文件 @
b9348f13
...
...
@@ -18,13 +18,13 @@
>
<span
slot-scope=
"
{ node, data }" class="custom-tree-node">
<span>
<span
style=
"margin-left: 6px"
>
{{
data
.
name
}}
</span>
<span
style=
"margin-left: 6px"
>
{{
node
.
data
.
name
}}
</span>
</span>
<span
@
click
.
stop
>
<div>
<span
class=
"auth-span"
>
<el-checkbox
v-model=
"data.checked"
/>
<el-checkbox
v-model=
"data.checked"
@
change=
"nodeStatusChange(data)"
/>
</span>
</div>
</span>
...
...
@@ -68,7 +68,8 @@ export default {
return
!
data
.
hasChildren
}
},
expandNodeIds
:
[]
expandNodeIds
:
[],
sharesLoad
:
false
}
},
watch
:
{
...
...
@@ -125,33 +126,36 @@ export default {
}
else
{
param
=
{
conditions
:
[
this
.
defaultCondition
]
}
}
if
(
!
this
.
sharesLoad
)
{
this
.
queryShareNodeIds
(()
=>
{
this
.
sharesLoad
=
true
this
.
loadTreeData
(
param
,
condition
)
})
}
else
{
this
.
loadTreeData
(
param
,
condition
)
}
},
this
.
queryShareNodeIds
(()
=>
{
loadTable
(
param
).
then
(
res
=>
{
let
data
=
res
.
data
data
=
data
.
map
(
obj
=>
{
if
(
obj
.
subCount
>
0
)
{
obj
.
hasChildren
=
true
}
return
obj
})
this
.
setCheckExpandNodes
(
data
)
this
.
expandNodeIds
=
[]
if
(
condition
&&
condition
.
value
)
{
// data = data.map(node => {
// delete (node.hasChildren)
// return node
// })
this
.
data
=
this
.
buildTree
(
data
)
this
.
$nextTick
(()
=>
{
// this.expandNodeIds.push()
this
.
expandResult
(
this
.
data
)
})
}
else
{
this
.
data
=
data
loadTreeData
(
param
,
condition
)
{
loadTable
(
param
).
then
(
res
=>
{
let
data
=
res
.
data
data
=
data
.
map
(
obj
=>
{
if
(
obj
.
subCount
>
0
)
{
obj
.
hasChildren
=
true
}
return
obj
})
this
.
setCheckExpandNodes
(
data
)
this
.
expandNodeIds
=
[]
if
(
condition
&&
condition
.
value
)
{
this
.
data
=
this
.
buildTree
(
data
)
this
.
$nextTick
(()
=>
{
this
.
expandResult
(
this
.
data
)
})
}
else
{
this
.
data
=
data
}
})
},
...
...
@@ -185,18 +189,8 @@ export default {
},
getSelected
()
{
// const ids = []
// this.searchChecked(ids)
// return {
// deptIds: ids
// }
// const ids = []
const
nodesMap
=
this
.
$refs
.
tree
.
store
.
nodesMap
const
ids
=
Object
.
values
(
nodesMap
).
filter
(
node
=>
node
.
data
.
checked
).
map
(
item
=>
item
.
data
.
deptId
)
return
{
deptIds
:
id
s
deptIds
:
this
.
share
s
}
},
...
...
@@ -221,24 +215,26 @@ export default {
const
shares
=
res
.
data
const
nodeIds
=
shares
.
map
(
share
=>
share
.
targetId
)
this
.
shares
=
nodeIds
// this.$nextTick(() => {
// this.setCheckNodes()
// })
callBack
&&
callBack
()
})
},
// setCheckNodes() {
// this.data.forEach(node => {
// const nodeId = node.deptId
// this.shares.includes(nodeId) && (node.checked = true)
// })
// },
setCheckExpandNodes
(
rows
)
{
rows
.
forEach
(
node
=>
{
const
nodeId
=
node
.
deptId
this
.
shares
.
includes
(
nodeId
)
&&
(
node
.
checked
=
true
)
})
},
nodeStatusChange
(
val
)
{
if
(
val
.
checked
)
{
if
(
!
this
.
shares
.
includes
(
val
.
deptId
))
{
this
.
shares
.
push
(
val
.
deptId
)
}
}
else
{
this
.
shares
=
this
.
shares
.
filter
(
deptId
=>
deptId
!==
val
.
deptId
)
}
}
}
...
...
frontend/src/views/panel/GrantAuth/index.vue
浏览文件 @
b9348f13
...
...
@@ -59,8 +59,6 @@ export default {
this
.
showSearchInput
=
false
},
save
()
{
// this.$refs[this.activeName].save(this.$t('commons.share_success'))
// this.$emit('close-grant', 0)
this
.
fineSave
()
},
fineSave
()
{
...
...
frontend/src/views/panel/GrantAuth/role/index.vue
浏览文件 @
b9348f13
...
...
@@ -2,11 +2,12 @@
<div
class=
"my_table"
>
<el-table
ref=
"table"
:data=
"
data.filter(node => !keyWord || node[fieldName].toLowerCase().includes(keyWord.toLowerCase()))
"
:data=
"
tableData
"
:show-header=
"true"
style=
"width: 100%"
:row-style=
"
{height: '35px'}"
@filter-change="filterChange"
@select="selectOne"
@select-all="selectAll"
>
<el-table-column
:column-key=
"fieldName"
:label=
"columnLabel"
:prop=
"fieldName"
filter-placement=
"right-start"
:filters=
"filter_options"
:filter-multiple=
"false"
:filter-method=
"filterHandler"
/>
<el-table-column
type=
"selection"
fixd
/>
...
...
@@ -18,7 +19,6 @@
import
{
roleGrid
}
from
'@/api/system/user'
import
{
formatCondition
}
from
'@/utils/index'
import
{
loadShares
}
from
'@/api/panel/share'
/* import { saveShare, loadShares } from '@/api/panel/share' */
export
default
{
name
:
'GrantRole'
,
props
:
{
...
...
@@ -39,7 +39,15 @@ export default {
filter_options
:
[{
text
:
this
.
$t
(
'panel.no_auth_role'
),
value
:
0
},
{
text
:
this
.
$t
(
'panel.auth_role'
),
value
:
1
}],
fieldName
:
'name'
,
type
:
1
,
// 类型1代表角色
shares
:
[]
shares
:
[],
tableData
:
[]
}
},
watch
:
{
'keyWord'
:
function
(
val
)
{
this
.
tableData
=
this
.
data
.
filter
(
node
=>
!
val
||
node
[
this
.
fieldName
].
toLowerCase
().
includes
(
val
.
toLowerCase
()))
this
.
setCheckNodes
()
}
},
created
()
{
...
...
@@ -56,48 +64,22 @@ export default {
const
param
=
temp
||
{}
roleGrid
(
1
,
0
,
param
).
then
(
response
=>
{
const
data
=
response
.
data
// this.total = data.itemCount
this
.
data
=
data
.
listObject
this
.
tableData
=
data
.
listObject
this
.
queryShareNodeIds
()
})
},
filterHandler
(
value
,
row
,
column
)
{
// const property = column['property']
// return row[property] === value
const
roleId
=
row
[
'roleId'
]
return
!
(
value
^
this
.
shares
.
includes
(
roleId
))
},
filterChange
(
obj
)
{
const
arr
=
obj
[
this
.
fieldName
]
if
(
arr
.
length
===
0
)
{
this
.
initColumnLabel
()
}
else
{
this
.
columnLabel
=
this
.
filter_options
[
arr
[
0
]].
text
}
this
.
$nextTick
(()
=>
{
this
.
setCheckNodes
()
})
},
getSelected
()
{
return
{
roleIds
:
this
.
$refs
.
table
.
store
.
states
.
selection
.
map
(
item
=>
item
.
roleId
)
roleIds
:
this
.
shares
}
},
/* save(msg) {
const rows = this.$refs.table.store.states.selection
const request = this.buildRequest(rows)
saveShare(request).then(res => {
this.$success(msg)
return true
}).catch(err => {
this.$error(err.message)
return false
})
}, */
cancel
()
{
},
buildRequest
(
rows
)
{
...
...
@@ -126,10 +108,39 @@ export default {
},
setCheckNodes
()
{
this
.
data
.
forEach
(
node
=>
{
const
nodeId
=
node
.
roleId
this
.
shares
.
includes
(
nodeId
)
&&
this
.
$refs
.
table
.
toggleRowSelection
(
node
,
true
)
this
.
$nextTick
(()
=>
{
this
.
$refs
.
table
.
store
.
states
.
data
.
forEach
(
node
=>
{
const
nodeId
=
node
.
roleId
this
.
shares
.
includes
(
nodeId
)
&&
this
.
$refs
.
table
.
toggleRowSelection
(
node
,
true
)
})
})
},
selectOne
(
selection
,
row
)
{
if
(
selection
.
some
(
node
=>
node
.
roleId
===
row
.
roleId
))
{
// 如果选中了 且 已有分享数据不包含当前节点则添加
if
(
!
this
.
shares
.
includes
(
row
.
roleId
))
{
this
.
shares
.
push
(
row
.
roleId
)
}
}
else
{
// 如果取消选中 则移除
this
.
shares
=
this
.
shares
.
filter
(
nodeId
=>
row
.
roleId
!==
nodeId
)
// this.shares.splice(this.shares.findIndex(item => item.roleId === row.roleId), 1)
}
},
selectAll
(
selection
)
{
// 1.全选
if
(
selection
&&
selection
.
length
>
0
)
{
selection
.
forEach
(
node
=>
{
if
(
!
this
.
shares
.
includes
(
node
.
roleId
))
{
this
.
shares
.
push
(
node
.
roleId
)
}
})
}
else
{
// 2.全部取消
const
currentNodes
=
this
.
$refs
.
table
.
store
.
states
.
data
const
currentNodeIds
=
currentNodes
.
map
(
node
=>
node
.
roleId
)
this
.
shares
=
this
.
shares
.
filter
(
nodeId
=>
!
currentNodeIds
.
includes
(
nodeId
))
}
}
}
...
...
frontend/src/views/panel/GrantAuth/shareTree.vue
浏览文件 @
b9348f13
...
...
@@ -11,15 +11,7 @@
</span>
<span
style=
"margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
>
{{
data
.
name
}}
</span>
</span>
<!--
<span
:class=
"!!data.msgNode ? 'msg-node-class': ''"
>
<span
v-if=
"!!data.id"
>
<el-button
icon=
"el-icon-picture-outline"
type=
"text"
/>
</span>
<span
style=
"margin-left: 6px"
>
{{
data
.
name
}}
</span>
</span>
-->
</span>
</el-tree>
</div>
...
...
@@ -28,9 +20,9 @@
<el-row>
<span
class=
"header-title"
>
{{
$t
(
'panel.share_out'
)
}}
</span>
<div
class=
"block"
style=
"margin-top:8px;"
>
<el-tree
:data=
"outDatas"
:props=
"defaultProps"
:highlight-current=
"true"
node-key=
"name"
:default-expand-all=
"true"
@
node-click=
"viewMyShare"
>
<el-tree
:data=
"outDatas"
:props=
"defaultProps"
:highlight-current=
"true"
node-key=
"name"
:default-expand-all=
"true"
>
<span
slot-scope=
"
{ data }" class="custom-tree-node father">
<span
style=
"display: flex; flex: 1 1 0%; width: 0px;"
>
<span
style=
"display: flex; flex: 1 1 0%; width: 0px;"
@
click=
"viewMyShare(data)"
>
<span
v-if=
"!!data.id"
>
<svg-icon
icon-class=
"panel"
class=
"ds-icon-scene"
/>
</span>
...
...
@@ -79,7 +71,18 @@ export default {
outDatas
:
[]
}
},
computed
:
{
panelInfo
()
{
return
this
.
$store
.
state
.
panel
.
panelInfo
}
},
created
()
{
bus
.
$on
(
'refresh-my-share-out'
,
()
=>
{
this
.
initOutData
().
then
(
res
=>
{
this
.
outDatas
=
res
.
data
this
.
setMainNull
()
})
})
this
.
initData
().
then
(
res
=>
{
this
.
datas
=
res
.
data
if
(
this
.
msgPanelIds
&&
this
.
msgPanelIds
.
length
>
0
)
{
...
...
@@ -145,7 +148,6 @@ export default {
})
},
removeCurrent
(
node
)
{
console
.
log
(
node
)
const
param
=
{
panelId
:
node
.
id
}
...
...
@@ -156,6 +158,7 @@ export default {
type
:
'warning'
}).
then
(()
=>
{
removeShares
(
param
).
then
(
res
=>
{
this
.
panelInfo
&&
this
.
panelInfo
.
id
&&
node
.
id
===
this
.
panelInfo
.
id
&&
this
.
setMainNull
()
this
.
initOutData
().
then
(
res
=>
{
this
.
outDatas
=
res
.
data
})
...
...
@@ -167,6 +170,9 @@ export default {
message
:
this
.
$t
(
'commons.delete_cancelled'
)
})
})
},
setMainNull
()
{
this
.
$store
.
dispatch
(
'panel/setPanelInfo'
,
{
id
:
null
,
name
:
''
,
preStyle
:
null
})
}
}
...
...
frontend/src/views/panel/GrantAuth/user/index.vue
浏览文件 @
b9348f13
...
...
@@ -2,11 +2,12 @@
<div
class=
"my_table"
>
<el-table
ref=
"table"
:data=
"
data.filter(node => !keyWord || node[fieldName].toLowerCase().includes(keyWord.toLowerCase()))
"
:data=
"
tableData
"
:show-header=
"true"
style=
"width: 100%"
:row-style=
"
{height: '35px'}"
@filter-change="filterChange"
@select="selectOne"
@select-all="selectAll"
>
<el-table-column
:column-key=
"fieldName"
...
...
@@ -47,7 +48,14 @@ export default {
filter_options
:
[{
text
:
this
.
$t
(
'panel.unshared_people'
),
value
:
0
},
{
text
:
this
.
$t
(
'panel.shared_people'
),
value
:
1
}],
fieldName
:
'nickName'
,
type
:
0
,
// 类型0代表用户
shares
:
[]
shares
:
[],
tableData
:
[]
}
},
watch
:
{
'keyWord'
:
function
(
val
)
{
this
.
tableData
=
this
.
data
.
filter
(
node
=>
!
val
||
node
[
this
.
fieldName
].
toLowerCase
().
includes
(
val
.
toLowerCase
()))
this
.
setCheckNodes
()
}
},
created
()
{
...
...
@@ -63,48 +71,22 @@ export default {
const
param
=
temp
||
{}
userLists
(
1
,
0
,
param
).
then
(
response
=>
{
const
data
=
response
.
data
// this.total = data.itemCount
this
.
data
=
data
.
listObject
.
filter
(
ele
=>
ele
.
id
!==
this
.
$store
.
getters
.
user
.
userId
)
this
.
tableData
=
data
.
listObject
.
filter
(
ele
=>
ele
.
id
!==
this
.
$store
.
getters
.
user
.
userId
)
this
.
queryShareNodeIds
()
})
},
filterHandler
(
value
,
row
,
column
)
{
// const property = column['property']
// return row[property] === value
const
userId
=
row
[
'userId'
]
return
!
(
value
^
this
.
shares
.
includes
(
userId
))
},
filterChange
(
obj
)
{
const
arr
=
obj
[
this
.
fieldName
]
if
(
arr
.
length
===
0
)
{
this
.
initColumnLabel
()
}
else
{
this
.
columnLabel
=
this
.
filter_options
[
arr
[
0
]].
text
}
this
.
$nextTick
(()
=>
{
this
.
setCheckNodes
()
})
},
getSelected
()
{
return
{
userIds
:
this
.
$refs
.
table
.
store
.
states
.
selection
.
map
(
item
=>
item
.
userId
)
userIds
:
this
.
shares
}
},
/* save(msg) {
const rows = this.$refs.table.store.states.selection
const request = this.buildRequest(rows)
saveShare(request).then(response => {
this.$success(msg)
return true
}).catch(err => {
this.$error(err.message)
return false
})
}, */
cancel
()
{
console
.
log
(
'user cancel'
)
},
...
...
@@ -134,10 +116,38 @@ export default {
},
setCheckNodes
()
{
this
.
data
.
forEach
(
node
=>
{
const
nodeId
=
node
.
userId
this
.
shares
.
includes
(
nodeId
)
&&
this
.
$refs
.
table
.
toggleRowSelection
(
node
,
true
)
this
.
$nextTick
(()
=>
{
this
.
$refs
.
table
.
store
.
states
.
data
.
forEach
(
node
=>
{
const
nodeId
=
node
.
userId
this
.
shares
.
includes
(
nodeId
)
&&
this
.
$refs
.
table
.
toggleRowSelection
(
node
,
true
)
})
})
},
selectOne
(
selection
,
row
)
{
if
(
selection
.
some
(
node
=>
node
.
userId
===
row
.
userId
))
{
// 如果选中了 且 已有分享数据不包含当前节点则添加
if
(
!
this
.
shares
.
includes
(
row
.
userId
))
{
this
.
shares
.
push
(
row
.
userId
)
}
}
else
{
// 如果取消选中 则移除
this
.
shares
=
this
.
shares
.
filter
(
nodeId
=>
row
.
userId
!==
nodeId
)
}
},
selectAll
(
selection
)
{
// 1.全选
if
(
selection
&&
selection
.
length
>
0
)
{
selection
.
forEach
(
node
=>
{
if
(
!
this
.
shares
.
includes
(
node
.
userId
))
{
this
.
shares
.
push
(
node
.
userId
)
}
})
}
else
{
// 2.全部取消
const
currentNodes
=
this
.
$refs
.
table
.
store
.
states
.
data
const
currentNodeIds
=
currentNodes
.
map
(
node
=>
node
.
userId
)
this
.
shares
=
this
.
shares
.
filter
(
nodeId
=>
!
currentNodeIds
.
includes
(
nodeId
))
}
}
}
...
...
frontend/src/views/panel/list/PanelMain.vue
浏览文件 @
b9348f13
...
...
@@ -4,7 +4,7 @@
<el-tabs
v-model=
"activeName"
class=
"tab-panel"
:stretch=
"true"
@
tab-click=
"handleClick"
>
<el-tab-pane
name=
"PanelList"
>
<span
slot=
"label"
><i
class=
"el-icon-document tablepanel-i"
/>
{{
$t
(
'panel.panel_list'
)
}}
</span>
<panel-list
ref=
"panelList"
v-if=
"activeName==='PanelList'
"
/>
<panel-list
v-if=
"activeName==='PanelList'"
ref=
"panelList
"
/>
</el-tab-pane>
<el-tab-pane
name=
"panels_star"
:lazy=
"true"
>
<span
slot=
"label"
><i
class=
"el-icon-star-off tablepanel-i"
/>
{{
$t
(
'panel.store'
)
}}
</span>
...
...
@@ -17,7 +17,7 @@
</el-tabs>
</de-aside-container>
<de-main-container>
<PanelViewShow
v-if=
"mainActiveName==='PanelMain'"
:active-tab=
"activeName"
@
editPanel=
"editPanel"
/>
<PanelViewShow
v-if=
"mainActiveName==='PanelMain'"
:active-tab=
"activeName"
@
editPanel=
"editPanel"
/>
</de-main-container>
</de-container>
</
template
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论