chore: 初始开源发布
iotlcm-admin-ui:管理前端(基于 Vben Admin 5.5.9 二次开发)。 - 天地图 API Key → YOUR_TIANDITU_KEY - OAuth 客户端 ID → your-client-id,store 加密密钥 → 提示自行替换 - Makefile 移除明文 registry 登录口令,镜像地址改 - appIcon 指向内网图床的链接 → /favicon.ico - 真实手机号 → 合法 11 位编造号(保留号段前 3 位 + 后 4 位) - 真实邮箱 → example.com(署名头内的上游作者邮箱保留) - 移除 CI 触发器 - 补 MIT LICENSE(含 Vben Admin 上游声明)+ README - 统一 LF 行尾并加 .gitattributes 上游 Vben Admin 的版权与许可声明完整保留(各源文件 @Author/@Copyright 头 + LICENSE)。
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
|
||||
/**
|
||||
* Ant Design Vue 基础组件统一在这里异步引入。
|
||||
*
|
||||
* adapter 层只关心组件映射关系,避免把具体 UI 库的 import 细节散落到注册文件中。
|
||||
*/
|
||||
export const AutoComplete = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/auto-complete'),
|
||||
);
|
||||
|
||||
export const Button = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/button'),
|
||||
);
|
||||
|
||||
export const Checkbox = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/checkbox'),
|
||||
);
|
||||
|
||||
export const CheckboxGroup = defineAsyncComponent(() =>
|
||||
import('ant-design-vue/es/checkbox').then((res) => res.CheckboxGroup),
|
||||
);
|
||||
|
||||
export const DatePicker = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/date-picker'),
|
||||
);
|
||||
|
||||
export const Divider = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/divider'),
|
||||
);
|
||||
|
||||
export const Image = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/image'),
|
||||
);
|
||||
|
||||
export const Input = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/input'),
|
||||
);
|
||||
|
||||
export const InputNumber = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/input-number'),
|
||||
);
|
||||
|
||||
export const InputPassword = defineAsyncComponent(() =>
|
||||
import('ant-design-vue/es/input').then((res) => res.InputPassword),
|
||||
);
|
||||
|
||||
export const Mentions = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/mentions'),
|
||||
);
|
||||
|
||||
export const PreviewGroup = defineAsyncComponent(() =>
|
||||
import('ant-design-vue/es/image').then((res) => res.ImagePreviewGroup),
|
||||
);
|
||||
|
||||
export const Radio = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/radio'),
|
||||
);
|
||||
|
||||
export const RadioGroup = defineAsyncComponent(() =>
|
||||
import('ant-design-vue/es/radio').then((res) => res.RadioGroup),
|
||||
);
|
||||
|
||||
export const RangePicker = defineAsyncComponent(() =>
|
||||
import('ant-design-vue/es/date-picker').then((res) => res.RangePicker),
|
||||
);
|
||||
|
||||
export const Rate = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/rate'),
|
||||
);
|
||||
|
||||
export const Select = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/select'),
|
||||
);
|
||||
|
||||
export const Space = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/space'),
|
||||
);
|
||||
|
||||
export const Switch = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/switch'),
|
||||
);
|
||||
|
||||
export const Textarea = defineAsyncComponent(() =>
|
||||
import('ant-design-vue/es/input').then((res) => res.Textarea),
|
||||
);
|
||||
|
||||
export const TimePicker = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/time-picker'),
|
||||
);
|
||||
|
||||
export const TreeSelect = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/tree-select'),
|
||||
);
|
||||
|
||||
export const Cascader = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/cascader'),
|
||||
);
|
||||
|
||||
export const Upload = defineAsyncComponent(
|
||||
() => import('ant-design-vue/es/upload'),
|
||||
);
|
||||
@@ -0,0 +1,20 @@
|
||||
import { globalShareState } from '@vben/common-ui';
|
||||
|
||||
import { notification } from 'ant-design-vue';
|
||||
|
||||
/**
|
||||
* 框架共享消息适配。
|
||||
*
|
||||
* common-ui 内部只声明消息场景,这里绑定到当前 UI 库的 notification 实现。
|
||||
*/
|
||||
export function defineComponentAdapterMessage() {
|
||||
globalShareState.defineMessage({
|
||||
copyPreferencesSuccess: (title, content) => {
|
||||
notification.success({
|
||||
description: content,
|
||||
message: title,
|
||||
placement: 'bottomRight',
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import type { UploadFile, UploadProps } from 'ant-design-vue';
|
||||
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
import { h, render, unref } from 'vue';
|
||||
|
||||
import { Image, PreviewGroup } from '../antd';
|
||||
|
||||
/**
|
||||
* UploadFile 没有稳定的图片标识字段时,通过 url/name/type 组合判断是否走图片预览。
|
||||
*/
|
||||
function isImageFile(file: UploadFile): boolean {
|
||||
const imageExtensions = new Set(['bmp', 'gif', 'jpeg', 'jpg', 'png', 'webp']);
|
||||
|
||||
if (file.url) {
|
||||
const ext = file.url?.split('.').pop()?.toLowerCase();
|
||||
return ext ? imageExtensions.has(ext) : false;
|
||||
}
|
||||
|
||||
if (!file.type) {
|
||||
const ext = file.name?.split('.').pop()?.toLowerCase();
|
||||
return ext ? imageExtensions.has(ext) : false;
|
||||
}
|
||||
|
||||
return file.type.startsWith('image/');
|
||||
}
|
||||
|
||||
/**
|
||||
* 本地待上传图片没有 url 时,需要转成 base64 才能进入 ImagePreviewGroup。
|
||||
*/
|
||||
function getBase64(file: File) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.addEventListener('load', () => resolve(reader.result));
|
||||
reader.addEventListener('error', (error) => reject(error));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 基于 Ant Design Vue ImagePreviewGroup 创建一次性预览容器。
|
||||
*
|
||||
* 预览关闭后会卸载并移除临时 DOM,避免多次预览后残留节点。
|
||||
*/
|
||||
export const previewImage = async (
|
||||
file: UploadFile,
|
||||
visible: Ref<boolean>,
|
||||
fileList: Ref<UploadProps['fileList']>,
|
||||
) => {
|
||||
// 非图片沿用文件打开行为,不进入图片预览组
|
||||
if (!isImageFile(file)) {
|
||||
if (file.url) {
|
||||
window.open(file.url, '_blank');
|
||||
} else if (file.preview) {
|
||||
window.open(file.preview, '_blank');
|
||||
} else {
|
||||
console.warn('无法打开文件,没有可用的URL或预览地址');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Image 与 PreviewGroup 只有预览时才加载,保持基础表单渲染轻量
|
||||
const [ImageComponent, PreviewGroupComponent] = await Promise.all([
|
||||
Image,
|
||||
PreviewGroup,
|
||||
]);
|
||||
|
||||
const imageFiles = (unref(fileList) || []).filter((element) =>
|
||||
isImageFile(element),
|
||||
);
|
||||
|
||||
// 同一上传列表中的图片都加入预览组,支持左右切换
|
||||
for (const imgFile of imageFiles) {
|
||||
if (!imgFile.url && !imgFile.preview && imgFile.originFileObj) {
|
||||
imgFile.preview = (await getBase64(imgFile.originFileObj)) as string;
|
||||
}
|
||||
}
|
||||
|
||||
const container: HTMLElement | null = document.createElement('div');
|
||||
document.body.append(container);
|
||||
|
||||
// 避免关闭动画期间重复触发卸载
|
||||
let isUnmounted = false;
|
||||
|
||||
const PreviewWrapper = {
|
||||
setup() {
|
||||
return () => {
|
||||
if (isUnmounted) return null;
|
||||
|
||||
return h(
|
||||
PreviewGroupComponent,
|
||||
{
|
||||
class: 'hidden',
|
||||
preview: {
|
||||
visible: visible.value,
|
||||
current: imageFiles.findIndex((f) => f.uid === file.uid),
|
||||
onVisibleChange: (value: boolean) => {
|
||||
visible.value = value;
|
||||
if (!value) {
|
||||
// 等待预览关闭动画结束后再卸载临时容器
|
||||
setTimeout(() => {
|
||||
if (!isUnmounted && container) {
|
||||
isUnmounted = true;
|
||||
render(null, container);
|
||||
container.remove();
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
() =>
|
||||
imageFiles.map((imgFile) =>
|
||||
h(ImageComponent, {
|
||||
key: imgFile.uid,
|
||||
src: imgFile.url || imgFile.preview,
|
||||
}),
|
||||
),
|
||||
);
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
render(h(PreviewWrapper), container);
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
import type { Component } from 'vue';
|
||||
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { defineComponent, h, ref } from 'vue';
|
||||
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
/**
|
||||
* 为输入类/选择类组件补齐统一占位文案,并保留原组件暴露的方法。
|
||||
*/
|
||||
export const withDefaultPlaceholder = <T extends Component>(
|
||||
component: T,
|
||||
type: 'input' | 'select',
|
||||
componentProps: Recordable<any> = {},
|
||||
) => {
|
||||
return defineComponent({
|
||||
name: component.name,
|
||||
inheritAttrs: false,
|
||||
setup: (props: any, { attrs, expose, slots }) => {
|
||||
const placeholder =
|
||||
props?.placeholder ||
|
||||
attrs?.placeholder ||
|
||||
$t(`ui.placeholder.${type}`);
|
||||
const innerRef = ref();
|
||||
|
||||
// 透传内部组件实例方法,避免包装后影响外部通过 ref 调用 focus 等能力
|
||||
expose(
|
||||
new Proxy(
|
||||
{},
|
||||
{
|
||||
get: (_target, key) => innerRef.value?.[key],
|
||||
has: (_target, key) => key in (innerRef.value || {}),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
return () =>
|
||||
h(
|
||||
component,
|
||||
{ ...componentProps, placeholder, ...props, ...attrs, ref: innerRef },
|
||||
slots,
|
||||
);
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,114 @@
|
||||
import type {
|
||||
UploadChangeParam,
|
||||
UploadFile,
|
||||
UploadProps,
|
||||
} from 'ant-design-vue';
|
||||
|
||||
import { defineComponent, h, ref, watch } from 'vue';
|
||||
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
import { $t } from '@vben/locales';
|
||||
import { isEmpty } from '@vben/utils';
|
||||
|
||||
import { Button, Upload } from '../antd';
|
||||
import { previewImage } from './upload-preview';
|
||||
|
||||
/**
|
||||
* Upload 未提供自定义插槽时,补齐项目统一的默认上传按钮。
|
||||
*/
|
||||
function createDefaultSlotsWithUpload(listType: string, placeholder: string) {
|
||||
switch (listType) {
|
||||
case 'picture-card': {
|
||||
return {
|
||||
default: () => placeholder,
|
||||
};
|
||||
}
|
||||
default: {
|
||||
return {
|
||||
default: () =>
|
||||
h(
|
||||
Button,
|
||||
{
|
||||
icon: h(IconifyIcon, {
|
||||
icon: 'ant-design:upload-outlined',
|
||||
class: 'mb-1 size-4',
|
||||
}),
|
||||
},
|
||||
() => placeholder,
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 适配 Ant Design Vue Upload 到 Vben Form:
|
||||
* - 使用 modelValue 与表单值同步
|
||||
* - 上传列表为空时回写 undefined
|
||||
* - 内置图片预览,非图片文件直接打开地址
|
||||
*/
|
||||
export const withPreviewUpload = () => {
|
||||
return defineComponent({
|
||||
name: Upload.name,
|
||||
emits: ['change', 'update:modelValue'],
|
||||
setup: (
|
||||
props: any,
|
||||
{ attrs, slots, emit }: { attrs: any; emit: any; slots: any },
|
||||
) => {
|
||||
const previewVisible = ref<boolean>(false);
|
||||
const placeholder = attrs?.placeholder || $t(`ui.placeholder.upload`);
|
||||
const listType = attrs?.listType || attrs?.['list-type'] || 'text';
|
||||
const fileList = ref<UploadProps['fileList']>(
|
||||
attrs?.fileList || attrs?.['file-list'] || [],
|
||||
);
|
||||
|
||||
const handleChange = async (event: UploadChangeParam) => {
|
||||
fileList.value = event.fileList;
|
||||
emit('change', event);
|
||||
emit(
|
||||
'update:modelValue',
|
||||
event.fileList?.length ? fileList.value : undefined,
|
||||
);
|
||||
};
|
||||
|
||||
const handlePreview = async (file: UploadFile) => {
|
||||
previewVisible.value = true;
|
||||
await previewImage(file, previewVisible, fileList);
|
||||
};
|
||||
|
||||
const renderUploadButton = (): any => {
|
||||
const isDisabled = attrs.disabled;
|
||||
|
||||
// 禁用状态下只展示文件列表,不再渲染上传入口
|
||||
if (isDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return isEmpty(slots)
|
||||
? createDefaultSlotsWithUpload(listType, placeholder)
|
||||
: slots;
|
||||
};
|
||||
|
||||
// 监听 formApi.setValues 等外部回填,保持 Upload 内部 fileList 同步
|
||||
watch(
|
||||
() => attrs.modelValue,
|
||||
(res) => {
|
||||
fileList.value = res;
|
||||
},
|
||||
);
|
||||
|
||||
return () =>
|
||||
h(
|
||||
Upload,
|
||||
{
|
||||
...props,
|
||||
...attrs,
|
||||
fileList: fileList.value,
|
||||
onChange: handleChange,
|
||||
onPreview: handlePreview,
|
||||
},
|
||||
renderUploadButton(),
|
||||
);
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,136 @@
|
||||
import type { Component } from 'vue';
|
||||
|
||||
import type { ComponentType } from './types';
|
||||
|
||||
import { h } from 'vue';
|
||||
|
||||
import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui';
|
||||
|
||||
import { HtcRegisterComponent } from '#/components/HtCustom/FormExpand/register';
|
||||
import { Tinymce as RichTextarea } from '#/components/tinymce';
|
||||
import { FileUpload, ImageUpload } from '#/components/upload';
|
||||
|
||||
import {
|
||||
AutoComplete,
|
||||
Button,
|
||||
Cascader,
|
||||
Checkbox,
|
||||
CheckboxGroup,
|
||||
DatePicker,
|
||||
Divider,
|
||||
Input,
|
||||
InputNumber,
|
||||
InputPassword,
|
||||
Mentions,
|
||||
Radio,
|
||||
RadioGroup,
|
||||
RangePicker,
|
||||
Rate,
|
||||
Select,
|
||||
Space,
|
||||
Switch,
|
||||
Textarea,
|
||||
TimePicker,
|
||||
TreeSelect,
|
||||
} from './antd';
|
||||
import { defineComponentAdapterMessage } from './helpers/message';
|
||||
import { withDefaultPlaceholder } from './helpers/with-default-placeholder';
|
||||
import { withPreviewUpload } from './helpers/with-preview-upload';
|
||||
|
||||
/**
|
||||
* 通用组件适配层。
|
||||
*
|
||||
* 这里只维护“组件名称 -> 真实组件”的映射关系,供 vben-form、vben-modal、
|
||||
* vben-drawer 等框架组件通过 globalShareState 复用。
|
||||
*/
|
||||
function createComponentAdapterMap(): Partial<
|
||||
Record<ComponentType, Component>
|
||||
> {
|
||||
return {
|
||||
// 如果你的组件体积比较大,可以使用异步加载
|
||||
// Button: () =>
|
||||
// import('xxx').then((res) => res.Button),
|
||||
ApiCascader: withDefaultPlaceholder(ApiComponent, 'select', {
|
||||
component: Cascader,
|
||||
fieldNames: { label: 'label', value: 'value', children: 'children' },
|
||||
loadingSlot: 'suffixIcon',
|
||||
modelPropName: 'value',
|
||||
visibleEvent: 'onVisibleChange',
|
||||
}),
|
||||
ApiSelect: withDefaultPlaceholder(
|
||||
{
|
||||
...ApiComponent,
|
||||
name: 'ApiSelect',
|
||||
},
|
||||
'select',
|
||||
{
|
||||
component: Select,
|
||||
loadingSlot: 'suffixIcon',
|
||||
visibleEvent: 'onDropdownVisibleChange',
|
||||
modelPropName: 'value',
|
||||
},
|
||||
),
|
||||
ApiTreeSelect: withDefaultPlaceholder(
|
||||
{
|
||||
...ApiComponent,
|
||||
name: 'ApiTreeSelect',
|
||||
},
|
||||
'select',
|
||||
{
|
||||
component: TreeSelect,
|
||||
fieldNames: { label: 'label', value: 'value', children: 'children' },
|
||||
loadingSlot: 'suffixIcon',
|
||||
modelPropName: 'value',
|
||||
optionsPropName: 'treeData',
|
||||
visibleEvent: 'onVisibleChange',
|
||||
},
|
||||
),
|
||||
AutoComplete,
|
||||
Cascader,
|
||||
Checkbox,
|
||||
CheckboxGroup,
|
||||
DatePicker,
|
||||
// 弹窗、抽屉等框架组件会通过共享状态读取这两个按钮组件
|
||||
DefaultButton: (props, { attrs, slots }) => {
|
||||
return h(Button, { ...props, attrs, type: 'default' }, slots);
|
||||
},
|
||||
Divider,
|
||||
FileUpload,
|
||||
ImageUpload,
|
||||
IconPicker: withDefaultPlaceholder(IconPicker, 'select', {
|
||||
iconSlot: 'addonAfter',
|
||||
inputComponent: Input,
|
||||
modelValueProp: 'value',
|
||||
}),
|
||||
Input: withDefaultPlaceholder(Input, 'input'),
|
||||
InputNumber: withDefaultPlaceholder(InputNumber, 'input'),
|
||||
InputPassword: withDefaultPlaceholder(InputPassword, 'input'),
|
||||
Mentions: withDefaultPlaceholder(Mentions, 'input'),
|
||||
PrimaryButton: (props, { attrs, slots }) => {
|
||||
return h(Button, { ...props, attrs, type: 'primary' }, slots);
|
||||
},
|
||||
Radio,
|
||||
RadioGroup,
|
||||
RangePicker,
|
||||
Rate,
|
||||
RichTextarea,
|
||||
Select: withDefaultPlaceholder(Select, 'select'),
|
||||
// SelectDivision,
|
||||
Space,
|
||||
Switch,
|
||||
Textarea: withDefaultPlaceholder(Textarea, 'input'),
|
||||
TimePicker,
|
||||
TreeSelect: withDefaultPlaceholder(TreeSelect, 'select'),
|
||||
Upload: withPreviewUpload(),
|
||||
...HtcRegisterComponent,
|
||||
};
|
||||
}
|
||||
|
||||
async function initComponentAdapter() {
|
||||
// 先注册组件,再初始化 form 适配,确保 setupVbenForm 能读到完整组件表
|
||||
globalShareState.setComponents(createComponentAdapterMap());
|
||||
defineComponentAdapterMessage();
|
||||
}
|
||||
|
||||
export { initComponentAdapter };
|
||||
export type { ComponentType };
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { SchemaComponentType } from './types';
|
||||
|
||||
import type { HtcComponentPropsMap } from '#/components/HtCustom/FormExpand/register';
|
||||
|
||||
type ComponentPropsGetter<Props> = (
|
||||
value: Partial<Record<string, any>>,
|
||||
actions: any,
|
||||
) => Props;
|
||||
|
||||
type ComponentPropsMap = HtcComponentPropsMap;
|
||||
|
||||
type UntypedComponentProps =
|
||||
| ComponentPropsGetter<Record<string, any>>
|
||||
| Record<string, any>;
|
||||
|
||||
export type ComponentProps<T extends SchemaComponentType> =
|
||||
T extends keyof ComponentPropsMap
|
||||
? ComponentPropsGetter<ComponentPropsMap[T]> | ComponentPropsMap[T]
|
||||
: UntypedComponentProps;
|
||||
@@ -0,0 +1,61 @@
|
||||
import type { BaseFormComponentType } from '@vben/common-ui';
|
||||
|
||||
import type { HtcRegisterComponentName } from '#/components/HtCustom/FormExpand/register';
|
||||
|
||||
/**
|
||||
* 表单 schema 中 component 字段允许使用的组件名称。
|
||||
*
|
||||
* 新增适配组件时,需要同时在这里补充名称,并在 index.ts 中注册真实组件。
|
||||
*/
|
||||
export type AdapterComponentType =
|
||||
| 'ApiCascader'
|
||||
| 'ApiSelect'
|
||||
| 'ApiTreeSelect'
|
||||
| 'AutoComplete'
|
||||
| 'Cascader'
|
||||
| 'Checkbox'
|
||||
| 'CheckboxGroup'
|
||||
| 'DatePicker'
|
||||
| 'DefaultButton'
|
||||
| 'Divider'
|
||||
| 'FileUpload'
|
||||
| 'HtcFormSwitch'
|
||||
| 'IconPicker'
|
||||
| 'ImageUpload'
|
||||
| 'Input'
|
||||
| 'InputNumber'
|
||||
| 'InputPassword'
|
||||
| 'Mentions'
|
||||
| 'PrimaryButton'
|
||||
| 'Radio'
|
||||
| 'RadioGroup'
|
||||
| 'RangePicker'
|
||||
| 'Rate'
|
||||
| 'RichTextarea'
|
||||
| 'Select'
|
||||
| 'SelectDivision'
|
||||
| 'Space'
|
||||
| 'Switch'
|
||||
| 'Textarea'
|
||||
| 'TimePicker'
|
||||
| 'TreeSelect'
|
||||
| 'Upload';
|
||||
|
||||
export type BaseComponentType =
|
||||
| 'DefaultButton'
|
||||
| 'PrimaryButton'
|
||||
| 'VbenCheckbox'
|
||||
| 'VbenInput'
|
||||
| 'VbenInputPassword'
|
||||
| 'VbenPinInput'
|
||||
| 'VbenSelect';
|
||||
|
||||
export type SchemaComponentType =
|
||||
| AdapterComponentType
|
||||
| BaseComponentType
|
||||
| HtcRegisterComponentName;
|
||||
|
||||
export type ComponentType =
|
||||
| AdapterComponentType
|
||||
| BaseFormComponentType
|
||||
| HtcRegisterComponentName;
|
||||
@@ -0,0 +1,68 @@
|
||||
import type {
|
||||
VbenFormProps as BaseVbenFormProps,
|
||||
VbenFormSchema as FormSchema,
|
||||
} from '@vben/common-ui';
|
||||
|
||||
import type { ComponentType } from './component';
|
||||
import type { ComponentProps } from './component/props';
|
||||
import type { SchemaComponentType } from './component/types';
|
||||
|
||||
import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
async function initSetupVbenForm() {
|
||||
setupVbenForm<ComponentType>({
|
||||
config: {
|
||||
// ant design vue组件库默认都是 v-model:value
|
||||
baseModelPropName: 'value',
|
||||
|
||||
// 一些组件是 v-model:checked 或者 v-model:fileList
|
||||
modelPropNameMap: {
|
||||
Checkbox: 'checked',
|
||||
Radio: 'checked',
|
||||
RichTextarea: 'modelValue',
|
||||
Switch: 'checked',
|
||||
Upload: 'fileList',
|
||||
ImageUpload: 'value',
|
||||
},
|
||||
},
|
||||
defineRules: {
|
||||
// 输入项目必填国际化适配
|
||||
required: (value, _params, ctx) => {
|
||||
if (value === undefined || value === null || value.length === 0) {
|
||||
return $t('ui.formRules.required', [ctx.label]);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 选择项目必填国际化适配
|
||||
selectRequired: (value, _params, ctx) => {
|
||||
if (value === undefined || value === null) {
|
||||
return $t('ui.formRules.selectRequired', [ctx.label]);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
type TypedFormSchema<T extends SchemaComponentType> = Omit<
|
||||
FormSchema<T>,
|
||||
'component' | 'componentProps'
|
||||
> & {
|
||||
component: T;
|
||||
componentProps?: ComponentProps<T>;
|
||||
};
|
||||
|
||||
export type VbenFormSchema = {
|
||||
[K in SchemaComponentType]: TypedFormSchema<K>;
|
||||
}[SchemaComponentType];
|
||||
|
||||
export type VbenFormProps = Omit<BaseVbenFormProps<ComponentType>, 'schema'> & {
|
||||
schema?: VbenFormSchema[];
|
||||
};
|
||||
|
||||
const useVbenForm = (options: VbenFormProps) => {
|
||||
return useForm<ComponentType>(options as BaseVbenFormProps<ComponentType>);
|
||||
};
|
||||
|
||||
export { initSetupVbenForm, useVbenForm, z };
|
||||
@@ -0,0 +1,124 @@
|
||||
/* eslint-disable vue/no-side-effects-in-computed-properties */
|
||||
import { computed, defineComponent, h, ref, watch } from 'vue';
|
||||
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
|
||||
const component = defineComponent({
|
||||
props: {
|
||||
code: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
language: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
autodetect: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
ignoreIllegals: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const language = ref(props.language);
|
||||
const ignoreIllegals = ref(props.ignoreIllegals);
|
||||
watch(
|
||||
() => props.language,
|
||||
(newLanguage) => {
|
||||
language.value = newLanguage;
|
||||
},
|
||||
);
|
||||
watch(
|
||||
() => props.ignoreIllegals,
|
||||
(newIgnoreIllegals) => {
|
||||
ignoreIllegals.value = newIgnoreIllegals;
|
||||
},
|
||||
);
|
||||
|
||||
const autodetect = computed(() => props.autodetect || !language.value);
|
||||
const cannotDetectLanguage = computed(
|
||||
() => !autodetect.value && !hljs.getLanguage(language.value),
|
||||
);
|
||||
|
||||
const className = computed((): string => {
|
||||
return cannotDetectLanguage.value ? '' : `hljs ${language.value}`;
|
||||
});
|
||||
|
||||
const highlightedCode = computed((): string => {
|
||||
// No idea what language to use, return raw code
|
||||
if (cannotDetectLanguage.value) {
|
||||
console.warn(
|
||||
`The language "${language.value}" you specified could not be found.`,
|
||||
);
|
||||
return props.code;
|
||||
}
|
||||
|
||||
if (autodetect.value) {
|
||||
const result = hljs.highlightAuto(props.code);
|
||||
language.value = result.language ?? '';
|
||||
return result.value;
|
||||
} else {
|
||||
const result = hljs.highlight(props.code, {
|
||||
language: language.value,
|
||||
ignoreIllegals: props.ignoreIllegals,
|
||||
});
|
||||
return result.value;
|
||||
}
|
||||
});
|
||||
// const saveSelection = (e: any) => {
|
||||
// const selection = window.getSelection();
|
||||
// if (selection && selection.rangeCount && selection.rangeCount > 0) {
|
||||
// const range = selection.getRangeAt(0);
|
||||
// return range;
|
||||
// }
|
||||
// return null;
|
||||
// };
|
||||
// const restoreSelection = (range: any, el: any) => {
|
||||
// if (range) {
|
||||
// const selection = window.getSelection();
|
||||
// if (selection) {
|
||||
// selection.removeAllRanges();
|
||||
// selection.addRange(range);
|
||||
// console.log('selection range', range);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
const updateContent = (e: any) => {
|
||||
// const range = saveSelection(e)
|
||||
const result = hljs.highlight(e.target.innerText, {
|
||||
language: language.value,
|
||||
ignoreIllegals: props.ignoreIllegals,
|
||||
});
|
||||
e.target.innerHTML = result.value;
|
||||
emit('update:code', e.target.innerText);
|
||||
// setTimeout(() => {
|
||||
// restoreSelection(range, e.target)
|
||||
// }, 0)
|
||||
};
|
||||
return {
|
||||
className,
|
||||
highlightedCode,
|
||||
updateContent,
|
||||
emit,
|
||||
};
|
||||
},
|
||||
render() {
|
||||
const updateContent = this.updateContent;
|
||||
return h('pre', {}, [
|
||||
h('code', {
|
||||
class: this.className,
|
||||
innerHTML: this.highlightedCode,
|
||||
contenteditable: true,
|
||||
// onInput(e: any) {},
|
||||
onBlur(e: any) {
|
||||
updateContent(e);
|
||||
},
|
||||
}),
|
||||
]);
|
||||
},
|
||||
});
|
||||
|
||||
export default component;
|
||||
@@ -0,0 +1,70 @@
|
||||
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
|
||||
|
||||
import { h } from 'vue';
|
||||
|
||||
import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
|
||||
|
||||
import { Button, Image } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from './form';
|
||||
|
||||
setupVbenVxeTable({
|
||||
configVxeTable: (vxeUI) => {
|
||||
vxeUI.setConfig({
|
||||
grid: {
|
||||
align: 'center',
|
||||
border: false,
|
||||
columnConfig: {
|
||||
resizable: true,
|
||||
},
|
||||
minHeight: 180,
|
||||
formConfig: {
|
||||
// 全局禁用vxe-table的表单配置,使用formOptions
|
||||
enabled: false,
|
||||
},
|
||||
proxyConfig: {
|
||||
autoLoad: true,
|
||||
response: {
|
||||
result: 'items',
|
||||
total: 'total',
|
||||
list: 'items',
|
||||
},
|
||||
showActiveMsg: true,
|
||||
showResponseMsg: false,
|
||||
},
|
||||
round: true,
|
||||
showOverflow: true,
|
||||
size: 'small',
|
||||
} as VxeTableGridOptions,
|
||||
});
|
||||
|
||||
// 表格配置项可以用 cellRender: { name: 'CellImage' },
|
||||
vxeUI.renderer.add('CellImage', {
|
||||
renderTableDefault(renderOpts, params) {
|
||||
const { props } = renderOpts;
|
||||
const { column, row } = params;
|
||||
return h(Image, { src: row[column.field], ...props });
|
||||
},
|
||||
});
|
||||
|
||||
// 表格配置项可以用 cellRender: { name: 'CellLink' },
|
||||
vxeUI.renderer.add('CellLink', {
|
||||
renderTableDefault(renderOpts) {
|
||||
const { props } = renderOpts;
|
||||
return h(
|
||||
Button,
|
||||
{ size: 'small', type: 'link' },
|
||||
{ default: () => props?.text },
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
||||
// vxeUI.formats.add
|
||||
},
|
||||
useVbenForm,
|
||||
});
|
||||
|
||||
export { useVbenVxeGrid };
|
||||
|
||||
export type * from '@vben/plugins/vxe-table';
|
||||
@@ -0,0 +1,170 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export interface AgentDept {
|
||||
deptId: number;
|
||||
tenantId?: string;
|
||||
deptType: number;
|
||||
parentId: number;
|
||||
ancestors?: string;
|
||||
deptKey?: string;
|
||||
deptName: string;
|
||||
deptCategory?: string;
|
||||
orderNum?: number;
|
||||
leader?: number;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
status: string;
|
||||
creditCode?: string;
|
||||
areaCode?: string;
|
||||
address?: string;
|
||||
deptRole?: number;
|
||||
userName?: string;
|
||||
defaultUserName?: string;
|
||||
nickName?: string;
|
||||
defaultNickName?: string;
|
||||
defaultUserNickName?: string;
|
||||
defaultUserId?: number;
|
||||
password?: string;
|
||||
createdAt?: string;
|
||||
}
|
||||
|
||||
export interface AgentRole {
|
||||
roleId: number;
|
||||
tenantId?: string;
|
||||
deptId: number;
|
||||
deptName?: string;
|
||||
roleName: string;
|
||||
roleKey: string;
|
||||
roleSort?: number;
|
||||
dataScope?: string;
|
||||
menuCheckStrictly?: number;
|
||||
deptCheckStrictly?: number;
|
||||
isPass?: number;
|
||||
sourceRoleId?: number;
|
||||
sourceDeptId?: number;
|
||||
status: string;
|
||||
createdAt?: string;
|
||||
remark?: string;
|
||||
isDefaultRole?: boolean;
|
||||
}
|
||||
|
||||
export interface MenuTreeItem {
|
||||
title: string;
|
||||
key: string;
|
||||
parentId: number;
|
||||
menuId: number;
|
||||
menuName: string;
|
||||
menuType: string;
|
||||
perms?: string;
|
||||
children?: MenuTreeItem[];
|
||||
}
|
||||
|
||||
export interface AgentRoleView extends AgentRole {
|
||||
menuIds: number[];
|
||||
deptIds: number[];
|
||||
allowedMenuIds: number[];
|
||||
menuTree: MenuTreeItem[];
|
||||
}
|
||||
|
||||
export interface AgentUser {
|
||||
userId: number;
|
||||
tenantId: string;
|
||||
deptId: number;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
userType: string;
|
||||
email: string;
|
||||
phonenumber: string;
|
||||
sex: string;
|
||||
avatar: string;
|
||||
status: string;
|
||||
loginIp?: string;
|
||||
loginDate?: string;
|
||||
createdDept?: number;
|
||||
createdBy?: number;
|
||||
createdAt?: string;
|
||||
remark?: string;
|
||||
deptInfo?: { deptId: number; deptName: string };
|
||||
roles?: AgentRole[];
|
||||
isDefaultUser?: boolean;
|
||||
}
|
||||
|
||||
export function getAgentDeptListApi(params?: Record<string, any>) {
|
||||
return requestClient.get<{ items: AgentDept[]; total: number }>(
|
||||
'/agent/dept/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
export function getAgentDeptViewApi(params: { deptId: number }) {
|
||||
return requestClient.get<AgentDept>('/agent/dept/view', { params });
|
||||
}
|
||||
|
||||
export function saveAgentDeptApi(params: Partial<AgentDept>) {
|
||||
return requestClient.post<{ deptId: number }>('/agent/dept/save', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteAgentDeptApi(params: { deptId: number }) {
|
||||
return requestClient.post('/agent/dept/delete', { ...params });
|
||||
}
|
||||
|
||||
export function resetAgentDeptPasswordApi(params: { deptId: number; password: string }) {
|
||||
return requestClient.post('/agent/dept/resetPassword', { ...params });
|
||||
}
|
||||
|
||||
export function getAgentUserListApi(params?: Record<string, any>) {
|
||||
return requestClient.get<{ items: AgentUser[]; total: number }>(
|
||||
'/agent/user/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
export function getAgentUserViewApi(params: { userId: number }) {
|
||||
return requestClient.get<AgentUser>('/agent/user/view', { params });
|
||||
}
|
||||
|
||||
export function addAgentUserApi(params: Record<string, any>) {
|
||||
return requestClient.post('/agent/user/add', { ...params });
|
||||
}
|
||||
|
||||
export function updateAgentUserApi(params: Record<string, any>) {
|
||||
return requestClient.post('/agent/user/update', { ...params });
|
||||
}
|
||||
|
||||
export function deleteAgentUserApi(params: { userId?: number; userIds?: number[] }) {
|
||||
return requestClient.post('/agent/user/delete', { ...params });
|
||||
}
|
||||
|
||||
export function resetAgentUserPasswordApi(params: { userId: number; password: string }) {
|
||||
return requestClient.post('/agent/user/resetPassword', { ...params });
|
||||
}
|
||||
|
||||
export function getAgentRoleListApi(params?: Record<string, any>) {
|
||||
return requestClient.get<{ items: AgentRole[]; total: number }>(
|
||||
'/agent/role/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
export function getAgentRoleViewApi(params: { roleId: number }) {
|
||||
return requestClient.get<AgentRoleView>('/agent/role/view', { params });
|
||||
}
|
||||
|
||||
export function saveAgentRoleApi(params: Record<string, any>) {
|
||||
return requestClient.post<{ roleId: number }>('/agent/role/save', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteAgentRoleApi(params: { roleId?: number; roleIds?: number[] }) {
|
||||
return requestClient.post('/agent/role/delete', { ...params });
|
||||
}
|
||||
|
||||
export function getAgentMenuTreeApi() {
|
||||
return requestClient.get<{ items: MenuTreeItem[]; menuIds: number[] }>(
|
||||
'/agent/menu/tree',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取开放接口权限组表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('agent/tApiGroup/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除开放接口权限组表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('agent/tApiGroup/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑开放接口权限组表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('agent/tApiGroup/edit', { ...params });
|
||||
}
|
||||
|
||||
// 修改开放接口权限组表状态
|
||||
export function Status(params:any) {
|
||||
return requestClient.post<any>('agent/tApiGroup/status', { ...params });
|
||||
}
|
||||
|
||||
// 获取开放接口权限组表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('agent/tApiGroup/view', { params });
|
||||
}
|
||||
|
||||
// 导出开放接口权限组表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/agent/tApiGroup/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取开放接口资源表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('agent/tApiResource/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除开放接口资源表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('agent/tApiResource/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑开放接口资源表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('agent/tApiResource/edit', { ...params });
|
||||
}
|
||||
|
||||
// 修改开放接口资源表状态
|
||||
export function Status(params:any) {
|
||||
return requestClient.post<any>('agent/tApiResource/status', { ...params });
|
||||
}
|
||||
|
||||
// 获取开放接口资源表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('agent/tApiResource/view', { params });
|
||||
}
|
||||
|
||||
// 导出开放接口资源表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/agent/tApiResource/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取企业客户财务信息列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tAgentBalance/list', { params });
|
||||
}
|
||||
|
||||
// 获取账户余额概览
|
||||
export function GetAccountBalance(params?: any) {
|
||||
return requestClient.get<any>('common/tAgentBalance/getAccountBalance', { params });
|
||||
}
|
||||
|
||||
// 获取费用总览折线图
|
||||
export function FeeTrend(params: any) {
|
||||
return requestClient.get<any>('common/tAgentBalance/feeTrend', { params });
|
||||
}
|
||||
|
||||
// 获取账户总览折线图
|
||||
export function AccountTrend(params: any) {
|
||||
return requestClient.get<any>('common/tAgentBalance/accountTrend', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除企业客户财务信息
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tAgentBalance/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑企业客户财务信息
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tAgentBalance/edit', { ...params });
|
||||
}
|
||||
|
||||
// 修改企业客户财务信息状态
|
||||
export function Status(params:any) {
|
||||
return requestClient.post<any>('common/tAgentBalance/status', { ...params });
|
||||
}
|
||||
|
||||
// 获取企业客户财务信息指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tAgentBalance/view', { params });
|
||||
}
|
||||
|
||||
// 导出企业客户财务信息
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tAgentBalance/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
export function AlipayPay(params: any) {
|
||||
return requestClient.post<any>('pay/alipay/pay', params);
|
||||
}
|
||||
|
||||
export function AlipayQuery(params: any) {
|
||||
return requestClient.get<any>('pay/alipay/query', { params });
|
||||
}
|
||||
|
||||
// 转可提现申请
|
||||
export function BalanceTransferApply(params: {
|
||||
amount: number;
|
||||
accountType: number;
|
||||
bankName?: string;
|
||||
bankAccount?: string;
|
||||
accountName?: string;
|
||||
identityCard?: string;
|
||||
remark?: string;
|
||||
}) {
|
||||
return requestClient.post<any>('common/tAgentBalance/balanceTransferApply', params);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取余额明细表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tBalanceDetail/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除余额明细表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tBalanceDetail/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑余额明细表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tBalanceDetail/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取余额明细表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tBalanceDetail/view', { params });
|
||||
}
|
||||
|
||||
// 导出余额明细表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tBalanceDetail/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
export function Recharge(params:any) {
|
||||
return requestClient.post<any>('common/tBalanceDetail/recharge', { ...params });
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取消费账户月账单表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tConsumeAccountMonthBill/list', { params });
|
||||
}
|
||||
|
||||
// 获取消费账户月账单汇总
|
||||
export function GetConsumptionBillSummary(params:any) {
|
||||
return requestClient.get<any>('common/tConsumeAccountMonthBill/getConsumptionBillSummary', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除消费账户月账单表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tConsumeAccountMonthBill/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑消费账户月账单表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tConsumeAccountMonthBill/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取消费账户月账单表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tConsumeAccountMonthBill/view', { params });
|
||||
}
|
||||
|
||||
// 导出消费账户月账单表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tConsumeAccountMonthBill/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取信用额度明细表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tCreditDetail/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除信用额度明细表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tCreditDetail/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑信用额度明细表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tCreditDetail/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取信用额度明细表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tCreditDetail/view', { params });
|
||||
}
|
||||
|
||||
// 导出信用额度明细表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tCreditDetail/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取分润明细表列表
|
||||
export function List(params: any) {
|
||||
return requestClient.get<any>('common/tFinCommissionDetail/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除分润明细表
|
||||
export function Delete(params: any) {
|
||||
return requestClient.post<any>('common/tFinCommissionDetail/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑分润明细表
|
||||
export function Edit(params: any) {
|
||||
return requestClient.post<any>('common/tFinCommissionDetail/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取分润明细表指定详情
|
||||
export function View(params: any) {
|
||||
return requestClient.get<any>('common/tFinCommissionDetail/view', { params });
|
||||
}
|
||||
|
||||
// 获取分层分润概览
|
||||
export function GetCommissionOverview(params: any) {
|
||||
return requestClient.get<any>(
|
||||
'common/tFinCommissionDetail/getCommissionOverview',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 获取层级汇总表
|
||||
export function GetLevelSummary(params: any) {
|
||||
return requestClient.get<any>(
|
||||
'common/tFinCommissionDetail/getLevelSummary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 导出分润明细表
|
||||
export function Export(params: any) {
|
||||
return requestClient.post<Blob>(
|
||||
'/common/tFinCommissionDetail/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取可提现变动明细表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tFinWithdrawableChange/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除可提现变动明细表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tFinWithdrawableChange/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑可提现变动明细表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tFinWithdrawableChange/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取可提现变动明细表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tFinWithdrawableChange/view', { params });
|
||||
}
|
||||
|
||||
// 导出可提现变动明细表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tFinWithdrawableChange/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取财务申请表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tFinanceApply/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除财务申请表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tFinanceApply/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑财务申请表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tFinanceApply/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取财务申请表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tFinanceApply/view', { params });
|
||||
}
|
||||
|
||||
// 导出财务申请表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tFinanceApply/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
// 审核余额转可提现申请
|
||||
export function BalanceTransferAudit(params: {
|
||||
applyNo: string;
|
||||
auditResult: number;
|
||||
auditOpinion?: string;
|
||||
}) {
|
||||
return requestClient.post<any>('common/tAgentBalance/balanceTransferAudit', params);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取财务审核记录表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tFinanceAuditRecord/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除财务审核记录表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tFinanceAuditRecord/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑财务审核记录表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tFinanceAuditRecord/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取财务审核记录表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tFinanceAuditRecord/view', { params });
|
||||
}
|
||||
|
||||
// 导出财务审核记录表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tFinanceAuditRecord/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取消息日志列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tMessageLog/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除消息日志
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tMessageLog/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑消息日志
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tMessageLog/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取消息日志指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tMessageLog/view', { params });
|
||||
}
|
||||
|
||||
// 导出消息日志
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tMessageLog/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取通知日志列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tNotifyLog/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除通知日志
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tNotifyLog/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑通知日志
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tNotifyLog/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取通知日志指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tNotifyLog/view', { params });
|
||||
}
|
||||
|
||||
// 导出通知日志
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tNotifyLog/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取盈利账户月账单表列表
|
||||
export function List(params: any) {
|
||||
return requestClient.get<any>('common/tProfitAccountMonthBill/list', { params });
|
||||
}
|
||||
|
||||
// 获取盈利账户月账单汇总
|
||||
export function GetProfitBillSummary(params: any) {
|
||||
return requestClient.get<any>(
|
||||
'common/tProfitAccountMonthBill/getProfitBillSummary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 获取核心财务指标
|
||||
export function GetCoreFinancialData(params: any) {
|
||||
return requestClient.get<any>(
|
||||
'common/tProfitAccountMonthBill/getCoreFinancialData',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 获取财务趋势
|
||||
export function GetFinancialTrend(params: any) {
|
||||
return requestClient.get<any>(
|
||||
'common/tProfitAccountMonthBill/getFinancialTrend',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 删除/批量删除盈利账户月账单表
|
||||
export function Delete(params: any) {
|
||||
return requestClient.post<any>('common/tProfitAccountMonthBill/delete', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
// 添加/编辑盈利账户月账单表
|
||||
export function Edit(params: any) {
|
||||
return requestClient.post<any>('common/tProfitAccountMonthBill/edit', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取盈利账户月账单表指定详情
|
||||
export function View(params: any) {
|
||||
return requestClient.get<any>('common/tProfitAccountMonthBill/view', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 导出盈利账户月账单表
|
||||
export function Export(params: any) {
|
||||
return requestClient.post<Blob>(
|
||||
'/common/tProfitAccountMonthBill/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取工单问题沟通表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('/common/tWoCommunication/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除工单问题沟通表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tWoCommunication/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑工单问题沟通表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tWoCommunication/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取工单问题沟通表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tWoCommunication/view', { params });
|
||||
}
|
||||
|
||||
// 发送工单沟通消息
|
||||
export function Message(params:any) {
|
||||
return requestClient.post<any>('common/tWoCommunication/message', { ...params });
|
||||
}
|
||||
|
||||
// 导出工单问题沟通表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tWoCommunication/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取工单主表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tWoMain/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除工单主表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tWoMain/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑工单主表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tWoMain/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取工单主表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tWoMain/view', { params });
|
||||
}
|
||||
|
||||
// 工单转单
|
||||
export function Transfer(params:any) {
|
||||
return requestClient.post<any>('common/tWoMain/transfer', { ...params });
|
||||
}
|
||||
|
||||
// 工单完成
|
||||
export function Resolve(params:any) {
|
||||
return requestClient.post<any>('common/tWoMain/resolve', { ...params });
|
||||
}
|
||||
|
||||
// 工单取消/关闭
|
||||
export function Cancel(params:any) {
|
||||
return requestClient.post<any>('common/tWoMain/cancel', { ...params });
|
||||
}
|
||||
|
||||
// 关闭工单
|
||||
export function Close(params:any) {
|
||||
return requestClient.post<any>('common/tWoMain/close', { ...params });
|
||||
}
|
||||
|
||||
// 工单评价
|
||||
export function Evaluate(params:any) {
|
||||
return requestClient.post<any>('common/tWoMain/evaluate', { ...params });
|
||||
}
|
||||
|
||||
// 导出工单主表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tWoMain/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取工单记录表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('common/tWoRecord/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除工单记录表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('common/tWoRecord/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑工单记录表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('common/tWoRecord/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取工单记录表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('common/tWoRecord/view', { params });
|
||||
}
|
||||
|
||||
// 导出工单记录表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/common/tWoRecord/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
/**
|
||||
* @description 认证相关接口
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
import { baseRequestClient, requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 登录类型
|
||||
* password 密码
|
||||
* sms 短信
|
||||
* social 第三方oauth
|
||||
* email 邮箱
|
||||
* xcx 小程序
|
||||
*/
|
||||
type GrantType = 'email' | 'password' | 'sms' | 'social' | 'xcx';
|
||||
|
||||
export namespace AuthApi {
|
||||
/** 登录接口参数 */
|
||||
export interface LoginParams {
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
/** 登录接口返回值 */
|
||||
export interface LoginResult {
|
||||
accessToken: string;
|
||||
}
|
||||
/** 注册接口参数 */
|
||||
export interface RegisterParams {
|
||||
tenantId?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
captchaID?: string;
|
||||
captchaValue?: string;
|
||||
}
|
||||
export type RegisterResult = Record<string, never>;
|
||||
|
||||
export interface RefreshTokenResult {
|
||||
data: string;
|
||||
status: number;
|
||||
}
|
||||
|
||||
export interface BaseLoginParams {
|
||||
clientId?: string;
|
||||
grantType: GrantType;
|
||||
tenantId: string;
|
||||
}
|
||||
|
||||
export interface OAuthLoginParams extends BaseLoginParams {
|
||||
socialCode: string;
|
||||
socialState: string;
|
||||
source: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param companyName 租户/公司名称
|
||||
* @param domain 绑定域名(不带http(s)://) 可选
|
||||
* @param tenantId 租户id
|
||||
*/
|
||||
export interface TenantOption {
|
||||
companyName: string;
|
||||
domain?: string;
|
||||
tenantId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tenantEnabled 是否启用租户
|
||||
* @param voList 租户列表
|
||||
*/
|
||||
export interface TenantResp {
|
||||
tenantEnabled: boolean;
|
||||
voList: TenantOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户权限码
|
||||
*/
|
||||
export interface GetAccessCodesResult {
|
||||
data: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
export async function loginApi(data: AuthApi.LoginParams) {
|
||||
return requestClient.post<AuthApi.LoginResult>('/system/auth/login', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送手机验证码登录短信
|
||||
*/
|
||||
export async function sendSmsLoginCodeApi(phone: string) {
|
||||
return requestClient.post('/system/auth/sms-code', { phone });
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机验证码登录
|
||||
*/
|
||||
export async function smsLoginApi(data: { code: string; phone: string }) {
|
||||
return requestClient.post<AuthApi.LoginResult>(
|
||||
'/system/auth/sms-login',
|
||||
data,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 注册register
|
||||
*/
|
||||
|
||||
export async function registerApi(data: AuthApi.RegisterParams) {
|
||||
return requestClient.post<AuthApi.RegisterResult>(
|
||||
'/system/user/register',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新accessToken
|
||||
*/
|
||||
export async function refreshTokenApi() {
|
||||
return baseRequestClient.post<AuthApi.RefreshTokenResult>(
|
||||
'/system/auth/refresh',
|
||||
undefined,
|
||||
{
|
||||
withCredentials: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
export async function logoutApi() {
|
||||
return requestClient.post('/system/auth/logout', undefined, {
|
||||
withCredentials: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户权限码
|
||||
*/
|
||||
export async function getAccessCodesApi() {
|
||||
return requestClient.get<GetAccessCodesResult>('/system/auth/codes');
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定第三方账号
|
||||
* @param source 绑定的来源
|
||||
* @returns 跳转url
|
||||
*/
|
||||
export function authBinding(source: string, tenantId: string) {
|
||||
return requestClient.get<string>(`/auth/binding/${source}`, {
|
||||
params: {
|
||||
domain: window.location.host,
|
||||
tenantId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消绑定
|
||||
* @param id id
|
||||
*/
|
||||
export function authUnbinding(id: string) {
|
||||
return requestClient.delete<unknown>(`/auth/unlock/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* oauth授权回调
|
||||
* @param data oauth授权
|
||||
* @returns void
|
||||
*/
|
||||
export function authCallback(data: AuthApi.OAuthLoginParams) {
|
||||
return requestClient.post<unknown>('/auth/social/callback', data);
|
||||
}
|
||||
|
||||
// 获取租户列表
|
||||
export function tenantList() {
|
||||
return requestClient.get<TenantResp>('/system/auth/getTenantList');
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @description 验证码相关接口
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CaptchaApi {
|
||||
export interface GetCaptchaResult {
|
||||
captchaID: string;
|
||||
captchaImage: string;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getCaptchaApi() {
|
||||
return requestClient.get<CaptchaApi.GetCaptchaResult>('/system/captcha');
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @description 核心模块接口导出
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
export * from './auth';
|
||||
export * from './menu';
|
||||
export * from './user';
|
||||
export * from './captcha';
|
||||
export * from './upload';
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @description 菜单相关接口
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
import type { RouteRecordStringComponent } from '@vben/types';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 获取用户所有菜单
|
||||
*/
|
||||
export async function getAllMenusApi() {
|
||||
return requestClient.get<RouteRecordStringComponent[]>('/system/menu/all');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @description 文件上传相关接口
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
import type { AxiosRequestConfig } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* Axios上传进度事件
|
||||
*/
|
||||
export type AxiosProgressEvent = AxiosRequestConfig['onUploadProgress'];
|
||||
|
||||
/**
|
||||
* 通过单文件上传接口
|
||||
* @param file 上传的文件
|
||||
* @param onUploadProgress 上传进度事件 非必传
|
||||
* @param isDevice 不知道这是什么,但是不敢动
|
||||
* @param newFileType 新文件类型 1:用户文件 2:用户图片 3:设备文件 4:iot配置图片 5:iot固件文件 6:项目图片 7:项目文件
|
||||
* @param subDirName 文件父目录
|
||||
* @param params 额外上传参数
|
||||
* @returns 上传结果
|
||||
*/
|
||||
export function uploadApi(
|
||||
file: Blob | File,
|
||||
onUploadProgress?: AxiosProgressEvent,
|
||||
isDevice?: boolean | undefined,
|
||||
newFileType?: number,
|
||||
subDirName?: string,
|
||||
params?: Record<string, any>,
|
||||
) {
|
||||
return requestClient.upload(
|
||||
'/common/oss/upload',
|
||||
{
|
||||
...params,
|
||||
file,
|
||||
fileType: 'file',
|
||||
...(isDevice ? { isDevice } : {}),
|
||||
...(newFileType ? { newFileType } : {}),
|
||||
...(subDirName ? { subDirName } : {}),
|
||||
},
|
||||
{ onUploadProgress, timeout: 60_000 },
|
||||
);
|
||||
}
|
||||
/**
|
||||
* 默认上传结果
|
||||
*/
|
||||
export interface UploadResult {
|
||||
url: string;
|
||||
fileName: string;
|
||||
ossId: string;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @description 用户信息相关接口
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
import type { UserInfo } from '@vben/types';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
export async function getUserInfoApi() {
|
||||
return requestClient.get<UserInfo>('/system/user/info');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取测试分类列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('gen/testCategory/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除测试分类
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('gen/testCategory/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑测试分类
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('gen/testCategory/edit', { ...params });
|
||||
}
|
||||
|
||||
// 修改测试分类状态
|
||||
export function Status(params:any) {
|
||||
return requestClient.post<any>('gen/testCategory/status', { ...params });
|
||||
}
|
||||
|
||||
// 获取测试分类指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('gen/testCategory/view', { params });
|
||||
}
|
||||
|
||||
// 获取测试分类最大排序
|
||||
export function MaxSort(params:any) {
|
||||
return requestClient.get<any>('gen/testCategory/maxSort', { params });
|
||||
}
|
||||
|
||||
// 导出测试分类
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/gen/testCategory/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @description 测试单表相关接口
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取测试单表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('gen/testDemo/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除测试单表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('gen/testDemo/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑测试单表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('gen/testDemo/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取测试单表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('gen/testDemo/view', { params });
|
||||
}
|
||||
|
||||
// 导出测试单表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('/gen/testDemo/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,325 @@
|
||||
/**
|
||||
* @description 代码生成器表格相关接口
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
import type { DictOption } from '#/store/dict';
|
||||
|
||||
export interface SysGenTableListReq {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
genType: number;
|
||||
varName: string;
|
||||
status: string;
|
||||
}
|
||||
export interface SysGenTableListModel {
|
||||
tableId: number; // 生成ID
|
||||
genType: number; // 生成类型
|
||||
genTemplate: number; // 生成模板
|
||||
varName: string; // 实体命名
|
||||
options: string; // 配置选项
|
||||
dbName: string; // 数据库名称
|
||||
tableName: string; // 主表名称
|
||||
tableComment: string; // 主表注释
|
||||
daoName: string; // 主表dao模型
|
||||
masterColumns: string; // 主表字段
|
||||
addonName: string; // 插件名称
|
||||
status: string; // 生成状态(0成功
|
||||
createdDept: number; // 创建组织
|
||||
createdBy: number; // 创建者
|
||||
createdAt: string; // 创建时间
|
||||
}
|
||||
export interface SysGenTableListRes {
|
||||
items: SysGenTableListModel[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export async function getSysGenTableListApi(params: SysGenTableListReq) {
|
||||
return requestClient.get<SysGenTableListRes>('/genCodes/genTable/list', { params });
|
||||
}
|
||||
|
||||
|
||||
export interface SysGenTableAddReq {
|
||||
genType: number;
|
||||
genTemplate: number;
|
||||
varName: string;
|
||||
options: string;
|
||||
dbName: string;
|
||||
tableName: string;
|
||||
tableComment: string;
|
||||
daoName: string;
|
||||
masterColumns: string;
|
||||
addonName: string;
|
||||
}
|
||||
export interface SysGenTableAddRes {
|
||||
tableId: number;
|
||||
}
|
||||
export interface SysGenTableEditReq {
|
||||
tableId: number;
|
||||
genType?: number;
|
||||
genTemplate?: number;
|
||||
varName?: string;
|
||||
options?: any;
|
||||
dbName?: string;
|
||||
tableName?: string;
|
||||
tableComment?: string;
|
||||
daoName?: string;
|
||||
masterColumns?: any;
|
||||
addonName?: string;
|
||||
}
|
||||
|
||||
export interface SysGenTableEditRes {
|
||||
tableId: number;
|
||||
}
|
||||
|
||||
export interface SysGenTableDeleteReq {
|
||||
tableIds: number[];
|
||||
}
|
||||
export interface SysGenTableDeleteRes {
|
||||
tableIds: number[];
|
||||
}
|
||||
export interface SysGenTableJoinModel {
|
||||
uuid: string;
|
||||
dbName: string;
|
||||
masterTableName: string;
|
||||
linkTable: string;
|
||||
alias: string;
|
||||
linkMode: number;
|
||||
field: string;
|
||||
masterField: string;
|
||||
daoName: string;
|
||||
columns: GenCodesColumn[];
|
||||
}
|
||||
|
||||
export interface SysGenTableTreeModel {
|
||||
titleColumn: string;
|
||||
styleType: number;
|
||||
}
|
||||
export interface SysGenTableMenuModel {
|
||||
icon: string;
|
||||
pid: number;
|
||||
sort: number;
|
||||
}
|
||||
export interface SysGenTableFuncDictModel {
|
||||
valueColumn: string|null ;
|
||||
labelColumn: string|null;
|
||||
}
|
||||
export interface SysGenTablePresetStepModel {
|
||||
formGridCols: number;
|
||||
}
|
||||
export interface SysGenTableOptionsModel {
|
||||
headOps?: string[];
|
||||
columnOps?: string[];
|
||||
autoOps?: string[];
|
||||
join?:any[];
|
||||
menu?:SysGenTableMenuModel;
|
||||
funcDict?: SysGenTableFuncDictModel;
|
||||
presetStep?:SysGenTablePresetStepModel;
|
||||
tree?:SysGenTableTreeModel;
|
||||
}
|
||||
|
||||
export interface SysGenTableViewReq {
|
||||
tableId: number;
|
||||
}
|
||||
|
||||
|
||||
export interface SysGenTableViewRes {
|
||||
tableId: number;
|
||||
genType: number;
|
||||
genTemplate: number;
|
||||
varName: string;
|
||||
options: SysGenTableOptionsModel|string;
|
||||
dbName: string;
|
||||
tableName: string;
|
||||
tableComment: string;
|
||||
daoName: string;
|
||||
masterColumns: GenCodesColumn[]|string;
|
||||
addonName: string;
|
||||
status: string;
|
||||
createdDept: number;
|
||||
createdBy: number;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export async function addSysGenTableApi(params: SysGenTableAddReq | {
|
||||
[x: string]: any;
|
||||
}) {
|
||||
return requestClient.post<SysGenTableAddRes>('/genCodes/genTable/add', { ...params });
|
||||
}
|
||||
|
||||
|
||||
export async function deleteSysGenTableApi(params: SysGenTableDeleteReq) {
|
||||
return requestClient.post<SysGenTableDeleteRes>('/genCodes/genTable/delete', { ...params });
|
||||
}
|
||||
|
||||
export async function editSysGenTableApi(params: SysGenTableEditReq) {
|
||||
return requestClient.post<SysGenTableEditRes>('/genCodes/genTable/edit', { ...params });
|
||||
}
|
||||
|
||||
export async function getSysGenTableViewApi(params: SysGenTableViewReq) {
|
||||
return requestClient.get<SysGenTableViewRes>('/genCodes/genTable/view', { params });
|
||||
}
|
||||
|
||||
|
||||
export interface SelectItemModel {
|
||||
value: string|number;
|
||||
label: string;
|
||||
name: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface SelectGenTypeModel extends SelectItemModel,DictOption {
|
||||
templates: SelectGenTemplateModel[];
|
||||
}
|
||||
|
||||
export interface SelectGenTemplateModel extends SelectItemModel {
|
||||
isAddon: boolean;
|
||||
}
|
||||
|
||||
export interface GenCodesSelect {
|
||||
genType: SelectGenTypeModel[];
|
||||
db: SelectItemModel[];
|
||||
status: SelectItemModel[];
|
||||
linkMode: SelectItemModel[];
|
||||
buildMethod: SelectItemModel[];
|
||||
formMode: SelectItemModel[];
|
||||
formRole: SelectItemModel[];
|
||||
whereMode: SelectItemModel[];
|
||||
addons: SelectItemModel[];
|
||||
tableAlign: SelectItemModel[];
|
||||
treeStyleType: SelectItemModel[];
|
||||
dictMode: SelectItemModel[];
|
||||
}
|
||||
|
||||
|
||||
export interface GenCodesSelectsReq {
|
||||
}
|
||||
|
||||
export interface GenCodesSelectsRes extends GenCodesSelect {
|
||||
|
||||
}
|
||||
|
||||
export async function getGenCodesSelectsApi(params: GenCodesSelectsReq) {
|
||||
return requestClient.get<GenCodesSelectsRes>('/genCodes/genTable/selects', { params });
|
||||
}
|
||||
|
||||
export interface DbTableSelectModel {
|
||||
value: string;
|
||||
label: string;
|
||||
name: string;
|
||||
daoName: string;
|
||||
defVarName: string;
|
||||
defAlias: string;
|
||||
defTableComment: string;
|
||||
}
|
||||
export interface GenCodesTableSelectReq {
|
||||
dbGroup: string;
|
||||
}
|
||||
|
||||
export interface GenCodesTableSelectRes {
|
||||
items: DbTableSelectModel[];
|
||||
}
|
||||
|
||||
export async function getGenCodesTableSelectApi(params: GenCodesTableSelectReq) {
|
||||
return requestClient.get<GenCodesTableSelectRes>('/genCodes/genTable/tableSelect', { params });
|
||||
}
|
||||
|
||||
export interface DbColumnSelectModel {
|
||||
value: string;
|
||||
label: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface GenCodesColumnSelectReq {
|
||||
dbGroup: string;
|
||||
tableName: string;
|
||||
}
|
||||
export interface GenCodesColumnSelectRes {
|
||||
items: DbColumnSelectModel[];
|
||||
}
|
||||
|
||||
export async function getGenCodesColumnSelectApi(params: GenCodesColumnSelectReq) {
|
||||
return requestClient.get<GenCodesColumnSelectRes>('/genCodes/genTable/columnSelect', { params });
|
||||
}
|
||||
|
||||
export interface GenCodesColumn {
|
||||
id: number;
|
||||
name: string;
|
||||
dc: string;
|
||||
dataType: string;
|
||||
sqlType: string;
|
||||
length: number;
|
||||
isAllowNull: boolean;
|
||||
defaultValue: any;
|
||||
index: string;
|
||||
extra: string;
|
||||
goName: string;
|
||||
goType: string;
|
||||
tsName: string;
|
||||
tsType: string;
|
||||
isList: boolean;
|
||||
isExport: boolean;
|
||||
isSort: boolean;
|
||||
isQuery: boolean;
|
||||
queryWhere: string;
|
||||
isEdit: boolean;
|
||||
required: boolean;
|
||||
unique: boolean;
|
||||
formMode: string;
|
||||
formRole: string;
|
||||
formGridSpan: number;
|
||||
dictType: number;
|
||||
align: string;
|
||||
width: number;
|
||||
}
|
||||
export interface GenCodesColumnListModel extends GenCodesColumn {
|
||||
|
||||
}
|
||||
|
||||
export interface GenCodesColumnListParam {
|
||||
dbGroup: string;
|
||||
tableName: string;
|
||||
isLink: number;
|
||||
alias: string;
|
||||
}
|
||||
export interface GenCodesColumnListRes {
|
||||
items: GenCodesColumnListModel[];
|
||||
}
|
||||
|
||||
export async function getGenCodesColumnListApi(params: GenCodesColumnListParam) {
|
||||
return requestClient.get<GenCodesColumnListRes>('/genCodes/genTable/columnList', { params });
|
||||
}
|
||||
|
||||
export interface GenCodesPreviewReq extends SysGenTableListModel {
|
||||
|
||||
}
|
||||
export interface GenFile {
|
||||
content: string;
|
||||
path: string;
|
||||
meth: number;
|
||||
required: boolean;
|
||||
}
|
||||
export interface GenCodesPreviewRes {
|
||||
views: Record<string, GenFile>;
|
||||
config?: any;
|
||||
}
|
||||
|
||||
export async function postGenCodesPreviewApi(params: GenCodesPreviewReq) {
|
||||
return requestClient.post<GenCodesPreviewRes>('/genCodes/genTable/preview', { ...params });
|
||||
}
|
||||
|
||||
export interface GenCodesBuildReq extends GenCodesPreviewReq {
|
||||
|
||||
}
|
||||
export interface GenCodesBuildRes {
|
||||
|
||||
}
|
||||
|
||||
export async function postGenCodesBuildApi(params: GenCodesBuildReq) {
|
||||
return requestClient.post<GenCodesBuildRes>('/genCodes/genTable/build', { ...params });
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @description API接口统一导出
|
||||
* @Link https://github.com/xiujiecn/xiu-admin
|
||||
* @Copyright Copyright (c) 2025 LiXiujie
|
||||
* @Author Lxj <li@xiujie.cn>
|
||||
* @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
||||
* @date 2024-03-21
|
||||
*/
|
||||
|
||||
export * from './core';
|
||||
export * from './system';
|
||||
@@ -0,0 +1,47 @@
|
||||
import type {
|
||||
TApiDeleteParam,
|
||||
TApiEditParam,
|
||||
TApiExportParam,
|
||||
TApiListParam,
|
||||
TApiListRes,
|
||||
TApiViewParam,
|
||||
TApiViewRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取API集成列表
|
||||
export function List(params: TApiListParam) {
|
||||
return requestClient.get<TApiListRes>('agent/tApi/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除API集成
|
||||
export function Delete(params: TApiDeleteParam) {
|
||||
return requestClient.post('agent/tApi/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑API集成
|
||||
export function Edit(params: TApiEditParam) {
|
||||
return requestClient.post('agent/tApi/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取API集成指定详情
|
||||
export function View(params: TApiViewParam) {
|
||||
return requestClient.get<TApiViewRes>('agent/tApi/view', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 导出API集成
|
||||
export function Export(params: TApiExportParam) {
|
||||
return requestClient.post<Blob>(
|
||||
'/agent/tApi/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
import type { MemberSumma } from '#/utils';
|
||||
|
||||
/** API集成列表项 */
|
||||
export interface TApiModel {
|
||||
/** ID */
|
||||
id: number;
|
||||
/** APPKey */
|
||||
appKey: string;
|
||||
/** APPSecret */
|
||||
appSecret: string;
|
||||
/** API分组 */
|
||||
groupId: number;
|
||||
/** 限流周期(秒,0:不限流) */
|
||||
rateLimitPeriod: number;
|
||||
/** 限流次数 */
|
||||
rateLimitCount: number;
|
||||
/** 所属机构 */
|
||||
deptId: number;
|
||||
/** 客户编号 */
|
||||
deptKey: string;
|
||||
/** 客户名称 */
|
||||
deptName: string;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门 */
|
||||
createdDept: number;
|
||||
/** 创建者 */
|
||||
createdBy: number;
|
||||
/** 创建者摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者 */
|
||||
updatedBy: number;
|
||||
/** 更新者摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
/** 获取API集成列表 请求参数 */
|
||||
export interface TApiListParam {
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string[];
|
||||
}
|
||||
|
||||
/** 获取API集成列表 响应 */
|
||||
export type TApiListRes = GlobalListRes<TApiModel>;
|
||||
|
||||
/** 导出API集成列表 请求参数 */
|
||||
export type TApiExportParam = TApiListParam;
|
||||
|
||||
/** 修改/新增API集成 请求参数 */
|
||||
export interface TApiEditParam {
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** APPKey */
|
||||
appKey?: string;
|
||||
/** APPSecret */
|
||||
appSecret?: string;
|
||||
/** API分组 */
|
||||
groupId?: number;
|
||||
/** 限流周期(秒,0:不限流) */
|
||||
rateLimitPeriod?: number;
|
||||
/** 限流次数 */
|
||||
rateLimitCount?: number;
|
||||
/** 所属机构 */
|
||||
deptId?: number;
|
||||
/** 租户ID */
|
||||
tenantId?: string;
|
||||
/** 创建部门 */
|
||||
createdDept?: number;
|
||||
/** 创建者 */
|
||||
createdBy?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新者 */
|
||||
updatedBy?: number;
|
||||
/** 更新时间 */
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
/** 获取API集成指定信息 请求参数 */
|
||||
export interface TApiViewParam {
|
||||
/** APPKey */
|
||||
appKey: string;
|
||||
}
|
||||
|
||||
/** 获取API集成指定信息 响应 */
|
||||
export type TApiViewRes = TApiModel;
|
||||
|
||||
/** 删除API集成 请求参数 */
|
||||
export interface TApiDeleteParam {
|
||||
/** 主键ID */
|
||||
id: number | number[];
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import type {
|
||||
TSimChannelTemplateDeleteParam,
|
||||
TSimChannelTemplateEditParam,
|
||||
TSimChannelTemplateExportParam,
|
||||
TSimChannelTemplateListParam,
|
||||
TSimChannelTemplateListRes,
|
||||
TSimChannelTemplateViewParam,
|
||||
TSimChannelTemplateViewRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取通道模板列表
|
||||
export function List(params: TSimChannelTemplateListParam) {
|
||||
return requestClient.get<TSimChannelTemplateListRes>(
|
||||
'iot/tSimChannelTemplate/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 删除/批量删除通道模板
|
||||
export function Delete(params: TSimChannelTemplateDeleteParam) {
|
||||
return requestClient.post('iot/tSimChannelTemplate/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑通道模板
|
||||
export function Edit(params: TSimChannelTemplateEditParam) {
|
||||
return requestClient.post('iot/tSimChannelTemplate/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取通道模板指定详情
|
||||
export function View(params: TSimChannelTemplateViewParam) {
|
||||
return requestClient.get<TSimChannelTemplateViewRes>(
|
||||
'iot/tSimChannelTemplate/view',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 导出通道模板
|
||||
export function Export(params: TSimChannelTemplateExportParam) {
|
||||
return requestClient.post<Blob>(
|
||||
'/iot/tSimChannelTemplate/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
import type { MemberSumma } from '#/utils';
|
||||
|
||||
/** 通道模板列表项 */
|
||||
export interface TSimChannelTemplateModel {
|
||||
/** ID */
|
||||
id: number;
|
||||
/** 模板标识 */
|
||||
tempKey: string;
|
||||
/** 模板名称 */
|
||||
tempName: string;
|
||||
/** 模板模型 */
|
||||
tempModel: string;
|
||||
/** 模板配置 */
|
||||
tempConfig: string;
|
||||
/** 模板状态(0未启用,1启用) */
|
||||
tempStatus: number;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门 */
|
||||
createdDept: number;
|
||||
/** 创建者 */
|
||||
createdBy: number;
|
||||
/** 创建者摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者 */
|
||||
updatedBy: number;
|
||||
/** 更新者摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
/** 获取通道模板指定信息响应项 */
|
||||
export interface TSimChannelTemplateViewModel {
|
||||
/** ID */
|
||||
id: number;
|
||||
/** 模板标识 */
|
||||
tempKey: string;
|
||||
/** 模板名称 */
|
||||
tempName: string;
|
||||
/** 模板模型 */
|
||||
tempModel: string;
|
||||
/** 模板配置 */
|
||||
tempConfig: string;
|
||||
/** 模板状态(0未启用,1启用) */
|
||||
tempStatus: number;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门 */
|
||||
createdDept: number;
|
||||
/** 创建者 */
|
||||
createdBy: number;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者 */
|
||||
updatedBy: number;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
/** 创建者摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 更新者摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
}
|
||||
|
||||
/** 获取通道模板列表 请求参数 */
|
||||
export interface TSimChannelTemplateListParam {
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** 模板标识 */
|
||||
tempKey?: string;
|
||||
/** 模板名称 */
|
||||
tempName?: string;
|
||||
/** 模板模型 */
|
||||
tempModel?: string;
|
||||
/** 模板状态(0未启用,1启用) */
|
||||
tempStatus?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string[];
|
||||
}
|
||||
|
||||
/** 获取通道模板列表 响应 */
|
||||
export type TSimChannelTemplateListRes = GlobalListRes<TSimChannelTemplateModel>;
|
||||
|
||||
/** 导出通道模板列表 请求参数 */
|
||||
export type TSimChannelTemplateExportParam = TSimChannelTemplateListParam;
|
||||
|
||||
/** 修改/新增通道模板 请求参数 */
|
||||
export interface TSimChannelTemplateEditParam {
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** 模板标识 */
|
||||
tempKey?: string;
|
||||
/** 模板名称 */
|
||||
tempName?: string;
|
||||
/** 模板模型 */
|
||||
tempModel?: string;
|
||||
/** 模板配置 */
|
||||
tempConfig?: string;
|
||||
/** 模板状态(0未启用,1启用) */
|
||||
tempStatus?: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 租户ID */
|
||||
tenantId?: string;
|
||||
/** 创建部门 */
|
||||
createdDept?: number;
|
||||
/** 创建者 */
|
||||
createdBy?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新者 */
|
||||
updatedBy?: number;
|
||||
/** 更新时间 */
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
/** 获取通道模板指定信息 请求参数 */
|
||||
export interface TSimChannelTemplateViewParam {
|
||||
/** ID */
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 获取通道模板指定信息 响应 */
|
||||
export type TSimChannelTemplateViewRes = TSimChannelTemplateViewModel;
|
||||
|
||||
/** 删除通道模板 请求参数 */
|
||||
export interface TSimChannelTemplateDeleteParam {
|
||||
/** 主键ID */
|
||||
id: number | number[];
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import type {
|
||||
TSimChannelsDeleteParam,
|
||||
TSimChannelsEditParam,
|
||||
TSimChannelsExportParam,
|
||||
TSimChannelsListParam,
|
||||
TSimChannelsListRes,
|
||||
TSimChannelsTestParam,
|
||||
TSimChannelsTestRes,
|
||||
TSimChannelsViewParam,
|
||||
TSimChannelsViewRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取通道管理列表
|
||||
export function List(params: TSimChannelsListParam) {
|
||||
return requestClient.get<TSimChannelsListRes>('iot/tSimChannels/list', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除/批量删除通道管理
|
||||
export function Delete(params: TSimChannelsDeleteParam) {
|
||||
return requestClient.post('iot/tSimChannels/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑通道管理
|
||||
export function Edit(params: TSimChannelsEditParam) {
|
||||
return requestClient.post('iot/tSimChannels/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取通道管理指定详情
|
||||
export function View(params: TSimChannelsViewParam) {
|
||||
return requestClient.get<TSimChannelsViewRes>('iot/tSimChannels/view', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 导出通道管理
|
||||
export function Export(params: TSimChannelsExportParam) {
|
||||
return requestClient.post<Blob>(
|
||||
'/iot/tSimChannels/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function Test(params: TSimChannelsTestParam) {
|
||||
return requestClient.post<TSimChannelsTestRes>('iot/tSimChannels/test', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 刷新通道卡数量统计 */
|
||||
export function RefreshCardCount() {
|
||||
return requestClient.post('iot/tSimChannels/refresh-card-count');
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
import type { MemberSumma } from '#/utils';
|
||||
|
||||
/** 通道管理列表项 */
|
||||
export interface TSimChannelsModel {
|
||||
/** 库存卡数量 */
|
||||
stockCardCount: number;
|
||||
/** 卡信息数量 */
|
||||
cardInfoCount: number;
|
||||
/** 销户卡数量 */
|
||||
cancellationCardCount: number;
|
||||
/** ID */
|
||||
id: number;
|
||||
/** 运营商:1移动,2联通,3电信 */
|
||||
operator: number;
|
||||
/** 模板标识 */
|
||||
tempKey: string;
|
||||
/** 是否允许同步:0否 1是 */
|
||||
syncEnabled: number;
|
||||
/** 模板名称 */
|
||||
tempName: string;
|
||||
/** 模板模型,用于识别共享 Token 能力 */
|
||||
tempModel?: string;
|
||||
/** 通道编号 */
|
||||
chanKey: string;
|
||||
/** 通道名称 */
|
||||
chanName: string;
|
||||
/** 通道配置 */
|
||||
chanConfig: string;
|
||||
/** 通道状态(0未启用,1启用) */
|
||||
chanStatus: number;
|
||||
/** 是否开放共享Token(0否,1是) */
|
||||
shareEnabled: number;
|
||||
/** 是否正常(0是,1否) */
|
||||
isNormal: null | number;
|
||||
/** 对接信息 */
|
||||
dockingStatus: null | number;
|
||||
/** 通道别名 */
|
||||
chanAlias: string;
|
||||
/** 通道行政区域代码(省市) */
|
||||
regionCode: string;
|
||||
/** 应用标识 */
|
||||
appKey: string;
|
||||
/** 应用密钥 */
|
||||
appSecret: string;
|
||||
/** 接口调用凭证 */
|
||||
accessToken: string;
|
||||
/** 凭证申请时间 */
|
||||
accessTokenCreated: string;
|
||||
/** 凭证过期时间 */
|
||||
accessTokenExpire: string;
|
||||
/** 刷新凭证 */
|
||||
refreshToken: string;
|
||||
/** 刷新凭证申请时间 */
|
||||
refreshTokenCreated: string;
|
||||
/** 刷新凭证过期时间 */
|
||||
refreshTokenExpire: string;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 登录账号 */
|
||||
loginUser: string;
|
||||
/** 登录密码 */
|
||||
loginPassword: string;
|
||||
/** 登录地址 */
|
||||
loginUrl: string;
|
||||
/** 登录状态(0未启用,1启用) */
|
||||
loginState: number;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门 */
|
||||
createdDept: number;
|
||||
/** 创建者 */
|
||||
createdBy: number;
|
||||
/** 创建者摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者 */
|
||||
updatedBy: number;
|
||||
/** 更新者摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
/** 获取通道管理指定信息响应项 */
|
||||
export interface TSimChannelsViewModel {
|
||||
/** ID */
|
||||
id: number;
|
||||
/** 运营商:1移动,2联通,3电信 */
|
||||
operator: number;
|
||||
/** 模板标识 */
|
||||
tempKey: string;
|
||||
/** 是否允许同步:0否 1是 */
|
||||
syncEnabled: number;
|
||||
/** 模板模型,用于识别共享 Token 能力 */
|
||||
tempModel?: string;
|
||||
/** 通道编号 */
|
||||
chanKey: string;
|
||||
/** 通道名称 */
|
||||
chanName: string;
|
||||
/** 通道配置 */
|
||||
chanConfig: string;
|
||||
/** 通道状态(0启用,1停用) */
|
||||
chanStatus: number;
|
||||
/** 是否开放共享Token(0否,1是) */
|
||||
shareEnabled: number;
|
||||
/** 是否正常(0是,1否) */
|
||||
isNormal: null | number;
|
||||
/** 对接信息 */
|
||||
dockingStatus: null | number;
|
||||
/** 通道别名 */
|
||||
chanAlias: string;
|
||||
/** 通道行政区域代码(省市) */
|
||||
regionCode: string;
|
||||
/** 应用标识 */
|
||||
appKey: string;
|
||||
/** 应用密钥 */
|
||||
appSecret: string;
|
||||
/** 接口调用凭证 */
|
||||
accessToken: string;
|
||||
/** 凭证申请时间 */
|
||||
accessTokenCreated: string;
|
||||
/** 凭证过期时间 */
|
||||
accessTokenExpire: string;
|
||||
/** 刷新凭证 */
|
||||
refreshToken: string;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 登录账号 */
|
||||
loginUser: string;
|
||||
/** 登录密码 */
|
||||
loginPassword: string;
|
||||
/** 登录地址 */
|
||||
loginUrl: string;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门 */
|
||||
createdDept: number;
|
||||
/** 创建者 */
|
||||
createdBy: number;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者 */
|
||||
updatedBy: number;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
/** 模板名称 */
|
||||
tempName: string;
|
||||
/** 创建者摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 更新者摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
}
|
||||
|
||||
/** 获取通道管理列表 请求参数 */
|
||||
export interface TSimChannelsListParam {
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** 运营商:1移动,2联通,3电信 */
|
||||
operator?: number;
|
||||
/** 模板标识 */
|
||||
tempKey?: string;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 通道名称 */
|
||||
chanName?: string;
|
||||
/** 通道别名 */
|
||||
chanAlias?: string;
|
||||
/** 通道状态(0未启用,1启用) */
|
||||
chanStatus?: number;
|
||||
shareEnabled?: number;
|
||||
isNormal?: number | null;
|
||||
dockingStatus?: number | null;
|
||||
syncEnabled?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string[];
|
||||
}
|
||||
|
||||
/** 获取通道管理列表 响应 */
|
||||
export type TSimChannelsListRes = GlobalListRes<TSimChannelsModel>;
|
||||
|
||||
/** 导出通道管理列表 请求参数 */
|
||||
export type TSimChannelsExportParam = TSimChannelsListParam;
|
||||
|
||||
/** 修改/新增通道管理 请求参数 */
|
||||
export interface TSimChannelsEditParam {
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** 运营商:1移动,2联通,3电信 */
|
||||
operator?: number;
|
||||
/** 模板标识 */
|
||||
tempKey?: string;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 通道名称 */
|
||||
chanName?: string;
|
||||
/** 通道配置 */
|
||||
chanConfig?: string;
|
||||
/** 通道状态(0未启用,1启用) */
|
||||
chanStatus?: number;
|
||||
/** 是否开放共享Token(0否,1是) */
|
||||
shareEnabled?: number;
|
||||
/** 是否正常(0是,1否) */
|
||||
isNormal?: null | number;
|
||||
/** 对接信息 */
|
||||
dockingStatus?: null | number;
|
||||
/** 通道别名 */
|
||||
chanAlias?: string;
|
||||
/** 通道行政区域代码(省市) */
|
||||
regionCode?: string;
|
||||
/** 应用标识 */
|
||||
appKey?: string;
|
||||
/** 应用密钥 */
|
||||
appSecret?: string;
|
||||
/** 接口调用凭证 */
|
||||
accessToken?: string;
|
||||
/** 凭证申请时间 */
|
||||
accessTokenCreated?: string;
|
||||
/** 凭证过期时间 */
|
||||
accessTokenExpire?: string;
|
||||
/** 刷新凭证 */
|
||||
refreshToken?: string;
|
||||
/** 刷新凭证申请时间 */
|
||||
refreshTokenCreated?: string;
|
||||
/** 刷新凭证过期时间 */
|
||||
refreshTokenExpire?: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 登录账号 */
|
||||
loginUser?: string;
|
||||
/** 登录密码 */
|
||||
loginPassword?: string;
|
||||
/** 登录地址 */
|
||||
loginUrl?: string;
|
||||
/** 登录状态(0未启用,1启用) */
|
||||
loginState?: number;
|
||||
/** 租户ID */
|
||||
tenantId?: string;
|
||||
/** 创建部门 */
|
||||
createdDept?: number;
|
||||
/** 创建者 */
|
||||
createdBy?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新者 */
|
||||
updatedBy?: number;
|
||||
/** 更新时间 */
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
/** 获取通道管理指定信息 请求参数 */
|
||||
export interface TSimChannelsViewParam {
|
||||
/** ID */
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 获取通道管理指定信息 响应 */
|
||||
export type TSimChannelsViewRes = TSimChannelsViewModel;
|
||||
|
||||
/** 删除通道管理 请求参数 */
|
||||
export interface TSimChannelsDeleteParam {
|
||||
/** 主键ID */
|
||||
id: number | number[];
|
||||
}
|
||||
|
||||
/** 通道测试请求参数 */
|
||||
export interface TSimChannelsTestParam {
|
||||
channelId: number;
|
||||
inputMode: 'complete' | 'direct_single' | 'single';
|
||||
cardValueType?: 'iccid' | 'imsi' | 'msisdn';
|
||||
cardValue?: string;
|
||||
iccid?: string;
|
||||
imsi?: string;
|
||||
msisdn?: string;
|
||||
/** 未传时执行全部查询项 */
|
||||
items?: string[];
|
||||
}
|
||||
|
||||
export type TSimChannelsTestItemStatus = 'failed' | 'success' | 'timeout';
|
||||
|
||||
/** 单项测试结果 */
|
||||
export interface TSimChannelsTestItem {
|
||||
key: string;
|
||||
name: string;
|
||||
status: TSimChannelsTestItemStatus;
|
||||
durationMs: number;
|
||||
errorCode?: number;
|
||||
message?: string;
|
||||
data?: unknown;
|
||||
/** 完整通道测试响应 JSON,归属当前单项展示 */
|
||||
responseJson?: string;
|
||||
}
|
||||
|
||||
/** 通道测试响应 */
|
||||
export interface TSimChannelsTestRes {
|
||||
items: TSimChannelsTestItem[];
|
||||
/** Unmodified response body from the channel gateway test endpoint. */
|
||||
gatewayResponseRaw?: string;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import type {
|
||||
TSimCardAllocateBatchSubmitParam,
|
||||
TSimCardAllocateBatchSubmitRes,
|
||||
TSimCardAllocateExcelSubmitParam,
|
||||
TSimCardAllocateInputPrepareParam,
|
||||
TSimCardAllocatePrepareRes,
|
||||
TSimCardAllocateTarget,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardAllocate/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ListTargets(keyword = '') {
|
||||
return requestClient.get<{ items: TSimCardAllocateTarget[] }>(
|
||||
'/iot/tSimCardAllocate/targets',
|
||||
{ params: { keyword } },
|
||||
);
|
||||
}
|
||||
|
||||
export function InputPrepare(params: TSimCardAllocateInputPrepareParam) {
|
||||
return requestClient.post<TSimCardAllocatePrepareRes>(
|
||||
'/iot/tSimCardAllocate/input/prepare',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
export function ExcelSubmit(params: TSimCardAllocateExcelSubmitParam) {
|
||||
const data: Record<string, any> & { file: File } = {
|
||||
file: params.file,
|
||||
remark: params.remark ?? '',
|
||||
};
|
||||
if (params.targetDeptId) {
|
||||
data.targetDeptId = String(params.targetDeptId);
|
||||
}
|
||||
return requestClient.upload<TSimCardAllocatePrepareRes>(
|
||||
'/iot/tSimCardAllocate/excel/submit',
|
||||
data,
|
||||
{ timeout: 10 * 60_000 },
|
||||
);
|
||||
}
|
||||
|
||||
export function BatchSubmit(params: TSimCardAllocateBatchSubmitParam) {
|
||||
return requestClient.post<TSimCardAllocateBatchSubmitRes>(
|
||||
'/iot/tSimCardAllocate/batch/submit',
|
||||
params,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
export interface TSimCardAllocateTarget {
|
||||
deptId: number;
|
||||
parentId: number;
|
||||
deptKey?: string;
|
||||
deptName: string;
|
||||
deptCategory?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardAllocateInputPrepareParam {
|
||||
input: string;
|
||||
targetDeptId: number;
|
||||
}
|
||||
|
||||
export interface TSimCardAllocateExcelSubmitParam {
|
||||
file: File;
|
||||
targetDeptId?: number;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardAllocateBatchSubmitParam {
|
||||
batchNo: string;
|
||||
targetDeptId?: number;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardAllocateBatchDetail {
|
||||
rowNo: number;
|
||||
itemId: string;
|
||||
targetDeptId?: number;
|
||||
targetDeptKey?: string;
|
||||
targetDeptName?: string;
|
||||
status: string;
|
||||
errorReason?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardAllocatePrepareRes {
|
||||
batchNo: string;
|
||||
batchType: number;
|
||||
batchAsyncStatus?: number;
|
||||
target?: TSimCardAllocateTarget;
|
||||
totalCount: number;
|
||||
validCount: number;
|
||||
failCount: number;
|
||||
failReason?: string;
|
||||
status: string;
|
||||
details: TSimCardAllocateBatchDetail[];
|
||||
}
|
||||
|
||||
export type TSimCardAllocateBatchSubmitRes = TSimCardAllocatePrepareRes;
|
||||
@@ -0,0 +1,94 @@
|
||||
import type {
|
||||
TSimAddPackageBatchConfirmParam,
|
||||
TSimAddPackageBatchConfirmRes,
|
||||
TSimAddPackageOptionsRes,
|
||||
TSimAddPackagePrepareResult,
|
||||
TSimBindPackageAddPackageExcelSubmitParam,
|
||||
TSimBindPackageAddPackageInputPrepareParam,
|
||||
TSimBindPackageAddPackageInputPrepareRes,
|
||||
TSimBindPackageAddPackageInputSubmitParam,
|
||||
TSimBindPackageAddPackageSubmitRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取卡绑定套餐列表
|
||||
export function List(params: any) {
|
||||
return requestClient.get<any>('iot/tSimCardBindPkg/list', { params });
|
||||
}
|
||||
|
||||
// 获取卡套餐详情
|
||||
export function GetPkgInfo(params: any) {
|
||||
return requestClient.get<any>('iot/tSimCardBindPkg/getPkgInfo', { params });
|
||||
}
|
||||
|
||||
// 获取变更套餐
|
||||
export function GetChangePkg(params: any) {
|
||||
return requestClient.get<any>('iot/tSimCardBindPkg/getChangePkg', { params });
|
||||
}
|
||||
|
||||
export function DownloadAddPackageTemplate() {
|
||||
return requestClient.download(
|
||||
'/iot/tSimCardBindPkg/addPackage/excel/template',
|
||||
{
|
||||
responseReturn: 'raw',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackageExcelSubmit(
|
||||
params: TSimBindPackageAddPackageExcelSubmitParam,
|
||||
): Promise<TSimBindPackageAddPackageSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardBindPkg/addPackage/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
manualConfirm: params.manualConfirm,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackageOptions(params: {
|
||||
iccids: string[];
|
||||
}): Promise<TSimAddPackageOptionsRes> {
|
||||
return requestClient.post('/iot/tSimCardBindPkg/addPackage/options', params);
|
||||
}
|
||||
|
||||
export function AddPackagePaymentContext(): Promise<TSimAddPackageOptionsRes> {
|
||||
return requestClient.post('/iot/tSimCardBindPkg/addPackage/payment-context');
|
||||
}
|
||||
|
||||
export function AddPackageInputSubmit(
|
||||
params: TSimBindPackageAddPackageInputSubmitParam,
|
||||
): Promise<TSimBindPackageAddPackageSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardBindPkg/addPackage/input/submit', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
export function AddPackageInputPrepare(
|
||||
params: TSimBindPackageAddPackageInputPrepareParam,
|
||||
): Promise<TSimBindPackageAddPackageInputPrepareRes> {
|
||||
return requestClient.post('/iot/tSimCardBindPkg/addPackage/input/prepare', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
export function AddPackagePrepareResult(
|
||||
batchNo: string,
|
||||
): Promise<TSimAddPackagePrepareResult> {
|
||||
return requestClient.get('/iot/tSimCardBindPkg/addPackage/prepare/result', {
|
||||
params: { batchNo },
|
||||
});
|
||||
}
|
||||
|
||||
export function AddPackageBatchConfirm(
|
||||
params: TSimAddPackageBatchConfirmParam,
|
||||
): Promise<TSimAddPackageBatchConfirmRes> {
|
||||
return requestClient.post('/iot/tSimCardBindPkg/addPackage/batch/confirm', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
export type AddPackageEffectiveMode = 'current_month';
|
||||
export type AddPackagePaymentMode = 'balance' | 'offline';
|
||||
|
||||
export interface TSimBindPackageAddPackageExcelSubmitParam {
|
||||
file: File;
|
||||
paymentMode?: AddPackagePaymentMode;
|
||||
offlineContractCompleted?: boolean;
|
||||
manualConfirm?: boolean;
|
||||
}
|
||||
|
||||
export interface TSimBindPackageAddPackageInputSubmitParam {
|
||||
input: string;
|
||||
packageCode?: string;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
remark?: string;
|
||||
paymentMode?: AddPackagePaymentMode;
|
||||
offlineContractCompleted?: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimBindPackageAddPackageInputPrepareParam {
|
||||
input: string;
|
||||
packageCode?: string;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
remark?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimBindPackageAddPackageSubmitRes {
|
||||
batchAsyncStatus?: number;
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
targetBatchType?: number;
|
||||
total?: number;
|
||||
validCount?: number;
|
||||
failCount?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type TSimBindPackageAddPackageInputPrepareRes =
|
||||
TSimAddPackagePrepareResult;
|
||||
|
||||
export interface TSimAddPackageBatchConfirmParam {
|
||||
batchNo: string;
|
||||
packageCode?: string;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
remark?: string;
|
||||
paymentMode?: AddPackagePaymentMode | string;
|
||||
offlineContractCompleted?: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimAddPackageBatchConfirmRes {
|
||||
batchAsyncStatus?: number;
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
packageCode?: string;
|
||||
status?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimAddPackagePaymentAccount {
|
||||
payerDeptId: number;
|
||||
targetCount: number;
|
||||
requiredAmount: number | string;
|
||||
availableBalance: number | string;
|
||||
balanceEnough: boolean;
|
||||
}
|
||||
|
||||
export interface TSimAddPackageOption {
|
||||
flowMb: number;
|
||||
packageCode: string;
|
||||
packageName: string;
|
||||
unitPrice?: number | string;
|
||||
totalAmount?: number | string;
|
||||
priceAvailable?: boolean;
|
||||
priceReason?: string;
|
||||
paymentAccounts?: TSimAddPackagePaymentAccount[];
|
||||
}
|
||||
|
||||
export interface TSimAddPackageOptionsRes {
|
||||
items: TSimAddPackageOption[];
|
||||
isTopDept?: boolean;
|
||||
defaultPaymentMode?: AddPackagePaymentMode | string;
|
||||
availableBalance?: number | string;
|
||||
}
|
||||
|
||||
export interface TSimAddPackagePrepareResult {
|
||||
availableBalance?: number | string;
|
||||
batchAsyncStatus?: number;
|
||||
batchInfo?: Record<string, any>;
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
effectiveModeText?: string;
|
||||
effectiveTime?: string;
|
||||
expectedExpireTime?: string;
|
||||
failCount?: number;
|
||||
failReason?: string;
|
||||
flowMb?: number | string;
|
||||
isTopDept?: boolean;
|
||||
packageCode?: string;
|
||||
packageName?: string;
|
||||
paymentAccounts?: TSimAddPackagePaymentAccount[];
|
||||
availablePackages?: TSimAddPackageOption[];
|
||||
quantity?: number;
|
||||
runResult?: number;
|
||||
snapshot?: Record<string, any>;
|
||||
status?: string;
|
||||
successCount?: number;
|
||||
targetBatchType?: number;
|
||||
total?: number;
|
||||
totalAmount?: number | string;
|
||||
unitPrice?: number | string;
|
||||
validCount?: number;
|
||||
defaultPaymentMode?: AddPackagePaymentMode | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import type {
|
||||
TSimCardCancelExcelSubmitParam,
|
||||
TSimCardCancelInputSubmitParam,
|
||||
TSimCardCancelSubmitRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardCancel/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardCancelExcelSubmitParam,
|
||||
): Promise<TSimCardCancelSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardCancel/excel/submit',
|
||||
{ file: params.file },
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardCancelInputSubmitParam,
|
||||
): Promise<TSimCardCancelSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardCancel/input/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/** 提交Excel卡销户请求参数 */
|
||||
export interface TSimCardCancelExcelSubmitParam {
|
||||
/** Excel文件 */
|
||||
file: File;
|
||||
}
|
||||
|
||||
/** 提交批量输入卡销户请求参数 */
|
||||
export interface TSimCardCancelInputSubmitParam {
|
||||
/** 批量输入ICCID文本 */
|
||||
input: string;
|
||||
/** 销户备注 */
|
||||
remark?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 卡销户提交响应 */
|
||||
export interface TSimCardCancelSubmitRes {
|
||||
/** 批次异步处理状态(Pending 等) */
|
||||
batchAsyncStatus?: number;
|
||||
/** 批次号 */
|
||||
batchNo?: string;
|
||||
/** 批次类型 */
|
||||
batchType?: number;
|
||||
/** 失败行数 */
|
||||
failCount?: number;
|
||||
/** 实际销户数量 */
|
||||
quantity?: number;
|
||||
/** 结果下载任务ID */
|
||||
resultDownloadId?: number;
|
||||
/** 结果文件OSS ID */
|
||||
resultFileOssId?: number;
|
||||
/** 导入状态 */
|
||||
status?: string;
|
||||
/** 解析总行数 */
|
||||
total?: number;
|
||||
/** 校验通过行数 */
|
||||
validCount?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const get = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
get,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardChange api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
get.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads excel change template from backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardChange/excel/template',
|
||||
{
|
||||
responseReturn: 'raw',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('submits excel change as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'change.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardChange/excel/submit',
|
||||
{ file },
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('prepares input change with backend contract path', async () => {
|
||||
const { InputPrepare } = await import('./index');
|
||||
const params = {
|
||||
durationMonths: 6,
|
||||
effectiveMode: 'immediate' as const,
|
||||
input: '8986000000000000001\n8986000000000000002',
|
||||
newPackageCode: 'PKG002',
|
||||
offlineContractCompleted: true,
|
||||
};
|
||||
|
||||
InputPrepare(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardChange/input/prepare', {
|
||||
...params,
|
||||
});
|
||||
});
|
||||
|
||||
it('prepares range change with backend contract path', async () => {
|
||||
const { RangePrepare } = await import('./index');
|
||||
const params = {
|
||||
durationMonths: 6,
|
||||
effectiveMode: 'next_month' as const,
|
||||
endIccid: '8986000000000000009',
|
||||
endImsi: '460000000000009',
|
||||
endMsisdn: '13000000009',
|
||||
newPackageCode: 'PKG002',
|
||||
offlineContractCompleted: true,
|
||||
startIccid: '8986000000000000001',
|
||||
startImsi: '460000000000001',
|
||||
startMsisdn: '13000000001',
|
||||
};
|
||||
|
||||
RangePrepare(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardChange/range/prepare', {
|
||||
...params,
|
||||
});
|
||||
});
|
||||
|
||||
it('submits change prepare batch with backend contract path', async () => {
|
||||
const { BatchSubmit } = await import('./index');
|
||||
const params = {
|
||||
batchNo: 'CH202607060001',
|
||||
durationMonths: 6,
|
||||
effectiveMode: 'immediate' as const,
|
||||
newPackageCode: 'PKG002',
|
||||
offlineContractCompleted: true,
|
||||
};
|
||||
|
||||
BatchSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardChange/batch/submit', {
|
||||
...params,
|
||||
});
|
||||
});
|
||||
|
||||
it('polls change prepare result with backend contract path', async () => {
|
||||
const { PrepareResult } = await import('./index');
|
||||
const batchNo = 'CH202607060001';
|
||||
|
||||
PrepareResult(batchNo);
|
||||
|
||||
expect(get).toHaveBeenCalledWith('/iot/tSimCardChange/prepare/result', {
|
||||
params: { batchNo },
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,77 @@
|
||||
import type {
|
||||
TSimCardChangeBatchPrepareRes,
|
||||
TSimCardChangeBatchPrepareResult,
|
||||
TSimCardChangeBatchSubmitParam,
|
||||
TSimCardChangeBatchSubmitRes,
|
||||
TSimCardChangeExcelSubmitParam,
|
||||
TSimCardChangeExcelSubmitRes,
|
||||
TSimCardChangeInputPrepareParam,
|
||||
TSimCardChangeInputOptionsParam,
|
||||
TSimCardChangeOptionsRes,
|
||||
TSimCardChangeRangePrepareParam,
|
||||
TSimCardChangeRangeOptionsParam,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardChange/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardChangeExcelSubmitParam,
|
||||
): Promise<TSimCardChangeExcelSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardChange/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputOptions(params: TSimCardChangeInputOptionsParam) {
|
||||
return requestClient.post<TSimCardChangeOptionsRes>(
|
||||
'/iot/tSimCardChange/input/change-options',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
export function RangeOptions(params: TSimCardChangeRangeOptionsParam) {
|
||||
return requestClient.post<TSimCardChangeOptionsRes>(
|
||||
'/iot/tSimCardChange/range/change-options',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
export function InputPrepare(params: TSimCardChangeInputPrepareParam) {
|
||||
return requestClient.post<TSimCardChangeBatchPrepareRes>(
|
||||
'/iot/tSimCardChange/input/prepare',
|
||||
{ ...params },
|
||||
);
|
||||
}
|
||||
|
||||
export function RangePrepare(params: TSimCardChangeRangePrepareParam) {
|
||||
return requestClient.post<TSimCardChangeBatchPrepareRes>(
|
||||
'/iot/tSimCardChange/range/prepare',
|
||||
{ ...params },
|
||||
);
|
||||
}
|
||||
|
||||
export function BatchSubmit(params: TSimCardChangeBatchSubmitParam) {
|
||||
return requestClient.post<TSimCardChangeBatchSubmitRes>(
|
||||
'/iot/tSimCardChange/batch/submit',
|
||||
{ ...params },
|
||||
);
|
||||
}
|
||||
|
||||
export function PrepareResult(batchNo: string) {
|
||||
return requestClient.get<TSimCardChangeBatchPrepareResult>(
|
||||
'/iot/tSimCardChange/prepare/result',
|
||||
{ params: { batchNo } },
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
export type TSimCardChangeEffectiveMode = 'immediate' | 'next_month';
|
||||
|
||||
export interface TSimCardChangeInputPrepareParam {
|
||||
durationMonths: number;
|
||||
effectiveMode: TSimCardChangeEffectiveMode;
|
||||
giftDurationMonths?: number;
|
||||
input: string;
|
||||
newPackageCode: string;
|
||||
offlineContractCompleted: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardChangeExcelSubmitParam {
|
||||
file: File;
|
||||
}
|
||||
|
||||
export interface TSimCardChangeExcelSubmitRes {
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
resultDownloadId?: number;
|
||||
resultFileOssId?: number;
|
||||
status?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardChangeInputOptionsParam {
|
||||
input: string;
|
||||
}
|
||||
|
||||
export interface TSimCardChangeRangeOptionsParam {
|
||||
endIccid: string;
|
||||
endImsi: string;
|
||||
endMsisdn: string;
|
||||
startIccid: string;
|
||||
startImsi: string;
|
||||
startMsisdn: string;
|
||||
}
|
||||
|
||||
export interface TSimCardChangePackageOption {
|
||||
changeUnitPrice?: number | string;
|
||||
flowMb?: number;
|
||||
packageCode: string;
|
||||
packageName: string;
|
||||
packageType?: number;
|
||||
renewableDurationOptions?: number[];
|
||||
}
|
||||
|
||||
export interface TSimCardChangeOptionsRes {
|
||||
customerAgentId?: number;
|
||||
customerName?: string;
|
||||
oldPackageCode?: string;
|
||||
oldPackageName?: string;
|
||||
oldPackageType?: number;
|
||||
packages?: TSimCardChangePackageOption[];
|
||||
quantity?: number;
|
||||
}
|
||||
|
||||
export interface TSimCardChangeBatchPrepareRes {
|
||||
batchNo: string;
|
||||
batchType?: number;
|
||||
agentDefaultPriceId?: number;
|
||||
changeUnitPrice?: number | string;
|
||||
customerAgentId?: number;
|
||||
customerName?: string;
|
||||
failCount?: number;
|
||||
newPackageCode?: string;
|
||||
newPackageFlowMb?: number;
|
||||
newPackageName?: string;
|
||||
newPackageType?: number;
|
||||
oldPackageCode?: string;
|
||||
oldPackageFlowMb?: number;
|
||||
oldPackageName?: string;
|
||||
oldPackageType?: number;
|
||||
priceSource?: string;
|
||||
quantity?: number;
|
||||
renewableDurationOptions?: number[];
|
||||
resultDownloadId?: number;
|
||||
resultFileOssId?: number;
|
||||
sourceBatchNo?: string;
|
||||
status?: string;
|
||||
targetBatchType?: number;
|
||||
targetPriceId?: number;
|
||||
total?: number;
|
||||
validCount?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardChangeRangePrepareParam {
|
||||
durationMonths: number;
|
||||
effectiveMode: TSimCardChangeEffectiveMode;
|
||||
endIccid: string;
|
||||
endImsi: string;
|
||||
endMsisdn: string;
|
||||
giftDurationMonths?: number;
|
||||
newPackageCode: string;
|
||||
offlineContractCompleted: boolean;
|
||||
startIccid: string;
|
||||
startImsi: string;
|
||||
startMsisdn: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardChangeBatchSubmitParam {
|
||||
adminNote?: string;
|
||||
batchNo: string;
|
||||
buyerNote?: string;
|
||||
durationMonths: number;
|
||||
effectiveMode: TSimCardChangeEffectiveMode;
|
||||
giftDurationMonths?: number;
|
||||
newPackageCode: string;
|
||||
offlineContractCompleted: boolean;
|
||||
remark?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardChangeBatchSubmitRes {
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
changeUnitPrice?: number | string;
|
||||
customerAgentId?: number;
|
||||
customerName?: string;
|
||||
durationMonths?: number;
|
||||
effectiveMode?: string;
|
||||
giftDurationMonths?: number;
|
||||
newPackageCode?: string;
|
||||
newPackageName?: string;
|
||||
oldPackageCode?: string;
|
||||
oldPackageName?: string;
|
||||
orderSn?: string;
|
||||
packageBeginTime?: string;
|
||||
packageEndTime?: string;
|
||||
quantity?: number;
|
||||
sourceBatchNo?: string;
|
||||
status?: string;
|
||||
totalAmount?: number | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type TSimCardChangeBatchAsyncStatus = number;
|
||||
|
||||
export interface TSimCardChangeBatchPrepareResult {
|
||||
batchAsyncStatus: TSimCardChangeBatchAsyncStatus;
|
||||
batchInfo?: TSimCardChangeBatchPrepareRes;
|
||||
batchNo: string;
|
||||
failReason?: string;
|
||||
runResult?: number;
|
||||
status: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardDataCut api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads the data cut template from the backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith('/iot/tSimCardDataCut/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
});
|
||||
|
||||
it('submits an excel data cut batch with the batch threshold', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'dataCut.xlsx');
|
||||
|
||||
ExcelSubmit({ file, trafficCutoffThreshold: 1024.125 });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardDataCut/excel/submit',
|
||||
{ file, trafficCutoffThreshold: 1024.125 },
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an input data cut batch from the backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
input: '8986000000000000001',
|
||||
trafficCutoffThreshold: 2048,
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardDataCut/input/submit', params);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import type {
|
||||
TSimCardDataCutExcelSubmitParam,
|
||||
TSimCardDataCutInputSubmitParam,
|
||||
TSimCardDataCutSubmitRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardDataCut/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardDataCutExcelSubmitParam,
|
||||
): Promise<TSimCardDataCutSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardDataCut/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
trafficCutoffThreshold: params.trafficCutoffThreshold,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardDataCutInputSubmitParam,
|
||||
): Promise<TSimCardDataCutSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardDataCut/input/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
export interface TSimCardDataCutExcelSubmitParam {
|
||||
file: File;
|
||||
trafficCutoffThreshold: number;
|
||||
}
|
||||
|
||||
export interface TSimCardDataCutInputSubmitParam {
|
||||
input: string;
|
||||
trafficCutoffThreshold: number;
|
||||
}
|
||||
|
||||
export interface TSimCardDataCutSubmitRes {
|
||||
batchNo: string;
|
||||
batchType: number;
|
||||
batchAsyncStatus: number;
|
||||
total: number;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardDataStart api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads the data start template from the backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith('/iot/tSimCardDataStart/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
});
|
||||
|
||||
it('submits an excel data start batch as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'dataStart.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardDataStart/excel/submit',
|
||||
{ file },
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an input data start batch from the backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
input: '8986000000000000001',
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardDataStart/input/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import type {
|
||||
TSimCardLifecycleExcelSubmitParam,
|
||||
TSimCardLifecycleInputSubmitParam,
|
||||
TSimCardLifecycleSubmitRes,
|
||||
} from '../tSimCardLifecycle/type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardDataStart/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardLifecycleExcelSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardDataStart/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardLifecycleInputSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardDataStart/input/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardDataStop api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads the data stop template from the backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith('/iot/tSimCardDataStop/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
});
|
||||
|
||||
it('submits an excel data stop batch as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'dataStop.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardDataStop/excel/submit',
|
||||
{ file },
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an input data stop batch from the backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
input: '8986000000000000001 14000000001 460001000000001',
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardDataStop/input/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import type {
|
||||
TSimCardLifecycleExcelSubmitParam,
|
||||
TSimCardLifecycleInputSubmitParam,
|
||||
TSimCardLifecycleSubmitRes,
|
||||
} from '../tSimCardLifecycle/type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardDataStop/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardLifecycleExcelSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardDataStop/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardLifecycleInputSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardDataStop/input/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const get = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
get,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardInfo session api', () => {
|
||||
beforeEach(() => {
|
||||
get.mockReset();
|
||||
});
|
||||
|
||||
it('queries session without showing a global failure message', async () => {
|
||||
const { QuerySimSession } = await import('./index');
|
||||
const params = { iccid: '8986000000000000001' };
|
||||
|
||||
QuerySimSession(params);
|
||||
|
||||
expect(get).toHaveBeenCalledWith('iot/tSimCardInfo/querySimSession', {
|
||||
params,
|
||||
errorMessageMode: 'none',
|
||||
});
|
||||
});
|
||||
|
||||
it('queries status without showing a global failure message', async () => {
|
||||
const { QuerySimStatus } = await import('./index');
|
||||
const params = { iccid: '8986000000000000001' };
|
||||
|
||||
QuerySimStatus(params);
|
||||
|
||||
expect(get).toHaveBeenCalledWith('iot/tSimCardInfo/querySimStatus', {
|
||||
params,
|
||||
errorMessageMode: 'none',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,71 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取卡信息表列表
|
||||
export function List(params: any) {
|
||||
return requestClient.get<any>('iot/tSimCardInfo/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除卡信息表
|
||||
export function Delete(params: any) {
|
||||
return requestClient.post<any>('iot/tSimCardInfo/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑卡信息表
|
||||
export function Edit(params: any) {
|
||||
return requestClient.post<any>('iot/tSimCardInfo/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取卡信息表指定详情
|
||||
export function View(params: any) {
|
||||
return requestClient.get<any>('iot/tSimCardInfo/view', { params });
|
||||
}
|
||||
|
||||
// 导出卡信息表
|
||||
export function Export(params: any) {
|
||||
return requestClient.post<Blob>(
|
||||
'/iot/tSimCardInfo/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
// 同步单张SIM卡用量
|
||||
export function SyncSimCardFlow(params: any) {
|
||||
return requestClient.post<any>('iot/tSimCardInfo/syncSimCardFlow', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
// 同步SIM卡状态
|
||||
export function SyncSimCardStatus(params: any) {
|
||||
return requestClient.post<any>('iot/tSimCardInfo/syncSimCardStatus', {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
// // 查询SIM卡会话
|
||||
// export function QuerySimSession(params: TSimCardInfoQuerySimSessionParam) {
|
||||
// return requestClient.get<TSimCardInfoQuerySimSessionRes>(
|
||||
// 'iot/tSimCardInfo/querySimSession',
|
||||
// { params },
|
||||
// );
|
||||
// }
|
||||
// 查询SIM卡会话
|
||||
export function QuerySimSession(params: any) {
|
||||
return requestClient.get<any>('iot/tSimCardInfo/querySimSession', {
|
||||
params,
|
||||
errorMessageMode: 'none',
|
||||
});
|
||||
}
|
||||
|
||||
// 查询SIM卡状态
|
||||
export function QuerySimStatus(params: any) {
|
||||
return requestClient.get<any>('iot/tSimCardInfo/querySimStatus', {
|
||||
params,
|
||||
errorMessageMode: 'none',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
import type { MemberSumma } from '#/utils';
|
||||
|
||||
/** 卡信息表列表项 */
|
||||
export interface TSimCardInfoModel {
|
||||
/** 主键ID */
|
||||
id: number;
|
||||
/** ICCID */
|
||||
iccid: string;
|
||||
/** MSISDN/卡号 */
|
||||
msisdn: string;
|
||||
/** IMSI */
|
||||
imsi: string;
|
||||
/** IMEI */
|
||||
imei: string;
|
||||
/** 归属地 */
|
||||
regionCode: string;
|
||||
/** 渠道客户ID */
|
||||
deptId: number;
|
||||
/** 渠道客户名称 */
|
||||
deptName: string;
|
||||
/** 当前套餐编号 */
|
||||
currentPackageCode: string;
|
||||
/** 当前套餐名称 */
|
||||
packageName: string;
|
||||
/** 套餐状态:0 无套餐,1待生效,2生效中,3已过期 */
|
||||
packageStatus: number;
|
||||
/** 接入方式:ipv4、ipv6、ipv4_ipv6 */
|
||||
accessType: number;
|
||||
/** 运营商卡状态 枚举 */
|
||||
bossCardStatus: number;
|
||||
/** 卡类型 枚举 */
|
||||
cardType: number;
|
||||
/** 运营商开户日期 */
|
||||
bossOpenAt: string;
|
||||
/** 运营商激活日期 */
|
||||
bossActivateAt: string;
|
||||
/** 是否按运营商激活减去赠送时长方:1是,0否 */
|
||||
isBossActivateEnabled: number;
|
||||
/** 入库批次 */
|
||||
inboundBatchNo: string;
|
||||
/** 出库批次 */
|
||||
outboundBatchNo: string;
|
||||
/** 划拨批次 */
|
||||
allocationBatchNo: string;
|
||||
/** 是否为池卡:1是,0否 */
|
||||
isFlowPool: number;
|
||||
/** 流量池编号 */
|
||||
flowPoolCode: string;
|
||||
/** 当前套餐生效时间 */
|
||||
flowPkgBeginAt: string;
|
||||
/** 套餐赠送结束时间 */
|
||||
flowPkgPresentAt: string;
|
||||
/** 实际赠送结束时间 */
|
||||
flowPkgRealPresentAt: string;
|
||||
/** 当前套餐预计到期时间 */
|
||||
flowPkgEndAt: string;
|
||||
/** 数据服务状态:1启用、0禁用 */
|
||||
dataServiceStatus: number;
|
||||
/** 套餐总流量MB */
|
||||
packageTotalFlowMb: number;
|
||||
/** 已用流量MB */
|
||||
usedFlowMb: number;
|
||||
/** 达量断网配置状态(0未配置 1已开启 2已关闭) */
|
||||
trafficCutoffStatus: number;
|
||||
/** 达量断网阈值 */
|
||||
trafficCutoffThreshold: number;
|
||||
/** 短信服务状态:1启用、0禁用 */
|
||||
smsServiceStatus: number;
|
||||
/** 套餐短信总条数 */
|
||||
packageTotalSms: number;
|
||||
/** 已用短信条数 */
|
||||
usedSms: number;
|
||||
/** 语音服务状态:1启用、0禁用 */
|
||||
voiceServiceStatus: number;
|
||||
/** 套餐语音总分钟数 */
|
||||
packageTotalVoice: number;
|
||||
/** 已用语音分钟数 */
|
||||
usedVoice: number;
|
||||
/** 国漫服务状态:1启用、0禁用 */
|
||||
roamServiceStatus: number;
|
||||
/** 套餐国际流量MB */
|
||||
packageTotalRoamFlowMb: number;
|
||||
/** 已用国际流量MB */
|
||||
usedRoamFlowMb: number;
|
||||
/** 状态最后一次同步时间 */
|
||||
statusSyncTime: string;
|
||||
/** 流量最后一次同步时间 */
|
||||
flowSyncTime: string;
|
||||
/** 短信最后一次同步时间 */
|
||||
smsSyncTime: string;
|
||||
/** 语音最后一次同步时间 */
|
||||
voiceSyncTime: string;
|
||||
/** 国漫最后一次同步时间 */
|
||||
roamSyncTime: string;
|
||||
/** 是否收取附加费:1是,0否 */
|
||||
extraFeeEnabled: number;
|
||||
/** 附加费用倍数 */
|
||||
extraFeeMultiple: number;
|
||||
/** 附加金额 */
|
||||
extraFee: number;
|
||||
/** 通道编号 */
|
||||
chanKey: string;
|
||||
/** 通道名称 */
|
||||
chanName: string;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 网络类型:4G、5G、NB-IoT */
|
||||
netModel: number;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门 */
|
||||
createdDept: number;
|
||||
/** 创建者 */
|
||||
createdBy: number;
|
||||
/** 创建者摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者 */
|
||||
updatedBy: number;
|
||||
/** 更新者摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
/** 获取卡信息表指定信息响应项 */
|
||||
export interface TSimCardInfoViewModel {
|
||||
/** 通道名称 */
|
||||
chanName: string;
|
||||
/** 部门名称 */
|
||||
deptName: string;
|
||||
/** 套餐名称 */
|
||||
packageName: string;
|
||||
/** 剩余流量MB */
|
||||
reminFlowMb: number;
|
||||
/** 主键ID */
|
||||
id: number;
|
||||
/** ICCID */
|
||||
iccid: string;
|
||||
/** MSISDN/卡号 */
|
||||
msisdn: string;
|
||||
/** IMSI */
|
||||
imsi: string;
|
||||
/** IMEI */
|
||||
imei: string;
|
||||
/** 归属地 */
|
||||
regionCode: string;
|
||||
/** 渠道客户ID */
|
||||
deptId: number;
|
||||
/** 当前套餐编号 */
|
||||
currentPackageCode: string;
|
||||
/** 套餐状态:0 无套餐,1待生效,2生效中,3已过期 */
|
||||
packageStatus: number;
|
||||
/** 接入方式:ipv4、ipv6、ipv4_ipv6 */
|
||||
accessType: number;
|
||||
/** 运营商卡状态 枚举 */
|
||||
bossCardStatus: number;
|
||||
/** 卡类型 枚举 */
|
||||
cardType: number;
|
||||
/** 运营商开户日期 */
|
||||
bossOpenAt: string;
|
||||
/** 运营商激活日期 */
|
||||
bossActivateAt: string;
|
||||
/** 是否按运营商激活减去赠送时长方:1是,0否 */
|
||||
isBossActivateEnabled: number;
|
||||
/** 入库批次 */
|
||||
inboundBatchNo: string;
|
||||
/** 出库批次 */
|
||||
outboundBatchNo: string;
|
||||
/** 划拨批次 */
|
||||
allocationBatchNo: string;
|
||||
/** 是否为池卡:1是,0否 */
|
||||
isFlowPool: number;
|
||||
/** 流量池编号 */
|
||||
flowPoolCode: string;
|
||||
/** 当前套餐生效时间 */
|
||||
flowPkgBeginAt: string;
|
||||
/** 套餐赠送结束时间 */
|
||||
flowPkgPresentAt: string;
|
||||
/** 实际赠送结束时间 */
|
||||
flowPkgRealPresentAt: string;
|
||||
/** 当前套餐预计到期时间 */
|
||||
flowPkgEndAt: string;
|
||||
/** 数据服务状态:1启用、0禁用 */
|
||||
dataServiceStatus: number;
|
||||
/** 套餐总流量MB */
|
||||
packageTotalFlowMb: number;
|
||||
/** 已用流量MB */
|
||||
usedFlowMb: number;
|
||||
/** 达量断网配置状态(0未配置 1已开启 2已关闭) */
|
||||
trafficCutoffStatus: number;
|
||||
/** 达量断网阈值 */
|
||||
trafficCutoffThreshold: number;
|
||||
/** 短信服务状态:1启用、0禁用 */
|
||||
smsServiceStatus: number;
|
||||
/** 套餐短信总条数 */
|
||||
packageTotalSms: number;
|
||||
/** 已用短信条数 */
|
||||
usedSms: number;
|
||||
/** 语音服务状态:1启用、0禁用 */
|
||||
voiceServiceStatus: number;
|
||||
/** 套餐语音总分钟数 */
|
||||
packageTotalVoice: number;
|
||||
/** 已用语音分钟数 */
|
||||
usedVoice: number;
|
||||
/** 国漫服务状态:1启用、0禁用 */
|
||||
roamServiceStatus: number;
|
||||
/** 套餐国际流量MB */
|
||||
packageTotalRoamFlowMb: number;
|
||||
/** 已用国际流量MB */
|
||||
usedRoamFlowMb: number;
|
||||
/** 状态最后一次同步时间 */
|
||||
statusSyncTime: string;
|
||||
/** 流量最后一次同步时间 */
|
||||
flowSyncTime: string;
|
||||
/** 短信最后一次同步时间 */
|
||||
smsSyncTime: string;
|
||||
/** 语音最后一次同步时间 */
|
||||
voiceSyncTime: string;
|
||||
/** 国漫最后一次同步时间 */
|
||||
roamSyncTime: string;
|
||||
/** 是否收取附加费:1是,0否 */
|
||||
extraFeeEnabled: number;
|
||||
/** 附加费用倍数 */
|
||||
extraFeeMultiple: number;
|
||||
/** 附加金额 */
|
||||
extraFee: number;
|
||||
/** 通道编号 */
|
||||
chanKey: string;
|
||||
/** 网络类型:4G、5G、NB-IoT */
|
||||
netModel: number;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门 */
|
||||
createdDept: number;
|
||||
/** 创建者 */
|
||||
createdBy: number;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者 */
|
||||
updatedBy: number;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
/** 创建者摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 更新者摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
}
|
||||
|
||||
/** 获取卡信息表列表 请求参数 */
|
||||
export interface TSimCardInfoListParam {
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** 运营商卡状态 */
|
||||
bossCardStatus?: number;
|
||||
/** 时间类型 */
|
||||
timeType?: number;
|
||||
/** 时间段 */
|
||||
time?: string[];
|
||||
/** 查询条件 */
|
||||
condition?: string;
|
||||
/** 起始号段 */
|
||||
startNum?: string;
|
||||
/** 结束号段 */
|
||||
endNum?: string;
|
||||
/** 维度 */
|
||||
dimension?: number;
|
||||
/** 维度状态 */
|
||||
dimensionStatus?: string;
|
||||
/** 维度值 */
|
||||
dimensionValue?: string;
|
||||
/** 排序值 */
|
||||
sortValue?: number;
|
||||
/** 排序类型 */
|
||||
sortType?: number;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 当前套餐编码 */
|
||||
currentPackageCode?: string;
|
||||
/** 卡号 */
|
||||
cardValue?: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** IMEI */
|
||||
imei?: string;
|
||||
/** 渠道客户ID */
|
||||
deptId?: number;
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** ICCID */
|
||||
iccid?: string;
|
||||
/** MSISDN/卡号 */
|
||||
msisdn?: string;
|
||||
/** IMSI */
|
||||
imsi?: string;
|
||||
/** 套餐状态:0 无套餐,1待生效,2生效中,3已过期 */
|
||||
packageStatus?: number;
|
||||
/** 数据服务状态:1启用、0禁用 */
|
||||
dataServiceStatus?: number;
|
||||
/** 短信服务状态:1启用、0禁用 */
|
||||
smsServiceStatus?: number;
|
||||
/** 语音服务状态:1启用、0禁用 */
|
||||
voiceServiceStatus?: number;
|
||||
/** 国漫服务状态:1启用、0禁用 */
|
||||
roamServiceStatus?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string[];
|
||||
}
|
||||
|
||||
/** 获取卡信息表列表 响应 */
|
||||
export type TSimCardInfoListRes = GlobalListRes<TSimCardInfoModel>;
|
||||
|
||||
/** 导出卡信息表列表 请求参数 */
|
||||
export type TSimCardInfoExportParam = TSimCardInfoListParam;
|
||||
|
||||
/** 修改/新增卡信息表 请求参数 */
|
||||
export interface TSimCardInfoEditParam {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 获取卡信息表指定信息 请求参数 */
|
||||
export interface TSimCardInfoViewParam {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** ICCID */
|
||||
iccid?: string;
|
||||
/** MSISDN/卡号 */
|
||||
msisdn?: string;
|
||||
}
|
||||
|
||||
/** 获取卡信息表指定信息 响应 */
|
||||
export type TSimCardInfoViewRes = TSimCardInfoViewModel;
|
||||
|
||||
/** 删除卡信息表 请求参数 */
|
||||
export interface TSimCardInfoDeleteParam {
|
||||
/** 主键ID */
|
||||
id: number | number[];
|
||||
}
|
||||
|
||||
/** 查询SIM卡会话 请求参数 */
|
||||
export interface TSimCardInfoQuerySimSessionParam {
|
||||
/** ICCID */
|
||||
iccid: string;
|
||||
}
|
||||
|
||||
/** 查询SIM卡会话 响应项 */
|
||||
export interface TSimCardInfoQuerySimSessionModel {
|
||||
/** APN */
|
||||
apnId: string;
|
||||
/** 实时IMEI */
|
||||
imei?: string;
|
||||
/** 接入方式 */
|
||||
rat: string;
|
||||
/** IPv4地址 */
|
||||
ipv4: string;
|
||||
/** IPv6地址 */
|
||||
ipv6: string;
|
||||
/** IPv6前缀 */
|
||||
ipv6Prefix: string;
|
||||
/** 在线状态 */
|
||||
status: string;
|
||||
/** 会话创建时间 */
|
||||
createTime: string;
|
||||
}
|
||||
|
||||
/** 查询SIM卡会话 响应 */
|
||||
export type TSimCardInfoQuerySimSessionRes =
|
||||
null | TSimCardInfoQuerySimSessionModel;
|
||||
|
||||
/** 查询SIM卡状态 请求参数 */
|
||||
export type TSimCardInfoQuerySimStatusParam =
|
||||
TSimCardInfoQuerySimSessionParam;
|
||||
|
||||
/** 查询SIM卡状态 响应项 */
|
||||
export interface TSimCardInfoQuerySimStatusModel {
|
||||
/** 卡状态 */
|
||||
cardStatus?: number;
|
||||
/** 最后变更时间 */
|
||||
lastChangeDate?: string;
|
||||
}
|
||||
|
||||
/** 查询SIM卡状态 响应 */
|
||||
export type TSimCardInfoQuerySimStatusRes =
|
||||
null | TSimCardInfoQuerySimStatusModel;
|
||||
@@ -0,0 +1,20 @@
|
||||
export interface TSimCardLifecycleExcelSubmitParam {
|
||||
/** Excel 文件 */
|
||||
file: File;
|
||||
}
|
||||
|
||||
export interface TSimCardLifecycleInputSubmitParam {
|
||||
/** 每行填写 ICCID,或 ICCID MSISDN IMSI */
|
||||
input: string;
|
||||
}
|
||||
|
||||
export interface TSimCardLifecycleSubmitRes {
|
||||
/** 批次编号 */
|
||||
batchNo: string;
|
||||
/** 批次类型 */
|
||||
batchType: number;
|
||||
/** 异步处理状态 */
|
||||
batchAsyncStatus: number;
|
||||
/** 提交总行数 */
|
||||
total: number;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const get = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
get,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardRenew api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
get.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads excel renew template from backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith('/iot/tSimCardRenew/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
});
|
||||
|
||||
it('submits excel renew as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'renew.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardRenew/excel/submit',
|
||||
{ file },
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('prepares input renew with backend contract path', async () => {
|
||||
const { InputPrepare } = await import('./index');
|
||||
const params = {
|
||||
input: '8986000000000000001\n8986000000000000002',
|
||||
};
|
||||
|
||||
InputPrepare(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardRenew/input/prepare', {
|
||||
...params,
|
||||
});
|
||||
});
|
||||
|
||||
it('confirms renew prepare batch with backend contract path', async () => {
|
||||
const { BatchConfirm } = await import('./index');
|
||||
const params = {
|
||||
batchNo: 'RN202607060001',
|
||||
durationMonths: 6,
|
||||
offlineContractCompleted: true,
|
||||
};
|
||||
|
||||
BatchConfirm(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardRenew/batch/confirm', {
|
||||
...params,
|
||||
});
|
||||
});
|
||||
|
||||
it('polls renew prepare result with backend contract path', async () => {
|
||||
const { PrepareResult } = await import('./index');
|
||||
const batchNo = 'RN202607060001';
|
||||
|
||||
PrepareResult(batchNo);
|
||||
|
||||
expect(get).toHaveBeenCalledWith('/iot/tSimCardRenew/prepare/result', {
|
||||
params: { batchNo },
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
import type {
|
||||
TSimCardRenewBatchConfirmParam,
|
||||
TSimCardRenewBatchConfirmRes,
|
||||
TSimCardRenewBatchPrepareRes,
|
||||
TSimCardRenewBatchPrepareResult,
|
||||
TSimCardRenewExcelSubmitParam,
|
||||
TSimCardRenewExcelSubmitRes,
|
||||
TSimCardRenewInputPrepareParam,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardRenew/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardRenewExcelSubmitParam,
|
||||
): Promise<TSimCardRenewExcelSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardRenew/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputPrepare(params: TSimCardRenewInputPrepareParam) {
|
||||
return requestClient.post<TSimCardRenewBatchPrepareRes>(
|
||||
'/iot/tSimCardRenew/input/prepare',
|
||||
{ ...params },
|
||||
);
|
||||
}
|
||||
|
||||
export function BatchConfirm(params: TSimCardRenewBatchConfirmParam) {
|
||||
return requestClient.post<TSimCardRenewBatchConfirmRes>(
|
||||
'/iot/tSimCardRenew/batch/confirm',
|
||||
{ ...params },
|
||||
);
|
||||
}
|
||||
|
||||
export function PrepareResult(batchNo: string) {
|
||||
return requestClient.get<TSimCardRenewBatchPrepareResult>(
|
||||
'/iot/tSimCardRenew/prepare/result',
|
||||
{ params: { batchNo } },
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
export interface TSimCardRenewInputPrepareParam {
|
||||
input: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardRenewExcelSubmitParam {
|
||||
file: File;
|
||||
}
|
||||
|
||||
export interface TSimCardRenewExcelSubmitRes {
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
resultDownloadId?: number;
|
||||
resultFileOssId?: number;
|
||||
status?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardRenewBatchPrepareRes {
|
||||
agentDefaultPriceId?: number;
|
||||
batchNo: string;
|
||||
batchType?: number;
|
||||
customerAgentId?: number;
|
||||
customerName?: string;
|
||||
failCount?: number;
|
||||
failedItems?: TSimCardRenewPrepareFailedItem[];
|
||||
failedItemsTruncated?: boolean;
|
||||
packageCode?: string;
|
||||
packageName?: string;
|
||||
billingMethod?: number;
|
||||
renewDurationUnit?: 'month' | 'year' | string;
|
||||
renewDurationUnitText?: string;
|
||||
durationValue?: number;
|
||||
durationYears?: number;
|
||||
giftDurationMonths?: number;
|
||||
priceSource?: string;
|
||||
quantity?: number;
|
||||
renewableDurationOptions?: number[];
|
||||
renewBeginDate?: string;
|
||||
renewBeginDateMax?: string;
|
||||
renewBeginDateMin?: string;
|
||||
renewUnitPrice?: number | string;
|
||||
renewablePackageCodes?: string[];
|
||||
renewablePackages?: TSimCardRenewPackageOption[];
|
||||
resultDownloadId?: number;
|
||||
resultFileOssId?: number;
|
||||
status?: string;
|
||||
targetPriceId?: number;
|
||||
total?: number;
|
||||
validCount?: number;
|
||||
isTopDept?: boolean;
|
||||
defaultPaymentMode?: 'balance' | 'offline' | string;
|
||||
availableBalance?: number | string;
|
||||
sameRenewBeginDate?: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardRenewPrepareFailedItem {
|
||||
iccid?: string;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardRenewPackageOption {
|
||||
packageCode?: string;
|
||||
packageName?: string;
|
||||
renewUnitPrice?: number | string;
|
||||
renewableDurationOptions?: number[];
|
||||
}
|
||||
|
||||
export interface TSimCardRenewBatchConfirmParam {
|
||||
adminNote?: string;
|
||||
batchNo: string;
|
||||
packageCode?: string;
|
||||
buyerNote?: string;
|
||||
durationYears?: number;
|
||||
durationMonths: number;
|
||||
giftDurationMonths?: number;
|
||||
offlineContractCompleted: boolean;
|
||||
paymentMode?: 'balance' | 'offline' | string;
|
||||
packageBeginTime?: string;
|
||||
packageEndTime?: string;
|
||||
renewDate?: string;
|
||||
remark?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardRenewBatchConfirmRes {
|
||||
batchNo: string;
|
||||
batchType?: number;
|
||||
billingMethod?: number;
|
||||
renewDurationUnit?: 'month' | 'year' | string;
|
||||
renewDurationUnitText?: string;
|
||||
durationYears?: number;
|
||||
durationMonths?: number;
|
||||
giftDurationMonths?: number;
|
||||
orderSn?: string;
|
||||
packageCode?: string;
|
||||
packageName?: string;
|
||||
paymentMode?: string;
|
||||
payAmount?: number | string;
|
||||
payType?: number;
|
||||
availableBalance?: number | string;
|
||||
balanceDetailSerialNo?: string;
|
||||
packageBeginTime?: string;
|
||||
packageEndTime?: string;
|
||||
quantity?: number;
|
||||
renewDate?: string;
|
||||
renewUnitPrice?: number | string;
|
||||
status?: string;
|
||||
totalAmount?: number | string;
|
||||
prepareChanged?: boolean;
|
||||
priceChanged?: boolean;
|
||||
message?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type TSimCardRenewBatchAsyncStatus = number;
|
||||
|
||||
export interface TSimCardRenewBatchPrepareResult {
|
||||
batchAsyncStatus: TSimCardRenewBatchAsyncStatus;
|
||||
batchInfo?: TSimCardRenewBatchPrepareRes;
|
||||
batchNo: string;
|
||||
failReason?: string;
|
||||
runResult?: number;
|
||||
status: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardRestart api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads the restart template from the backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardRestart/excel/template',
|
||||
{
|
||||
responseReturn: 'raw',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an excel restart batch as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'restart.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardRestart/excel/submit',
|
||||
{ file },
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an input restart batch from the backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
input: '8986000000000000001 14000000001 460001000000001',
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardRestart/input/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import type {
|
||||
TSimCardLifecycleExcelSubmitParam,
|
||||
TSimCardLifecycleInputSubmitParam,
|
||||
TSimCardLifecycleSubmitRes,
|
||||
} from '../tSimCardLifecycle/type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardRestart/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardLifecycleExcelSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardRestart/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardLifecycleInputSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardRestart/input/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardStart api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads the resume template from the backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith('/iot/tSimCardStart/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
});
|
||||
|
||||
it('submits an excel resume batch as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'resume.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardStart/excel/submit',
|
||||
{ file },
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an input resume batch from the backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
input: '8986000000000000001',
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardStart/input/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import type {
|
||||
TSimCardLifecycleExcelSubmitParam,
|
||||
TSimCardLifecycleInputSubmitParam,
|
||||
TSimCardLifecycleSubmitRes,
|
||||
} from '../tSimCardLifecycle/type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardStart/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardLifecycleExcelSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardStart/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardLifecycleInputSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardStart/input/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardStop api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads the stop template from the backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith('/iot/tSimCardStop/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
});
|
||||
|
||||
it('submits an excel stop batch as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'stop.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardStop/excel/submit',
|
||||
{ file },
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an input stop batch from the backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
input: '8986000000000000001 14000000001 460001000000001',
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardStop/input/submit', params);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import type {
|
||||
TSimCardLifecycleExcelSubmitParam,
|
||||
TSimCardLifecycleInputSubmitParam,
|
||||
TSimCardLifecycleSubmitRes,
|
||||
} from '../tSimCardLifecycle/type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardStop/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardLifecycleExcelSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardStop/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardLifecycleInputSubmitParam,
|
||||
): Promise<TSimCardLifecycleSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardStop/input/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const get = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: { download, get, post, upload },
|
||||
}));
|
||||
|
||||
describe('tSimCardTrafficCutoff api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
get.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads the traffic cutoff template', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardTrafficCutoff/excel/template',
|
||||
{ responseReturn: 'raw' },
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an excel traffic cutoff batch', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'trafficCutoff.xlsx');
|
||||
|
||||
ExcelSubmit({
|
||||
file,
|
||||
trafficCutoffCrossMonthHold: 1,
|
||||
trafficCutoffStatus: 1,
|
||||
trafficCutoffThreshold: 1024.125,
|
||||
});
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardTrafficCutoff/excel/submit',
|
||||
{
|
||||
file,
|
||||
trafficCutoffCrossMonthHold: 1,
|
||||
trafficCutoffStatus: 1,
|
||||
trafficCutoffThreshold: 1024.125,
|
||||
},
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
});
|
||||
|
||||
it('submits an input traffic cutoff batch', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
|
||||
InputSubmit({
|
||||
input: '8986000000000000001',
|
||||
trafficCutoffCrossMonthHold: 0,
|
||||
trafficCutoffStatus: 2,
|
||||
trafficCutoffThreshold: 2048,
|
||||
});
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardTrafficCutoff/input/submit',
|
||||
{
|
||||
input: '8986000000000000001',
|
||||
trafficCutoffCrossMonthHold: 0,
|
||||
trafficCutoffStatus: 2,
|
||||
trafficCutoffThreshold: 2048,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('queries configured cards', async () => {
|
||||
const { List } = await import('./index');
|
||||
const params = { page: 1, pageSize: 20, cardValue: '8986' };
|
||||
|
||||
List(params);
|
||||
|
||||
expect(get).toHaveBeenCalledWith('/iot/tSimCardTrafficCutoff/list', {
|
||||
params,
|
||||
});
|
||||
});
|
||||
|
||||
it('exports configured cards', async () => {
|
||||
const { Export } = await import('./index');
|
||||
const params = {
|
||||
page: 1,
|
||||
pageSize: 2000,
|
||||
deptId: 12,
|
||||
trafficCutoffStatus: 1 as const,
|
||||
};
|
||||
|
||||
Export(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardTrafficCutoff/export',
|
||||
params,
|
||||
{ responseType: 'blob' },
|
||||
);
|
||||
});
|
||||
|
||||
it('updates a traffic cutoff configuration', async () => {
|
||||
const { Edit } = await import('./index');
|
||||
const params = {
|
||||
id: 7,
|
||||
trafficCutoffCrossMonthHold: 1 as const,
|
||||
iccid: '8986000000000000001',
|
||||
trafficCutoffStatus: 1 as const,
|
||||
trafficCutoffThreshold: 1024.5,
|
||||
};
|
||||
|
||||
Edit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardTrafficCutoff/edit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
|
||||
it('clears a traffic cutoff configuration', async () => {
|
||||
const { Delete } = await import('./index');
|
||||
|
||||
Delete({ id: 7, iccid: '8986000000000000001' });
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardTrafficCutoff/delete', {
|
||||
id: 7,
|
||||
iccid: '8986000000000000001',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,67 @@
|
||||
import type {
|
||||
TSimCardTrafficCutoffDeleteParam,
|
||||
TSimCardTrafficCutoffEditParam,
|
||||
TSimCardTrafficCutoffExcelSubmitParam,
|
||||
TSimCardTrafficCutoffInputSubmitParam,
|
||||
TSimCardTrafficCutoffListParam,
|
||||
TSimCardTrafficCutoffListRes,
|
||||
TSimCardTrafficCutoffSubmitRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardTrafficCutoff/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardTrafficCutoffExcelSubmitParam,
|
||||
): Promise<TSimCardTrafficCutoffSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardTrafficCutoff/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
trafficCutoffStatus: params.trafficCutoffStatus,
|
||||
trafficCutoffThreshold: params.trafficCutoffThreshold,
|
||||
trafficCutoffCrossMonthHold: params.trafficCutoffCrossMonthHold,
|
||||
},
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardTrafficCutoffInputSubmitParam,
|
||||
): Promise<TSimCardTrafficCutoffSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardTrafficCutoff/input/submit', {
|
||||
input: params.input,
|
||||
trafficCutoffStatus: params.trafficCutoffStatus,
|
||||
trafficCutoffThreshold: params.trafficCutoffThreshold,
|
||||
trafficCutoffCrossMonthHold: params.trafficCutoffCrossMonthHold,
|
||||
});
|
||||
}
|
||||
|
||||
export function List(params: TSimCardTrafficCutoffListParam) {
|
||||
return requestClient.get<TSimCardTrafficCutoffListRes>(
|
||||
'/iot/tSimCardTrafficCutoff/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
export function Export(params: TSimCardTrafficCutoffListParam) {
|
||||
return requestClient.post<Blob>('/iot/tSimCardTrafficCutoff/export', params, {
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
export function Edit(params: TSimCardTrafficCutoffEditParam) {
|
||||
return requestClient.post<unknown>('/iot/tSimCardTrafficCutoff/edit', params);
|
||||
}
|
||||
|
||||
export function Delete(params: TSimCardTrafficCutoffDeleteParam) {
|
||||
return requestClient.post<unknown>(
|
||||
'/iot/tSimCardTrafficCutoff/delete',
|
||||
params,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
|
||||
export interface TSimCardTrafficCutoffExcelSubmitParam {
|
||||
trafficCutoffCrossMonthHold: 0 | 1;
|
||||
file: File;
|
||||
trafficCutoffStatus: 0 | 1 | 2;
|
||||
trafficCutoffThreshold: number;
|
||||
}
|
||||
|
||||
export interface TSimCardTrafficCutoffInputSubmitParam {
|
||||
trafficCutoffCrossMonthHold: 0 | 1;
|
||||
input: string;
|
||||
trafficCutoffStatus: 0 | 1 | 2;
|
||||
trafficCutoffThreshold: number;
|
||||
}
|
||||
|
||||
export interface TSimCardTrafficCutoffSubmitRes {
|
||||
batchNo: string;
|
||||
batchType: number;
|
||||
batchAsyncStatus: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface TSimCardTrafficCutoffModel {
|
||||
trafficCutoffCrossMonthHold: 0 | 1;
|
||||
id: number;
|
||||
iccid: string;
|
||||
msisdn: string;
|
||||
imsi: string;
|
||||
imei: string;
|
||||
chanName?: string;
|
||||
deptName?: string;
|
||||
packageName?: string;
|
||||
bossCardStatus?: number;
|
||||
trafficCutoffStatus: 1 | 2;
|
||||
trafficCutoffThreshold: number;
|
||||
}
|
||||
|
||||
export interface TSimCardTrafficCutoffListParam {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
cardValue?: string;
|
||||
imei?: string;
|
||||
deptId?: number | string;
|
||||
trafficCutoffStatus?: 1 | 2;
|
||||
}
|
||||
|
||||
export type TSimCardTrafficCutoffListRes =
|
||||
GlobalListRes<TSimCardTrafficCutoffModel>;
|
||||
|
||||
export interface TSimCardTrafficCutoffEditParam {
|
||||
trafficCutoffCrossMonthHold: 0 | 1;
|
||||
id: number;
|
||||
iccid: string;
|
||||
trafficCutoffStatus: 1 | 2;
|
||||
trafficCutoffThreshold: number;
|
||||
}
|
||||
|
||||
export interface TSimCardTrafficCutoffDeleteParam {
|
||||
id: number;
|
||||
iccid: string;
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardUnsub api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads excel unsubscribe template from backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith('/iot/tSimCardUnsub/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
});
|
||||
|
||||
it('submits excel unsubscribe as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'unsubscribe.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardUnsub/excel/submit',
|
||||
{ file },
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('submits input unsubscribe from backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
input: '8986000000000000000',
|
||||
remark: 'unsubscribe remark',
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardUnsub/input/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
|
||||
it('submits range unsubscribe from backend contract path', async () => {
|
||||
const { RangeSubmit } = await import('./index');
|
||||
const params = {
|
||||
endIccid: '8986000000000000009',
|
||||
endImsi: '460000000000009',
|
||||
endMsisdn: '13000000009',
|
||||
remark: 'unsubscribe remark',
|
||||
startIccid: '8986000000000000001',
|
||||
startImsi: '460000000000001',
|
||||
startMsisdn: '13000000001',
|
||||
};
|
||||
|
||||
RangeSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardUnsub/range/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
|
||||
it('exposes batchAsyncStatus on the submit response type so async Pending is representable', async () => {
|
||||
const typeModule = await import('./type');
|
||||
const res: typeof typeModule.TSimCardUnsubSubmitRes.prototype = {
|
||||
batchAsyncStatus: 0,
|
||||
batchNo: 'B202607210001',
|
||||
batchType: 1,
|
||||
};
|
||||
|
||||
expect(res.batchAsyncStatus).toBe(0);
|
||||
expect(res.batchNo).toBe('B202607210001');
|
||||
});
|
||||
|
||||
it('keeps excel/input/range submit endpoints pointing at the backend contract paths', async () => {
|
||||
const { ExcelSubmit, InputSubmit, RangeSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'unsubscribe.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
InputSubmit({ input: '8986000000000000000' });
|
||||
RangeSubmit({
|
||||
endIccid: '8986000000000000009',
|
||||
endImsi: '460000000000009',
|
||||
endMsisdn: '13000000009',
|
||||
startIccid: '8986000000000000001',
|
||||
startImsi: '460000000000001',
|
||||
startMsisdn: '13000000001',
|
||||
});
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardUnsub/excel/submit',
|
||||
{ file },
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardUnsub/input/submit', {
|
||||
input: '8986000000000000000',
|
||||
});
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardUnsub/range/submit',
|
||||
expect.objectContaining({
|
||||
startIccid: '8986000000000000001',
|
||||
endIccid: '8986000000000000009',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import type {
|
||||
TSimCardUnsubExcelSubmitParam,
|
||||
TSimCardUnsubInputSubmitParam,
|
||||
TSimCardUnsubRangeSubmitParam,
|
||||
TSimCardUnsubSubmitRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardUnsub/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimCardUnsubExcelSubmitParam,
|
||||
): Promise<TSimCardUnsubSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimCardUnsub/excel/submit',
|
||||
{ file: params.file },
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimCardUnsubInputSubmitParam,
|
||||
): Promise<TSimCardUnsubSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardUnsub/input/submit', params);
|
||||
}
|
||||
|
||||
export function RangeSubmit(
|
||||
params: TSimCardUnsubRangeSubmitParam,
|
||||
): Promise<TSimCardUnsubSubmitRes> {
|
||||
return requestClient.post('/iot/tSimCardUnsub/range/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/** 提交Excel卡退订请求参数 */
|
||||
export interface TSimCardUnsubExcelSubmitParam {
|
||||
/** Excel文件 */
|
||||
file: File;
|
||||
}
|
||||
|
||||
/** 提交批量输入卡退订请求参数 */
|
||||
export interface TSimCardUnsubInputSubmitParam {
|
||||
/** 批量输入ICCID文本 */
|
||||
input: string;
|
||||
/** 退订备注 */
|
||||
remark?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 提交连号卡退订请求参数 */
|
||||
export interface TSimCardUnsubRangeSubmitParam {
|
||||
/** 结束ICCID */
|
||||
endIccid: string;
|
||||
/** 结束IMSI */
|
||||
endImsi: string;
|
||||
/** 结束MSISDN */
|
||||
endMsisdn: string;
|
||||
/** 退订备注 */
|
||||
remark?: string;
|
||||
/** 起始ICCID */
|
||||
startIccid: string;
|
||||
/** 起始IMSI */
|
||||
startImsi: string;
|
||||
/** 起始MSISDN */
|
||||
startMsisdn: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 卡退订提交响应 */
|
||||
export interface TSimCardUnsubSubmitRes {
|
||||
/** 批次异步处理状态(Pending 等) */
|
||||
batchAsyncStatus?: number;
|
||||
/** 批次号 */
|
||||
batchNo?: string;
|
||||
/** 批次类型 */
|
||||
batchType?: number;
|
||||
/** 失败行数 */
|
||||
failCount?: number;
|
||||
/** 实际退订数量 */
|
||||
quantity?: number;
|
||||
/** 结果下载任务ID */
|
||||
resultDownloadId?: number;
|
||||
/** 结果文件OSS ID */
|
||||
resultFileOssId?: number;
|
||||
/** 导入状态 */
|
||||
status?: string;
|
||||
/** 解析总行数 */
|
||||
total?: number;
|
||||
/** 校验通过行数 */
|
||||
validCount?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import type {
|
||||
TSimPoolAddPackageBatchConfirmParam,
|
||||
TSimPoolAddPackageBatchConfirmRes,
|
||||
TSimPoolAddPackageOptionsRes,
|
||||
TSimPoolAddPackagePrepareResult,
|
||||
TSimPoolBindPackageAddPackageExcelSubmitParam,
|
||||
TSimPoolBindPackageAddPackageInputPrepareParam,
|
||||
TSimPoolBindPackageAddPackageInputPrepareRes,
|
||||
TSimPoolBindPackageAddPackageInputSubmitParam,
|
||||
TSimPoolBindPackageAddPackageSubmitRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadAddPackageTemplate() {
|
||||
return requestClient.download(
|
||||
'/iot/tSimPoolBindPackage/addPackage/excel/template',
|
||||
{
|
||||
responseReturn: 'raw',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackageExcelSubmit(
|
||||
params: TSimPoolBindPackageAddPackageExcelSubmitParam,
|
||||
): Promise<TSimPoolBindPackageAddPackageSubmitRes> {
|
||||
return requestClient.upload(
|
||||
'/iot/tSimPoolBindPackage/addPackage/excel/submit',
|
||||
{
|
||||
file: params.file,
|
||||
manualConfirm: params.manualConfirm,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackageOptions(params: {
|
||||
flowPoolCodes: string[];
|
||||
}): Promise<TSimPoolAddPackageOptionsRes> {
|
||||
return requestClient.post(
|
||||
'/iot/tSimPoolBindPackage/addPackage/options',
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackagePaymentContext(): Promise<TSimPoolAddPackageOptionsRes> {
|
||||
return requestClient.post(
|
||||
'/iot/tSimPoolBindPackage/addPackage/payment-context',
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackageInputSubmit(
|
||||
params: TSimPoolBindPackageAddPackageInputSubmitParam,
|
||||
): Promise<TSimPoolBindPackageAddPackageSubmitRes> {
|
||||
return requestClient.post(
|
||||
'/iot/tSimPoolBindPackage/addPackage/input/submit',
|
||||
{
|
||||
...params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackageInputPrepare(
|
||||
params: TSimPoolBindPackageAddPackageInputPrepareParam,
|
||||
): Promise<TSimPoolBindPackageAddPackageInputPrepareRes> {
|
||||
return requestClient.post(
|
||||
'/iot/tSimPoolBindPackage/addPackage/input/prepare',
|
||||
{
|
||||
...params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackagePrepareResult(
|
||||
batchNo: string,
|
||||
): Promise<TSimPoolAddPackagePrepareResult> {
|
||||
return requestClient.get(
|
||||
'/iot/tSimPoolBindPackage/addPackage/prepare/result',
|
||||
{
|
||||
params: { batchNo },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function AddPackageBatchConfirm(
|
||||
params: TSimPoolAddPackageBatchConfirmParam,
|
||||
): Promise<TSimPoolAddPackageBatchConfirmRes> {
|
||||
return requestClient.post(
|
||||
'/iot/tSimPoolBindPackage/addPackage/batch/confirm',
|
||||
{
|
||||
...params,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
export type AddPackageEffectiveMode = 'current_month';
|
||||
export type AddPackagePaymentMode = 'balance' | 'offline';
|
||||
|
||||
export interface TSimPoolBindPackageAddPackageExcelSubmitParam {
|
||||
file: File;
|
||||
paymentMode?: AddPackagePaymentMode;
|
||||
offlineContractCompleted?: boolean;
|
||||
manualConfirm?: boolean;
|
||||
}
|
||||
|
||||
export interface TSimPoolBindPackageAddPackageInputSubmitParam {
|
||||
input: string;
|
||||
packageCode?: string;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
remark?: string;
|
||||
paymentMode?: AddPackagePaymentMode;
|
||||
offlineContractCompleted?: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimPoolBindPackageAddPackageInputPrepareParam {
|
||||
input: string;
|
||||
packageCode?: string;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
remark?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimPoolBindPackageAddPackageSubmitRes {
|
||||
batchAsyncStatus?: number;
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
targetBatchType?: number;
|
||||
total?: number;
|
||||
validCount?: number;
|
||||
failCount?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type TSimPoolBindPackageAddPackageInputPrepareRes =
|
||||
TSimPoolAddPackagePrepareResult;
|
||||
|
||||
export interface TSimPoolAddPackageBatchConfirmParam {
|
||||
batchNo: string;
|
||||
packageCode?: string;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
remark?: string;
|
||||
paymentMode?: AddPackagePaymentMode | string;
|
||||
offlineContractCompleted?: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimPoolAddPackageBatchConfirmRes {
|
||||
batchAsyncStatus?: number;
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
packageCode?: string;
|
||||
status?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimPoolAddPackagePaymentAccount {
|
||||
payerDeptId: number;
|
||||
targetCount: number;
|
||||
requiredAmount: number | string;
|
||||
availableBalance: number | string;
|
||||
balanceEnough: boolean;
|
||||
}
|
||||
|
||||
export interface TSimPoolAddPackageOption {
|
||||
flowMb: number;
|
||||
packageCode: string;
|
||||
packageName: string;
|
||||
unitPrice?: number | string;
|
||||
totalAmount?: number | string;
|
||||
priceAvailable?: boolean;
|
||||
priceReason?: string;
|
||||
paymentAccounts?: TSimPoolAddPackagePaymentAccount[];
|
||||
}
|
||||
|
||||
export interface TSimPoolAddPackageOptionsRes {
|
||||
items: TSimPoolAddPackageOption[];
|
||||
isTopDept?: boolean;
|
||||
defaultPaymentMode?: AddPackagePaymentMode | string;
|
||||
availableBalance?: number | string;
|
||||
}
|
||||
|
||||
export interface TSimPoolAddPackagePrepareResult {
|
||||
availableBalance?: number | string;
|
||||
batchAsyncStatus?: number;
|
||||
batchInfo?: Record<string, any>;
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
effectiveMode?: AddPackageEffectiveMode | string;
|
||||
effectiveModeText?: string;
|
||||
effectiveTime?: string;
|
||||
expectedExpireTime?: string;
|
||||
failCount?: number;
|
||||
failReason?: string;
|
||||
flowMb?: number | string;
|
||||
isTopDept?: boolean;
|
||||
packageCode?: string;
|
||||
packageName?: string;
|
||||
paymentAccounts?: TSimPoolAddPackagePaymentAccount[];
|
||||
availablePackages?: TSimPoolAddPackageOption[];
|
||||
quantity?: number;
|
||||
runResult?: number;
|
||||
snapshot?: Record<string, any>;
|
||||
status?: string;
|
||||
successCount?: number;
|
||||
targetBatchType?: number;
|
||||
total?: number;
|
||||
totalAmount?: number | string;
|
||||
unitPrice?: number | string;
|
||||
validCount?: number;
|
||||
defaultPaymentMode?: AddPackagePaymentMode | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import type {
|
||||
TSimWarningConfigEmailCodeParam,
|
||||
TSimWarningConfigExcelSubmitParam,
|
||||
TSimWarningConfigInputSubmitParam,
|
||||
TSimWarningConfigRangeSubmitParam,
|
||||
TSimWarningConfigSubmitRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function DownloadTemplate(params?: { itemType?: number }) {
|
||||
return requestClient.download('/iot/tSimWarningConfig/excel/template', {
|
||||
params,
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function SendEmailCode(params: TSimWarningConfigEmailCodeParam) {
|
||||
return requestClient.post('/iot/tSimWarningConfig/email/code', params);
|
||||
}
|
||||
|
||||
export function ExcelSubmit(
|
||||
params: TSimWarningConfigExcelSubmitParam,
|
||||
): Promise<TSimWarningConfigSubmitRes> {
|
||||
const { file, ...data } = params;
|
||||
return requestClient.upload(
|
||||
'/iot/tSimWarningConfig/excel/submit',
|
||||
{
|
||||
file,
|
||||
...data,
|
||||
},
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(
|
||||
params: TSimWarningConfigInputSubmitParam,
|
||||
): Promise<TSimWarningConfigSubmitRes> {
|
||||
return requestClient.post('/iot/tSimWarningConfig/input/submit', params);
|
||||
}
|
||||
|
||||
export function RangeSubmit(
|
||||
params: TSimWarningConfigRangeSubmitParam,
|
||||
): Promise<TSimWarningConfigSubmitRes> {
|
||||
return requestClient.post('/iot/tSimWarningConfig/range/submit', params);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
export interface TSimWarningConfigCommonParam {
|
||||
itemType?: number;
|
||||
warnUnit: number;
|
||||
firstWarn: number;
|
||||
secondWarn?: number;
|
||||
thirdWarn?: number;
|
||||
warnMethods?: string;
|
||||
warnPhones?: string;
|
||||
warnEmails?: string;
|
||||
warnEmailCode?: string;
|
||||
autoAction?: number;
|
||||
isEnabled?: number;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface TSimWarningConfigEmailCodeParam {
|
||||
captchaId: string;
|
||||
captchaValue: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface TSimWarningConfigExcelSubmitParam extends TSimWarningConfigCommonParam {
|
||||
file: File;
|
||||
}
|
||||
|
||||
export interface TSimWarningConfigInputSubmitParam extends TSimWarningConfigCommonParam {
|
||||
input: string;
|
||||
}
|
||||
|
||||
export interface TSimWarningConfigRangeSubmitParam extends TSimWarningConfigCommonParam {
|
||||
endIccid: string;
|
||||
endImsi: string;
|
||||
endMsisdn: string;
|
||||
startIccid: string;
|
||||
startImsi: string;
|
||||
startMsisdn: string;
|
||||
}
|
||||
|
||||
export interface TSimWarningConfigSubmitRes {
|
||||
batchAsyncStatus?: number;
|
||||
batchNo?: string;
|
||||
batchType?: number;
|
||||
failCount?: number;
|
||||
total?: number;
|
||||
validCount?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import type {
|
||||
CardStatisticsRes,
|
||||
CardStatusStatisticsRes,
|
||||
FlowPoolUsageRes,
|
||||
FlowUsageChartRes,
|
||||
TopUsageCardsRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取卡片数据统计
|
||||
export function CardStatistics() {
|
||||
return requestClient.get<CardStatisticsRes>('/home/cardStatistics');
|
||||
}
|
||||
|
||||
// 获取卡状态统计
|
||||
export function CardStatusStatistics() {
|
||||
return requestClient.get<CardStatusStatisticsRes>(
|
||||
'/home/cardStatusStatistics',
|
||||
);
|
||||
}
|
||||
|
||||
// 获取流量使用图表数据
|
||||
export function FlowUsageChart(period: '1m' | '7d') {
|
||||
return requestClient.get<FlowUsageChartRes>('/home/flowUsageChart', {
|
||||
params: { period },
|
||||
});
|
||||
}
|
||||
|
||||
// 获取前一天流量使用前五名的卡片
|
||||
export function TopUsageCards() {
|
||||
return requestClient.get<TopUsageCardsRes>('/home/topUsageCards');
|
||||
}
|
||||
|
||||
// 获取流量池流量使用情况
|
||||
export function FlowPoolUsage() {
|
||||
return requestClient.get<FlowPoolUsageRes>('/home/flowPoolUsage');
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/** 首页卡片数据统计 */
|
||||
export interface CardStatisticsRes {
|
||||
/** 总卡数 */
|
||||
totalCount: number;
|
||||
/** 本月新增开卡数 */
|
||||
monthlyNewCount: number;
|
||||
/** 本月流量用量 */
|
||||
monthlyFlowUsage: number;
|
||||
/** 本月活跃卡数 */
|
||||
monthlyActiveCount: number;
|
||||
}
|
||||
|
||||
/** 卡状态统计 */
|
||||
export interface CardStatusStatisticsRes {
|
||||
/** 待激活(1) */
|
||||
pendingActivationCount: number;
|
||||
/** 已激活(2) */
|
||||
activatedCount: number;
|
||||
/** 停机(4) */
|
||||
stoppedCount: number;
|
||||
/** 可测试(6) */
|
||||
testableCount: number;
|
||||
/** 库存(7) */
|
||||
inventoryCount: number;
|
||||
/** 预销户(8) */
|
||||
preCancelCount: number;
|
||||
/** 已销户(9) */
|
||||
canceledCount: number;
|
||||
/** 未知(0) */
|
||||
unknownCount: number;
|
||||
}
|
||||
|
||||
/** 流量使用图表 */
|
||||
export interface FlowUsageChartRes {
|
||||
/** 日期/月度标签 */
|
||||
labels: string[];
|
||||
/** 流量使用值,单位 MB */
|
||||
values: number[];
|
||||
}
|
||||
|
||||
/** TOP 流量卡片 */
|
||||
export interface TopUsageCard {
|
||||
iccid: string;
|
||||
statDate: string;
|
||||
/** 使用量,单位 MB */
|
||||
usageMb: number;
|
||||
}
|
||||
|
||||
/** TOP 流量卡片响应 */
|
||||
export interface TopUsageCardsRes {
|
||||
data: TopUsageCard[];
|
||||
}
|
||||
|
||||
/** 单个流量池使用情况 */
|
||||
export interface FlowPoolUsageItem {
|
||||
flowPoolCode: string;
|
||||
totalFlowMb: number;
|
||||
usedFlowMb: number;
|
||||
}
|
||||
|
||||
/** 流量池使用情况响应 */
|
||||
export interface FlowPoolUsageRes {
|
||||
data: FlowPoolUsageItem[];
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取SIM流量池套餐配置表列表
|
||||
export function List(params:any) {
|
||||
return requestClient.get<any>('iot/tFlowPackageConfig/list', { params });
|
||||
}
|
||||
|
||||
// 删除/批量删除SIM流量池套餐配置表
|
||||
export function Delete(params:any) {
|
||||
return requestClient.post<any>('iot/tFlowPackageConfig/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑SIM流量池套餐配置表
|
||||
export function Edit(params:any) {
|
||||
return requestClient.post<any>('iot/tFlowPackageConfig/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取SIM流量池套餐配置表指定详情
|
||||
export function View(params:any) {
|
||||
return requestClient.get<any>('iot/tFlowPackageConfig/view', { params });
|
||||
}
|
||||
|
||||
// 导出SIM流量池套餐配置表
|
||||
export function Export(params:any) {
|
||||
return requestClient.post<Blob>('iot/tFlowPackageConfig/export', { ...params } , {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
export function GetFlowPackageOptions(params: { poolPackageCode?: string } = {}) {
|
||||
return requestClient.get<any>(
|
||||
'iot/tSimFlowPackageInfo/getFlowPackageOptions',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
export function FlowPackageList(
|
||||
params: { flow: string; poolPackageCode?: string } | string,
|
||||
) {
|
||||
const flow = typeof params === 'string' ? params : params.flow;
|
||||
const poolPackageCode =
|
||||
typeof params === 'string' ? '' : params.poolPackageCode || '';
|
||||
const queryFlow =
|
||||
flow?.startsWith('"') && flow?.endsWith('"') ? flow : `"${flow}"`;
|
||||
const queryPoolPackageCode = poolPackageCode
|
||||
? `&poolPackageCode=${encodeURIComponent(poolPackageCode)}`
|
||||
: '';
|
||||
return requestClient.get<any>(
|
||||
`iot/tSimFlowPackageInfo/flowPackageList?flow=${queryFlow}${queryPoolPackageCode}`,
|
||||
);
|
||||
}
|
||||
|
||||
export function FlowPackageAddList() {
|
||||
return requestClient.get<any>('iot/tSimFlowPackageInfo/flowPackageAddList');
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import type {
|
||||
BatchMainCardsParam,
|
||||
BatchMainCardsRes,
|
||||
BatchMainDeleteParam,
|
||||
BatchMainEditParam,
|
||||
BatchMainExportParam,
|
||||
BatchMainListParam,
|
||||
BatchMainListRes,
|
||||
BatchMainViewParam,
|
||||
BatchMainViewRes,
|
||||
BatchMainWarehousingListParam,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取批次主表列表
|
||||
export function List(params: BatchMainListParam) {
|
||||
return requestClient.get<BatchMainListRes>('common/batchMain/successList', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取入库批次列表
|
||||
export function WarehousingList(params: BatchMainWarehousingListParam) {
|
||||
return List({
|
||||
...params,
|
||||
batchType: 1,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取批次卡清单
|
||||
export function Cards(params: BatchMainCardsParam) {
|
||||
return requestClient.get<BatchMainCardsRes>('common/batchMain/cards', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除/批量删除批次主表
|
||||
export function Delete(params: BatchMainDeleteParam) {
|
||||
return requestClient.post('common/batchMain/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑批次主表
|
||||
export function Edit(params: BatchMainEditParam) {
|
||||
return requestClient.post('common/batchMain/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取批次主表指定详情
|
||||
export function View(params: BatchMainViewParam) {
|
||||
return requestClient.get<BatchMainViewRes>('common/batchMain/view', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 导出批次主表
|
||||
export function Export(params: BatchMainExportParam) {
|
||||
return requestClient.post<Blob>(
|
||||
'/common/batchMain/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
import type { AllocationUnits } from '#/api/iotlcm/tOperationlog/type';
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
import type { MemberSumma } from '#/utils';
|
||||
|
||||
/** 批次主表列表项 */
|
||||
export interface BatchMainBatchInfo {
|
||||
/** 协议期到期时间 */
|
||||
agreementExpiryDate?: null | string;
|
||||
/** 卡类型 */
|
||||
cardType?: string;
|
||||
/** 运营商达量断网 */
|
||||
carrierTrafficCutoffEnabled?: number;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 是否开启上游三码校验:1开启 0关闭 */
|
||||
validateUpstreamBasicInfo?: number;
|
||||
/** 结束ICCID */
|
||||
endIccid?: string;
|
||||
/** 结束IMSI */
|
||||
endImsi?: string;
|
||||
/** 结束MSISDN */
|
||||
endMsisdn?: string;
|
||||
/** 是否有沉默期 */
|
||||
hasSilentPeriod?: number;
|
||||
/** 是否有测试期 */
|
||||
hasTestPeriod?: number;
|
||||
/** 导入文件OSS ID */
|
||||
importFileOssId?: number;
|
||||
/** 贴片转插拔 */
|
||||
insertToPlugEnabled?: number;
|
||||
/** 沉默期天数 */
|
||||
silentPeriodDays?: number;
|
||||
/** 沉默期最晚过期日期 */
|
||||
silentPeriodLatestExpiryDate?: null | string;
|
||||
/** 起始ICCID */
|
||||
startIccid?: string;
|
||||
/** 起始IMSI */
|
||||
startImsi?: string;
|
||||
/** 起始MSISDN */
|
||||
startMsisdn?: string;
|
||||
/** 供应商 */
|
||||
suppliersCode?: string;
|
||||
/** 测试期天数 */
|
||||
testPeriodDays?: number;
|
||||
/** 测试期最晚过期日期 */
|
||||
testPeriodLatestExpiryDate?: null | string;
|
||||
/** 上游套餐 */
|
||||
upPkgCode?: string;
|
||||
/** 上游给出激活时间 */
|
||||
upstreamActivationTime?: null | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface BatchMainModel extends AllocationUnits {
|
||||
/** 批次业务参数 */
|
||||
batchInfo?: BatchMainBatchInfo;
|
||||
/** 批次编号 */
|
||||
batchNo: string;
|
||||
/** 批次执行时间 */
|
||||
batchTime?: string;
|
||||
/** 批次类型 枚举 */
|
||||
batchType: number;
|
||||
/** 总数量 */
|
||||
totalCount: number;
|
||||
/** 在库数量 */
|
||||
stockCount?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 获取批次主表指定信息响应项 */
|
||||
export interface BatchMainViewModel extends AllocationUnits {
|
||||
/** 主键ID */
|
||||
id: number;
|
||||
/** 批次编号 */
|
||||
batchNo: string;
|
||||
/** 订单编号 */
|
||||
orderSn: string;
|
||||
/** 批次类型 枚举 */
|
||||
batchType: number;
|
||||
/** 异步处理状态 0=已创建 1=待处理 2=处理中 3=成功 4=失败 5=部分成功 */
|
||||
batchAsyncStatus: number;
|
||||
/** 来源方式 枚举 */
|
||||
sourceType: number;
|
||||
/** 来源批次编号 */
|
||||
sourceBatchNo: string;
|
||||
/** 是否跨级操作机构 0-否 1-是 */
|
||||
isCrossDept: number;
|
||||
/** 目标机构编号 */
|
||||
targetDeptId: number;
|
||||
/** 机构编号 */
|
||||
deptId: number;
|
||||
/** 总数量 */
|
||||
totalCount: number;
|
||||
/** 有效数量 */
|
||||
validCount: number;
|
||||
/** 成功数量 */
|
||||
successCount: number;
|
||||
/** 失败数量 */
|
||||
failCount: number;
|
||||
/** 运行结果:0-待运行 1-运行中 2-成功 3-失败 */
|
||||
runResult: number;
|
||||
/** 失败原因 */
|
||||
failReason: string;
|
||||
/** 批次信息:入库/出库展示字段 */
|
||||
batchInfo: BatchMainViewModel;
|
||||
/** 备注扩展字段 */
|
||||
remark: BatchMainViewModel;
|
||||
/** 开始时间 */
|
||||
startTime: string;
|
||||
/** 结束时间 */
|
||||
endTime: string;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门ID */
|
||||
createdDept: number;
|
||||
/** 创建者ID */
|
||||
createdBy: number;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者ID */
|
||||
updatedBy: number;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
/** 创建者ID摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 更新者ID摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
}
|
||||
|
||||
/** 获取批次主表列表 请求参数 */
|
||||
export interface BatchMainListParam {
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** 批次编号 */
|
||||
batchNo?: string;
|
||||
/** 批次类型 枚举 */
|
||||
batchType: number;
|
||||
/** 批次执行时间 */
|
||||
time?: string[];
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/** 获取入库批次列表 请求参数 */
|
||||
export type BatchMainWarehousingListParam = Omit<
|
||||
BatchMainListParam,
|
||||
'batchType'
|
||||
>;
|
||||
|
||||
/** 获取批次主表列表 响应 */
|
||||
export type BatchMainListRes = GlobalListRes<BatchMainModel>;
|
||||
|
||||
/** 批次卡清单列表项 */
|
||||
export interface BatchCardListModel extends AllocationUnits {
|
||||
/** 明细状态 */
|
||||
detailStatus?: number;
|
||||
/** ICCID */
|
||||
iccid?: string;
|
||||
/** IMSI */
|
||||
imsi?: string;
|
||||
/** MSISDN */
|
||||
msisdn?: string;
|
||||
/** 行号 */
|
||||
rowNo?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 获取批次卡清单请求参数 */
|
||||
export interface BatchMainCardsParam {
|
||||
/** 批次编号 */
|
||||
batchNo: string;
|
||||
/** 批次类型 */
|
||||
batchType?: number;
|
||||
/** ICCID */
|
||||
iccid?: string;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** MSISDN */
|
||||
msisdn?: string;
|
||||
/** 仅显示当前库存卡 */
|
||||
currentStockOnly?: boolean;
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 获取批次卡清单响应 */
|
||||
export type BatchMainCardsRes = GlobalListRes<BatchCardListModel>;
|
||||
|
||||
/** 导出批次主表列表 请求参数 */
|
||||
export type BatchMainExportParam = BatchMainListParam;
|
||||
|
||||
/** 修改/新增批次主表 请求参数 */
|
||||
export interface BatchMainEditParam {
|
||||
/** 新建批次操作规模:1单卡2批量 */
|
||||
executionMode?: number;
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 批次编号 */
|
||||
batchNo?: string;
|
||||
/** 订单编号 */
|
||||
orderSn?: string;
|
||||
/** 批次类型 枚举 */
|
||||
batchType?: number;
|
||||
/** 批次状态 枚举 */
|
||||
batchStatus?: number;
|
||||
/** 来源方式 枚举 */
|
||||
sourceType?: number;
|
||||
/** 来源批次编号 */
|
||||
sourceBatchNo?: string;
|
||||
/** 是否跨级操作机构 0-否 1-是 */
|
||||
isCrossDept?: number;
|
||||
/** 目标机构编号 */
|
||||
targetDeptId?: number;
|
||||
/** 机构编号 */
|
||||
deptId?: number;
|
||||
/** 总数量 */
|
||||
totalCount?: number;
|
||||
/** 有效数量 */
|
||||
validCount?: number;
|
||||
/** 成功数量 */
|
||||
successCount?: number;
|
||||
/** 失败数量 */
|
||||
failCount?: number;
|
||||
/** 运行结果:0-待运行 1-运行中 2-成功 3-失败 */
|
||||
runResult?: number;
|
||||
/** 失败原因 */
|
||||
failReason?: string;
|
||||
/** 批次信息:入库/出库展示字段 */
|
||||
batchInfo?: BatchMainViewModel;
|
||||
/** 备注扩展字段 */
|
||||
remark?: BatchMainViewModel;
|
||||
/** 开始时间 */
|
||||
startTime?: string;
|
||||
/** 结束时间 */
|
||||
endTime?: string;
|
||||
/** 租户ID */
|
||||
tenantId?: string;
|
||||
/** 创建部门ID */
|
||||
createdDept?: number;
|
||||
/** 创建者ID */
|
||||
createdBy?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新者ID */
|
||||
updatedBy?: number;
|
||||
/** 更新时间 */
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
/** 获取批次主表指定信息 请求参数 */
|
||||
export interface BatchMainViewParam {
|
||||
/** 主键ID */
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 获取批次主表指定信息 响应 */
|
||||
export type BatchMainViewRes = BatchMainViewModel;
|
||||
|
||||
/** 删除批次主表 请求参数 */
|
||||
export interface BatchMainDeleteParam {
|
||||
/** 主键ID */
|
||||
id: number | number[];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import type {
|
||||
TSimCardCancellationFilter,
|
||||
TSimCardCancellationListParam,
|
||||
TSimCardCancellationListRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export function List(params: TSimCardCancellationListParam) {
|
||||
return requestClient.get<TSimCardCancellationListRes>(
|
||||
'/iot/tSimCardCancellation/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
export function Export(params: TSimCardCancellationFilter) {
|
||||
return requestClient.post<Blob>('/iot/tSimCardCancellation/export', params, {
|
||||
responseReturn: 'raw',
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
import type { MemberSumma } from '#/utils';
|
||||
|
||||
export interface TSimCardCancellationModel {
|
||||
id: number;
|
||||
iccid: string;
|
||||
msisdn: string;
|
||||
imsi: string;
|
||||
imei: string;
|
||||
deptId: number;
|
||||
deptName: string;
|
||||
chanKey: string;
|
||||
chanName: string;
|
||||
cancelBatchNo: string;
|
||||
cancelledAt: string;
|
||||
bossCardStatus: number;
|
||||
currentPackageCode: string;
|
||||
packageName: string;
|
||||
inboundBatchNo: string;
|
||||
outboundBatchNo: string;
|
||||
allocationBatchNo: string;
|
||||
cardType: number;
|
||||
netModel: number;
|
||||
remark: string;
|
||||
createdBy: number;
|
||||
createdBySumma?: MemberSumma;
|
||||
}
|
||||
|
||||
export interface TSimCardCancellationFilter {
|
||||
cardValue?: string;
|
||||
cancelBatchNo?: string;
|
||||
deptId?: number;
|
||||
chanKey?: string;
|
||||
cancelledStartAt?: string;
|
||||
cancelledEndAt?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardCancellationListParam extends TSimCardCancellationFilter {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
export type TSimCardCancellationListRes =
|
||||
GlobalListRes<TSimCardCancellationModel>;
|
||||
@@ -0,0 +1,89 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardInbound api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads inbound template from backend contract path', async () => {
|
||||
const { ExcelTemplate } = await import('./index');
|
||||
|
||||
ExcelTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardInbound/excel/template',
|
||||
{
|
||||
responseReturn: 'raw',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('submits excel inbound import with validation flag form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'inbound.xlsx');
|
||||
|
||||
ExcelSubmit({ file, validateUpstreamBasicInfo: 1 });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardInbound/excel/submit',
|
||||
{ file, validateUpstreamBasicInfo: 1 },
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('submits range inbound import with backend contract path', async () => {
|
||||
const { RangeSubmit } = await import('./index');
|
||||
const params = {
|
||||
cardType: '1',
|
||||
chanKey: 'CMCC',
|
||||
endIccid: '8986000000000000009',
|
||||
endImsi: '460001000000009',
|
||||
endMsisdn: '14000000009',
|
||||
sourceType: 1,
|
||||
startIccid: '8986000000000000001',
|
||||
startImsi: '460001000000001',
|
||||
startMsisdn: '14000000001',
|
||||
validateUpstreamBasicInfo: 0,
|
||||
};
|
||||
|
||||
RangeSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardInbound/range/submit', {
|
||||
...params,
|
||||
});
|
||||
});
|
||||
|
||||
it('submits input inbound import with backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
cardType: '1',
|
||||
chanKey: 'CMCC',
|
||||
input: '8986000000000000001 14000000001 460001000000001',
|
||||
sourceType: 2,
|
||||
upPkgCode: 'UP001',
|
||||
validateUpstreamBasicInfo: 0,
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith('/iot/tSimCardInbound/input/submit', {
|
||||
...params,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,137 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 下载入库示例模板
|
||||
export function ExcelTemplate() {
|
||||
return requestClient.download('/iot/tSimCardInbound/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export interface TSimCardInboundExcelSubmitParams {
|
||||
file: File;
|
||||
/** 是否开启上游三码校验:1开启 0关闭 */
|
||||
validateUpstreamBasicInfo?: number;
|
||||
}
|
||||
|
||||
export interface TSimCardInboundSubmitRes {
|
||||
/** 批次编号 */
|
||||
batchNo?: string;
|
||||
/** 批次类型 */
|
||||
batchType?: number;
|
||||
}
|
||||
|
||||
export interface TSimCardInboundRangeSubmitParams {
|
||||
/** 连号字段:iccid、msisdn 或 imsi */
|
||||
rangeType?: 'iccid' | 'imsi' | 'msisdn';
|
||||
/** 协议期到期时间 */
|
||||
agreementExpiryDate?: string;
|
||||
/** 卡类型 */
|
||||
cardType?: string;
|
||||
/** 是否运营商达量断网(global_yes_or_no) */
|
||||
carrierTrafficCutoffEnabled?: number;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 是否开启上游三码校验:1开启 0关闭 */
|
||||
validateUpstreamBasicInfo?: number;
|
||||
/** 结束号段ICCID */
|
||||
endIccid?: string;
|
||||
/** 结束号段IMSI */
|
||||
endImsi?: string;
|
||||
/** 结束号段MSISDN */
|
||||
endMsisdn?: string;
|
||||
/** 是否有沉默期(global_yes_or_no) */
|
||||
hasSilentPeriod?: number;
|
||||
/** 是否有测试期(global_yes_or_no) */
|
||||
hasTestPeriod?: number;
|
||||
/** 是否贴片转插拔(global_yes_or_no) */
|
||||
insertToPlugEnabled?: number;
|
||||
/** 来源方式:0 批次选择,1 连号,2 批量输入,3 文件,4 定时任务 */
|
||||
sourceType?: number;
|
||||
/** 沉默期天数 */
|
||||
silentPeriodDays?: number;
|
||||
/** 沉默期最晚过期日期 */
|
||||
silentPeriodLatestExpiryDate?: string;
|
||||
/** 起始号段ICCID */
|
||||
startIccid?: string;
|
||||
/** 起始号段IMSI */
|
||||
startImsi?: string;
|
||||
/** 起始号段MSISDN */
|
||||
startMsisdn?: string;
|
||||
/** 供应商编码 */
|
||||
suppliersCode?: string;
|
||||
/** 测试期天数 */
|
||||
testPeriodDays?: number;
|
||||
/** 测试期最晚过期日期 */
|
||||
testPeriodLatestExpiryDate?: string;
|
||||
/** 上游套餐编码 */
|
||||
upPkgCode?: string;
|
||||
/** 上游给出激活时间 */
|
||||
upstreamActivationTime?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardInboundInputSubmitParams {
|
||||
/** 协议期到期时间 */
|
||||
agreementExpiryDate?: string;
|
||||
/** 卡类型 */
|
||||
cardType?: string;
|
||||
/** 是否运营商达量断网(global_yes_or_no) */
|
||||
carrierTrafficCutoffEnabled?: number;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 是否开启上游三码校验:1开启 0关闭 */
|
||||
validateUpstreamBasicInfo?: number;
|
||||
/** 是否有沉默期(global_yes_or_no) */
|
||||
hasSilentPeriod?: number;
|
||||
/** 是否有测试期(global_yes_or_no) */
|
||||
hasTestPeriod?: number;
|
||||
/** 批量输入内容 */
|
||||
input: string;
|
||||
/** 是否贴片转插拔(global_yes_or_no) */
|
||||
insertToPlugEnabled?: number;
|
||||
/** 来源方式:0 批次选择,1 连号,2 批量输入,3 文件,4 定时任务 */
|
||||
sourceType?: number;
|
||||
/** 沉默期天数 */
|
||||
silentPeriodDays?: number;
|
||||
/** 沉默期最晚过期日期 */
|
||||
silentPeriodLatestExpiryDate?: string;
|
||||
/** 供应商编码 */
|
||||
suppliersCode?: string;
|
||||
/** 测试期天数 */
|
||||
testPeriodDays?: number;
|
||||
/** 测试期最晚过期日期 */
|
||||
testPeriodLatestExpiryDate?: string;
|
||||
/** 上游套餐编码 */
|
||||
upPkgCode?: string;
|
||||
/** 上游给出激活时间 */
|
||||
upstreamActivationTime?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// Excel批量卡入库
|
||||
export function ExcelSubmit(params: TSimCardInboundExcelSubmitParams) {
|
||||
const { file, ...data } = params;
|
||||
return requestClient.upload<TSimCardInboundSubmitRes>(
|
||||
'/iot/tSimCardInbound/excel/submit',
|
||||
{ ...data, file },
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 连号批量卡入库
|
||||
export function RangeSubmit(params: TSimCardInboundRangeSubmitParams) {
|
||||
return requestClient.post<TSimCardInboundSubmitRes>(
|
||||
'/iot/tSimCardInbound/range/submit',
|
||||
{ ...params },
|
||||
);
|
||||
}
|
||||
|
||||
// 批量输入卡入库
|
||||
export function InputSubmit(params: TSimCardInboundInputSubmitParams) {
|
||||
return requestClient.post<TSimCardInboundSubmitRes>(
|
||||
'/iot/tSimCardInbound/input/submit',
|
||||
{ ...params },
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const download = vi.fn();
|
||||
const get = vi.fn();
|
||||
const post = vi.fn();
|
||||
const upload = vi.fn();
|
||||
|
||||
vi.mock('#/api/request', () => ({
|
||||
requestClient: {
|
||||
download,
|
||||
get,
|
||||
post,
|
||||
upload,
|
||||
},
|
||||
}));
|
||||
|
||||
describe('tSimCardOutbound api', () => {
|
||||
beforeEach(() => {
|
||||
download.mockReset();
|
||||
get.mockReset();
|
||||
post.mockReset();
|
||||
upload.mockReset();
|
||||
});
|
||||
|
||||
it('downloads excel outbound template from backend contract path', async () => {
|
||||
const { DownloadTemplate } = await import('./index');
|
||||
|
||||
DownloadTemplate();
|
||||
|
||||
expect(download).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardOutbound/excel/template',
|
||||
{
|
||||
responseReturn: 'raw',
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('submits excel outbound as file-only form data', async () => {
|
||||
const { ExcelSubmit } = await import('./index');
|
||||
const file = new File(['iccid'], 'outbound.xlsx');
|
||||
|
||||
ExcelSubmit({ file });
|
||||
|
||||
expect(upload).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardOutbound/excel/submit',
|
||||
{ file },
|
||||
{
|
||||
timeout: 60_000,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('submits range outbound with backend contract path', async () => {
|
||||
const { RangeSubmit } = await import('./index');
|
||||
const params = {
|
||||
customerAgentId: 12,
|
||||
durationMonths: 6,
|
||||
endIccid: '8986000000000000009',
|
||||
endImsi: '460000000000009',
|
||||
endMsisdn: '13000000009',
|
||||
offlineContractCompleted: true,
|
||||
packageBeginTime: '2026-07-02 10:00:00',
|
||||
packageCode: 'PKG001',
|
||||
startIccid: '8986000000000000001',
|
||||
startImsi: '460000000000001',
|
||||
startMsisdn: '13000000001',
|
||||
};
|
||||
|
||||
RangeSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardOutbound/range/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
|
||||
it('queries outbound inbound batch list from backend contract path', async () => {
|
||||
const { InboundBatchList } = await import('./index');
|
||||
const params = {
|
||||
batchNo: 'IN202607020001',
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
};
|
||||
|
||||
InboundBatchList(params);
|
||||
|
||||
expect(get).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardOutbound/inboundBatch/list',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('queries outbound inbound batch cards from backend contract path', async () => {
|
||||
const { InboundBatchCards } = await import('./index');
|
||||
const params = {
|
||||
batchNo: 'IN202607020001',
|
||||
iccid: '8986',
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
};
|
||||
|
||||
InboundBatchCards(params);
|
||||
|
||||
expect(get).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardOutbound/inboundBatch/cards',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('queries outbound customer balance from backend contract path', async () => {
|
||||
const { CustomerBalance } = await import('./index');
|
||||
const params = { customerAgentId: 12 };
|
||||
|
||||
CustomerBalance(params);
|
||||
|
||||
expect(get).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardOutbound/customerBalance',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('submits inbound batch outbound with backend-supported payload', async () => {
|
||||
const { BatchSubmit } = await import('./index');
|
||||
const params = {
|
||||
batchNo: 'IN202607020001',
|
||||
customerAgentId: 12,
|
||||
durationMonths: 6,
|
||||
offlineContractCompleted: false,
|
||||
packageBeginTime: '2026-07-02',
|
||||
packageCode: 'PKG001',
|
||||
};
|
||||
|
||||
BatchSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardOutbound/batch/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
|
||||
it('submits input outbound with backend contract path', async () => {
|
||||
const { InputSubmit } = await import('./index');
|
||||
const params = {
|
||||
customerAgentId: 12,
|
||||
durationMonths: 6,
|
||||
input: '8986000000000000001\n8986000000000000002',
|
||||
offlineContractCompleted: true,
|
||||
packageBeginTime: '2026-07-02 10:00:00',
|
||||
packageCode: 'PKG001',
|
||||
};
|
||||
|
||||
InputSubmit(params);
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/iot/tSimCardOutbound/input/submit',
|
||||
params,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('tSimCardStock outbound form model', () => {
|
||||
it('calculates outbound end date from begin date and duration parts', async () => {
|
||||
const { calculateOutboundEndDate } =
|
||||
await import('#/views/iotlcm/tLifeCycle/tSimCardStock/outboundFormUtils');
|
||||
|
||||
expect(
|
||||
calculateOutboundEndDate({
|
||||
durationMonthPart: 6,
|
||||
durationYears: 1,
|
||||
giftDurationMonthPart: 2,
|
||||
giftDurationYears: 0,
|
||||
packageBeginTime: '2026-08-06',
|
||||
}),
|
||||
).toBe('2028-03-31');
|
||||
});
|
||||
|
||||
it('normalizes outbound submit values without period options', async () => {
|
||||
const { normalizeOutboundSubmitValues } =
|
||||
await import('#/views/iotlcm/tLifeCycle/tSimCardStock/outboundFormUtils');
|
||||
|
||||
expect(
|
||||
normalizeOutboundSubmitValues({
|
||||
adminNote: 'old',
|
||||
amount: 12,
|
||||
buyerNote: 'old',
|
||||
customerBalanceDisplay: '余额:¥100.00',
|
||||
durationMonthPart: 3,
|
||||
durationYears: 1,
|
||||
expectedPackageEndTime: '2027-11-06',
|
||||
giftDurationMonthPart: 1,
|
||||
giftDurationYears: 0,
|
||||
hasSilentPeriod: 0,
|
||||
hasTestPeriod: 0,
|
||||
offlineContractCompleted: false,
|
||||
remark: ' remark ',
|
||||
silentPeriodDays: 7,
|
||||
testPeriodDays: 3,
|
||||
}),
|
||||
).toMatchObject({
|
||||
amount: '12',
|
||||
adminNote: undefined,
|
||||
buyerNote: undefined,
|
||||
customerBalanceDisplay: undefined,
|
||||
durationMonths: 15,
|
||||
expectedPackageEndTime: undefined,
|
||||
giftDurationMonths: 1,
|
||||
hasSilentPeriod: undefined,
|
||||
hasTestPeriod: undefined,
|
||||
offlineContractCompleted: false,
|
||||
remark: 'remark',
|
||||
silentPeriodDays: undefined,
|
||||
testPeriodDays: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,197 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export interface TSimCardOutboundSubmitRes {
|
||||
batchAsyncStatus: number;
|
||||
batchNo: string;
|
||||
batchType: number;
|
||||
failCount?: number;
|
||||
orderSn?: string;
|
||||
quantity?: number;
|
||||
resultDownloadId?: number;
|
||||
resultFileOssId?: number;
|
||||
status?: string;
|
||||
total?: number;
|
||||
validCount?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundSubmitBaseParam {
|
||||
adminNote?: string;
|
||||
amount?: number | string;
|
||||
buyerNote?: string;
|
||||
customerAgentId: number;
|
||||
durationMonthPart?: number;
|
||||
durationYears?: number;
|
||||
durationMonths: number;
|
||||
giftDurationMonthPart?: number;
|
||||
giftDurationYears?: number;
|
||||
giftDurationMonths?: number;
|
||||
offlineContractCompleted: boolean;
|
||||
packageBeginTime: string;
|
||||
packageCode: string;
|
||||
remark?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundExcelSubmitParam {
|
||||
file: File;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundRangeSubmitParam extends TSimCardOutboundSubmitBaseParam {
|
||||
endIccid: string;
|
||||
endImsi: string;
|
||||
endMsisdn: string;
|
||||
rangeCodeType?: 'iccid' | 'imsi' | 'msisdn';
|
||||
startIccid: string;
|
||||
startImsi: string;
|
||||
startMsisdn: string;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundInputSubmitParam extends TSimCardOutboundSubmitBaseParam {
|
||||
input: string;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundInboundBatchListParam {
|
||||
agreementExpiryMonths?: number;
|
||||
batchNo?: string;
|
||||
cardType?: string;
|
||||
chanName?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
upPkgKeyword?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundInboundBatchListItem {
|
||||
agreementExpiryDate?: string;
|
||||
batchNo: string;
|
||||
cardType?: string;
|
||||
chanKey?: string;
|
||||
chanName?: string;
|
||||
firstCreatedAt?: string;
|
||||
lastCreatedAt?: string;
|
||||
stockCount: number;
|
||||
upPkgCode?: string;
|
||||
upPkgName?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundInboundBatchListRes {
|
||||
items: TSimCardOutboundInboundBatchListItem[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundInboundBatchCardsParam {
|
||||
batchNo: string;
|
||||
iccid?: string;
|
||||
imsi?: string;
|
||||
msisdn?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundInboundBatchCardItem {
|
||||
agreementExpiryDate?: string;
|
||||
batchNo: string;
|
||||
cardType?: string;
|
||||
chanKey?: string;
|
||||
chanName?: string;
|
||||
createdAt?: string;
|
||||
iccid: string;
|
||||
imei?: string;
|
||||
imsi?: string;
|
||||
msisdn?: string;
|
||||
upPkgCode?: string;
|
||||
upPkgName?: string;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundInboundBatchCardsRes {
|
||||
items: TSimCardOutboundInboundBatchCardItem[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundBatchSubmitParam extends TSimCardOutboundSubmitBaseParam {
|
||||
batchNo: string;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundCustomerBalanceParam {
|
||||
customerAgentId: number;
|
||||
}
|
||||
|
||||
export interface TSimCardOutboundCustomerBalanceRes {
|
||||
accountExists: boolean;
|
||||
balance: number;
|
||||
customerAgentId: number;
|
||||
customerName?: string;
|
||||
status: number;
|
||||
statusText?: string;
|
||||
}
|
||||
|
||||
export function DownloadTemplate() {
|
||||
return requestClient.download('/iot/tSimCardOutbound/excel/template', {
|
||||
responseReturn: 'raw',
|
||||
});
|
||||
}
|
||||
|
||||
export function ExcelSubmit(params: TSimCardOutboundExcelSubmitParam) {
|
||||
return requestClient.upload<TSimCardOutboundSubmitRes>(
|
||||
'/iot/tSimCardOutbound/excel/submit',
|
||||
{ file: params.file },
|
||||
{
|
||||
timeout: 180_000,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function RangeSubmit(params: TSimCardOutboundRangeSubmitParam) {
|
||||
return requestClient.post<TSimCardOutboundSubmitRes>(
|
||||
'/iot/tSimCardOutbound/range/submit',
|
||||
params,
|
||||
{ timeout: 180_000 },
|
||||
);
|
||||
}
|
||||
|
||||
export function InputSubmit(params: TSimCardOutboundInputSubmitParam) {
|
||||
return requestClient.post<TSimCardOutboundSubmitRes>(
|
||||
'/iot/tSimCardOutbound/input/submit',
|
||||
params,
|
||||
{ timeout: 180_000 },
|
||||
);
|
||||
}
|
||||
|
||||
export function InboundBatchList(
|
||||
params: TSimCardOutboundInboundBatchListParam,
|
||||
) {
|
||||
return requestClient.get<TSimCardOutboundInboundBatchListRes>(
|
||||
'/iot/tSimCardOutbound/inboundBatch/list',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function InboundBatchCards(
|
||||
params: TSimCardOutboundInboundBatchCardsParam,
|
||||
) {
|
||||
return requestClient.get<TSimCardOutboundInboundBatchCardsRes>(
|
||||
'/iot/tSimCardOutbound/inboundBatch/cards',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function BatchSubmit(params: TSimCardOutboundBatchSubmitParam) {
|
||||
return requestClient.post<TSimCardOutboundSubmitRes>(
|
||||
'/iot/tSimCardOutbound/batch/submit',
|
||||
params,
|
||||
{ timeout: 180_000 },
|
||||
);
|
||||
}
|
||||
|
||||
export function CustomerBalance(params: TSimCardOutboundCustomerBalanceParam) {
|
||||
return requestClient.get<TSimCardOutboundCustomerBalanceRes>(
|
||||
'/iot/tSimCardOutbound/customerBalance',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import type {
|
||||
TSimCardStockDeleteParam,
|
||||
TSimCardStockEditParam,
|
||||
TSimCardStockExportParam,
|
||||
TSimCardStockListParam,
|
||||
TSimCardStockListRes,
|
||||
TSimCardStockViewParam,
|
||||
TSimCardStockViewRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取库存卡信息表列表
|
||||
export function List(params: TSimCardStockListParam) {
|
||||
return requestClient.get<TSimCardStockListRes>('iot/tSimCardStock/list', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除/批量删除库存卡信息表
|
||||
export function Delete(params: TSimCardStockDeleteParam) {
|
||||
return requestClient.post('iot/tSimCardStock/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑库存卡信息表
|
||||
export function Edit(params: TSimCardStockEditParam) {
|
||||
return requestClient.post('iot/tSimCardStock/edit', { ...params });
|
||||
}
|
||||
|
||||
// 获取库存卡信息表指定详情
|
||||
export function View(params: TSimCardStockViewParam) {
|
||||
return requestClient.get<TSimCardStockViewRes>('iot/tSimCardStock/view', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 导出库存卡信息表
|
||||
export function Export(params: TSimCardStockExportParam) {
|
||||
return requestClient.post<Blob>(
|
||||
'/iot/tSimCardStock/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
import type { MemberSumma } from '#/utils';
|
||||
|
||||
/** 库存卡信息表列表项 */
|
||||
export interface TSimCardStockModel {
|
||||
/** 主键ID */
|
||||
id: number;
|
||||
/** 入库批次号 */
|
||||
batchNo?: string;
|
||||
/** ICCID */
|
||||
iccid: string;
|
||||
/** MSISDN */
|
||||
msisdn: string;
|
||||
/** IMSI */
|
||||
imsi: string;
|
||||
/** IMEI */
|
||||
imei: string;
|
||||
/** 通道编号 */
|
||||
chanKey: string;
|
||||
/** 通道名称 */
|
||||
chanName?: string;
|
||||
/** 卡类型 */
|
||||
cardType?: string;
|
||||
/** 上游套餐编码 */
|
||||
upPkgCode?: string;
|
||||
/** 上游套餐名称 */
|
||||
upPkgName?: string;
|
||||
/** 协议到期时间 */
|
||||
agreementExpiryDate?: string;
|
||||
/** 租户ID */
|
||||
tenantId: string;
|
||||
/** 创建部门 */
|
||||
createdDept: number;
|
||||
/** 创建者 */
|
||||
createdBy: number;
|
||||
/** 创建者摘要信息 */
|
||||
createdBySumma: MemberSumma;
|
||||
/** 创建时间 */
|
||||
createdAt: string;
|
||||
/** 更新者 */
|
||||
updatedBy: number;
|
||||
/** 更新者摘要信息 */
|
||||
updatedBySumma: MemberSumma;
|
||||
/** 更新时间 */
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
/** 获取库存卡信息表列表 请求参数 */
|
||||
export interface TSimCardStockListParam {
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** 入库批次号 */
|
||||
batchNo?: string;
|
||||
/** ICCID */
|
||||
iccid?: string;
|
||||
/** MSISDN */
|
||||
msisdn?: string;
|
||||
/** IMSI */
|
||||
imsi?: string;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 通道名称 */
|
||||
chanName?: string;
|
||||
/** 卡类型 */
|
||||
cardType?: string;
|
||||
/** 上游套餐关键字 */
|
||||
upPkgKeyword?: string;
|
||||
/** 协议到期快捷筛选(月) */
|
||||
agreementExpiryMonths?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string[];
|
||||
}
|
||||
|
||||
/** 获取库存卡信息表列表 响应 */
|
||||
export type TSimCardStockListRes = GlobalListRes<TSimCardStockModel>;
|
||||
|
||||
/** 导出库存卡信息表列表 请求参数 */
|
||||
export type TSimCardStockExportParam = TSimCardStockListParam;
|
||||
|
||||
/** 修改/新增库存卡信息表 请求参数 */
|
||||
export interface TSimCardStockEditParam {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** ICCID */
|
||||
iccid?: string;
|
||||
/** MSISDN */
|
||||
msisdn?: string;
|
||||
/** IMSI */
|
||||
imsi?: string;
|
||||
/** IMEI */
|
||||
imei?: string;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 租户ID */
|
||||
tenantId?: string;
|
||||
/** 创建部门 */
|
||||
createdDept?: number;
|
||||
/** 创建者 */
|
||||
createdBy?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新者 */
|
||||
updatedBy?: number;
|
||||
/** 更新时间 */
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
/** 获取库存卡信息表指定信息 请求参数 */
|
||||
export interface TSimCardStockViewParam {
|
||||
/** 主键ID */
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 获取库存卡信息表指定信息 响应 */
|
||||
export type TSimCardStockViewRes = TSimCardStockModel;
|
||||
|
||||
/** 删除库存卡信息表 请求参数 */
|
||||
export interface TSimCardStockDeleteParam {
|
||||
/** 主键ID */
|
||||
id: number | number[];
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import type {
|
||||
BatchExecutionLogDetailListParam,
|
||||
BatchExecutionLogDetailListRes,
|
||||
BatchExecutionLogListParam,
|
||||
BatchExecutionLogListRes,
|
||||
BatchExecutionLogSummaryParam,
|
||||
BatchExecutionLogSummaryRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取批次执行日志列表
|
||||
export function List(params: BatchExecutionLogListParam) {
|
||||
return requestClient.get<BatchExecutionLogListRes>(
|
||||
'common/batchExecutionLog/list',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 获取批次执行日志概要
|
||||
export function Summary(params: BatchExecutionLogSummaryParam) {
|
||||
return requestClient.get<BatchExecutionLogSummaryRes>(
|
||||
'common/batchExecutionLog/summary',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 获取批次执行日志明细列表
|
||||
export function DetailList(params: BatchExecutionLogDetailListParam) {
|
||||
return requestClient.get<BatchExecutionLogDetailListRes>(
|
||||
'common/batchExecutionLog/detailList',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
import type { GlobalListRes } from '#/types/global';
|
||||
import type { MemberSumma } from '#/utils';
|
||||
|
||||
/** 划拨单位信息,名称优先使用提交时快照。 */
|
||||
export interface AllocationUnits {
|
||||
sourceDeptId?: number;
|
||||
sourceDeptName?: string;
|
||||
targetDeptId?: number;
|
||||
targetDeptName?: string;
|
||||
targetDeptMode?: 'per_row' | 'single';
|
||||
}
|
||||
|
||||
/** 批次执行日志列表项 */
|
||||
export interface BatchExecutionLogModel extends AllocationUnits {
|
||||
sourceChannel?: string;
|
||||
executionMode?: number;
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 批次编号 */
|
||||
batchNo?: string;
|
||||
/** 异步处理状态 */
|
||||
batchAsyncStatus?: number;
|
||||
/** 批次类型 */
|
||||
batchType?: number;
|
||||
/** 来源方式 */
|
||||
sourceType?: null | number;
|
||||
/** 总数量 */
|
||||
totalCount?: number;
|
||||
/** 运行结果 */
|
||||
runResult?: number;
|
||||
/** 开始时间 */
|
||||
startTime?: string;
|
||||
/** 结束时间 */
|
||||
endTime?: string;
|
||||
/** 创建部门ID */
|
||||
createdDept?: number;
|
||||
/** 创建者ID */
|
||||
createdBy?: number;
|
||||
/** 创建者摘要 */
|
||||
createdBySumma?: MemberSumma;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
}
|
||||
|
||||
/** 批次执行日志概要响应 */
|
||||
export interface BatchExecutionLogSummaryRes extends AllocationUnits {
|
||||
sourceChannel?: string;
|
||||
executionMode?: number;
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 批次编号 */
|
||||
batchNo?: string;
|
||||
/** 异步处理状态 */
|
||||
batchAsyncStatus?: number;
|
||||
/** 批次类型 */
|
||||
batchType?: number;
|
||||
/** 来源方式 */
|
||||
sourceType?: null | number;
|
||||
/** 总数量 */
|
||||
totalCount?: number;
|
||||
/** 运行结果 */
|
||||
runResult?: number;
|
||||
/** 失败原因 */
|
||||
failReason?: string;
|
||||
/** 源文件 */
|
||||
sourceFile?: BatchExecutionLogFileModel;
|
||||
/** 结果文件 */
|
||||
resultFile?: BatchExecutionLogResultFileModel;
|
||||
/** 开始时间 */
|
||||
startTime?: string;
|
||||
/** 结束时间 */
|
||||
endTime?: string;
|
||||
}
|
||||
|
||||
/** 批次执行日志文件信息 */
|
||||
export interface BatchExecutionLogFileModel {
|
||||
/** OSS文件ID */
|
||||
ossId?: number;
|
||||
/** 文件URL */
|
||||
url?: string;
|
||||
}
|
||||
|
||||
/** 批次执行日志结果文件信息 */
|
||||
export interface BatchExecutionLogResultFileModel extends BatchExecutionLogFileModel {
|
||||
/** 下载任务ID */
|
||||
downloadId?: number;
|
||||
/** 下载状态 */
|
||||
downloadStatus?: number;
|
||||
}
|
||||
|
||||
/** 获取批次执行日志列表请求参数 */
|
||||
export interface BatchExecutionLogListParam {
|
||||
sourceChannel?: string;
|
||||
executionMode?: number;
|
||||
/** 输入方式:0选择、1连号、2输入、3文件、4定时 */
|
||||
sourceType?: number;
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** 批次编号 */
|
||||
batchNo?: string;
|
||||
/** 异步处理状态 */
|
||||
batchAsyncStatus?: number;
|
||||
/** 批次类型 */
|
||||
batchType?: number;
|
||||
/** 创建时间 */
|
||||
createdAt?: string[];
|
||||
}
|
||||
|
||||
/** 获取批次执行日志列表响应 */
|
||||
export type BatchExecutionLogListRes = GlobalListRes<BatchExecutionLogModel>;
|
||||
|
||||
/** 批次执行日志明细列表项 */
|
||||
export interface BatchExecutionLogDetailModel extends AllocationUnits {
|
||||
/** 协议到期时间 */
|
||||
agreementExpiryDate?: string;
|
||||
/** 卡类型 */
|
||||
cardType?: string;
|
||||
/** 是否运营商达量断网 */
|
||||
carrierTrafficCutoffEnabled?: string;
|
||||
/** 通道编号 */
|
||||
chanKey?: string;
|
||||
/** 明细状态 */
|
||||
detailStatus?: number;
|
||||
/** 错误信息 */
|
||||
error?: BatchExecutionLogDetailErrorModel;
|
||||
/** 是否有沉默期 */
|
||||
hasSilentPeriod?: string;
|
||||
/** 是否有测试期 */
|
||||
hasTestPeriod?: string;
|
||||
/** ICCID */
|
||||
iccid?: string;
|
||||
/** IMEI */
|
||||
imei?: string;
|
||||
/** IMSI */
|
||||
imsi?: string;
|
||||
/** 是否贴片转插拔 */
|
||||
insertToPlugEnabled?: string;
|
||||
/** MSISDN */
|
||||
msisdn?: string;
|
||||
/** 行号 */
|
||||
rowNo?: number;
|
||||
/** 沉默期天数 */
|
||||
silentPeriodDays?: string;
|
||||
/** 沉默期最晚过期日期 */
|
||||
silentPeriodLatestExpiryDate?: string;
|
||||
/** 供应商编码 */
|
||||
suppliersCode?: string;
|
||||
/** 测试期天数 */
|
||||
testPeriodDays?: string;
|
||||
/** 测试期最晚过期日期 */
|
||||
testPeriodLatestExpiryDate?: string;
|
||||
/** 上游套餐编码 */
|
||||
upPkgCode?: string;
|
||||
/** 上游激活时间 */
|
||||
upstreamActivationTime?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 批次执行日志明细错误信息 */
|
||||
export interface BatchExecutionLogDetailErrorModel {
|
||||
/** 异常原因 */
|
||||
reason?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 获取批次执行日志明细列表请求参数 */
|
||||
export interface BatchExecutionLogDetailListParam {
|
||||
/** 批次编号 */
|
||||
batchNo: string;
|
||||
/** 批次类型 */
|
||||
batchType?: number;
|
||||
/** 明细状态 */
|
||||
detailStatus?: number;
|
||||
/** ICCID */
|
||||
iccid?: string;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页大小 */
|
||||
pageSize?: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/** 获取批次执行日志明细列表响应 */
|
||||
export type BatchExecutionLogDetailListRes =
|
||||
GlobalListRes<BatchExecutionLogDetailModel>;
|
||||
|
||||
/** 获取批次执行日志概要请求参数 */
|
||||
export interface BatchExecutionLogSummaryParam {
|
||||
/** 批次编号 */
|
||||
batchNo: string;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export interface OrderItem {
|
||||
businessBatchNo: string;
|
||||
durationUnit: string;
|
||||
durationValue: number;
|
||||
effectiveMode: string;
|
||||
itemId: number;
|
||||
price: number;
|
||||
productName: string;
|
||||
productSn: string;
|
||||
quantity: number;
|
||||
serviceBeginTime?: string;
|
||||
serviceEndTime?: string;
|
||||
sourceBatchNo: string;
|
||||
}
|
||||
|
||||
export interface OrderRow {
|
||||
agentName: string;
|
||||
balance: number;
|
||||
businessBatchNo: string;
|
||||
buyerNote: string;
|
||||
createdAt: string;
|
||||
customerName: string;
|
||||
discountAmount: number;
|
||||
distributionStatus: number;
|
||||
id: number;
|
||||
items?: OrderItem[];
|
||||
offlinePaidAmount: number;
|
||||
onlinePaidAmount: number;
|
||||
orderSn: string;
|
||||
orderStatus: number;
|
||||
orderType: number;
|
||||
paidAmount: number;
|
||||
parentOrderSn: string;
|
||||
payOrderSn: string;
|
||||
payStatus: number;
|
||||
payTime?: string;
|
||||
payType: number;
|
||||
productAmount: number;
|
||||
productName: string;
|
||||
productSn: string;
|
||||
quantity: number;
|
||||
returnStatus: number;
|
||||
serviceBeginTime?: string;
|
||||
serviceEndTime?: string;
|
||||
serviceFee: number;
|
||||
totalAmount: number;
|
||||
unitPrice: number;
|
||||
unrefundAmount: number;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface OrderListParams {
|
||||
createdAt?: [string, string];
|
||||
distributionStatus?: number;
|
||||
orderSn?: string;
|
||||
orderStatus?: number;
|
||||
orderType?: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
payStatus?: number;
|
||||
payType?: number;
|
||||
perspective?: 'purchase' | 'sell';
|
||||
}
|
||||
|
||||
export interface OrderListResult {
|
||||
items: OrderRow[];
|
||||
page: number;
|
||||
pageSize: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function List(params: OrderListParams) {
|
||||
return requestClient.get<OrderListResult>('iot/tOrder/list', { params });
|
||||
}
|
||||
|
||||
export function SellList(params: OrderListParams) {
|
||||
return requestClient.get<OrderListResult>('iot/tOrder/sellList', { params });
|
||||
}
|
||||
|
||||
export function View(params: { id: number }) {
|
||||
return requestClient.get<OrderRow>('iot/tOrder/view', { params });
|
||||
}
|
||||
|
||||
export function Export(params: OrderListParams) {
|
||||
return requestClient.post<Blob>(
|
||||
'/iot/tOrder/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import type {
|
||||
TSimFlowPackageInfoDeleteParam,
|
||||
TSimFlowPackageInfoEditParam,
|
||||
TSimFlowPackageInfoExportParam,
|
||||
TSimFlowPackageInfoListParam,
|
||||
TSimFlowPackageInfoListRes,
|
||||
TSimFlowPackageInfoViewParam,
|
||||
TSimFlowPackageInfoViewRes,
|
||||
} from './type';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
// 获取SIM流量套餐管理列表
|
||||
export function List(params: TSimFlowPackageInfoListParam) {
|
||||
return requestClient.get<TSimFlowPackageInfoListRes>(
|
||||
'iot/tSimFlowPackageInfo/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 删除/批量删除SIM流量套餐管理
|
||||
export function Delete(params: TSimFlowPackageInfoDeleteParam) {
|
||||
return requestClient.post('iot/tSimFlowPackageInfo/delete', { ...params });
|
||||
}
|
||||
|
||||
// 添加/编辑SIM流量套餐管理
|
||||
export function Edit(params: TSimFlowPackageInfoEditParam) {
|
||||
return requestClient.post('iot/tSimFlowPackageInfo/edit', { ...params });
|
||||
}
|
||||
|
||||
// 同步当前部门套餐关联
|
||||
export function SyncDeptPackages() {
|
||||
return requestClient.post('iot/tSimFlowPackageInfo/syncDeptPackages');
|
||||
}
|
||||
|
||||
// 获取SIM流量套餐管理指定详情
|
||||
export function View(params: TSimFlowPackageInfoViewParam) {
|
||||
return requestClient.get<TSimFlowPackageInfoViewRes>(
|
||||
'iot/tSimFlowPackageInfo/view',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 导出SIM流量套餐管理
|
||||
export function Export(params: TSimFlowPackageInfoExportParam) {
|
||||
return requestClient.post<Blob>(
|
||||
'/iot/tSimFlowPackageInfo/export',
|
||||
{ ...params },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
},
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user