Commit e2e6348d by 杨北旺

角色管理模块

1 parent 8515a437
......@@ -17,7 +17,7 @@ import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { TGT: 'scrm-base-57a2c9a4-42bd-4821-8af0-02e98a473594-rop' } })
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { TGT: 'scrm-base-61a28f77-294f-4510-aa1c-6a35cff86f25-rop' } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
\ No newline at end of file
......@@ -29,7 +29,7 @@
</div>
</el-form-item>
</el-form>
<SelectProduct ref="productFrom" :roleType="true" :parentId="41712" :accountlevel="accountLevel" :pId="41713"></SelectProduct>
<SelectProduct ref="productFrom" :roleType="true" title=""></SelectProduct>
</div>
<div style="height: 84px"></div>
<div class="fixed_bottom">
......@@ -73,18 +73,18 @@ export default {
list: [],
// tree数据
treeDataList: [],
accountLevel:1
accountLevel: 1
}
},
created() {
let id = Number(this.$route.params.id);
let id = Number(this.$route.params.id)
if (!id) {
this.pageName = '新增角色'
this.pageType ='create'
this.pageType = 'create'
this.getMerchantName()
} else {
this.pageName = '修改角色'
this.pageType ='edit'
this.pageType = 'edit'
this.getRoleData(id)
this.editId = id
}
......@@ -100,9 +100,10 @@ export default {
merchantName: res.merchantName,
roleName: res.roleName,
roleDesc: res.roleDescription,
merchantId:res.merchantId
merchantId: res.merchantId
}
this.getMerchantTree(id, res.responseList)
this.$refs.productFrom.accountTypeSearchRequest({id:res.merchantId }, 'edit')
})
},
// 获取商户树
......@@ -136,13 +137,12 @@ export default {
}
},
// 选择商户----获取权限
selectMerchant(id) {
this.$apis.role.merchantRootById({ id }).then(res => {
this.accountList = res.map(item => {
item.select = false
async selectMerchant(id) {
let res = await this.$refs.productFrom.accountTypeSearchRequest({ id }, 'create')
this.accountList = res.map(item => {
item.select = true
return item
})
})
},
// 选择商户权限
selectCurAccount(item, index) {
......@@ -157,35 +157,34 @@ export default {
this.rootList = arr
}
},
// 确定按钮---处理参数---提交数据---创建为0---草稿为1
toCreateRole(delFlag) {
let { merchantId, roleDesc, roleName } = this.ruleForm
if(!merchantId){
this.$message.error("请选择所属商户");
if (!merchantId) {
this.$message.error('请选择所属商户')
return
}
if(!roleName){
this.$message.error("请输入角色名称");
if (!roleName) {
this.$message.error('请输入角色名称')
return
}
if (this.$refs.productFrom.getSelectInfo().length == 0) {
this.$message.error("请选择产品");
return;
this.$message.error('请选择产品')
return
}
let accountTypes = JSON.stringify(this.$refs.productFrom.getSelectInfo())
let accountTypes = JSON.stringify(this.$refs.productFrom.getSelectInfo())
let para = {
merchantId: merchantId,
roleName: roleName,
roleDescription: roleDesc,
delFlag,
requestList: accountTypes,
requestList: accountTypes
}
if(this.pageType=='edit'){
if (this.pageType == 'edit') {
para.id = this.editId
this.updateRole(para)
}else{
} else {
this.insertRole(para)
}
},
......@@ -204,7 +203,7 @@ export default {
})
},
toBack() {
this.$router.push("/role/index");
this.$router.push('/role/index')
}
}
}
......@@ -246,6 +245,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
z-index: 20;
.wrap_driver {
margin: 0 40px;
}
......@@ -258,5 +258,4 @@ export default {
margin-right: 15px;
}
}
</style>
......@@ -137,7 +137,7 @@ export default {
this.$apis.role.roleDataList(para).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (!res.data.length) {
if (!res.data.length || !res) {
this.$refs.table.setTableHeightFun()
}
// this.$nextTick(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!