Commit 2c2d1ff6 by cwq0219
2 parents 48a92c82 49a1a8c1
{
"name": "home",
"name": "account",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
......
<template>
<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="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">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter">
......@@ -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>
</div>
</template>
<script>
import { Table, TableColumn, Pagination } from 'element-ui'
export default {
name: 'GLTable',
components: {
[Table.name]: Table,
[TableColumn.name]: TableColumn,
[Pagination.name]: Pagination
},
props: {
size: {
type: String,
......@@ -184,7 +181,6 @@ export default {
}
}
},
data() {
return {
loading: false,
......@@ -195,12 +191,10 @@ export default {
// 多选数组
mutiSelectArr: {},
tableColumns: [],
showClass: false,
tableHeightValues: null
}
},
watch: {
customHeadShowList(val) {
this.isCustomHead && this.findShowHeadCol()
......@@ -213,7 +207,6 @@ export default {
// deep: true
// }
},
methods: {
findShowHeadCol() {
this.tableColumns = []
......@@ -236,12 +229,11 @@ export default {
sortChange({ column, prop, order }) {
this.$emit('sortChange', { column, prop, order })
},
// 多选
handleSelect(val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val
this.$emit('selectionTable', val)
},
// 清空多选
clearMutiSelect() {
this.mutiSelectArr[this.tableParams.mutiSelectName] = []
......@@ -252,12 +244,8 @@ export default {
//navHeight 传值底部高度
var baseNavEle = document.querySelector('.scrm-base-nav')
var baseSubNavEle = document.querySelector('.scrm-base-sub-nav')
var baseNavEleHeight = 0
var baseSubNavEleHeight = 0
if (baseNavEle && baseNavEle) {
baseNavEleHeight = baseNavEle.clientHeight //60
baseSubNavEleHeight = baseSubNavEle.clientHeight //14
}
var baseNavEleHeight = baseNavEle ? baseNavEle.clientHeight : 0
var baseSubNavEleHeight = baseSubNavEle ? baseSubNavEle.clientHeight : 0
let paginationHeight
if (document.querySelector('.el-pagination')) {
paginationHeight = document.querySelector('.el-pagination').clientHeight + 20
......@@ -266,12 +254,10 @@ export default {
}
let offsettop = document.getElementById('initTable').offsetTop
let clientHeight = document.documentElement.clientHeight
// document.getElementById('initTable').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'
},
refreshTable(isResetPageNum = true, isClearMuti = true) {
this.beforeSearchFn().then(res => {
// 清空多选
......@@ -287,12 +273,13 @@ export default {
}
this.getListApi(params)
.then(res => {
console.log(res)
this.data = this.findVal(res, this.tableParams.listName)
this.total = this.findVal(res, this.pageConf.totalCount)
this.loading = false
if (this.data.length) {
this.$emit('setTableFinishFun', this.data) //表格请求到数据
} else {
this.setTableHeightFun()
}
})
.catch(() => {
......@@ -300,7 +287,6 @@ export default {
})
})
},
// 找返回值
findVal(res, rankStr) {
var rankList = rankStr.split('.')
......@@ -309,23 +295,18 @@ export default {
}
return this.findVal(res[rankList[0]], rankList.splice(1).join('.'))
},
// 每页条数
handleSizeChange(value) {
let offsettop = document.getElementById('initTable').offsetTop
console.log('表格距离顶部1', offsettop)
this.page[this.pageConf.pageSize] = value
this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page)
},
// 页码
handleCurrentChange(value) {
this.page[this.pageConf.pageNum] = value
this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page)
}
},
mounted() {
this.isCustomHead ? this.findShowHeadCol() : (this.tableColumns = this.tableParams.tableColumns)
this.page = {}
......@@ -334,8 +315,7 @@ export default {
this.getListApi && this.refreshTable()
}
}
</script>
</script>
<style>
.a-click {
cursor: pointer;
......@@ -370,50 +350,35 @@ export default {
height: 10px;
/* display: none; */
}
/*正常情况下滑块的样式*/
.el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在该类指向的控件上时滑块的样式*/
.el-table__body-wrapper::-webkit-scrollbar-thumb {
/* background-color: rgba(0, 0, 0, 0.2); */
background: #e9e8ff;
border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在滑块上时滑块的样式*/
/* &::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.4);
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
} */
/*正常时候的主干部分*/
.el-table__body-wrapper::-webkit-scrollbar-track {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
}
/*鼠标悬浮在滚动条上的主干部分*/
/* .el-table__body-wrapper::-webkit-scrollbar-track:hover {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.01);
} */
/* .hasTableContent .el-table__body{
height: 100%;
} */
......
......@@ -2,11 +2,13 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import ElementUI from 'element-ui'
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { GLButton ,GLTable} from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import render from './render'
Vue.use(ElementUI)
Vue.use(GLTable)
// import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/common.scss'
let routes = []
......
......@@ -345,7 +345,7 @@ export default {
} else {
list.push({
functionId: j.parentId,
menuId: j.superParentId,
mendId: j.superParentId,
functionValue: j.id + ':' + j.label
})
}
......@@ -355,7 +355,7 @@ export default {
functionIdList.forEach(i => {
list.push({
functionId: i.parentId,
menuId: i.superParentId
mendId: i.superParentId
})
})
}
......
......@@ -735,7 +735,7 @@ export default {
background-color: #f4f5fa;
display: flex;
.merchant-left {
padding-top: 15px;
padding-top: 20px;
padding-left: 20px;
// min-height: calc(100vh - 200px);
// max-height: 100vh;
......@@ -748,8 +748,10 @@ export default {
.merchant-headerMsg {
display: flex;
.merchantImg {
margin-top: 5px;
width: 64px;
height: 64px;
img {
display: inline-block;
width: 100%;
......@@ -761,11 +763,11 @@ export default {
margin-left: 15px;
// width: 240px;
max-width: 220px;
height: 24px;
height: 32px;
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 24px;
line-height: 32px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
......@@ -813,7 +815,7 @@ export default {
// margin-left: 0;
// }
.merchant-right {
padding-top: 15px;
padding-top: 20px;
padding-bottom: 20px;
width: calc(100vw - 360px - 20px);
overflow-x: auto;
......@@ -833,7 +835,8 @@ export default {
.companyName {
display: inline-block;
max-width: 300px;
height: 36px;
height: 32px;
line-height: 32px;
font-size: 16px;
font-weight: 500;
color: #333333;
......@@ -844,7 +847,8 @@ export default {
}
.emloyeeListText {
display: inline-block;
height: 36px;
height: 32px;
line-height: 32px;
font-size: 16px;
font-weight: 500;
color: #333333;
......
......@@ -107,7 +107,9 @@ export default {
drawer: false,
direction: 'rtl',
searchForm: {
accountOrPhone: 1
accountOrPhone: 1,
merchantLegalPersonPhone: '',
merchantLoginAccount: ''
},
optionsContact,
accountLevel: [],
......
......@@ -8,7 +8,9 @@
<div class="box_wrap">
<div class="title">
<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 class="select_wrapper">
<div class="label">商户账户</div>
......@@ -20,12 +22,6 @@
</template>
</el-cascader>
</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 class="icon_wrap">
<img src="../../assets/scrm_jh_icon.png" />
......@@ -33,7 +29,9 @@
<div class="box_wrap">
<div class="title">
<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 class="select_wrapper">
<div class="label">企业微信</div>
......@@ -45,12 +43,12 @@
</template>
</el-cascader>
</div>
<div v-if="showTip2" class="tipContentClass">
<!-- <div v-if="showTip2" 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">
<el-button type="purple" size="small" icon="el-icon-link" @click="handlerGL">关联</el-button>
......@@ -146,8 +144,6 @@ export default {
customWidth: 113,
shopName: '',
selectedDepartment: '',
showTip1: false,
showTip2: false
}
},
......@@ -397,59 +393,6 @@ export default {
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 {
display: flex;
......
......@@ -275,7 +275,7 @@ export default {
return data.label.indexOf(value) !== -1
},
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.getOptionsList('editFormData', false, 'roleIds')
})
......
......@@ -106,22 +106,38 @@ export default {
this.productTab = productId
},
findMenuFunTree(id, status) {
let menu = util.deepClone(this.tabMenu)
let tabMenu = util.deepClone(this.tabMenu_r)
let menu = tabMenu.filter(item => item.accounttypeId == id)
let index = tabMenu.findIndex(item => item.accounttypeId == id)
let menuSelect = tabMenu.filter(item => item.accounttypeId == id)
let idx = tabMenu.findIndex(item => item.accounttypeId == id)
this.tabMenu_r.forEach((item, index) => {
if (!this.tabMenu[index]) {
this.$set(this.tabMenu, index, '')
if (menu.length == 0) {
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) {
this.$set(this.tabMenu, index, menu[0])
this.tabName = this.tabMenu[index].accounttypeId
this.$set(this.tabMenu, idx, menuSelect[0])
this.tabName = this.tabMenu[idx].accounttypeId
} else {
this.$set(this.tabMenu, index, '')
this.$set(this.tabMenu, idx, '')
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) {
......@@ -175,10 +191,13 @@ export default {
},
// 获取已选择的权限
findPermissionsByMerId(arr) {
let accounttypeId = []
arr.forEach(item => {
this.accountList.forEach(itm => {
if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm)
accounttypeId.push(item.accounttypeId)
this.accountList.forEach((itm, index) => {
console.log(accounttypeId)
if (accounttypeId.includes(itm.accounttypeId)) {
this.tabMenu[index] = itm
if (!item.productList) {
return
}
......@@ -188,16 +207,25 @@ export default {
itm.productsArr.push(j)
this.$nextTick(() => {
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.productTab = this.tabMenu[0].productsArr[0].productId
this.tabMenu.forEach(item => {
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() {
this.tabMenu = []
......
......@@ -20,12 +20,15 @@
</div>
<div class="top_select">
<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>
<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>
<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">
<el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button type="text" @click="toEditPage(scope.scope)">修改</el-button>
......@@ -104,7 +107,8 @@ export default {
merchantList: [],
tableTotal: 0,
accountLevel: 1,
list: []
list: [],
distoryTable: true
}
},
......@@ -112,10 +116,18 @@ export default {
// 获取表格数据
getTableData() {
let { delFlag, roleName, merchantId } = this.searchForm
let para = {}
console.log(merchantId)
let para = {
pageNum: this.$refs.table.page.pageNum,
pageSize: this.$refs.table.page.pageSize
if (!this.distoryTable) {//代表重置
para = {
pageNum: 1,
pageSize: 10
}
} else {
para = {
pageNum: this.$refs.table.page.pageNum,
pageSize: this.$refs.table.page.pageSize
}
}
if (delFlag < 2) {
para.delFlag = delFlag
......@@ -141,8 +153,8 @@ export default {
this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => {
this.merchantList = res || []
this.merchantList.unshift({
merchantName:'全部',
id:0
merchantName: '全部',
id: 0
})
// this.filterList()
})
......@@ -158,6 +170,19 @@ export default {
// this.list = arr
// }
// },
// 重置
reSetFindData() {
this.distoryTable = false
this.searchForm = {
delFlag: 2,
roleName: '',
merchantId: ''
}
this.getTableData()
this.$nextTick(() => {
this.distoryTable = true
})
},
// 查询
toFindData() {
this.getTableData()
......@@ -251,8 +276,13 @@ export default {
font-weight: 400;
color: #333333;
margin-right: 10px;
white-space: nowrap;
}
}
}
.btn_wrapper {
display: flex;
align-items: center;
}
}
</style>
......@@ -21,7 +21,7 @@
<div class="main_widget">
<div class="main_title">角色权限</div>
<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>
</div>
......@@ -266,11 +266,13 @@ export default {
padding-bottom: 20px;
.menu_line_one {
width: 100%;
height: 36px;
// height: 36px;
background: #f4f6fc;
border-radius: 4px;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 10px;
.line_element {
// width: 180px;
padding: 0 55px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!