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

Skip to content
源代码提交(4)
## [1.0.13](http://git.leadwaycloud.com/package/lwc-ui-components/compare/v1.0.12...v1.0.13) (2022-12-14)
## [1.0.15](http://git.leadwaycloud.com/package/lwc-ui-components/compare/v1.0.14...v1.0.15) (2022-12-14)
### Bug Fixes
* 修复上传附件预览功能图片显示不完整 修复table表尾数据高度多行导致自动高度失效错误 ([7d1a274](http://git.leadwaycloud.com/package/lwc-ui-components/commits/7d1a274107f5beee62f657f3084f2cd1acb24386))
* 修复有页脚的列表在特地情况重复请求卡死的错误 ([58ff8e2](http://git.leadwaycloud.com/package/lwc-ui-components/commits/58ff8e251b155ff9227e93ebb25ab65fcde9185a))
......
{
"name": "@package/lwc-ui-components",
"version": "1.0.15",
"version": "1.0.16",
"private": false,
"description": "立威云UI组件库",
"author": "",
......
<template>
<lwc-table-basic :gridConfig="gridConfig"> </lwc-table-basic>
</template>
<script>
import { ref } from "@vue/composition-api";
export default {
setup(props, context) {
let widgetRefs = ref({});
const gridConfig = ref({
columns: [
{ type: "checkbox", width: "60" },
{ field: "name", title: "提货库名称" },
{ field: "code", title: "提货库编号" },
{ field: "externalCode", title: "外部编号", cellRender: { name: "Empty" } },
{ field: "contact.mobile", title: "手机号码", cellRender: { name: "Empty" } },
{ field: "contact.email", title: "联系邮箱", cellRender: { name: "Empty" } },
],
rowId: "id",
checkboxConfig: {
reserve: true,
highlight: true,
trigger: "row"
},
formConfig: {
data: {
name: null,
code: null,
externalCode: null,
statusList: null
},
titleWidth: 80,
titleAlign: "left",
size: "small",
items: [
{
field: "code",
className: "grid-form-item",
itemRender: {
name: "ElInput",
attrs: { placeholder: "提货库编号" },
props: { clearable: true }
}
},
{
field: "externalCode",
className: "grid-form-item",
itemRender: {
name: "ElInput",
attrs: { placeholder: "外部编号" },
props: { clearable: true }
}
},
{
field: "name",
className: "grid-form-item",
itemRender: {
name: "ElInput",
attrs: { placeholder: "提货库名称" },
props: { clearable: true }
}
},
{
className: "float-right",
align: "right",
itemRender: {
name: "ElButtons",
children: [
{
content: "搜索",
props: { type: "primary", nativeType: "submit" }
},
{ content: "重置", props: { type: "", nativeType: "reset" } }
]
}
},
{ className: "float-right pr-0", align: "right", collapseNode: true }
]
},
pagerConfig: { pageSize: 10, border: true },
proxyConfig: {
props: {
result: "list", // 配置响应结果列表字段
total: "total" // 配置响应结果总页数字段
},
ajax: {
// 接收 Promise 对象
query: async ({ page, sorts, $grid }, form = {}) => {
widgetRefs.value.table = $grid;
return new Promise((resolve) => {
setTimeout(() => {
resolve({
list: [],
total: 0
})
}, 3000);
});
// return {
// list: [],
// total: 0
// }
}
}
}
});
return {
// data
gridConfig
};
}
};
</script>
......@@ -209,7 +209,7 @@ if (typeof window !== 'undefined' && window.Vue) {
}
export default {
version: '1.0.13',
version: '1.0.15',
install,
LwcBasicButton,
LwcBasicButtonIcon,
......
......@@ -8,6 +8,13 @@
`新特性`
`非兼容性更新`
---
### **v1.0.15 20221214**
#### 新增
- 修复 lwc-table-basic 组件 有页尾的列表导致循环页面卡死错误
---
### **v1.0.13 20221214**
......
......@@ -112,6 +112,7 @@ export default {
dialogRef: `dialog_${uuidv4()}`,
loading: false,
firstLoading: true,
showModal: false
}
},
methods: {
......@@ -147,7 +148,7 @@ export default {
scopedSlots: {
default: () => {
return [
renderHoc(h, _this, contentConfig)
this.showModal ? renderHoc(h, _this, contentConfig) : null
];
},
footer: (event) => {
......@@ -156,6 +157,7 @@ export default {
},
on: {
show: () => {
if(!_this.showModal) _this.showModal = true
if(_this.firstLoading) {
_this.load(async() => {
const contentRef = this.$refs[this.contentRef];
......
import LwcDialogForm from "./src/index.js";
import BarcodeTpl from "../../../__mock__/template/barcode.vue";
// import BarcodeTpl from "../../../__mock__/template/barcode.vue";
import TableTpl from "../../../__mock__/template/table.vue";
export default {
title: "Design System/Dialog/表单弹窗",
......@@ -46,7 +47,7 @@ const Template = (args, { argTypes }) => ({
return {
status: false,
contentConfig: {
name: BarcodeTpl,
name: TableTpl,
},
// loading: true
};
......@@ -64,7 +65,6 @@ const Template = (args, { argTypes }) => ({
on: {
click: () => {
_this.status = true;
// 测试loading 关闭
// setTimeout(() => {
// _this.loading = false
......@@ -76,6 +76,7 @@ const Template = (args, { argTypes }) => ({
),
h("lwc-dialog-form", {
props: {
width: "80%",
status: this.status,
name: "商品选择",
contentConfig: this.contentConfig,
......
......@@ -95,7 +95,8 @@ export default {
return {
contentRef: `content_${uuidv4()}`,
vnLoading: false,
firstLoading: true
firstLoading: true,
showModal: false
}
},
methods: {
......@@ -133,10 +134,10 @@ export default {
scopedSlots: {
default: () => {
return [
renderHoc(h, _this, {
this.showModal ? renderHoc(h, _this, {
...contentConfig,
ref: _this.contentRef // 更新ref
})
}) : null
];
},
footer: () => {
......@@ -145,6 +146,7 @@ export default {
},
on: {
show: () => {
if(!_this.showModal) _this.showModal = true
if(_this.firstLoading) {
_this.load(async() => {
const contentRef = this.$refs[this.contentRef];
......
......@@ -60,16 +60,29 @@ Default.args = {
name: "label"
},
selectProps: {
clearable: true
clearable: true,
filterable: true,
},
columnsFilter: ['label', 'nickname'],
pulldownProps: {
transfer: false
},
gridProps: {
gridConfig: {
"row-key": true,
border: "inner",
resizable: true,
keepSource: true,
pagerConfig: {
enabled: false
},
"row-config": {
isCurrent: true
},
// "scroll-y": {
// gt: 200
// // enabled: false
// },
columns: [
{ type: 'checkbox', width: 50 },
{ type: 'seq', width: 60 },
......@@ -82,6 +95,12 @@ Default.args = {
ajax: {
// 接收 Promise 对象
query: ({ page, sorts, filters, $grid }) => {
let data = []
for(let i = 0; i< 110; i++) {
data.push(
{ id: i, label: "用户" + i, nickname: "12121"+ i, value: i +"" },
)
}
return data
}
......
......@@ -17,7 +17,7 @@ function renderSelect({ h, $pulldown, vm }) {
filterable: true,
"popper-class": "hidden",
}: {
readonly: true
readonly: true,
}),
multiple: vm.multiple,
"filter-method": (str) => {
......@@ -43,6 +43,21 @@ function renderSelect({ h, $pulldown, vm }) {
if(state) {
if(!filterable) vm.$refs[vm.selectInput].blur();
$pulldown.showPanel().then(() => {
const tableGrid = vm.$refs[vm.selectTable].getTableGrid()
if(tableGrid) {
setTimeout(async() => {
const scroll = await tableGrid.getScroll()
if(scroll.scrollTop > 0) {
tableGrid.scrollTo(scroll.scrollLeft, 0).then(() => {
tableGrid.scrollTo(scroll.scrollLeft, scroll.scrollTop)
})
} else {
tableGrid.scrollTo(scroll.scrollLeft, scroll.scrollLeft + 1).then(() => {
tableGrid.scrollTo(scroll.scrollLeft, 0)
})
}
}, 0)
}
if(!vm.needInit && !vm.initStatus) {
vm.needInit = false
vm.initStatus = true
......@@ -466,6 +481,6 @@ export default {
})
]
}
},
}
......@@ -158,7 +158,7 @@ const getData = (data) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(data);
}, 2000)
}, 20000)
})
}
const getData1 = (page) => {
......