diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 73913b91..7f3f95f9 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -147,6 +147,7 @@ export enum DICT_TYPE { MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型 // ========== MALL - PROMOTION 模块 ========== + PRODUCT_UNIT = 'product_unit', // 商品单位 PROMOTION_DISCOUNT_TYPE = 'promotion_discount_type', // 优惠类型 PROMOTION_PRODUCT_SCOPE = 'promotion_product_scope', // 营销的商品范围 PROMOTION_COUPON_TEMPLATE_VALIDITY_TYPE = 'promotion_coupon_template_validity_type', // 优惠劵模板的有限期类型 diff --git a/src/views/mall/product/spu/components/BasicInfoForm.vue b/src/views/mall/product/spu/components/BasicInfoForm.vue index b8ae405c..c3ccf6b5 100644 --- a/src/views/mall/product/spu/components/BasicInfoForm.vue +++ b/src/views/mall/product/spu/components/BasicInfoForm.vue @@ -14,7 +14,6 @@ </el-form-item> </el-col> <el-col :span="12"> - <!-- TODO @puhui999:只能选根节点 fix: 已完善--> <el-form-item label="商品分类" prop="categoryId"> <el-tree-select v-model="formData.categoryId" @@ -166,8 +165,7 @@ </Descriptions> <!-- 商品属性添加 Form 表单 --> - <!-- TODO @puhui999: ProductPropertyAddForm 是不是更合适呀 --> - <ProductAttributesAddForm ref="attributesAddFormRef" :propertyList="propertyList" /> + <ProductPropertyAddForm ref="attributesAddFormRef" :propertyList="propertyList" /> </template> <script lang="ts" name="ProductSpuBasicInfoForm" setup> import { PropType } from 'vue' @@ -178,7 +176,7 @@ import { checkSelectedNode, defaultProps, handleTree, treeToString } from '@/uti import { createImageViewer } from '@/components/ImageViewer' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { UploadImg, UploadImgs } from '@/components/UploadFile' -import { ProductAttributes, ProductAttributesAddForm, SkuList } from './index' +import { ProductAttributes, ProductPropertyAddForm, SkuList } from './index' import { basicInfoSchema } from './spu.data' import type { Spu } from '@/api/mall/product/spu' import * as ProductCategoryApi from '@/api/mall/product/category' diff --git a/src/views/mall/product/spu/components/ProductAttributesAddForm.vue b/src/views/mall/product/spu/components/ProductPropertyAddForm.vue similarity index 97% rename from src/views/mall/product/spu/components/ProductAttributesAddForm.vue rename to src/views/mall/product/spu/components/ProductPropertyAddForm.vue index 2de843f6..978ebe71 100644 --- a/src/views/mall/product/spu/components/ProductAttributesAddForm.vue +++ b/src/views/mall/product/spu/components/ProductPropertyAddForm.vue @@ -17,7 +17,7 @@ </template> </Dialog> </template> -<script lang="ts" name="ProductPropertyForm" setup> +<script lang="ts" name="ProductPropertyAddForm" setup> import * as PropertyApi from '@/api/mall/product/property' const { t } = useI18n() // 国际化 diff --git a/src/views/mall/product/spu/components/SkuList.vue b/src/views/mall/product/spu/components/SkuList.vue index 916746e3..4114bd09 100644 --- a/src/views/mall/product/spu/components/SkuList.vue +++ b/src/views/mall/product/spu/components/SkuList.vue @@ -23,7 +23,6 @@ min-width="120" > <template #default="{ row }"> - <!-- TODO puhui999:展示成蓝色,有点区分度哈 fix--> <span style="font-weight: bold; color: #40aaff"> {{ row.properties[index]?.valueName }} </span> diff --git a/src/views/mall/product/spu/components/index.ts b/src/views/mall/product/spu/components/index.ts index f908e7d3..549a9815 100644 --- a/src/views/mall/product/spu/components/index.ts +++ b/src/views/mall/product/spu/components/index.ts @@ -2,7 +2,7 @@ import BasicInfoForm from './BasicInfoForm.vue' import DescriptionForm from './DescriptionForm.vue' import OtherSettingsForm from './OtherSettingsForm.vue' import ProductAttributes from './ProductAttributes.vue' -import ProductAttributesAddForm from './ProductAttributesAddForm.vue' +import ProductPropertyAddForm from './ProductPropertyAddForm.vue' import SkuList from './SkuList.vue' export { @@ -10,6 +10,6 @@ export { DescriptionForm, OtherSettingsForm, ProductAttributes, - ProductAttributesAddForm, + ProductPropertyAddForm, SkuList } diff --git a/src/views/mall/product/spu/components/spu.data.ts b/src/views/mall/product/spu/components/spu.data.ts index befb6e8a..2f024d5b 100644 --- a/src/views/mall/product/spu/components/spu.data.ts +++ b/src/views/mall/product/spu/components/spu.data.ts @@ -1,6 +1,7 @@ import { CrudSchema } from '@/hooks/web/useCrudSchemas' // TODO @puhui999:如果只要 detail,可以不用 CrudSchema,只要描述的 Schema +// fix: useCrudSchemas 中没有单独处理的情况且只要 detail 的情况只要 spu 这里有使用 如果改动得添加/修改代码 export const basicInfoSchema = reactive<CrudSchema[]>([ { label: '商品名称',