JeecgBoot3.6.1中实现编码校验唯一性

JeecgBoot3.6.1中实现编码校验唯一性


前言

提示:以下是本篇文章正文内容,下面案例可供参考

在我们项目开发中,可能会用到一些数据字典,字典中会用到一些code值,会以外键的形式出现在别的表中,我们角色数据字典为例

vue使用的版本为3.0

下面的代码解析,熟悉vue3的小伙伴可以忽略


一、前端页面:role.data.ts

1.关键代码示例

import {
    BasicColumn } from '/@/components/Table';
import {
    FormSchema } from '/@/components/Table';
import {
    isRoleExist } from './role.api';
//列表数据
export const columns: BasicColumn[] = [
  {
   
    title: '角色名称',
    align: 'center',
    dataIndex: 'roleName',
  },
  {
   
    title: '角色编码',
    align: 'center',
    dataIndex: 'roleCode',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
   
    label: '角色编码',
    field: 'roleCode',
    component: 'Input',
    //colProps: {span: 6},
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
   
    label: '角色名称',
    field: 'roleName',
    component: 'Input',
    dynamicRules: ({
    model, schema }) => {
   
      return [
        {
    required: true, message: '请输入角色名称!' },
        {
    max: 30, message
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值