增加通用右键菜单路由

master
pan 4 years ago
parent 049aa1e894
commit d69ccb34ae
  1. 6
      public/javascripts/route.js

@ -1,4 +1,6 @@
var mock=require('../../public/javascripts/mock') var mock=require('../../public/javascripts/mock')
const multipart = require("connect-multiparty");
var multipartMiddleware = multipart();
module.exports= { module.exports= {
//**通用右键菜单接口 //**通用右键菜单接口
addContextMenu:function (router,prefix, label) addContextMenu:function (router,prefix, label)
@ -26,6 +28,10 @@ module.exports= {
router.patch(`/${prefix}/:y/down`, function (req, res, next) { router.patch(`/${prefix}/:y/down`, function (req, res, next) {
return res.json(mock.ok(`${label}${+req.params.y + 1}行跟第${+req.params.y + 2}行交换位置`)) return res.json(mock.ok(`${label}${+req.params.y + 1}行跟第${+req.params.y + 2}行交换位置`))
}) })
router.put(`/${prefix}/:y/:column`, multipartMiddleware,function (req, res, next) {
return res.json(mock.ok(`${label}${+req.params.y + 1}${label}:列${req.params.column}更新值:${req.body.value}成功`))
})
} }
} }

Loading…
Cancel
Save