Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
Support
提交反馈
登录
切换导航
E
el-components
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
吴上海
el-components
提交
271c6e95
提交
271c6e95
编写于
3月 11, 2022
作者:
吴上海
🤡
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
15a7f651
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
38 行增加
和
26 行删除
+38
-26
ElSearch.vue
src/components/table/components/ElSearch.vue
+34
-22
ElTools.vue
src/components/table/components/ElTools.vue
+2
-2
index.vue
src/components/table/index.vue
+2
-2
未找到文件。
src/components/table/components/ElSearch.vue
浏览文件 @
271c6e95
<
script
setup
>
<
script
setup
>
import
{
resolveComponent
,
h
}
from
'
vue
'
import
{
resolveComponent
,
h
,
reactive
,
ref
}
from
'
vue
'
const
ElForm
=
resolveComponent
(
'
ElForm
'
)
const
ElForm
=
resolveComponent
(
'
ElForm
'
)
const
ElFormItem
=
resolveComponent
(
'
ElFormItem
'
)
const
ElFormItem
=
resolveComponent
(
'
ElFormItem
'
)
const
ElInput
=
resolveComponent
(
'
ElInput
'
)
const
ElButton
=
resolveComponent
(
'
ElButton
'
)
const
props
=
defineProps
({
const
props
=
defineProps
({
schema
:
Object
,
schema
:
Object
,
})
})
const
emit
=
defineEmits
([
'
click
'
])
const
emit
=
defineEmits
([
'
event
'
])
const
{
const
{
table
:
{
column
},
table
:
{
column
},
search
,
search
,
}
=
props
.
schema
}
=
props
.
schema
const
list
=
[...
search
,
...
column
.
filter
((
item
)
=>
item
.
search
)]
let
formAttrs
=
{}
search
.
forEach
((
item
)
=>
{
if
(
item
.
prop
)
formAttrs
[
item
.
prop
]
=
''
})
let
form
=
reactive
(
formAttrs
)
const
components
=
search
.
map
((
item
)
=>
{
return
h
(
ElFormItem
,
item
,
()
=>
{
return
h
(
resolveComponent
(
item
.
typedef
),
{
...
item
,
modelValue
:
form
[
item
.
prop
],
onInput
:
function
(
value
)
{
if
(
item
.
typedef
===
'
ElInput
'
)
form
[
item
.
prop
]
=
value
},
// onChange: function (value) {
// form[item.prop] = value
// },
onClick
:
function
()
{
if
(
item
.
typedef
===
'
ElButton
'
)
emit
(
'
event
'
,
{
handle
:
item
.
handle
,
})
},
},
()
=>
(
item
.
typedef
===
'
ElButton
'
?
item
.
label
:
''
)
)
})
})
const
render
=
()
=>
{
const
render
=
()
=>
{
return
h
(
return
h
(
...
@@ -21,23 +49,7 @@
...
@@ -21,23 +49,7 @@
{
{
inline
:
true
,
inline
:
true
,
},
},
()
=>
[
()
=>
components
...
list
.
map
((
item
)
=>
h
(
ElFormItem
,
item
,
()
=>
h
(
ElInput
,
item
))),
h
(
ElFormItem
,
null
,
()
=>
h
(
ElButton
,
{
type
:
'
primary
'
,
onClick
()
{
emit
(
'
click
'
,
{
handle
:
item
.
handle
,
})
},
},
()
=>
'
查询
'
)
),
]
)
)
}
}
</
script
>
</
script
>
...
...
src/components/table/components/ElTools.vue
浏览文件 @
271c6e95
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
})
})
const
{
tools
}
=
props
.
schema
const
{
tools
}
=
props
.
schema
const
emit
=
defineEmits
([
'
click
'
])
const
emit
=
defineEmits
([
'
event
'
])
const
render
=
()
=>
{
const
render
=
()
=>
{
return
h
(
return
h
(
'
div
'
,
'
div
'
,
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
{
{
...
item
,
...
item
,
onClick
()
{
onClick
()
{
emit
(
'
click
'
,
{
emit
(
'
event
'
,
{
handle
:
item
.
handle
,
handle
:
item
.
handle
,
})
})
},
},
...
...
src/components/table/index.vue
浏览文件 @
271c6e95
<
template
>
<
template
>
<ElSearch
:schema=
"schema"
/>
<ElSearch
:schema=
"schema"
@
event=
"handles"
/>
<ElTools
:schema=
"schema"
@
click
=
"handles"
/>
<ElTools
:schema=
"schema"
@
event
=
"handles"
/>
<ElTable
:schema=
"schema"
:data=
"data"
/>
<ElTable
:schema=
"schema"
:data=
"data"
/>
</
template
>
</
template
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录