11-wms/src/api/basicData/GroupModule/major.js

93 lines
1.5 KiB
JavaScript

/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: lb
* @LastEditTime: 2022-04-26 16:38:42
* @Description:
*/
import request from '@/utils/request'
/**
* 获取分页专业列表
* @param {object} data
* @param {number} data.current
* @param {number} data.size
* @param {number} [data.enabled]
* @param {string} [data.name]
*/
export function list(data) {
return request({
url: '/basic/major/page',
method: 'post',
data
})
}
/**
* 获取专业
* @param {number} id
*/
export function detail(id) {
return request({
url: '/basic/major/get',
method: 'post',
data: { id }
})
}
/**
* 更新专业
* @param {object} data
* @param {number} data.id
* @param {string} data.code
* @param {string} data.name
* @param {string} [data.abbreviation]
* @param {string} [data.description]
*/
export function update(data) {
return request({
url: '/basic/major/update',
method: 'post',
data
})
}
/**
* 新增专业
* @param {object} data
* @param {number} [data.id]
* @param {string} data.code
* @param {string} data.name
* @param {string} [data.abbreviation]
* @param {string} [data.description]
*/
export function add(data) {
return request({
url: '/basic/major/add',
method: 'post',
data
})
}
/**
* 获取code
*/
export function getCode() {
return request({
url: '/basic/major/get-code',
method: 'post'
})
}
/**
* 删除专业
* @param {number} id
*/
export function del(id) {
return request({
url: '/basic/major/delete',
method: 'post',
data: { id }
})
}