Commit 1ba4040d by lixiaomin

修改权限

parent 30c6c712
...@@ -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/changeStatus', url: '/system/status',
method: 'put', method: 'put',
data: data data: data
}) })
......
...@@ -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>
...@@ -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.innerText
return ; return ;
} }
} }
......
<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>
......
...@@ -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>
......
...@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment