提交 e7fac97d 编写于 作者: KK's avatar KK

多选回填值

上级 f2f71100
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<ion-list v-else-if="viewType == 'DEMOBPICKUPTREEVIEW' && !isSingleSelect"> <ion-list v-else-if="viewType == 'DEMOBPICKUPTREEVIEW' && !isSingleSelect">
<template v-for="item in valueNodes"> <template v-for="item in valueNodes">
<ion-item :key="item.id"> <ion-item :key="item.id">
<ion-checkbox color="secondary" v-if="viewType == 'DEMOBPICKUPTREEVIEW' && !isSingleSelect" :checked="item.checked" :value="item.id" slot="end" @ionChange="onChecked"></ion-checkbox> <ion-checkbox color="secondary" v-if="viewType == 'DEMOBPICKUPTREEVIEW' && !isSingleSelect" :checked="item.selected" :value="item.id" slot="end" @ionChange="onChecked"></ion-checkbox>
<ion-label>{{item.text}}</ion-label> <ion-label>{{item.text}}</ion-label>
</ion-item> </ion-item>
</template> </template>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<template v-for="item in valueNodes"> <template v-for="item in valueNodes">
<ion-item :key="item.id" @click="onSimpleSelChange(item)"> <ion-item :key="item.id" @click="onSimpleSelChange(item)">
<ion-label>{{item.text}}</ion-label> <ion-label>{{item.text}}</ion-label>
<ion-radio slot="end" :checked="item.checked" :value="item.id"></ion-radio> <ion-radio slot="end" :checked="item.selected" :value="item.id"></ion-radio>
</ion-item> </ion-item>
</template> </template>
</ion-radio-group> </ion-radio-group>
......
...@@ -184,6 +184,9 @@ import { Util } from '@ibiz-core/utils' ...@@ -184,6 +184,9 @@ import { Util } from '@ibiz-core/utils'
if(!item.leaf){ if(!item.leaf){
rootNodes.push(item); rootNodes.push(item);
}else{ }else{
if(this.selectedNodes.findIndex((temp:any)=>{return temp.srfkey == item.srfkey}) > -1){
item.selected = true;
}
valueNodes.push(item); valueNodes.push(item);
} }
}); });
...@@ -790,6 +793,17 @@ ${P.getCtrlCode(childCtrl, 'CONTROL.html').code} ...@@ -790,6 +793,17 @@ ${P.getCtrlCode(childCtrl, 'CONTROL.html').code}
}); });
this.$emit('selectchange', this.selectedNodes); this.$emit('selectchange', this.selectedNodes);
} }
/**
* 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public mounted() {
if(this.viewparams.selectedData){
this.selectedNodes = this.viewparams.selectedData;
}
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
../@MACRO/VIEW_HEADER-BASE.vue.ftl ../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#assign mounted_block>
if(this.viewparams.selectedData){
this.engine.onCtrlEvent('pickupviewpanel', 'selectionchange', this.viewparams.selectedData);
}
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl ../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册