Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_54851307
vue-vben-admin
提交
e08a155c
V
vue-vben-admin
项目概览
weixin_54851307
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e08a155c
编写于
10月 20, 2022
作者:
W
Wit〆苗大
提交者:
GitHub
10月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(EditableCell): table 可编辑单元格和可编辑行 增加 单选框相关组件, 并增加示例 (#2294)
Co-authored-by:
N
苗大
<
caoshengmiao@hypergryph.com
>
上级
c37a15fe
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
117 addition
and
5 deletion
+117
-5
mock/demo/table-demo.ts
mock/demo/table-demo.ts
+3
-0
src/components/Table/src/componentMap.ts
src/components/Table/src/componentMap.ts
+5
-1
src/components/Table/src/components/editable/EditableCell.vue
...components/Table/src/components/editable/EditableCell.vue
+2
-2
src/components/Table/src/types/componentType.ts
src/components/Table/src/types/componentType.ts
+4
-1
src/views/demo/table/EditCellTable.vue
src/views/demo/table/EditCellTable.vue
+52
-1
src/views/demo/table/EditRowTable.vue
src/views/demo/table/EditRowTable.vue
+51
-0
未找到文件。
mock/demo/table-demo.ts
浏览文件 @
e08a155c
...
...
@@ -27,6 +27,9 @@ const demoList = (() => {
name6
:
'
@cname()
'
,
name7
:
'
@cname()
'
,
name8
:
'
@cname()
'
,
radio1
:
`选项
${
index
+
1
}
`
,
radio2
:
`选项
${
index
+
1
}
`
,
radio3
:
`选项
${
index
+
1
}
`
,
avatar
:
Random
.
image
(
'
400x400
'
,
Random
.
color
(),
Random
.
color
(),
Random
.
first
()),
imgArr
:
getRandomPics
(
Math
.
ceil
(
Math
.
random
()
*
3
)
+
1
),
imgs
:
getRandomPics
(
Math
.
ceil
(
Math
.
random
()
*
3
)
+
1
),
...
...
src/components/Table/src/componentMap.ts
浏览文件 @
e08a155c
...
...
@@ -8,9 +8,10 @@ import {
DatePicker
,
TimePicker
,
AutoComplete
,
Radio
,
}
from
'
ant-design-vue
'
;
import
type
{
ComponentType
}
from
'
./types/componentType
'
;
import
{
ApiSelect
,
ApiTreeSelect
}
from
'
/@/components/Form
'
;
import
{
ApiSelect
,
ApiTreeSelect
,
RadioButtonGroup
,
ApiRadioGroup
}
from
'
/@/components/Form
'
;
const
componentMap
=
new
Map
<
ComponentType
,
Component
>
();
...
...
@@ -24,6 +25,9 @@ componentMap.set('Switch', Switch);
componentMap
.
set
(
'
Checkbox
'
,
Checkbox
);
componentMap
.
set
(
'
DatePicker
'
,
DatePicker
);
componentMap
.
set
(
'
TimePicker
'
,
TimePicker
);
componentMap
.
set
(
'
RadioGroup
'
,
Radio
.
Group
);
componentMap
.
set
(
'
RadioButtonGroup
'
,
RadioButtonGroup
);
componentMap
.
set
(
'
ApiRadioGroup
'
,
ApiRadioGroup
);
export
function
add
(
compName
:
ComponentType
,
component
:
Component
)
{
componentMap
.
set
(
compName
,
component
);
...
...
src/components/Table/src/components/editable/EditableCell.vue
浏览文件 @
e08a155c
...
...
@@ -14,7 +14,7 @@
import
{
propTypes
}
from
'
/@/utils/propTypes
'
;
import
{
isArray
,
isBoolean
,
isFunction
,
isNumber
,
isString
}
from
'
/@/utils/is
'
;
import
{
createPlaceholderMessage
}
from
'
./helper
'
;
import
{
omit
,
pick
,
set
}
from
'
lodash-es
'
;
import
{
pick
,
set
}
from
'
lodash-es
'
;
import
{
treeToList
}
from
'
/@/utils/helper/treeHelper
'
;
import
{
Spin
}
from
'
ant-design-vue
'
;
...
...
@@ -122,7 +122,7 @@
}
const
component
=
unref
(
getComponent
);
if
(
!
component
.
includes
(
'
Select
'
))
{
if
(
!
component
.
includes
(
'
Select
'
)
&&
!
component
.
includes
(
'
Radio
'
)
)
{
return
value
;
}
...
...
src/components/Table/src/types/componentType.ts
浏览文件 @
e08a155c
...
...
@@ -8,4 +8,7 @@ export type ComponentType =
|
'
Checkbox
'
|
'
Switch
'
|
'
DatePicker
'
|
'
TimePicker
'
;
|
'
TimePicker
'
|
'
RadioGroup
'
|
'
RadioButtonGroup
'
|
'
ApiRadioGroup
'
;
src/views/demo/table/EditCellTable.vue
浏览文件 @
e08a155c
...
...
@@ -105,7 +105,7 @@
},
{
title
:
'
远程下拉树
'
,
dataIndex
:
'
name
71
'
,
dataIndex
:
'
name
8
'
,
edit
:
true
,
editComponent
:
'
ApiTreeSelect
'
,
editRule
:
false
,
...
...
@@ -157,6 +157,57 @@
},
width
:
200
,
},
{
title
:
'
单选框
'
,
dataIndex
:
'
radio1
'
,
edit
:
true
,
editComponent
:
'
RadioGroup
'
,
editComponentProps
:
{
options
:
[
{
label
:
'
选项1
'
,
value
:
'
1
'
,
},
{
label
:
'
选项2
'
,
value
:
'
2
'
,
},
],
},
width
:
200
,
},
{
title
:
'
单选按钮框
'
,
dataIndex
:
'
radio2
'
,
edit
:
true
,
editComponent
:
'
RadioButtonGroup
'
,
editComponentProps
:
{
options
:
[
{
label
:
'
选项1
'
,
value
:
'
1
'
,
},
{
label
:
'
选项2
'
,
value
:
'
2
'
,
},
],
},
width
:
200
,
},
{
title
:
'
远程单选框
'
,
dataIndex
:
'
radio3
'
,
edit
:
true
,
editComponent
:
'
ApiRadioGroup
'
,
editComponentProps
:
{
api
:
optionsListApi
,
resultField
:
'
list
'
,
labelField
:
'
name
'
,
valueField
:
'
id
'
,
},
width
:
200
,
},
];
export
default
defineComponent
({
components
:
{
BasicTable
},
...
...
src/views/demo/table/EditRowTable.vue
浏览文件 @
e08a155c
...
...
@@ -162,6 +162,57 @@
},
width
:
100
,
},
{
title
:
'
单选框
'
,
dataIndex
:
'
radio1
'
,
editRow
:
true
,
editComponent
:
'
RadioGroup
'
,
editComponentProps
:
{
options
:
[
{
label
:
'
选项1
'
,
value
:
'
1
'
,
},
{
label
:
'
选项2
'
,
value
:
'
2
'
,
},
],
},
width
:
200
,
},
{
title
:
'
单选按钮框
'
,
dataIndex
:
'
radio2
'
,
editRow
:
true
,
editComponent
:
'
RadioButtonGroup
'
,
editComponentProps
:
{
options
:
[
{
label
:
'
选项1
'
,
value
:
'
1
'
,
},
{
label
:
'
选项2
'
,
value
:
'
2
'
,
},
],
},
width
:
200
,
},
{
title
:
'
远程单选框
'
,
dataIndex
:
'
radio3
'
,
editRow
:
true
,
editComponent
:
'
ApiRadioGroup
'
,
editComponentProps
:
{
api
:
optionsListApi
,
resultField
:
'
list
'
,
labelField
:
'
name
'
,
valueField
:
'
id
'
,
},
width
:
200
,
},
];
export
default
defineComponent
({
components
:
{
BasicTable
,
TableAction
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录