让企业管理更智慧、更快捷
Skip to content
GitLab
探索
登录
注册
源代码提交(4)
docs: update changelog
· 2455777b
由
丁阳
创作于
11月 17, 2022
2455777b
refactor: table组件增加parentNode自适应高度
· 04d4233b
由
丁阳
创作于
12月 02, 2022
04d4233b
Merge branch 'dy-dev'
· b8d77059
由
丁阳
创作于
12月 02, 2022
b8d77059
1.0.12
· 790198f3
由
丁阳
创作于
12月 02, 2022
790198f3
隐藏空白变更内容
行内
左右并排
CHANGELOG.md
浏览文件 @
790198f3
## [1.0.11](http://git.leadwaycloud.com/package/lwc-ui-components/compare/v1.0.10...v1.0.11) (2022-11-17)
## [1.0.10](http://git.leadwaycloud.com/package/lwc-ui-components/compare/v1.0.9...v1.0.10) (2022-11-03)
...
...
package.json
浏览文件 @
790198f3
{
"name"
:
"@package/lwc-ui-components"
,
"version"
:
"1.0.1
1
"
,
"version"
:
"1.0.1
2
"
,
"private"
:
false
,
"description"
:
"立威云UI组件库"
,
"author"
:
""
,
...
...
src/index.js
浏览文件 @
790198f3
...
...
@@ -209,7 +209,7 @@ if (typeof window !== 'undefined' && window.Vue) {
}
export
default
{
version
:
'
1.0.1
0
'
,
version
:
'
1.0.1
1
'
,
install
,
LwcBasicButton
,
LwcBasicButtonIcon
,
...
...
src/stories/changelog.stories.mdx
浏览文件 @
790198f3
...
...
@@ -8,6 +8,19 @@
`新特性`
`非兼容性更新`
---
### **v1.0.11 20221117**
#### 新增
- 新增 lwc-table-basic 组件 高度随父级元素100%自适应
#### Bug修复
- 修复 lwc-table-basic 组件 缓存/隐藏后再次显示出现空白问题
- 修复 lwc-select-dialog 组件 缓存/隐藏后再次显示出现空白问题
- 修复 lwc-timeline-approve-info 组件 审核成功背景颜色跟随主色primary问题,修改为success
---
### **v1.0.10 20221103**
...
...
src/stories/data-display/tabs/index.stories.js
浏览文件 @
790198f3
...
...
@@ -84,7 +84,7 @@ Default.args = {
{
label
:
"
跟进记录
"
,
name
:
"
1
"
,
lazy
:
tru
e
,
lazy
:
fals
e
,
content
:
[
{
name
:
"
lwc-table-basic
"
,
...
...
@@ -116,15 +116,17 @@ Default.args = {
// 接收 Promise 对象
query
:
async
({
page
,
sorts
,
filters
},
form
=
{})
=>
{
console
.
log
(
'
query load data
'
)
let
list
=
[]
for
(
let
i
=
0
;
i
<
100
;
i
++
)
{
list
.
push
({
id
:
i
+
1
,
version
:
"
2.2.0
"
,
description
:
"
正式版本 xxxxx
"
,
active
:
true
,
})
}
return
{
pageList
:
[
{
id
:
1
,
version
:
"
2.2.0
"
,
description
:
"
正式版本 xxxxx
"
,
active
:
true
,
},
],
pageList
:
list
,
totalPage
:
0
,
};
},
...
...
src/stories/form/basic/index.stories.js
浏览文件 @
790198f3
...
...
@@ -64,3 +64,79 @@ Default.args = {
title
:
'
基本信息
'
,
subTitle
:
'
Utilities for controlling the text color of an element
'
};
const
Template1
=
(
args
,
{
argTypes
})
=>
({
props
:
Object
.
keys
(
argTypes
),
template
:
`<vxe-form ref="form" label-position="left" size="small" label-width="80px" v-bind="formConfig" :style="{height: '500px'}">
</vxe-form>`
,
setup
(
props
,
context
)
{
const
formConfig
=
{
data
:
{
barcode
:
""
,
location
:
{
id
:
null
}
},
titleWidth
:
150
,
titleAlign
:
'
left
'
,
items
:
[
{
title
:
null
,
span
:
24
,
className
:
[
'
mt-6
'
],
itemRender
:
{
name
:
'
FormBasicTitle
'
,
props
:
{
title
:
"
qy6jBddoMNsJjUfFy7xZq
"
,
subTitle
:
''
,
mt
:
0
}
}
},
{
title
:
null
,
span
:
24
,
className
:
[
'
last-form-item
'
],
itemRender
:
{
name
:
'
ElHoc
'
,
hocName
:
'
lwc-table-basic
'
,
props
:
{
get
parentNode
()
{
return
context
.
refs
.
form
},
gridConfig
:
{
columns
:
[
{
type
:
"
seq
"
,
title
:
"
ihaz9tUNnVF7Td4wTeV
"
,
width
:
"
60px
"
},
{
field
:
"
name
"
,
title
:
"
n204RhIdm3DbocCisd3L
"
},
{
field
:
"
code
"
,
title
:
"
jApAVwXCgLc5553TnKMk2
"
},
{
field
:
'
goodsBarcode.barcode
'
,
title
:
"
apVwPjojSSrWpw3EvjF
"
},
{
field
:
'
warehouse.name
'
,
title
:
"
LmrhEenCkwoXjDrbXqt8
"
},
{
field
:
'
alreadyNum
'
,
title
:
"
kIm1V4RhQfECm11jLHjqz
"
},
{
field
:
'
inventoryQty
'
,
title
:
"
u2Zm1p3I30Dv0AdZ22iZ3
"
,
editRender
:
{
name
:
'
ElInput
'
,
size
:
"
small
"
}
}
],
// "max-height": "600px",
keepSource
:
true
,
toolbarConfig
:
{
toolbar
:
{
refresh
:
true
,
export
:
true
}
},
proxyConfig
:
{
ajax
:
{
// 接收 Promise 对象
query
:
({
$grid
})
=>
{
let
finalData
=
[]
for
(
let
i
=
0
;
i
<
20
;
i
++
)
{
finalData
.
push
({
name
:
`名称
${
i
}
`
,
id
:
i
,
code
:
i
})
}
return
finalData
}
}
}
}
},
ref
:
'
pageTable
'
}
}
]
}
return
{
formConfig
}
}
});
export
const
Simple
=
Template1
.
bind
({});
Simple
.
storyName
=
"
表格表单
"
;
src/stories/select/down-table/src/index.js
浏览文件 @
790198f3
...
...
@@ -25,7 +25,7 @@ function renderSelect({ h, $pulldown, vm }) {
if
(
tableGrid
)
{
let
finalData
=
vm
.
originData
if
(
filterMethod
)
{
finalData
=
filterMethod
(
vm
.
originData
)
finalData
=
filterMethod
(
vm
.
originData
,
str
)
}
else
{
finalData
=
vm
.
originData
.
filter
(
item
=>
{
return
vm
.
columnsFilter
.
some
(
field
=>
{
...
...
src/stories/table/basic/index.stories.js
浏览文件 @
790198f3
...
...
@@ -758,10 +758,10 @@ DefaultForm.storyName = "表单表格";
DefaultForm
.
args
=
{}
let
treeList
=
[
{
"
company_code
"
:
"
lwc
"
,
"
company_name
"
:
"
立威云
"
,
"
children
"
:[
//
{
//
"company_code":"lwc",
//
"company_name":"立威云",
//
"children":[
{
"
goods_name
"
:
"
五粮液-绵柔尖庄
"
,
"
barcode
"
:
"
1122121234214
"
,
...
...
@@ -786,98 +786,98 @@ let treeList = [
"
goods_code
"
:
"
101002
"
,
"
qty
"
:
52
},
{
"
goods_name
"
:
"
小飞酒
"
,
"
barcode
"
:
"
12121212121
"
,
"
goods_code
"
:
"
101002
"
,
"
qty
"
:
34
},
{
"
goods_name
"
:
"
飞天茅台
"
,
"
barcode
"
:
"
8563214236549
"
,
"
goods_code
"
:
"
0236514485632145856324
"
,
"
qty
"
:
-
2
},
{
"
goods_name
"
:
"
三星超薄全面屏电视
"
,
"
barcode
"
:
"
vmall-3-1-3-2
"
,
"
goods_code
"
:
"
vmall-3-1-3-2
"
,
"
qty
"
:
6
},
{
"
goods_name
"
:
"
维他 低糖柠檬茶250ml*16盒
"
,
"
barcode
"
:
"
202107050001
"
,
"
goods_code
"
:
"
20210706
"
,
"
qty
"
:
5
},
{
"
goods_name
"
:
"
卫龙小面筋
"
,
"
barcode
"
:
"
1254126321542
"
,
"
goods_code
"
:
"
15145105
"
,
"
qty
"
:
155
},
{
"
goods_name
"
:
"
华为p40
"
,
"
barcode
"
:
"
555555555555
"
,
"
goods_code
"
:
"
11111
"
,
"
qty
"
:
-
16
},
{
"
goods_name
"
:
"
华为p40
"
,
"
barcode
"
:
"
1111111111116
"
,
"
goods_code
"
:
"
11111
"
,
"
qty
"
:
11
},
{
"
goods_name
"
:
"
#92汽油
"
,
"
barcode
"
:
"
2010110100000
"
,
"
goods_code
"
:
"
900101
"
,
"
qty
"
:
-
0.176
},
{
"
goods_name
"
:
"
安慕希
"
,
"
barcode
"
:
"
9998855541223
"
,
"
goods_code
"
:
"
111222222
"
,
"
qty
"
:
408
},
{
"
goods_name
"
:
"
清风面巾纸200抽*3层/包
"
,
"
barcode
"
:
"
6922266445033
"
,
"
goods_code
"
:
"
20808
"
,
"
qty
"
:
154
},
{
"
goods_name
"
:
"
CK Jeans 2021秋冬款男装时尚全棉方型LOGO绣标圆领长袖卫衣
"
,
"
barcode
"
:
"
1002545317819
"
,
"
goods_code
"
:
"
J318043
"
,
"
qty
"
:
1
},
{
"
goods_name
"
:
"
蒙牛 纯牛奶 PURE MILK 250ml*16 航天定制装
"
,
"
barcode
"
:
"
6907992513751
"
,
"
goods_code
"
:
"
htmilk
"
,
"
qty
"
:
-
1
},
{
"
goods_name
"
:
"
中包装
"
,
"
barcode
"
:
"
102123456789
"
,
"
goods_code
"
:
"
102
"
,
"
qty
"
:
100
},
{
"
goods_name
"
:
"
维他 低糖柠檬茶250ml*16盒
"
,
"
barcode
"
:
"
2010000100004
"
,
"
goods_code
"
:
"
100001
"
,
"
qty
"
:
-
3
},
{
"
goods_name
"
:
"
CK Jeans 2021秋冬款男装时尚全棉方型LOGO绣标圆领长袖卫衣
"
,
"
barcode
"
:
"
1002545317826
"
,
"
goods_code
"
:
"
J318043
"
,
"
qty
"
:
1
}
]
}
//
{
//
"goods_name":"小飞酒",
//
"barcode":"12121212121",
//
"goods_code":"101002",
//
"qty":34
//
},
//
{
//
"goods_name":"飞天茅台",
//
"barcode":"8563214236549",
//
"goods_code":"0236514485632145856324",
//
"qty":-2
//
},
//
{
//
"goods_name":"三星超薄全面屏电视",
//
"barcode":"vmall-3-1-3-2",
//
"goods_code":"vmall-3-1-3-2",
//
"qty":6
//
},
//
{
//
"goods_name":"维他 低糖柠檬茶250ml*16盒",
//
"barcode":"202107050001",
//
"goods_code":"20210706",
//
"qty":5
//
},
//
{
//
"goods_name":"卫龙小面筋",
//
"barcode":"1254126321542",
//
"goods_code":"15145105",
//
"qty":155
//
},
//
{
//
"goods_name":"华为p40",
//
"barcode":"555555555555",
//
"goods_code":"11111",
//
"qty":-16
//
},
//
{
//
"goods_name":"华为p40",
//
"barcode":"1111111111116",
//
"goods_code":"11111",
//
"qty":11
//
},
//
{
//
"goods_name":"#92汽油",
//
"barcode":"2010110100000",
//
"goods_code":"900101",
//
"qty":-0.176
//
},
//
{
//
"goods_name":"安慕希",
//
"barcode":"9998855541223",
//
"goods_code":"111222222",
//
"qty":408
//
},
//
{
//
"goods_name":"清风面巾纸200抽*3层/包",
//
"barcode":"6922266445033",
//
"goods_code":"20808",
//
"qty":154
//
},
//
{
//
"goods_name":"CK Jeans 2021秋冬款男装时尚全棉方型LOGO绣标圆领长袖卫衣",
//
"barcode":"1002545317819",
//
"goods_code":"J318043",
//
"qty":1
//
},
//
{
//
"goods_name":"蒙牛 纯牛奶 PURE MILK 250ml*16 航天定制装",
//
"barcode":"6907992513751",
//
"goods_code":"htmilk",
//
"qty":-1
//
},
//
{
//
"goods_name":"中包装",
//
"barcode":"102123456789",
//
"goods_code":"102",
//
"qty":100
//
},
//
{
//
"goods_name":"维他 低糖柠檬茶250ml*16盒",
//
"barcode":"2010000100004",
//
"goods_code":"100001",
//
"qty":-3
//
},
//
{
//
"goods_name":"CK Jeans 2021秋冬款男装时尚全棉方型LOGO绣标圆领长袖卫衣",
//
"barcode":"1002545317826",
//
"goods_code":"J318043",
//
"qty":1
//
}
//
]
//
}
]
export
const
TreeTable
=
Template
.
bind
({});
TreeTable
.
storyName
=
"
树形表格
"
;
...
...
@@ -887,12 +887,12 @@ TreeTable.args = {
resizable
:
true
,
exportConfig
:
{},
autoResize
:
true
,
treeConfig
:
{
expandAll
:
true
,
indent
:
30
},
//
treeConfig: {
//
expandAll: true,
//
indent: 30
//
},
columns
:
[
{
field
:
"
company_code
"
,
title
:
"
公司编号
"
,
minWidth
:
"
80px
"
,
treeNode
:
true
},
{
field
:
"
company_code
"
,
title
:
"
公司编号
"
,
minWidth
:
"
80px
"
},
{
field
:
"
company_name
"
,
title
:
"
公司名称
"
,
minWidth
:
"
100px
"
},
{
field
:
"
goods_name
"
,
title
:
"
商品名称
"
,
minWidth
:
"
150px
"
,
showOverflow
:
true
},
{
field
:
"
goods_code
"
,
title
:
"
商品货号
"
,
minWidth
:
"
100px
"
},
...
...
src/stories/table/basic/src/index.js
浏览文件 @
790198f3
...
...
@@ -257,7 +257,7 @@ const renderCustomToolbarIcon = (h, customConfig) => {
})
}
const
renderTable
=
(
h
,
contentConfig
,
formConfig
,
_vm
)
=>
{
const
renderTable
=
(
h
,
contentConfig
,
formConfig
,
_vm
,
height
)
=>
{
const
{
events
=
{},
slots
,
...
tableConfig
}
=
contentConfig
// 获取列表数据
// const { data, ...otherTableConfig } = tableConfig
...
...
@@ -294,11 +294,12 @@ const renderTable = (h, contentConfig, formConfig, _vm) => {
}
let
mainHeight
=
"
100%
"
if
(
tableConfig
.
autoHeight
||
_
.
isUndefined
(
tableConfig
.
autoHeight
))
{
let
gridBox
=
_vm
.
$refs
[
_vm
.
gridBox
]?.
getBoundingClientRect
()
let
gridTableBox
=
_vm
.
$refs
[
_vm
.
gridTableBox
]?.
getBoundingClientRect
()
let
gridBoxHeight
=
_vm
.
parentNode
?
height
:
gridBox
?.
height
if
(
gridBox
&&
gridTableBox
)
{
let
mainHeightNum
=
gridBox
.
h
eight
-
(
gridTableBox
.
top
-
gridBox
.
top
)
let
mainHeightNum
=
gridBox
H
eight
-
(
gridTableBox
.
top
-
gridBox
.
top
)
mainHeight
=
mainHeightNum
>
200
?
`
${
mainHeightNum
}
px`
:
'
100%
'
let
tableMainHeight
=
mainHeightNum
if
(
tableConfig
.
showFooter
)
{
...
...
@@ -309,6 +310,7 @@ const renderTable = (h, contentConfig, formConfig, _vm) => {
}
}
}
// 默认添加溢出隐藏
if
(
_
.
isUndefined
(
tableConfig
[
'
show-overflow
'
]
&&
_
.
isUndefined
(
tableConfig
.
showOverflow
)))
{
tableConfig
[
'
show-overflow
'
]
=
'
tooltip
'
...
...
@@ -321,10 +323,12 @@ const renderTable = (h, contentConfig, formConfig, _vm) => {
ref
:
_vm
.
gridTableBox
},
[
h
(
"
vxe-grid
"
,
{
props
:
{
// loading: false,
...
tableConfig
,
formConfig
:
{
data
:
_vm
.
getFormData
(
_vm
.
btnType
)
}
get
props
()
{
return
{
// loading: false,
...
tableConfig
,
formConfig
:
{
data
:
_vm
.
getFormData
(
_vm
.
btnType
)
}
}
},
class
:
[
'
lwc-table-basic
'
,
...
...
@@ -352,6 +356,7 @@ export default {
components
:
{
LwcBasicButtonIcon
},
props
:
{
gridConfig
:
Object
,
parentNode
:
Object
,
className
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
...
...
@@ -624,11 +629,15 @@ export default {
},
render
(
h
)
{
const
_this
=
this
;
const
{
formConfig
=
{},
toolbarConfig
,
cardConfig
,
...
contentConfig
}
=
this
.
gridConfig
const
{
formConfig
=
{},
toolbarConfig
,
cardConfig
,
autoHeight
,
...
contentConfig
}
=
this
.
gridConfig
const
{
items
=
[]
}
=
formConfig
||
{}
let
gridBox
=
_this
.
$refs
[
_this
.
gridBox
]
let
gridParentBox
=
gridBox
?.
parentElement
let
top
=
gridBox
?.
offsetTop
-
gridParentBox
?.
offsetTop
let
gridBoxEl
=
_this
.
$refs
[
_this
.
gridBox
]
let
gridParentBoxEl
=
_this
.
parentNode
?
_this
.
parentNode
.
$el
:
gridBoxEl
?.
parentElement
let
gridBox
=
gridBoxEl
?.
getBoundingClientRect
()
let
gridParentBox
=
gridParentBoxEl
?.
getBoundingClientRect
()
let
top
=
gridBox
?.
top
-
gridParentBox
?.
top
let
isAutoHeight
=
autoHeight
||
_
.
isUndefined
(
autoHeight
)
let
height
=
gridParentBox
?.
height
-
top
return
h
(
"
div
"
,
{
class
:
[
this
.
fullScreen
?
"
vxe-grid is--maximize
"
:
''
,
...
...
@@ -637,7 +646,11 @@ export default {
style
:
{
...(
this
.
fullScreen
?
{
"
z-index
"
:
9999
}
:
{}),
get
height
()
{
return
gridBox
?
`calc(100% -
${
top
}
px)`
:
"
100%
"
if
(
_this
.
parentNode
)
{
return
(
gridBox
&&
height
>
200
&&
isAutoHeight
)
?
`
${
height
}
px`
:
"
100%
"
}
else
{
return
(
gridBox
&&
top
>
0
&&
isAutoHeight
)
?
`calc(100% -
${
top
}
px)`
:
"
100%
"
}
}
},
ref
:
this
.
gridBox
...
...
@@ -669,7 +682,7 @@ export default {
}
})
:
null
,
toolbarConfig
?
renderToolbar
(
h
,
toolbarConfig
,
contentConfig
,
this
)
:
null
,
renderTable
(
h
,
contentConfig
,
formConfig
,
this
),
renderTable
(
h
,
contentConfig
,
formConfig
,
this
,
height
),
cardConfig
&&
cardConfig
.
name
?
renderCard
(
h
,
cardConfig
,
contentConfig
,
this
)
:
null
])
},
...
...