让企业管理更智慧、更快捷

Skip to content
源代码提交(4)
## [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)
......
{
"name": "@package/lwc-ui-components",
"version": "1.0.11",
"version": "1.0.12",
"private": false,
"description": "立威云UI组件库",
"author": "",
......
......@@ -209,7 +209,7 @@ if (typeof window !== 'undefined' && window.Vue) {
}
export default {
version: '1.0.10',
version: '1.0.11',
install,
LwcBasicButton,
LwcBasicButtonIcon,
......
......@@ -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**
......
......@@ -84,7 +84,7 @@ Default.args = {
{
label: "跟进记录",
name: "1",
lazy: true,
lazy: false,
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,
};
},
......
......@@ -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 = "表格表单";
......@@ -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 => {
......
......@@ -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" },
......
......@@ -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.height - (gridTableBox.top - gridBox.top)
let mainHeightNum = gridBoxHeight - (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
])
},
......