Merge remote-tracking branch 'refs/remotes/yudao/dev' into dev-crm
commit
bcf2f7a5dc
@ -1,49 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 秒杀时段 VO
|
||||
export interface SeckillConfigVO {
|
||||
id: number
|
||||
name: string
|
||||
startTime: string
|
||||
endTime: string
|
||||
sliderPicUrls: string[]
|
||||
status: number
|
||||
}
|
||||
|
||||
// 查询秒杀时段配置列表
|
||||
export const getSeckillConfigPage = async (params) => {
|
||||
return await request.get({ url: '/promotion/seckill-config/page', params })
|
||||
}
|
||||
|
||||
// 查询秒杀时段配置详情
|
||||
export const getSeckillConfig = async (id: number) => {
|
||||
return await request.get({ url: '/promotion/seckill-config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获得所有开启状态的秒杀时段精简列表
|
||||
export const getSimpleSeckillConfigList = async () => {
|
||||
return await request.get({ url: '/promotion/seckill-config/list-all-simple' })
|
||||
}
|
||||
|
||||
// 新增秒杀时段配置
|
||||
export const createSeckillConfig = async (data: SeckillConfigVO) => {
|
||||
return await request.post({ url: '/promotion/seckill-config/create', data })
|
||||
}
|
||||
|
||||
// 修改秒杀时段配置
|
||||
export const updateSeckillConfig = async (data: SeckillConfigVO) => {
|
||||
return await request.put({ url: '/promotion/seckill-config/update', data })
|
||||
}
|
||||
|
||||
// 修改时段配置状态
|
||||
export const updateSeckillConfigStatus = (id: number, status: number) => {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
id: number // 编号
|
||||
name: string // 秒杀时段名称
|
||||
startTime: string // 开始时间点
|
||||
endTime: string // 结束时间点
|
||||
sliderPicUrls: string[] // 秒杀轮播图
|
||||
status: number // 活动状态
|
||||
}
|
||||
|
||||
// 秒杀时段 API
|
||||
export const SeckillConfigApi = {
|
||||
// 查询秒杀时段分页
|
||||
getSeckillConfigPage: async (params: any) => {
|
||||
return await request.get({ url: `/promotion/seckill-config/page`, params })
|
||||
},
|
||||
|
||||
// 查询秒杀时段详情
|
||||
getSeckillConfig: async (id: number) => {
|
||||
return await request.get({ url: `/promotion/seckill-config/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增秒杀时段
|
||||
createSeckillConfig: async (data: SeckillConfigVO) => {
|
||||
return await request.post({ url: `/promotion/seckill-config/create`, data })
|
||||
},
|
||||
|
||||
// 修改秒杀时段
|
||||
updateSeckillConfig: async (data: SeckillConfigVO) => {
|
||||
return await request.put({ url: `/promotion/seckill-config/update`, data })
|
||||
},
|
||||
|
||||
// 删除秒杀时段
|
||||
deleteSeckillConfig: async (id: number) => {
|
||||
return await request.delete({ url: `/promotion/seckill-config/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 修改时段配置状态
|
||||
updateSeckillConfigStatus: async (id: number, status: number) => {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/promotion/seckill-config/update-status', data: data })
|
||||
}
|
||||
return request.put({ url: '/promotion/seckill-config/update-status', data: data })
|
||||
}
|
||||
|
||||
// 删除秒杀时段配置
|
||||
export const deleteSeckillConfig = async (id: number) => {
|
||||
return await request.delete({ url: '/promotion/seckill-config/delete?id=' + id })
|
||||
}
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
// 表单校验
|
||||
export const rules = reactive({
|
||||
name: [required],
|
||||
startTime: [required],
|
||||
endTime: [required],
|
||||
picUrl: [required],
|
||||
status: [required]
|
||||
})
|
||||
|
||||
// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
|
||||
const crudSchemas = reactive<CrudSchema[]>([
|
||||
{
|
||||
label: '秒杀时段名称',
|
||||
field: 'name',
|
||||
isSearch: true
|
||||
},
|
||||
{
|
||||
label: '开始时间点',
|
||||
field: 'startTime',
|
||||
isSearch: false,
|
||||
search: {
|
||||
component: 'TimePicker'
|
||||
},
|
||||
form: {
|
||||
component: 'TimePicker',
|
||||
componentProps: {
|
||||
valueFormat: 'HH:mm:ss'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '结束时间点',
|
||||
field: 'endTime',
|
||||
isSearch: false,
|
||||
search: {
|
||||
component: 'TimePicker'
|
||||
},
|
||||
form: {
|
||||
component: 'TimePicker',
|
||||
componentProps: {
|
||||
valueFormat: 'HH:mm:ss'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '秒杀轮播图',
|
||||
field: 'sliderPicUrls',
|
||||
isSearch: false,
|
||||
form: {
|
||||
component: 'UploadImgs'
|
||||
},
|
||||
table: {
|
||||
width: 300
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
dictType: DICT_TYPE.COMMON_STATUS,
|
||||
dictClass: 'number',
|
||||
isSearch: true,
|
||||
form: {
|
||||
component: 'Radio'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
field: 'createTime',
|
||||
isForm: false,
|
||||
isSearch: false,
|
||||
formatter: dateFormatter
|
||||
},
|
||||
{
|
||||
label: '操作',
|
||||
field: 'action',
|
||||
isForm: false
|
||||
}
|
||||
])
|
||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||
Loading…
Reference in New Issue