You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.2 KiB

var mock=require('../../public/javascripts/mock')
module.exports= {
//**通用右键菜单接口
addContextMenu:function (router,prefix, label)
{
router.post(`/${prefix}/:y/addEmpty`, function (req, res, next) {
return res.json(mock.ok(`${label}插入第${+req.params.y + 1}空白行成功`))
})
router.post(`/${prefix}/:y/copy`, function (req, res, next) {
return res.json(mock.ok(`拷贝${+req.params.y + 1}${label}并插入到下一行成功`))
})
router.delete(`/${prefix}/:y/del`, function (req, res, next) {
return res.json(mock.ok(`删除第${+req.params.y + 1}${label}成功`))
})
router.delete(`/${prefix}/:y/clean`, function (req, res, next) {
return res.json(mock.ok(`清空第${+req.params.y + 1}${label}成功`))
})
router.patch(`/${prefix}/:y/up`, function (req, res, next) {
return res.json(mock.ok(`${label}${+req.params.y + 1}行跟第${+req.params.y}行交换位置`))
})
router.patch(`/${prefix}/:y/down`, function (req, res, next) {
return res.json(mock.ok(`${label}${+req.params.y + 1}行跟第${+req.params.y + 2}行交换位置`))
})
}
}