Commit d70964ce by yangming

bug

1 parent 4b1a81cf
{ {
"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 = []
......
...@@ -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: [],
......
...@@ -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,36 @@ export default { ...@@ -106,22 +106,36 @@ export default {
this.productTab = productId this.productTab = productId
}, },
findMenuFunTree(id, status) { findMenuFunTree(id, status) {
let menu = util.deepClone(this.tabMenu)
console.log(menu)
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]) { menu.forEach(itm => {
this.$set(this.tabMenu, index, '') 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.tabMenu[idx] = menuSelect[0]
this.tabName = this.tabMenu[index].accounttypeId this.$set(this.tabMenu, idx, menuSelect[0])
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) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!