提交 9763b1b3 编写于 作者: zhangpingchuan's avatar zhangpingchuan

Update CONTROL.vue.ftl

上级 b2a6d697
......@@ -5,12 +5,30 @@ ${P.getPartCode(item,'FORM').code}
<script>
import { FormButtonModel,FormDetailModel,FormItemModel,FormDRUIPartModel,FormGroupPanelModel,FormIFrameModel,FormPageModel,FormPartModel,FormRowItemModel,FormTabPageModel,FormTabPanelModel,FormUserControlModel} from "@models/index.js";
export default {
name: "${ctrl.getCodeName()}${ctrl.getName()}",
props:['formData'],
data() {
return {
/**
* 激活分组
*
*/
activeGroup:[<#if ctrl.getAllPSDEFormDetails()??><#list ctrl.getAllPSDEFormDetails() as formitem><#if formitem.getDetailType() == "GROUPPANEL">"${formitem.getName()}",</#if></#list></#if>],
/**
* 激活分组
*
*/
data:this.formData,
/**
* 表单模型
*
*/
detailsModel:{
<#list ctrl.getAllPSDEFormDetails() as formdetail>
${formdetail.name}: ${P.getPartCode(formdetail, 'DETAIL_MODEL').code},
......@@ -19,6 +37,11 @@ export default {
${ctrl.name}: new FormTabPanelModel({ caption: '${ctrl.name}', detailType: 'TABPANEL', name: '${ctrl.name}', visible: true, isShowCaption: true, form: this, tabPages: [<#list ctrl.getPSDEFormPages() as formmenber><#if formmenber_index gt 0>, </#if>{ name: '${formmenber.name}', index: ${formmenber_index}, visible: <#if formmenber.getPSDEFDGroupLogic('PANELVISIBLE')??>false<#else>true</#if> }</#list>] }),
</#if>
},
/**
* 值规则
*
*/
rules:{
<#list ctrl.getAllPSDEFormDetails() as formdetail>
<#if formdetail.getDetailType?? && formdetail.getDetailType() == 'FORMITEM'>
......@@ -32,9 +55,11 @@ export default {
}
};
},
created(){
this.initForm();
},
methods: {
/**
......@@ -57,34 +82,6 @@ export default {
console.log("表单选中了"+key);
},
/**
* 表单项值变化
*
*/
formItemChange(name,value){
this.resetValidates();
this.formLogic(name,value);
},
/**
* 表单逻辑
*
*/
formLogic( name, newVal, oldVal) {
<#if P.getPartCode(item,'FORM_LOGIC').code?length gt 0>
${P.getPartCode(item,'FORM_LOGIC').code}
</#if>
<#if ctrl.getPSDEFormItems()??>
<#list ctrl.getPSDEFormItems() as formitem>
<#if formitem.getPSDEFormItemUpdate()??>
if(Object.is(name, '${formitem.name}')){
this.updateFormItems('${formitem.getPSDEFormItemUpdate().codeName}', this.data,false);
}
</#if>
</#list>
</#if>
},
/**
* 重置校验结果
*
......@@ -121,10 +118,37 @@ export default {
*/
button_click($event,caption){
this.$message.success("点击了"+caption);
}
},
/**
* 表单项值变化
*
*/
formItemChange(name,value){
this.resetValidates();
this.formLogic(name,value);
},
/**
* 表单逻辑
*
*/
formLogic( name, newVal, oldVal) {
<#if P.getPartCode(item,'FORM_LOGIC').code?length gt 0>
${P.getPartCode(item,'FORM_LOGIC').code}
</#if>
<#if ctrl.getPSDEFormItems()??>
<#list ctrl.getPSDEFormItems() as formitem>
<#if formitem.getPSDEFormItemUpdate()??>
if(Object.is(name, '${formitem.name}')){
this.updateFormItems('${formitem.getPSDEFormItemUpdate().codeName}', this.data,false);
}
</#if>
</#list>
</#if>
}
}
};
}
</script>
<style scoped>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册