Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
杨明
/
scrm-micro-config
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d70964ce
authored
Nov 27, 2021
by
yangming
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug
1 parent
4b1a81cf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
56 deletions
package-lock.json
src/components/glsx-table/index.vue
src/setup/qiankun.js
src/views/account/index.vue
src/views/employee/editEmployee.vue
src/views/role/components/selectProduct.vue
package-lock.json
View file @
d70964c
{
"name"
:
"
home
"
,
"name"
:
"
account
"
,
"version"
:
"0.1.0"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
...
...
src/components/glsx-table/index.vue
View file @
d70964c
<
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%;
} */
...
...
src/setup/qiankun.js
View file @
d70964c
...
...
@@ -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
=
[]
...
...
src/views/account/index.vue
View file @
d70964c
...
...
@@ -107,7 +107,9 @@ export default {
drawer
:
false
,
direction
:
'rtl'
,
searchForm
:
{
accountOrPhone
:
1
accountOrPhone
:
1
,
merchantLegalPersonPhone
:
''
,
merchantLoginAccount
:
''
},
optionsContact
,
accountLevel
:
[],
...
...
src/views/employee/editEmployee.vue
View file @
d70964c
...
...
@@ -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'
)
})
...
...
src/views/role/components/selectProduct.vue
View file @
d70964c
...
...
@@ -106,22 +106,36 @@ export default {
this
.
productTab
=
productId
},
findMenuFunTree
(
id
,
status
)
{
let
menu
=
util
.
deepClone
(
this
.
tabMenu
)
console
.
log
(
menu
)
let
tabMenu
=
util
.
deepClone
(
this
.
tabMenu_r
)
let
menu
=
tabMenu
.
filter
(
item
=>
item
.
accounttypeId
==
id
)
let
i
nde
x
=
tabMenu
.
findIndex
(
item
=>
item
.
accounttypeId
==
id
)
let
menu
Select
=
tabMenu
.
filter
(
item
=>
item
.
accounttypeId
==
id
)
let
i
d
x
=
tabMenu
.
findIndex
(
item
=>
item
.
accounttypeId
==
id
)
this
.
tabMenu_r
.
forEach
((
item
,
index
)
=>
{
if
(
!
this
.
tabMenu
[
index
])
{
this
.
$set
(
this
.
tabMenu
,
index
,
''
)
}
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.tabMenu[idx] = menuSelect[0]
this
.
$set
(
this
.
tabMenu
,
idx
,
menuSelect
[
0
])
this
.
tabName
=
this
.
tabMenu
[
idx
].
accounttypeId
}
else
{
this
.
$set
(
this
.
tabMenu
,
i
nde
x
,
''
)
this
.
$set
(
this
.
tabMenu
,
i
d
x
,
''
)
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
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment