Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
web
soss
Commits
1ba4040d
Commit
1ba4040d
authored
Jun 02, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改权限
parent
30c6c712
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
26 deletions
+41
-26
src/api/system/role.js
+1
-1
src/components/ImageUpload/index.vue
+28
-3
src/directive/permission/hasPermi.js
+2
-4
src/views/system/base/components/leftImg.vue
+3
-3
src/views/system/base/components/right.vue
+4
-10
src/views/system/base/index.vue
+3
-5
No files found.
src/api/system/role.js
View file @
1ba4040d
...
...
@@ -51,7 +51,7 @@ export function changeRoleStatus(roleId, status) {
status
}
return
request
({
url
:
'/system/
role/changeS
tatus'
,
url
:
'/system/
s
tatus'
,
method
:
'put'
,
data
:
data
})
...
...
src/components/ImageUpload/index.vue
View file @
1ba4040d
...
...
@@ -3,7 +3,7 @@
<el-upload
multiple
:action=
"uploadImgUrl"
list-type=
"picture-card"
:on-success=
"handleUploadSuccess"
:before-upload=
"handleBeforeUpload"
:limit=
"limit"
:on-error=
"handleUploadError"
:on-exceed=
"handleExceed"
name=
"file"
:on-remove=
"handleRemove"
:show-file-list=
"true"
:headers=
"headers"
:file-list=
"fileList"
:on-preview=
"handlePictureCardPreview"
:class=
"
{ hide: this.fileList.length >= this.limit }">
:on-preview=
"handlePictureCardPreview"
:class=
"
{ hide: this.fileList.length >= this.limit }"
:disabled="disabled"
>
<i
class=
"el-icon-plus"
></i>
</el-upload>
...
...
@@ -27,7 +27,7 @@
<
script
>
import
{
getToken
}
from
"@/utils/auth"
;
import
store
from
'@/store'
export
default
{
props
:
{
value
:
[
String
,
Object
,
Array
],
...
...
@@ -72,6 +72,7 @@ export default {
Authorization
:
"Bearer "
+
getToken
(),
},
fileList
:
[],
disabled
:
true
};
},
watch
:
{
...
...
@@ -104,7 +105,10 @@ export default {
// 是否显示提示
showTip
()
{
return
this
.
isShowTip
&&
(
this
.
fileType
||
this
.
fileSize
);
},
}
},
created
()
{
this
.
bb
();
},
methods
:
{
// 删除图片
...
...
@@ -198,6 +202,23 @@ export default {
return
strs
;
},
bb
(){
const
permissions
=
store
.
getters
&&
store
.
getters
.
permissions
;
if
(
permissions
.
length
>
0
){
if
(
permissions
[
0
]
==
"*:*:*"
){
this
.
disabled
=
false
return
;
}
for
(
let
i
=
0
;
i
<
permissions
.
length
;
i
++
){
if
(
permissions
[
i
]
==
"system:config:edit"
){
this
.
disabled
=
false
console
.
log
(
"this.disabled"
,
this
.
disabled
)
return
;
}
}
}
}
},
};
</
script
>
...
...
@@ -229,4 +250,8 @@ export default {
height
:
100px
;
line-height
:
110px
;
}
.el-upload-list__item-delete
{
display
:
none
!important
;
}
</
style
>
src/directive/permission/hasPermi.js
View file @
1ba4040d
...
...
@@ -12,16 +12,14 @@ export default {
const
permissions
=
store
.
getters
&&
store
.
getters
.
permissions
if
(
value
&&
value
instanceof
Array
&&
value
.
length
>
0
)
{
const
permissionFlag
=
value
const
permissionFlag
=
value
const
hasPermissions
=
permissions
.
some
(
permission
=>
{
return
all_permission
===
permission
||
permissionFlag
.
includes
(
permission
)
})
//自定义权限按钮处理
if
(
vnode
.
elm
.
attributes
[
"myattr"
]
){
if
(
!
hasPermissions
)
{
vnode
.
elm
.
innerHTML
=
vnode
.
elm
.
inner
vnode
.
elm
.
innerHTML
=
vnode
.
elm
.
inner
Text
return
;
}
}
...
...
src/views/system/base/components/leftImg.vue
View file @
1ba4040d
<
template
>
<div>
<ImageUpload
@
callback=
"submit"
v-model=
"value"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImagePreview
:imageValue=
"value"
v-hasPermi=
"['system:config:imageView']"
/>
<div
>
<ImageUpload
@
callback=
"submit"
v-model=
"value"
:limit=
"1"
/>
</div>
</
template
>
...
...
@@ -31,6 +30,7 @@ export default {
})
})
}
}
}
</
script
>
...
...
src/views/system/base/components/right.vue
View file @
1ba4040d
...
...
@@ -2,24 +2,18 @@
<div>
<el-form
ref=
"form"
label-width=
"80px"
>
<el-form-item
label=
"停业"
>
<ImageUpload
@
callback=
"submit"
v-model=
"list['closeDown']"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImagePreview
:imageValue=
"list['closeDown']"
v-hasPermi=
"['system:config:imageView']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"list['closeDown']"
:limit=
"1"
/>
</el-form-item>
<el-form-item
label=
"制作中"
>
<ImageUpload
@
callback=
"submit"
v-model=
"list['inProduction']"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImagePreview
:imageValue=
"list['closeDown']"
v-hasPermi=
"['system:config:imageView']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"list['inProduction']"
:limit=
"1"
/>
</el-form-item>
<el-form-item
label=
"有待取单"
>
<ImageUpload
@
callback=
"submit"
v-model=
"list['thereAOrder']"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImagePreview
:imageValue=
"list['closeDown']"
v-hasPermi=
"['system:config:imageView']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"list['thereAOrder']"
:limit=
"1"
/>
</el-form-item>
<el-form-item
label=
"无待取单"
>
<ImageUpload
@
callback=
"submit"
v-model=
"list['noOrder']"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImagePreview
:imageValue=
"list['closeDown']"
v-hasPermi=
"['system:config:imageView']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"list['noOrder']"
:limit=
"1"
/>
</el-form-item>
</el-form>
</div>
</
template
>
...
...
src/views/system/base/index.vue
View file @
1ba4040d
...
...
@@ -10,15 +10,13 @@
<el-tab-pane
label=
"其他设置"
name=
"third"
>
<el-form
ref=
"form"
label-width=
"180px"
>
<el-form-item
label=
"每件商品数量"
>
<el-input
v-model=
"workValue['goods.limit'].configValue"
placeholder=
"请输入名称"
v-hasPermi=
"['system:config:otherEdit']"
/>
<el-input
v-model=
"workValue['goods.limit'].configValue"
placeholder=
"请输入名称"
v-hasPermi=
"['system:config:otherView']"
disabled
/>
<el-input
v-model=
"workValue['goods.limit'].configValue"
placeholder=
"请输入名称"
/>
</el-form-item>
<el-form-item
label=
"温馨提示地址"
>
<el-input
v-model=
"workValue['tips.address'].configValue"
placeholder=
"请输入名称"
v-hasPermi=
"['system:config:otherEdit']"
/>
<el-input
v-model=
"workValue['tips.address'].configValue"
placeholder=
"请输入名称"
v-hasPermi=
"['system:config:otherView']"
disabled
/>
<el-input
v-model=
"workValue['tips.address'].configValue"
placeholder=
"请输入名称"
/>
</el-form-item>
<el-form-item
label=
""
>
<el-button
@
click=
"sumit"
v-hasPermi=
"['system:config:
otherView']"
disabled
>
提交
</el-button>
<el-button
@
click=
"sumit"
v-hasPermi=
"['system:config:
edit']"
>
提交
</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment