You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
3.8 KiB

1 year ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as UserApi from "@/api/system/user";
import * as SupplierApi from '@/api/wms/supplier'
import {Supplier} from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data";
export const User = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'ID',
field: 'id',
sort: 'custom',
table: {
width: 150
}
},
{
label: '用户名称',
field: 'username',
sort: 'custom',
table: {
width: 150
}
},
{
label: '昵称',
field: 'nickname',
sort: 'custom',
table: {
width: 150
}
},
{
label: '部门',
field: 'deptId',
sort: 'custom',
table: {
width: 150
}
},
{
label: '邮箱',
field: 'email',
sort: 'custom',
table: {
width: 150
}
},
{
label: '电话',
field: 'mobile',
sort: 'custom',
table: {
width: 150
}
}
]))
// 表单校验
export const SupplierUserRules = reactive({
userId: [required],
supplierCode: [required],
status: [required],
concurrencyStamp: [required],
})
export const SupplierUser = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'ID',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '用户ID',
field: 'userId',
sort: 'custom',
isSearch: true,
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选用户信息',
searchField: 'id',
searchTitle: '用户信息',
searchAllSchemas: User.allSchemas,
searchPage: UserApi.getUserPage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选用户信息',
searchField: 'id',
searchTitle: '用户信息',
searchAllSchemas: User.allSchemas,
searchPage: UserApi.getUserPage
}
}
},
{
label: '用户账号',
field: 'userName',
sort: 'custom',
isForm: false,
},
{
label: '用户昵称',
field: 'nickName',
sort: 'custom',
isForm: false,
},
1 year ago
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选供应商信息',
searchField: 'code',
searchTitle: '供应商信息',
searchAllSchemas: Supplier.allSchemas,
searchPage: SupplierApi.getSupplierPage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选供应商信息',
searchField: 'code',
searchTitle: '供应商信息',
searchAllSchemas: Supplier.allSchemas,
searchPage: SupplierApi.getSupplierPage
}
}
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isForm: false,
},
1 year ago
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.ITEM_STATUS,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'ENABLE',
componentProps: {
inactiveValue: 'DISABLE',
activeValue: 'ENABLE'
}
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
}
}
]))