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) {
...
@@ -51,7 +51,7 @@ export function changeRoleStatus(roleId, status) {
status
status
}
}
return
request
({
return
request
({
url
:
'/system/
role/changeS
tatus'
,
url
:
'/system/
s
tatus'
,
method
:
'put'
,
method
:
'put'
,
data
:
data
data
:
data
})
})
...
...
src/components/ImageUpload/index.vue
View file @
1ba4040d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<el-upload
multiple
:action=
"uploadImgUrl"
list-type=
"picture-card"
:on-success=
"handleUploadSuccess"
<el-upload
multiple
:action=
"uploadImgUrl"
list-type=
"picture-card"
:on-success=
"handleUploadSuccess"
:before-upload=
"handleBeforeUpload"
:limit=
"limit"
:on-error=
"handleUploadError"
:on-exceed=
"handleExceed"
: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"
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>
<i
class=
"el-icon-plus"
></i>
</el-upload>
</el-upload>
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<
script
>
<
script
>
import
{
getToken
}
from
"@/utils/auth"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
store
from
'@/store'
export
default
{
export
default
{
props
:
{
props
:
{
value
:
[
String
,
Object
,
Array
],
value
:
[
String
,
Object
,
Array
],
...
@@ -72,6 +72,7 @@ export default {
...
@@ -72,6 +72,7 @@ export default {
Authorization
:
"Bearer "
+
getToken
(),
Authorization
:
"Bearer "
+
getToken
(),
},
},
fileList
:
[],
fileList
:
[],
disabled
:
true
};
};
},
},
watch
:
{
watch
:
{
...
@@ -104,7 +105,10 @@ export default {
...
@@ -104,7 +105,10 @@ export default {
// 是否显示提示
// 是否显示提示
showTip
()
{
showTip
()
{
return
this
.
isShowTip
&&
(
this
.
fileType
||
this
.
fileSize
);
return
this
.
isShowTip
&&
(
this
.
fileType
||
this
.
fileSize
);
},
}
},
created
()
{
this
.
bb
();
},
},
methods
:
{
methods
:
{
// 删除图片
// 删除图片
...
@@ -198,6 +202,23 @@ export default {
...
@@ -198,6 +202,23 @@ export default {
return
strs
;
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
>
</
script
>
...
@@ -229,4 +250,8 @@ export default {
...
@@ -229,4 +250,8 @@ export default {
height
:
100px
;
height
:
100px
;
line-height
:
110px
;
line-height
:
110px
;
}
}
.el-upload-list__item-delete
{
display
:
none
!important
;
}
</
style
>
</
style
>
src/directive/permission/hasPermi.js
View file @
1ba4040d
...
@@ -12,16 +12,14 @@ export default {
...
@@ -12,16 +12,14 @@ export default {
const
permissions
=
store
.
getters
&&
store
.
getters
.
permissions
const
permissions
=
store
.
getters
&&
store
.
getters
.
permissions
if
(
value
&&
value
instanceof
Array
&&
value
.
length
>
0
)
{
if
(
value
&&
value
instanceof
Array
&&
value
.
length
>
0
)
{
const
permissionFlag
=
value
const
permissionFlag
=
value
const
hasPermissions
=
permissions
.
some
(
permission
=>
{
const
hasPermissions
=
permissions
.
some
(
permission
=>
{
return
all_permission
===
permission
||
permissionFlag
.
includes
(
permission
)
return
all_permission
===
permission
||
permissionFlag
.
includes
(
permission
)
})
})
//自定义权限按钮处理
//自定义权限按钮处理
if
(
vnode
.
elm
.
attributes
[
"myattr"
]
){
if
(
vnode
.
elm
.
attributes
[
"myattr"
]
){
if
(
!
hasPermissions
)
{
if
(
!
hasPermissions
)
{
vnode
.
elm
.
innerHTML
=
vnode
.
elm
.
inner
vnode
.
elm
.
innerHTML
=
vnode
.
elm
.
inner
Text
return
;
return
;
}
}
}
}
...
...
src/views/system/base/components/leftImg.vue
View file @
1ba4040d
<
template
>
<
template
>
<div>
<div
>
<ImageUpload
@
callback=
"submit"
v-model=
"value"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"value"
:limit=
"1"
/>
<ImagePreview
:imageValue=
"value"
v-hasPermi=
"['system:config:imageView']"
/>
</div>
</div>
</
template
>
</
template
>
...
@@ -31,6 +30,7 @@ export default {
...
@@ -31,6 +30,7 @@ export default {
})
})
})
})
}
}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/system/base/components/right.vue
View file @
1ba4040d
...
@@ -2,24 +2,18 @@
...
@@ -2,24 +2,18 @@
<div>
<div>
<el-form
ref=
"form"
label-width=
"80px"
>
<el-form
ref=
"form"
label-width=
"80px"
>
<el-form-item
label=
"停业"
>
<el-form-item
label=
"停业"
>
<ImageUpload
@
callback=
"submit"
v-model=
"list['closeDown']"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"list['closeDown']"
:limit=
"1"
/>
<ImagePreview
:imageValue=
"list['closeDown']"
v-hasPermi=
"['system:config:imageView']"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"制作中"
>
<el-form-item
label=
"制作中"
>
<ImageUpload
@
callback=
"submit"
v-model=
"list['inProduction']"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"list['inProduction']"
:limit=
"1"
/>
<ImagePreview
:imageValue=
"list['closeDown']"
v-hasPermi=
"['system:config:imageView']"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"有待取单"
>
<el-form-item
label=
"有待取单"
>
<ImageUpload
@
callback=
"submit"
v-model=
"list['thereAOrder']"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"list['thereAOrder']"
:limit=
"1"
/>
<ImagePreview
:imageValue=
"list['closeDown']"
v-hasPermi=
"['system:config:imageView']"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"无待取单"
>
<el-form-item
label=
"无待取单"
>
<ImageUpload
@
callback=
"submit"
v-model=
"list['noOrder']"
:limit=
"1"
v-hasPermi=
"['system:config:imageEdit']"
/>
<ImageUpload
@
callback=
"submit"
v-model=
"list['noOrder']"
:limit=
"1"
/>
<ImagePreview
:imageValue=
"list['closeDown']"
v-hasPermi=
"['system:config:imageView']"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
</
template
>
</
template
>
...
...
src/views/system/base/index.vue
View file @
1ba4040d
...
@@ -10,15 +10,13 @@
...
@@ -10,15 +10,13 @@
<el-tab-pane
label=
"其他设置"
name=
"third"
>
<el-tab-pane
label=
"其他设置"
name=
"third"
>
<el-form
ref=
"form"
label-width=
"180px"
>
<el-form
ref=
"form"
label-width=
"180px"
>
<el-form-item
label=
"每件商品数量"
>
<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=
"请输入名称"
/>
<el-input
v-model=
"workValue['goods.limit'].configValue"
placeholder=
"请输入名称"
v-hasPermi=
"['system:config:otherView']"
disabled
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"温馨提示地址"
>
<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=
"请输入名称"
/>
<el-input
v-model=
"workValue['tips.address'].configValue"
placeholder=
"请输入名称"
v-hasPermi=
"['system:config:otherView']"
disabled
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
""
>
<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-item>
</el-form>
</el-form>
</el-tab-pane>
</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