feat: use Rate
This commit is contained in:
@@ -70,23 +70,16 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
// TODO @xingyu:无法使用 Rate 组件,会报 TypeError: Cannot read properties of undefined (reading 'prefixCls')
|
|
||||||
{
|
{
|
||||||
fieldName: 'descriptionScores',
|
fieldName: 'descriptionScores',
|
||||||
label: '描述星级',
|
label: '描述星级',
|
||||||
component: 'InputNumber',
|
component: 'Rate',
|
||||||
componentProps: {
|
|
||||||
placeholder: '请选择描述星级',
|
|
||||||
},
|
|
||||||
rules: z.number().min(1).max(5).default(5),
|
rules: z.number().min(1).max(5).default(5),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'benefitScores',
|
fieldName: 'benefitScores',
|
||||||
label: '服务星级',
|
label: '服务星级',
|
||||||
component: 'InputNumber',
|
component: 'Rate',
|
||||||
componentProps: {
|
|
||||||
placeholder: '请选择服务星级',
|
|
||||||
},
|
|
||||||
rules: z.number().min(1).max(5).default(5),
|
rules: z.number().min(1).max(5).default(5),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -204,12 +197,18 @@ export function useGridColumns<T = MallCommentApi.Comment>(
|
|||||||
{
|
{
|
||||||
field: 'descriptionScores',
|
field: 'descriptionScores',
|
||||||
title: '商品评分',
|
title: '商品评分',
|
||||||
minWidth: 90,
|
minWidth: 150,
|
||||||
|
slots: {
|
||||||
|
default: 'descriptionScores',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'benefitScores',
|
field: 'benefitScores',
|
||||||
title: '服务评分',
|
title: '服务评分',
|
||||||
minWidth: 90,
|
minWidth: 150,
|
||||||
|
slots: {
|
||||||
|
default: 'benefitScores',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'content',
|
field: 'content',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { h } from 'vue';
|
|||||||
|
|
||||||
import { confirm, DocAlert, Page, prompt, useVbenModal } from '@vben/common-ui';
|
import { confirm, DocAlert, Page, prompt, useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
import { message, Textarea } from 'ant-design-vue';
|
import { message, Rate, Textarea } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
@@ -129,6 +129,12 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
</template>
|
</template>
|
||||||
<FormModal @success="handleRefresh" />
|
<FormModal @success="handleRefresh" />
|
||||||
<Grid table-title="评论列表">
|
<Grid table-title="评论列表">
|
||||||
|
<template #descriptionScores="{ row }">
|
||||||
|
<Rate v-model:value="row.descriptionScores" :disabled="true" />
|
||||||
|
</template>
|
||||||
|
<template #benefitScores="{ row }">
|
||||||
|
<Rate v-model:value="row.benefitScores" :disabled="true" />
|
||||||
|
</template>
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<TableAction
|
<TableAction
|
||||||
:actions="[
|
:actions="[
|
||||||
|
|||||||
Reference in New Issue
Block a user