fix: 替换字典数据接口
This commit is contained in:
@@ -21,7 +21,7 @@ export function exportData(query: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function listData(query: Record<string, any>) {
|
export function listData(query: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/list',
|
url: '/dictDataManage/v1/dictDatas',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -34,7 +34,7 @@ export function listData(query: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function getData(dictCode: string | number) {
|
export function getData(dictCode: string | number) {
|
||||||
return request({
|
return request({
|
||||||
url: `/system/dict/data/${dictCode}`,
|
url: `/dictDataManage/v1/dictData/${dictCode}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ export function getData(dictCode: string | number) {
|
|||||||
*/
|
*/
|
||||||
export function addData(data: Record<string, any>) {
|
export function addData(data: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data',
|
url: '/dictDataManage/v1/dictData',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
@@ -59,7 +59,7 @@ export function addData(data: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function updateData(data: Record<string, any>) {
|
export function updateData(data: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data',
|
url: '/dictDataManage/v1/dictData',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
@@ -72,7 +72,7 @@ export function updateData(data: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function delData(dictCode: string | number) {
|
export function delData(dictCode: string | number) {
|
||||||
return request({
|
return request({
|
||||||
url: `/system/dict/data/${dictCode}`,
|
url: `/dictDataManage/v1/dictData/${dictCode}`,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ export function delData(dictCode: string | number) {
|
|||||||
*/
|
*/
|
||||||
export function getDictDataType(dictType: string) {
|
export function getDictDataType(dictType: string) {
|
||||||
return request({
|
return request({
|
||||||
url: `/system/dict/data/type/${dictType}`,
|
url: `/dictDataManage/v1/dictData/type/${dictType}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function exportType(query: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function listType(query: Record<string, any>) {
|
export function listType(query: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type/list',
|
url: '/dictTypegManage/v1/dictTypes',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -34,7 +34,7 @@ export function listType(query: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function getType(dictId: string | number) {
|
export function getType(dictId: string | number) {
|
||||||
return request({
|
return request({
|
||||||
url: `/system/dict/type/${dictId}`,
|
url: `/dictTypegManage/v1/dictType/${dictId}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ export function getType(dictId: string | number) {
|
|||||||
*/
|
*/
|
||||||
export function addType(data: Record<string, any>) {
|
export function addType(data: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type',
|
url: '/dictTypegManage/v1/dictType',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
@@ -59,7 +59,7 @@ export function addType(data: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function updateType(data: Record<string, any>) {
|
export function updateType(data: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type',
|
url: '/dictTypegManage/v1/dictType',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
@@ -72,7 +72,7 @@ export function updateType(data: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function delType(dictId: string | number) {
|
export function delType(dictId: string | number) {
|
||||||
return request({
|
return request({
|
||||||
url: `/system/dict/type/${dictId}`,
|
url: `/dictTypegManage/v1/dictType/${dictId}`,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ export function delType(dictId: string | number) {
|
|||||||
*/
|
*/
|
||||||
export function refreshCache() {
|
export function refreshCache() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type/refreshCache',
|
url: '/dictTypegManage/v1/dictType/refreshCache',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ export function refreshCache() {
|
|||||||
*/
|
*/
|
||||||
export function getDictOptionselect() {
|
export function getDictOptionselect() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type/getDictOptionselect',
|
url: '/dictTypegManage/v1/dictTypes/optionselect',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const useDictStore = defineStore('dict', {
|
|||||||
let disct = this.dicts.get(key);
|
let disct = this.dicts.get(key);
|
||||||
if (disct === undefined || disct.length === 0) {
|
if (disct === undefined || disct.length === 0) {
|
||||||
const res = await getDictDataType(key);
|
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 => ({
|
const dictData: DictType[] = res.data.map(d => ({
|
||||||
label: d.dictLabel,
|
label: d.dictLabel,
|
||||||
value: d.dictValue,
|
value: d.dictValue,
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ function fnModalVisibleByEdit(dictCode?: string | number) {
|
|||||||
getData(dictCode).then(res => {
|
getData(dictCode).then(res => {
|
||||||
modalState.confirmLoading = false;
|
modalState.confirmLoading = false;
|
||||||
hide();
|
hide();
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
modalState.from = Object.assign(modalState.from, res.data);
|
modalState.from = Object.assign(modalState.from, res.data);
|
||||||
modalState.title = '修改字典数据';
|
modalState.title = '修改字典数据';
|
||||||
modalState.visibleByEdit = true;
|
modalState.visibleByEdit = true;
|
||||||
@@ -312,7 +312,7 @@ function fnModalOk() {
|
|||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
dictData
|
dictData
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `${modalState.title}成功`,
|
content: `${modalState.title}成功`,
|
||||||
key,
|
key,
|
||||||
@@ -363,7 +363,7 @@ function fnRecordDelete(dictCode: string = '0') {
|
|||||||
const key = 'delData';
|
const key = 'delData';
|
||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
delData(dictCode).then(res => {
|
delData(dictCode).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `删除成功`,
|
content: `删除成功`,
|
||||||
key,
|
key,
|
||||||
@@ -391,7 +391,7 @@ function fnExportList() {
|
|||||||
const key = 'exportData';
|
const key = 'exportData';
|
||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
exportData(toRaw(queryParams)).then(res => {
|
exportData(toRaw(queryParams)).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `已完成导出`,
|
content: `已完成导出`,
|
||||||
key,
|
key,
|
||||||
@@ -425,7 +425,7 @@ function fnGetList() {
|
|||||||
if (tableState.loading) return;
|
if (tableState.loading) return;
|
||||||
tableState.loading = true;
|
tableState.loading = true;
|
||||||
listData(toRaw(queryParams)).then(res => {
|
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) {
|
if (tableState.selectedRowKeys.length > 0) {
|
||||||
tableState.selectedRowKeys = [];
|
tableState.selectedRowKeys = [];
|
||||||
@@ -448,7 +448,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
if (resArr[1].status === 'fulfilled') {
|
if (resArr[1].status === 'fulfilled') {
|
||||||
const dicts = resArr[1].value;
|
const dicts = resArr[1].value;
|
||||||
if (dicts.code === 200) {
|
if (dicts.code === 1) {
|
||||||
dict.sysDictType = dicts.data;
|
dict.sysDictType = dicts.data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -456,7 +456,7 @@ onMounted(() => {
|
|||||||
// 指定字典id列表数据
|
// 指定字典id列表数据
|
||||||
if (dictId && dictId !== '0') {
|
if (dictId && dictId !== '0') {
|
||||||
getType(dictId).then(res => {
|
getType(dictId).then(res => {
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 1 && res.data) {
|
||||||
queryParams.dictType = res.data.dictType;
|
queryParams.dictType = res.data.dictType;
|
||||||
fnGetList();
|
fnGetList();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ function fnModalVisibleByVive(dictId: string | number) {
|
|||||||
getType(dictId).then(res => {
|
getType(dictId).then(res => {
|
||||||
modalState.confirmLoading = false;
|
modalState.confirmLoading = false;
|
||||||
hide();
|
hide();
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 1 && res.data) {
|
||||||
modalState.from = Object.assign(modalState.from, res.data);
|
modalState.from = Object.assign(modalState.from, res.data);
|
||||||
modalState.title = '字典类型信息';
|
modalState.title = '字典类型信息';
|
||||||
modalState.visibleByView = true;
|
modalState.visibleByView = true;
|
||||||
@@ -263,7 +263,7 @@ function fnModalVisibleByEdit(dictId?: string | number) {
|
|||||||
getType(dictId).then(res => {
|
getType(dictId).then(res => {
|
||||||
modalState.confirmLoading = false;
|
modalState.confirmLoading = false;
|
||||||
hide();
|
hide();
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 1 && res.data) {
|
||||||
modalState.from = Object.assign(modalState.from, res.data);
|
modalState.from = Object.assign(modalState.from, res.data);
|
||||||
modalState.title = '修改字典类型';
|
modalState.title = '修改字典类型';
|
||||||
modalState.visibleByEdit = true;
|
modalState.visibleByEdit = true;
|
||||||
@@ -289,7 +289,7 @@ function fnModalOk() {
|
|||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
dictType
|
dictType
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `${modalState.title}成功`,
|
content: `${modalState.title}成功`,
|
||||||
key,
|
key,
|
||||||
@@ -340,7 +340,7 @@ function fnRecordDelete(dictId: string = '0') {
|
|||||||
const key = 'delType';
|
const key = 'delType';
|
||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
delType(dictId).then(res => {
|
delType(dictId).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `删除成功`,
|
content: `删除成功`,
|
||||||
key,
|
key,
|
||||||
@@ -368,7 +368,7 @@ function fnExportList() {
|
|||||||
const key = 'exportType';
|
const key = 'exportType';
|
||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
exportType(toRaw(queryParams)).then(res => {
|
exportType(toRaw(queryParams)).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `已完成导出`,
|
content: `已完成导出`,
|
||||||
key,
|
key,
|
||||||
@@ -398,7 +398,7 @@ function fnRefreshCache() {
|
|||||||
const key = 'refreshCache';
|
const key = 'refreshCache';
|
||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
refreshCache().then(res => {
|
refreshCache().then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `刷新缓存成功`,
|
content: `刷新缓存成功`,
|
||||||
key,
|
key,
|
||||||
@@ -428,7 +428,7 @@ function fnGetList() {
|
|||||||
queryParams.beginTime = queryRangePicker.value[0];
|
queryParams.beginTime = queryRangePicker.value[0];
|
||||||
queryParams.endTime = queryRangePicker.value[1];
|
queryParams.endTime = queryRangePicker.value[1];
|
||||||
listType(toRaw(queryParams)).then(res => {
|
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) {
|
if (tableState.selectedRowKeys.length > 0) {
|
||||||
tableState.selectedRowKeys = [];
|
tableState.selectedRowKeys = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user