01 cell-list的基本使用
001基本样式
// 因为要显示多个联系人所以外面定义一个div然后遍历生成的手机联系人和手机号码拼接的字符串的数组
data() {
this.aesDt=aesDt;
return {
form: {
enterName: '', // 企业名字
industryType: '', // 行业类型
enterId: '', // 企业统一社会信用代码
area: '', // 区域
level: '', // 企业层级
groupName: '', // 专项小组
enterpriseAbstract: '', // 企业简介
address: '', // 地址
streetName: '', // 街道
leadDept: '', // 牵头单位
xlEnterpriseListDto: [ // 联系人
{
contactId: '', // 联系人主键
contactName: '', // 联系人姓名
contactMobile: '', // 联系人电话
}
],
},
contact1:[]
};
},
// 通过Id获取数据
getDetails(enterId) {
serviceApi
.getEnterById({ enterId })
.then((res) => {
console.log(res);
if (res.code == 200) {
// 解密联系人手机号
res.result.contact.forEach((item) => {
item.contactMobile && (item.contactMobile = aesDt(item.contactMobile));
});
this.form = res.result;cell-list标签里面只能:content='item'填写一个值,所以要把用户名和手机号码拼接字符串然后显示到content里面
// 因为
this.contact1 = res.result.contact.map(item => {
return item.contactName+','+parseInt(item.contactMobile,16)
})
}
})
.catch((err) => {
console.log("err", err);
});
},