From ff9f2be9e1f39236e6397b5f66050e369df9d293 Mon Sep 17 00:00:00 2001 From: wocwin Date: Mon, 22 Jul 2024 19:14:34 +0800 Subject: [PATCH 01/20] =?UTF-8?q?fix:=E8=A7=A3=E5=86=B3TButton=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=96=87=E6=A1=A3Attributes=E9=94=99=E4=B9=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/TButton/base.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/components/TButton/base.md b/docs/components/TButton/base.md index 9567ffde..647b0c3f 100644 --- a/docs/components/TButton/base.md +++ b/docs/components/TButton/base.md @@ -15,12 +15,12 @@ TButton/tip ### 2、配置参数(Attributes)继承 el-button Attributes | 参数 | 说明 | 类型 | 默认值 | -| :-------- | :----------------------------------------------------------- | :--------------------------------------------------- | :----- | --- | +| :-------- | :----------------------------------------------------------- | :--------------------------------------------------- | :----- | | size | 尺寸 | 'large' / 'default' / 'small' | - | | type | 类型 | 'default / 'primary / 'success / 'warning / 'danger' | - | | plain | 是否朴素按钮 | boolean | false | | round | 是否圆角按钮 | boolean | false | -| circle | 是否圆形按钮 | boolean | false | 无 | +| circle | 是否圆形按钮 | boolean | false | | time | 防抖的时间 | number | 1000 | | tip | 提示文字,常用于 type="text" 或拥有 text,link 属性的 button | string | - | | placement | Tooltip 组件出现的位置 | 继承 el-tooltip | top | From 376d1e3a15566706ef3497a484b456f861f56d42 Mon Sep 17 00:00:00 2001 From: wocwin Date: Mon, 22 Jul 2024 19:15:54 +0800 Subject: [PATCH 02/20] =?UTF-8?q?feat:TSelectTable=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E9=80=89=E6=A1=86=E6=96=B0=E5=A2=9Eselecttable(?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=9F=90=E4=BA=9B=E5=A4=8D=E9=80=89=E6=A1=86?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/TSelectTable/base.md | 6 ++ docs/examples/TSelectTable/selectable.vue | 93 +++++++++++++++++++++++ packages/select-table/src/index.vue | 6 +- 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 docs/examples/TSelectTable/selectable.vue diff --git a/docs/components/TSelectTable/base.md b/docs/components/TSelectTable/base.md index c3e20d4b..261f99bf 100644 --- a/docs/components/TSelectTable/base.md +++ b/docs/components/TSelectTable/base.md @@ -72,6 +72,12 @@ TSelectTable/multipleDefaultSelectVal TSelectTable/multiple ::: +### 多选--禁用复选框 + +:::demo `multiple` 开启多选;设置`selectable`属性其类型:`Function(row: any, index: number)` 可根据返回值来决定 `CheckBox` 是否可以勾选. +TSelectTable/selectable +::: + ### 开启分页功能(支持翻页选中且默认开启) :::demo `isShowPagination` 开启分页功能;`@page-change`页码改变事件;传出当前选中的页码;`table` 数据源及表头信息;`keywords` 选项中的 value(选项的值),label(选项的标签) diff --git a/docs/examples/TSelectTable/selectable.vue b/docs/examples/TSelectTable/selectable.vue new file mode 100644 index 00000000..e8c78707 --- /dev/null +++ b/docs/examples/TSelectTable/selectable.vue @@ -0,0 +1,93 @@ + + diff --git a/packages/select-table/src/index.vue b/packages/select-table/src/index.vue index ebb94c94..64871328 100644 --- a/packages/select-table/src/index.vue +++ b/packages/select-table/src/index.vue @@ -77,6 +77,7 @@ width="55" align="center" :reserve-selection="reserveSelection" + :selectable="selectable" fixed > [] - } + }, + // Function(row: any, index: number) 的返回值用来决定这一行的 CheckBox 是否可以勾选 + selectable:Function }) const selectAttr = computed(() => { return { From 64a54eb23602b5fff27accd76aa9c9393862ce80 Mon Sep 17 00:00:00 2001 From: wocwin Date: Mon, 22 Jul 2024 19:16:07 +0800 Subject: [PATCH 03/20] =?UTF-8?q?fix:TForm=E7=A4=BA=E4=BE=8B=E6=96=B0?= =?UTF-8?q?=E5=A2=9ETS=E7=B1=BB=E5=9E=8B=E6=A0=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/examples/TForm/widthSize.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/examples/TForm/widthSize.vue b/docs/examples/TForm/widthSize.vue index 78b562e5..16595a6c 100644 --- a/docs/examples/TForm/widthSize.vue +++ b/docs/examples/TForm/widthSize.vue @@ -15,7 +15,17 @@ From bcb12cf20238e6c9d0f8b946b4dadcb7658da1ec Mon Sep 17 00:00:00 2001 From: wocwin Date: Wed, 31 Jul 2024 19:13:59 +0800 Subject: [PATCH 10/20] =?UTF-8?q?docs:TForm=E8=A7=84=E5=88=99=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/TTable/base.md | 1 + docs/examples/TForm/rules.vue | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/components/TTable/base.md b/docs/components/TTable/base.md index 968bfad9..3e5440c1 100644 --- a/docs/components/TTable/base.md +++ b/docs/components/TTable/base.md @@ -333,6 +333,7 @@ TTable/expand | align | table 对齐方式 可选值`left`、`center`、`right` | String | 'center' | | isSlotToolbar | TAdaptivePage 组件是否使用了 Toolbar 插槽 | Boolean | false | | isSlotTitle | TAdaptivePage 组件是否使用了 title 插槽 | Boolean | - | +| sortable | 设置为 'custom',需要监听 Table 的 sort-change 事件 | Boolean/string | - | ### 3、events 其他事件按照 el-table 直接使用(如 sort-change 排序事件) diff --git a/docs/examples/TForm/rules.vue b/docs/examples/TForm/rules.vue index ede0e30c..44af0055 100644 --- a/docs/examples/TForm/rules.vue +++ b/docs/examples/TForm/rules.vue @@ -15,7 +15,8 @@ diff --git a/packages/table/src/ColumnSet.vue b/packages/table/src/ColumnSet.vue index 2781b8bb..4e57a115 100644 --- a/packages/table/src/ColumnSet.vue +++ b/packages/table/src/ColumnSet.vue @@ -98,6 +98,7 @@ const initColumnSet = () => { ) return columnSet } + // 抛出事件 const emits = defineEmits(["columnSetting"]) const state: any = reactive({ @@ -112,7 +113,6 @@ watch( () => state.columnSet, val => { emits("columnSetting", val) - // console.log(3333, val) localStorage.setItem( `t-ui-plus:TTable.columnSet-${props.name || props.title}`, JSON.stringify(val) @@ -120,6 +120,13 @@ watch( }, { deep: true } ) +// 重新赋值 +const reSetColumnSet = () => { + let value: any = localStorage.getItem(`t-ui-plus:TTable.columnSet-${props.name || props.title}`) + // console.log("重新赋值", JSON.parse(value)) + state.columnSet = JSON.parse(value) + emits("columnSetting", state.columnSet) +} // checkbox改变选中状态 const checkChanged = (checked: any, index: string | number) => { state.columnSet[index].hidden = !checked @@ -142,6 +149,9 @@ const checkChanged = (checked: any, index: string | number) => { }) } } +defineExpose({ + reSetColumnSet +})