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.

221 lines
4.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',
1 year ago
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],
userName: [required],
1 year ago
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',
isForm: false,
1 year ago
isSearch: true,
// tableForm:{
// isInpuFocusShow: true,
// searchListPlaceholder: '请选用户信息',
// searchField: 'username',
// searchTitle: '用户信息',
// searchAllSchemas: User.allSchemas,
// searchPage: UserApi.getUserPage
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// dialogWidth:'1025px',//搜索出来弹窗的宽度
// isSearchList: true,
// searchListPlaceholder: '请选用户信息',
// searchField: 'username',
// searchTitle: '用户信息',
// searchAllSchemas: User.allSchemas,
// searchPage: UserApi.getUserPage
// }
// }
},
{
label: '用户账号',
field: 'userName',
sort: 'custom',
1 year ago
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选用户信息',
searchField: 'username',
1 year ago
searchTitle: '用户信息',
searchAllSchemas: User.allSchemas,
searchPage: UserApi.getUserPage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
11 months ago
dialogWidth:'1025px',//搜索出来弹窗的宽度
1 year ago
isSearchList: true,
searchListPlaceholder: '请选用户信息',
searchField: 'username',
1 year ago
searchTitle: '用户信息',
searchAllSchemas: User.allSchemas,
searchPage: UserApi.getUserPage
}
},
isSearch: true,
},
{
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: {
enterSearch:true,
1 year ago
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')]
}
},
11 months ago
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
1 year ago
isForm: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
}
}
]))