Merge branch 'master' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm

This commit is contained in:
YunaiV
2024-10-03 11:28:45 +08:00
88 changed files with 5532 additions and 450 deletions

View File

@ -0,0 +1,74 @@
import request from '@/config/axios'
// IoT 设备 VO
export interface DeviceVO {
id: number // 设备 ID主键自增
deviceKey: string // 设备唯一标识符
deviceName: string // 设备名称
productId: number // 产品编号
productKey: string // 产品标识
deviceType: number // 设备类型
nickname: string // 设备备注名称
gatewayId: number // 网关设备 ID
status: number // 设备状态
statusLastUpdateTime: Date // 设备状态最后更新时间
lastOnlineTime: Date // 最后上线时间
lastOfflineTime: Date // 最后离线时间
activeTime: Date // 设备激活时间
createTime: Date // 创建时间
ip: string // 设备的 IP 地址
firmwareVersion: string // 设备的固件版本
deviceSecret: string // 设备密钥,用于设备认证,需安全存储
mqttClientId: string // MQTT 客户端 ID
mqttUsername: string // MQTT 用户名
mqttPassword: string // MQTT 密码
authType: string // 认证类型
latitude: number // 设备位置的纬度
longitude: number // 设备位置的经度
areaId: number // 地区编码
address: string // 设备详细地址
serialNumber: string // 设备序列号
}
export interface DeviceUpdateStatusVO {
id: number // 设备 ID主键自增
status: number // 设备状态
}
// 设备 API
export const DeviceApi = {
// 查询设备分页
getDevicePage: async (params: any) => {
return await request.get({ url: `/iot/device/page`, params })
},
// 查询设备详情
getDevice: async (id: number) => {
return await request.get({ url: `/iot/device/get?id=` + id })
},
// 新增设备
createDevice: async (data: DeviceVO) => {
return await request.post({ url: `/iot/device/create`, data })
},
// 修改设备
updateDevice: async (data: DeviceVO) => {
return await request.put({ url: `/iot/device/update`, data })
},
// 修改设备状态
updateDeviceStatus: async (data: DeviceUpdateStatusVO) => {
return await request.put({ url: `/iot/device/update-status`, data })
},
// 删除设备
deleteDevice: async (id: number) => {
return await request.delete({ url: `/iot/device/delete?id=` + id })
},
// 获取设备数量
getDeviceCount: async (productId: number) => {
return await request.get({ url: `/iot/device/count?productId=` + productId })
}
}

View File

@ -0,0 +1,62 @@
import request from '@/config/axios'
// IoT 产品 VO
export interface ProductVO {
id: number // 产品编号
name: string // 产品名称
productKey: string // 产品标识
protocolId: number // 协议编号
categoryId: number // 产品所属品类标识符
description: string // 产品描述
validateType: number // 数据校验级别
status: number // 产品状态
deviceType: number // 设备类型
netType: number // 联网方式
protocolType: number // 接入网关协议
dataFormat: number // 数据格式
deviceCount: number // 设备数量
createTime: Date // 创建时间
}
// IoT 产品 API
export const ProductApi = {
// 查询产品分页
getProductPage: async (params: any) => {
return await request.get({ url: `/iot/product/page`, params })
},
// 查询产品详情
getProduct: async (id: number) => {
return await request.get({ url: `/iot/product/get?id=` + id })
},
// 新增产品
createProduct: async (data: ProductVO) => {
return await request.post({ url: `/iot/product/create`, data })
},
// 修改产品
updateProduct: async (data: ProductVO) => {
return await request.put({ url: `/iot/product/update`, data })
},
// 删除产品
deleteProduct: async (id: number) => {
return await request.delete({ url: `/iot/product/delete?id=` + id })
},
// 导出产品 Excel
exportProduct: async (params) => {
return await request.download({ url: `/iot/product/export-excel`, params })
},
// 更新产品状态
updateProductStatus: async (id: number, status: number) => {
return await request.put({ url: `/iot/product/update-status?id=` + id + `&status=` + status })
},
// 查询产品(精简)列表
getSimpleProductList() {
return request.get({ url: '/iot/product/list-all-simple' })
}
}

View File

@ -0,0 +1,55 @@
import request from '@/config/axios'
// IoT 产品物模型 VO
export interface ThinkModelFunctionVO {
id: number // 物模型功能编号
identifier: string // 功能标识
name: string // 功能名称
description: string // 功能描述
productId: number // 产品编号
productKey: string // 产品标识
type: number // 功能类型
property: string // 属性
event: string // 事件
service: string // 服务
}
// IoT 产品物模型 API
export const ThinkModelFunctionApi = {
// 查询产品物模型分页
getThinkModelFunctionPage: async (params: any) => {
return await request.get({ url: `/iot/think-model-function/page`, params })
},
// 获得产品物模型
getThinkModelFunctionListByProductId: async (params: any) => {
return await request.get({
url: `/iot/think-model-function/list-by-product-id`,
params
})
},
// 查询产品物模型详情
getThinkModelFunction: async (id: number) => {
return await request.get({ url: `/iot/think-model-function/get?id=` + id })
},
// 新增产品物模型
createThinkModelFunction: async (data: ThinkModelFunctionVO) => {
return await request.post({ url: `/iot/think-model-function/create`, data })
},
// 修改产品物模型
updateThinkModelFunction: async (data: ThinkModelFunctionVO) => {
return await request.put({ url: `/iot/think-model-function/update`, data })
},
// 删除产品物模型
deleteThinkModelFunction: async (id: number) => {
return await request.delete({ url: `/iot/think-model-function/delete?id=` + id })
},
// 导出产品物模型 Excel
exportThinkModelFunction: async (params) => {
return await request.download({ url: `/iot/think-model-function/export-excel`, params })
}
}

View File

@ -1,6 +1,6 @@
import request from '@/config/axios'
import { getRefreshToken } from '@/utils/auth'
import type { UserLoginVO } from './types'
import type { RegisterVO, UserLoginVO } from './types'
export interface SmsCodeVO {
mobile: string
@ -17,6 +17,11 @@ export const login = (data: UserLoginVO) => {
return request.post({ url: '/system/auth/login', data })
}
// 注册
export const register = (data: RegisterVO) => {
return request.post({ url: '/system/auth/register', data })
}
// 刷新访问令牌
export const refreshToken = () => {
return request.post({ url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken() })

View File

@ -29,3 +29,10 @@ export type UserVO = {
loginIp: string
loginDate: string
}
export type RegisterVO = {
tenantName: string
username: string
password: string
captchaVerification: string
}

View File

@ -0,0 +1,91 @@
import request from '@/config/axios'
import { Sku, Spu } from '@/api/mall/product/spu' // 积分商城活动 VO
// 积分商城活动 VO
export interface PointActivityVO {
id: number // 积分商城活动编号
spuId: number // 积分商城活动商品
status: number // 活动状态
stock: number // 积分商城活动库存
totalStock: number // 积分商城活动总库存
remark?: string // 备注
sort: number // 排序
createTime: string // 创建时间
products: PointProductVO[] // 积分商城商品
// ========== 商品字段 ==========
spuName: string // 商品名称
picUrl: string // 商品主图
marketPrice: number // 商品市场价,单位:分
//======================= 显示所需兑换积分最少的 sku 信息 =======================
point: number // 兑换积分
price: number // 兑换金额,单位:分
}
// 秒杀活动所需属性
export interface PointProductVO {
id?: number // 积分商城商品编号
activityId?: number // 积分商城活动 id
spuId?: number // 商品 SPU 编号
skuId: number // 商品 SKU 编号
count: number // 可兑换数量
point: number // 兑换积分
price: number // 兑换金额,单位:分
stock: number // 积分商城商品库存
activityStatus?: number // 积分商城商品状态
}
// 扩展 Sku 配置
export type SkuExtension = Sku & {
productConfig: PointProductVO
}
export interface SpuExtension extends Spu {
skus: SkuExtension[] // 重写类型
}
export interface SpuExtension0 extends Spu {
pointStock: number // 积分商城活动库存
pointTotalStock: number // 积分商城活动总库存
point: number // 兑换积分
pointPrice: number // 兑换金额,单位:分
}
// 积分商城活动 API
export const PointActivityApi = {
// 查询积分商城活动分页
getPointActivityPage: async (params: any) => {
return await request.get({ url: `/promotion/point-activity/page`, params })
},
// 查询积分商城活动详情
getPointActivity: async (id: number) => {
return await request.get({ url: `/promotion/point-activity/get?id=` + id })
},
// 查询积分商城活动列表,基于活动编号数组
getPointActivityListByIds: async (ids: number[]) => {
return request.get({ url: `/promotion/point-activity/list-by-ids?ids=${ids}` })
},
// 新增积分商城活动
createPointActivity: async (data: PointActivityVO) => {
return await request.post({ url: `/promotion/point-activity/create`, data })
},
// 修改积分商城活动
updatePointActivity: async (data: PointActivityVO) => {
return await request.put({ url: `/promotion/point-activity/update`, data })
},
// 删除积分商城活动
deletePointActivity: async (id: number) => {
return await request.delete({ url: `/promotion/point-activity/delete?id=` + id })
},
// 关闭秒杀活动
closePointActivity: async (id: number) => {
return await request.put({ url: '/promotion/point-activity/close?id=' + id })
}
}

View File

@ -47,7 +47,12 @@ export const getReward = async (id: number) => {
return await request.get({ url: '/promotion/reward-activity/get?id=' + id })
}
// 删除限时折扣活动
// 删除满减送活动
export const deleteRewardActivity = async (id: number) => {
return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id })
}
// 关闭满减送活动
export const closeRewardActivity = async (id: number) => {
return await request.put({ url: '/promotion/reward-activity/close?id=' + id })
}

View File

@ -18,6 +18,7 @@ export interface SeckillActivityVO {
singleLimitCount?: number
stock?: number
totalStock?: number
seckillPrice?: number
products?: SeckillProductVO[]
}
@ -43,6 +44,11 @@ export const getSeckillActivityPage = async (params) => {
return await request.get({ url: '/promotion/seckill-activity/page', params })
}
// 查询秒杀活动列表,基于活动编号数组
export const getSeckillActivityListByIds = (ids: number[]) => {
return request.get({ url: `/promotion/seckill-activity/list-by-ids?ids=${ids}` })
}
// 查询秒杀活动详情
export const getSeckillActivity = async (id: number) => {
return await request.get({ url: '/promotion/seckill-activity/get?id=' + id })

View File

@ -84,8 +84,14 @@ export const getOrderPage = async (params: OrderPageReqVO) => {
}
// 查询详情支付订单
export const getOrder = async (id: number) => {
return await request.get({ url: '/pay/order/get?id=' + id })
export const getOrder = async (id: number, sync?: boolean) => {
return await request.get({
url: '/pay/order/get',
params: {
id,
sync
}
})
}
// 获得支付订单的明细