Browse Source

前端页面位置调整

master
叶佳兴 1 week ago
parent
commit
fb1e10615b
  1. 669
      src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
  2. 38
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  3. 38
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

669
src/views/eam/device/deviceAccounts/deviceAccounts.data.ts

@ -9,380 +9,385 @@ const supplierList = await SupplierApi.getSupplierNoPage({})
const userListAll = await UserApi.getSimpleUserList()
// 表单校验
export const DeviceAccountsRules = reactive({
name: [
required,
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
],
specification: [
{ max: 20, message: '不得超过20个字符', trigger: 'blur' },
],
type: [
{ max: 20, message: '不得超过20个字符', trigger: 'blur' },
],
status: [
{ max: 20, message: '不得超过20个字符', trigger: 'blur' },
],
name: [required, { max: 50, message: '不得超过50个字符', trigger: 'blur' }],
specification: [{ max: 20, message: '不得超过20个字符', trigger: 'blur' }],
type: [{ max: 20, message: '不得超过20个字符', trigger: 'blur' }],
status: [{ max: 20, message: '不得超过20个字符', trigger: 'blur' }],
power: [
{ max: 20, message: '不得超过20个字符', trigger: 'blur' },
{ validator:validateNumDot, message: '请输入数字格式', trigger: 'blur'}
],
describes: [
{ max: 600, message: '不得超过600个字符', trigger: 'blur' },
],
factoryAreaNumber: [
required,
{ max: 20, message: '不得超过20个字符', trigger: 'blur' },
],
purchaseDept: [
{ max: 100, message: '不得超过100个字符', trigger: 'blur' },
],
purchaser: [
{ max: 300, message: '不得超过300个字符', trigger: 'blur' },
],
supplierNumber: [
{ max: 20, message: '不得超过20个字符', trigger: 'blur' },
{ validator: validateNumDot, message: '请输入数字格式', trigger: 'blur' }
],
describes: [{ max: 600, message: '不得超过600个字符', trigger: 'blur' }],
factoryAreaNumber: [required, { max: 20, message: '不得超过20个字符', trigger: 'blur' }],
purchaseDept: [{ max: 100, message: '不得超过100个字符', trigger: 'blur' }],
purchaser: [{ max: 300, message: '不得超过300个字符', trigger: 'blur' }],
supplierNumber: [{ max: 20, message: '不得超过20个字符', trigger: 'blur' }],
purchasePrice: [
{ validator: validateNumberMax20Length, message: '请填写合理的价格', trigger: 'blur' },
{ validator:validateNumDot, message: '请输入数字格式', trigger: 'blur'}
],
{ validator: validateNumDot, message: '请输入数字格式', trigger: 'blur' }
]
})
export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备台账编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: '150',
fixed: 'left',
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: '150',
},
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
table: {
width: '150',
},
},
{
label: '设备功率(kw)',
field: 'power',
sort: 'custom',
isSearch: false,
table: {
width: '200',
},
},
{
label: '设备功率范围',
field: 'powerRange',
sort: 'custom',
dictType: DICT_TYPE.POWER_RANGE,
dictClass: 'string',
isSearch: true,
search: {
show: true,
component: 'Select',
export const DeviceAccounts = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '设备台账编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: '150',
fixed: 'left'
}
},
isTable: false,
isTableForm: false,
isDetail: false,
isForm: false,
},
{
label: '设备类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: '150'
}
},
isSearch: false,
isForm: true,
isTable: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: {
value: 'DEVICE',
component: 'Select',
componentProps: {
disabled: true,
{
label: '规格型号',
field: 'specification',
sort: 'custom',
table: {
width: '150'
}
},
search: {
value: 'DEVICE'
}
},
{
label: '所属厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isSearch: false,
isDetail: false,
table: {
width: '150',
{
label: '设备功率(kw)',
field: 'power',
sort: 'custom',
isSearch: false,
table: {
width: '200'
}
},
api: () => factoryDeptList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryDeptList.find((account) => account.id == cellValue)?.name
{
label: '设备功率范围',
field: 'powerRange',
sort: 'custom',
dictType: DICT_TYPE.POWER_RANGE,
dictClass: 'string',
isSearch: true,
search: {
show: true,
component: 'Select'
},
isTable: false,
isTableForm: false,
isDetail: false,
isForm: false
},
search: {
show: true,
component: 'Select',
api: () => factoryDeptList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
{
label: '设备类型',
field: 'type',
sort: 'custom',
table: {
width: '150'
},
isSearch: false,
isForm: true,
isTable: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: {
value: 'DEVICE',
component: 'Select',
componentProps: {
disabled: true
}
},
search: {
value: 'DEVICE'
}
},
form: {
component: 'Select',
{
label: '所属厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isSearch: false,
isDetail: false,
table: {
width: '150'
},
api: () => factoryDeptList,
componentProps: {
disabled: false,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请选择设备"
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryDeptList.find((account) => account.id == cellValue)?.name
},
}
},
{
label: '所属厂区',
field: 'factoryAreaNumberDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '负责人',
field: 'principal',
sort: 'custom',
isSearch: false,
isDetail: false,
table: {
width: '150',
search: {
show: true,
component: 'Select',
api: () => factoryDeptList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true
}
},
form: {
component: 'Select',
api: () => factoryDeptList,
componentProps: {
disabled: false,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: '请选择设备'
}
}
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
{
label: '所属厂区',
field: 'factoryAreaNumberDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false
},
// search: {
// show: true,
// component: 'Select',
// api: () => userListAll,
// componentProps: {
// optionsAlias: {
// labelField: 'nickname',
// valueField: 'id'
// }
// }
// },
form: {
component: 'Select',
{
label: '负责人',
field: 'principal',
sort: 'custom',
isSearch: false,
isDetail: false,
table: {
width: '150'
},
api: () => userListAll,
componentProps: {
optionsAlias: {
labelField: 'nickname',
valueField: 'id',
},
filterable: true,
placeholder: "请选择负责人"
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
// search: {
// show: true,
// component: 'Select',
// api: () => userListAll,
// componentProps: {
// optionsAlias: {
// labelField: 'nickname',
// valueField: 'id'
// }
// }
// },
form: {
component: 'Select',
api: () => userListAll,
componentProps: {
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
placeholder: '请选择负责人'
}
}
},
},
{
label: '负责人',
field: 'principalDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '采购时间',
field: 'purchaseTime',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150',
{
label: '负责人',
field: 'principalDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
{
label: '采购时间',
field: 'purchaseTime',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
}
},
{
label: '采购部门',
field: 'purchaseDept',
sort: 'custom',
isSearch: false,
isForm: true,
isTable: true,
table: {
width: '150',
},
form: {
component: 'Input',
}
},
{
label: '采购人',
field: 'purchaser',
sort: 'custom',
form: {
component: 'Input',
{
label: '采购部门',
field: 'purchaseDept',
sort: 'custom',
isSearch: false,
isForm: true,
isTable: true,
table: {
width: '150'
},
form: {
component: 'Input'
}
},
table: {
width: '150',
{
label: '采购人',
field: 'purchaser',
sort: 'custom',
form: {
component: 'Input'
},
table: {
width: '150'
}
},
},
{
label: '供应商',
field: 'supplierNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
{
label: '供应商',
field: 'supplierNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150'
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return supplierList.find((account) => account.number == cellValue)?.name
},
form: {
component: 'Select',
componentProps: {
options: supplierList,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
placeholder: '请选择供应商'
}
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return supplierList.find((account) => account.number == cellValue)?.name
{
label: '供应商',
field: 'supplierNumberDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false
},
form:{
component: 'Select',
componentProps: {
options: supplierList,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
placeholder: "请选择供应商"
{
label: '出厂日期',
field: 'productionDate',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD'
}
}
},
{
label: '供应商',
field: 'supplierNumberDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '出厂日期',
field: 'productionDate',
sort: 'custom',
formatter: dateFormatter,
table: {
width: '150',
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
{
label: '价格',
field: 'purchasePrice',
sort: 'custom',
table: {
width: '150'
}
},
detail: {
dateFormat: 'YYYY-MM-DD'
}
},
{
label: '价格',
field: 'purchasePrice',
sort: 'custom',
table: {
width: '150',
},
},
{
label: '维修状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.BASIC_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
isSearch: false,
isForm: false,
table: {
width: 150
}
{
label: '维修状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.BASIC_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
isSearch: false,
isForm: false,
table: {
width: 150
}
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 200,
fixed: 'right'
isForm: false,
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')]
}
}
},
isDetail: false,
}
]))
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 200,
fixed: 'right'
},
isDetail: false
}
])
)
// 表单校验
export const UpImageRules = reactive({
filePath: [required],
filePath: [required]
})
export const UpImage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '上传图片',
field: 'filePathList',
sort: 'custom',
isForm: true,
form:{
component:'UploadImgs',
export const UpImage = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '上传图片',
field: 'filePathList',
sort: 'custom',
isForm: true,
form: {
component: 'UploadImgs'
}
}
},
]))
])
)
// // 表单校验
// export const UpFileRules = reactive({
// filePath: [required],

38
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -272,16 +272,38 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isForm: false,
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')]
}
}
},
{
label: '操作',
field: 'action',

38
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -517,16 +517,38 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isForm: false,
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')]
}
}
},
// {
// label: '验证时间',
// field: 'verifyTimeDetail',

Loading…
Cancel
Save