123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import axios from '@/axios/http';
- const URL = {
- curdDept: 'dept/', //部门增删查改
- }
- /**
- * 得到树
- * @param {Object} params {parent_id:父级节点id(可空,空则返回顶级树)}
- */
- export function getNode(params) {
- return axios({
- url: URL.curdDept,
- method: 'get',
- params
- })
- }
- /**
- * 新增叶子
- * 如果父级id空,则创建为顶级树
- * @param {Object} data {name:名字,parent_id:父级id(可空)}
- */
- export function addNode(data) {
- return axios({
- url: URL.curdDept,
- method: 'post',
- data
- })
- }
- /**
- * 删除节点
- * @param {Object} data {id:节点id}
- */
- export function delNode(data) {
- return axios({
- url: URL.curdDept,
- method: 'delete',
- data
- })
- }
- /**
- * 更新节点
- * @param {Object} data {id:节点id,name:节点名字,parent_id:父级id(可空)}
- */
- export function putNode(data) {
- return axios({
- url: URL.curdDept,
- method: 'put',
- data
- })
- }
|