mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
37 lines
696 B
JavaScript
37 lines
696 B
JavaScript
|
|
||
|
|
||
|
module.exports = function(req, res) {
|
||
|
const level = parseInt(req.query.level, 10) || 0;
|
||
|
const maxLevel = parseInt(req.query.maxLevel, 10) || 0;
|
||
|
if (level >= maxLevel) {
|
||
|
res.json({
|
||
|
status: 0,
|
||
|
data: null
|
||
|
})
|
||
|
} else {
|
||
|
res.json({
|
||
|
status: 0,
|
||
|
data: [
|
||
|
{
|
||
|
label: `A ${level}`,
|
||
|
value: 'a'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
label: `B ${level}`,
|
||
|
value: 'b'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
label: `C ${level}`,
|
||
|
value: 'c'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
label: `D ${level}`,
|
||
|
value: 'd'
|
||
|
}
|
||
|
]
|
||
|
})
|
||
|
}
|
||
|
}
|