代码拉取完成,页面将自动刷新
<template>
<section>
<el-table-column v-for="(field,idx) in formFields" :key="idx" :prop="expandFieldName+'.'+field.idCaml" :label="field.title">
<template #default="scope">
<div>{{ scope.row[expandFieldName][field.idCaml] }}</div>
</template>
</el-table-column>
</section>
</template>
<script>
/**
* 自能表单表格展示列扩展
*/
export default {
name:'ColumnExpand',
components: {
},
computed: {
},
props:{
/**
* 存储自定义表单数据的字段
*/
expandFieldName:{
type:String,
default:'extInfos'
},
expandId:{
type:String,
default:null,
},
},
watch: {
},
data() {
return {
load:{list:false},
formDef:{},
formFields:[],
}
},
methods: {
//由组件扩展添加其它的初始页面的逻辑(mounted+onOpen都会调用此函数,建议只添加公共逻辑)
initCurrData(){
this.getFormFields();
},
//获取列表 FormField 表单字段定义
getFormFields() {
if(!this.expandId){
return;
}
let params = {
formId:this.expandId
};
this.load.list=true;
this.$mdp.listFormDefCacheFirst(params).then((res) => {
var tips=res.tips;
if(tips.isOk){
this.formFields = res.data.formFields;
this.formDef=res.data.formDef
}else{
this.$message({message: tips.msg, type: 'error' });
}
this.load.list=false;
}).catch(() => {
this.load.list=false;
});
}
},
mounted() {
this.initCurrData();
}
}
</script>
<style scoped>
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。