Ai
376 Star 3.6K Fork 2.7K

唛盟开源/低代码开发平台-唛盟lcode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ColumnExpand.vue 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
Admin 提交于 2024-05-18 04:35 +08:00 . 优化
<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>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/maimengcloud/mdp-lcode-ui-web.git
git@gitee.com:maimengcloud/mdp-lcode-ui-web.git
maimengcloud
mdp-lcode-ui-web
低代码开发平台-唛盟lcode
master

搜索帮助