Commit e2e6348d by 杨北旺

角色管理模块

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