feat: 更新 @riwa/api-types 依赖至 0.0.145,修改产品图标字段及相关表单验证规则
This commit is contained in:
@@ -21,7 +21,7 @@ const { data } = safeClient(
|
||||
);
|
||||
|
||||
const form = ref<Body>({
|
||||
icon: '',
|
||||
iconifyIcon: '',
|
||||
name: '',
|
||||
code: '',
|
||||
categoryId: '',
|
||||
@@ -32,7 +32,7 @@ const form = ref<Body>({
|
||||
});
|
||||
|
||||
const rules: FormRules = {
|
||||
icon: [{ required: true, message: '请选择产品图标', trigger: ['blur', 'input'] }],
|
||||
iconifyIcon: [{ required: true, message: '请选择产品图标', trigger: ['blur', 'input'] }],
|
||||
name: [{ required: true, message: '请输入产品名称', trigger: ['blur', 'input'] }],
|
||||
code: [
|
||||
{ required: true, message: '请输入产品编号', trigger: ['blur', 'input'] },
|
||||
@@ -95,8 +95,8 @@ function handleCreateDraftAndSubmit() {
|
||||
:rules="rules"
|
||||
require-mark-placement="left"
|
||||
>
|
||||
<NFormItem path="icon" label="产品图标 ">
|
||||
<IconPicker v-model="form.icon" />
|
||||
<NFormItem path="iconifyIcon" label="产品图标 ">
|
||||
<IconPicker v-model="form.iconifyIcon" />
|
||||
</NFormItem>
|
||||
<NFormItem path="name" label="产品名称">
|
||||
<NInput v-model:value="form.name" />
|
||||
|
||||
@@ -27,7 +27,7 @@ const { data: categories } = safeClient(
|
||||
|
||||
const form = ref<Body>({
|
||||
id: props.data.id,
|
||||
icon: props.data.icon,
|
||||
iconifyIcon: props.data.iconifyIcon,
|
||||
name: props.data.name,
|
||||
code: props.data.code,
|
||||
categoryId: props.data.categoryId,
|
||||
@@ -38,7 +38,7 @@ const form = ref<Body>({
|
||||
});
|
||||
|
||||
const rules: FormRules = {
|
||||
icon: [{ required: true, message: '请选择产品图标', trigger: ['blur', 'input'] }],
|
||||
iconifyIcon: [{ required: true, message: '请选择产品图标', trigger: ['blur', 'input'] }],
|
||||
name: [{ required: true, message: '请输入产品名称', trigger: ['blur', 'input'] }],
|
||||
code: [
|
||||
{ required: true, message: '请输入产品编号', trigger: ['blur', 'input'] },
|
||||
@@ -90,8 +90,8 @@ function handleSubmit() {
|
||||
:rules="rules"
|
||||
require-mark-placement="left"
|
||||
>
|
||||
<NFormItem path="icon" label="产品图标 ">
|
||||
<IconPicker v-model="form.icon" />
|
||||
<NFormItem path="iconifyIcon" label="产品图标 ">
|
||||
<IconPicker v-model="form.iconifyIcon" />
|
||||
</NFormItem>
|
||||
<NFormItem path="name" label="产品名称">
|
||||
<NInput v-model:value="form.name" />
|
||||
|
||||
@@ -5,6 +5,7 @@ import { NDatePicker, useDialog, useMessage } from 'naive-ui';
|
||||
import { client, safeClient } from '@/service/api';
|
||||
import type { TableBaseColumns, TableFetchData, TableFilterColumns, TableInst } from '@/components/table';
|
||||
import { RwaStatusEnum } from '@/enum';
|
||||
import SvgIcon from '@/components/custom/svg-icon.vue';
|
||||
import Add from './components/add.vue';
|
||||
import Edit from './components/edit.vue';
|
||||
import Editions from './components/editions.vue';
|
||||
@@ -32,6 +33,13 @@ const columns: TableBaseColumns = [
|
||||
type: 'selection',
|
||||
width: 60
|
||||
},
|
||||
{
|
||||
title: '产品图标',
|
||||
key: 'iconifyIcon',
|
||||
render: (row: any) => {
|
||||
return h(SvgIcon, { icon: row.iconifyIcon });
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '产品代码',
|
||||
key: 'code'
|
||||
|
||||
Reference in New Issue
Block a user