From c15452d0f9bb5f39ba787c5caf1e41788dacdb10 Mon Sep 17 00:00:00 2001 From: changpei Date: Mon, 25 Mar 2024 10:18:26 +0800 Subject: [PATCH 01/14] =?UTF-8?q?fix:=20=E6=BC=94=E7=BB=83=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=BC=82=E5=B8=B8=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-tree-select-new.vue/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/u-tree-select-new.vue/api.ts b/src/components/u-tree-select-new.vue/api.ts index 38deb05a7..5300f48b8 100644 --- a/src/components/u-tree-select-new.vue/api.ts +++ b/src/components/u-tree-select-new.vue/api.ts @@ -160,7 +160,7 @@ namespace nasl.ui { @Prop({ group: '交互属性', title: '只渲染激活节点', - description: '设置只渲染tree激活子节点,用于渲染性能提升。', + description: '设置只渲染 tree 激活子节点,用于渲染性能提升。', docDescription: '开启后只渲染激活节点,默认关闭。', setter: { concept: 'SwitchSetter', From ee5392e1da4e498021a2422750c8868889e10371 Mon Sep 17 00:00:00 2001 From: changpei Date: Mon, 25 Mar 2024 10:44:56 +0800 Subject: [PATCH 02/14] =?UTF-8?q?fix:=20=E6=BC=94=E7=BB=83=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=BC=82=E5=B8=B8=E6=B5=8B=E8=AF=95v0.20.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 247ae42b1..9e525be6b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cloud-ui.vusion", "description": "Vusion Cloud UI", - "version": "0.20.3", + "version": "0.20.4", "author": "Forrest ", "contributors": [ "haoxutong <1255965516@qq.com>", From 81d11d308be64c82813fab137ae36062039efef4 Mon Sep 17 00:00:00 2001 From: changpei Date: Mon, 25 Mar 2024 14:02:39 +0800 Subject: [PATCH 03/14] =?UTF-8?q?fix:=20=E6=BC=94=E7=BB=83=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=BC=82=E5=B8=B8=E6=B5=8B=E8=AF=95v0.20.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e525be6b..247ae42b1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cloud-ui.vusion", "description": "Vusion Cloud UI", - "version": "0.20.4", + "version": "0.20.3", "author": "Forrest ", "contributors": [ "haoxutong <1255965516@qq.com>", From 9745729432e0f1b316fe205a915b783d096aa77f Mon Sep 17 00:00:00 2001 From: changpei Date: Mon, 25 Mar 2024 14:03:17 +0800 Subject: [PATCH 04/14] =?UTF-8?q?fix:=20=E6=BC=94=E7=BB=83=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=BC=82=E5=B8=B8=E6=B5=8B=E8=AF=95v0.20.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-tree-select-new.vue/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/u-tree-select-new.vue/api.ts b/src/components/u-tree-select-new.vue/api.ts index 5300f48b8..38deb05a7 100644 --- a/src/components/u-tree-select-new.vue/api.ts +++ b/src/components/u-tree-select-new.vue/api.ts @@ -160,7 +160,7 @@ namespace nasl.ui { @Prop({ group: '交互属性', title: '只渲染激活节点', - description: '设置只渲染 tree 激活子节点,用于渲染性能提升。', + description: '设置只渲染tree激活子节点,用于渲染性能提升。', docDescription: '开启后只渲染激活节点,默认关闭。', setter: { concept: 'SwitchSetter', From 6f8e626cfedf6898dccea7ced1044e1bbff6f54c Mon Sep 17 00:00:00 2001 From: changpei Date: Tue, 26 Mar 2024 16:39:17 +0800 Subject: [PATCH 05/14] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/genThemeConfig/property.json | 3 ++ scripts/genThemeConfig/result.json | 16 +++++- src/components/u-checkbox.vue/index.vue | 2 + src/components/u-checkboxes.vue/api.ts | 8 +++ src/components/u-checkboxes.vue/index.vue | 65 ++++++++++++----------- src/styles/theme.css | 1 + 6 files changed, 64 insertions(+), 31 deletions(-) diff --git a/scripts/genThemeConfig/property.json b/scripts/genThemeConfig/property.json index f36863fd7..ae336b73b 100644 --- a/scripts/genThemeConfig/property.json +++ b/scripts/genThemeConfig/property.json @@ -216,6 +216,7 @@ "--collapse-border-radius": "var(--border-radius-base)", "--collapse-item-head-color-disabled": "var(--brand-disabled-dark)", "--collapse-item-head-padding": "10px 20px 10px 40px", + "--collapse-item-head-min-height": "42px", "--collapse-item-expander-size": "42px", "--collapse-item-expander-color": "var(--color-light)", "--collapse-item-expander-color-disabled": "var(--brand-disabled-dark)", @@ -586,6 +587,7 @@ "--carousel-button-color": "rgba(255, 255, 255, 0.6)", "--carousel-button-color-hover": "white", "--carousel-button-transition": "all 0.3s", + "--carousel-transition-duration": "var(--transition-duration-slow)", "--carousel-button-background": "rgba(0, 0, 0, 0.2)", "--carousel-button-background-hover": "rgba(0, 0, 0, 0.2)", "--timepicker-input-border-color": "var(--input-border-color)", @@ -1034,6 +1036,7 @@ "--checkbox-background": "var(--brand-primary)", "--checkbox-color": "var(--background-color-default)", "--checkbox-box-shadow-focus": "var(--box-shadow-form-item-base)", + "--checkbox-label-width": "80px", "--checkbox-border-color": "var(--border-color-base)", "--checkbox-border-color-disabled": "var(--border-color-base)", "--checkbox-border-color-focus": "var(--brand-primary)", diff --git a/scripts/genThemeConfig/result.json b/scripts/genThemeConfig/result.json index efb865bd9..5f54a7bb4 100644 --- a/scripts/genThemeConfig/result.json +++ b/scripts/genThemeConfig/result.json @@ -199,6 +199,10 @@ "type": "input", "desc": "面板项折叠表头内边距,如:1px" }, + "--collapse-item-head-min-height": { + "type": "input", + "desc": "面板项折叠表头最小高度,如:1px" + }, "--collapse-item-expander-size": { "type": "input", "desc": "面板项展开箭头容器元素大小,如:1px" @@ -1304,7 +1308,11 @@ }, "--carousel-button-transition": { "type": "input", - "desc": "幻灯片左右换页按钮显现动画快慢参数,如:all 0.2s" + "desc": "幻灯片左右换页按钮鼠标悬停颜色变化动画快慢参数,如:all 0.2s" + }, + "--carousel-transition-duration": { + "type": "input", + "desc": "幻灯片切换动画快慢参数,如:0.3s" } } }, @@ -3292,6 +3300,12 @@ "group": "阴影效果", "prefix": "checkbox", "desc": "多选项按钮的阴影效果,如 2px 2px 2px 1px rgba(0, 0, 0, 0.2)" + }, + "--checkbox-label-width": { + "type": "input", + "group": "选项宽度", + "prefix": "checkbox", + "desc": "多选项按钮的宽度,如 100px" } } }, diff --git a/src/components/u-checkbox.vue/index.vue b/src/components/u-checkbox.vue/index.vue index dc66c1a04..bb7ed56c5 100644 --- a/src/components/u-checkbox.vue/index.vue +++ b/src/components/u-checkbox.vue/index.vue @@ -124,6 +124,8 @@ export default { user-select: none; cursor: var(--cursor-pointer); color: var(--checkbox-font-color); + min-width: var(--checkbox-label-width); + display: inline-block; } .root:focus { diff --git a/src/components/u-checkboxes.vue/api.ts b/src/components/u-checkboxes.vue/api.ts index 3ed816c90..8d3f89854 100644 --- a/src/components/u-checkboxes.vue/api.ts +++ b/src/components/u-checkboxes.vue/api.ts @@ -95,6 +95,14 @@ namespace nasl.ui { }) checkAllText: nasl.core.String = '全选'; + @Prop, 'checkAllWidth'>({ + group: '主要属性', + title: '全选项宽度', + description: '全选功能展示的宽度', + if: _ => _.checkAll === true, + }) + checkAllWidth: nasl.core.String = '100px'; + @Prop, 'checkAllDisplay'>({ group: '主要属性', title: '展示方式', diff --git a/src/components/u-checkboxes.vue/index.vue b/src/components/u-checkboxes.vue/index.vue index 42fdab4f7..c35e4e959 100644 --- a/src/components/u-checkboxes.vue/index.vue +++ b/src/components/u-checkboxes.vue/index.vue @@ -2,40 +2,40 @@
-
@@ -65,6 +65,7 @@ export default { checkAll: { type: Boolean, default: false }, checkAllDisplay: { type: String, default: "inline" }, checkAllText: { type: String, default: "全选" }, + checkAllWidth: { type: String, default: "100px" }, preview: { type: Boolean, default: false }, }, data() { @@ -257,7 +258,7 @@ export default { .root { } -.root > *:not(:last-child) { +.wrap > * { margin-right: var(--checkbox-space-x); } @@ -267,4 +268,8 @@ export default { justify-content: center; padding: 10px; } + +.inline { /* $style[checkAllDisplay] */ + display: flex; +} diff --git a/src/styles/theme.css b/src/styles/theme.css index b9478da7e..9d42fbc0c 100644 --- a/src/styles/theme.css +++ b/src/styles/theme.css @@ -1237,6 +1237,7 @@ --checkbox-background: var(--brand-primary); /* @type color */ /* @group 背景色 */ /* @prefix checkbox */ /* @desc 多选项按钮的背景色,如 #223325 */ --checkbox-color: var(--background-color-default); /* @type color */ /* @group 内容颜色 */ /* @prefix checkbox */ /* @desc 多选项按钮的内容颜色,如 #223325 */ --checkbox-box-shadow-focus: var(--box-shadow-form-item-base); /* @group 阴影效果 */ /* @prefix checkbox */ /* @desc 多选项按钮的阴影效果,如 2px 2px 2px 1px rgba(0, 0, 0, 0.2); */ + --checkbox-label-width: 80px; /* @group 选项宽度 */ /* @prefix checkbox */ /* @desc 多选项按钮的宽度,如 100px; */ --checkbox-border-color: var(--border-color-base); /* @hidden */ --checkbox-border-color-disabled: var(--border-color-base); /* @hidden */ From 496dbe1317a31279b245d9dc2cf4710a3026d546 Mon Sep 17 00:00:00 2001 From: changpei Date: Wed, 27 Mar 2024 16:55:51 +0800 Subject: [PATCH 06/14] =?UTF-8?q?fix:=200.20.4=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__tests__/__snapshots__/demo.test.js.snap | 303 ++++++++++-------- 1 file changed, 171 insertions(+), 132 deletions(-) diff --git a/src/components/u-checkboxes.vue/__tests__/__snapshots__/demo.test.js.snap b/src/components/u-checkboxes.vue/__tests__/__snapshots__/demo.test.js.snap index c78a7c2f1..8fe436f69 100644 --- a/src/components/u-checkboxes.vue/__tests__/__snapshots__/demo.test.js.snap +++ b/src/components/u-checkboxes.vue/__tests__/__snapshots__/demo.test.js.snap @@ -3,18 +3,22 @@ exports[`u-checkboxes.vue Demo-autofocus 1`] = `
- - - - +
+
+ + + + +
+
`; @@ -33,18 +37,22 @@ exports[`u-checkboxes.vue Demo-全选 1`] = ` 全选
- - - - +
+
+ + + + +
+
[] @@ -85,6 +93,9 @@ exports[`u-checkboxes.vue Demo-基本用法 1`] = ` exports[`u-checkboxes.vue Demo-基础用法 1`] = `
+
+
+
`; @@ -94,18 +105,22 @@ exports[`u-checkboxes.vue Demo-多选组 1`] = `
- - - - +
+
+ + + + +
+
[ "水杯", @@ -113,70 +128,82 @@ exports[`u-checkboxes.vue Demo-多选组 1`] = ` ]
- - - - +
+
+ + + + +
+
- - - - +
+
+ + + + +
+
- - - - +
+
+ + + + +
+
[]
@@ -186,18 +213,22 @@ exports[`u-checkboxes.vue Demo-多选组 1`] = ` exports[`u-checkboxes.vue Demo-多选组 2`] = `
- - - - +
+
+ + + + +
+
[ "毛巾", @@ -209,18 +240,22 @@ exports[`u-checkboxes.vue Demo-多选组 2`] = ` exports[`u-checkboxes.vue Demo-多选组 3`] = `
- - - - +
+
+ + + + +
+
毛巾,沙发
@@ -229,18 +264,22 @@ exports[`u-checkboxes.vue Demo-多选组 3`] = ` exports[`u-checkboxes.vue Demo-数量限制 1`] = `
- - - - +
+
+ + + + +
+
[ "毛巾", From 65f2ce3189e0598f9dcfe28299d82a29d7c098dc Mon Sep 17 00:00:00 2001 From: violarong Date: Fri, 29 Mar 2024 10:14:21 +0800 Subject: [PATCH 07/14] update version 0.20.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 247ae42b1..9e525be6b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cloud-ui.vusion", "description": "Vusion Cloud UI", - "version": "0.20.3", + "version": "0.20.4", "author": "Forrest ", "contributors": [ "haoxutong <1255965516@qq.com>", From f3d987717e557a9e01bb333d806dafa7ef946d18 Mon Sep 17 00:00:00 2001 From: violarong Date: Fri, 26 Apr 2024 09:13:31 +0800 Subject: [PATCH 08/14] =?UTF-8?q?feat(TableView):=20=E6=B7=BB=E5=8A=A0load?= =?UTF-8?q?To=E6=96=B9=E6=B3=95=EF=BC=8C=E5=BD=93=E5=89=8D=E9=A1=B5?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-table-view.vue/api.ts | 13 +++++++++++++ src/components/u-table-view.vue/index.vue | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/src/components/u-table-view.vue/api.ts b/src/components/u-table-view.vue/api.ts index ce590cd20..5f3d50bff 100644 --- a/src/components/u-table-view.vue/api.ts +++ b/src/components/u-table-view.vue/api.ts @@ -109,6 +109,19 @@ namespace nasl.ui { item?: object, ): void {} constructor(options?: Partial>) { super(); } + + @Method({ + title: '带页码刷新', + description: '保持页码,重新加载', + }) + loadTo( + @Param({ + title: '页数', + description: '要刷新的页数', + }) + page?: nasl.core.Integer, + ): void {} + } export class UTableViewOptions extends ViewComponentOptions { diff --git a/src/components/u-table-view.vue/index.vue b/src/components/u-table-view.vue/index.vue index 5a5debd07..495acd3b7 100644 --- a/src/components/u-table-view.vue/index.vue +++ b/src/components/u-table-view.vue/index.vue @@ -3276,6 +3276,13 @@ export default { onXScrollParentScroll(event) { this.syncHeadScroll(); }, + loadTo(page) { + if (page !== undefined) { + this.page(page); + } else { + this.load(); + } + }, }, }; From d6a8608258e380ff28a9a04d72a0ed8456332fde Mon Sep 17 00:00:00 2001 From: violarong Date: Fri, 26 Apr 2024 13:36:59 +0800 Subject: [PATCH 09/14] =?UTF-8?q?fix(TableView):=20loadTo=E6=96=B9?= =?UTF-8?q?=E6=B3=95page=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E3=80=81null=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-table-view.vue/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/u-table-view.vue/index.vue b/src/components/u-table-view.vue/index.vue index 495acd3b7..5d1dfcf04 100644 --- a/src/components/u-table-view.vue/index.vue +++ b/src/components/u-table-view.vue/index.vue @@ -3277,7 +3277,7 @@ export default { this.syncHeadScroll(); }, loadTo(page) { - if (page !== undefined) { + if (!['', null, undefined].includes(page)) { this.page(page); } else { this.load(); From f1f32e8976ce2b61d9c2761efd172593491937a6 Mon Sep 17 00:00:00 2001 From: violarong Date: Tue, 7 May 2024 17:24:04 +0800 Subject: [PATCH 10/14] =?UTF-8?q?fix(TableView):=20loadTo=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=B8=85=E7=A9=BA=E6=95=B0=E6=8D=AE&=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90=E6=98=AF=E5=8F=98=E9=87=8F=E6=97=B6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-table-view.vue/api.ts | 25 +++++----- src/components/u-table-view.vue/docs/cases.md | 49 +++++++++++++++---- src/components/u-table-view.vue/index.vue | 22 ++++++--- src/utils/DataSource/new.js | 2 +- 4 files changed, 68 insertions(+), 30 deletions(-) diff --git a/src/components/u-table-view.vue/api.ts b/src/components/u-table-view.vue/api.ts index 5f3d50bff..537ef1a67 100644 --- a/src/components/u-table-view.vue/api.ts +++ b/src/components/u-table-view.vue/api.ts @@ -49,6 +49,18 @@ namespace nasl.ui { }) reload(): void {} + @Method({ + title: '带页码刷新', + description: '保持页码,重新加载', + }) + loadTo( + @Param({ + title: '页数', + description: '要刷新的页数', + }) + page?: nasl.core.Integer, + ): void {} + @Method({ title: 'undefined', description: '获取所有表格列的 field', @@ -109,19 +121,6 @@ namespace nasl.ui { item?: object, ): void {} constructor(options?: Partial>) { super(); } - - @Method({ - title: '带页码刷新', - description: '保持页码,重新加载', - }) - loadTo( - @Param({ - title: '页数', - description: '要刷新的页数', - }) - page?: nasl.core.Integer, - ): void {} - } export class UTableViewOptions extends ViewComponentOptions { diff --git a/src/components/u-table-view.vue/docs/cases.md b/src/components/u-table-view.vue/docs/cases.md index 04b076479..673082701 100644 --- a/src/components/u-table-view.vue/docs/cases.md +++ b/src/components/u-table-view.vue/docs/cases.md @@ -2637,16 +2637,34 @@ export default { ``` vue diff --git a/src/components/u-table-view.vue/index.vue b/src/components/u-table-view.vue/index.vue index 5d1dfcf04..944cb723e 100644 --- a/src/components/u-table-view.vue/index.vue +++ b/src/components/u-table-view.vue/index.vue @@ -1446,7 +1446,7 @@ export default { && this.$refs.scrollView[2].$refs.wrap !== target && (this.$refs.scrollView[2].$refs.wrap.scrollTop = scrollTop); }, - load(more) { + load(more, paging = {}) { const dataSource = this.currentDataSource; if (!dataSource) return; @@ -1458,7 +1458,7 @@ export default { this.currentLoading = true; this.currentError = false; } - dataSource[more ? 'loadMore' : 'load']() + dataSource[more ? 'loadMore' : 'load'](paging.offset, paging.limit, paging.number) .then((data) => { // 防止同步数据使页面抖动 // setTimeout(() => this.currentData = data); @@ -1835,7 +1835,7 @@ export default { this.currentDataSource.page(paging); this.$emit('update:page-number', number, this); this.$emit('page', paging, this); - this.load(); + this.load(false, { number, limit: size }); }, onClickSort(columnVM) { let order; @@ -3277,10 +3277,20 @@ export default { this.syncHeadScroll(); }, loadTo(page) { - if (!['', null, undefined].includes(page)) { - this.page(page); + const dataSource = this.currentDataSource; + if (!(dataSource && dataSource.paging)) + return; + if (dataSource._load && typeof dataSource._load === 'function') { + dataSource.clearLocalData(); + } + let currentPage = page; + if (['', null, undefined].includes(page)) { + currentPage = dataSource.paging.number; + } + if (currentPage === dataSource.paging.number) { + this.load(false, { number: currentPage }); } else { - this.load(); + dataSource.paging.number = page; } }, }, diff --git a/src/utils/DataSource/new.js b/src/utils/DataSource/new.js index 883d8f694..f040dc86f 100644 --- a/src/utils/DataSource/new.js +++ b/src/utils/DataSource/new.js @@ -316,7 +316,7 @@ const VueDataSource = Vue.extend({ limit = this.limit; // reload 或 query变化 重置分页 - if (this.cleared || this.queryChanged) { + if ((this.cleared || this.queryChanged) && newPageNumber === undefined) { if (this.paging) { this.paging.number = 1; } From 112d096b3a1fd4f6da00b0c6d7fef3b6501a1532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E9=A3=8E?= <18012261618@126.com> Date: Tue, 11 Jun 2024 18:01:28 +0800 Subject: [PATCH 11/14] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DKeyboardEvent?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-input.vue/api.ts | 22 ++-------------------- src/components/u-number-input.vue/api.ts | 22 ++-------------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/src/components/u-input.vue/api.ts b/src/components/u-input.vue/api.ts index 04762804e..16ba3e3a6 100644 --- a/src/components/u-input.vue/api.ts +++ b/src/components/u-input.vue/api.ts @@ -324,31 +324,13 @@ namespace nasl.ui { title: '键盘按下', description: '键盘按键按下时触发', }) - onKeydown: (event: { - altKey: nasl.core.Boolean; - code: nasl.core.String; - ctrlKey: nasl.core.Boolean; - isComposing: nasl.core.Boolean; - key: nasl.core.String; - metaKey: nasl.core.Boolean; - repeat: nasl.core.Boolean; - shiftKey: nasl.core.Boolean; - }) => any; + onKeydown: (event: KeyboardEvent) => any; @Event({ title: '键盘松开', description: '键盘按键松开时触发', }) - onKeyup: (event: { - altKey: nasl.core.Boolean; - code: nasl.core.String; - ctrlKey: nasl.core.Boolean; - isComposing: nasl.core.Boolean; - key: nasl.core.String; - metaKey: nasl.core.Boolean; - repeat: nasl.core.Boolean; - shiftKey: nasl.core.Boolean; - }) => any; + onKeyup: (event: KeyboardEvent) => any; @Slot({ title: '前缀图标', diff --git a/src/components/u-number-input.vue/api.ts b/src/components/u-number-input.vue/api.ts index 26b90f04e..f17f441b0 100644 --- a/src/components/u-number-input.vue/api.ts +++ b/src/components/u-number-input.vue/api.ts @@ -292,31 +292,13 @@ namespace nasl.ui { title: '键盘按下', description: '键盘按键按下时触发', }) - onKeydown: (event: { - altKey: nasl.core.Boolean; - code: nasl.core.String; - ctrlKey: nasl.core.Boolean; - isComposing: nasl.core.Boolean; - key: nasl.core.String; - metaKey: nasl.core.Boolean; - repeat: nasl.core.Boolean; - shiftKey: nasl.core.Boolean; - }) => any; + onKeydown: (event: KeyboardEvent) => any; @Event({ title: '键盘松开', description: '键盘按键松开时触发', }) - onKeyup: (event: { - altKey: nasl.core.Boolean; - code: nasl.core.String; - ctrlKey: nasl.core.Boolean; - isComposing: nasl.core.Boolean; - key: nasl.core.String; - metaKey: nasl.core.Boolean; - repeat: nasl.core.Boolean; - shiftKey: nasl.core.Boolean; - }) => any; + onKeyup: (event: KeyboardEvent) => any; @Slot({ title: '默认', From 196aa8647d87bdb667cc95206d1571f445049fc7 Mon Sep 17 00:00:00 2001 From: wybieshang <40905133+wybieshang@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:50:25 +0800 Subject: [PATCH 12/14] Feature/sidebar collipse icon support control (#876) * feat(Sideber): collapse-support-control * feat(Sideber): collapse-support-control-api * fix(Sidebar): unable-collapse-cancel-toggle --- package.json | 4 ++-- src/components/u-sidebar.vue/api.ts | 22 ++++++++++++++++++++-- src/components/u-sidebar.vue/api.yaml | 14 ++++++++++++++ src/components/u-sidebar.vue/index.vue | 17 ++++++++++++++++- 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9e525be6b..d9309b5b6 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "deploy:doc-entry": "vusion deploy --framework cloud-ui -v minor dist-doc-entry", "usage": "node ./scripts/lcap", "deploy:dev": "node bin/deploy-lcp-tgz --platform=http://defaulttenant.lcap.codewave-dev.163yun.com && lcap deploy dist-theme --platform http://defaulttenant.lcap.codewave-dev.163yun.com && node bin/deploy-lcp-images --platform=http://defaulttenant.lcap.codewave-dev.163yun.com", - "deploy:test": "node bin/deploy-lcp-tgz --platform=http://defaulttenant.lcap.codewave-test.163yun.com/ && lcap deploy dist-theme --platform http://defaulttenant.lcap.codewave-test.163yun.com/ && node bin/deploy-lcp-images --platform=http://defaulttenant.lcap.codewave-test.163yun.com/", - "deploy:pre": "npm test && lcap deploy dist-theme --platform http://defaulttenant.lcap.hadri.163yun.com && node bin/deploy-lcp-images --platform=http://defaulttenant.lcap.hadri.163yun.com", + "deploy:test": "node bin/deploy-lcp-tgz --platform=http://defaulttenant.lcap.code.sovell.com/ && lcap deploy dist-theme --platform http://defaulttenant.lcap.code.sovell.com/ && node bin/deploy-lcp-images --platform=http://defaulttenant.lcap.code.sovell.com/", + "deploy:pre": "lcap deploy dist-theme --platform http://defaulttenant.lcap.hadri.163yun.com && node bin/deploy-lcp-images --platform=http://defaulttenant.lcap.hadri.163yun.com", "deploy:online": "npm test && lcap deploy dist-theme --platform http://netease-template.lcap.163yun.com && node bin/deploy-lcp-images --platform=http://netease-template.lcap.163yun.com", "prepublishOnly": "rm -rf node_modules/.cache && npm run build && npm run build:theme && npm run build:raw && vusion readme && vusion vetur && git add .", "postpublish": "npm run build:docs && vusion ghpages", diff --git a/src/components/u-sidebar.vue/api.ts b/src/components/u-sidebar.vue/api.ts index be4ff6090..61ce659d5 100644 --- a/src/components/u-sidebar.vue/api.ts +++ b/src/components/u-sidebar.vue/api.ts @@ -21,6 +21,13 @@ namespace nasl.ui { }) expanded: nasl.core.Boolean, ): void {} + + @Method({ + title: 'undefined', + description: '展开/折叠所有分组', + }) + toggleCollapse(): void {} + constructor(options?: Partial>) { super(); } } @@ -196,6 +203,17 @@ namespace nasl.ui { }) collapseMode: 'fold' | 'expand' = 'expand'; + @Prop, 'showCollapseIcon'>({ + group: '交互属性', + title: '是否展示伸缩图标', + description: '是否展示伸缩图标', + setter: { + concept: 'SwitchSetter', + }, + if: _ => _.enableCollapse === true, + }) + showCollapseIcon: nasl.core.Boolean = true; + @Prop, 'expandIcon'>({ group: '交互属性', title: '展开图标', @@ -203,7 +221,7 @@ namespace nasl.ui { setter: { concept: 'IconSetter', }, - if: _ => _.enableCollapse === true, + if: _ => _.enableCollapse === true && _.showCollapseIcon === true, }) expandIcon: nasl.core.String = 'expand'; @@ -214,7 +232,7 @@ namespace nasl.ui { setter: { concept: 'IconSetter', }, - if: _ => _.enableCollapse === true, + if: _ => _.enableCollapse === true && _.showCollapseIcon === true, }) foldIcon: nasl.core.String = 'fold'; diff --git a/src/components/u-sidebar.vue/api.yaml b/src/components/u-sidebar.vue/api.yaml index 4d1b0f430..421978749 100644 --- a/src/components/u-sidebar.vue/api.yaml +++ b/src/components/u-sidebar.vue/api.yaml @@ -174,6 +174,17 @@ description: 侧边栏是否折叠 dependency: - "enable-collapse": true + - name: showCollapseIcon + title: 是否展示伸缩图标 + type: boolean + default: true + description: 是否展示伸缩图标 + group: 交互属性 + dependency: + - "enable-collapse": true + brifeDoc: "" + docDescription: 是否展示伸缩图标。 + tooltipLink: "" - name: expand-icon title: 展开图标 type: icon @@ -256,6 +267,9 @@ type: USidebar description: 发送事件实例 methods: + - name: toggleCollapse + description: 展开/折叠侧边栏 + params: [] - name: toggleAll description: 展开/折叠所有分组 params: diff --git a/src/components/u-sidebar.vue/index.vue b/src/components/u-sidebar.vue/index.vue index b906a9e57..30f4ab37b 100644 --- a/src/components/u-sidebar.vue/index.vue +++ b/src/components/u-sidebar.vue/index.vue @@ -35,7 +35,7 @@ :class="$style.resizer" @mousedown="handleResizerMouseDown">
-
+
/^(expand|fold)$/.test(value) }, + showCollapseIcon: { type: Boolean, default: true }, expandIcon: { type: String, default: 'expand' }, foldIcon: { type: String, default: 'fold' }, }, @@ -184,7 +185,21 @@ export default { this.isTransitionEnd = true; }, toggleCollapse() { + if(!this.enableCollapse) return; this.currentWidth = this.currentCollapse ? null : this.minWidth; + if ( + this.currentCollapse + && this.$vnode.data + && this.$vnode.data.staticStyle + && this.$vnode.data.staticStyle.width + ) { + const cw = parseInt(this.$vnode.data.staticStyle.width); + + if (!isNaN(cw)) { + this.currentWidth = cw; + } + } + this.updateCollapse(!this.currentCollapse); this.isTransitionEnd = false; }, From af3c4931a028be726656e3f6ac9b8f4206f78391 Mon Sep 17 00:00:00 2001 From: violarong Date: Wed, 3 Jul 2024 12:40:54 +0800 Subject: [PATCH 13/14] =?UTF-8?q?fix(TableView):=20=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E4=B8=8D=E7=94=A8cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-table-view.vue/index.vue | 1 + src/utils/DataSource/new.js | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/u-table-view.vue/index.vue b/src/components/u-table-view.vue/index.vue index 4b443f3f8..60b42a20a 100644 --- a/src/components/u-table-view.vue/index.vue +++ b/src/components/u-table-view.vue/index.vue @@ -1035,6 +1035,7 @@ export default { getExtraParams: this.getExtraParams, process: this.processData, filterMultiple: this.filterMultiple, + useCache: !this.usePagination, // fix:2879747503294464 大数据分页使用cache性能问题 }; if (this.treeDisplay && this.valueField && this.parentField && this.childrenField) { diff --git a/src/utils/DataSource/new.js b/src/utils/DataSource/new.js index f040dc86f..61768a315 100644 --- a/src/utils/DataSource/new.js +++ b/src/utils/DataSource/new.js @@ -133,6 +133,7 @@ const VueDataSource = Vue.extend({ queryChanged: false, treeDisplay: false, + useCache: true, }; }, computed: { @@ -161,8 +162,10 @@ const VueDataSource = Vue.extend({ if (this.paging) { if (this.viewMode === 'more') return this.arrangedData.slice(0, this.offset + this.limit); - else - return this.arrangedData.slice(this.offset, this.offset + this.limit); + else { + const data = this.arrangedData.slice(this.offset, this.offset + this.limit); + return data.length === 0 ? this.arrangedData : data; + } } else return this.arrangedData; }, @@ -415,11 +418,15 @@ const VueDataSource = Vue.extend({ if (!this.remotePaging || limit === Infinity) { this.data = finalResult.data; } else { - for (let i = 0; i < limit; i++) { - const item = finalResult.data[i]; - if (item) { - this.data[offset + i] = item; + if (this.useCache) { + for (let i = 0; i < limit; i++) { + const item = finalResult.data[i]; + if (item) { + this.data[offset + i] = item; + } } + } else { + this.data = finalResult.data; } } From 2925ef0874e6674e55c3ae1c40fd40ca8f1b2af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E9=98=B3?= Date: Tue, 29 Oct 2024 17:26:37 +0800 Subject: [PATCH 14/14] =?UTF-8?q?fix(DatePicker):=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BA=86=E6=97=A5=E6=9C=9F=E7=9A=84=E6=9C=80=E5=B0=8F=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=97=B6=E9=97=B4=EF=BC=8C=E4=BD=86=E6=98=AF=E5=9C=A8?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4=E5=8F=AF=E4=BB=A5=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=88=B0=E6=9C=80=E5=B0=8F=E6=97=A5=E6=9C=9F=E4=B9=8B?= =?UTF-8?q?=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-date-time-picker.vue/range.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/u-date-time-picker.vue/range.vue b/src/components/u-date-time-picker.vue/range.vue index bc59c0536..162a2aff8 100644 --- a/src/components/u-date-time-picker.vue/range.vue +++ b/src/components/u-date-time-picker.vue/range.vue @@ -172,11 +172,11 @@ export default { computed: { // 基于编辑目标状态计算出来的最小值 finalMinDate() { - return this.editTarget === 'end' ? this.startDateTime : this.minDate; + return this.editTarget === 'end' ? this.startDateTime || this.minDate : this.minDate; }, // 基于编辑目标状态计算出来的最大值 finalMaxDate() { - return this.editTarget === 'start' ? this.endDateTime : this.currentMaxDate; + return this.editTarget === 'start' ? this.endDateTime || this.currentMaxDate : this.currentMaxDate; }, minCalendarDate() { return this.format(this.finalMinDate, 'YYYY-MM-DD');