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

Skip to content
源代码提交(9)
## [1.0.4](http://git.leadwaycloud.com/package/lwc-ui-components/compare/v1.0.3...v1.0.4) (2022-03-22)
### Features
* 新增 lwc-select-cascader-extend 组件 ([9d3a223](http://git.leadwaycloud.com/package/lwc-ui-components/commits/9d3a223273805b8a0ff07241f16124b1bfc3fd18))
## [1.0.3](http://git.leadwaycloud.com/package/lwc-ui-components/compare/v1.0.2...v1.0.3) (2022-03-17)
......
此差异已折叠。
{
"name": "@package/lwc-ui-components",
"version": "1.0.4",
"version": "1.0.5",
"private": false,
"description": "立威云UI组件库",
"author": "",
......@@ -31,44 +31,42 @@
],
"dependencies": {
"@mdx-js/vue-loader": "^1.6.22",
"@package/icon-park": "^1.2.5",
"@vue/composition-api": "^1.0.0-beta.19",
"clipboard": "^2.0.6",
"core-js": "^3.21.1",
"dayjs": "^1.9.6",
"echarts": "^5.2.1",
"element-ui": "^2.15.6",
"jsbarcode": "^3.11.3",
"lodash": "^4.17.20",
"qrcode": "^1.4.4",
"resize-detector": "^0.2.2",
"tailwindcss": "~2.2.19",
"underscore": "^1.11.0",
"uuid": "^8.3.2",
"vue": "^2.6.11",
"vue": "2.6.14",
"vue-cropper": "^0.5.6",
"vue-i18n": "^8.22.1",
"vue-quill-editor": "^3.0.6",
"element-ui": "^2.15.6",
"tailwindcss": "~2.2.19",
"vxe-table": "~3.5.1",
"vxe-table": "3.5.1",
"vxe-table-plugin-element": "^1.11.2",
"xe-utils": "^3.1.13",
"lodash": "^4.17.20",
"@package/icon-park": "^1.2.5"
"xe-utils": "^3.1.13"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@storybook/addon-docs": "^6.5.0-alpha.45",
"@storybook/addon-a11y": "^6.5.0-alpha.45",
"@storybook/addon-actions": "^6.5.0-alpha.45",
"@storybook/addon-essentials": "^6.5.0-alpha.45",
"@storybook/addon-knobs": "^6.1.21",
"@storybook/addon-controls": "^6.5.0-alpha.45",
"@storybook/addon-links": "^6.5.0-alpha.45",
"@storybook/addon-notes": "^6.0.0-alpha.6",
"@storybook/addon-storysource": "^6.5.0-alpha.45",
"@storybook/addon-viewport": "^6.5.0-alpha.45",
"@storybook/builder-webpack5": "^6.5.0-alpha.45",
"@storybook/manager-webpack5": "^6.5.0-alpha.45",
"@storybook/vue": "^6.5.0-alpha.45",
"@storybook/addon-a11y": "^6.5.10",
"@storybook/addon-actions": "^6.5.10",
"@storybook/addon-controls": "^6.5.10",
"@storybook/addon-docs": "^6.5.10",
"@storybook/addon-essentials": "^6.5.10",
"@storybook/addon-links": "^6.5.10",
"@storybook/addon-storysource": "^6.5.10",
"@storybook/addon-viewport": "^6.5.10",
"@storybook/builder-webpack5": "^6.5.0-rc.1",
"@storybook/manager-webpack5": "^6.5.0-rc.1",
"@storybook/vue": "^6.5.10",
"@vue/cli-plugin-babel": "~5.0.1",
"@vue/cli-plugin-eslint": "~5.0.1",
"@vue/cli-service": "~5.0.1",
......@@ -112,13 +110,13 @@
"url-loader": "^4.1.1",
"validate-commit-msg": "^2.14.0",
"vue-loader": "~15.9.3",
"vue-template-compiler": "^2.6.11",
"webpack": "~5.69.1",
"vue-template-compiler": "2.6.14",
"webpack": "5",
"webpack-cli": "^4.9.2",
"webpack-node-externals": "~2.5.0"
},
"resolutions": {
"@storybook/vue/webpack": "~5.69.1"
"@storybook/vue/webpack": "5"
},
"browserslist": [
"> 1%",
......
......@@ -132,17 +132,26 @@ export default {
return new Promise((resolve,reject) => {
setTimeout(res => {
resolve({ req: formConfig.value.data, res: {} });
},2000);
},5000);
})
}
};
const load = () => {
return new Promise((resolve, reject) => {
setTimeout(res => {
resolve();
},3000);
})
}
return {
// data
formConfig,
// methods
submit
submit,
load
};
}
};
......
......@@ -8,6 +8,27 @@
`新特性`
`非兼容性更新`
---
### **v1.0.5 20220805**
#### Bug修复
- 修复 lwc-basic-form 组件 loading问题
- 修复 lwc-table-basic 组件 card模式 loading问题
- 修复 lwc-select-extend 组件 筛选不灵敏并且错误问题
- 修复 lwc-table-basic 组件 form搜索条件未过滤掉数组空值问题
---
### **v1.0.4 20220322**
#### 新增
- 新增 lwc-select-cascader-extend 组件
#### 优化
- 优化 lwc-data-display-description 默认宽度
---
### **v1.0.3 20220317**
......
......@@ -3,7 +3,47 @@ import LwcDialogBasic from './src/index.js';
export default {
title: "Design System/Dialog/基础弹窗",
component: LwcDialogBasic,
argTypes: {},
argTypes: {
status: { type: "boolean", description: "弹窗状态" },
contentConfig: { type: "object", description: "弹窗内容组件配置参数,由hoc组件跳转,所有需要嵌入“表单弹窗”的组件,必须按照规范实现,可以参考模板" },
events: { type: "object", description: "弹窗内容方法配置参数,由hoc组件跳转,所有需要嵌入“表单弹窗”的组件,必须按照规范实现,可以参考模板" },
name: {
type: 'string',
require: true,
default: "弹窗标题",
description: "弹窗标题",
},
width: {
type: "string | number",
require: false,
description: "弹窗宽度,配置与 vxe-modal 一致",
},
height: {
type: "string | number",
require: false,
description: "弹窗高度,配置与 vxe-modal 一致",
},
showFooter: {
type: "boolean",
require: false,
description: "是否显示底部按钮",
},
showSubmitBtn: {
type: "boolean",
require: false,
description: "是否显示底部确认按钮",
},
submitText: {
type: "string",
require: false,
description: "确认按钮文字",
},
cancelText: {
type: "string",
require: false,
description: "取消按钮文字",
}
},
decorators: [() => ({ template: '<el-col class="bg-white p-4"><story/></el-col>' })]
};
......@@ -12,8 +52,8 @@ const Template = (args, { argTypes }) => ({
components: { LwcDialogBasic },
data() {
return {
status: false,
contentConfig: {
statusTpl: false,
contentConfigTpl: {
name: 'lwc-select-goods',
ref: 'selectGoods',
props: {
......@@ -198,19 +238,24 @@ const Template = (args, { argTypes }) => ({
},
on: {
click: () => {
_this.status = true
_this.statusTpl = true
}
}
}, '弹出弹窗'),
h('lwc-dialog-basic', {
props: {
ref: "dialogBasic",
status: this.status,
status: this.statusTpl,
name: "商品选择",
contentConfig: this.contentConfig,
contentConfig: this.contentConfigTpl,
height: "80%",
events: {
beforeSubmit() { // 若为false,截止后续请求
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true)
}, 10000)
})
return true
return false
},
......@@ -220,7 +265,7 @@ const Template = (args, { argTypes }) => ({
}
},
on: {
'update:status': (val) => _this.status = val
'update:status': (val) => _this.statusTpl = val
}
})
]);
......
......@@ -111,6 +111,22 @@ export default {
return {
dialogRef: `dialog_${uuidv4()}`,
loading: false,
firstLoading: true,
}
},
methods: {
async load(callback) {
try {
this.vnLoading = true
if(callback) await callback(this)
this.vnLoading = false
this.firstLoading = false
} catch (error) {
this.vnLoading = false
throw Error(error)
} finally {
this.vnLoading = false
}
}
},
render(h) {
......@@ -139,6 +155,14 @@ export default {
}
},
on: {
show: () => {
if(_this.firstLoading) {
_this.load(async() => {
const contentRef = this.$refs[this.contentRef];
if(contentRef?.load) await contentRef.load();
})
}
},
hide: () => {
_this.$emit('update:status', false)
}
......
......@@ -48,7 +48,7 @@ const Template = (args, { argTypes }) => ({
contentConfig: {
name: BarcodeTpl,
},
loading: true
// loading: true
};
},
render(h) {
......@@ -66,9 +66,9 @@ const Template = (args, { argTypes }) => ({
_this.status = true;
// 测试loading 关闭
setTimeout(() => {
_this.loading = false
}, 3000)
// setTimeout(() => {
// _this.loading = false
// }, 3000)
},
},
},
......@@ -79,7 +79,7 @@ const Template = (args, { argTypes }) => ({
status: this.status,
name: "商品选择",
contentConfig: this.contentConfig,
loading: this.loading
// loading: this.loading
},
on: {
"update:status": (val) => (_this.status = val),
......
......@@ -7,7 +7,7 @@ function renderButtons(h, _vm) {
class: _vm.footerClass ? _vm.footerClass : '',
}, [
h('el-button', {
props: { type: "primary" },
props: { type: "primary", disabled: _vm.vnLoading },
on: {
click: async () => {
try {
......@@ -17,7 +17,7 @@ function renderButtons(h, _vm) {
_vm.vnLoading = false
if (result) {
_vm.$emit('afterSubmit', result);
if (_vm.autoClose) _vm.$refs[_vm.dialogRef].close();
if (_vm.autoClose) _vm.$refs[_vm.dialogRef]?.close();
}
} catch (error) {
_vm.vnLoading = false
......@@ -32,7 +32,7 @@ function renderButtons(h, _vm) {
props: {},
on: {
click: () => {
_vm.$refs[_vm.dialogRef].close();
_vm.$refs[_vm.dialogRef]?.close();
_vm.$emit('onCancel');
}
}
......@@ -85,7 +85,7 @@ export default {
default: true,
require: true
},
loading: {
loading: { // 是否显示loading true显示loading
type: Boolean,
default: false,
require: false
......@@ -94,19 +94,35 @@ export default {
data() {
return {
contentRef: `content_${uuidv4()}`,
vnLoading: false
vnLoading: false,
firstLoading: true
}
},
methods: {
async load(callback) {
try {
this.vnLoading = true
if(callback) await callback(this)
this.vnLoading = false
this.firstLoading = false
} catch (error) {
this.vnLoading = false
throw Error(error)
} finally {
this.vnLoading = false
}
}
},
render(h) {
const _this = this;
const { name, width, height, contentConfig, showFooter, dialogRef, loading } = this.$props;
if (contentConfig.ref) this.contentRef = contentConfig.ref; // 使用外部传入内容组件的ref
this.vnLoading = loading;
// this.vnLoading = loading;
return h('vxe-modal', {
ref: dialogRef,
props: {
loading: this.vnLoading,
...this.$attrs,
loading: this.vnLoading || loading,
value: this.status,
title: name,
width: width,
......@@ -128,6 +144,14 @@ export default {
}
},
on: {
show: () => {
if(_this.firstLoading) {
_this.load(async() => {
const contentRef = this.$refs[this.contentRef];
if(contentRef?.load) await contentRef.load();
})
}
},
hide: () => {
_this.$emit('update:status', false)
}
......
......@@ -210,6 +210,7 @@ function selectRow({ vm, checked, toggle, row, $grid }) {
[vm.optionProps["name"]]: XEUtils.get(row, vm.columnsProps["name"])
})
}
vm.$emit("select", row)
$grid.setCheckboxRow(row, toggle ? selectIndex < 0 : checked)
vm.$emit("update:value", vm.type === "obj" ? JSON.parse(JSON.stringify(vm.selectList)) : vm.selectValue)
}
......@@ -301,6 +302,12 @@ export default {
return {}
}
},
pulldownProps: {
type: Object,
default: function() {
return {}
}
},
gridProps: Object,
// 表格默认显示
renderCell: {
......@@ -393,7 +400,7 @@ export default {
renderTableCell(h, this)
]) : h("vxe-pulldown", {
class: "w-full",
props: { transfer: true },
props: { transfer: true, ...this.pulldownProps },
scopedSlots: {
default: ({ $pulldown }) => {
return renderSelect({
......
......@@ -206,7 +206,7 @@ AsyncLoadOptions.args = {
isOptionsGroup: false,
selectConfig: {
filterable: true,
multiple: true, // 是否多选
multiple: false, // 是否多选
// disabled: true, // 是否禁用
size: "mini", // 是否禁用
},
......
......@@ -320,11 +320,11 @@ export default {
"popper-class": hasFooter ? 'lwc-select-footer_visible' : '',
...selectConfig,
loading: _this.searchLoading,
"filter-method": function(query) {
_this.filterQuery = query;
_this.filteredOptions = _this.queryChange(query)
_this.filteredOptionsCount = _this.filteredOptions.length
},
// "filter-method": function(query) {
// _this.filterQuery = query;
// _this.filteredOptions = _this.queryChange(query)
// _this.filteredOptionsCount = _this.filteredOptions.length
// },
"remote-method": async function(query) {
_this.searchLoading = true;
const list = await asyncLoadMethod(query);
......@@ -359,9 +359,9 @@ export default {
"view-class": "el-select-dropdown__list",
},
style: `height: ${this.computedOptionsScrollHeight()}px`
}, renderOptions(this, h, this.filterQuery ? this.filteredOptions : this.renderOptions, defaultOption)),
}, renderOptions(this, h, this.renderOptions, defaultOption)),
renderFooter(this, h, footerConfig),
] : [ renderOptions(this, h, this.filterQuery ? this.filteredOptions : this.renderOptions, defaultOption) ]
] : [ renderOptions(this, h, this.renderOptions, defaultOption) ]
),
_this.dialogConfig.status ? h("lwc-dialog-form", {
props: {
......
......@@ -220,6 +220,7 @@ DefaultList.args = {
data: {
name: "",
email: null,
statusList: []
},
titleWidth: 50,
titleAlign: "left",
......@@ -247,11 +248,11 @@ DefaultList.args = {
itemRender: { name: "ElInput", attrs: { placeholder: "角色" } },
},
{
field: "sex",
field: "statusList",
className: "w-1/4 md:w-1/4 sm:w-1/3",
folding: true,
titleSuffix: { message: "注意,必填信息!", icon: "fa fa-info-circle" },
itemRender: { name: "ElSelect", options: [], props: { placeholder: "性别" } },
itemRender: { name: "ElSelect", options: [], props: { placeholder: "性别", multiple: true } },
},
{
field: "age",
......
......@@ -26,7 +26,11 @@ const renderCard = (h, cardConfig, contentConfig, _vm) => {
},
on: {
...events
}
},
directives: [{
name: 'loading',
value: _vm.loading
}]
}),
_vm.showPager ? h("div", {
class: {
......@@ -422,7 +426,7 @@ export default {
if (formConfig) {
// 实时获取搜索参数设置
for(let filed in formConfig.data) {
if(formConfig.data[filed] || (!formConfig.data[filed] && (typeof formConfig.data[filed] === 'number' || typeof formConfig.data[filed] === 'boolean'))) this.$set(formData, filed, formConfig.data[filed])
if((formConfig.data[filed] && !_.isEmpty(formConfig.data[filed])) || (!formConfig.data[filed] && (typeof formConfig.data[filed] === 'number' || typeof formConfig.data[filed] === 'boolean'))) this.$set(formData, filed, formConfig.data[filed])
}
// 搜索返回
if(code === "submit") {
......@@ -432,7 +436,7 @@ export default {
if(code === "reset"){
let resetFormData = this.defaultGridConfig.formConfig?.data
for(let filed in resetFormData) {
if(resetFormData[filed] || (!resetFormData[filed] && (typeof resetFormData[filed] === 'number' || typeof resetFormData[filed] === 'boolean'))) {
if((resetFormData[filed] && !_.isEmpty(resetFormData[filed])) || (!resetFormData[filed] && (typeof resetFormData[filed] === 'number' || typeof resetFormData[filed] === 'boolean'))) {
this.$set(formData, filed, resetFormData[filed])
}
}
......
此差异已折叠。