parent
6742875503
commit
542a11dbdc
@ -0,0 +1,50 @@
|
|||||||
|
import request from '@/config/axios';
|
||||||
|
import type { TableData } from './types';
|
||||||
|
|
||||||
|
/** 获取表格数据 */
|
||||||
|
export const getIndexCategoryListApi = (data: any) => {
|
||||||
|
return request.postJson({ url: '/dataset/spi/dataset/IndexCategory/IndexCategoryQueryPage', data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 批量删除 */
|
||||||
|
export const delIndexCategoryListApi = (list: string[] | number[]): Promise<IResponse> => {
|
||||||
|
const _list = list.map(v => {
|
||||||
|
return {
|
||||||
|
id: v,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return request.postJson({
|
||||||
|
url: '/dataset/spi/dataset/IndexCategory/IndexCategoryBatchDelete',
|
||||||
|
data: {
|
||||||
|
list: _list,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 删除 */
|
||||||
|
export const delIndexCategoryApi = (id?: string | number): Promise<IResponse> => {
|
||||||
|
return request.postJson({ url: '/dataset/spi/dataset/IndexCategory/IndexCategoryDelete', data: { id } });
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** 查询单条数据 */
|
||||||
|
export const queryIndexCategoryApi = (id?: string | number): Promise<IResponse> => {
|
||||||
|
return request.postJson({ url: '/dataset/spi/dataset/IndexCategory/IndexCategoryQueryOne', data: { id } });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 菜单树,增加默认排序 */
|
||||||
|
export const getIndexCategoryTreeApi = async () => {
|
||||||
|
const res = await request.post({
|
||||||
|
url: '/dataset/spi/dataset/IndexCategory/IndexCategoryTree',
|
||||||
|
});
|
||||||
|
if (res?.body?.menutree?.length > 0) {
|
||||||
|
const data = res.body.menutree
|
||||||
|
return data.sort((a:AppCustomRouteRecordRaw, b:AppCustomRouteRecordRaw) => {
|
||||||
|
return a?.props?.sort && b?.props?.sort ? a.props.sort - b.props.sort : 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
import {integer} from "vue-types";
|
||||||
|
|
||||||
|
export type TableData = {
|
||||||
|
/** 主键 */
|
||||||
|
dicid?: string
|
||||||
|
/** 分类名称 */
|
||||||
|
dicname?: string
|
||||||
|
/** 分类值 */
|
||||||
|
dicvalue?: string
|
||||||
|
/** 上级菜单 */
|
||||||
|
parentName?: string
|
||||||
|
/** 分类描述 */
|
||||||
|
description?: string
|
||||||
|
/** 分类状态 */
|
||||||
|
status?: string
|
||||||
|
/** 分类类型 */
|
||||||
|
dictype?: string
|
||||||
|
|
||||||
|
parentid?: string
|
||||||
|
}
|
Loading…
Reference in new issue