Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
V
vue-quasar-admin-dev
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
vue-quasar-admin-dev
Commits
169a1987
Commit
169a1987
authored
Dec 25, 2025
by
周海峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
416d6b89
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
78 行增加
和
5 行删除
+78
-5
src/pages/permission/role.vue
+60
-5
src/service/permission/role.js
+18
-0
没有找到文件。
src/pages/permission/role.vue
View file @
169a1987
...
...
@@ -71,7 +71,38 @@
<q-field
:count=
"200"
>
<q-input
v-model=
"tempRole.description"
:float-label=
"$t('Role description')"
/>
</q-field>
<q-option-group
color=
"secondary"
type=
"checkbox"
v-model=
"group"
:options=
"itemList"
/>
<div
class=
"q-mt-md"
>
<div
class=
"row q-gutter-md"
>
<div
class=
"col-6"
>
<q-card
flat
bordered
class=
"full-height"
>
<div
class=
"text-h6"
>
PC端可见应用
</div>
<div
class=
"q-pa-md"
>
<q-option-group
color=
"primary"
type=
"checkbox"
v-model=
"group"
:options=
"itemList"
class=
"q-gutter-sm"
/>
</div>
</q-card>
</div>
<div
class=
"col-6"
>
<q-card
flat
bordered
class=
"full-height"
>
<div
class=
"text-h6"
>
App端可见应用
</div>
<div
class=
"q-pa-md"
>
<q-option-group
color=
"secondary"
type=
"checkbox"
v-model=
"groupApp"
:options=
"itemListApp"
class=
"q-gutter-sm"
/>
</div>
</q-card>
</div>
</div>
</div>
</div>
</q-modal-layout>
</q-modal>
...
...
@@ -85,7 +116,9 @@ import {
delRoles
,
saveRole
,
platformapplicationslistall
,
listbyrole
listbyrole
,
platformapplicationslistallApp
,
listbyroleApp
}
from
"@/service/permission/role"
;
export
default
{
name
:
"role"
,
...
...
@@ -134,6 +167,8 @@ export default {
},
itemList
:[],
group
:[],
itemListApp
:[],
groupApp
:[],
};
},
methods
:
{
...
...
@@ -212,23 +247,35 @@ export default {
},
async
editRole
(
id
)
{
this
.
group
=
[];
this
.
groupApp
=
[];
let
editRole
=
this
.
serverData
.
filter
(
s
=>
{
return
s
.
id
===
id
;
});
if
(
editRole
&&
editRole
.
length
>
0
)
{
this
.
tempRole
=
JSON
.
parse
(
JSON
.
stringify
(
editRole
[
0
]));
}
else
{
return
true
;
}
// 加载PC端应用权限
let
dataRes
=
await
listbyrole
(
this
.
tempRole
.
id
);
for
(
let
i
=
0
;
i
<
dataRes
.
data
.
data
.
length
;
i
++
){
this
.
group
.
push
(
dataRes
.
data
.
data
[
i
].
roleUseStatue
+
''
)
let
app
=
dataRes
.
data
.
data
[
i
];
if
(
app
.
roleUseStatue
!==
0
){
this
.
group
.
push
(
app
.
roleUseStatue
+
''
)
}
}
// 加载App端应用权限
let
dataResApp
=
await
listbyroleApp
(
this
.
tempRole
.
id
);
for
(
let
i
=
0
;
i
<
dataResApp
.
data
.
data
.
length
;
i
++
){
let
app
=
dataResApp
.
data
.
data
[
i
];
if
(
app
.
roleUseStatue
!==
0
){
this
.
groupApp
.
push
(
app
.
roleUseStatue
+
''
)
}
}
this
.
editModal
=
true
;
},
async
saveRole
()
{
debugger
if
(
this
.
tempRole
.
name
==
""
||
this
.
tempRole
.
name
==
null
||
this
.
tempRole
.
namezh
==
""
||
this
.
tempRole
.
namezh
==
null
)
{
this
.
$q
.
notify
({
message
:
"角色名称和角色编码不能为空"
,
...
...
@@ -241,6 +288,8 @@ export default {
}
let
groupstr
=
(
JSON
.
stringify
(
this
.
group
).
substr
(
1
,
JSON
.
stringify
(
this
.
group
).
length
-
2
)).
split
(
'"'
).
join
(
''
);
this
.
tempRole
.
group
=
groupstr
;
let
groupAppStr
=
(
JSON
.
stringify
(
this
.
groupApp
).
substr
(
1
,
JSON
.
stringify
(
this
.
groupApp
).
length
-
2
)).
split
(
'"'
).
join
(
''
);
this
.
tempRole
.
groupApp
=
groupAppStr
;
await
saveRole
(
this
.
tempRole
);
this
.
$q
.
notify
({
type
:
"positive"
,
...
...
@@ -258,18 +307,24 @@ export default {
addRole
()
{
this
.
tempRole
=
{};
this
.
group
=
[];
this
.
groupApp
=
[];
this
.
editModal
=
true
;
},
async
platformapplicationslistall
(){
let
dataRes
=
await
platformapplicationslistall
();
this
.
itemList
=
dataRes
.
data
.
data
;
},
async
platformapplicationslistallApp
(){
let
dataRes
=
await
platformapplicationslistallApp
();
this
.
itemListApp
=
dataRes
.
data
.
data
;
},
},
mounted
()
{
this
.
request
({
pagination
:
this
.
serverPagination
});
this
.
platformapplicationslistall
();
this
.
platformapplicationslistallApp
();
}
};
</
script
>
src/service/permission/role.js
View file @
169a1987
...
...
@@ -68,3 +68,21 @@ export function listbyrole(id){
loading
:
"hourglass"
})
}
export
function
platformapplicationslistallApp
(){
return
request
({
url
:
'/PlatformRoleApplicationAppController/platformapplications/listallApp'
,
method
:
'get'
,
data
:
''
,
loading
:
"hourglass"
})
}
export
function
listbyroleApp
(
id
){
return
request
({
url
:
'/PlatformRoleApplicationAppController/platformapplications/listbyroleApp/'
+
id
,
method
:
'get'
,
data
:
''
,
loading
:
"hourglass"
})
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论