Commit a016dfdd authored by xioln's avatar xioln

tab切换组件

parent 6c78cb49
...@@ -5,80 +5,25 @@ export default { ...@@ -5,80 +5,25 @@ export default {
title: '高级组件配置', title: '高级组件配置',
data: [ data: [
{ {
key: 'searchAttrModel', key: 'searchParams',
title: '搜索模型', title: '搜索参数配置',
width: 1, width: 1,
component: { component: {
defaultValue: 'JobResponseInExperment', defaultValue: '{"layKey":"JobResponseInExpermentQuery","typeName":"JobResponseInExperment"}',
name: 'el-input', name: 'el-input',
type: 'textarea', type: 'textarea',
rows: '4' rows: '4'
} }
}, },
{ {
key: 'searchAttrModel', key: 'tabParams',
title: '搜索模型', title: 'TAB参数配置',
component: { width: 1,
defaultValue: 'JobResponseInExperment',
name: 'el-input'
}
},
{
key: 'searchAttrNumber',
title: '搜索编号',
component: {
defaultValue: 'JobResponseInExpermentQuery',
name: 'el-input'
}
},
{
key: 'attrTab1Name',
title: 'TAB1名称',
component: {
defaultValue: '试验',
name: 'el-input'
}
},
{
key: 'attrTab1Model',
title: 'TAB1模型',
component: {
defaultValue: 'JobResponseInExperment',
name: 'el-input'
}
},
{
key: 'attrTab1Number',
title: 'TAB1编号',
component: {
defaultValue: 'unqualified_Table',
name: 'el-input'
}
},
{
key: 'attrTab2Name',
title: 'TAB2名称',
component: {
defaultValue: '不合格品',
name: 'el-input'
}
},
{
key: 'attrTab2Model',
title: 'TAB2模型',
component: {
defaultValue: 'JobResponseInTest',
name: 'el-input'
}
},
{
key: 'attrTab2Number',
title: 'TAB2编号',
component: { component: {
defaultValue: 'unqualified_Table', defaultValue: '[{"id":1,"name":"不合格品","typeName":"JobResponseInTest","layKey":"unqualified_Table"},{"id":2,"name":"试验","typeName":"JobResponseInExperment","layKey":"unqualified_Table"}]',
name: 'el-input', name: 'el-input',
type: 'textarea', type: 'textarea',
rows: '2' rows: '4'
} }
} }
] ]
......
...@@ -14,19 +14,16 @@ ...@@ -14,19 +14,16 @@
<dee-tab <dee-tab
ref="deetab" ref="deetab"
class="dee-tab" class="dee-tab"
:tabs="tabs" :tabs="tabOptions"
@tabClick="tabClick" @tabClick="tabClick"
> >
<div slot="1"> <div v-for="(item, index) in tabOptions" :key="index" :slot="item.id">
<dee-as-com <dee-as-com
ref="deetab1" :ref="item.id"
:lay-config="tab1Options" :lay-config="{
/> typeName: item.typeName,
</div> layKey: item.layKey
<div slot="2"> }"
<dee-as-com
ref="deetab2"
:lay-config="tab2Options"
/> />
</div> </div>
</dee-tab> </dee-tab>
...@@ -49,24 +46,10 @@ export default { ...@@ -49,24 +46,10 @@ export default {
}, },
data() { data() {
return { return {
tabs: [ serchOptions: {},
{ id: '1', name: '' }, tabOptions: [],
{ id: '2', name: '' }
],
serchOptions: {
typeName: '',
layKey: ''
},
tab1Options: {
typeName: '',
layKey: ''
},
tab2Options: {
typeName: '',
layKey: ''
},
searchItems: [], searchItems: [],
currTab: 1 currTab: null
} }
}, },
computed: {}, computed: {},
...@@ -75,14 +58,14 @@ export default { ...@@ -75,14 +58,14 @@ export default {
immediate: true, immediate: true,
deep: true, deep: true,
handler(v) { handler(v) {
this.tabs[0].name = v.attrTab1Name this.$nextTick(() => {
this.tabs[1].name = v.attrTab2Name if (v.hasOwnProperty('searchParams')) {
this.serchOptions.typeName = v.searchAttrModel this.serchOptions = JSON.parse(v.searchParams)
this.serchOptions.layKey = v.searchAttrNumber }
this.tab1Options.typeName = v.attrTab1Model if (v.hasOwnProperty('tabParams')) {
this.tab1Options.layKey = v.attrTab1Number this.tabOptions = JSON.parse(v.tabParams)
this.tab2Options.typeName = v.attrTab2Model }
this.tab2Options.layKey = v.attrTab2Number })
} }
} }
}, },
...@@ -99,11 +82,7 @@ export default { ...@@ -99,11 +82,7 @@ export default {
this.searchFun() this.searchFun()
}, },
searchFun() { searchFun() {
if (this.currTab === 1) { this.$refs[this.currTab][0].$refs.asCom.getData(this.searchItems)
this.$refs.deetab1.$refs.asCom.getData(this.searchItems)
} else {
this.$refs.deetab2.$refs.asCom.getData(this.searchItems)
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment