Commit 1ba4040d by lixiaomin

修改权限

parent 30c6c712
......@@ -51,7 +51,7 @@ export function changeRoleStatus(roleId, status) {
status
}
return request({
url: '/system/role/changeStatus',
url: '/system/status',
method: 'put',
data: data
})
......
......@@ -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>
......@@ -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.innerText
return ;
}
}
......
<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>
......
......@@ -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>
......
......@@ -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>
......
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