diff --git a/apps/web-ele/src/views/mall/product/comment/data.ts b/apps/web-ele/src/views/mall/product/comment/data.ts index 7a3641ef2..e3f895801 100644 --- a/apps/web-ele/src/views/mall/product/comment/data.ts +++ b/apps/web-ele/src/views/mall/product/comment/data.ts @@ -3,7 +3,6 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MallCommentApi } from '#/api/mall/product/comment'; import { z } from '#/adapter/form'; -import { getSpuSimpleList } from '#/api/mall/product/spu'; import { getRangePickerDefaultProps } from '#/utils'; /** 新增/修改的表单 */ @@ -17,19 +16,28 @@ export function useFormSchema(): VbenFormSchema[] { show: () => false, }, }, - // TODO @puhui999:商品的选择 { fieldName: 'spuId', label: '商品', - component: 'ApiSelect', + component: 'Input', componentProps: { - api: getSpuSimpleList, - labelField: 'name', - valueField: 'id', placeholder: '请选择商品', }, rules: 'required', }, + { + fieldName: 'skuId', + label: '商品规格', + component: 'Input', + componentProps: { + placeholder: '请选择商品规格', + }, + dependencies: { + triggerFields: ['spuId'], + show: (values) => !!values.spuId, + }, + rules: 'required', + }, { fieldName: 'userAvatar', label: '用户头像', @@ -88,7 +96,7 @@ export function useGridFormSchema(): VbenFormSchema[] { { fieldName: 'replyStatus', label: '回复状态', - component: 'Select', + component: 'RadioGroup', componentProps: { options: [ { label: '已回复', value: true }, diff --git a/apps/web-ele/src/views/mall/product/comment/index.vue b/apps/web-ele/src/views/mall/product/comment/index.vue index 373dbe7c0..3c39a767c 100644 --- a/apps/web-ele/src/views/mall/product/comment/index.vue +++ b/apps/web-ele/src/views/mall/product/comment/index.vue @@ -2,8 +2,6 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MallCommentApi } from '#/api/mall/product/comment'; -import { h } from 'vue'; - import { confirm, DocAlert, Page, prompt, useVbenModal } from '@vben/common-ui'; import { ElInput, ElMessage, ElRate } from 'element-plus'; @@ -37,17 +35,17 @@ function handleCreate() { /** 回复评价 */ function handleReply(row: MallCommentApi.Comment) { prompt({ - component: () => { - return h(ElInput, { - type: 'textarea', - placeholder: '请输入回复内容', - }); + component: ElInput, + componentProps: { + type: 'textarea', + placeholder: '请输入回复内容', + rows: 4, }, content: row.content ? `用户评论:${row.content}\n请输入回复内容:` : '请输入回复内容:', title: '回复评论', - modelPropName: 'value', + modelPropName: 'modelValue', }).then(async (val) => { if (val) { await replyComment({ @@ -127,10 +125,10 @@ const [Grid, gridApi] = useVbenVxeGrid({