fix: 替换字典数据接口

This commit is contained in:
TsMask
2023-09-06 11:33:13 +08:00
parent a07ad1ade2
commit e30d7757c4
5 changed files with 28 additions and 28 deletions

View File

@@ -21,7 +21,7 @@ export function exportData(query: Record<string, any>) {
*/
export function listData(query: Record<string, any>) {
return request({
url: '/system/dict/data/list',
url: '/dictDataManage/v1/dictDatas',
method: 'get',
params: query,
});
@@ -34,7 +34,7 @@ export function listData(query: Record<string, any>) {
*/
export function getData(dictCode: string | number) {
return request({
url: `/system/dict/data/${dictCode}`,
url: `/dictDataManage/v1/dictData/${dictCode}`,
method: 'get',
});
}
@@ -46,7 +46,7 @@ export function getData(dictCode: string | number) {
*/
export function addData(data: Record<string, any>) {
return request({
url: '/system/dict/data',
url: '/dictDataManage/v1/dictData',
method: 'post',
data: data,
});
@@ -59,7 +59,7 @@ export function addData(data: Record<string, any>) {
*/
export function updateData(data: Record<string, any>) {
return request({
url: '/system/dict/data',
url: '/dictDataManage/v1/dictData',
method: 'put',
data: data,
});
@@ -72,7 +72,7 @@ export function updateData(data: Record<string, any>) {
*/
export function delData(dictCode: string | number) {
return request({
url: `/system/dict/data/${dictCode}`,
url: `/dictDataManage/v1/dictData/${dictCode}`,
method: 'delete',
});
}
@@ -84,7 +84,7 @@ export function delData(dictCode: string | number) {
*/
export function getDictDataType(dictType: string) {
return request({
url: `/system/dict/data/type/${dictType}`,
url: `/dictDataManage/v1/dictData/type/${dictType}`,
method: 'get',
});
}

View File

@@ -21,7 +21,7 @@ export function exportType(query: Record<string, any>) {
*/
export function listType(query: Record<string, any>) {
return request({
url: '/system/dict/type/list',
url: '/dictTypegManage/v1/dictTypes',
method: 'get',
params: query,
});
@@ -34,7 +34,7 @@ export function listType(query: Record<string, any>) {
*/
export function getType(dictId: string | number) {
return request({
url: `/system/dict/type/${dictId}`,
url: `/dictTypegManage/v1/dictType/${dictId}`,
method: 'get',
});
}
@@ -46,7 +46,7 @@ export function getType(dictId: string | number) {
*/
export function addType(data: Record<string, any>) {
return request({
url: '/system/dict/type',
url: '/dictTypegManage/v1/dictType',
method: 'post',
data: data,
});
@@ -59,7 +59,7 @@ export function addType(data: Record<string, any>) {
*/
export function updateType(data: Record<string, any>) {
return request({
url: '/system/dict/type',
url: '/dictTypegManage/v1/dictType',
method: 'put',
data: data,
});
@@ -72,7 +72,7 @@ export function updateType(data: Record<string, any>) {
*/
export function delType(dictId: string | number) {
return request({
url: `/system/dict/type/${dictId}`,
url: `/dictTypegManage/v1/dictType/${dictId}`,
method: 'delete',
});
}
@@ -84,7 +84,7 @@ export function delType(dictId: string | number) {
*/
export function refreshCache() {
return request({
url: '/system/dict/type/refreshCache',
url: '/dictTypegManage/v1/dictType/refreshCache',
method: 'put',
});
}
@@ -96,7 +96,7 @@ export function refreshCache() {
*/
export function getDictOptionselect() {
return request({
url: '/system/dict/type/getDictOptionselect',
url: '/dictTypegManage/v1/dictTypes/optionselect',
method: 'get',
});
}

View File

@@ -42,7 +42,7 @@ const useDictStore = defineStore('dict', {
let disct = this.dicts.get(key);
if (disct === undefined || disct.length === 0) {
const res = await getDictDataType(key);
if (res.code === 200 && Array.isArray(res.data)) {
if (res.code === 1 && Array.isArray(res.data)) {
const dictData: DictType[] = res.data.map(d => ({
label: d.dictLabel,
value: d.dictValue,

View File

@@ -286,7 +286,7 @@ function fnModalVisibleByEdit(dictCode?: string | number) {
getData(dictCode).then(res => {
modalState.confirmLoading = false;
hide();
if (res.code === 200) {
if (res.code === 1) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = '修改字典数据';
modalState.visibleByEdit = true;
@@ -312,7 +312,7 @@ function fnModalOk() {
message.loading({ content: '请稍等...', key });
dictData
.then(res => {
if (res.code === 200) {
if (res.code === 1) {
message.success({
content: `${modalState.title}成功`,
key,
@@ -363,7 +363,7 @@ function fnRecordDelete(dictCode: string = '0') {
const key = 'delData';
message.loading({ content: '请稍等...', key });
delData(dictCode).then(res => {
if (res.code === 200) {
if (res.code === 1) {
message.success({
content: `删除成功`,
key,
@@ -391,7 +391,7 @@ function fnExportList() {
const key = 'exportData';
message.loading({ content: '请稍等...', key });
exportData(toRaw(queryParams)).then(res => {
if (res.code === 200) {
if (res.code === 1) {
message.success({
content: `已完成导出`,
key,
@@ -425,7 +425,7 @@ function fnGetList() {
if (tableState.loading) return;
tableState.loading = true;
listData(toRaw(queryParams)).then(res => {
if (res.code === 200 && Array.isArray(res.rows)) {
if (res.code === 1 && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
@@ -448,7 +448,7 @@ onMounted(() => {
}
if (resArr[1].status === 'fulfilled') {
const dicts = resArr[1].value;
if (dicts.code === 200) {
if (dicts.code === 1) {
dict.sysDictType = dicts.data;
}
}
@@ -456,7 +456,7 @@ onMounted(() => {
// 指定字典id列表数据
if (dictId && dictId !== '0') {
getType(dictId).then(res => {
if (res.code === 200 && res.data) {
if (res.code === 1 && res.data) {
queryParams.dictType = res.data.dictType;
fnGetList();
} else {

View File

@@ -237,7 +237,7 @@ function fnModalVisibleByVive(dictId: string | number) {
getType(dictId).then(res => {
modalState.confirmLoading = false;
hide();
if (res.code === 200 && res.data) {
if (res.code === 1 && res.data) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = '字典类型信息';
modalState.visibleByView = true;
@@ -263,7 +263,7 @@ function fnModalVisibleByEdit(dictId?: string | number) {
getType(dictId).then(res => {
modalState.confirmLoading = false;
hide();
if (res.code === 200 && res.data) {
if (res.code === 1 && res.data) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = '修改字典类型';
modalState.visibleByEdit = true;
@@ -289,7 +289,7 @@ function fnModalOk() {
message.loading({ content: '请稍等...', key });
dictType
.then(res => {
if (res.code === 200) {
if (res.code === 1) {
message.success({
content: `${modalState.title}成功`,
key,
@@ -340,7 +340,7 @@ function fnRecordDelete(dictId: string = '0') {
const key = 'delType';
message.loading({ content: '请稍等...', key });
delType(dictId).then(res => {
if (res.code === 200) {
if (res.code === 1) {
message.success({
content: `删除成功`,
key,
@@ -368,7 +368,7 @@ function fnExportList() {
const key = 'exportType';
message.loading({ content: '请稍等...', key });
exportType(toRaw(queryParams)).then(res => {
if (res.code === 200) {
if (res.code === 1) {
message.success({
content: `已完成导出`,
key,
@@ -398,7 +398,7 @@ function fnRefreshCache() {
const key = 'refreshCache';
message.loading({ content: '请稍等...', key });
refreshCache().then(res => {
if (res.code === 200) {
if (res.code === 1) {
message.success({
content: `刷新缓存成功`,
key,
@@ -428,7 +428,7 @@ function fnGetList() {
queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1];
listType(toRaw(queryParams)).then(res => {
if (res.code === 200 && Array.isArray(res.rows)) {
if (res.code === 1 && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];