| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- import axios from 'axios';
- import type { RouteRecordNormalized } from 'vue-router';
- import { UserState } from '@/store/modules/user/types';
- import instance from './interceptor';
- export interface DataList {
- id?: number;
- name?: string;
- description?: string;
- }
- export interface DictRes {
- success: boolean;
- data: DataList[];
- message: string;
- code: string;
- }
- export interface DictParams {
- name: string | null;
- description: string | null;
- pageIndex: number;
- pageSize: number;
- }
- export interface DictItemParams {
- dictId: number;
- name: string;
- dictCode: number;
- description: string;
- }
- export interface ItemDataList {
- id?: number;
- dictId?: number;
- dictCode?: string | null;
- number?: number | null;
- name: string;
- chsName?: string;
- chtName?: string;
- order: number;
- status: number;
- lastModifiedTime?: string;
- description?: string;
- }
- export interface DictItemList {
- success: boolean;
- message: string;
- code: string;
- data: ItemDataList[];
- }
- export interface SuccessRes {
- success: boolean;
- message: string;
- code: string;
- data: number;
- }
- export interface AdditionalProp {
- dictCode: number;
- name: string;
- chsName: string;
- chtName: string;
- }
- export interface AdditionalProp {
- dictCode: number;
- name: string;
- chsName: string;
- chtName: string;
- }
- export interface DictQueryList {
- [key: string]: AdditionalProp[]; // 索引签名,允许任意字符串键
- }
- export interface DictQueryRes {
- success: boolean;
- message: string;
- code: string;
- data: DictQueryList;
- }
- export async function getDictList(params: object): Promise<DictRes> {
- const res = await instance.post('/api/Dict/List', params);
- return res.data;
- }
- export async function fetchSaveDict(params: object): Promise<SuccessRes> {
- const res = await instance.post('/api/Dict/Save', params);
- return res.data;
- }
- export async function fetchDeleteDict(params: object): Promise<SuccessRes> {
- const res = await instance.post('/api/Dict/Delete', params);
- return res.data;
- }
- export async function getDictQueryList(params: object): Promise<DictQueryRes> {
- const res = await instance.post('/api/Dict/DictQuery', params);
- return res.data;
- }
- export async function getDictItemList(params: object): Promise<DictItemList> {
- const res = await instance.post('/api/DictItem/List', params);
- return res.data;
- }
- export async function fetchSaveDictItem(params: object): Promise<SuccessRes> {
- const res = await instance.post('/api/DictItem/Save', params);
- return res.data;
- }
- export async function fetchDeleteDictItem(params: object): Promise<SuccessRes> {
- const res = await instance.post('/api/DictItem/Delete', params);
- return res.data;
- }
|