review 秒杀活动

This commit is contained in:
YunaiV 2023-07-02 21:46:04 +08:00
parent a6fc5f775a
commit b1ce2672e4
6 changed files with 11 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import SkuList from './SkuList.vue'
import { Spu } from '@/api/mall/product/spu' import { Spu } from '@/api/mall/product/spu'
// TODO @puhui999Properties 改成 Property 更合适?
interface Properties { interface Properties {
id: number id: number
name: string name: string
@ -30,8 +31,10 @@ interface RuleConfig {
} }
/** /**
* *
*
* @param spu * @param spu
* @return Property
*/ */
const getPropertyList = (spu: Spu): Properties[] => { const getPropertyList = (spu: Spu): Properties[] => {
// 直接拿返回的 skus 属性逆向生成出 propertyList // 直接拿返回的 skus 属性逆向生成出 propertyList

View File

@ -437,6 +437,7 @@ const categoryList = ref() // 分类树
const categoryString = (categoryId) => { const categoryString = (categoryId) => {
return treeToString(categoryList.value, categoryId) return treeToString(categoryList.value, categoryId)
} }
/** /**
* 校验所选是否为二级及以下节点 * 校验所选是否为二级及以下节点
*/ */
@ -446,6 +447,7 @@ const nodeClick = () => {
message.warning('必须选择二级及以下节点!!') message.warning('必须选择二级及以下节点!!')
} }
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getTabsCount() await getTabsCount()

View File

@ -256,7 +256,6 @@ const imagePreview = (imgUrl: string) => {
const categoryList = ref() // const categoryList = ref() //
// TODO @puhui999
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getList() await getList()

View File

@ -7,6 +7,7 @@ type SpuProperty<T> = {
spuDetail: T spuDetail: T
propertyList: Properties[] propertyList: Properties[]
} }
/** /**
* *
*/ */

View File

@ -89,6 +89,8 @@ const openForm = (type: string, id?: number) => {
const handleDelete = (id: number) => { const handleDelete = (id: number) => {
tableMethods.delList(id, false) tableMethods.delList(id, false)
} }
// TODO @puhui configList
const seckillConfigAllSimple = ref([]) // const seckillConfigAllSimple = ref([]) //
const convertSeckillConfigNames = computed( const convertSeckillConfigNames = computed(
() => (row) => () => (row) =>
@ -96,6 +98,7 @@ const convertSeckillConfigNames = computed(
?.filter((item) => row.configIds.includes(item.id)) ?.filter((item) => row.configIds.includes(item.id))
?.map((config) => config.name) ?.map((config) => config.name)
) )
const expandChange = (row, expandedRows) => { const expandChange = (row, expandedRows) => {
// TODO puhui CRUD // TODO puhui CRUD
console.log(row, expandedRows) console.log(row, expandedRows)

View File

@ -219,7 +219,7 @@ const crudSchemas = reactive<CrudSchema[]>([
}, },
{ {
label: '状态', label: '状态',
field: 'status', // TODO @puhui999状态在 table 格式化不对;建表插入的数据状态值不对,改为 0 或 1 就好了 field: 'status',
dictType: DICT_TYPE.COMMON_STATUS, dictType: DICT_TYPE.COMMON_STATUS,
dictClass: 'number', dictClass: 'number',
isForm: false, isForm: false,