[JavaScript] 纯文本查看 复制代码
let new_form = [
{
type: 'textarea',
name: 'new_title',
title: '标题',
isMust: true,
},
{
type: 'picker',
name: 'new_indexUrgency',
title: '紧急程度',
range: ['一般', '急', '特急'],
value: 0,
},
{
type: 'picker',
name: 'new_indexDemandType',
title: '业务需求',
range: ['新建', '迁移'],
value: 0,
},
{
type: 'textarea',
name: 'new_oldSite',
title: '旧站点名',
},
{
type: 'textarea',
name: 'new_site',
title: '站点名',
isMust: true,
},
{
type: 'multiPicker',
name: 'new_indexSubDistrict',
title: '站点区域',
range: [
['茂南', '电白', '高州', '化州', '信宜'],
['城南街道', '红旗街道', '河西街道', '河东街道'],
],
value: [0, 0],
},
{
type: 'time',
mode: 'dateTime',
name: 'new_completionLimit',
title: '完成时限',
},
{
type: 'input',
name: 'new_regionHead',
title: '区域负责人',
},
];
let item = 'new_form[5]'; //传递的变量 e.currentTarget.dataset
let range = [];
for (let i = 0; i < new_form.length; i++) {
if (`new_form[${i}]` === item) {
range = new_form[i].range;
}
}
console.log(range);