完成字典、字典类型管理相关

This commit is contained in:
橙子
2023-02-05 15:17:11 +08:00
parent b01d242cbc
commit 95484877a3
51 changed files with 1388 additions and 76 deletions

View File

@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询字典数据列表
export function listData(query) {
return request({
url: '/dictionaryInfo/pageList',
url: '/dictionary',
method: 'get',
params: query
})
@@ -12,7 +12,7 @@ export function listData(query) {
// 查询字典数据详细
export function getData(dictCode) {
return request({
url: '/dictionaryInfo/getById/' + dictCode,
url: '/dictionary/' + dictCode,
method: 'get'
})
}
@@ -20,7 +20,7 @@ export function getData(dictCode) {
// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
return request({
url: '/dictionaryInfo/GetListByType/' + dictType,
url: '/dictionary/dic-type/' + dictType,
method: 'get'
})
}
@@ -28,7 +28,7 @@ export function getDicts(dictType) {
// 新增字典数据
export function addData(data) {
return request({
url: '/dictionaryInfo/add',
url: '/dictionary',
method: 'post',
data: data
})
@@ -37,7 +37,7 @@ export function addData(data) {
// 修改字典数据
export function updateData(data) {
return request({
url: '/dictionaryInfo/update',
url: `/dictionary/${data.id}`,
method: 'put',
data: data
})
@@ -45,14 +45,9 @@ export function updateData(data) {
// 删除字典数据
export function delData(dictCode) {
if("string"==typeof(dictCode))
{
dictCode=[dictCode];
}
console.log(dictCode,"dictCode")
return request({
url: '/dictionaryInfo/delList',
method: 'delete',
data:dictCode
url: `/dictionary/${dictCode}`,
method: 'delete'
})
}

View File

@@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询字典类型列表
export function listType(query) {
return request({
url: '/dictionary/pageList',
url: '/dictionary-type',
method: 'get',
params: query
})
@@ -12,7 +12,7 @@ export function listType(query) {
// 查询字典类型详细
export function getType(dictId) {
return request({
url: '/dictionary/getById/' + dictId,
url: '/dictionary-type/' + dictId,
method: 'get'
})
}
@@ -20,7 +20,7 @@ export function getType(dictId) {
// 新增字典类型
export function addType(data) {
return request({
url: '/dictionary/add',
url: '/dictionary-type',
method: 'post',
data: data
})
@@ -29,7 +29,7 @@ export function addType(data) {
// 修改字典类型
export function updateType(data) {
return request({
url: '/dictionary/update',
url: `/dictionary-type/${data.id}`,
method: 'put',
data: data
})
@@ -37,14 +37,9 @@ export function updateType(data) {
// 删除字典类型
export function delType(dictId) {
if("string"==typeof(dictId))
{
dictId=[dictId];
}
return request({
url: '/dictionary/delList',
url: `/dictionary-type/${dictId}`,
method: 'delete',
data:dictId
})
}
@@ -59,7 +54,7 @@ export function refreshCache() {
// 获取字典选择框列表
export function optionselect() {
return request({
url: '/dictionary/getList',
url: '/dictionary-type',
method: 'get'
})
}