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.
201 lines
4.3 KiB
201 lines
4.3 KiB
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import * as ItemApi from "@/api/eam/inspectionItemSelectSet";
|
|
import {
|
|
InspectionItemSelectSet
|
|
} from "@/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data";
|
|
import {getInspectionItemSelectSetPage} from "@/api/eam/inspectionItemSelectSet";
|
|
|
|
// 表单校验
|
|
export const BasicInspectionOptionRules = reactive({
|
|
code: [required],
|
|
name: [required],
|
|
selectId: [required],
|
|
})
|
|
|
|
export const BasicInspectionOption = useCrudSchemas(reactive<CrudSchema[]>([
|
|
{
|
|
label: 'id',
|
|
field: 'id',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
isTable: false,
|
|
isForm: false,
|
|
isDetail:false,
|
|
},
|
|
{
|
|
label: '编号',
|
|
field: 'code',
|
|
sort: 'custom',
|
|
isSearch: true,
|
|
},
|
|
{
|
|
label: '方案名称',
|
|
field: 'name',
|
|
sort: 'custom',
|
|
isSearch: true,
|
|
},
|
|
{
|
|
label: '选择集',
|
|
field: 'selectId',
|
|
sort: 'custom',
|
|
isDetail: true,
|
|
form: {
|
|
componentProps: {
|
|
isSearchList: true, // 开启查询弹窗
|
|
searchTitle: '巡检选择集信息', // 查询弹窗标题
|
|
searchAllSchemas: InspectionItemSelectSet.allSchemas, // 查询弹窗所需类
|
|
searchField: 'name', // 查询弹窗赋值字段
|
|
searchPage: ItemApi.getInspectionItemSelectSetPage, // 查询弹窗所需分页方法
|
|
multiple:true,
|
|
searchCondition: [{
|
|
key: 'available',
|
|
value: 'TRUE',
|
|
action: '==',
|
|
isSearch: true,
|
|
isMainValue: false
|
|
}]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '描述',
|
|
field: 'describing',
|
|
sort: 'custom',
|
|
isSearch: true,
|
|
},
|
|
{
|
|
label: '项是否可修改',
|
|
field: 'isUpdated',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.IS_UPDATED,
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
isTable: true,
|
|
isDetail: false,
|
|
isSearch: true,
|
|
isTableForm: false,
|
|
isForm: true,
|
|
form: {
|
|
component: 'Switch',
|
|
value: 'TRUE',
|
|
componentProps: {
|
|
inactiveValue: 'FALSE',
|
|
activeValue: 'TRUE'
|
|
}
|
|
},
|
|
},
|
|
// {
|
|
// label: '巡检项',
|
|
// field: 'type',
|
|
// sort: 'custom',
|
|
// isSearch: true,
|
|
// },
|
|
{
|
|
label: '创建时间',
|
|
field: 'createTime',
|
|
sort: 'custom',
|
|
formatter: dateFormatter,
|
|
isSearch: true,
|
|
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: '部门id',
|
|
field: 'departmentCode',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
isTable: false,
|
|
isForm: false,
|
|
isDetail:false,
|
|
},
|
|
{
|
|
label: '备注',
|
|
field: 'remark',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
},
|
|
{
|
|
label: '地点ID',
|
|
field: 'siteId',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
isTable: false,
|
|
isForm: false,
|
|
isDetail:false,
|
|
},
|
|
{
|
|
label: '是否可用',
|
|
field: 'available',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
isTable: true,
|
|
isDetail: false,
|
|
isSearch: false,
|
|
isTableForm: false,
|
|
isForm: false,
|
|
},
|
|
{
|
|
label: '删除时间',
|
|
field: 'deletionTime',
|
|
sort: 'custom',
|
|
formatter: dateFormatter,
|
|
isSearch: false,
|
|
isTable: false,
|
|
isForm: false,
|
|
isDetail: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')]
|
|
}
|
|
},
|
|
form: {
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
type: 'datetime',
|
|
valueFormat: 'x'
|
|
}
|
|
},
|
|
},
|
|
{
|
|
label: '删除人id',
|
|
field: 'deleterId',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
isTable: false,
|
|
isForm: false,
|
|
isDetail:false,
|
|
},
|
|
{
|
|
label: '并发乐观锁',
|
|
field: 'concurrencyStamp',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
isTable: false,
|
|
isForm: false,
|
|
isDetail:false,
|
|
form: {
|
|
component: 'InputNumber',
|
|
value: 0
|
|
},
|
|
},
|
|
{
|
|
label: '操作',
|
|
field: 'action',
|
|
isForm: false,
|
|
table: {
|
|
width: 150,
|
|
fixed: 'right'
|
|
}
|
|
}
|
|
]))
|
|
|