框架更新
This commit is contained in:
Generated
+473
-647
File diff suppressed because it is too large
Load Diff
+26
-24
@@ -41,20 +41,21 @@
|
|||||||
"type-check": "vue-tsc --noEmit"
|
"type-check": "vue-tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-app": "3.0.0-4010520240507001",
|
"@ant-design/icons-vue": "^7.0.1",
|
||||||
"@dcloudio/uni-app-plus": "3.0.0-4010520240507001",
|
"@dcloudio/uni-app": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-components": "3.0.0-4010520240507001",
|
"@dcloudio/uni-app-plus": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-h5": "3.0.0-4010520240507001",
|
"@dcloudio/uni-components": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-alipay": "3.0.0-4010520240507001",
|
"@dcloudio/uni-h5": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-baidu": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-alipay": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-jd": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-baidu": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-kuaishou": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-jd": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-lark": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-kuaishou": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-qq": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-lark": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-toutiao": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-qq": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-weixin": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-toutiao": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-mp-xhs": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-weixin": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4010520240507001",
|
"@dcloudio/uni-mp-xhs": "3.0.0-4020320240708001",
|
||||||
|
"@dcloudio/uni-quickapp-webview": "3.0.0-4020320240708001",
|
||||||
"@hyoga/uni-socket.io": "^3.0.4",
|
"@hyoga/uni-socket.io": "^3.0.4",
|
||||||
"@types/socket.io-client": "^3.0.0",
|
"@types/socket.io-client": "^3.0.0",
|
||||||
"@vitejs/plugin-vue": "^5.0.5",
|
"@vitejs/plugin-vue": "^5.0.5",
|
||||||
@@ -67,24 +68,25 @@
|
|||||||
"luch-request": "^3.1.1",
|
"luch-request": "^3.1.1",
|
||||||
"md5": "^2.3.0",
|
"md5": "^2.3.0",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
|
"postcss": "^8.4.39",
|
||||||
|
"qrcode": "^1.5.3",
|
||||||
"socket.io-client": "^4.7.2",
|
"socket.io-client": "^4.7.2",
|
||||||
"vite": "^5.3.2",
|
"vue": "3.4.21",
|
||||||
"vue": "^3.4.21",
|
"vue-i18n": "9.13.1"
|
||||||
"vue-i18n": "^9.1.9"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@dcloudio/types": "^3.4.8",
|
"@dcloudio/types": "3.4.12",
|
||||||
"@dcloudio/uni-automator": "3.0.0-4010520240507001",
|
"@dcloudio/uni-automator": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-cli-shared": "3.0.0-4010520240507001",
|
"@dcloudio/uni-cli-shared": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/uni-stacktracey": "3.0.0-4010520240507001",
|
"@dcloudio/uni-stacktracey": "3.0.0-4020320240708001",
|
||||||
"@dcloudio/vite-plugin-uni": "3.0.0-4010520240507001",
|
"@dcloudio/vite-plugin-uni": "3.0.0-4020320240708001",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@vue/runtime-core": "^3.4.21",
|
"@vue/runtime-core": "3.4.33",
|
||||||
"@vue/tsconfig": "^0.1.3",
|
"@vue/tsconfig": "^0.1.3",
|
||||||
"sass": "^1.77.6",
|
"sass": "^1.77.6",
|
||||||
"sass-loader": "10.1.1",
|
"sass-loader": "10.1.1",
|
||||||
"typescript": "^4.9.4",
|
"typescript": "^4.9.4",
|
||||||
"vite": "^5.3.2",
|
"vite": "5.2.8",
|
||||||
"vue-tsc": "^1.0.24"
|
"vue-tsc": "^1.0.24"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ export interface MpMenu {
|
|||||||
icon?: string;
|
icon?: string;
|
||||||
// 图标颜色
|
// 图标颜色
|
||||||
color?: string;
|
color?: string;
|
||||||
|
// 所在行
|
||||||
|
rows?: number;
|
||||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||||
hide?: number;
|
hide?: number;
|
||||||
// 位置 0不限 1顶部 2底部
|
// 位置 0不限 1顶部 2底部
|
||||||
@@ -48,6 +50,8 @@ export interface MpMenu {
|
|||||||
goodsId?: number;
|
goodsId?: number;
|
||||||
// 用户ID
|
// 用户ID
|
||||||
userId?: number;
|
userId?: number;
|
||||||
|
// 是否管理人员可见
|
||||||
|
adminShow?: number;
|
||||||
// 设为首页
|
// 设为首页
|
||||||
home?: number;
|
home?: number;
|
||||||
// 排序(数字越小越靠前)
|
// 排序(数字越小越靠前)
|
||||||
@@ -63,13 +67,17 @@ export interface MpMenu {
|
|||||||
// 子菜单
|
// 子菜单
|
||||||
children?: MpMenu[];
|
children?: MpMenu[];
|
||||||
pageName?: string;
|
pageName?: string;
|
||||||
|
groupName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序端菜单搜索条件
|
* 小程序端菜单搜索条件
|
||||||
*/
|
*/
|
||||||
export interface MpMenuParam extends PageParam {
|
export interface MpMenuParam extends PageParam {
|
||||||
|
parentId?: number;
|
||||||
menuId?: number;
|
menuId?: number;
|
||||||
|
pageId?: number;
|
||||||
|
subpackage?: string;
|
||||||
type?: number;
|
type?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { Mp, MpParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页数据
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export async function getIndex(params: MpParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<Mp>>>(
|
||||||
|
MODULES_API_URL + '/cms/mp/index',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询小程序信息
|
||||||
|
*/
|
||||||
|
export async function pageMp(params: MpParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<Mp>>>(
|
||||||
|
MODULES_API_URL + '/cms/mp/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询小程序信息列表
|
||||||
|
*/
|
||||||
|
export async function listMp(params?: MpParam) {
|
||||||
|
const res = await request.get<ApiResult<Mp[]>>(
|
||||||
|
MODULES_API_URL + '/cms/mp',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加小程序信息
|
||||||
|
*/
|
||||||
|
export async function addMp(data: Mp) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/mp',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改小程序信息
|
||||||
|
*/
|
||||||
|
export async function updateMp(data: Mp) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/mp',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除小程序信息
|
||||||
|
*/
|
||||||
|
export async function removeMp(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/mp/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除小程序信息
|
||||||
|
*/
|
||||||
|
export async function removeBatchMp(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/mp/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询小程序信息
|
||||||
|
*/
|
||||||
|
export async function getMp(id: number) {
|
||||||
|
const res = await request.get<ApiResult<Mp>>(
|
||||||
|
MODULES_API_URL + '/cms/mp/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
import type {MpMenu} from "@/api/cms/mp-menu/model";
|
||||||
|
import type {Ad} from "@/api/cms/ad/model";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序信息封装
|
||||||
|
*/
|
||||||
|
export interface MpInfo {
|
||||||
|
mp?: Mp;
|
||||||
|
config?: any;
|
||||||
|
tabBar?: MpMenu[];
|
||||||
|
slide?: Ad;
|
||||||
|
mpMenus?: MpMenu[];
|
||||||
|
serverTime?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序信息
|
||||||
|
*/
|
||||||
|
export interface Mp {
|
||||||
|
// ID
|
||||||
|
mpId?: number;
|
||||||
|
// 小程序ID
|
||||||
|
appId?: string;
|
||||||
|
// 小程序密钥
|
||||||
|
appSecret?: string;
|
||||||
|
// 小程序名称
|
||||||
|
mpName?: string;
|
||||||
|
// 小程序简称
|
||||||
|
shortName?: string;
|
||||||
|
// 头像
|
||||||
|
avatar?: string;
|
||||||
|
// 小程序码
|
||||||
|
mpQrcode?: string;
|
||||||
|
// 微信认证
|
||||||
|
authentication?: number;
|
||||||
|
// 主体信息
|
||||||
|
companyName?: string;
|
||||||
|
// 小程序备案
|
||||||
|
icpNo?: string;
|
||||||
|
// 登录邮箱
|
||||||
|
email?: string;
|
||||||
|
// 登录密码
|
||||||
|
password?: string;
|
||||||
|
// 原始ID
|
||||||
|
ghId?: string;
|
||||||
|
// 入口页面
|
||||||
|
mainPath?: string;
|
||||||
|
// 过期时间
|
||||||
|
expirationTime?: string;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 介绍
|
||||||
|
comments?: string;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 注册时间
|
||||||
|
createTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序信息搜索条件
|
||||||
|
*/
|
||||||
|
export interface MpParam extends PageParam {
|
||||||
|
mpId?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序广告位
|
||||||
|
*/
|
||||||
|
export interface MpAd {
|
||||||
|
// ID
|
||||||
|
adId?: number;
|
||||||
|
// 页面ID
|
||||||
|
pageId?: number;
|
||||||
|
// 广告类型
|
||||||
|
adType?: string;
|
||||||
|
// 广告位名称
|
||||||
|
name?: string;
|
||||||
|
// 宽
|
||||||
|
width?: string;
|
||||||
|
// 高
|
||||||
|
height?: string;
|
||||||
|
// 广告图片
|
||||||
|
images?: string;
|
||||||
|
// 路由/链接地址
|
||||||
|
path?: string;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 注册时间
|
||||||
|
createTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序广告位搜索条件
|
||||||
|
*/
|
||||||
|
export interface MpAdParam extends PageParam {
|
||||||
|
adId?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
+52
-53
@@ -1,27 +1,14 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
import type { RechargeOrder, RechargeOrderParam } from './model/index';
|
import type { MpField, MpFieldParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值
|
* 分页查询小程序配置
|
||||||
*/
|
*/
|
||||||
export async function recharge(data: RechargeOrder) {
|
export async function pageMpField(params: MpFieldParam) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.get<ApiResult<PageResult<MpField>>>(
|
||||||
'/shop/recharge-order/recharge',
|
MODULES_API_URL + '/cms/mp-field/page',
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询充值记录
|
|
||||||
*/
|
|
||||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
|
||||||
'/shop/recharge-order/page',
|
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -33,11 +20,11 @@ export async function pageRechargeOrder(params: RechargeOrderParam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充值记录列表
|
* 查询小程序配置列表
|
||||||
*/
|
*/
|
||||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
export async function listMpField(params?: MpFieldParam) {
|
||||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
const res = await request.get<ApiResult<MpField[]>>(
|
||||||
'/shop/recharge-order',
|
MODULES_API_URL + '/cms/mp-field',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -49,24 +36,11 @@ export async function listRechargeOrder(params?: RechargeOrderParam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询充值记录
|
* 添加小程序配置
|
||||||
*/
|
*/
|
||||||
export async function getRechargeOrder(id: number) {
|
export async function addMpField(data: MpField) {
|
||||||
const res = await request.get<ApiResult<RechargeOrder>>(
|
|
||||||
'/shop/recharge-order/' + id
|
|
||||||
);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加充值记录
|
|
||||||
*/
|
|
||||||
export async function addRechargeOrder(data: RechargeOrder) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
'/shop/recharge-order',
|
MODULES_API_URL + '/cms/mp-field',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -76,11 +50,11 @@ export async function addRechargeOrder(data: RechargeOrder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改充值记录
|
* 修改小程序配置
|
||||||
*/
|
*/
|
||||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
export async function updateMpField(data: MpField) {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
'/shop/recharge-order',
|
MODULES_API_URL + '/cms/mp-field',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -90,11 +64,11 @@ export async function updateRechargeOrder(data: RechargeOrder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除充值记录
|
* 删除小程序配置
|
||||||
*/
|
*/
|
||||||
export async function removeRechargeOrder(id?: number) {
|
export async function removeMpField(id?: number) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
'/shop/recharge-order/' + id
|
MODULES_API_URL + '/cms/mp-field/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
@@ -103,11 +77,11 @@ export async function removeRechargeOrder(id?: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除充值记录
|
* 批量删除小程序配置
|
||||||
*/
|
*/
|
||||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
export async function removeBatchMpField(data: (number | undefined)[]) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
'/shop/recharge-order/batch',
|
MODULES_API_URL + '/cms/mp-field/batch',
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
@@ -119,12 +93,37 @@ export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量充值操作
|
* 根据id查询小程序配置
|
||||||
*/
|
*/
|
||||||
export async function batchRecharge(data: RechargeOrder[]) {
|
export async function getMpField(id: number) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.get<ApiResult<MpField>>(
|
||||||
'/shop/recharge-order/batchRecharge',
|
MODULES_API_URL + '/cms/mp-field/' + id
|
||||||
data
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除缓存
|
||||||
|
*/
|
||||||
|
export async function removeMpInfoCache(key?: string) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/mp-field/clearMpInfo/' + key
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复项目参数
|
||||||
|
*/
|
||||||
|
export async function undeleteMpField(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/mp-field/undelete/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序配置
|
||||||
|
*/
|
||||||
|
export interface MpField {
|
||||||
|
// 自增ID
|
||||||
|
id?: number;
|
||||||
|
// 类型,0文本 1图片 2其他
|
||||||
|
type?: number;
|
||||||
|
// 名称
|
||||||
|
name?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 名称
|
||||||
|
value?: string;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 注册时间
|
||||||
|
createTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序配置搜索条件
|
||||||
|
*/
|
||||||
|
export interface MpFieldParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
import type { Link, LinkParam } from './model';
|
import type { MpPages, MpPagesParam } from './model';
|
||||||
import { MODULES_API_URL } from '@/config/setting';
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询链接
|
* 分页查询小程序页面
|
||||||
*/
|
*/
|
||||||
export async function pageLink(params: LinkParam) {
|
export async function pageMpPages(params: MpPagesParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<Link>>>(
|
const res = await request.get<ApiResult<PageResult<MpPages>>>(
|
||||||
MODULES_API_URL + '/oa/link/page',
|
MODULES_API_URL + '/cms/mp-pages/page',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -20,11 +20,11 @@ export async function pageLink(params: LinkParam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询链接列表
|
* 查询小程序页面列表
|
||||||
*/
|
*/
|
||||||
export async function listLink(params?: LinkParam) {
|
export async function listMpPages(params?: MpPagesParam) {
|
||||||
const res = await request.get<ApiResult<Link[]>>(
|
const res = await request.get<ApiResult<MpPages[]>>(
|
||||||
MODULES_API_URL + '/oa/link',
|
MODULES_API_URL + '/cms/mp-pages',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -36,11 +36,11 @@ export async function listLink(params?: LinkParam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加链接
|
* 添加小程序页面
|
||||||
*/
|
*/
|
||||||
export async function addLink(data: Link) {
|
export async function addMpPages(data: MpPages) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
MODULES_API_URL + '/oa/link',
|
MODULES_API_URL + '/cms/mp-pages',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -50,11 +50,11 @@ export async function addLink(data: Link) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改链接
|
* 修改小程序页面
|
||||||
*/
|
*/
|
||||||
export async function updateLink(data: Link) {
|
export async function updateMpPages(data: MpPages) {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
MODULES_API_URL + '/oa/link',
|
MODULES_API_URL + '/cms/mp-pages',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -64,11 +64,11 @@ export async function updateLink(data: Link) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除链接
|
* 删除小程序页面
|
||||||
*/
|
*/
|
||||||
export async function removeLink(id?: number) {
|
export async function removeMpPages(id?: number) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
MODULES_API_URL + '/oa/link/' + id
|
MODULES_API_URL + '/cms/mp-pages/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
@@ -77,11 +77,11 @@ export async function removeLink(id?: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除链接
|
* 批量删除小程序页面
|
||||||
*/
|
*/
|
||||||
export async function removeBatchLink(data: (number | undefined)[]) {
|
export async function removeBatchMpPages(data: (number | undefined)[]) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
MODULES_API_URL + '/oa/link/batch',
|
MODULES_API_URL + '/cms/mp-pages/batch',
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
@@ -93,21 +93,14 @@ export async function removeBatchLink(data: (number | undefined)[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查IP是否存在
|
* 根据id查询小程序页面
|
||||||
*/
|
*/
|
||||||
export async function checkExistence(
|
export async function getMpPages(id: number) {
|
||||||
field: string,
|
const res = await request.get<ApiResult<MpPages>>(
|
||||||
value: string,
|
MODULES_API_URL + '/cms/mp-pages/' + id
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
|
||||||
MODULES_API_URL + '/oa/link/existence',
|
|
||||||
{
|
|
||||||
params: { field, value, id }
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.message;
|
return res.data.data;
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序页面
|
||||||
|
*/
|
||||||
|
export interface MpPages {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 上级id, 0是顶级
|
||||||
|
parentId?: number;
|
||||||
|
// 页面名称
|
||||||
|
title?: string;
|
||||||
|
// 页面路径
|
||||||
|
path?: string;
|
||||||
|
// 设为首页
|
||||||
|
home?: number;
|
||||||
|
// 分包
|
||||||
|
subpackage?: string;
|
||||||
|
// 图标
|
||||||
|
icon?: string;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 注册时间
|
||||||
|
createTime?: string;
|
||||||
|
// 子页面
|
||||||
|
children?: MpPages[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序页面搜索条件
|
||||||
|
*/
|
||||||
|
export interface MpPagesParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
title?: string;
|
||||||
|
path?: string;
|
||||||
|
subpackage?: string;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -127,3 +127,16 @@ export async function checkExistence(
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复项目参数
|
||||||
|
*/
|
||||||
|
export async function undeleteWebsiteField(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/website-field/undelete/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ export interface WebsiteField {
|
|||||||
value?: string;
|
value?: string;
|
||||||
comments?: string;
|
comments?: string;
|
||||||
userId?: number;
|
userId?: number;
|
||||||
websiteId?: number;
|
type?: number;
|
||||||
status?: any;
|
status?: any;
|
||||||
sortNumber?: any;
|
sortNumber?: any;
|
||||||
createTime?: string;
|
createTime?: string;
|
||||||
|
deleted?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 约定的网站参数名称
|
||||||
export interface WebsiteParam {
|
export interface WebsiteParam {
|
||||||
// 网站名称
|
// 网站名称
|
||||||
site_logo?: string;
|
site_logo?: string;
|
||||||
@@ -26,6 +28,8 @@ export interface WebsiteParam {
|
|||||||
|
|
||||||
// 约定的小程序参数名称
|
// 约定的小程序参数名称
|
||||||
export interface MpWeixinParam {
|
export interface MpWeixinParam {
|
||||||
|
// 小程序LOGO
|
||||||
|
site_logo?: string;
|
||||||
// 我的页面顶部背景图片
|
// 我的页面顶部背景图片
|
||||||
mp_user_top?: string;
|
mp_user_top?: string;
|
||||||
}
|
}
|
||||||
@@ -36,5 +40,6 @@ export interface MpWeixinParam {
|
|||||||
export interface WebsiteFieldParam extends PageParam {
|
export interface WebsiteFieldParam extends PageParam {
|
||||||
id?: number;
|
id?: number;
|
||||||
userId?: number;
|
userId?: number;
|
||||||
|
name?: string;
|
||||||
websiteId?: number;
|
websiteId?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,40 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
import type { Website, WebsiteParam } from './model';
|
import type { Website, WebsiteParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询网站列表
|
* 获取网站信息
|
||||||
|
*/
|
||||||
|
export async function getSiteInfo() {
|
||||||
|
const res = await request.get<ApiResult<Website>>(
|
||||||
|
MODULES_API_URL + '/cms/website/getSiteInfo'
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除缓存
|
||||||
|
*/
|
||||||
|
export async function removeSiteInfoCache(key?: string) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/website/clearSiteInfo/' + key
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询网站
|
||||||
*/
|
*/
|
||||||
export async function pageWebsite(params: WebsiteParam) {
|
export async function pageWebsite(params: WebsiteParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<Website>>>(
|
const res = await request.get<ApiResult<PageResult<Website>>>(
|
||||||
'/cms/website/page',
|
MODULES_API_URL + '/cms/website/page',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -23,7 +50,7 @@ export async function pageWebsite(params: WebsiteParam) {
|
|||||||
*/
|
*/
|
||||||
export async function listWebsite(params?: WebsiteParam) {
|
export async function listWebsite(params?: WebsiteParam) {
|
||||||
const res = await request.get<ApiResult<Website[]>>(
|
const res = await request.get<ApiResult<Website[]>>(
|
||||||
'/cms/website',
|
MODULES_API_URL + '/cms/website',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -39,7 +66,7 @@ export async function listWebsite(params?: WebsiteParam) {
|
|||||||
*/
|
*/
|
||||||
export async function addWebsite(data: Website) {
|
export async function addWebsite(data: Website) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
'/cms/website',
|
MODULES_API_URL + '/cms/website',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -53,7 +80,7 @@ export async function addWebsite(data: Website) {
|
|||||||
*/
|
*/
|
||||||
export async function updateWebsite(data: Website) {
|
export async function updateWebsite(data: Website) {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
'/cms/website',
|
MODULES_API_URL + '/cms/website',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -67,7 +94,7 @@ export async function updateWebsite(data: Website) {
|
|||||||
*/
|
*/
|
||||||
export async function removeWebsite(id?: number) {
|
export async function removeWebsite(id?: number) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
'/cms/website/' + id
|
MODULES_API_URL + '/cms/website/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
@@ -80,7 +107,7 @@ export async function removeWebsite(id?: number) {
|
|||||||
*/
|
*/
|
||||||
export async function removeBatchWebsite(data: (number | undefined)[]) {
|
export async function removeBatchWebsite(data: (number | undefined)[]) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
'/cms/website/batch',
|
MODULES_API_URL + '/cms/website/batch',
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
@@ -91,6 +118,36 @@ export async function removeBatchWebsite(data: (number | undefined)[]) {
|
|||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户状态
|
||||||
|
*/
|
||||||
|
export async function updateWebsiteStatus(websiteId?: number, status?: number) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/cms/website/status',
|
||||||
|
{
|
||||||
|
websiteId,
|
||||||
|
status
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询网站
|
||||||
|
*/
|
||||||
|
export async function getWebsite(id: number) {
|
||||||
|
const res = await request.get<ApiResult<Website>>(
|
||||||
|
MODULES_API_URL + '/cms/website/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查IP是否存在
|
* 检查IP是否存在
|
||||||
*/
|
*/
|
||||||
@@ -100,7 +157,7 @@ export async function checkExistence(
|
|||||||
id?: number
|
id?: number
|
||||||
) {
|
) {
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
const res = await request.get<ApiResult<unknown>>(
|
||||||
'/cms/website/existence',
|
MODULES_API_URL + '/cms/website/existence',
|
||||||
{
|
{
|
||||||
params: { field, value, id }
|
params: { field, value, id }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,58 +1,71 @@
|
|||||||
import type { PageParam } from '@/api';
|
import type {WebsiteField} from '@/api/cms/website/field/model';
|
||||||
import type { WebsiteField } from '@/api/cms/website/field/model';
|
import type {Navigation} from "@/api/cms/navigation/model";
|
||||||
import type { Navigation } from "@/api/cms/navigation/model";
|
import type {Link} from "@/api/oa/link/model";
|
||||||
import type { Link } from "@/api/oa/link/model";
|
import type {ArrangeCategory} from "@/api/cms/category/model";
|
||||||
import type { ArrangeCategory } from "@/api/cms/category/model";
|
import type {MpMenu} from "@/api/cms/mp-menu/model";
|
||||||
|
import type {Ad} from "@/api/cms/ad/model";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息
|
||||||
|
*/
|
||||||
|
export interface WebSiteInfo {
|
||||||
|
website?: Website;
|
||||||
|
config?: any;
|
||||||
|
tabBar?: MpMenu[];
|
||||||
|
slide?: Ad;
|
||||||
|
mpMenus?: MpMenu[];
|
||||||
|
serverTime?: any;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网站
|
* 网站
|
||||||
*/
|
*/
|
||||||
export interface Website {
|
export interface Website {
|
||||||
websiteId ?: number;
|
websiteId?: number;
|
||||||
websiteName ?: string;
|
websiteName?: string;
|
||||||
websiteCode ?: string;
|
websiteCode?: string;
|
||||||
websiteIcon ?: string;
|
websiteIcon?: string;
|
||||||
websiteLogo ?: string;
|
websiteLogo?: string;
|
||||||
websiteDarkLogo ?: string;
|
websiteDarkLogo?: string;
|
||||||
keywords ?: string;
|
keywords?: string;
|
||||||
address ?: string;
|
address?: string;
|
||||||
phone ?: string;
|
phone?: string;
|
||||||
email ?: string;
|
email?: string;
|
||||||
websiteType ?: string;
|
websiteType?: string;
|
||||||
expirationTime ?: string;
|
expirationTime?: string;
|
||||||
templateId ?: string;
|
templateId?: string;
|
||||||
industryParent ?: string;
|
industryParent?: string;
|
||||||
industryChild ?: string;
|
industryChild?: string;
|
||||||
companyId ?: number;
|
companyId?: number;
|
||||||
domain ?: string;
|
domain?: string;
|
||||||
icpNo ?: string;
|
icpNo?: string;
|
||||||
policeNo ?: string;
|
policeNo?: string;
|
||||||
comments ?: string;
|
comments?: string;
|
||||||
sortNumber ?: number;
|
sortNumber?: number;
|
||||||
createTime ?: string;
|
createTime?: string;
|
||||||
disabled ?: boolean;
|
disabled?: boolean;
|
||||||
country ?: string;
|
country?: string;
|
||||||
province ?: string;
|
province?: string;
|
||||||
city ?: string;
|
city?: string;
|
||||||
region ?: string;
|
region?: string;
|
||||||
appId ?: number;
|
appId?: number;
|
||||||
fields ?: WebsiteField[];
|
fields?: WebsiteField[];
|
||||||
status ?: number;
|
status?: boolean;
|
||||||
tenantId ?: number;
|
tenantId?: number;
|
||||||
tenantName ?: string;
|
tenantName?: string;
|
||||||
navigations ?: Navigation[];
|
navigations?: Navigation[];
|
||||||
categoryList ?: ArrangeCategory[];
|
categoryList?: ArrangeCategory[];
|
||||||
links ?: Link[];
|
links?: Link[];
|
||||||
// 配置信息
|
// 配置信息
|
||||||
config ?: any;
|
config?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网站搜索条件
|
* 菜单搜索参数
|
||||||
*/
|
*/
|
||||||
export interface WebsiteParam extends PageParam {
|
export interface WebsiteParam {
|
||||||
title ?: string;
|
title?: string;
|
||||||
path ?: string;
|
path?: string;
|
||||||
authority ?: string;
|
authority?: string;
|
||||||
parentId ?: number;
|
parentId?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
+72
-151
@@ -1,86 +1,99 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult } from '@/api';
|
import type {ApiResult} from '@/api';
|
||||||
import type { User } from '@/api/system/user/model';
|
import type {User} from '@/api/system/user/model';
|
||||||
import type { UpdatePasswordParam, NoticeResult } from './model';
|
import type {UpdatePasswordParam, NoticeResult} from './model';
|
||||||
import { MODULES_API_URL, SERVER_API_URL } from '@/config/setting';
|
import {MODULES_API_URL, SERVER_API_URL} from '@/config/setting';
|
||||||
import type { Company } from '@/api/system/company/model';
|
import type {Company} from '@/api/system/company/model';
|
||||||
import type { Website } from '@/api/cms/website/model';
|
import type {WebSiteInfo} from '@/api/cms/website/model';
|
||||||
|
import type {MpInfo} from "@/api/cms/mp/model";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录的用户信息、菜单、权限、角色
|
* 获取当前登录的用户信息、菜单、权限、角色
|
||||||
*/
|
*/
|
||||||
export async function getTenantInfo() : Promise<Company> {
|
export async function getTenantInfo(): Promise<Company> {
|
||||||
const res = await request.get<ApiResult<Company>>(
|
const res = await request.get<ApiResult<Company>>(
|
||||||
SERVER_API_URL + '/auth/tenant'
|
SERVER_API_URL + '/auth/tenant'
|
||||||
);
|
);
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取网站信息
|
* 获取网站信息
|
||||||
*/
|
*/
|
||||||
export async function getSiteInfo() {
|
export async function getSiteInfo() {
|
||||||
const res = await request.get<ApiResult<Website>>(
|
const res = await request.get<ApiResult<WebSiteInfo>>(
|
||||||
MODULES_API_URL + '/cms/website/getSiteInfo'
|
MODULES_API_URL + '/cms/website/getSiteInfo'
|
||||||
);
|
);
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取网站信息
|
||||||
|
*/
|
||||||
|
export async function getMpInfo() {
|
||||||
|
const res = await request.get<ApiResult<MpInfo>>(
|
||||||
|
MODULES_API_URL + '/cms/mp/getMpInfo'
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录的用户信息、菜单、权限、角色
|
* 获取当前登录的用户信息、菜单、权限、角色
|
||||||
*/
|
*/
|
||||||
export async function getUserInfo() : Promise<User> {
|
export async function getUserInfo(): Promise<User> {
|
||||||
const res = await request.get<ApiResult<User>>(SERVER_API_URL + '/auth/user');
|
const res = await request.get<ApiResult<User>>(SERVER_API_URL + '/auth/user');
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向子模块传递token
|
* 向子模块传递token
|
||||||
* @param url
|
* @param url
|
||||||
*/
|
*/
|
||||||
export async function transferToken(url : string) : Promise<string> {
|
export async function transferToken(url: string): Promise<string> {
|
||||||
const res = await request.get<ApiResult<unknown>>(url);
|
const res = await request.get<ApiResult<unknown>>(url);
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改当前登录的用户密码
|
* 修改当前登录的用户密码
|
||||||
*/
|
*/
|
||||||
export async function updatePassword(
|
export async function updatePassword(
|
||||||
data : UpdatePasswordParam
|
data: UpdatePasswordParam
|
||||||
) : Promise<string> {
|
): Promise<string> {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/auth/password',
|
SERVER_API_URL + '/auth/password',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message ?? '修改成功';
|
return res.data.message ?? '修改成功';
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取未来7天的日期
|
* 获取未来7天的日期
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
export async function getNext7day() {
|
export async function getNext7day() {
|
||||||
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getNext7day');
|
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getNext7day');
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,11 +101,11 @@ export async function getNext7day() {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
export async function getServerTime() {
|
export async function getServerTime() {
|
||||||
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getServerTime');
|
const res = await request.get<ApiResult<unknown>>(MODULES_API_URL + '/cms/website/getServerTime');
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,104 +113,12 @@ export async function getServerTime() {
|
|||||||
* https://modules.gxwebsoft.com/json/regions-data.json
|
* https://modules.gxwebsoft.com/json/regions-data.json
|
||||||
*/
|
*/
|
||||||
export async function getRegions() {
|
export async function getRegions() {
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
const res = await request.get<ApiResult<unknown>>(
|
||||||
'https://modules.gxwebsoft.com/json/regions-data.json'
|
'https://modules.gxwebsoft.com/json/regions-data.json'
|
||||||
);
|
);
|
||||||
console.log('res: ',res);
|
console.log('res: ', res);
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询未读通知
|
|
||||||
*/
|
|
||||||
export async function getUnreadNotice() : Promise<NoticeResult> {
|
|
||||||
return {
|
|
||||||
notice: [
|
|
||||||
{
|
|
||||||
color: '#60B2FC',
|
|
||||||
icon: 'NotificationFilled',
|
|
||||||
title: '你收到了一封14份新周报',
|
|
||||||
time: '2020-07-27 18:30:18'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
color: '#F5686F',
|
|
||||||
icon: 'PushpinFilled',
|
|
||||||
title: '许经理同意了你的请假申请',
|
|
||||||
time: '2020-07-27 09:08:36'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
color: '#7CD734',
|
|
||||||
icon: 'VideoCameraFilled',
|
|
||||||
title: '陈总邀请你参加视频会议',
|
|
||||||
time: '2020-07-26 18:30:01'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
color: '#FAAD14',
|
|
||||||
icon: 'CarryOutFilled',
|
|
||||||
title: '你推荐的刘诗雨已通过第三轮面试',
|
|
||||||
time: '2020-07-25 16:38:46'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
color: '#2BCACD',
|
|
||||||
icon: 'BellFilled',
|
|
||||||
title: '你的6月加班奖金已发放',
|
|
||||||
time: '2020-07-25 11:03:31'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
letter: [
|
|
||||||
{
|
|
||||||
avatar:
|
|
||||||
'https://cdn.eleadmin.com/20200609/c184eef391ae48dba87e3057e70238fb.jpg',
|
|
||||||
title: 'SunSmile 评论了你的日志',
|
|
||||||
content: '写的不错, 以后多多向你学习~',
|
|
||||||
time: '2020-07-27 18:30:18'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
avatar:
|
|
||||||
'https://cdn.eleadmin.com/20200609/948344a2a77c47a7a7b332fe12ff749a.jpg',
|
|
||||||
title: '刘诗雨 点赞了你的日志',
|
|
||||||
content: '写的不错, 以后多多向你学习~',
|
|
||||||
time: '2020-07-27 09:08:36'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
avatar:
|
|
||||||
'https://cdn.eleadmin.com/20200609/2d98970a51b34b6b859339c96b240dcd.jpg',
|
|
||||||
title: '酷酷的大叔 评论了你的周报',
|
|
||||||
content: '写的不错, 以后多多向你学习~',
|
|
||||||
time: '2020-07-26 18:30:01'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
avatar:
|
|
||||||
'https://cdn.eleadmin.com/20200609/f6bc05af944a4f738b54128717952107.jpg',
|
|
||||||
title: 'Jasmine 点赞了你的周报',
|
|
||||||
content: '写的不错, 以后多多向你学习~',
|
|
||||||
time: '2020-07-25 11:03:31'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
todo: [
|
|
||||||
{
|
|
||||||
status: 0,
|
|
||||||
title: '刘诗雨的请假审批',
|
|
||||||
description: '刘诗雨在 07-27 18:30 提交的请假申请'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
status: 1,
|
|
||||||
title: '第三方代码紧急变更',
|
|
||||||
description: '需要在 2020-07-27 之前完成'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
status: 2,
|
|
||||||
title: '信息安全考试',
|
|
||||||
description: '需要在 2020-07-26 18:30 前完成'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
status: 2,
|
|
||||||
title: 'EleAdmin发布新版本',
|
|
||||||
description: '需要在 2020-07-25 11:03 前完成'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,153 @@
|
|||||||
|
/** 菜单用到的图标 */
|
||||||
|
export {
|
||||||
|
HomeOutlined,
|
||||||
|
SettingOutlined,
|
||||||
|
TeamOutlined,
|
||||||
|
DesktopOutlined,
|
||||||
|
FileTextOutlined,
|
||||||
|
TableOutlined,
|
||||||
|
AppstoreOutlined,
|
||||||
|
CheckCircleOutlined,
|
||||||
|
ExclamationCircleOutlined,
|
||||||
|
UserOutlined,
|
||||||
|
TagOutlined,
|
||||||
|
IdcardOutlined,
|
||||||
|
BarChartOutlined,
|
||||||
|
AuditOutlined,
|
||||||
|
PicLeftOutlined,
|
||||||
|
BellOutlined,
|
||||||
|
CloseCircleOutlined,
|
||||||
|
QuestionCircleOutlined,
|
||||||
|
SoundOutlined,
|
||||||
|
ApartmentOutlined,
|
||||||
|
DashboardOutlined,
|
||||||
|
OneToOneOutlined,
|
||||||
|
DragOutlined,
|
||||||
|
InteractionOutlined,
|
||||||
|
BankOutlined,
|
||||||
|
BlockOutlined,
|
||||||
|
CheckSquareOutlined,
|
||||||
|
ProfileOutlined,
|
||||||
|
WarningOutlined,
|
||||||
|
FolderOutlined,
|
||||||
|
YoutubeOutlined,
|
||||||
|
ControlOutlined,
|
||||||
|
EllipsisOutlined,
|
||||||
|
CalendarOutlined,
|
||||||
|
AppstoreAddOutlined,
|
||||||
|
FileSearchOutlined,
|
||||||
|
EnvironmentOutlined,
|
||||||
|
CompassOutlined,
|
||||||
|
FontSizeOutlined,
|
||||||
|
SketchOutlined,
|
||||||
|
BgColorsOutlined,
|
||||||
|
PrinterOutlined,
|
||||||
|
QrcodeOutlined,
|
||||||
|
BarcodeOutlined,
|
||||||
|
PictureOutlined,
|
||||||
|
LinkOutlined,
|
||||||
|
AlertOutlined,
|
||||||
|
HistoryOutlined,
|
||||||
|
ChromeOutlined,
|
||||||
|
CodeOutlined,
|
||||||
|
AntDesignOutlined,
|
||||||
|
ReadOutlined,
|
||||||
|
CrownOutlined,
|
||||||
|
LaptopOutlined,
|
||||||
|
ShoppingCartOutlined,
|
||||||
|
SkinOutlined,
|
||||||
|
ShopOutlined,
|
||||||
|
ShoppingOutlined,
|
||||||
|
AliyunOutlined,
|
||||||
|
GiftOutlined,
|
||||||
|
InsuranceOutlined,
|
||||||
|
FileZipOutlined,
|
||||||
|
SearchOutlined,
|
||||||
|
RedEnvelopeOutlined,
|
||||||
|
MoneyCollectOutlined,
|
||||||
|
TagsOutlined,
|
||||||
|
PayCircleOutlined,
|
||||||
|
RocketOutlined,
|
||||||
|
BarsOutlined,
|
||||||
|
WalletOutlined,
|
||||||
|
UngroupOutlined,
|
||||||
|
ToolOutlined,
|
||||||
|
HourglassOutlined,
|
||||||
|
FormatPainterOutlined,
|
||||||
|
CarOutlined,
|
||||||
|
DownloadOutlined,
|
||||||
|
UploadOutlined,
|
||||||
|
MailOutlined,
|
||||||
|
CloudOutlined,
|
||||||
|
ClearOutlined,
|
||||||
|
CoffeeOutlined,
|
||||||
|
CopyrightOutlined,
|
||||||
|
CompressOutlined,
|
||||||
|
CalculatorOutlined,
|
||||||
|
AimOutlined,
|
||||||
|
AudioOutlined,
|
||||||
|
BugOutlined,
|
||||||
|
CloudSyncOutlined,
|
||||||
|
CommentOutlined,
|
||||||
|
DisconnectOutlined,
|
||||||
|
DingtalkOutlined,
|
||||||
|
ExpandOutlined,
|
||||||
|
DollarOutlined,
|
||||||
|
FolderOpenOutlined,
|
||||||
|
ExperimentOutlined,
|
||||||
|
ForkOutlined,
|
||||||
|
FolderAddOutlined,
|
||||||
|
FunnelPlotOutlined,
|
||||||
|
GlobalOutlined,
|
||||||
|
LikeOutlined,
|
||||||
|
LayoutOutlined,
|
||||||
|
MergeCellsOutlined,
|
||||||
|
MehOutlined,
|
||||||
|
MobileOutlined,
|
||||||
|
NodeExpandOutlined,
|
||||||
|
PaperClipOutlined,
|
||||||
|
ScanOutlined,
|
||||||
|
ShakeOutlined,
|
||||||
|
ThunderboltOutlined,
|
||||||
|
TrademarkOutlined,
|
||||||
|
UnlockOutlined,
|
||||||
|
UsbOutlined,
|
||||||
|
WhatsAppOutlined,
|
||||||
|
WomanOutlined,
|
||||||
|
WifiOutlined,
|
||||||
|
VerifiedOutlined,
|
||||||
|
UserSwitchOutlined,
|
||||||
|
UsergroupAddOutlined,
|
||||||
|
UsergroupDeleteOutlined,
|
||||||
|
UserAddOutlined,
|
||||||
|
UserDeleteOutlined,
|
||||||
|
TranslationOutlined,
|
||||||
|
TransactionOutlined,
|
||||||
|
TrophyOutlined,
|
||||||
|
StarOutlined,
|
||||||
|
SplitCellsOutlined,
|
||||||
|
ShareAltOutlined,
|
||||||
|
RestOutlined,
|
||||||
|
PartitionOutlined,
|
||||||
|
MedicineBoxOutlined,
|
||||||
|
HeartOutlined,
|
||||||
|
GatewayOutlined,
|
||||||
|
FlagOutlined,
|
||||||
|
FireOutlined,
|
||||||
|
FieldNumberOutlined,
|
||||||
|
FieldStringOutlined,
|
||||||
|
AppleOutlined,
|
||||||
|
AndroidOutlined,
|
||||||
|
GithubOutlined,
|
||||||
|
Html5Outlined,
|
||||||
|
QqOutlined,
|
||||||
|
AlipayOutlined,
|
||||||
|
RedditOutlined,
|
||||||
|
InstagramOutlined,
|
||||||
|
WechatOutlined,
|
||||||
|
BorderOutlined,
|
||||||
|
PieChartOutlined,
|
||||||
|
AreaChartOutlined,
|
||||||
|
KeyOutlined,
|
||||||
|
LockOutlined
|
||||||
|
} from '@ant-design/icons-vue';
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { App, AppParam } from './model/index';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询应用
|
|
||||||
*/
|
|
||||||
export async function pageApp(params: AppParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<App>>>('/oa/app/page', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询应用列表
|
|
||||||
*/
|
|
||||||
export async function listApp(params?: AppParam) {
|
|
||||||
const res = await request.get<ApiResult<App[]>>('/oa/app', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询应用
|
|
||||||
*/
|
|
||||||
export async function getApp(id: number) {
|
|
||||||
const res = await request.get<ApiResult<App>>('/oa/app/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加应用
|
|
||||||
*/
|
|
||||||
export async function addApp(data: App) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/app', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改应用
|
|
||||||
*/
|
|
||||||
export async function updateApp(data: App) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/app', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除应用
|
|
||||||
*/
|
|
||||||
export async function removeApp(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除应用
|
|
||||||
*/
|
|
||||||
export async function removeBatchApp(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/oa/app/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getAppSecret(data: App) {
|
|
||||||
const res = await request.post<ApiResult<App>>(
|
|
||||||
'/open/app/getAppSecret',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function updateAppSecret(data: App) {
|
|
||||||
const res = await request.post<ApiResult<App>>(
|
|
||||||
'/oa/app/updateAppSecret',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加菜单
|
|
||||||
export async function saveMenu(data: App) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/app/saveMenu', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加菜单按钮
|
|
||||||
export async function saveAuthority(data: any[]) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
|
||||||
'/oa/app/saveAuthority',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
import { AppUser } from '@/api/oa/app/user/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用
|
|
||||||
*/
|
|
||||||
export interface App {
|
|
||||||
// 应用id
|
|
||||||
appId?: number;
|
|
||||||
// 应用秘钥
|
|
||||||
appSecret?: string;
|
|
||||||
// 英文名称
|
|
||||||
enName?: string;
|
|
||||||
// 应用名称
|
|
||||||
appName?: string;
|
|
||||||
// 上级id, 0是顶级
|
|
||||||
parentId?: number;
|
|
||||||
// 应用编号
|
|
||||||
appCode?: string;
|
|
||||||
// 应用图标
|
|
||||||
appIcon?: string;
|
|
||||||
appQrcode?: string;
|
|
||||||
// 应用截图
|
|
||||||
images?: string;
|
|
||||||
// 应用类型
|
|
||||||
appType?: string;
|
|
||||||
appTypeMultiple?: string[];
|
|
||||||
// 菜单类型
|
|
||||||
menuType?: number;
|
|
||||||
// 应用地址
|
|
||||||
appUrl?: string;
|
|
||||||
// 后台管理地址
|
|
||||||
adminUrl?: string;
|
|
||||||
// 原型图地址
|
|
||||||
prototypeUrl?: string;
|
|
||||||
// 下载地址
|
|
||||||
downUrl?: string;
|
|
||||||
// 服务器接口地址
|
|
||||||
serverUrl?: string;
|
|
||||||
// 模块接口地址
|
|
||||||
modulesUrl?: string;
|
|
||||||
// 回调地址
|
|
||||||
callbackUrl?: string;
|
|
||||||
// 腾讯文档地址
|
|
||||||
gitUrl?: string;
|
|
||||||
docsUrl?: string;
|
|
||||||
ipAddress?: string;
|
|
||||||
fileUrl?: string;
|
|
||||||
// 应用包名
|
|
||||||
packageName?: string;
|
|
||||||
// 点击次数
|
|
||||||
clicks?: string;
|
|
||||||
// 安装次数
|
|
||||||
installs?: string;
|
|
||||||
// 应用介绍
|
|
||||||
content?: string;
|
|
||||||
// 开发者(个人)
|
|
||||||
developer?: string;
|
|
||||||
director?: string;
|
|
||||||
projectDirector?: string;
|
|
||||||
salesman?: string;
|
|
||||||
// 续费金额
|
|
||||||
renewMoney?: string;
|
|
||||||
// 软件定价
|
|
||||||
price?: string;
|
|
||||||
// 评分
|
|
||||||
score?: string;
|
|
||||||
// 星级
|
|
||||||
star?: string;
|
|
||||||
// 菜单组件地址
|
|
||||||
component?: string;
|
|
||||||
// 菜单路由地址
|
|
||||||
path?: string;
|
|
||||||
// 权限标识
|
|
||||||
authority?: string;
|
|
||||||
// 打开位置
|
|
||||||
target?: string;
|
|
||||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
|
||||||
hide?: number;
|
|
||||||
// 菜单侧栏选中的path
|
|
||||||
active?: string;
|
|
||||||
// 其它路由元信息
|
|
||||||
meta?: string;
|
|
||||||
// 版本
|
|
||||||
edition?: string;
|
|
||||||
// 版本号
|
|
||||||
version?: string;
|
|
||||||
// 是否已安装
|
|
||||||
isUse?: number;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: any;
|
|
||||||
tenantName?: string;
|
|
||||||
companyId?: number;
|
|
||||||
companyName?: string;
|
|
||||||
// 租户编号
|
|
||||||
tenantCode?: string;
|
|
||||||
// 租户id
|
|
||||||
tenantId?: number;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 过期时间
|
|
||||||
expirationTime?: string;
|
|
||||||
// 应用状态
|
|
||||||
appStatus?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 发布者
|
|
||||||
userId?: any;
|
|
||||||
// 发布者昵称
|
|
||||||
nickname?: string;
|
|
||||||
// 子菜单
|
|
||||||
children?: App[];
|
|
||||||
// 权限树回显选中状态, 0未选中, 1选中
|
|
||||||
checked?: boolean;
|
|
||||||
//
|
|
||||||
key?: number;
|
|
||||||
//
|
|
||||||
value?: number;
|
|
||||||
//
|
|
||||||
parentIds?: number[];
|
|
||||||
//
|
|
||||||
openType?: number;
|
|
||||||
//
|
|
||||||
search?: any;
|
|
||||||
// 成员管理
|
|
||||||
users?: AppUser[];
|
|
||||||
// 项目需求
|
|
||||||
requirement?: string;
|
|
||||||
file1?: string;
|
|
||||||
file2?: string;
|
|
||||||
file3?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用搜索条件
|
|
||||||
*/
|
|
||||||
export interface AppParam extends PageParam {
|
|
||||||
userId?: number;
|
|
||||||
appName?: any;
|
|
||||||
appCode?: string;
|
|
||||||
appId?: number;
|
|
||||||
developer?: string;
|
|
||||||
tenantCode?: string;
|
|
||||||
parentId?: string;
|
|
||||||
tenantName?: string;
|
|
||||||
companyName?: string;
|
|
||||||
companyId?: number;
|
|
||||||
status?: number;
|
|
||||||
nickname?: string;
|
|
||||||
appStatus?: any;
|
|
||||||
showExpiration?: boolean;
|
|
||||||
keywords?: any;
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { AppRenew, AppRenewParam } from '@/api/oa/app/renew/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询开发成员
|
|
||||||
*/
|
|
||||||
export async function pageAppRenew(params: AppRenewParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<AppRenew>>>(
|
|
||||||
'/oa/app-renew/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询开发成员列表
|
|
||||||
*/
|
|
||||||
export async function listAppRenew(params?: AppRenewParam) {
|
|
||||||
const res = await request.get<ApiResult<AppRenew[]>>('/oa/app-renew', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询开发成员
|
|
||||||
*/
|
|
||||||
export async function getAppRenew(id: number) {
|
|
||||||
const res = await request.get<ApiResult<AppRenew>>('/oa/app-renew/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加开发成员
|
|
||||||
*/
|
|
||||||
export async function addAppRenew(data: AppRenew) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/app-renew', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改开发成员
|
|
||||||
*/
|
|
||||||
export async function updateAppRenew(data: AppRenew) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/app-renew', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeAppRenew(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/app-renew/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeBatchAppRenew(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/app-renew/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/oa/app-renew/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员
|
|
||||||
*/
|
|
||||||
export interface AppRenew {
|
|
||||||
appRenewId?: number;
|
|
||||||
money?: any;
|
|
||||||
comments?: string;
|
|
||||||
startTime?: any;
|
|
||||||
endTime?: any;
|
|
||||||
userId?: number;
|
|
||||||
nickname?: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
mobile?: string;
|
|
||||||
appId?: number;
|
|
||||||
companyId?: number;
|
|
||||||
status?: any;
|
|
||||||
images?: string;
|
|
||||||
files?: any;
|
|
||||||
createTime?: string;
|
|
||||||
editStatus?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员搜索条件
|
|
||||||
*/
|
|
||||||
export interface AppRenewParam extends PageParam {
|
|
||||||
userId?: number;
|
|
||||||
appId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserItem {
|
|
||||||
key: string;
|
|
||||||
isEdit?: boolean;
|
|
||||||
number?: string;
|
|
||||||
name?: string;
|
|
||||||
department?: string;
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { AppUser, AppUserParam } from '@/api/oa/app/user/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询开发成员
|
|
||||||
*/
|
|
||||||
export async function pageAppUser(params: AppUserParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<AppUser>>>(
|
|
||||||
'/oa/app-user/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询开发成员列表
|
|
||||||
*/
|
|
||||||
export async function listAppUser(params?: AppUserParam) {
|
|
||||||
const res = await request.get<ApiResult<AppUser[]>>('/oa/app-user', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询开发成员
|
|
||||||
*/
|
|
||||||
export async function getAppUser(id: number) {
|
|
||||||
const res = await request.get<ApiResult<AppUser>>('/oa/app-user/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加开发成员
|
|
||||||
*/
|
|
||||||
export async function addAppUser(data: AppUser) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/app-user', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改开发成员
|
|
||||||
*/
|
|
||||||
export async function updateAppUser(data: AppUser) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/app-user', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeAppUser(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/oa/app-user/' + id
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeBatchAppUser(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/oa/app-user/batch',
|
|
||||||
{
|
|
||||||
data
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
|
||||||
'/oa/app-user/existence',
|
|
||||||
{
|
|
||||||
params: { field, value, id }
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员
|
|
||||||
*/
|
|
||||||
export interface AppUser {
|
|
||||||
// 开发成员id
|
|
||||||
appUserId?: number;
|
|
||||||
role?: number;
|
|
||||||
userId?: number;
|
|
||||||
username?: string;
|
|
||||||
nickname?: string;
|
|
||||||
avatar?: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
mobile?: string;
|
|
||||||
appId?: number;
|
|
||||||
status?: string;
|
|
||||||
createTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员搜索条件
|
|
||||||
*/
|
|
||||||
export interface AppUserParam extends PageParam {
|
|
||||||
userId?: number;
|
|
||||||
appId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserItem {
|
|
||||||
key: string;
|
|
||||||
isEdit?: boolean;
|
|
||||||
number?: string;
|
|
||||||
name?: string;
|
|
||||||
department?: string;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult } from '@/api';
|
|
||||||
import type { Customer } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请免费体验
|
|
||||||
*/
|
|
||||||
export async function apply(data: Customer) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/customer-apply', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户
|
|
||||||
*/
|
|
||||||
export interface Customer {
|
|
||||||
// 客户id
|
|
||||||
customerId?: number;
|
|
||||||
// 客户类型
|
|
||||||
customerType?: string;
|
|
||||||
// 客户标识
|
|
||||||
customerCode: string;
|
|
||||||
// 客户名称
|
|
||||||
customerName?: string;
|
|
||||||
// 客户头像
|
|
||||||
customerAvatar?: string;
|
|
||||||
// 座机电话
|
|
||||||
customerPhone?: string;
|
|
||||||
// 手机号码
|
|
||||||
customerMobile?: string;
|
|
||||||
// 联系人
|
|
||||||
customerContacts?: string;
|
|
||||||
// 联系地址
|
|
||||||
customerAddress?: string;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 状态
|
|
||||||
status?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户搜索条件
|
|
||||||
*/
|
|
||||||
export interface CustomerParam extends PageParam {
|
|
||||||
customerName?: string;
|
|
||||||
customerCode?: string;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Assets, AssetsParam } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询资产
|
|
||||||
*/
|
|
||||||
export async function pageAssets(params: AssetsParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Assets>>>(
|
|
||||||
'/oa/assets/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询资产列表
|
|
||||||
*/
|
|
||||||
export async function listAssets(params?: AssetsParam) {
|
|
||||||
const res = await request.get<ApiResult<Assets[]>>('/oa/assets', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询服务器
|
|
||||||
*/
|
|
||||||
export async function getAssets(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Assets>>('/oa/assets/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加资产
|
|
||||||
*/
|
|
||||||
export async function addAssets(data: Assets) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/assets', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改资产
|
|
||||||
*/
|
|
||||||
export async function updateAssets(data: Assets) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/assets', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除资产
|
|
||||||
*/
|
|
||||||
export async function removeAssets(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/assets/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除资产
|
|
||||||
*/
|
|
||||||
export async function removeBatchAssets(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/assets/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/oa/assets/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
import type { User } from '@/api/system/user/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 资产
|
|
||||||
*/
|
|
||||||
export interface Assets {
|
|
||||||
// 资产id
|
|
||||||
assetsId?: number;
|
|
||||||
// 资产类型
|
|
||||||
type?: string;
|
|
||||||
// 资产标识
|
|
||||||
code: string;
|
|
||||||
// 资产名称
|
|
||||||
name?: string;
|
|
||||||
//
|
|
||||||
account?: string;
|
|
||||||
//
|
|
||||||
password?: string;
|
|
||||||
//
|
|
||||||
panel?: string;
|
|
||||||
//
|
|
||||||
panelAccount?: string;
|
|
||||||
//
|
|
||||||
panelPassword?: string;
|
|
||||||
//
|
|
||||||
configuration?: any;
|
|
||||||
root?: string;
|
|
||||||
//
|
|
||||||
sortNumber?: number;
|
|
||||||
financeAmount?: any;
|
|
||||||
financeYears?: any;
|
|
||||||
financeRenew?: any;
|
|
||||||
financeCustomerName?: string;
|
|
||||||
financeCustomerContact?: string;
|
|
||||||
financeCustomerPhone?: string;
|
|
||||||
//
|
|
||||||
brandAccount?: string;
|
|
||||||
brandPassword?: string;
|
|
||||||
btSign?: string;
|
|
||||||
openPort?: any;
|
|
||||||
comments?: string;
|
|
||||||
// 所属客户
|
|
||||||
customerId?: number;
|
|
||||||
customerName?: string;
|
|
||||||
// 品牌
|
|
||||||
brand?: string;
|
|
||||||
// 购买时间
|
|
||||||
startTime?: string;
|
|
||||||
// 到期时间
|
|
||||||
endTime?: string;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 状态
|
|
||||||
status?: string;
|
|
||||||
userId?: number;
|
|
||||||
companyId?: number;
|
|
||||||
companyName?: string;
|
|
||||||
nickname?: string;
|
|
||||||
// 可见性类型
|
|
||||||
visibility?: string;
|
|
||||||
// 可见用户ID
|
|
||||||
userList?: User[];
|
|
||||||
systemTotal?: Object;
|
|
||||||
diskInfo?: Object;
|
|
||||||
netWork?: Object;
|
|
||||||
sites?: Object;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 资产搜索条件
|
|
||||||
*/
|
|
||||||
export interface AssetsParam extends PageParam {
|
|
||||||
name?: string;
|
|
||||||
code?: string;
|
|
||||||
isExpire?: string;
|
|
||||||
status?: string;
|
|
||||||
brand?: string;
|
|
||||||
customerId?: string;
|
|
||||||
companyId?: number;
|
|
||||||
companyName?: string;
|
|
||||||
userId?: number;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type {
|
|
||||||
AssetsUser,
|
|
||||||
AssetsUserParam
|
|
||||||
} from '@/api/oa/assets/user/model/index';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询开发成员
|
|
||||||
*/
|
|
||||||
export async function pageAssetsUser(params: AssetsUserParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<AssetsUser>>>(
|
|
||||||
'/oa/assets-user/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询开发成员列表
|
|
||||||
*/
|
|
||||||
export async function listAssetsUser(params?: AssetsUserParam) {
|
|
||||||
const res = await request.get<ApiResult<AssetsUser[]>>('/oa/assets-user', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询开发成员
|
|
||||||
*/
|
|
||||||
export async function getAssetsUser(id: number) {
|
|
||||||
const res = await request.get<ApiResult<AssetsUser>>('/oa/assets-user/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加开发成员
|
|
||||||
*/
|
|
||||||
export async function addAssetsUser(data: AssetsUser) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/assets-user', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改开发成员
|
|
||||||
*/
|
|
||||||
export async function updateAssetsUser(data: AssetsUser) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/assets-user', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeAssetsUser(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/assets-user/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeBatchAssetsUser(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/assets-user/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
|
||||||
'/oa/assets-user/existence',
|
|
||||||
{
|
|
||||||
params: { field, value, id }
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员
|
|
||||||
*/
|
|
||||||
export interface AssetsUser {
|
|
||||||
// 开发成员id
|
|
||||||
id?: number;
|
|
||||||
role?: number;
|
|
||||||
userId?: number;
|
|
||||||
username?: string;
|
|
||||||
nickname?: string;
|
|
||||||
avatar?: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
assetsId?: number;
|
|
||||||
status?: string;
|
|
||||||
createTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员搜索条件
|
|
||||||
*/
|
|
||||||
export interface AssetsUserParam extends PageParam {
|
|
||||||
userId?: number;
|
|
||||||
assetsId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserItem {
|
|
||||||
key: string;
|
|
||||||
isEdit?: boolean;
|
|
||||||
number?: string;
|
|
||||||
name?: string;
|
|
||||||
department?: string;
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult } from '@/api';
|
|
||||||
import { ChatParam } from '@/api/oa/chatgpt/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送
|
|
||||||
*/
|
|
||||||
export async function send(data: ChatParam) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/open/chat/send', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求openAI
|
|
||||||
* /open/chat/chat
|
|
||||||
* 'https://chatgpt.websoft.top/api/open/chat/chat',
|
|
||||||
*/
|
|
||||||
export async function chat(data: ChatParam) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
|
||||||
'https://chatgpt.websoft.top/api/open/chat/chat',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* 消息
|
|
||||||
*/
|
|
||||||
export interface Chat {
|
|
||||||
noticeId?: number;
|
|
||||||
content?: any;
|
|
||||||
tenantId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务搜索条件
|
|
||||||
*/
|
|
||||||
export interface ChatParam {
|
|
||||||
tenantId?: number;
|
|
||||||
content?: string;
|
|
||||||
noticeId?: number;
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Customer, CustomerParam } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询客户
|
|
||||||
*/
|
|
||||||
export async function pageCustomer(params: CustomerParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Customer>>>(
|
|
||||||
'/oa/customer/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询客户列表
|
|
||||||
*/
|
|
||||||
export async function listCustomer(params?: CustomerParam) {
|
|
||||||
const res = await request.get<ApiResult<Customer[]>>('/oa/customer', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询客户
|
|
||||||
*/
|
|
||||||
export async function getCustomer(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Customer>>('/oa/customer/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加客户
|
|
||||||
*/
|
|
||||||
export async function addCustomer(data: Customer) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/customer', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改客户
|
|
||||||
*/
|
|
||||||
export async function updateCustomer(data: Customer) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/customer', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量修改客户
|
|
||||||
*/
|
|
||||||
export async function updateBatchCustomer(data: Customer[]) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/customer/batch', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除客户
|
|
||||||
*/
|
|
||||||
export async function removeCustomer(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/customer/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除客户
|
|
||||||
*/
|
|
||||||
export async function removeBatchCustomer(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/customer/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/oa/customer/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户
|
|
||||||
*/
|
|
||||||
export interface Customer {
|
|
||||||
// 客户id
|
|
||||||
customerId?: number;
|
|
||||||
// 客户类型
|
|
||||||
customerType?: string;
|
|
||||||
// 客户来源
|
|
||||||
customerSource?: string;
|
|
||||||
// 客户标识
|
|
||||||
customerCode: string;
|
|
||||||
// 客户名称
|
|
||||||
customerName?: string;
|
|
||||||
// 客户全称
|
|
||||||
customerFullName?: string;
|
|
||||||
// 客户头像
|
|
||||||
customerAvatar?: string;
|
|
||||||
// 座机电话
|
|
||||||
customerPhone?: string;
|
|
||||||
// 手机号码
|
|
||||||
customerMobile?: string;
|
|
||||||
// 联系人
|
|
||||||
customerContacts?: string;
|
|
||||||
// 联系地址
|
|
||||||
customerAddress?: string;
|
|
||||||
customerProvince?: string;
|
|
||||||
customerCity?: string;
|
|
||||||
customerRegion?: string;
|
|
||||||
longitude?: string;
|
|
||||||
latitude?: string;
|
|
||||||
// 跟进状态
|
|
||||||
progress?: string;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 状态
|
|
||||||
status?: string;
|
|
||||||
// 用户ID
|
|
||||||
userId?: any;
|
|
||||||
// 发布者昵称
|
|
||||||
nickname?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户搜索条件
|
|
||||||
*/
|
|
||||||
export interface CustomerParam extends PageParam {
|
|
||||||
customerName?: string;
|
|
||||||
customerCode?: string;
|
|
||||||
customerType?: string;
|
|
||||||
createTimeStart?: string;
|
|
||||||
createTimeEnd?: string;
|
|
||||||
customerCategory?: string;
|
|
||||||
progress?: string;
|
|
||||||
customerSource?: string;
|
|
||||||
betweenTime?: any;
|
|
||||||
userId?: number;
|
|
||||||
nickname?: string;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 链接
|
|
||||||
*/
|
|
||||||
export interface Link {
|
|
||||||
id?: number;
|
|
||||||
name?: string;
|
|
||||||
icon?: string;
|
|
||||||
url?: string;
|
|
||||||
linkType?: string;
|
|
||||||
appId?: number;
|
|
||||||
userId?: number;
|
|
||||||
comments?: string;
|
|
||||||
recommend?: number;
|
|
||||||
sortNumber?: number;
|
|
||||||
deleted?: number;
|
|
||||||
status?: number;
|
|
||||||
createTime?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 链接搜索条件
|
|
||||||
*/
|
|
||||||
export interface LinkParam extends PageParam {
|
|
||||||
id?: number;
|
|
||||||
linkType?: string;
|
|
||||||
name?: string;
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Notice, NoticeParam } from './model/index';
|
|
||||||
import { TabsParam } from '@/api/tabs';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询消息
|
|
||||||
*/
|
|
||||||
export async function pageNotice(params: NoticeParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Notice>>>(
|
|
||||||
'/oa/notice/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询消息列表
|
|
||||||
*/
|
|
||||||
export async function listNotice(params?: NoticeParam) {
|
|
||||||
const res = await request.get<ApiResult<Notice[]>>('/oa/notice', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询消息
|
|
||||||
*/
|
|
||||||
export async function getNotice(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Notice>>('/oa/notice/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加消息
|
|
||||||
*/
|
|
||||||
export async function addNotice(data: Notice) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/notice', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改消息
|
|
||||||
*/
|
|
||||||
export async function updateNotice(data: Notice) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/notice', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除消息
|
|
||||||
*/
|
|
||||||
export async function removeNotice(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/notice/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量修改消息
|
|
||||||
*/
|
|
||||||
export async function updateBatchNotices(data: Notice[]) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/notice/batch', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除消息
|
|
||||||
*/
|
|
||||||
export async function removeBatchNotice(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/notice/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getCount(params?: TabsParam) {
|
|
||||||
const res = await request.get<ApiResult<TabsParam>>('/oa/notice/count', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息
|
|
||||||
*/
|
|
||||||
export interface Notice {
|
|
||||||
// 消息id
|
|
||||||
noticeRecordId?: number;
|
|
||||||
noticeId?: number;
|
|
||||||
title?: string;
|
|
||||||
channel?: string;
|
|
||||||
avatar?: string;
|
|
||||||
content?: string;
|
|
||||||
files?: string;
|
|
||||||
developerId?: number;
|
|
||||||
userId?: number;
|
|
||||||
sortNumber?: number;
|
|
||||||
comments?: string;
|
|
||||||
status?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息搜索条件
|
|
||||||
*/
|
|
||||||
export interface NoticeParam extends PageParam {
|
|
||||||
type?: string;
|
|
||||||
noticeRecordId?: number;
|
|
||||||
noticeId?: number;
|
|
||||||
userId?: number;
|
|
||||||
developerId?: number;
|
|
||||||
status?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询未读数量
|
|
||||||
export interface NnReadNum {
|
|
||||||
notice?: string;
|
|
||||||
letter?: number;
|
|
||||||
todo?: number;
|
|
||||||
chatGPT?: number;
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Project, ProjectParam } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询项目
|
|
||||||
*/
|
|
||||||
export async function pageProject(params: ProjectParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Project>>>(
|
|
||||||
'/oa/project/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询项目列表
|
|
||||||
*/
|
|
||||||
export async function listProject(params?: ProjectParam) {
|
|
||||||
const res = await request.get<ApiResult<Project[]>>('/oa/project', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询项目
|
|
||||||
*/
|
|
||||||
export async function getProject(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Project>>('/oa/project/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加项目
|
|
||||||
*/
|
|
||||||
export async function addProject(data: Project) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/project', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改项目
|
|
||||||
*/
|
|
||||||
export async function updateProject(data: Project) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/project', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除项目
|
|
||||||
*/
|
|
||||||
export async function removeProject(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/project/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除项目
|
|
||||||
*/
|
|
||||||
export async function removeBatchProject(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/project/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/oa/project/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目
|
|
||||||
*/
|
|
||||||
export interface Project {
|
|
||||||
// 项目id
|
|
||||||
projectId?: number;
|
|
||||||
// 项目类型
|
|
||||||
projectType?: string;
|
|
||||||
// 项目分类
|
|
||||||
projectCategory?: string;
|
|
||||||
// 项目标识
|
|
||||||
projectCode: string;
|
|
||||||
// 项目名称
|
|
||||||
projectName?: string;
|
|
||||||
// 项目图标
|
|
||||||
projectAvatar?: string;
|
|
||||||
url?: string;
|
|
||||||
urlDev?: string;
|
|
||||||
urlAdmin?: string;
|
|
||||||
account?: string;
|
|
||||||
money?: string;
|
|
||||||
realMoney?: string;
|
|
||||||
annualFee?: string;
|
|
||||||
qrcode?: string;
|
|
||||||
progress?: string;
|
|
||||||
views?: string;
|
|
||||||
// 项目详情
|
|
||||||
content?: string;
|
|
||||||
// 客户ID
|
|
||||||
customerId?: number;
|
|
||||||
// 客户名称
|
|
||||||
customerName?: string;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 状态
|
|
||||||
status?: string;
|
|
||||||
// 用户ID
|
|
||||||
userId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目搜索条件
|
|
||||||
*/
|
|
||||||
export interface ProjectParam extends PageParam {
|
|
||||||
projectName?: string;
|
|
||||||
projectCode?: string;
|
|
||||||
status?: string;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { TaskCount, TaskCountParam } from './model/index';
|
|
||||||
import { TabsParam } from '@/api/tabs';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询统计
|
|
||||||
*/
|
|
||||||
export async function pageTaskCount(params: TaskCountParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<TaskCount>>>(
|
|
||||||
'/oa/task-count/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询统计列表
|
|
||||||
*/
|
|
||||||
export async function listTaskCount(params?: TaskCountParam) {
|
|
||||||
const res = await request.get<ApiResult<TaskCount[]>>('/oa/task-count', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询统计
|
|
||||||
*/
|
|
||||||
export async function getTaskCount(id: number) {
|
|
||||||
const res = await request.get<ApiResult<TaskCount>>('/oa/task-count/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加统计
|
|
||||||
*/
|
|
||||||
export async function addTaskCount(data: TaskCount) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/task-count', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改统计
|
|
||||||
*/
|
|
||||||
export async function updateTaskCount(data: TaskCount) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/task-count', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除统计
|
|
||||||
*/
|
|
||||||
export async function removeTaskCount(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/task-count/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除统计
|
|
||||||
*/
|
|
||||||
export async function removeBatchTaskCount(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/task-count/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getCount(params?: TabsParam) {
|
|
||||||
const res = await request.get<ApiResult<TabsParam>>('/oa/task-count/count', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统计
|
|
||||||
*/
|
|
||||||
export interface TaskCount {
|
|
||||||
// 统计id
|
|
||||||
taskCountId?: number;
|
|
||||||
userId?: number;
|
|
||||||
nickname?: string;
|
|
||||||
avatar?: string;
|
|
||||||
phone?: string;
|
|
||||||
pending?: number;
|
|
||||||
unused?: number;
|
|
||||||
today?: number;
|
|
||||||
month?: number;
|
|
||||||
year?: number;
|
|
||||||
total?: number;
|
|
||||||
commander?: number;
|
|
||||||
createTime?: string;
|
|
||||||
updateTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统计搜索条件
|
|
||||||
*/
|
|
||||||
export interface TaskCountParam extends PageParam {
|
|
||||||
taskCountId?: number;
|
|
||||||
userId?: number;
|
|
||||||
roleId?: number;
|
|
||||||
roleCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { TaskRecord, TaskRecordParam } from './model/index';
|
|
||||||
import { TabsParam } from '@/api/tabs';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询任务
|
|
||||||
*/
|
|
||||||
export async function pageTaskRecord(params: TaskRecordParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<TaskRecord>>>(
|
|
||||||
'/oa/task-record/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务列表
|
|
||||||
*/
|
|
||||||
export async function listTaskRecord(params?: TaskRecordParam) {
|
|
||||||
const res = await request.get<ApiResult<TaskRecord[]>>('/oa/task-record', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询任务
|
|
||||||
*/
|
|
||||||
export async function getTaskRecord(id: number) {
|
|
||||||
const res = await request.get<ApiResult<TaskRecord>>('/oa/task-record/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加任务
|
|
||||||
*/
|
|
||||||
export async function addTaskRecord(data: TaskRecord) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/task-record', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务
|
|
||||||
*/
|
|
||||||
export async function updateTaskRecord(data: TaskRecord) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/task-record', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务
|
|
||||||
*/
|
|
||||||
export async function removeTaskRecord(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/task-record/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除任务
|
|
||||||
*/
|
|
||||||
export async function removeBatchTaskRecord(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/oa/task-record/batch',
|
|
||||||
{
|
|
||||||
data
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getCount(params?: TabsParam) {
|
|
||||||
const res = await request.get<ApiResult<TabsParam>>('/oa/task-record/count', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
import { User } from '@/api/user/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务
|
|
||||||
*/
|
|
||||||
export interface TaskRecord {
|
|
||||||
// 任务id
|
|
||||||
taskRecordId?: number;
|
|
||||||
taskId?: number;
|
|
||||||
parentId?: number;
|
|
||||||
nickname?: string;
|
|
||||||
avatar?: string;
|
|
||||||
content?: string;
|
|
||||||
files?: any;
|
|
||||||
appId?: number;
|
|
||||||
developerId?: number;
|
|
||||||
userId?: number;
|
|
||||||
sortNumber?: number;
|
|
||||||
comments?: string;
|
|
||||||
status?: string;
|
|
||||||
children?: TaskRecord[] | [];
|
|
||||||
createTime?: string;
|
|
||||||
toUser: User | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务搜索条件
|
|
||||||
*/
|
|
||||||
export interface TaskRecordParam extends PageParam {
|
|
||||||
taskRecordId?: number;
|
|
||||||
taskId?: number;
|
|
||||||
userId?: number;
|
|
||||||
developerId?: number;
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { TaskUser, TaskUserParam } from './model/index';
|
|
||||||
import { TabsParam } from '@/api/tabs';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询工单成员
|
|
||||||
*/
|
|
||||||
export async function pageTaskUser(params: TaskUserParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<TaskUser>>>(
|
|
||||||
'/oa/task-user/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询工单成员列表
|
|
||||||
*/
|
|
||||||
export async function listTaskUser(params?: TaskUserParam) {
|
|
||||||
const res = await request.get<ApiResult<TaskUser[]>>('/oa/task-user', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询工单成员
|
|
||||||
*/
|
|
||||||
export async function getTaskUser(id: number) {
|
|
||||||
const res = await request.get<ApiResult<TaskUser>>('/oa/task-user/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加工单成员
|
|
||||||
*/
|
|
||||||
export async function addTaskUser(data: TaskUser) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/task-user', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改工单成员
|
|
||||||
*/
|
|
||||||
export async function updateTaskUser(data: TaskUser) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/task-user', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除工单成员
|
|
||||||
*/
|
|
||||||
export async function removeTaskUser(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/task-user/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除工单成员
|
|
||||||
*/
|
|
||||||
export async function removeBatchTaskUser(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/task-user/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getCount(params?: TabsParam) {
|
|
||||||
const res = await request.get<ApiResult<TabsParam>>('/oa/task-user/count', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务
|
|
||||||
*/
|
|
||||||
export interface TaskUser {
|
|
||||||
// 任务id
|
|
||||||
taskUserId?: number;
|
|
||||||
taskId?: number;
|
|
||||||
role?: number;
|
|
||||||
userId?: number;
|
|
||||||
status?: string;
|
|
||||||
avatar?: string;
|
|
||||||
name?: string;
|
|
||||||
username?: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务搜索条件
|
|
||||||
*/
|
|
||||||
export interface TaskUserParam extends PageParam {
|
|
||||||
taskUserId?: number;
|
|
||||||
taskId?: number;
|
|
||||||
userId?: number;
|
|
||||||
}
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Task, TaskParam } from './model/index';
|
|
||||||
import { TabsParam } from '@/api/tabs';
|
|
||||||
import { MODULES_API_URL } from "@/config/setting";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询任务
|
|
||||||
*/
|
|
||||||
export async function pageTask(params: TaskParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Task>>>('/oa/task/page', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询任务列表
|
|
||||||
*/
|
|
||||||
export async function listTask(params?: TaskParam) {
|
|
||||||
const res = await request.get<ApiResult<Task[]>>('/oa/task', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询任务
|
|
||||||
*/
|
|
||||||
export async function getTask(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Task>>('/oa/task/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加任务
|
|
||||||
*/
|
|
||||||
export async function addTask(data: Task) {
|
|
||||||
const res = await request.post<ApiResult<Task>>('/oa/task', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改任务
|
|
||||||
*/
|
|
||||||
export async function updateTask(data: Task) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/task', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除任务
|
|
||||||
*/
|
|
||||||
export async function removeTask(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/task/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除任务
|
|
||||||
*/
|
|
||||||
export async function removeBatchTask(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/task/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getCount(params?: TabsParam) {
|
|
||||||
const res = await request.get<ApiResult<TabsParam>>('/oa/task/count', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取工单二维码
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export async function taskQRCode(params: TaskParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Task>>>(
|
|
||||||
MODULES_API_URL + '/oa/task/taskQRCode',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取邀请加入二维码
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export async function taskJoinQRCode(params: TaskParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Task>>>(
|
|
||||||
MODULES_API_URL + '/oa/task/taskJoinQRCode',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
import { TaskRecord } from '@/api/oa/task-record/model';
|
|
||||||
import { TaskUser } from '@/api/oa/task-user/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务
|
|
||||||
*/
|
|
||||||
export interface Task {
|
|
||||||
// 任务id
|
|
||||||
taskId?: number;
|
|
||||||
// 任务名称
|
|
||||||
name?: string;
|
|
||||||
// 任务类型
|
|
||||||
taskType?: string;
|
|
||||||
// 关联应用
|
|
||||||
appId?: number;
|
|
||||||
appName?: string;
|
|
||||||
// 项目ID
|
|
||||||
projectId?: string;
|
|
||||||
// 客户ID
|
|
||||||
customerId?: string;
|
|
||||||
// 资产ID
|
|
||||||
assetsId?: string;
|
|
||||||
// 开始时间
|
|
||||||
startTime?: string;
|
|
||||||
// 结束时间
|
|
||||||
endTime?: string;
|
|
||||||
// 任务内容
|
|
||||||
content?: string;
|
|
||||||
files?: string;
|
|
||||||
// 任务发起人
|
|
||||||
promoter?: number;
|
|
||||||
promoterName?: string;
|
|
||||||
promoterAlias?: string;
|
|
||||||
promoterAvatar?: string;
|
|
||||||
promoterCompanyName?: string;
|
|
||||||
// 任务状态
|
|
||||||
progress?: number;
|
|
||||||
isRead?: boolean;
|
|
||||||
// 优先级
|
|
||||||
priority?: string;
|
|
||||||
// 品质要求
|
|
||||||
quality?: string;
|
|
||||||
// 期限(天)
|
|
||||||
day?: string;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
redirect?: string;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
updateTime?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 发布者
|
|
||||||
userId?: any;
|
|
||||||
// 发布者昵称
|
|
||||||
nickname?: string;
|
|
||||||
// 项目名称
|
|
||||||
projectName?: string;
|
|
||||||
// 图片集
|
|
||||||
images?: [];
|
|
||||||
avatar?: string;
|
|
||||||
// 受理人
|
|
||||||
commander?: number;
|
|
||||||
commanderName?: string;
|
|
||||||
commanderAlias?: string;
|
|
||||||
commanderAvatar?: string;
|
|
||||||
commanderCompanyName?: string;
|
|
||||||
commanderRealName?: string;
|
|
||||||
// 最后回复人
|
|
||||||
lastRealName?: string;
|
|
||||||
lastAvatar?: string;
|
|
||||||
lastReadUser?: number;
|
|
||||||
lastNickname?: string;
|
|
||||||
recordList?: TaskRecord[];
|
|
||||||
users?: TaskUser[];
|
|
||||||
phone?: string;
|
|
||||||
phoneXX?: string;
|
|
||||||
action?: string;
|
|
||||||
// 机密信息
|
|
||||||
confidential?: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务搜索条件
|
|
||||||
*/
|
|
||||||
export interface TaskParam extends PageParam {
|
|
||||||
taskId?: number;
|
|
||||||
status?: any;
|
|
||||||
name?: string;
|
|
||||||
promoter?: number;
|
|
||||||
promoterName?: string;
|
|
||||||
commander?: number;
|
|
||||||
commanderName?: string;
|
|
||||||
progress?: number;
|
|
||||||
betweenTime?: any;
|
|
||||||
userId?: number;
|
|
||||||
nickname?: string;
|
|
||||||
keywords?: any;
|
|
||||||
current?: string;
|
|
||||||
pending?: number;
|
|
||||||
appId?: number;
|
|
||||||
appName?: string;
|
|
||||||
companyId?: number;
|
|
||||||
companyName?: string;
|
|
||||||
taskType?: string;
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* 枚举类
|
|
||||||
*/
|
|
||||||
export const TOBEARRANGED = 0; // 待安排
|
|
||||||
export const PENDING = 1; // 待处理
|
|
||||||
export const PROCESSING = 2; // 处理中
|
|
||||||
export const TOBECONFIRMED = 3; // 待评价
|
|
||||||
export const COMPLETED = 4; // 已完成
|
|
||||||
export const CLOSED = 5; // 已关闭
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
export const TASK_STATUS_0 = 0; // 待处理
|
|
||||||
export const TASK_STATUS_1 = 1; // 已完成
|
|
||||||
|
|
||||||
export const ACTION_1 = '派单';
|
|
||||||
export const ACTION_2 = '已解决';
|
|
||||||
export const ACTION_3 = '关单';
|
|
||||||
export const ACTION_4 = '分享';
|
|
||||||
export const ACTION_5 = '编辑';
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Tenant, TenantParam } from './model';
|
|
||||||
import { Menu } from '@/api/system/menu/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询租户
|
|
||||||
*/
|
|
||||||
export async function pageTenant(params: TenantParam) {
|
|
||||||
// 租户列表查询需要传一个key
|
|
||||||
// params.tenantCode = 'ZAcxbdmDQFwUKC3e';
|
|
||||||
const res = await request.get<ApiResult<PageResult<Tenant>>>(
|
|
||||||
'/system/tenant/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询租户资料
|
|
||||||
*/
|
|
||||||
export async function profile(params?: TenantParam) {
|
|
||||||
const res = await request.get<ApiResult<Tenant>>('/system/tenant/profile', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询租户列表
|
|
||||||
*/
|
|
||||||
export async function listTenant(params?: TenantParam) {
|
|
||||||
const res = await request.get<ApiResult<Tenant[]>>('/system/tenant', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*/
|
|
||||||
export async function getTenant(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Tenant>>('/system/tenant/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加租户
|
|
||||||
*/
|
|
||||||
export async function addTenant(data: Tenant) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/system/tenant', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改租户
|
|
||||||
*/
|
|
||||||
export async function updateTenant(data: Tenant) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/system/tenant', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除租户
|
|
||||||
*/
|
|
||||||
export async function removeTenant(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/system/tenant/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除租户
|
|
||||||
*/
|
|
||||||
export async function removeBatchTenant(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/system/tenant/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重置用户密码
|
|
||||||
*/
|
|
||||||
export async function updateTenantPassword(
|
|
||||||
tenantId?: number,
|
|
||||||
password = 'gxwebsoft.com'
|
|
||||||
) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/system/tenant/password', {
|
|
||||||
tenantId,
|
|
||||||
password
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
|
||||||
'/system/tenant/existence',
|
|
||||||
{
|
|
||||||
params: { field, value, id }
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 租户初始化
|
|
||||||
*/
|
|
||||||
export async function initialization(roleId?: number) {
|
|
||||||
const res = await request.get<ApiResult<Menu[]>>(
|
|
||||||
'/system/tenant/role-menu/' + roleId
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 租户
|
|
||||||
*/
|
|
||||||
export interface Tenant {
|
|
||||||
// 租户id
|
|
||||||
tenantId?: number;
|
|
||||||
// 租户名称
|
|
||||||
tenantName?: string;
|
|
||||||
// 应用ID
|
|
||||||
appId?: string;
|
|
||||||
// 应用秘钥
|
|
||||||
appSecret?: string;
|
|
||||||
logo?: string;
|
|
||||||
// 所属客户
|
|
||||||
companyName?: string;
|
|
||||||
// 关联客户ID
|
|
||||||
companyId?: string;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
//
|
|
||||||
password?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 租户搜索条件
|
|
||||||
*/
|
|
||||||
export interface TenantParam extends PageParam {
|
|
||||||
tenantName?: string;
|
|
||||||
appId?: string;
|
|
||||||
companyId?: number;
|
|
||||||
companyName?: string;
|
|
||||||
tenantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -17,6 +17,40 @@ export async function login(data: LoginParam) {
|
|||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信验证码登录
|
||||||
|
*/
|
||||||
|
export async function loginBySms(data: LoginParam): Promise<string | undefined> {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
SERVER_API_URL + '/loginBySms',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
// @ts-ignore
|
||||||
|
uni.setStorageSync('access_token', res.data.data?.access_token)
|
||||||
|
// setToken(res.data.data?.access_token, data.remember);
|
||||||
|
// @ts-ignore
|
||||||
|
const user = res.data.data?.user;
|
||||||
|
if (user) {
|
||||||
|
console.log('user: ', user.userId);
|
||||||
|
uni.setStorageSync('user_id', user.userId)
|
||||||
|
console.log('TenantId: ', user.tenantId);
|
||||||
|
console.log('Phone: ', user.phone);
|
||||||
|
console.log('UserId: ', user.userId);
|
||||||
|
console.log('MerchantId: ', user.merchantId);
|
||||||
|
uni.setStorageSync('TenantId', user.tenantId)
|
||||||
|
uni.setStorageSync('Phone', user.phone)
|
||||||
|
uni.setStorageSync('UserId', user.userId)
|
||||||
|
if (user.merchantId) {
|
||||||
|
uni.setStorageSync('MerchantId', user.merchantId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取验证码
|
* 获取验证码
|
||||||
*/
|
*/
|
||||||
@@ -73,7 +107,7 @@ export async function registerUser(data: User) {
|
|||||||
export async function loginMpWxMobile(data: User) {
|
export async function loginMpWxMobile(data: User) {
|
||||||
const res = await request.post<ApiResult<unknown>>('/wx-login/loginByMpWxPhone', data);
|
const res = await request.post<ApiResult<unknown>>('/wx-login/loginByMpWxPhone', data);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.data;
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,156 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type {ApiResult, PageResult} from '@/api';
|
||||||
|
import {MODULES_API_URL} from '@/config/setting';
|
||||||
|
import type {Cart, CartParam, CartVo} from "@/api/shop/cart/model";
|
||||||
|
import type {Merchant} from "@/api/shop/merchant/model";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询商品记录表
|
||||||
|
*/
|
||||||
|
export async function pageCart(params: CartParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<Cart>>>(
|
||||||
|
MODULES_API_URL + '/shop/cart/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品记录表列表
|
||||||
|
*/
|
||||||
|
export async function listCart(params?: CartParam) {
|
||||||
|
const res = await request.get<ApiResult<CartVo>>(
|
||||||
|
MODULES_API_URL + '/shop/cart',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加商品记录表
|
||||||
|
*/
|
||||||
|
export async function addCart(data: Cart) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/cart',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
console.log(res)
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品记录表
|
||||||
|
*/
|
||||||
|
export async function updateCart(data: Cart) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/cart',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除商品记录表
|
||||||
|
*/
|
||||||
|
export async function removeCart(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/cart/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按店铺ID更新选中
|
||||||
|
export async function updateCartByMerchantId(id?: number) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/cart/updateCartByMerchantId/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 全选操作
|
||||||
|
export async function onSelectAll(yes: Boolean) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/cart/onSelectAll/' + yes
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量修改
|
||||||
|
*/
|
||||||
|
export async function updateBatchCart(data: Cart[]) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(MODULES_API_URL + '/shop/cart/batch', data);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除商品记录表
|
||||||
|
*/
|
||||||
|
export async function removeBatchCart(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/cart/batch',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询商品记录表
|
||||||
|
*/
|
||||||
|
export async function getCart(id: number) {
|
||||||
|
const res = await request.get<ApiResult<Cart>>(
|
||||||
|
MODULES_API_URL + '/shop/cart/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询商品记录表
|
||||||
|
*/
|
||||||
|
export async function myCart(params: CartParam) {
|
||||||
|
const res = await request.get<ApiResult<Merchant[]>>(
|
||||||
|
MODULES_API_URL + '/shop/cart/myCart',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
|
||||||
|
export interface CartVo {
|
||||||
|
// 店铺列表
|
||||||
|
shops?: CartShopVo[];
|
||||||
|
// 购物车总金额
|
||||||
|
totalPrice?: number;
|
||||||
|
// 宝贝总数量
|
||||||
|
totalNums?: number;
|
||||||
|
// 已选宝贝
|
||||||
|
selectNums?: number;
|
||||||
|
// 是否全选
|
||||||
|
selectAll?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CartShopVo {
|
||||||
|
// 店铺ID
|
||||||
|
shopId?: number;
|
||||||
|
// 店铺名称
|
||||||
|
shopName?: string;
|
||||||
|
// 店铺LOGO
|
||||||
|
shopLogo?: string;
|
||||||
|
// 购物车商品列表
|
||||||
|
carts?: Cart[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购物车
|
||||||
|
*/
|
||||||
|
export interface Cart {
|
||||||
|
// 购物车表ID
|
||||||
|
id?: string;
|
||||||
|
// 类型 0商城 1预定
|
||||||
|
type?: number;
|
||||||
|
// 商品ID
|
||||||
|
goodsId?: string;
|
||||||
|
// 唯一标识
|
||||||
|
code?: string;
|
||||||
|
// 商品规格
|
||||||
|
spec?: string;
|
||||||
|
// 商品数量
|
||||||
|
cartNum?: number;
|
||||||
|
// 0 = 未购买 1 = 已购买
|
||||||
|
isPay?: string;
|
||||||
|
// 是否为立即购买
|
||||||
|
isNew?: string;
|
||||||
|
// 拼团id
|
||||||
|
combinationId?: number;
|
||||||
|
// 秒杀产品ID
|
||||||
|
seckillId?: number;
|
||||||
|
// 砍价id
|
||||||
|
bargainId?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: string;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 注册时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
// 是否已选中
|
||||||
|
selected?: boolean;
|
||||||
|
// 全选操作
|
||||||
|
selectAll?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购物车搜索条件
|
||||||
|
*/
|
||||||
|
export interface CartParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
page?: number;
|
||||||
|
type?: number;
|
||||||
|
selected?: boolean;
|
||||||
|
isNew?: boolean;
|
||||||
|
cartId?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商城销售统计表
|
||||||
|
*/
|
||||||
|
export interface Count {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 统计日期
|
||||||
|
dateTime?: string;
|
||||||
|
// 总销售额
|
||||||
|
totalPrice?: string;
|
||||||
|
// 今日销售额
|
||||||
|
todayPrice?: string;
|
||||||
|
// 总会员数
|
||||||
|
totalUsers?: string;
|
||||||
|
// 今日新增
|
||||||
|
todayUsers?: string;
|
||||||
|
// 总订单笔数
|
||||||
|
totalOrders?: string;
|
||||||
|
// 今日订单笔数
|
||||||
|
todayOrders?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 注册时间
|
||||||
|
createTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商城销售统计表搜索条件
|
||||||
|
*/
|
||||||
|
export interface CountParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { DealerApply, DealerApplyParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分销商申请记录表
|
||||||
|
*/
|
||||||
|
export async function pageDealerApply(params: DealerApplyParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<DealerApply>>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-apply/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分销商申请记录表列表
|
||||||
|
*/
|
||||||
|
export async function listDealerApply(params?: DealerApplyParam) {
|
||||||
|
const res = await request.get<ApiResult<DealerApply[]>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-apply',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分销商申请记录表
|
||||||
|
*/
|
||||||
|
export async function addDealerApply(data: DealerApply) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-apply',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分销商申请记录表
|
||||||
|
*/
|
||||||
|
export async function updateDealerApply(data: DealerApply) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-apply',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分销商申请记录表
|
||||||
|
*/
|
||||||
|
export async function removeDealerApply(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-apply/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分销商申请记录表
|
||||||
|
*/
|
||||||
|
export async function removeBatchDealerApply(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-apply/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分销商申请记录表
|
||||||
|
*/
|
||||||
|
export async function getDealerApply(id: number) {
|
||||||
|
const res = await request.get<ApiResult<DealerApply>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-apply/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商申请记录表
|
||||||
|
*/
|
||||||
|
export interface DealerApply {
|
||||||
|
// 主键ID
|
||||||
|
applyId?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 姓名
|
||||||
|
realName?: string;
|
||||||
|
// 手机号
|
||||||
|
mobile?: string;
|
||||||
|
// 推荐人用户ID
|
||||||
|
refereeId?: number;
|
||||||
|
// 申请方式(10需后台审核 20无需审核)
|
||||||
|
applyType?: number;
|
||||||
|
// 申请时间
|
||||||
|
applyTime?: number;
|
||||||
|
// 审核状态 (10待审核 20审核通过 30驳回)
|
||||||
|
applyStatus?: number;
|
||||||
|
// 审核时间
|
||||||
|
auditTime?: number;
|
||||||
|
// 驳回原因
|
||||||
|
rejectReason?: string;
|
||||||
|
// 商城ID
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商申请记录表搜索条件
|
||||||
|
*/
|
||||||
|
export interface DealerApplyParam extends PageParam {
|
||||||
|
applyId?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { DealerCapital, DealerCapitalParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分销商资金明细表
|
||||||
|
*/
|
||||||
|
export async function pageDealerCapital(params: DealerCapitalParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<DealerCapital>>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-capital/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分销商资金明细表列表
|
||||||
|
*/
|
||||||
|
export async function listDealerCapital(params?: DealerCapitalParam) {
|
||||||
|
const res = await request.get<ApiResult<DealerCapital[]>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-capital',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分销商资金明细表
|
||||||
|
*/
|
||||||
|
export async function addDealerCapital(data: DealerCapital) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-capital',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分销商资金明细表
|
||||||
|
*/
|
||||||
|
export async function updateDealerCapital(data: DealerCapital) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-capital',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分销商资金明细表
|
||||||
|
*/
|
||||||
|
export async function removeDealerCapital(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-capital/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分销商资金明细表
|
||||||
|
*/
|
||||||
|
export async function removeBatchDealerCapital(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-capital/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分销商资金明细表
|
||||||
|
*/
|
||||||
|
export async function getDealerCapital(id: number) {
|
||||||
|
const res = await request.get<ApiResult<DealerCapital>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-capital/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商资金明细表
|
||||||
|
*/
|
||||||
|
export interface DealerCapital {
|
||||||
|
// 主键ID
|
||||||
|
id?: number;
|
||||||
|
// 分销商用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 订单ID
|
||||||
|
orderId?: number;
|
||||||
|
// 资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入)
|
||||||
|
flowType?: number;
|
||||||
|
// 金额
|
||||||
|
money?: string;
|
||||||
|
// 描述
|
||||||
|
describe?: string;
|
||||||
|
// 对方用户ID
|
||||||
|
toUserId?: number;
|
||||||
|
// 商城ID
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商资金明细表搜索条件
|
||||||
|
*/
|
||||||
|
export interface DealerCapitalParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { DealerOrder, DealerOrderParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分销商订单记录表
|
||||||
|
*/
|
||||||
|
export async function pageDealerOrder(params: DealerOrderParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<DealerOrder>>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-order/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分销商订单记录表列表
|
||||||
|
*/
|
||||||
|
export async function listDealerOrder(params?: DealerOrderParam) {
|
||||||
|
const res = await request.get<ApiResult<DealerOrder[]>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-order',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分销商订单记录表
|
||||||
|
*/
|
||||||
|
export async function addDealerOrder(data: DealerOrder) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-order',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分销商订单记录表
|
||||||
|
*/
|
||||||
|
export async function updateDealerOrder(data: DealerOrder) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-order',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分销商订单记录表
|
||||||
|
*/
|
||||||
|
export async function removeDealerOrder(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-order/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分销商订单记录表
|
||||||
|
*/
|
||||||
|
export async function removeBatchDealerOrder(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-order/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分销商订单记录表
|
||||||
|
*/
|
||||||
|
export async function getDealerOrder(id: number) {
|
||||||
|
const res = await request.get<ApiResult<DealerOrder>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-order/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商订单记录表
|
||||||
|
*/
|
||||||
|
export interface DealerOrder {
|
||||||
|
// 主键ID
|
||||||
|
id?: number;
|
||||||
|
// 买家用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 订单ID
|
||||||
|
orderId?: number;
|
||||||
|
// 订单总金额(不含运费)
|
||||||
|
orderPrice?: string;
|
||||||
|
// 分销商用户id(一级)
|
||||||
|
firstUserId?: number;
|
||||||
|
// 分销商用户id(二级)
|
||||||
|
secondUserId?: number;
|
||||||
|
// 分销商用户id(三级)
|
||||||
|
thirdUserId?: number;
|
||||||
|
// 分销佣金(一级)
|
||||||
|
firstMoney?: string;
|
||||||
|
// 分销佣金(二级)
|
||||||
|
secondMoney?: string;
|
||||||
|
// 分销佣金(三级)
|
||||||
|
thirdMoney?: string;
|
||||||
|
// 订单是否失效(0未失效 1已失效)
|
||||||
|
isInvalid?: number;
|
||||||
|
// 佣金结算(0未结算 1已结算)
|
||||||
|
isSettled?: number;
|
||||||
|
// 结算时间
|
||||||
|
settleTime?: number;
|
||||||
|
// 商城ID
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商订单记录表搜索条件
|
||||||
|
*/
|
||||||
|
export interface DealerOrderParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { DealerReferee, DealerRefereeParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分销商推荐关系表
|
||||||
|
*/
|
||||||
|
export async function pageDealerReferee(params: DealerRefereeParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<DealerReferee>>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-referee/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分销商推荐关系表列表
|
||||||
|
*/
|
||||||
|
export async function listDealerReferee(params?: DealerRefereeParam) {
|
||||||
|
const res = await request.get<ApiResult<DealerReferee[]>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-referee',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分销商推荐关系表
|
||||||
|
*/
|
||||||
|
export async function addDealerReferee(data: DealerReferee) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-referee',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分销商推荐关系表
|
||||||
|
*/
|
||||||
|
export async function updateDealerReferee(data: DealerReferee) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-referee',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分销商推荐关系表
|
||||||
|
*/
|
||||||
|
export async function removeDealerReferee(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-referee/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分销商推荐关系表
|
||||||
|
*/
|
||||||
|
export async function removeBatchDealerReferee(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-referee/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分销商推荐关系表
|
||||||
|
*/
|
||||||
|
export async function getDealerReferee(id: number) {
|
||||||
|
const res = await request.get<ApiResult<DealerReferee>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-referee/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商推荐关系表
|
||||||
|
*/
|
||||||
|
export interface DealerReferee {
|
||||||
|
// 主键ID
|
||||||
|
id?: number;
|
||||||
|
// 分销商用户ID
|
||||||
|
dealerId?: number;
|
||||||
|
// 用户id(被推荐人)
|
||||||
|
userId?: number;
|
||||||
|
// 推荐关系层级(1,2,3)
|
||||||
|
level?: number;
|
||||||
|
// 商城ID
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商推荐关系表搜索条件
|
||||||
|
*/
|
||||||
|
export interface DealerRefereeParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { DealerSetting, DealerSettingParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分销商设置表
|
||||||
|
*/
|
||||||
|
export async function pageDealerSetting(params: DealerSettingParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<DealerSetting>>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-setting/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分销商设置表列表
|
||||||
|
*/
|
||||||
|
export async function listDealerSetting(params?: DealerSettingParam) {
|
||||||
|
const res = await request.get<ApiResult<DealerSetting[]>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-setting',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分销商设置表
|
||||||
|
*/
|
||||||
|
export async function addDealerSetting(data: DealerSetting) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-setting',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分销商设置表
|
||||||
|
*/
|
||||||
|
export async function updateDealerSetting(data: DealerSetting) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-setting',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分销商设置表
|
||||||
|
*/
|
||||||
|
export async function removeDealerSetting(id?: string) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-setting/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分销商设置表
|
||||||
|
*/
|
||||||
|
export async function removeBatchDealerSetting(data: (string | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-setting/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分销商设置表
|
||||||
|
*/
|
||||||
|
export async function getDealerSetting(id: string) {
|
||||||
|
const res = await request.get<ApiResult<DealerSetting>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-setting/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商设置表
|
||||||
|
*/
|
||||||
|
export interface DealerSetting {
|
||||||
|
// 设置项标示
|
||||||
|
key?: string;
|
||||||
|
// 设置项描述
|
||||||
|
describe?: string;
|
||||||
|
// 设置内容(json格式)
|
||||||
|
values?: string;
|
||||||
|
// 商城ID
|
||||||
|
tenantId?: number;
|
||||||
|
// 更新时间
|
||||||
|
updateTime?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商设置表搜索条件
|
||||||
|
*/
|
||||||
|
export interface DealerSettingParam extends PageParam {
|
||||||
|
key?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { DealerUser, DealerUserParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分销商用户记录表
|
||||||
|
*/
|
||||||
|
export async function pageDealerUser(params: DealerUserParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<DealerUser>>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-user/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分销商用户记录表列表
|
||||||
|
*/
|
||||||
|
export async function listDealerUser(params?: DealerUserParam) {
|
||||||
|
const res = await request.get<ApiResult<DealerUser[]>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-user',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分销商用户记录表
|
||||||
|
*/
|
||||||
|
export async function addDealerUser(data: DealerUser) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-user',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分销商用户记录表
|
||||||
|
*/
|
||||||
|
export async function updateDealerUser(data: DealerUser) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-user',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分销商用户记录表
|
||||||
|
*/
|
||||||
|
export async function removeDealerUser(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-user/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分销商用户记录表
|
||||||
|
*/
|
||||||
|
export async function removeBatchDealerUser(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-user/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分销商用户记录表
|
||||||
|
*/
|
||||||
|
export async function getDealerUser(id: number) {
|
||||||
|
const res = await request.get<ApiResult<DealerUser>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-user/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分销商用户记录表
|
||||||
|
*/
|
||||||
|
export async function getDealerUserQrcode() {
|
||||||
|
const res = await request.get<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-user/getDealerUserQrcode'
|
||||||
|
);
|
||||||
|
if (res.data?.code == 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商用户记录表
|
||||||
|
*/
|
||||||
|
export interface DealerUser {
|
||||||
|
// 主键ID
|
||||||
|
id?: number;
|
||||||
|
// 自增ID
|
||||||
|
userId?: number;
|
||||||
|
// 姓名
|
||||||
|
realName?: string;
|
||||||
|
// 手机号
|
||||||
|
mobile?: string;
|
||||||
|
// 支付密码
|
||||||
|
payPassword?: string;
|
||||||
|
// 当前可提现佣金
|
||||||
|
money?: string;
|
||||||
|
// 已冻结佣金
|
||||||
|
freezeMoney?: string;
|
||||||
|
// 累积提现佣金
|
||||||
|
totalMoney?: string;
|
||||||
|
// 推荐人用户ID
|
||||||
|
refereeId?: number;
|
||||||
|
// 成员数量(一级)
|
||||||
|
firstNum?: number;
|
||||||
|
// 成员数量(二级)
|
||||||
|
secondNum?: number;
|
||||||
|
// 成员数量(三级)
|
||||||
|
thirdNum?: number;
|
||||||
|
// 是否删除
|
||||||
|
isDelete?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商用户记录表搜索条件
|
||||||
|
*/
|
||||||
|
export interface DealerUserParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
refereeId?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { DealerWithdraw, DealerWithdrawParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分销商提现明细表
|
||||||
|
*/
|
||||||
|
export async function pageDealerWithdraw(params: DealerWithdrawParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<DealerWithdraw>>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-withdraw/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分销商提现明细表列表
|
||||||
|
*/
|
||||||
|
export async function listDealerWithdraw(params?: DealerWithdrawParam) {
|
||||||
|
const res = await request.get<ApiResult<DealerWithdraw[]>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-withdraw',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分销商提现明细表
|
||||||
|
*/
|
||||||
|
export async function addDealerWithdraw(data: DealerWithdraw) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-withdraw',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分销商提现明细表
|
||||||
|
*/
|
||||||
|
export async function updateDealerWithdraw(data: DealerWithdraw) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-withdraw',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分销商提现明细表
|
||||||
|
*/
|
||||||
|
export async function removeDealerWithdraw(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-withdraw/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分销商提现明细表
|
||||||
|
*/
|
||||||
|
export async function removeBatchDealerWithdraw(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-withdraw/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分销商提现明细表
|
||||||
|
*/
|
||||||
|
export async function getDealerWithdraw(id: number) {
|
||||||
|
const res = await request.get<ApiResult<DealerWithdraw>>(
|
||||||
|
MODULES_API_URL + '/shop/dealer-withdraw/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商提现明细表
|
||||||
|
*/
|
||||||
|
export interface DealerWithdraw {
|
||||||
|
// 主键ID
|
||||||
|
id?: number;
|
||||||
|
// 分销商用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 提现金额
|
||||||
|
money?: string;
|
||||||
|
// 打款方式 (10微信 20支付宝 30银行卡)
|
||||||
|
payType?: number;
|
||||||
|
// 支付宝姓名
|
||||||
|
alipayName?: string;
|
||||||
|
// 支付宝账号
|
||||||
|
alipayAccount?: string;
|
||||||
|
// 开户行名称
|
||||||
|
bankName?: string;
|
||||||
|
// 银行开户名
|
||||||
|
bankAccount?: string;
|
||||||
|
// 银行卡号
|
||||||
|
bankCard?: string;
|
||||||
|
// 申请状态 (10待审核 20审核通过 30驳回 40已打款)
|
||||||
|
applyStatus?: number;
|
||||||
|
// 审核时间
|
||||||
|
auditTime?: number;
|
||||||
|
// 驳回原因
|
||||||
|
rejectReason?: string;
|
||||||
|
// 来源客户端(APP、H5、小程序等)
|
||||||
|
platform?: string;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销商提现明细表搜索条件
|
||||||
|
*/
|
||||||
|
export interface DealerWithdrawParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -104,3 +104,50 @@ export async function getGoodsCategory(id: number) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商城菜单分类
|
||||||
|
*/
|
||||||
|
export async function listCategoryTree(params?: GoodsCategoryParam) {
|
||||||
|
const res = await request.get<ApiResult<GoodsCategory[]>>(
|
||||||
|
MODULES_API_URL + '/shop/goods-category/listCategoryTree',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询父节点下的子分类分类及商品数据
|
||||||
|
*/
|
||||||
|
export async function listCategoryParentIdTree(id: number) {
|
||||||
|
const res = await request.get<ApiResult<GoodsCategory[]>>(
|
||||||
|
MODULES_API_URL + '/shop/goods-category/listCategoryParentIdTree/' + id,
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询门店菜单分类及菜品数据
|
||||||
|
*/
|
||||||
|
export async function listShopCategoryTree(params?: GoodsCategoryParam) {
|
||||||
|
const res = await request.get<ApiResult<GoodsCategory[]>>(
|
||||||
|
MODULES_API_URL + '/shop/goods-category/listShopCategoryTree',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -59,5 +59,7 @@ export interface GoodsCategory {
|
|||||||
*/
|
*/
|
||||||
export interface GoodsCategoryParam extends PageParam {
|
export interface GoodsCategoryParam extends PageParam {
|
||||||
categoryId?: number;
|
categoryId?: number;
|
||||||
|
parentId?: number;
|
||||||
|
merchantId?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<template>
|
||||||
|
<u-sticky zIndex="99999">
|
||||||
|
<u-navbar fixed :auto-back="false" :bgColor="bgColor" :status-bar-bg-color="bgColor" placeholder :title="title"
|
||||||
|
:title-style="{color: 'white'}" auto-back left-icon-color="white" @leftClick="leftClick">
|
||||||
|
<template slot="left">
|
||||||
|
<u-icon :name="currentPages.length > 1 ? 'arrow-left' : 'home'" size="20" color="white" v-if="showBack"/>
|
||||||
|
</template>
|
||||||
|
</u-navbar>
|
||||||
|
</u-sticky>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {LINEAR} from "@/config/color";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "HeaderItem",
|
||||||
|
props: {
|
||||||
|
title: String,
|
||||||
|
showBack: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
bgColor: LINEAR,
|
||||||
|
currentPages: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
leftClick() {
|
||||||
|
console.log(this.currentPages)
|
||||||
|
if (this.currentPages.length === 1) uni.switchTab({url: '/pages/index/index'})
|
||||||
|
// else uni.navigateBack()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.currentPages = getCurrentPages()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<view class="layout">
|
||||||
|
<slot />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as MpApi from "@/api/cms/mpPages";
|
||||||
|
import * as MenuIcons from '@/api/menu-icons';
|
||||||
|
import {useMpStore} from "@/store/modules/mp";
|
||||||
|
const mpStore = useMpStore();
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Layout',
|
||||||
|
components: {MenuIcons},
|
||||||
|
emits: ['done'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
index: 0,
|
||||||
|
// 配置信息
|
||||||
|
config: {},
|
||||||
|
tabBar: null,
|
||||||
|
ads: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.reload()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async reload(){
|
||||||
|
console.log('reloeddd')
|
||||||
|
// 获取小程序信息包
|
||||||
|
const info = await mpStore.fetchMpInfo();
|
||||||
|
// 配置信息
|
||||||
|
this.config = info.config
|
||||||
|
// 底部导航栏
|
||||||
|
this.tabBar = info.tabBar
|
||||||
|
// 加载当前页面
|
||||||
|
this.getPageByPath()
|
||||||
|
},
|
||||||
|
getPageByPath(){
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
const { route } = currentPage;
|
||||||
|
console.log(route)
|
||||||
|
this.index = this.tabBar.findIndex(d => d.path === `/${route}`)
|
||||||
|
MpApi.pageMpPages({
|
||||||
|
path: `/${route}`,
|
||||||
|
SceneType: 'showMpMenus'
|
||||||
|
}).then(res => {
|
||||||
|
this.$emit('done',res.list[0])
|
||||||
|
})
|
||||||
|
},
|
||||||
|
openUrl(url){
|
||||||
|
uni.switchTab({url})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
+1
-1
@@ -90,7 +90,7 @@
|
|||||||
"h5" : {
|
"h5" : {
|
||||||
"router" : {
|
"router" : {
|
||||||
"mode" : "hash",
|
"mode" : "hash",
|
||||||
"base" : "/gxtyzx-h5/"
|
"base" : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+495
-515
File diff suppressed because it is too large
Load Diff
+451
-387
@@ -1,407 +1,471 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="waterfall">
|
<layout class="container" @done="onLayout">
|
||||||
<!-- 商城导航图标 -->
|
|
||||||
<block v-if="navigation.length > 0">
|
<!-- 幻灯片广告 -->
|
||||||
<div class="user-oreder web-cell">
|
<block v-if="shopInfo.files">
|
||||||
<block v-for="(item,index) in goodsCategoryList" :key="index">
|
<view class="uv-demo-block" style="width: 750rpx; margin: auto">
|
||||||
<div class="web-cell-content web-text-center" @click="onCategory(item)">
|
<uv-swiper :list="JSON.parse(shopInfo.files)" bgColor="transparent" indicatorMode="dot" indicator circular
|
||||||
<image :src="item.image" style="width: 30px; height: 30px;" mode="widthFix"></image>
|
:autoplay="false"
|
||||||
<text>{{ item.title }}</text>
|
radius="0" height="200" @click="onSlide"></uv-swiper>
|
||||||
</div>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</div>
|
|
||||||
</block>
|
<!-- search-->
|
||||||
<block v-else>
|
<view class="search" style="padding: 0 10rpx; background-color: #FFFFFF">
|
||||||
<uni-card :border="false" :padding="'12px 4px'">
|
<uni-search-bar radius="5" placeholder="搜索商品" clearButton="auto" cancelButton="none" @confirm="search"/>
|
||||||
<view class="web-cell" style="justify-content: center; align-items: center;">
|
</view>
|
||||||
<uv-skeleton rows="0" avatar :loading="hideTools" :title="false">
|
|
||||||
</uv-skeleton>
|
<!-- <uv-gap height="8"></uv-gap>-->
|
||||||
<uv-skeleton rows="0" avatar :loading="hideTools" :title="false">
|
<uv-vtabs
|
||||||
</uv-skeleton>
|
:chain="chain"
|
||||||
<uv-skeleton rows="0" avatar :loading="hideTools" :title="false">
|
:list="list"
|
||||||
</uv-skeleton>
|
keyName="title"
|
||||||
<uv-skeleton rows="0" avatar :loading="hideTools" :title="false">
|
:height="height"
|
||||||
</uv-skeleton>
|
:barItemActiveStyle="{color: '#ff0000'}"
|
||||||
</view>
|
:barItemActiveLineStyle="{background: '#ff0000'}"
|
||||||
</uni-card>
|
hdHeight="100rpx"
|
||||||
</block>
|
@change="change">
|
||||||
<block v-if="!hideTools">
|
<template v-for="(item,index) in children" :key="index">
|
||||||
<view class="waterfall">
|
<uv-vtabs-item :index="index">
|
||||||
<uv-waterfall ref="waterfall" v-model="goodsList" :add-time="10" :left-gap="leftGap"
|
<view class="item">
|
||||||
:right-gap="rightGap" :column-gap="columnGap" @changeList="changeList">
|
<text class="ele-text-secondary" style="color: #808080">{{ item.title }}</text>
|
||||||
<!-- 第一列数据 -->
|
</view>
|
||||||
<template v-slot:list1>
|
<view class="item"
|
||||||
<!-- 为了磨平部分平台的BUG,必须套一层view -->
|
v-for="(item,index2) in item.goods"
|
||||||
<view>
|
:key="index2">
|
||||||
<view v-for="(item, index) in list1" :key="item.id" class="waterfall-item">
|
<view class="flex">
|
||||||
<view class="waterfall-item__image" :style="[imageStyle(item)]" @click="navTo(item)">
|
<uv-image :src="item.image" width="80" height="80" radius="6"
|
||||||
<image :src="item.image ? JSON.parse(item.image)[0] : []" mode="widthFix"
|
@click="navTo(`/package/goods/detail?id=${item.goodsId}`)"/>
|
||||||
:style="{width:item.width+'px'}"></image>
|
<view class="goods-info ml-2" style="flex: 1">
|
||||||
</view>
|
<view class="flex flex-col justify-between" style="height: 80px">
|
||||||
<view class="waterfall-item__ft">
|
<view class="goods-bar">
|
||||||
<view class="waterfall-item__ft__title" @click="navTo(item)">
|
<view class="goods-name">{{ item.goodsName }}</view>
|
||||||
<text class="value">{{item.goodsName}}</text>
|
<view class="goods-desc web-text-secondary">{{ item.comments }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="waterfall-item__ft__desc uv-line-2">
|
<view class="flex justify-between goods-price-bar">
|
||||||
<text class="web-text-danger">¥{{ item.price }}</text>
|
<view class="goods-price">¥{{ item.price }}</view>
|
||||||
</view>
|
|
||||||
</view>
|
<block v-if="item.specs === 1">
|
||||||
</view>
|
<uv-button type="error" class="goods-btn" size="mini" @click="openSpecForm(item)"
|
||||||
</view>
|
:customStyle="{backgroundColor: '#ff0000', color: '#ffffff'}">选规格
|
||||||
</template>
|
</uv-button>
|
||||||
<!-- 第二列数据 -->
|
</block>
|
||||||
<template v-slot:list2>
|
<block v-else>
|
||||||
<!-- 为了磨平部分平台的BUG,必须套一层view -->
|
<uv-number-box v-model="item.totalNums"
|
||||||
<view>
|
step="1"
|
||||||
<view v-for="(item, index) in list2" :key="item.id" class="waterfall-item">
|
:min="0"
|
||||||
<view class="waterfall-item__image" :style="[imageStyle(item)]" @click="navTo(item)">
|
:showMinus="item.totalNums > 0"
|
||||||
<image :src="item.image ? JSON.parse(item.image)[0] : []" mode="widthFix"
|
@change="addNum(item)"
|
||||||
:style="{width:item.width+'px'}"></image>
|
>
|
||||||
</view>
|
<template v-slot:minus>
|
||||||
<view class="waterfall-item__ft">
|
<view class="minus">
|
||||||
<view class="waterfall-item__ft__title" @click="navTo(item)">
|
<uv-icon
|
||||||
<text class="value">{{item.goodsName}}</text>
|
name="minus"
|
||||||
</view>
|
size="12">
|
||||||
<view class="waterfall-item__ft__desc uv-line-2">
|
</uv-icon>
|
||||||
<text class="web-text-danger">¥{{ item.price }}</text>
|
</view>
|
||||||
</view>
|
</template>
|
||||||
</view>
|
<template v-slot:input>
|
||||||
</view>
|
<text
|
||||||
</view>
|
style="width: 18px;text-align: center;"
|
||||||
</template>
|
class="input"
|
||||||
</uv-waterfall>
|
>
|
||||||
</view>
|
{{ item.totalNums }}
|
||||||
</block>
|
</text>
|
||||||
<block v-else>
|
</template>
|
||||||
<view class="skeleton" style="display: flex;">
|
<template v-slot:plus>
|
||||||
<uni-card :border="false" :padding="'18px 6px'">
|
<view class="plus">
|
||||||
<uv-skeleton rows="0" avatar avatarShape="square" avatarSize="100" :loading="hideTools"
|
<uv-icon
|
||||||
:title="false">
|
name="plus"
|
||||||
</uv-skeleton>
|
color="#FFFFFF"
|
||||||
<uv-gap height="16"></uv-gap>
|
size="12"
|
||||||
<uv-skeleton rows="2" :loading="hideTools" :title="false">
|
>
|
||||||
</uv-skeleton>
|
</uv-icon>
|
||||||
</uni-card>
|
</view>
|
||||||
<uni-card :border="false" :padding="'18px 6px'">
|
</template>
|
||||||
<uv-skeleton rows="0" avatar avatarShape="square" avatarSize="100" :loading="hideTools"
|
</uv-number-box>
|
||||||
:title="false">
|
</block>
|
||||||
</uv-skeleton>
|
</view>
|
||||||
<uv-gap height="16"></uv-gap>
|
</view>
|
||||||
<uv-skeleton rows="2" :loading="hideTools" :title="false">
|
</view>
|
||||||
</uv-skeleton>
|
</view>
|
||||||
</uni-card>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="skeleton" style="display: flex;">
|
|
||||||
<uni-card :border="false" :padding="'18px 6px'">
|
<view
|
||||||
<uv-skeleton rows="0" avatar avatarShape="square" avatarSize="100" :loading="hideTools"
|
class="gap"
|
||||||
:title="false">
|
v-if="index<list.length-1">
|
||||||
</uv-skeleton>
|
<uv-gap bg-color="#f1f1f1" height="4"></uv-gap>
|
||||||
<uv-gap height="16"></uv-gap>
|
</view>
|
||||||
<uv-skeleton rows="2" :loading="hideTools" :title="false">
|
</uv-vtabs-item>
|
||||||
</uv-skeleton>
|
</template>
|
||||||
</uni-card>
|
</uv-vtabs>
|
||||||
<uni-card :border="false" :padding="'18px 6px'">
|
|
||||||
<uv-skeleton rows="0" avatar avatarShape="square" avatarSize="100" :loading="hideTools"
|
<!-- 支付密码弹窗 -->
|
||||||
:title="false">
|
<uni-popup ref="specForm" type="center" border-radius="10px 10px 0 0">
|
||||||
</uv-skeleton>
|
<uni-card :title="goods.goodsName" :border="false" :is-shadow="false" :padding="0">
|
||||||
<uv-gap height="16"></uv-gap>
|
<view class="spec-card" style="width: 660rpx;">
|
||||||
<uv-skeleton rows="2" :loading="hideTools" :title="false">
|
<block v-if="goods.specValue">
|
||||||
</uv-skeleton>
|
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff' }" :border="false">
|
||||||
</uni-card>
|
<block v-for="(item, index) in JSON.parse(goods.specValue)" :key="index">
|
||||||
</view>
|
<uv-cell :title="item.value" :cellStyle="{ padding: '10px 0' }" :label="item.address">
|
||||||
</block>
|
<template v-slot:label>
|
||||||
</view>
|
<view class="tags flex mt-10">
|
||||||
|
<view class="tag mr-15" v-for="value in item.detail">
|
||||||
|
<uv-tags :text="value" v-if="onPlain(value)" plain border-color="#eeeeee" color="#808080"
|
||||||
|
@click="onTag(value,index)"></uv-tags>
|
||||||
|
<uv-tags :text="value" v-else plain color="#ff0000" border-color="#ff0000"
|
||||||
|
@click="onTag(value,index)"></uv-tags>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</uv-cell>
|
||||||
|
</block>
|
||||||
|
<uv-cell :cellStyle="{ padding: '40px 0' }">
|
||||||
|
|
||||||
|
</uv-cell>
|
||||||
|
<uv-cell :cellStyle="{ padding: '10px 0', backgroundColor: '#f3f3f3' }">
|
||||||
|
<template v-slot:label>
|
||||||
|
<view class="web-text-secondary">
|
||||||
|
已选规格:{{ skuText }}
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</uv-cell>
|
||||||
|
</uv-cell-group>
|
||||||
|
<view class="flex m-20 justify-between items-center">
|
||||||
|
<view class="total-price web-text-heading">
|
||||||
|
总计
|
||||||
|
<text class="text-red-500" style="font-weight: 500; font-size: 36rpx">¥12.99</text>
|
||||||
|
</view>
|
||||||
|
<view class="add-cart">
|
||||||
|
<uv-button type="warning" class="add-address" iconSize="16" :customStyle="{ borderRadius: '6px', padding: '5px 20px',
|
||||||
|
backgroundColor: '#ff0000', color: '#ffffff', fontWeight: 'bold' }" text="加入购物车"
|
||||||
|
@click="addCart"></uv-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</uni-card>
|
||||||
|
</uni-popup>
|
||||||
|
<!-- 登录组件 -->
|
||||||
|
<ws-login ref="login" @done="reload"/>
|
||||||
|
</layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as GoodsApi from '@/api/shop/goods';
|
import Layout from "@/components/layout.vue";
|
||||||
import * as GoodsCategoryApi from '@/api/shop/goodsCategory';
|
import {listCategoryParentIdTree, listCategoryTree} from '@/api/shop/goodsCategory';
|
||||||
import {
|
import UvAvatar from "@/uni_modules/uv-avatar/components/uv-avatar/uv-avatar.vue";
|
||||||
guid
|
import UvImage from "@/uni_modules/uv-image/components/uv-image/uv-image.vue";
|
||||||
} from '@/uni_modules/uv-ui-tools/libs/function/index.js'
|
import UvButton from "@/uni_modules/uv-button/components/uv-button/uv-button.vue";
|
||||||
import {
|
import {useMpStore} from "@/store/modules/mp";
|
||||||
useTenantStore
|
import UvGap from "@/uni_modules/uv-gap/components/uv-gap/uv-gap.vue";
|
||||||
} from '@/store/modules/tenant';
|
import * as CartApi from "@/api/shop/cart";
|
||||||
|
|
||||||
|
const mpStore = useMpStore();
|
||||||
|
|
||||||
const tenantStore = useTenantStore();
|
export default {
|
||||||
|
components: {UvGap, UvButton, UvImage, UvAvatar, Layout},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
shopInfo: {},
|
||||||
|
goods: {},
|
||||||
|
cart: {},
|
||||||
|
isLogin: false,
|
||||||
|
// 配置信息
|
||||||
|
config: {},
|
||||||
|
mpMenus: [],
|
||||||
|
list: [],
|
||||||
|
children: [],
|
||||||
|
chain: false,
|
||||||
|
showSpecForm: false,
|
||||||
|
sku: [],
|
||||||
|
skuText: '',
|
||||||
|
disabled: false,
|
||||||
|
// 支付密码是否正确
|
||||||
|
isPayPasswordCorrect: false,
|
||||||
|
disabledPayPayPassword: false,
|
||||||
|
payPassword: '',
|
||||||
|
totalPrice: 0,
|
||||||
|
cartNum: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
height() {
|
||||||
|
return uni.getSystemInfoSync().windowHeight - uni.upx2px(108);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.listCart();
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
// 模拟接口请求数据
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
this.reload();
|
||||||
|
// setTimeout(() => {
|
||||||
|
// // this.list = getList;
|
||||||
|
// this.reload()
|
||||||
|
// }, 500)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async reload() {
|
||||||
|
const app = this;
|
||||||
|
// 获取小程序信息包
|
||||||
|
const info = await mpStore.fetchMpInfo();
|
||||||
|
// 配置信息
|
||||||
|
app.config = info.config
|
||||||
|
// 登录状态
|
||||||
|
if (uni.getStorageSync('user_id') && uni.getStorageSync('access_token')) {
|
||||||
|
app.isLogin = true;
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
// 查询店铺分类
|
||||||
data() {
|
listCategoryTree({type: 0}).then(data => {
|
||||||
return {
|
app.list = data;
|
||||||
goodsList: [], // 瀑布流全部数据
|
if (data.length > 0) {
|
||||||
list1: [], // 瀑布流第一列数据
|
const parentId = data[0].categoryId
|
||||||
list2: [], // 瀑布流第二列数据
|
listCategoryParentIdTree(parentId).then(children => {
|
||||||
goodsCategoryList: [], // 商品分类
|
app.children = children;
|
||||||
leftGap: 10,
|
})
|
||||||
rightGap: 10,
|
}
|
||||||
columnGap: 10,
|
|
||||||
// 小程序导航图标
|
|
||||||
navigation: [],
|
|
||||||
// 骨架屏
|
|
||||||
hideTools: true,
|
|
||||||
// 商品分类
|
|
||||||
categoryId: undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
imageStyle(item) {
|
|
||||||
return item => {
|
|
||||||
const v = uni.upx2px(750) - this.leftGap - this.rightGap - this.columnGap;
|
|
||||||
const w = v / 2;
|
|
||||||
const rate = w / item.w;
|
|
||||||
const h = rate * item.h;
|
|
||||||
return {
|
|
||||||
width: w + 'px',
|
|
||||||
height: h + 'px'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async onLoad() {
|
|
||||||
// const {
|
|
||||||
// data
|
|
||||||
// } = await this.getData();
|
|
||||||
// this.list = data;
|
|
||||||
|
|
||||||
// 获取服务租户信息包
|
}).finally(err => {
|
||||||
const info = await tenantStore.fetchTenantInfo();
|
uni.hideLoading();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
listCart() {
|
||||||
|
CartApi.listCart({type: 0, isNew: false}).then(data => {
|
||||||
|
if (data) {
|
||||||
|
this.cart = data
|
||||||
|
uni.setTabBarBadge({
|
||||||
|
index: 2,
|
||||||
|
text: `${data.totalNums}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
navTo(url) {
|
||||||
|
uni.navigateTo({url})
|
||||||
|
},
|
||||||
|
change(index) {
|
||||||
|
const app = this
|
||||||
|
this.children = this.list[index].children;
|
||||||
|
const parentId = this.list[index].categoryId
|
||||||
|
listCategoryParentIdTree(parentId).then(children => {
|
||||||
|
app.children = children;
|
||||||
|
})
|
||||||
|
console.log('选项改变:', index)
|
||||||
|
},
|
||||||
|
openSpecForm(goods) {
|
||||||
|
if (!this.isLogin) {
|
||||||
|
this.$refs.login.open('bottom');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.goods = goods;
|
||||||
|
this.$refs.specForm.open('center');
|
||||||
|
},
|
||||||
|
addNum(item) {
|
||||||
|
const app = this
|
||||||
|
if (!app.isLogin) {
|
||||||
|
app.$refs.login.open('bottom');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
CartApi.addCart({
|
||||||
|
...item,
|
||||||
|
spec: this.skuText,
|
||||||
|
cartNum: 1
|
||||||
|
}).then(() => {
|
||||||
|
app.listCart()
|
||||||
|
}).catch(res => {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onPlain(text) {
|
||||||
|
const index = this.sku.findIndex(d => d === text)
|
||||||
|
return index < 0;
|
||||||
|
},
|
||||||
|
onTag(text, index) {
|
||||||
|
const app = this
|
||||||
|
console.log(text, index)
|
||||||
|
const json = JSON.parse(this.goods.specValue)
|
||||||
|
const parent = this.sku.findIndex(d => d === text)
|
||||||
|
console.log(parent);
|
||||||
|
if (parent < 0) {
|
||||||
|
app.sku.push(text)
|
||||||
|
app.skuText = app.sku.join('、')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addCart() {
|
||||||
|
const app = this
|
||||||
|
this.disabled = true;
|
||||||
|
CartApi.addCart({
|
||||||
|
...app.goods,
|
||||||
|
spec: app.skuText,
|
||||||
|
cartNum: 1
|
||||||
|
}).then(data => {
|
||||||
|
app.reload()
|
||||||
|
})
|
||||||
|
this.$refs.specForm.close();
|
||||||
|
},
|
||||||
|
onSlide() {
|
||||||
|
|
||||||
// 解析小程序导航图标
|
},
|
||||||
if (info.mpMenus) {
|
save() {
|
||||||
const arr1 = info.mpMenus.filter(d => (d.type == 3))
|
// 跳转页面
|
||||||
console.log('info.mpMenus: ', arr1);
|
uni.navigateTo({
|
||||||
if (arr1) {
|
url: '/package/goods/checkout?goodsId=' + this.goods.goodsId
|
||||||
this.navigation = arr1
|
})
|
||||||
}
|
},
|
||||||
}
|
onLayout(data) {
|
||||||
// 请求数据
|
if (data) {
|
||||||
this.reload()
|
// 页面图标链接
|
||||||
|
this.mpMenus = data.mpMenus;
|
||||||
},
|
}
|
||||||
methods: {
|
}
|
||||||
async reload() {
|
}
|
||||||
const app = this
|
}
|
||||||
|
|
||||||
// 获取服务租户信息包
|
|
||||||
const info = await tenantStore.fetchTenantInfo();
|
|
||||||
|
|
||||||
// 登录状态
|
|
||||||
if (uni.getStorageSync('user_id') && uni.getStorageSync('access_token')) {
|
|
||||||
app.isLogin = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 解析小程序导航图标
|
|
||||||
if (info.mpMenus) {
|
|
||||||
const arr1 = info.mpMenus.filter(d => (d.type == 3))
|
|
||||||
console.log('info.mpMenus: ', arr1);
|
|
||||||
if (arr1) {
|
|
||||||
app.navigation = arr1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 请求数据
|
|
||||||
Promise.all([app.pageGoods(),app.getGoodsCategory()])
|
|
||||||
.then((res) => {
|
|
||||||
app.goodsList = res[0];
|
|
||||||
app.goodsCategoryList = res[1];
|
|
||||||
app.hideTools = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
pageGoods() {
|
|
||||||
const app = this
|
|
||||||
const { categoryId } = this
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
GoodsApi.pageGoods({parentId: categoryId})
|
|
||||||
.then(result => {
|
|
||||||
resolve(result.list)
|
|
||||||
})
|
|
||||||
.catch(reject)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getGoodsCategory(){
|
|
||||||
const app = this
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
GoodsCategoryApi.pageGoodsCategory({parentId: 0})
|
|
||||||
.then(result => {
|
|
||||||
resolve(result.list)
|
|
||||||
})
|
|
||||||
.catch(reject)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navTo(item) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/package/goods/detail?id=' + item.goodsId
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onCategory(item){
|
|
||||||
this.categoryId = item.categoryId
|
|
||||||
this.goodsList = []
|
|
||||||
this.list1 = []
|
|
||||||
this.list2 = []
|
|
||||||
this.reload()
|
|
||||||
},
|
|
||||||
// 这点非常重要:e.name在这里返回是list1或list2,要手动将数据追加到相应列
|
|
||||||
changeList(e) {
|
|
||||||
console.log('e: ', e);
|
|
||||||
this[e.name].push(e.value);
|
|
||||||
},
|
|
||||||
// 模拟的后端数据
|
|
||||||
getData() {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
const imgs = [{
|
|
||||||
url: 'https://via.placeholder.com/100x110.png/3c9cff/fff',
|
|
||||||
width: 100,
|
|
||||||
height: 110
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/200x220.png/f9ae3d/fff',
|
|
||||||
width: 200,
|
|
||||||
height: 220
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/300x340.png/5ac725/fff',
|
|
||||||
width: 300,
|
|
||||||
height: 340
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/400x400.png/f56c6c/fff',
|
|
||||||
width: 400,
|
|
||||||
height: 400
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/500x510.png/909399/fff',
|
|
||||||
width: 500,
|
|
||||||
height: 510
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/600x606.png/3c9cff/fff',
|
|
||||||
width: 600,
|
|
||||||
height: 606
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/310x422.png/f1a532/fff',
|
|
||||||
width: 310,
|
|
||||||
height: 422
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/320x430.png/3c9cff/fff',
|
|
||||||
width: 320,
|
|
||||||
height: 430
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/330x424.png/f9ae3d/fff',
|
|
||||||
width: 330,
|
|
||||||
height: 424
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/340x435.png/5ac725/fff',
|
|
||||||
width: 340,
|
|
||||||
height: 435
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/350x440.png/f56c6c/fff',
|
|
||||||
width: 350,
|
|
||||||
height: 440
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: 'https://via.placeholder.com/380x470.png/909399/fff',
|
|
||||||
width: 380,
|
|
||||||
height: 470
|
|
||||||
}
|
|
||||||
];
|
|
||||||
let list = [];
|
|
||||||
const doFn = (i) => {
|
|
||||||
const randomIndex = Math.floor(Math.random() * 10);
|
|
||||||
return {
|
|
||||||
id: guid(),
|
|
||||||
allowEdit: i == 0,
|
|
||||||
image: imgs[randomIndex].url,
|
|
||||||
w: imgs[randomIndex].width,
|
|
||||||
h: imgs[randomIndex].height,
|
|
||||||
title: i % 2 == 0 ? `(${this.list.length + i + 1})体验uv-ui框架` :
|
|
||||||
`(${this.list.length + i +1})uv-ui支持多平台`,
|
|
||||||
desc: i % 2 == 0 ? `(${this.list.length + i + 1})欢迎使用uv-ui,uni-app生态专用的UI框架` :
|
|
||||||
`(${this.list.length + i})开发者编写一套代码, 可发布到iOS、Android、H5、以及各种小程序`
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// 模拟异步
|
|
||||||
setTimeout(() => {
|
|
||||||
for (let i = 0; i < 20; i++) {
|
|
||||||
list.push(doFn(i));
|
|
||||||
}
|
|
||||||
resolve({
|
|
||||||
data: list
|
|
||||||
});
|
|
||||||
}, 200)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
|
||||||
page {
|
|
||||||
/* background: url('https://oss.wsdns.cn/20240505/eaa18a0271fa42aa8395bd5eb874808a.png') no-repeat; */
|
|
||||||
background-size: 100%;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-color: #f0f2f5;
|
|
||||||
width: 750rpx;
|
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
$show-lines: 1;
|
.container {
|
||||||
@import '@/uni_modules/uv-ui-tools/libs/css/variable.scss';
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.waterfall-item {
|
.header {
|
||||||
overflow: hidden;
|
padding: 30rpx;
|
||||||
margin-top: 10px;
|
font-size: 30rpx;
|
||||||
border-radius: 6px;
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
&__image {
|
.item {
|
||||||
background-color: #fff;
|
padding: 10rpx 20rpx;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.waterfall-item__ft {
|
&-title {
|
||||||
padding: 20rpx;
|
.text {
|
||||||
background: #fff;
|
font-weight: 700;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #111;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__title {
|
&-content {
|
||||||
margin-bottom: 10rpx;
|
padding: 20rpx 0;
|
||||||
line-height: 48rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
|
|
||||||
.value {
|
.text {
|
||||||
font-size: 32rpx;
|
line-height: 48rpx;
|
||||||
color: #303133;
|
font-size: 30rpx;
|
||||||
}
|
color: #111;
|
||||||
}
|
/* #ifndef APP-NVUE */
|
||||||
|
word-break: break-all;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__desc .value {
|
.checkout-car {
|
||||||
font-size: 28rpx;
|
width: 700rpx;
|
||||||
color: #606266;
|
left: 25rpx;
|
||||||
}
|
z-index: 9999;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: #000000;
|
||||||
|
border-radius: 100px;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
&__btn {
|
.car-selected {
|
||||||
padding: 10px 0;
|
color: #ccc;
|
||||||
}
|
display: flex;
|
||||||
}
|
align-items: center;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.user-oreder {
|
.car-total {
|
||||||
width: 720rpx;
|
display: flex;
|
||||||
margin: 20rpx auto 8rpx auto;
|
color: #ebcf00;
|
||||||
padding: 28rpx 0;
|
align-items: center;
|
||||||
border-radius: 16rpx;
|
padding-left: 40rpx;
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
.web-cell-content {
|
.save-btn {
|
||||||
display: flex;
|
}
|
||||||
flex-direction: column;
|
}
|
||||||
justify-content: center;
|
}
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.web-text-center {
|
.gap {
|
||||||
text-align: center;
|
padding: 0 30rpx;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
.goods-desc {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-price {
|
||||||
|
color: #ff0000;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop-bar {
|
||||||
|
width: 680rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: auto;
|
||||||
|
position: absolute;
|
||||||
|
top: 189rpx;
|
||||||
|
left: 35rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 12rpx 12rpx 0 0;
|
||||||
|
|
||||||
|
.shop-info {
|
||||||
|
height: 160rpx;
|
||||||
|
|
||||||
|
.shop-name-box {
|
||||||
|
.shop-name {
|
||||||
|
font-size: 46rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//.shop-bar{
|
||||||
|
// background-color: #FFFFFF;
|
||||||
|
// width: 600rpx;
|
||||||
|
// height: 160rpx;
|
||||||
|
// margin: auto;
|
||||||
|
// position: absolute;
|
||||||
|
// top: 0rpx;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
.minus {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
border: 1px solid #E6E6E6 !important;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plus {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
background-color: #FF0000;
|
||||||
|
border-radius: 50%;
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
+197
-177
@@ -1,140 +1,155 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page">
|
<layout class="page" @done="onLayout">
|
||||||
<!-- 顶部距离 -->
|
<!-- 顶部距离 -->
|
||||||
<view class="header" :style="'margin-top: ' + statusBarHeight + 'px'"></view>
|
<view class="header" :style="'margin-top: ' + statusBarHeight + 'px'"></view>
|
||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<ws-user-card :data="userInfo" :users="users" :is-login="isLogin" @openLogin="openLogin" @done="reload" />
|
<ws-user-card :data="userInfo" :users="users" :is-login="isLogin" @openLogin="openLogin" @done="reload"/>
|
||||||
<block v-if="hideTools">
|
<block v-if="hideTools">
|
||||||
<uni-card :border="false" :padding="'18px 8px'">
|
<uni-card :border="false" :padding="'18px 8px'">
|
||||||
<uv-skeleton rows="2" :loading="hideTools" :title="false"></uv-skeleton>
|
<uv-skeleton rows="2" :loading="hideTools" :title="false"></uv-skeleton>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
<uni-card :border="false" :padding="'18px 8px'">
|
<uni-card :border="false" :padding="'18px 8px'">
|
||||||
<uv-skeleton rows="9" :loading="hideTools" :title="false"></uv-skeleton>
|
<uv-skeleton rows="9" :loading="hideTools" :title="false"></uv-skeleton>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
</block>
|
</block>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<!-- 收藏|关注|足迹|作品 -->
|
<!-- 收藏|关注|足迹|作品 -->
|
||||||
<!-- <ws-user-collect></ws-user-collect> -->
|
<!-- <ws-user-collect></ws-user-collect> -->
|
||||||
<!-- 我的资产 -->
|
<!-- 我的资产 -->
|
||||||
<ws-my-asset :data="users" :is-login="isLogin" @done="openLogin"></ws-my-asset>
|
<ws-my-asset :data="users" :is-login="isLogin" @done="openLogin"></ws-my-asset>
|
||||||
<!-- 我的订单 -->
|
<!-- 我的订单 -->
|
||||||
<!-- <ws-user-order :order="order" :is-login="isLogin" @done="openLogin"></ws-user-order> -->
|
<!-- <ws-user-order :order="order" :is-login="isLogin" @done="openLogin"></ws-user-order> -->
|
||||||
<!-- 其他功能 -->
|
<!-- 其他功能 -->
|
||||||
<uni-card :border="false" :padding="0">
|
<uni-card :border="false" :padding="0">
|
||||||
<!-- 场馆管理可见-->
|
<!-- 场馆管理可见-->
|
||||||
<block v-if="hasMerchantRole || hasMerchantClerkRole">
|
<block v-if="hasMerchantRole || hasMerchantClerkRole">
|
||||||
<view class="server" style="min-height: 200px">
|
<view class="server" style="min-height: 200px">
|
||||||
<uni-list :border="false">
|
<uni-list :border="false">
|
||||||
<block v-for="(item, index) in server" :key="index">
|
<block v-for="(item, index) in mpMenus" :key="index">
|
||||||
<uni-list-item :thumb="item.icon" link @click="navTo(item)">
|
<block v-if="index === '1981'" v-for="(v,i) in item">
|
||||||
<template v-slot:body>
|
<uni-list-item :thumb="v.avatar" link @click="navTo(item)">
|
||||||
<view class="slot-box">
|
<template v-slot:body>
|
||||||
<text class="slot-text" :style="{ color: item.color ? item.color : '#333333' }">{{ item.title }}</text>
|
<view class="slot-box">
|
||||||
</view>
|
<text class="slot-text" :style="{ color: v.color ? v.color : '#333333' }">{{
|
||||||
</template>
|
v.title
|
||||||
</uni-list-item>
|
}}
|
||||||
</block>
|
</text>
|
||||||
</uni-list>
|
</view>
|
||||||
</view>
|
</template>
|
||||||
</block>
|
</uni-list-item>
|
||||||
<block v-else>
|
</block>
|
||||||
<!-- 普通会员菜单 -->
|
</block>
|
||||||
<view class="server" style="min-height: 200px">
|
</uni-list>
|
||||||
<uni-list :border="false">
|
</view>
|
||||||
<block v-for="(item, index) in server" :key="index">
|
</block>
|
||||||
<uni-list-item :thumb="item.icon" link @click="navTo(item)">
|
<block v-else>
|
||||||
<template v-slot:body>
|
<!-- 普通会员菜单 -->
|
||||||
<view class="slot-box">
|
<view class="server" style="min-height: 200px">
|
||||||
<text class="slot-text" :style="{ color: item.color ? item.color : '#333333' }">{{ item.title }}</text>
|
<uni-list :border="false">
|
||||||
</view>
|
<block v-for="(item, index) in mpMenus" :key="index">
|
||||||
</template>
|
<block v-if="index === '1981'" v-for="(v,i) in item">
|
||||||
</uni-list-item>
|
<uni-list-item :thumb="item.avatar" link @click="navTo(item)">
|
||||||
</block>
|
<template v-slot:body>
|
||||||
</uni-list>
|
<view class="slot-box">
|
||||||
</view>
|
<text class="slot-text" :style="{ color: item.color ? item.color : '#333333' }">{{
|
||||||
</block>
|
v.title
|
||||||
</uni-card>
|
}}
|
||||||
<!-- <ws-personal :form="users" ref="personal" @done="reload" />-->
|
</text>
|
||||||
<!-- 登录组件 -->
|
</view>
|
||||||
<ws-login ref="login" :logo="logo" @done="reload" />
|
</template>
|
||||||
<!-- 退出按钮 -->
|
</uni-list-item>
|
||||||
<ws-logout v-if="isLogin" @done="reload"></ws-logout>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</uni-list>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</uni-card>
|
||||||
|
|
||||||
|
<!-- <ws-personal :form="users" ref="personal" @done="reload" />-->
|
||||||
|
<!-- 登录组件 -->
|
||||||
|
<ws-login ref="login" :logo="logo" @done="reload"/>
|
||||||
|
<!-- 退出按钮 -->
|
||||||
|
<ws-logout v-if="isLogin" @done="reload"></ws-logout>
|
||||||
|
</block>
|
||||||
|
</layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { useUserStore } from '@/store/modules/user';
|
import {useUserStore} from '@/store/modules/user';
|
||||||
import * as UserApi from '@/api/booking/users';
|
import * as UserApi from '@/api/booking/users';
|
||||||
import * as MpMenuApi from '@/api/cms/mp-menu/index';
|
import * as MpMenuApi from '@/api/cms/mp-menu/index';
|
||||||
import * as UserCardApi from '@/api/booking/userCard';
|
import * as UserCardApi from '@/api/booking/userCard';
|
||||||
import { updateUsers } from '@/api/shop/users';
|
import {updateUsers} from '@/api/shop/users';
|
||||||
import { openUrl } from '@/utils/common';
|
import {openUrl} from '@/utils/common';
|
||||||
import { getWxOpenId } from '@/api/passport/login';
|
import {getWxOpenId} from '@/api/passport/login';
|
||||||
|
import Layout from "@/components/layout.vue";
|
||||||
|
|
||||||
import { useTenantStore } from '@/store/modules/tenant';
|
import {useTenantStore} from '@/store/modules/tenant';
|
||||||
|
|
||||||
const tenantStore = useTenantStore();
|
const tenantStore = useTenantStore();
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
components: {Layout},
|
||||||
return {
|
data() {
|
||||||
statusBarHeight: 104,
|
return {
|
||||||
isLogin: false,
|
statusBarHeight: 104,
|
||||||
userInfo: {},
|
isLogin: false,
|
||||||
fields: {},
|
userInfo: {},
|
||||||
logo: '',
|
fields: {},
|
||||||
bookingUser: {},
|
logo: '',
|
||||||
merchantList: [],
|
bookingUser: {},
|
||||||
server: [],
|
merchantList: [],
|
||||||
order: [],
|
server: [],
|
||||||
|
mpMenus: [],
|
||||||
|
ads: [],
|
||||||
|
order: [],
|
||||||
users: {},
|
users: {},
|
||||||
hideTools: true,
|
hideTools: true,
|
||||||
// 是否拥有场馆管理员权限
|
// 是否拥有场馆管理员权限
|
||||||
hasMerchantRole: false,
|
hasMerchantRole: false,
|
||||||
// 是否拥有场馆职员权限
|
// 是否拥有场馆职员权限
|
||||||
hasMerchantClerkRole: false,
|
hasMerchantClerkRole: false,
|
||||||
// 是否拥有超级管理员权限
|
// 是否拥有超级管理员权限
|
||||||
hasSuperAdminRole: false
|
hasSuperAdminRole: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.reload();
|
this.reload();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async reload(e) {
|
async reload(e) {
|
||||||
const app = this;
|
const app = this;
|
||||||
// 获取系统信息
|
// 获取系统信息
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
success(data) {
|
success(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
app.statusBarHeight = data.statusBarHeight + 50;
|
app.statusBarHeight = data.statusBarHeight + 50;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 当前租户信息
|
// 当前租户信息
|
||||||
const tenantInfo = await tenantStore.fetchTenantInfo();
|
const tenantInfo = await tenantStore.fetchTenantInfo();
|
||||||
app.logo = tenantInfo.websiteLogo;
|
app.logo = tenantInfo.websiteLogo;
|
||||||
if (tenantInfo.fields) {
|
if (tenantInfo.fields) {
|
||||||
tenantInfo.fields.map((d) => {
|
tenantInfo.fields.map((d) => {
|
||||||
const key = d.name;
|
const key = d.name;
|
||||||
app.fields[key] = d.value;
|
app.fields[key] = d.value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前登录用户信息
|
// 当前登录用户信息
|
||||||
const userInfo = await userStore.fetchUserInfo();
|
const userInfo = await userStore.fetchUserInfo();
|
||||||
if (Object.keys(userInfo).length > 0) {
|
if (Object.keys(userInfo).length > 0) {
|
||||||
app.isLogin = true;
|
app.isLogin = true;
|
||||||
app.userInfo = userInfo;
|
app.userInfo = userInfo;
|
||||||
uni.setStorageSync('user_id', app.userInfo.userId);
|
uni.setStorageSync('user_id', app.userInfo.userId);
|
||||||
|
|
||||||
// 判断用户角色
|
// 判断用户角色
|
||||||
app.hasMerchantRole = userInfo.roles.find((d) => d.roleCode === 'merchant');
|
app.hasMerchantRole = userInfo.roles.find((d) => d.roleCode === 'merchant');
|
||||||
app.hasMerchantClerkRole = userInfo.roles.find((d) => d.roleCode === 'merchantClerk');
|
app.hasMerchantClerkRole = userInfo.roles.find((d) => d.roleCode === 'merchantClerk');
|
||||||
app.hasSuperAdminRole = userInfo.roles.find((d) => d.roleCode === 'superAdmin');
|
app.hasSuperAdminRole = userInfo.roles.find((d) => d.roleCode === 'superAdmin');
|
||||||
|
|
||||||
// 获取用户副表信息
|
// 获取用户副表信息
|
||||||
UserApi.getByPhone({
|
UserApi.getByPhone({
|
||||||
@@ -142,16 +157,16 @@ export default {
|
|||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
app.users = data;
|
app.users = data;
|
||||||
uni.setStorageSync('uid',data.id);
|
uni.setStorageSync('uid', data.id);
|
||||||
app.userInfo = Object.assign({}, app.userInfo, data);
|
app.userInfo = Object.assign({}, app.userInfo, data);
|
||||||
if(!data.openId){
|
if (!data.openId) {
|
||||||
data.openId = app.userInfo.openid
|
data.openId = app.userInfo.openid
|
||||||
updateUsers(data);
|
updateUsers(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(!uni.getStorageSync('openid')){
|
if (!uni.getStorageSync('openid')) {
|
||||||
// 更新openid
|
// 更新openid
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
uni.login({
|
uni.login({
|
||||||
@@ -159,7 +174,7 @@ export default {
|
|||||||
getWxOpenId({
|
getWxOpenId({
|
||||||
code: res.code
|
code: res.code
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
uni.setStorageSync('openid',response.openid);
|
uni.setStorageSync('openid', response.openid);
|
||||||
updateUsers({
|
updateUsers({
|
||||||
id: uni.getStorageSync('uid'),
|
id: uni.getStorageSync('uid'),
|
||||||
openId: response.openid,
|
openId: response.openid,
|
||||||
@@ -172,64 +187,69 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
app.isLogin = false;
|
app.isLogin = false;
|
||||||
app.userInfo = {};
|
app.userInfo = {};
|
||||||
}
|
}
|
||||||
// 菜单数据
|
// 菜单数据
|
||||||
MpMenuApi.pageMpMenu({ type: 0, limit: 100 })
|
MpMenuApi.pageMpMenu({type: 0, limit: 100})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
app.order = res.list.filter((d) => d.rows == 0);
|
app.order = res.list.filter((d) => d.rows == 0);
|
||||||
app.server = res.list.filter((d) => d.rows == 1);
|
app.server = res.list.filter((d) => d.rows == 1);
|
||||||
// console.log('app.hasMerchantRole: ',app.hasMerchantRole);
|
// console.log('app.hasMerchantRole: ',app.hasMerchantRole);
|
||||||
// console.log('app.hasMerchantClerkRole: ',app.hasMerchantClerkRole);
|
// console.log('app.hasMerchantClerkRole: ',app.hasMerchantClerkRole);
|
||||||
// console.log('app.hasSuperAdminRole: ',app.hasSuperAdminRole);
|
// console.log('app.hasSuperAdminRole: ',app.hasSuperAdminRole);
|
||||||
if(!app.hasMerchantRole && !app.hasMerchantClerkRole){
|
if (!app.hasMerchantRole && !app.hasMerchantClerkRole) {
|
||||||
// console.log('11111: ',11111);
|
// console.log('11111: ',11111);
|
||||||
app.server = res.list.filter((d) => d.rows == 1 && d.adminShow == 0);
|
app.server = res.list.filter((d) => d.rows == 1 && d.adminShow == 0);
|
||||||
}
|
}
|
||||||
app.hideTools = false;
|
app.hideTools = false;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请检查您的网络.',
|
title: '请检查您的网络.',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
app.hideTools = false;
|
app.hideTools = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
UserCardApi.pageUserCard({payStatus:1, userId: uni.getStorageSync('user_id')}).then(res => {
|
UserCardApi.pageUserCard({payStatus: 1, userId: uni.getStorageSync('user_id')}).then(res => {
|
||||||
console.log('res8888889: ',res);
|
console.log('res8888889: ', res);
|
||||||
app.userInfo.cards = res.count
|
app.userInfo.cards = res.count
|
||||||
app.userInfo.coupon = 1;
|
app.userInfo.coupon = 1;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
navTo(item) {
|
navTo(item) {
|
||||||
if (!this.isLogin) {
|
if (!this.isLogin) {
|
||||||
this.$refs.login.open('bottom');
|
this.$refs.login.open('bottom');
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
openUrl(item);
|
openUrl(item);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 弹出登录提示框
|
onLayout({mpMenus, ads}) {
|
||||||
openLogin() {
|
this.mpMenus = mpMenus;
|
||||||
if (!this.isLogin) {
|
this.ads = ads;
|
||||||
this.$refs.login.open('bottom');
|
this.hideTools = false;
|
||||||
return false;
|
},
|
||||||
}
|
// 弹出登录提示框
|
||||||
}
|
openLogin() {
|
||||||
}
|
if (!this.isLogin) {
|
||||||
|
this.$refs.login.open('bottom');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
background: url('https://oss.wsdns.cn/20240502/75fc744657544a38a32f83a825688286.png') no-repeat;
|
background: url('https://oss.wsdns.cn/20240502/75fc744657544a38a32f83a825688286.png') no-repeat;
|
||||||
background-size: 100%;
|
background-size: 100%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-color: #f0f2f5;
|
background-color: #f0f2f5;
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss"></style>
|
<style lang="scss"></style>
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
/**
|
||||||
|
* 购物车 store
|
||||||
|
*/
|
||||||
|
import { defineStore } from 'pinia';
|
||||||
|
import type { Order } from '@/api/shop/order/model';
|
||||||
|
import type { OrderInfo } from '@/api/shop/orderInfo/model';
|
||||||
|
import type { UserAddress } from '@/api/shop/userAddress/model';
|
||||||
|
import type { Goods } from '@/api/shop/goods/model';
|
||||||
|
import type { Merchant } from '@/api/shop/merchant/model';
|
||||||
|
import type { Period } from '@/api/booking/period/model'
|
||||||
|
|
||||||
|
export interface CarState {
|
||||||
|
merchantId: Number | null;
|
||||||
|
merchantName: String | null;
|
||||||
|
merchantCode: Number | null;
|
||||||
|
sid: String | null;
|
||||||
|
merchant: Merchant | null;
|
||||||
|
order: Order | null;
|
||||||
|
orderInfo: OrderInfo[] | null;
|
||||||
|
goodsList: Goods[] | null;
|
||||||
|
totalPrice: Number | null;
|
||||||
|
childrenPrice: Number | null;
|
||||||
|
payPrice: Number | null;
|
||||||
|
period: Period | null;
|
||||||
|
carNum: Number | null;
|
||||||
|
carNum2: Number | null;
|
||||||
|
isNew?: Boolean | null;
|
||||||
|
type: Number | null;
|
||||||
|
dateTime: String | null;
|
||||||
|
address: UserAddress | null;
|
||||||
|
isLogin?: Boolean | false;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useCartStore = defineStore({
|
||||||
|
id: 'car',
|
||||||
|
state: (): CarState => ({
|
||||||
|
// 场馆ID
|
||||||
|
merchantId: null,
|
||||||
|
// 场馆名称
|
||||||
|
merchantName: null,
|
||||||
|
// 场馆编号
|
||||||
|
merchantCode: null,
|
||||||
|
// 场馆编号
|
||||||
|
sid: null,
|
||||||
|
// 场馆信息
|
||||||
|
merchant: null,
|
||||||
|
// 订单信息
|
||||||
|
order: null,
|
||||||
|
// 场地信息
|
||||||
|
orderInfo: [],
|
||||||
|
// 预定时段
|
||||||
|
period: null,
|
||||||
|
// 订单总金额
|
||||||
|
totalPrice: null,
|
||||||
|
// 实付金额
|
||||||
|
payPrice: null,
|
||||||
|
// 儿童票价
|
||||||
|
childrenPrice: null,
|
||||||
|
// 购物车数量
|
||||||
|
carNum: null,
|
||||||
|
// 儿童票数量
|
||||||
|
carNum2: null,
|
||||||
|
// 是否立即购买
|
||||||
|
isNew: null,
|
||||||
|
// 1全场 2半场
|
||||||
|
type: null,
|
||||||
|
// 下单日期
|
||||||
|
dateTime: null,
|
||||||
|
// 商品信息
|
||||||
|
goodsList: [],
|
||||||
|
// 用户收货地址
|
||||||
|
address: null,
|
||||||
|
// 是否登录
|
||||||
|
isLogin: false
|
||||||
|
}),
|
||||||
|
getters: {},
|
||||||
|
actions: {
|
||||||
|
/**
|
||||||
|
* 添加购物车
|
||||||
|
*/
|
||||||
|
AddCar(value: OrderInfo) {
|
||||||
|
this.orderInfo?.push(value);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 移除购物车
|
||||||
|
*/
|
||||||
|
DelCard(value: OrderInfo) {
|
||||||
|
const index = this.orderInfo?.findIndex((d) => d.fid == value.fid);
|
||||||
|
if(index){
|
||||||
|
this.orderInfo?.splice(index, 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setOrder(value: Order){
|
||||||
|
this.order = value
|
||||||
|
},
|
||||||
|
setMerchant(value: Merchant){
|
||||||
|
this.merchant = value
|
||||||
|
},
|
||||||
|
setGoodsList(value: Goods[]) {
|
||||||
|
this.goodsList = value;
|
||||||
|
},
|
||||||
|
setOrderInfo(value: OrderInfo[]) {
|
||||||
|
this.orderInfo = value;
|
||||||
|
},
|
||||||
|
setAddress(value: UserAddress) {
|
||||||
|
this.address = value;
|
||||||
|
},
|
||||||
|
setPeriod(value: Period){
|
||||||
|
this.period = value
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* 小程序信息 store
|
||||||
|
*/
|
||||||
|
import {defineStore} from 'pinia';
|
||||||
|
import {getMpInfo} from '@/api/layout';
|
||||||
|
import type {MpInfo} from "@/api/cms/mp/model";
|
||||||
|
|
||||||
|
export interface UserState {
|
||||||
|
mpInfo: MpInfo | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useMpStore = defineStore({
|
||||||
|
id: 'mp',
|
||||||
|
state: (): UserState => ({
|
||||||
|
// 小程序
|
||||||
|
mpInfo: null,
|
||||||
|
}),
|
||||||
|
getters: {},
|
||||||
|
actions: {
|
||||||
|
/**
|
||||||
|
* 请求用户信息、权限、角色、菜单
|
||||||
|
*/
|
||||||
|
async fetchMpInfo() {
|
||||||
|
const info = await getMpInfo().catch(() => void 0);
|
||||||
|
if (!info) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
// 租户信息
|
||||||
|
this.mpInfo = info;
|
||||||
|
return info;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 更新租户信息
|
||||||
|
*/
|
||||||
|
setInfo(value: MpInfo) {
|
||||||
|
this.mpInfo = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
* 登录用户 store
|
* 登录用户 store
|
||||||
*/
|
*/
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import type { User } from '@/uni_modules/ws-common/api/system/user/model';
|
import type { User } from '@/api/system/user/model';
|
||||||
import { getUserInfo } from '@/uni_modules/ws-common/api/layout';
|
import { getUserInfo } from '@/api/layout';
|
||||||
|
|
||||||
export interface UserState {
|
export interface UserState {
|
||||||
info: User | null;
|
info: User | null;
|
||||||
@@ -45,7 +45,7 @@ export const useUserStore = defineStore({
|
|||||||
this.roles = result.roles?.map((d) => d.roleCode) ?? [];
|
this.roles = result.roles?.map((d) => d.roleCode) ?? [];
|
||||||
// 用户菜单, 过滤掉按钮类型并转为 children 形式
|
// 用户菜单, 过滤掉按钮类型并转为 children 形式
|
||||||
this.menus = [];
|
this.menus = [];
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,117 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Ad, AdParam } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询广告位
|
|
||||||
*/
|
|
||||||
export async function pageAd(params: AdParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Ad>>>('/cms/ad/page', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询广告位列表
|
|
||||||
*/
|
|
||||||
export async function listAd(params?: AdParam) {
|
|
||||||
const res = await request.get<ApiResult<Ad[]>>('/cms/ad', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加广告位
|
|
||||||
*/
|
|
||||||
export async function addAd(data: Ad) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/cms/ad', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改广告位
|
|
||||||
*/
|
|
||||||
export async function updateAd(data: Ad) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/cms/ad', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除广告位
|
|
||||||
*/
|
|
||||||
export async function removeAd(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/cms/ad/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除广告位
|
|
||||||
*/
|
|
||||||
export async function removeBatchAd(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/cms/ad/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户状态
|
|
||||||
*/
|
|
||||||
export async function updateAdStatus(adId?: number, status?: number) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/cms/ad/status', {
|
|
||||||
adId,
|
|
||||||
status
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询广告位
|
|
||||||
*/
|
|
||||||
export async function getAd(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Ad>>('/cms/ad/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/cms/ad/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告位
|
|
||||||
*/
|
|
||||||
export interface Ad {
|
|
||||||
// 广告位id
|
|
||||||
adId?: number;
|
|
||||||
// 广告位名称
|
|
||||||
adType?: string;
|
|
||||||
// 类型
|
|
||||||
type?: string;
|
|
||||||
// 宽
|
|
||||||
width?: string;
|
|
||||||
// 高
|
|
||||||
height?: string;
|
|
||||||
// 附件
|
|
||||||
images?: string;
|
|
||||||
// 用户ID
|
|
||||||
userId?: number;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 更新时间
|
|
||||||
updateTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告位搜索条件
|
|
||||||
*/
|
|
||||||
export interface AdParam extends PageParam {
|
|
||||||
adId?: string;
|
|
||||||
name?: number;
|
|
||||||
type?: number;
|
|
||||||
userId?: number;
|
|
||||||
}
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Article, ArticleParam } from './model';
|
|
||||||
// const merchantCode = localStorage.getItem('merchantCode');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询文章
|
|
||||||
*/
|
|
||||||
export async function pageArticle(params: ArticleParam) {
|
|
||||||
// // 按商户筛选
|
|
||||||
// if (merchantCode != 'null') {
|
|
||||||
// params.merchantCode = `${merchantCode}`;
|
|
||||||
// }
|
|
||||||
const res = await request.get<ApiResult<PageResult<Article>>>(
|
|
||||||
'/cms/article/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文章列表
|
|
||||||
*/
|
|
||||||
export async function listArticle(params?: ArticleParam) {
|
|
||||||
const res = await request.get<ApiResult<Article[]>>('/cms/article', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加文章
|
|
||||||
*/
|
|
||||||
export async function addArticle(data: Article) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/cms/article', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文章
|
|
||||||
*/
|
|
||||||
export async function updateArticle(data: Article) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/cms/article', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文章
|
|
||||||
*/
|
|
||||||
export async function removeArticle(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/cms/article/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除文章
|
|
||||||
*/
|
|
||||||
export async function removeBatchArticle(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/cms/article/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户状态
|
|
||||||
*/
|
|
||||||
export async function updateArticleStatus(articleId?: number, status?: number) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/cms/article/status', {
|
|
||||||
articleId,
|
|
||||||
status
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询文章
|
|
||||||
*/
|
|
||||||
export async function getArticle(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Article>>('/cms/article/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/cms/article/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章
|
|
||||||
*/
|
|
||||||
export interface Article {
|
|
||||||
// 文章id
|
|
||||||
articleId?: number;
|
|
||||||
// 文章标题
|
|
||||||
title?: string;
|
|
||||||
// 展现方式
|
|
||||||
showType?: number;
|
|
||||||
// 文章类型
|
|
||||||
categoryId?: number;
|
|
||||||
// 封面图
|
|
||||||
image?: string;
|
|
||||||
// 附件
|
|
||||||
files?: string;
|
|
||||||
// 缩列图
|
|
||||||
thumbnail?: string;
|
|
||||||
// 视频地址
|
|
||||||
video?: string;
|
|
||||||
// 上传的文件类型
|
|
||||||
accept?: string;
|
|
||||||
// 来源
|
|
||||||
source?: string;
|
|
||||||
// 文章内容
|
|
||||||
content?: string;
|
|
||||||
// 虚拟阅读量
|
|
||||||
virtualViews?: string;
|
|
||||||
// 实际阅读量
|
|
||||||
actualViews?: string;
|
|
||||||
// 用户ID
|
|
||||||
userId?: number;
|
|
||||||
// 用户昵称
|
|
||||||
nickname?: string;
|
|
||||||
// 账号
|
|
||||||
username?: string;
|
|
||||||
// 用户头像
|
|
||||||
userAvatar?: string;
|
|
||||||
// 所属门店ID
|
|
||||||
shopId?: string;
|
|
||||||
//
|
|
||||||
likes?: number;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 更新时间
|
|
||||||
updateTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章搜索条件
|
|
||||||
*/
|
|
||||||
export interface ArticleParam extends PageParam {
|
|
||||||
title?: string;
|
|
||||||
articleId?: number;
|
|
||||||
categoryId?: string;
|
|
||||||
status?: string;
|
|
||||||
sortNumber?: string;
|
|
||||||
createTime?: string;
|
|
||||||
username?: string;
|
|
||||||
nickname?: string;
|
|
||||||
userId?: number;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { ArticleCategory, ArticleCategoryParam } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询文章分类
|
|
||||||
*/
|
|
||||||
export async function pageArticleCategory(params: ArticleCategoryParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<ArticleCategory>>>(
|
|
||||||
'/cms/article-category/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文章分类列表
|
|
||||||
*/
|
|
||||||
export async function listArticleCategory(params?: ArticleCategoryParam) {
|
|
||||||
const res = await request.get<ApiResult<ArticleCategory[]>>(
|
|
||||||
'/cms/article-category',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加文章分类
|
|
||||||
*/
|
|
||||||
export async function addArticleCategory(data: ArticleCategory) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
|
||||||
'/cms/article-category',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文章分类
|
|
||||||
*/
|
|
||||||
export async function updateArticleCategory(data: ArticleCategory) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
|
||||||
'/cms/article-category',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文章分类
|
|
||||||
*/
|
|
||||||
export async function removeArticleCategory(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/cms/article-category/' + id
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除文章分类
|
|
||||||
*/
|
|
||||||
export async function removeBatchArticleCategory(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/cms/article-category/batch',
|
|
||||||
{
|
|
||||||
data
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
|
||||||
'/cms/article-category/existence',
|
|
||||||
{
|
|
||||||
params: { field, value, id }
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章分类
|
|
||||||
*/
|
|
||||||
export interface ArticleCategory {
|
|
||||||
// 文章分类id
|
|
||||||
categoryId?: number;
|
|
||||||
// 文章分类
|
|
||||||
title?: string;
|
|
||||||
// 文章分类图片
|
|
||||||
image?: string;
|
|
||||||
// 上级分类
|
|
||||||
parentId?: number;
|
|
||||||
// 封面图
|
|
||||||
avatar?: string;
|
|
||||||
// 用户ID
|
|
||||||
userId?: string;
|
|
||||||
// 所属门店ID
|
|
||||||
shopId?: string;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 更新时间
|
|
||||||
updateTime?: string;
|
|
||||||
//
|
|
||||||
key?: number;
|
|
||||||
//
|
|
||||||
value?: number;
|
|
||||||
// 子菜单
|
|
||||||
children?: ArticleCategory[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章分类搜索条件
|
|
||||||
*/
|
|
||||||
export interface ArticleCategoryParam extends PageParam {
|
|
||||||
title?: string;
|
|
||||||
categoryId?: string;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { DocsContent, DocsContentParam } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询文档
|
|
||||||
*/
|
|
||||||
export async function pageDocsContent(params: DocsContentParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<DocsContent>>>(
|
|
||||||
'/cms/docs-content/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文档列表
|
|
||||||
*/
|
|
||||||
export async function listDocsContent(params?: DocsContentParam) {
|
|
||||||
const res = await request.get<ApiResult<DocsContent[]>>('/cms/docs-content', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加文档
|
|
||||||
*/
|
|
||||||
export async function addDocsContent(data: DocsContent) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/cms/docs-content', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文档
|
|
||||||
*/
|
|
||||||
export async function updateDocsContent(data: DocsContent) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
|
||||||
'/cms/docs-content',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文档
|
|
||||||
*/
|
|
||||||
export async function removeDocsContent(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/cms/docs-content/' + id
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除文档
|
|
||||||
*/
|
|
||||||
export async function removeBatchDocsContent(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/cms/docs-content/batch',
|
|
||||||
{
|
|
||||||
data
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户状态
|
|
||||||
*/
|
|
||||||
export async function updateDocsContentStatus(
|
|
||||||
docsId?: number,
|
|
||||||
status?: number
|
|
||||||
) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/cms/docs-content/status', {
|
|
||||||
docsId,
|
|
||||||
status
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询文档
|
|
||||||
*/
|
|
||||||
export async function getDocsContent(id: number) {
|
|
||||||
const res = await request.get<ApiResult<DocsContent>>(
|
|
||||||
'/cms/docs-content/' + id
|
|
||||||
);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
|
||||||
'/cms/docs-content/existence',
|
|
||||||
{
|
|
||||||
params: { field, value, id }
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文档内容
|
|
||||||
*/
|
|
||||||
export interface DocsContent {
|
|
||||||
// 自增ID
|
|
||||||
docsContentId?: number;
|
|
||||||
// 文档内容id
|
|
||||||
docsId?: number;
|
|
||||||
// 文档内容
|
|
||||||
content?: string;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 更新时间
|
|
||||||
updateTime?: string;
|
|
||||||
//
|
|
||||||
key?: number;
|
|
||||||
//
|
|
||||||
value?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文档内容搜索条件
|
|
||||||
*/
|
|
||||||
export interface DocsContentParam extends PageParam {
|
|
||||||
docsId?: number;
|
|
||||||
content?: string;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { Docs, DocsParam } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询文档
|
|
||||||
*/
|
|
||||||
export async function pageDocs(params: DocsParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<Docs>>>('/cms/docs/page', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询文档列表
|
|
||||||
*/
|
|
||||||
export async function listDocs(params?: DocsParam) {
|
|
||||||
const res = await request.get<ApiResult<Docs[]>>('/cms/docs', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加文档
|
|
||||||
*/
|
|
||||||
export async function addDocs(data: Docs) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/cms/docs', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文档
|
|
||||||
*/
|
|
||||||
export async function updateDocs(data: Docs) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/cms/docs', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文档
|
|
||||||
*/
|
|
||||||
export async function removeDocs(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/cms/docs/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除文档
|
|
||||||
*/
|
|
||||||
export async function removeBatchDocs(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/cms/docs/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户状态
|
|
||||||
*/
|
|
||||||
export async function updateDocsStatus(docsId?: number, status?: number) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/cms/docs/status', {
|
|
||||||
docsId,
|
|
||||||
status
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询文档
|
|
||||||
*/
|
|
||||||
export async function getDocs(id: number) {
|
|
||||||
const res = await request.get<ApiResult<Docs>>('/cms/docs/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/cms/docs/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文档
|
|
||||||
*/
|
|
||||||
export interface Docs {
|
|
||||||
// 文档id
|
|
||||||
docsId?: number;
|
|
||||||
// 文档标题
|
|
||||||
title?: string;
|
|
||||||
// 文档类型 0目录 1文档
|
|
||||||
type?: number;
|
|
||||||
// 展现方式
|
|
||||||
showType?: number;
|
|
||||||
// 文档类型
|
|
||||||
categoryId?: number;
|
|
||||||
// 上级分类
|
|
||||||
parentId?: number;
|
|
||||||
// 封面图
|
|
||||||
avatar?: string;
|
|
||||||
// 来源
|
|
||||||
source?: string;
|
|
||||||
// 文档内容
|
|
||||||
content?: string;
|
|
||||||
// 虚拟阅读量
|
|
||||||
virtualViews?: string;
|
|
||||||
// 实际阅读量
|
|
||||||
actualViews?: string;
|
|
||||||
// 用户ID
|
|
||||||
userId?: string;
|
|
||||||
// 用户昵称
|
|
||||||
nickname?: string;
|
|
||||||
// 账号
|
|
||||||
username?: string;
|
|
||||||
// 用户头像
|
|
||||||
userAvatar?: string;
|
|
||||||
// 所属门店ID
|
|
||||||
shopId?: string;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 更新时间
|
|
||||||
updateTime?: string;
|
|
||||||
//
|
|
||||||
key?: number;
|
|
||||||
//
|
|
||||||
value?: number;
|
|
||||||
//
|
|
||||||
docsContentId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文档搜索条件
|
|
||||||
*/
|
|
||||||
export interface DocsParam extends PageParam {
|
|
||||||
title?: string;
|
|
||||||
docsId?: number;
|
|
||||||
categoryId?: string;
|
|
||||||
status?: string;
|
|
||||||
sortNumber?: string;
|
|
||||||
createTime?: string;
|
|
||||||
username?: string;
|
|
||||||
nickname?: string;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
/**
|
|
||||||
* 接口统一返回结果
|
|
||||||
*/
|
|
||||||
export interface ApiResult<T> {
|
|
||||||
// 状态码
|
|
||||||
code: number;
|
|
||||||
// 状态信息
|
|
||||||
message?: string;
|
|
||||||
// 返回数据
|
|
||||||
data?: T;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询统一结果
|
|
||||||
*/
|
|
||||||
export interface PageResult<T> {
|
|
||||||
// 返回数据
|
|
||||||
list: T[];
|
|
||||||
// 总数量
|
|
||||||
count: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询基本参数
|
|
||||||
*/
|
|
||||||
export interface PageParam {
|
|
||||||
// 第几页
|
|
||||||
page?: number;
|
|
||||||
// 每页多少条
|
|
||||||
limit?: number;
|
|
||||||
// 排序字段
|
|
||||||
sort?: string;
|
|
||||||
// 排序方式, asc升序, desc降序
|
|
||||||
order?: string;
|
|
||||||
// 租户ID
|
|
||||||
tenantId?: number;
|
|
||||||
// 搜素关键词
|
|
||||||
keywords?: string;
|
|
||||||
createTimeStart?: string;
|
|
||||||
createTimeEnd?: string;
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
/**
|
|
||||||
* 默认字典数据
|
|
||||||
*/
|
|
||||||
export async function getLinkType() {
|
|
||||||
return {
|
|
||||||
list: [
|
|
||||||
{ value: '0', label: '应用组件', text: '应用组件', comments: '' },
|
|
||||||
{ value: '1', label: '外部链接', text: '外部链接', comments: '' }
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// 默认字典数据
|
|
||||||
export function getJson(dictName) {
|
|
||||||
if (dictName == 'customerFollowStatus') {
|
|
||||||
return [
|
|
||||||
{ value: '1', label: '初访', text: '初访', comments: '' },
|
|
||||||
{ value: '2', label: '意向', text: '意向', comments: '' },
|
|
||||||
{ value: '3', label: '报价', text: '报价', comments: '' },
|
|
||||||
{ value: '4', label: '成交', text: '成交', comments: '' },
|
|
||||||
{ value: '5', label: '暂时搁置', text: '暂时搁置', comments: '' },
|
|
||||||
{ value: '6', label: '未成交', text: '未成交', comments: '' }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (dictName == 'customerCategory') {
|
|
||||||
return [
|
|
||||||
{ value: 'my', label: '我创建的', text: '我创建的', comments: '' },
|
|
||||||
{ value: 'stars', label: '标星客户', text: '标星客户', comments: '' },
|
|
||||||
{ value: 'join', label: '我协作的', text: '我协作的', comments: '' }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (dictName == 'orderType') {
|
|
||||||
return [
|
|
||||||
{ value: 'all', label: '全部订单', text: '全部订单', comments: '' },
|
|
||||||
{ value: 'delivery', label: '待发货', text: '待发货', comments: '' },
|
|
||||||
{ value: 'receipt', label: '待收货', text: '待收货', comments: '' },
|
|
||||||
{ value: 'pay', label: '待付款', text: '待付款', comments: '' },
|
|
||||||
{ value: 'complete', label: '已完成', text: '已完成', comments: '' },
|
|
||||||
{ value: 'cancel', label: '已取消', text: '已取消', comments: '' }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (dictName == 'customerSource') {
|
|
||||||
return [
|
|
||||||
{ value: '搜索引擎', label: '搜索引擎', text: '搜索引擎', comments: '' },
|
|
||||||
{ value: '客户介绍', label: '客户介绍', text: '客户介绍', comments: '' },
|
|
||||||
{ value: '代理商', label: '代理商', text: '代理商', comments: '' },
|
|
||||||
{ value: '社交推广', label: '社交推广', text: '社交推广', comments: '' },
|
|
||||||
{ value: '其他', label: '其他', text: '其他', comments: '' }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (dictName == 'serverBrand') {
|
|
||||||
return [
|
|
||||||
{ value: '阿里云', label: '阿里云', text: '阿里云', comments: '' },
|
|
||||||
{ value: '腾讯云', label: '腾讯云', text: '腾讯云', comments: '' },
|
|
||||||
{ value: '华为云', label: '华为云', text: '华为云', comments: '' },
|
|
||||||
{ value: '西部数码', label: '西部数码', text: '西部数码', comments: '' },
|
|
||||||
{ value: '其他', label: '其他', text: '其他', comments: '' }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (dictName == 'orderType') {
|
|
||||||
return [
|
|
||||||
{ value: 'all', label: '全部订单', text: '全部订单', comments: '' },
|
|
||||||
{ value: 'delivery', label: '待发货', text: '待发货', comments: '' },
|
|
||||||
{ value: 'receipt', label: '待收货', text: '待收货', comments: '' },
|
|
||||||
{ value: 'pay', label: '待付款', text: '待付款', comments: '' },
|
|
||||||
{ value: 'complete', label: '已完成', text: '已完成', comments: '' },
|
|
||||||
{ value: 'cancel', label: '已取消', text: '已取消', comments: '' }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (dictName == 'sex') {
|
|
||||||
return [
|
|
||||||
{ value: '1', label: '男', text: '男', comments: null },
|
|
||||||
{ value: '2', label: '女', text: '女', comments: null }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (dictName == 'payMethod') {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
value: '余额支付',
|
|
||||||
label: '余额支付',
|
|
||||||
text: '余额支付'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: '微信支付',
|
|
||||||
label: '微信支付',
|
|
||||||
text: '微信支付'
|
|
||||||
},
|
|
||||||
{ value: '支付宝', label: '支付宝', text: '支付宝' }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
import request from '@/uni_modules/ws-common/utils/request';
|
|
||||||
import type { ApiResult } from '@/uni_modules/ws-common/api';
|
|
||||||
import type { User } from '@/uni_modules/ws-common/api/system/user/model';
|
|
||||||
import type { UpdatePasswordParam, NoticeResult } from './model';
|
|
||||||
import { MODULES_API_URL, SERVER_API_URL } from '@/config/setting';
|
|
||||||
/**
|
|
||||||
* 解析token
|
|
||||||
*/
|
|
||||||
export async function parseToken(token : string) : Promise<any> {
|
|
||||||
const res = await request.get<ApiResult<any>>(
|
|
||||||
'https://server.gxwebsoft.com/api/parseToken/' + token
|
|
||||||
);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前登录的用户信息、菜单、权限、角色
|
|
||||||
*/
|
|
||||||
export async function getUserInfo() : Promise<User> {
|
|
||||||
const res = await request.get<ApiResult<User>>(SERVER_API_URL + '/auth/user');
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function loginMpWxMobile(data : User) : Promise<User> {
|
|
||||||
const res = await request.post<ApiResult<unknown>>(SERVER_API_URL + '/wx-login/loginByMpWxPhone', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改当前登录的用户密码
|
|
||||||
*/
|
|
||||||
export async function updatePassword(
|
|
||||||
data : UpdatePasswordParam
|
|
||||||
) : Promise<string> {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/auth/password', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message ?? '修改成功';
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询未读通知
|
|
||||||
*/
|
|
||||||
export async function getUnreadNotice() : Promise<NoticeResult> {
|
|
||||||
return {
|
|
||||||
notice: [
|
|
||||||
{
|
|
||||||
color: '#60B2FC',
|
|
||||||
icon: 'NotificationFilled',
|
|
||||||
title: '你收到了一封14份新周报',
|
|
||||||
time: '2020-07-27 18:30:18'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
color: '#F5686F',
|
|
||||||
icon: 'PushpinFilled',
|
|
||||||
title: '许经理同意了你的请假申请',
|
|
||||||
time: '2020-07-27 09:08:36'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
color: '#7CD734',
|
|
||||||
icon: 'VideoCameraFilled',
|
|
||||||
title: '陈总邀请你参加视频会议',
|
|
||||||
time: '2020-07-26 18:30:01'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
color: '#FAAD14',
|
|
||||||
icon: 'CarryOutFilled',
|
|
||||||
title: '你推荐的刘诗雨已通过第三轮面试',
|
|
||||||
time: '2020-07-25 16:38:46'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
color: '#2BCACD',
|
|
||||||
icon: 'BellFilled',
|
|
||||||
title: '你的6月加班奖金已发放',
|
|
||||||
time: '2020-07-25 11:03:31'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
letter: [
|
|
||||||
{
|
|
||||||
avatar:
|
|
||||||
'https://cdn.eleadmin.com/20200609/c184eef391ae48dba87e3057e70238fb.jpg',
|
|
||||||
title: 'SunSmile 评论了你的日志',
|
|
||||||
content: '写的不错, 以后多多向你学习~',
|
|
||||||
time: '2020-07-27 18:30:18'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
avatar:
|
|
||||||
'https://cdn.eleadmin.com/20200609/948344a2a77c47a7a7b332fe12ff749a.jpg',
|
|
||||||
title: '刘诗雨 点赞了你的日志',
|
|
||||||
content: '写的不错, 以后多多向你学习~',
|
|
||||||
time: '2020-07-27 09:08:36'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
avatar:
|
|
||||||
'https://cdn.eleadmin.com/20200609/2d98970a51b34b6b859339c96b240dcd.jpg',
|
|
||||||
title: '酷酷的大叔 评论了你的周报',
|
|
||||||
content: '写的不错, 以后多多向你学习~',
|
|
||||||
time: '2020-07-26 18:30:01'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
avatar:
|
|
||||||
'https://cdn.eleadmin.com/20200609/f6bc05af944a4f738b54128717952107.jpg',
|
|
||||||
title: 'Jasmine 点赞了你的周报',
|
|
||||||
content: '写的不错, 以后多多向你学习~',
|
|
||||||
time: '2020-07-25 11:03:31'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
todo: [
|
|
||||||
{
|
|
||||||
status: 0,
|
|
||||||
title: '刘诗雨的请假审批',
|
|
||||||
description: '刘诗雨在 07-27 18:30 提交的请假申请'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
status: 1,
|
|
||||||
title: '第三方代码紧急变更',
|
|
||||||
description: '需要在 2020-07-27 之前完成'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
status: 2,
|
|
||||||
title: '信息安全考试',
|
|
||||||
description: '需要在 2020-07-26 18:30 前完成'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
status: 2,
|
|
||||||
title: 'EleAdmin发布新版本',
|
|
||||||
description: '需要在 2020-07-25 11:03 前完成'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
/**
|
|
||||||
* 修改密码参数
|
|
||||||
*/
|
|
||||||
export interface UpdatePasswordParam {
|
|
||||||
// 新密码
|
|
||||||
password: string;
|
|
||||||
// 原始密码
|
|
||||||
oldPassword: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通知数据格式
|
|
||||||
*/
|
|
||||||
export interface NoticeModel {
|
|
||||||
// 图标颜色
|
|
||||||
color?: string;
|
|
||||||
// 图标
|
|
||||||
icon?: string;
|
|
||||||
// 标题
|
|
||||||
title?: string;
|
|
||||||
// 时间
|
|
||||||
time?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 私信数据格式
|
|
||||||
*/
|
|
||||||
export interface LetterModel {
|
|
||||||
// 头像
|
|
||||||
avatar?: string;
|
|
||||||
// 标题
|
|
||||||
title?: string;
|
|
||||||
// 内容
|
|
||||||
content?: string;
|
|
||||||
// 时间
|
|
||||||
time?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 代办数据格式
|
|
||||||
*/
|
|
||||||
export interface TodoModel {
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 标题
|
|
||||||
title?: string;
|
|
||||||
// 描述
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询未读通知返回结果
|
|
||||||
*/
|
|
||||||
export interface NoticeResult {
|
|
||||||
notice: NoticeModel[];
|
|
||||||
letter: LetterModel[];
|
|
||||||
todo: TodoModel[];
|
|
||||||
}
|
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { App, AppParam } from './model/index';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询应用
|
|
||||||
*/
|
|
||||||
export async function pageApp(params: AppParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<App>>>('/oa/app/page', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询应用列表
|
|
||||||
*/
|
|
||||||
export async function listApp(params?: AppParam) {
|
|
||||||
const res = await request.get<ApiResult<App[]>>('/oa/app', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询应用
|
|
||||||
*/
|
|
||||||
export async function getApp(id: number) {
|
|
||||||
const res = await request.get<ApiResult<App>>('/oa/app/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加应用
|
|
||||||
*/
|
|
||||||
export async function addApp(data: App) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/app', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改应用
|
|
||||||
*/
|
|
||||||
export async function updateApp(data: App) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/app', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除应用
|
|
||||||
*/
|
|
||||||
export async function removeApp(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除应用
|
|
||||||
*/
|
|
||||||
export async function removeBatchApp(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/app/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/oa/app/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getAppSecret(data: App) {
|
|
||||||
const res = await request.post<ApiResult<App>>(
|
|
||||||
'/open/app/getAppSecret',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function updateAppSecret(data: App) {
|
|
||||||
const res = await request.post<ApiResult<App>>(
|
|
||||||
'/oa/app/updateAppSecret',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加菜单
|
|
||||||
export async function saveMenu(data: App) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/app/saveMenu', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加菜单按钮
|
|
||||||
export async function saveAuthority(data: any[]) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
|
||||||
'/oa/app/saveAuthority',
|
|
||||||
data
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
import { AppUser } from '@/api/oa/app/user/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用
|
|
||||||
*/
|
|
||||||
export interface App {
|
|
||||||
// 应用id
|
|
||||||
appId?: number;
|
|
||||||
// 应用秘钥
|
|
||||||
appSecret?: string;
|
|
||||||
// 英文名称
|
|
||||||
enName?: string;
|
|
||||||
// 应用名称
|
|
||||||
appName?: string;
|
|
||||||
// 上级id, 0是顶级
|
|
||||||
parentId?: number;
|
|
||||||
// 应用编号
|
|
||||||
appCode?: string;
|
|
||||||
// 应用图标
|
|
||||||
appIcon?: string;
|
|
||||||
appQrcode?: string;
|
|
||||||
// 应用截图
|
|
||||||
images?: string;
|
|
||||||
// 应用类型
|
|
||||||
appType?: string;
|
|
||||||
appTypeMultiple?: string[];
|
|
||||||
// 菜单类型
|
|
||||||
menuType?: number;
|
|
||||||
// 应用地址
|
|
||||||
appUrl?: string;
|
|
||||||
// 后台管理地址
|
|
||||||
adminUrl?: string;
|
|
||||||
// 原型图地址
|
|
||||||
prototypeUrl?: string;
|
|
||||||
// 下载地址
|
|
||||||
downUrl?: string;
|
|
||||||
// 服务器接口地址
|
|
||||||
serverUrl?: string;
|
|
||||||
// 模块接口地址
|
|
||||||
modulesUrl?: string;
|
|
||||||
// 回调地址
|
|
||||||
callbackUrl?: string;
|
|
||||||
// 腾讯文档地址
|
|
||||||
gitUrl?: string;
|
|
||||||
docsUrl?: string;
|
|
||||||
ipAddress?: string;
|
|
||||||
fileUrl?: string;
|
|
||||||
// 应用包名
|
|
||||||
packageName?: string;
|
|
||||||
// 点击次数
|
|
||||||
clicks?: string;
|
|
||||||
// 安装次数
|
|
||||||
installs?: string;
|
|
||||||
// 应用介绍
|
|
||||||
content?: string;
|
|
||||||
// 开发者(个人)
|
|
||||||
developer?: string;
|
|
||||||
director?: string;
|
|
||||||
projectDirector?: string;
|
|
||||||
salesman?: string;
|
|
||||||
// 续费金额
|
|
||||||
renewMoney?: string;
|
|
||||||
// 软件定价
|
|
||||||
price?: string;
|
|
||||||
// 评分
|
|
||||||
score?: string;
|
|
||||||
// 星级
|
|
||||||
star?: string;
|
|
||||||
// 菜单组件地址
|
|
||||||
component?: string;
|
|
||||||
// 菜单路由地址
|
|
||||||
path?: string;
|
|
||||||
// 权限标识
|
|
||||||
authority?: string;
|
|
||||||
// 打开位置
|
|
||||||
target?: string;
|
|
||||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
|
||||||
hide?: number;
|
|
||||||
// 菜单侧栏选中的path
|
|
||||||
active?: string;
|
|
||||||
// 其它路由元信息
|
|
||||||
meta?: string;
|
|
||||||
// 版本
|
|
||||||
edition?: string;
|
|
||||||
// 版本号
|
|
||||||
version?: string;
|
|
||||||
// 是否已安装
|
|
||||||
isUse?: number;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: any;
|
|
||||||
tenantName?: string;
|
|
||||||
companyId?: number;
|
|
||||||
companyName?: string;
|
|
||||||
// 租户编号
|
|
||||||
tenantCode?: string;
|
|
||||||
// 租户id
|
|
||||||
tenantId?: number;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 过期时间
|
|
||||||
expirationTime?: string;
|
|
||||||
// 应用状态
|
|
||||||
appStatus?: string;
|
|
||||||
// 状态
|
|
||||||
status?: number;
|
|
||||||
// 发布者
|
|
||||||
userId?: any;
|
|
||||||
// 发布者昵称
|
|
||||||
nickname?: string;
|
|
||||||
// 子菜单
|
|
||||||
children?: App[];
|
|
||||||
// 权限树回显选中状态, 0未选中, 1选中
|
|
||||||
checked?: boolean;
|
|
||||||
//
|
|
||||||
key?: number;
|
|
||||||
//
|
|
||||||
value?: number;
|
|
||||||
//
|
|
||||||
parentIds?: number[];
|
|
||||||
//
|
|
||||||
openType?: number;
|
|
||||||
//
|
|
||||||
search?: any;
|
|
||||||
// 成员管理
|
|
||||||
users?: AppUser[];
|
|
||||||
// 项目需求
|
|
||||||
requirement?: string;
|
|
||||||
file1?: string;
|
|
||||||
file2?: string;
|
|
||||||
file3?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用搜索条件
|
|
||||||
*/
|
|
||||||
export interface AppParam extends PageParam {
|
|
||||||
userId?: number;
|
|
||||||
appName?: any;
|
|
||||||
appCode?: string;
|
|
||||||
appId?: number;
|
|
||||||
developer?: string;
|
|
||||||
tenantCode?: string;
|
|
||||||
parentId?: string;
|
|
||||||
tenantName?: string;
|
|
||||||
companyName?: string;
|
|
||||||
companyId?: number;
|
|
||||||
status?: number;
|
|
||||||
nickname?: string;
|
|
||||||
appStatus?: any;
|
|
||||||
showExpiration?: boolean;
|
|
||||||
keywords?: any;
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { AppRenew, AppRenewParam } from '@/api/oa/app/renew/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询开发成员
|
|
||||||
*/
|
|
||||||
export async function pageAppRenew(params: AppRenewParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<AppRenew>>>(
|
|
||||||
'/oa/app-renew/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询开发成员列表
|
|
||||||
*/
|
|
||||||
export async function listAppRenew(params?: AppRenewParam) {
|
|
||||||
const res = await request.get<ApiResult<AppRenew[]>>('/oa/app-renew', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询开发成员
|
|
||||||
*/
|
|
||||||
export async function getAppRenew(id: number) {
|
|
||||||
const res = await request.get<ApiResult<AppRenew>>('/oa/app-renew/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加开发成员
|
|
||||||
*/
|
|
||||||
export async function addAppRenew(data: AppRenew) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/app-renew', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改开发成员
|
|
||||||
*/
|
|
||||||
export async function updateAppRenew(data: AppRenew) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/app-renew', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeAppRenew(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/app-renew/' + id);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeBatchAppRenew(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>('/oa/app-renew/batch', {
|
|
||||||
data
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>('/oa/app-renew/existence', {
|
|
||||||
params: { field, value, id }
|
|
||||||
});
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员
|
|
||||||
*/
|
|
||||||
export interface AppRenew {
|
|
||||||
appRenewId?: number;
|
|
||||||
money?: any;
|
|
||||||
comments?: string;
|
|
||||||
startTime?: any;
|
|
||||||
endTime?: any;
|
|
||||||
userId?: number;
|
|
||||||
nickname?: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
mobile?: string;
|
|
||||||
appId?: number;
|
|
||||||
companyId?: number;
|
|
||||||
status?: any;
|
|
||||||
images?: string;
|
|
||||||
files?: any;
|
|
||||||
createTime?: string;
|
|
||||||
editStatus?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员搜索条件
|
|
||||||
*/
|
|
||||||
export interface AppRenewParam extends PageParam {
|
|
||||||
userId?: number;
|
|
||||||
appId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserItem {
|
|
||||||
key: string;
|
|
||||||
isEdit?: boolean;
|
|
||||||
number?: string;
|
|
||||||
name?: string;
|
|
||||||
department?: string;
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
|
||||||
import type { AppUser, AppUserParam } from '@/api/oa/app/user/model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询开发成员
|
|
||||||
*/
|
|
||||||
export async function pageAppUser(params: AppUserParam) {
|
|
||||||
const res = await request.get<ApiResult<PageResult<AppUser>>>(
|
|
||||||
'/oa/app-user/page',
|
|
||||||
{
|
|
||||||
params
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询开发成员列表
|
|
||||||
*/
|
|
||||||
export async function listAppUser(params?: AppUserParam) {
|
|
||||||
const res = await request.get<ApiResult<AppUser[]>>('/oa/app-user', {
|
|
||||||
params
|
|
||||||
});
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询开发成员
|
|
||||||
*/
|
|
||||||
export async function getAppUser(id: number) {
|
|
||||||
const res = await request.get<ApiResult<AppUser>>('/oa/app-user/' + id);
|
|
||||||
if (res.data.code === 0 && res.data.data) {
|
|
||||||
return res.data.data;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加开发成员
|
|
||||||
*/
|
|
||||||
export async function addAppUser(data: AppUser) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/oa/app-user', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改开发成员
|
|
||||||
*/
|
|
||||||
export async function updateAppUser(data: AppUser) {
|
|
||||||
const res = await request.put<ApiResult<unknown>>('/oa/app-user', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeAppUser(id?: number) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/oa/app-user/' + id
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除开发成员
|
|
||||||
*/
|
|
||||||
export async function removeBatchAppUser(data: (number | undefined)[]) {
|
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
|
||||||
'/oa/app-user/batch',
|
|
||||||
{
|
|
||||||
data
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查IP是否存在
|
|
||||||
*/
|
|
||||||
export async function checkExistence(
|
|
||||||
field: string,
|
|
||||||
value: string,
|
|
||||||
id?: number
|
|
||||||
) {
|
|
||||||
const res = await request.get<ApiResult<unknown>>(
|
|
||||||
'/oa/app-user/existence',
|
|
||||||
{
|
|
||||||
params: { field, value, id }
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员
|
|
||||||
*/
|
|
||||||
export interface AppUser {
|
|
||||||
// 开发成员id
|
|
||||||
appUserId?: number;
|
|
||||||
role?: number;
|
|
||||||
userId?: number;
|
|
||||||
username?: string;
|
|
||||||
nickname?: string;
|
|
||||||
avatar?: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
mobile?: string;
|
|
||||||
appId?: number;
|
|
||||||
status?: string;
|
|
||||||
createTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开发成员搜索条件
|
|
||||||
*/
|
|
||||||
export interface AppUserParam extends PageParam {
|
|
||||||
userId?: number;
|
|
||||||
appId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserItem {
|
|
||||||
key: string;
|
|
||||||
isEdit?: boolean;
|
|
||||||
number?: string;
|
|
||||||
name?: string;
|
|
||||||
department?: string;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import type { ApiResult } from '@/api';
|
|
||||||
import type { Customer } from './model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请免费体验
|
|
||||||
*/
|
|
||||||
export async function apply(data: Customer) {
|
|
||||||
const res = await request.post<ApiResult<unknown>>('/customer-apply', data);
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
return res.data.message;
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.data.message));
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
import type { PageParam } from '@/api';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户
|
|
||||||
*/
|
|
||||||
export interface Customer {
|
|
||||||
// 客户id
|
|
||||||
customerId?: number;
|
|
||||||
// 客户类型
|
|
||||||
customerType?: string;
|
|
||||||
// 客户标识
|
|
||||||
customerCode: string;
|
|
||||||
// 客户名称
|
|
||||||
customerName?: string;
|
|
||||||
// 客户头像
|
|
||||||
customerAvatar?: string;
|
|
||||||
// 座机电话
|
|
||||||
customerPhone?: string;
|
|
||||||
// 手机号码
|
|
||||||
customerMobile?: string;
|
|
||||||
// 联系人
|
|
||||||
customerContacts?: string;
|
|
||||||
// 联系地址
|
|
||||||
customerAddress?: string;
|
|
||||||
// 排序
|
|
||||||
sortNumber?: number;
|
|
||||||
// 备注
|
|
||||||
comments?: string;
|
|
||||||
// 创建时间
|
|
||||||
createTime?: string;
|
|
||||||
// 状态
|
|
||||||
status?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 客户搜索条件
|
|
||||||
*/
|
|
||||||
export interface CustomerParam extends PageParam {
|
|
||||||
customerName?: string;
|
|
||||||
customerCode?: string;
|
|
||||||
// 商户编号
|
|
||||||
merchantCode?: string;
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user