11-wms/src/api/basicData/dataDict.js

195 lines
4.5 KiB
JavaScript

/*
* @Author: lb
* @Date: 2022-04-21 8:51:29
* @LastEditors: lb
* @LastEditTime: 2022-04-21 8:51:29
* @Description:
*/
import request from '@/utils/request'
/**
* 获取字典类型列表
* @param {object} data
* @param {number} data.current
* @param {number} data.enabled
* @param {number} data.size
* @param {string} data.typeCode
* @param {string} data.typeName
*/
export function getTypeList(data) {
return request({
url: '/basic/platform-dict/selectPlatformDictTypeListByPage',
method: 'post',
data
})
}
/**
* 根据id查询字典类型
* @param {number} id
*/
export function getTypeDetail(id) {
//
return request({
url: '/basic/platform-dict/selectDictTypeById',
method: 'post',
data: { id }
})
}
/**
* 更新字典类型
* @param {object} data
* @param {number} data.id
* @param {string} data.typeCode
* @param {string} data.typeName
* @param {string} [data.remark]
* @param {number} [data.valid]
* @param {number} [data.version]
* @param {string} [data.createTime]
* @param {number} [data.creator]
* @param {string} [data.creatorName]
* @param {string} [data.updateTime]
* @param {number} [data.updater]
* @param {string} [data.updaterName]
*/
export function updateType(data) {
return request({
url: '/basic/platform-dict/updatePlatformDictType',
method: 'post',
data
})
}
/**
* 新增字典类型
* @param {object} data
* @param {number} [data.id]
* @param {string} data.typeCode
* @param {string} data.typeName
* @param {string} [data.remark]
* @param {number} [data.valid]
* @param {number} [data.version]
* @param {string} [data.createTime]
* @param {number} [data.creator]
* @param {string} [data.creatorName]
* @param {string} [data.updateTime]
* @param {number} [data.updater]
* @param {string} [data.updaterName]
*/
export function addType(data) {
return request({
url: '/basic/platform-dict/savePlatformDictType',
method: 'post',
data
})
}
/**
* 删除字典类型单条数据
* @param {number} id
*/
export function deleteType(id) {
return request({
url: '/basic/platform-dict/deletePlatformDictType',
method: 'post',
data: { id }
})
}
/**
* 获取某个字典类型下的所有字典数据
* @param {object} data
* @param {number} data.current
* @param {number} data.size
* @param {number} data.dictTypeId
* @param {string} [data.dataCode]
* @param {string} [data.dataName]
* @param {number} [data.enabled]
*/
export function list(data) {
return request({
url: '/basic/platform-dict/selectPlatformDictDataListByPage',
method: 'post',
data
})
}
/**
* 获取某个字典类型下的某条字典数据
* @param {number} id
*/
export function detail(id) {
return request({
url: '/basic/platform-dict/selectPlatformDictDataById',
method: 'post',
data: { id }
})
}
/**
* 更新某个字典类型下的某条字典数据
* @param {object} data
* @param {number} data.id
* @param {number} data.dictTypeId
* @param {string} data.createTime
* @param {string} data.dataCode
* @param {string} data.dataName
* @param {string} data.typeCode
* @param {string} data.typeName
* @param {number} [data.valid]
* @param {string} [data.remark]
* @param {number} [data.version]
* @param {number} [data.creator]
* @param {string} [data.creatorName]
* @param {string} [data.updateTime]
* @param {number} [data.updater]
* @param {string} [data.updaterName]
*/
export function update(data) {
return request({
url: '/basic/platform-dict/updatePlatformDictData',
method: 'post',
data
})
}
/**
* 新增某个字典类型下的某条字典数据
* @param {object} data
* @param {number} data.id
* @param {number} data.dictTypeId
* @param {string} data.createTime
* @param {string} data.dataCode
* @param {string} data.dataName
* @param {string} data.typeCode
* @param {string} data.typeName
* @param {number} [data.valid]
* @param {string} [data.remark]
* @param {number} [data.version]
* @param {number} [data.creator]
* @param {string} [data.creatorName]
* @param {string} [data.updateTime]
* @param {number} [data.updater]
* @param {string} [data.updaterName]
*/
export function add(data) {
return request({
url: '/basic/platform-dict/savePlatformDictData',
method: 'post',
data
})
}
/**
* 删除某个字典类型下的某条字典数据
* @param {number} id
*/
export function del(id) {
return request({
url: '/basic/platform-dict/deletePlatformDictData',
method: 'post',
data: { id }
})
}