Commit 4e7b7e95 by ym

add

1 parent e3060510
......@@ -52,10 +52,30 @@ const saveMerchant = params => {
sign: true
})
}
const findPermissionsByMerId = params => {
params.method = 'cn.com.glsx.merchants.merchant.findPermissionsByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const findMenuFunTreeByMerId = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
findMerchantByPage,
findAllDictData,
getCarbrandTree,
findMerchantDetail,
saveMerchant
saveMerchant,
findPermissionsByMerId,
findMenuFunTreeByMerId
}
\ No newline at end of file
<template>
<div class="btn-unselect" :class="{ 'selectd-type': typeStatus }" @click="tabType">
<div disabled class="btn-unselect" :class="{ 'selectd-type': typeStatus }" @click="tabType">
<span class="select-type-title">{{ btnLabel }}</span
><i class="btn-icon" :class="{ 'el-icon-check': typeStatus }"></i>
</div>
......@@ -14,23 +14,33 @@ export default {
type: String,
default: "",
},
btnValue: {
type: Number,
default: 0,
},
typeStatus: {
type: Boolean,
default: false,
},
stopClick: {
type: Boolean,
default: false,
}
},
data() {
return {
};
return {};
},
methods: {
tabType() {
if(this.stopClick) {
return;
}
this.typeStatus = !this.typeStatus;
this.$emit('getBtnStatus',this.typeStatus)
this.$emit("getBtnStatus", this.typeStatus, this.btnValue);
},
}
},
};
</script>
......@@ -42,6 +52,7 @@ export default {
height: 30px;
line-height: 30px;
margin-top: 6px;
margin-right: 10px;
padding-right: 30px;
cursor: pointer;
font-size: 0;
......
......@@ -9,6 +9,12 @@ const staticRoutes = Object.freeze([{
path: '/acount/addAccount',
meta: {},
component: resolve => require([`@/views/home/addAccount.vue`], resolve)
},
{
name: 'editAccount',
path: '/acount/editAccount',
meta: {},
component: resolve => require([`@/views/home/editAccount.vue`], resolve)
}
])
export default staticRoutes
\ No newline at end of file
<template>
<div class="account-body scrm-box-f">
<div class="account-title">功能权限</div>
<el-tabs v-model="tabName" type="card">
<el-tab-pane
:label="item.accounttypeName"
:name="item.accounttypeId"
v-for="(item, index) in tabMenu"
:key="index"
></el-tab-pane>
</el-tabs>
<div
class="account-select-pro"
v-for="(item, index) in tabMenu"
:key="index"
v-show="tabName == item.accounttypeId"
>
<label>选择产品</label>
<el-checkbox-group v-model="item.productsArr" @change="selectPro(index)">
<el-checkbox
v-for="(itm, idx) in item.products"
:label="itm.productName"
:key="idx"
></el-checkbox>
</el-checkbox-group>
</div>
<div class="account-select-menu">请选择产品权限</div>
<div class="menu-box">
<div :key="index" v-for="(item, index) in tabMenu">
<div
class="menu-box-tab"
v-show="tabName == item.accounttypeId"
>
<div class="tab-item text-hide" v-for="(itm, idx) in item.productsArr" :key="idx">
{{ itm }}
</div>
</div>
<div v-if="item.products[0]" class="menu-box-tree" v-show="tabName == item.accounttypeId && item.productsArr.indexOf(item.accounttypeName) != -1">
<el-tree
:data="item.products[0].merchantProTreeResponses"
show-checkbox
default-expand-all
node-key="id"
ref="brandTree"
highlight-current
:props="defaultProps"
>
</el-tree>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "product",
props: {
parentId: {
type: Number,
},
pId: {
type: Number,
},
accountlevel: {
type: Number,
},
},
data() {
return {
tabMenu: [],
selectIndex: 0,
products: [],
productsArr: [],
tabName: "",
defaultProps: {
children: "children",
label: "label",
},
};
},
methods: {
selectPro() {},
findPermissionsByMerId() {
let params = {
accountlevel: 2,
parentId: 41513,
id: 41555,
};
this.$apis.store.findMenuFunTreeByMerId(params).then((res) => {
this.tabMenu = res.map((item) => {
return {
productsArr: [],
products: item.products,
accounttypeName: item.accounttypeName,
accounttypeId: item.accounttypeId,
};
});
this.tabName = this.tabMenu[0].accounttypeId;
});
},
},
mounted() {
this.findPermissionsByMerId();
},
};
</script>
<style scoped lang="scss">
.account-body {
padding: 20px;
.account-title {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
margin-bottom: 30px;
}
.account-select-pro {
padding-left: 30px;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
display: flex;
flex-wrap: wrap;
label {
margin-right: 20px;
}
}
.account-select-menu {
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
margin-top: 20px;
}
.menu-box {
margin-top: 10px;
background: #f4f6fc;
border-radius: 4px;
padding: 10px;
.tab-item {
width: 180px;
background: #ffffff;
border-radius: 4px 0px 0px 0px;
border: 1px solid #f4f6fc;
font-size: 14px;
line-height: 14px;
font-weight: 400;
color: #322ad9;
text-align: center;
padding: 12px 0px;
}
}
}
</style>
\ No newline at end of file
......@@ -142,7 +142,9 @@ export default {
methods: {
handleLook() {},
handleEdit() {},
handleAdd() {},
handleAdd(scope) {
this.$router.push({path:'/acount/addAccount',query:{id:scope.id}})
},
findAllDictData(dictType) {
var params = {
dictType
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!