Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TFMOM
TF-MOM-WEB
Commits
ccdfb96d
Commit
ccdfb96d
authored
Nov 03, 2023
by
xioln
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TAB切换组件
parent
47cf50cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
27 deletions
+41
-27
config.js
.../privateComponents/components/UnqualifiedSearch/config.js
+2
-2
index.vue
.../privateComponents/components/UnqualifiedSearch/index.vue
+39
-25
No files found.
applications/dee-mes/src/privateComponents/components/UnqualifiedSearch/config.js
View file @
ccdfb96d
...
@@ -9,7 +9,7 @@ export default {
...
@@ -9,7 +9,7 @@ export default {
title
:
'搜索参数配置'
,
title
:
'搜索参数配置'
,
width
:
1
,
width
:
1
,
component
:
{
component
:
{
defaultValue
:
'{"
layKey":"JobResponseInExpermentQuery","typeName":"JobResponseInExperment
"}'
,
defaultValue
:
'{"
typeName":"JobResponseInExperment","layKey":"JobResponseInExpermentQuery
"}'
,
name
:
'el-input'
,
name
:
'el-input'
,
type
:
'textarea'
,
type
:
'textarea'
,
rows
:
'4'
rows
:
'4'
...
@@ -20,7 +20,7 @@ export default {
...
@@ -20,7 +20,7 @@ export default {
title
:
'TAB参数配置'
,
title
:
'TAB参数配置'
,
width
:
1
,
width
:
1
,
component
:
{
component
:
{
defaultValue
:
'[{"
id":1,"name":"不合格品","typeName":"JobResponseInTest","layKey":"unqualified_Table"},{"id":2,
"name":"试验","typeName":"JobResponseInExperment","layKey":"unqualified_Table"}]'
,
defaultValue
:
'[{"
name":"不合格品","typeName":"JobResponseInTest","layKey":"unqualified_Table"},{
"name":"试验","typeName":"JobResponseInExperment","layKey":"unqualified_Table"}]'
,
name
:
'el-input'
,
name
:
'el-input'
,
type
:
'textarea'
,
type
:
'textarea'
,
rows
:
'4'
rows
:
'4'
...
...
applications/dee-mes/src/privateComponents/components/UnqualifiedSearch/index.vue
View file @
ccdfb96d
/**
/**
* @Description:
双
TAB切换
* @Description: TAB切换
* @author xioln
* @author xioln
* @date 2023-10-25
* @date 2023-10-25
* @FilePath: applications/dee-mes/src/privateComponents/components/UnqualifiedSearch/index.vue
* @FilePath: applications/dee-mes/src/privateComponents/components/UnqualifiedSearch/index.vue
*/
*/
<
template
>
<
template
>
<div
class=
"unqualifie-search"
>
<div
class=
"unqualifie-search"
>
<dee-as-com
<dee-as-com
ref=
"deeSearch"
:lay-config=
"serchOptions"
@
searchEvent=
"searchEvent"
/>
ref=
"deeSearch"
<el-tabs
ref=
"tabRef"
v-model=
"activeTab"
class=
"dee-tab"
type=
"card"
@
tab-click=
"tabClick"
>
:lay-config=
"serchOptions"
<el-tab-pane
v-for=
"(tab, index) in tabOptions"
:key=
"index"
:label=
"tab.name"
:name=
"index.toString()"
>
@
searchEvent=
"searchEvent"
<dee-as-com
:ref=
"'tab' + index"
:lay-config=
"getLayConfig(tab)"
/>
/>
</el-tab-pane>
<dee-tab
</el-tabs>
ref=
"deetab"
class=
"dee-tab"
:tabs=
"tabOptions"
@
tabClick=
"tabClick"
>
<div
v-for=
"(item, index) in tabOptions"
:key=
"index"
:slot=
"item.id"
>
<dee-as-com
:ref=
"item.id"
:lay-config=
"
{
typeName: item.typeName,
layKey: item.layKey
}"
/>
</div>
</dee-tab>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -49,7 +34,8 @@ export default {
...
@@ -49,7 +34,8 @@ export default {
serchOptions
:
{},
serchOptions
:
{},
tabOptions
:
[],
tabOptions
:
[],
searchItems
:
[],
searchItems
:
[],
currTab
:
null
activeTab
:
'0'
,
tableRef
:
null
}
}
},
},
computed
:
{},
computed
:
{},
...
@@ -72,20 +58,48 @@ export default {
...
@@ -72,20 +58,48 @@ export default {
created
()
{
created
()
{
// 初始化数据
// 初始化数据
},
},
mounted
()
{
// 初始化数据
},
methods
:
{
methods
:
{
getLayConfig
(
item
)
{
// 根据 item 的属性创建 lay-config 对象
return
{
typeName
:
item
.
typeName
,
layKey
:
item
.
layKey
}
},
searchEvent
(
v
)
{
searchEvent
(
v
)
{
this
.
searchItems
=
v
.
items
this
.
searchItems
=
v
.
items
this
.
searchFun
()
this
.
searchFun
()
},
},
tabClick
(
val
)
{
tabClick
(
val
)
{
this
.
currTab
=
val
.
name
this
.
tableRef
=
val
.
$children
[
0
]
this
.
searchFun
()
this
.
searchFun
()
},
},
searchFun
()
{
searchFun
()
{
this
.
$refs
[
this
.
currTab
][
0
].
$refs
.
asCom
.
getData
(
this
.
searchItems
)
if
(
this
.
tableRef
)
{
this
.
tableRef
.
$refs
.
asCom
.
getData
(
this
.
searchItems
)
}
else
{
this
.
$refs
.
tab0
[
0
].
$refs
.
asCom
.
getData
(
this
.
searchItems
)
}
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
'scss'
>
<
style
lang=
'scss'
>
.unqualifie-search
{
height
:
100%
;
.dee-tab
{
height
:
100%
;
}
.is-active
{
background-color
:
#f2f2f2
;
}
.dee-table
{
height
:
60vh
!
important
;
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment