Commit 2c2d1ff6 by cwq0219
2 parents 48a92c82 49a1a8c1
{ {
"name": "home", "name": "account",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
......
<template> <template>
<div class="glsx-table"> <div class="glsx-table">
<el-table style="width: 100%" id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle"> <el-table id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle">
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column> <el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column>
<el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column> <el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
<el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :align="item.align || 'center'" :sortable="item.sortable"> <el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable">
<template slot-scope="scope"> <template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
...@@ -34,18 +34,15 @@ ...@@ -34,18 +34,15 @@
<el-pagination v-if="hasPage" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page[this.pageConf.pageNum]" :page-sizes="[10, 20, 30, 40]" :page-size="page[this.pageConf.pageSize]" :total="getListApi ? total : tableTotal" :layout="layout"></el-pagination> <el-pagination v-if="hasPage" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page[this.pageConf.pageNum]" :page-sizes="[10, 20, 30, 40]" :page-size="page[this.pageConf.pageSize]" :total="getListApi ? total : tableTotal" :layout="layout"></el-pagination>
</div> </div>
</template> </template>
<script> <script>
import { Table, TableColumn, Pagination } from 'element-ui' import { Table, TableColumn, Pagination } from 'element-ui'
export default { export default {
name: 'GLTable', name: 'GLTable',
components: { components: {
[Table.name]: Table, [Table.name]: Table,
[TableColumn.name]: TableColumn, [TableColumn.name]: TableColumn,
[Pagination.name]: Pagination [Pagination.name]: Pagination
}, },
props: { props: {
size: { size: {
type: String, type: String,
...@@ -184,7 +181,6 @@ export default { ...@@ -184,7 +181,6 @@ export default {
} }
} }
}, },
data() { data() {
return { return {
loading: false, loading: false,
...@@ -195,12 +191,10 @@ export default { ...@@ -195,12 +191,10 @@ export default {
// 多选数组 // 多选数组
mutiSelectArr: {}, mutiSelectArr: {},
tableColumns: [], tableColumns: [],
showClass: false, showClass: false,
tableHeightValues: null tableHeightValues: null
} }
}, },
watch: { watch: {
customHeadShowList(val) { customHeadShowList(val) {
this.isCustomHead && this.findShowHeadCol() this.isCustomHead && this.findShowHeadCol()
...@@ -213,7 +207,6 @@ export default { ...@@ -213,7 +207,6 @@ export default {
// deep: true // deep: true
// } // }
}, },
methods: { methods: {
findShowHeadCol() { findShowHeadCol() {
this.tableColumns = [] this.tableColumns = []
...@@ -236,12 +229,11 @@ export default { ...@@ -236,12 +229,11 @@ export default {
sortChange({ column, prop, order }) { sortChange({ column, prop, order }) {
this.$emit('sortChange', { column, prop, order }) this.$emit('sortChange', { column, prop, order })
}, },
// 多选 // 多选
handleSelect(val) { handleSelect(val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val this.mutiSelectArr[this.tableParams.mutiSelectName] = val
this.$emit('selectionTable', val)
}, },
// 清空多选 // 清空多选
clearMutiSelect() { clearMutiSelect() {
this.mutiSelectArr[this.tableParams.mutiSelectName] = [] this.mutiSelectArr[this.tableParams.mutiSelectName] = []
...@@ -252,12 +244,8 @@ export default { ...@@ -252,12 +244,8 @@ export default {
//navHeight 传值底部高度 //navHeight 传值底部高度
var baseNavEle = document.querySelector('.scrm-base-nav') var baseNavEle = document.querySelector('.scrm-base-nav')
var baseSubNavEle = document.querySelector('.scrm-base-sub-nav') var baseSubNavEle = document.querySelector('.scrm-base-sub-nav')
var baseNavEleHeight = 0 var baseNavEleHeight = baseNavEle ? baseNavEle.clientHeight : 0
var baseSubNavEleHeight = 0 var baseSubNavEleHeight = baseSubNavEle ? baseSubNavEle.clientHeight : 0
if (baseNavEle && baseNavEle) {
baseNavEleHeight = baseNavEle.clientHeight //60
baseSubNavEleHeight = baseSubNavEle.clientHeight //14
}
let paginationHeight let paginationHeight
if (document.querySelector('.el-pagination')) { if (document.querySelector('.el-pagination')) {
paginationHeight = document.querySelector('.el-pagination').clientHeight + 20 paginationHeight = document.querySelector('.el-pagination').clientHeight + 20
...@@ -266,12 +254,10 @@ export default { ...@@ -266,12 +254,10 @@ export default {
} }
let offsettop = document.getElementById('initTable').offsetTop let offsettop = document.getElementById('initTable').offsetTop
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
// document.getElementById('initTable').style.height = clientHeight - offsettop - paginationHeight - navHeight + 'px' // document.getElementById('initTable').style.height = clientHeight - offsettop - paginationHeight - navHeight + 'px'
// document.querySelector('.el-table__empty-block').style.height=(clientHeight - offsettop - paginationHeight - navHeight)+'px'; // document.querySelector('.el-table__empty-block').style.height=(clientHeight - offsettop - paginationHeight - navHeight)+'px';
this.tableHeightValues = clientHeight - offsettop - paginationHeight - baseNavEleHeight - baseSubNavEleHeight - 10 - 30 - 20 + 'px' this.tableHeightValues = clientHeight - offsettop - paginationHeight - baseNavEleHeight - baseSubNavEleHeight - 10 - 30 - 20 + 'px'
}, },
refreshTable(isResetPageNum = true, isClearMuti = true) { refreshTable(isResetPageNum = true, isClearMuti = true) {
this.beforeSearchFn().then(res => { this.beforeSearchFn().then(res => {
// 清空多选 // 清空多选
...@@ -287,12 +273,13 @@ export default { ...@@ -287,12 +273,13 @@ export default {
} }
this.getListApi(params) this.getListApi(params)
.then(res => { .then(res => {
console.log(res)
this.data = this.findVal(res, this.tableParams.listName) this.data = this.findVal(res, this.tableParams.listName)
this.total = this.findVal(res, this.pageConf.totalCount) this.total = this.findVal(res, this.pageConf.totalCount)
this.loading = false this.loading = false
if (this.data.length) { if (this.data.length) {
this.$emit('setTableFinishFun', this.data) //表格请求到数据 this.$emit('setTableFinishFun', this.data) //表格请求到数据
} else {
this.setTableHeightFun()
} }
}) })
.catch(() => { .catch(() => {
...@@ -300,7 +287,6 @@ export default { ...@@ -300,7 +287,6 @@ export default {
}) })
}) })
}, },
// 找返回值 // 找返回值
findVal(res, rankStr) { findVal(res, rankStr) {
var rankList = rankStr.split('.') var rankList = rankStr.split('.')
...@@ -309,23 +295,18 @@ export default { ...@@ -309,23 +295,18 @@ export default {
} }
return this.findVal(res[rankList[0]], rankList.splice(1).join('.')) return this.findVal(res[rankList[0]], rankList.splice(1).join('.'))
}, },
// 每页条数 // 每页条数
handleSizeChange(value) { handleSizeChange(value) {
let offsettop = document.getElementById('initTable').offsetTop let offsettop = document.getElementById('initTable').offsetTop
console.log('表格距离顶部1', offsettop)
this.page[this.pageConf.pageSize] = value this.page[this.pageConf.pageSize] = value
this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page) this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page)
}, },
// 页码 // 页码
handleCurrentChange(value) { handleCurrentChange(value) {
this.page[this.pageConf.pageNum] = value this.page[this.pageConf.pageNum] = value
this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page) this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page)
} }
}, },
mounted() { mounted() {
this.isCustomHead ? this.findShowHeadCol() : (this.tableColumns = this.tableParams.tableColumns) this.isCustomHead ? this.findShowHeadCol() : (this.tableColumns = this.tableParams.tableColumns)
this.page = {} this.page = {}
...@@ -334,8 +315,7 @@ export default { ...@@ -334,8 +315,7 @@ export default {
this.getListApi && this.refreshTable() this.getListApi && this.refreshTable()
} }
} }
</script> </script>
<style> <style>
.a-click { .a-click {
cursor: pointer; cursor: pointer;
...@@ -370,50 +350,35 @@ export default { ...@@ -370,50 +350,35 @@ export default {
height: 10px; height: 10px;
/* display: none; */ /* display: none; */
} }
/*正常情况下滑块的样式*/ /*正常情况下滑块的样式*/
.el-table__body-wrapper::-webkit-scrollbar-thumb { .el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
border-radius: 10px; border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1); box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
} }
/*鼠标悬浮在该类指向的控件上时滑块的样式*/ /*鼠标悬浮在该类指向的控件上时滑块的样式*/
.el-table__body-wrapper::-webkit-scrollbar-thumb { .el-table__body-wrapper::-webkit-scrollbar-thumb {
/* background-color: rgba(0, 0, 0, 0.2); */ /* background-color: rgba(0, 0, 0, 0.2); */
background: #e9e8ff; background: #e9e8ff;
border-radius: 10px; border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1); box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
} }
/*鼠标悬浮在滑块上时滑块的样式*/ /*鼠标悬浮在滑块上时滑块的样式*/
/* &::-webkit-scrollbar-thumb:hover { /* &::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.4);
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1); box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
} */ } */
/*正常时候的主干部分*/ /*正常时候的主干部分*/
.el-table__body-wrapper::-webkit-scrollbar-track { .el-table__body-wrapper::-webkit-scrollbar-track {
border-radius: 10px; border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0); box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white; background-color: white;
} }
/*鼠标悬浮在滚动条上的主干部分*/ /*鼠标悬浮在滚动条上的主干部分*/
/* .el-table__body-wrapper::-webkit-scrollbar-track:hover { /* .el-table__body-wrapper::-webkit-scrollbar-track:hover {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4); box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.01); background-color: rgba(0, 0, 0, 0.01);
} */ } */
/* .hasTableContent .el-table__body{ /* .hasTableContent .el-table__body{
height: 100%; height: 100%;
} */ } */
......
...@@ -2,11 +2,13 @@ import Vue from 'vue' ...@@ -2,11 +2,13 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js' // import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton ,GLTable} from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import render from './render' import render from './render'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
// import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/common.scss' import '@/assets/css/common.scss'
let routes = [] let routes = []
......
...@@ -345,7 +345,7 @@ export default { ...@@ -345,7 +345,7 @@ export default {
} else { } else {
list.push({ list.push({
functionId: j.parentId, functionId: j.parentId,
menuId: j.superParentId, mendId: j.superParentId,
functionValue: j.id + ':' + j.label functionValue: j.id + ':' + j.label
}) })
} }
...@@ -355,7 +355,7 @@ export default { ...@@ -355,7 +355,7 @@ export default {
functionIdList.forEach(i => { functionIdList.forEach(i => {
list.push({ list.push({
functionId: i.parentId, functionId: i.parentId,
menuId: i.superParentId mendId: i.superParentId
}) })
}) })
} }
......
...@@ -735,7 +735,7 @@ export default { ...@@ -735,7 +735,7 @@ export default {
background-color: #f4f5fa; background-color: #f4f5fa;
display: flex; display: flex;
.merchant-left { .merchant-left {
padding-top: 15px; padding-top: 20px;
padding-left: 20px; padding-left: 20px;
// min-height: calc(100vh - 200px); // min-height: calc(100vh - 200px);
// max-height: 100vh; // max-height: 100vh;
...@@ -748,8 +748,10 @@ export default { ...@@ -748,8 +748,10 @@ export default {
.merchant-headerMsg { .merchant-headerMsg {
display: flex; display: flex;
.merchantImg { .merchantImg {
margin-top: 5px;
width: 64px; width: 64px;
height: 64px; height: 64px;
img { img {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
...@@ -761,11 +763,11 @@ export default { ...@@ -761,11 +763,11 @@ export default {
margin-left: 15px; margin-left: 15px;
// width: 240px; // width: 240px;
max-width: 220px; max-width: 220px;
height: 24px; height: 32px;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 24px; line-height: 32px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
...@@ -813,7 +815,7 @@ export default { ...@@ -813,7 +815,7 @@ export default {
// margin-left: 0; // margin-left: 0;
// } // }
.merchant-right { .merchant-right {
padding-top: 15px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
width: calc(100vw - 360px - 20px); width: calc(100vw - 360px - 20px);
overflow-x: auto; overflow-x: auto;
...@@ -833,7 +835,8 @@ export default { ...@@ -833,7 +835,8 @@ export default {
.companyName { .companyName {
display: inline-block; display: inline-block;
max-width: 300px; max-width: 300px;
height: 36px; height: 32px;
line-height: 32px;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
...@@ -844,7 +847,8 @@ export default { ...@@ -844,7 +847,8 @@ export default {
} }
.emloyeeListText { .emloyeeListText {
display: inline-block; display: inline-block;
height: 36px; height: 32px;
line-height: 32px;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
......
...@@ -107,7 +107,9 @@ export default { ...@@ -107,7 +107,9 @@ export default {
drawer: false, drawer: false,
direction: 'rtl', direction: 'rtl',
searchForm: { searchForm: {
accountOrPhone: 1 accountOrPhone: 1,
merchantLegalPersonPhone: '',
merchantLoginAccount: ''
}, },
optionsContact, optionsContact,
accountLevel: [], accountLevel: [],
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
<div class="box_wrap"> <div class="box_wrap">
<div class="title"> <div class="title">
<span>选择你要绑定的商户账户</span> <span>选择你要绑定的商户账户</span>
<img @mouseenter="showTip1 = true" @mouseleave="showTip1 = false" src="../../assets/img/question.png" /> <el-popover placement="top-start" title="说明" width="200" trigger="hover" content="只有账户状态正常的门店和商户才允许关联,如未开通,请联系您的专属顾问">
<img slot="reference" src="../../assets/img/question.png" />
</el-popover>
</div> </div>
<div class="select_wrapper"> <div class="select_wrapper">
<div class="label">商户账户</div> <div class="label">商户账户</div>
...@@ -20,12 +22,6 @@ ...@@ -20,12 +22,6 @@
</template> </template>
</el-cascader> </el-cascader>
</div> </div>
<div v-if="showTip1" class="tipContentClass">
<div class="title">说明</div>
<p class="h20_title">只有账户状态正常的门店和商户才允许关联,如未开通,请联系您的专属顾问</p>
<div class="single"></div>
<div class="single1"></div>
</div>
</div> </div>
<div class="icon_wrap"> <div class="icon_wrap">
<img src="../../assets/scrm_jh_icon.png" /> <img src="../../assets/scrm_jh_icon.png" />
...@@ -33,7 +29,9 @@ ...@@ -33,7 +29,9 @@
<div class="box_wrap"> <div class="box_wrap">
<div class="title"> <div class="title">
<span>选择你要绑定的企微门店</span> <span>选择你要绑定的企微门店</span>
<img @mouseenter="showTip2 = true" @mouseleave="showTip2 = false" src="../../assets/img/question.png" /> <el-popover placement="top-start" width="200" title="说明" trigger="hover" content="企业微信授权成功后,企业微信相关内容才会显示">
<img slot="reference" src="../../assets/img/question.png" />
</el-popover>
</div> </div>
<div class="select_wrapper"> <div class="select_wrapper">
<div class="label">企业微信</div> <div class="label">企业微信</div>
...@@ -45,12 +43,12 @@ ...@@ -45,12 +43,12 @@
</template> </template>
</el-cascader> </el-cascader>
</div> </div>
<div v-if="showTip2" class="tipContentClass"> <!-- <div v-if="showTip2" class="tipContentClass">
<div class="title">说明</div> <div class="title">说明</div>
<p class="h20_title">企业微信授权成功后,企业微信相关内容才会显示</p> <p class="h20_title">企业微信授权成功后,企业微信相关内容才会显示</p>
<div class="single"></div> <div class="single"></div>
<div class="single1"></div> <div class="single1"></div>
</div> </div> -->
</div> </div>
<div class="icon_wrap"> <div class="icon_wrap">
<el-button type="purple" size="small" icon="el-icon-link" @click="handlerGL">关联</el-button> <el-button type="purple" size="small" icon="el-icon-link" @click="handlerGL">关联</el-button>
...@@ -146,8 +144,6 @@ export default { ...@@ -146,8 +144,6 @@ export default {
customWidth: 113, customWidth: 113,
shopName: '', shopName: '',
selectedDepartment: '', selectedDepartment: '',
showTip1: false,
showTip2: false
} }
}, },
...@@ -397,59 +393,6 @@ export default { ...@@ -397,59 +393,6 @@ export default {
text-align: right; text-align: right;
} }
} }
.tipContentClass {
position: absolute;
right: -50px;
top: -15px;
width: 236px;
// height: 94px;
background: #ffffff;
box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
border: 1px solid #e4e7ed;
z-index: 999;
box-sizing: border-box;
padding: 10px 9px;
.h20_title {
font-size: 12px;
font-weight: 400;
color: #666666;
}
.title {
font-size: 12px;
font-weight: bold;
color: #333333;
z-index: 999;
position: relative;
}
> p {
z-index: 999;
position: relative;
margin-top: 10px;
line-height: 18px;
}
.single {
position: absolute;
left: -5px;
top: 15px;
// transform: translate(0, -50%);
width: 10px;
height: 10px;
background: #ffffff;
transform: rotate(-60deg);
border: 1px solid #e4e7ed;
z-index: -1;
}
.single1 {
position: absolute;
left: 0px;
top: 50%;
transform: translate(0, -50%);
width: 20px;
height: 100%;
background: #ffffff;
z-index: 22;
}
}
} }
.icon_wrap { .icon_wrap {
display: flex; display: flex;
......
...@@ -275,7 +275,7 @@ export default { ...@@ -275,7 +275,7 @@ export default {
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
getRoleList(value) { getRoleList(value) {
this.$apis.employee.getRoleListApi({ id: value }).then(res => { this.$apis.employee.getRoleListApi({ id: value, delFlag:0}).then(res => {
this.baseData.roleList = res this.baseData.roleList = res
this.getOptionsList('editFormData', false, 'roleIds') this.getOptionsList('editFormData', false, 'roleIds')
}) })
......
...@@ -106,22 +106,38 @@ export default { ...@@ -106,22 +106,38 @@ export default {
this.productTab = productId this.productTab = productId
}, },
findMenuFunTree(id, status) { findMenuFunTree(id, status) {
let menu = util.deepClone(this.tabMenu)
let tabMenu = util.deepClone(this.tabMenu_r) let tabMenu = util.deepClone(this.tabMenu_r)
let menu = tabMenu.filter(item => item.accounttypeId == id) let menuSelect = tabMenu.filter(item => item.accounttypeId == id)
let index = tabMenu.findIndex(item => item.accounttypeId == id) let idx = tabMenu.findIndex(item => item.accounttypeId == id)
this.tabMenu_r.forEach((item, index) => { this.tabMenu_r.forEach((item, index) => {
if (!this.tabMenu[index]) { if (menu.length == 0) {
this.$set(this.tabMenu, index, '') this.tabMenu[index] = ''
return
} }
menu.forEach(itm => {
if (itm.accounttypeId != item.accounttypeId) {
if (!this.tabMenu[index]) {
this.tabMenu[index] = ''
}
}
if (itm.accounttypeId == item.accounttypeId) {
if (!this.tabMenu[index]) {
this.tabMenu[index] = item
}
}
})
}) })
if (status) { if (status) {
this.$set(this.tabMenu, index, menu[0]) this.$set(this.tabMenu, idx, menuSelect[0])
this.tabName = this.tabMenu[index].accounttypeId this.tabName = this.tabMenu[idx].accounttypeId
} else { } else {
this.$set(this.tabMenu, index, '') this.$set(this.tabMenu, idx, '')
let accounttypeId = this.tabMenu.find(item => item) let accounttypeId = this.tabMenu.find(item => item)
this.tabName = accounttypeId && accounttypeId.length > 0 ? accounttypeId[0].accounttypeId : '' this.tabName = accounttypeId ? accounttypeId.accounttypeId : ''
} }
console.log(this.tabMenu)
this.tabMenuStatus = this.tabMenu.some(item => item)
}, },
// 获取当前的所有权限 // 获取当前的所有权限
async findMenuFunTreeByMerId(params) { async findMenuFunTreeByMerId(params) {
...@@ -175,10 +191,13 @@ export default { ...@@ -175,10 +191,13 @@ export default {
}, },
// 获取已选择的权限 // 获取已选择的权限
findPermissionsByMerId(arr) { findPermissionsByMerId(arr) {
let accounttypeId = []
arr.forEach(item => { arr.forEach(item => {
this.accountList.forEach(itm => { accounttypeId.push(item.accounttypeId)
if (item.accounttypeId == itm.accounttypeId) { this.accountList.forEach((itm, index) => {
this.tabMenu.push(itm) console.log(accounttypeId)
if (accounttypeId.includes(itm.accounttypeId)) {
this.tabMenu[index] = itm
if (!item.productList) { if (!item.productList) {
return return
} }
...@@ -188,16 +207,25 @@ export default { ...@@ -188,16 +207,25 @@ export default {
itm.productsArr.push(j) itm.productsArr.push(j)
this.$nextTick(() => { this.$nextTick(() => {
this.addStyle() this.addStyle()
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.idList) this.$refs[`tree_${itm.accounttypeId}_${j.productId}`] ? this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.idList) : ''
}) })
} }
}) })
}) })
}else {
this.tabMenu[index] = ''
} }
}) })
}) })
this.tabName = this.tabMenu[0].accounttypeId this.tabMenu.forEach(item => {
this.productTab = this.tabMenu[0].productsArr[0].productId if (item && item.accounttypeId) {
console.log(item)
this.tabName = item.accounttypeId
this.productTab = item.productsArr[0]?item.productsArr[0].productId: ''
return false;
}
})
this.tabMenuStatus = this.tabMenu.some(item => item)
}, },
resetView() { resetView() {
this.tabMenu = [] this.tabMenu = []
......
...@@ -20,12 +20,15 @@ ...@@ -20,12 +20,15 @@
</div> </div>
<div class="top_select"> <div class="top_select">
<span class="select_label">角色名称</span> <span class="select_label">角色名称</span>
<el-input style="width:76%" size="small" v-model="searchForm.roleName" clearable placeholder="请输入"></el-input> <el-input style="width: 76%" size="small" v-model="searchForm.roleName" clearable placeholder="请输入"></el-input>
</div> </div>
</div> </div>
<el-button type="primary" size="small" @click="toFindData">查询</el-button> <div class="btn_wrapper">
<el-button size="small" @click="reSetFindData">重置</el-button>
<el-button type="primary" size="small" @click="toFindData">查询</el-button>
</div>
</div> </div>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData"> <GLTable v-if="distoryTable" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData">
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="toLookPage(scope.scope)">查看</el-button> <el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button type="text" @click="toEditPage(scope.scope)">修改</el-button> <el-button type="text" @click="toEditPage(scope.scope)">修改</el-button>
...@@ -104,7 +107,8 @@ export default { ...@@ -104,7 +107,8 @@ export default {
merchantList: [], merchantList: [],
tableTotal: 0, tableTotal: 0,
accountLevel: 1, accountLevel: 1,
list: [] list: [],
distoryTable: true
} }
}, },
...@@ -112,10 +116,18 @@ export default { ...@@ -112,10 +116,18 @@ export default {
// 获取表格数据 // 获取表格数据
getTableData() { getTableData() {
let { delFlag, roleName, merchantId } = this.searchForm let { delFlag, roleName, merchantId } = this.searchForm
let para = {}
console.log(merchantId) console.log(merchantId)
let para = { if (!this.distoryTable) {//代表重置
pageNum: this.$refs.table.page.pageNum, para = {
pageSize: this.$refs.table.page.pageSize pageNum: 1,
pageSize: 10
}
} else {
para = {
pageNum: this.$refs.table.page.pageNum,
pageSize: this.$refs.table.page.pageSize
}
} }
if (delFlag < 2) { if (delFlag < 2) {
para.delFlag = delFlag para.delFlag = delFlag
...@@ -141,8 +153,8 @@ export default { ...@@ -141,8 +153,8 @@ export default {
this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => { this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => {
this.merchantList = res || [] this.merchantList = res || []
this.merchantList.unshift({ this.merchantList.unshift({
merchantName:'全部', merchantName: '全部',
id:0 id: 0
}) })
// this.filterList() // this.filterList()
}) })
...@@ -158,6 +170,19 @@ export default { ...@@ -158,6 +170,19 @@ export default {
// this.list = arr // this.list = arr
// } // }
// }, // },
// 重置
reSetFindData() {
this.distoryTable = false
this.searchForm = {
delFlag: 2,
roleName: '',
merchantId: ''
}
this.getTableData()
this.$nextTick(() => {
this.distoryTable = true
})
},
// 查询 // 查询
toFindData() { toFindData() {
this.getTableData() this.getTableData()
...@@ -251,8 +276,13 @@ export default { ...@@ -251,8 +276,13 @@ export default {
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
margin-right: 10px; margin-right: 10px;
white-space: nowrap;
} }
} }
} }
.btn_wrapper {
display: flex;
align-items: center;
}
} }
</style> </style>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="main_widget"> <div class="main_widget">
<div class="main_title">角色权限</div> <div class="main_title">角色权限</div>
<div class="wrapper"> <div class="wrapper">
<div class="menu_line_one"> <div class="menu_line_one" :style="rootList.length?'':'padding:0'">
<div v-for="(item, index) in rootList" :key="index" class="line_element" :class="curRootIndex == index ? 'line_element_active' : ''" @click="selectRootItem(index)">{{ item.accounttypeName }}</div> <div v-for="(item, index) in rootList" :key="index" class="line_element" :class="curRootIndex == index ? 'line_element_active' : ''" @click="selectRootItem(index)">{{ item.accounttypeName }}</div>
</div> </div>
</div> </div>
...@@ -266,11 +266,13 @@ export default { ...@@ -266,11 +266,13 @@ export default {
padding-bottom: 20px; padding-bottom: 20px;
.menu_line_one { .menu_line_one {
width: 100%; width: 100%;
height: 36px; // height: 36px;
background: #f4f6fc; background: #f4f6fc;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: border-box;
padding: 10px;
.line_element { .line_element {
// width: 180px; // width: 180px;
padding: 0 55px; padding: 0 55px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!