|
|
@ -13,225 +13,223 @@ export const ClassTypeRules = reactive({ |
|
|
|
engineerRoleName: [required], |
|
|
|
type: [required], |
|
|
|
factoryAreaNumber: [required], |
|
|
|
factoryAreaName: [required], |
|
|
|
factoryAreaName: [required] |
|
|
|
}) |
|
|
|
const userStore = useUserStore() |
|
|
|
const FactoryAreaNoPage = await deptApi.getDeptPage({'deptGroup':'factory'}) |
|
|
|
const FactoryAreaNoPage = await deptApi.getDeptPage({ deptGroup: 'factory' }) |
|
|
|
const roleList = await roleApi.getSimpleRoleList({}) |
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
// 假设你想添加一个新的工厂区域
|
|
|
|
// const factoryList = [...factoryListResult, {
|
|
|
|
// ...userStore.userSelfInfo.dept
|
|
|
|
// }]
|
|
|
|
console.log('FactoryAreaNoPage',FactoryAreaNoPage); |
|
|
|
console.log('roleList',roleList); |
|
|
|
console.log('FactoryAreaNoPage', FactoryAreaNoPage) |
|
|
|
console.log('roleList', roleList) |
|
|
|
|
|
|
|
const FactoryAreaNumbers = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
const FactoryAreaNumbers = useCrudSchemas( |
|
|
|
reactive<CrudSchema[]>([ |
|
|
|
{ |
|
|
|
label: '编号', |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '编号', |
|
|
|
|
|
|
|
field: 'id', |
|
|
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
|
|
isSearch: true, |
|
|
|
isForm: true, |
|
|
|
|
|
|
|
table: { |
|
|
|
|
|
|
|
width: 180, |
|
|
|
|
|
|
|
fixed: 'left' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '名称', |
|
|
|
|
|
|
|
field: 'name', |
|
|
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
])) |
|
|
|
export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
{ |
|
|
|
label: '维修工角色', |
|
|
|
field: 'workerRoleId', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return roleList.find((item) => item.id == cellValue)?.name |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '维修工角色', |
|
|
|
field: 'workerRoleName', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: { |
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择角色', // 输入框占位文本
|
|
|
|
searchField: 'id', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '维修工角色', // 查询弹窗标题
|
|
|
|
searchAllSchemas: Role.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: roleApi.getRolePages, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [ |
|
|
|
// {
|
|
|
|
// key: 'deptGroup',
|
|
|
|
// value: 'factory',
|
|
|
|
// isMainValue: false
|
|
|
|
// }
|
|
|
|
] |
|
|
|
field: 'id', |
|
|
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
|
|
isSearch: true, |
|
|
|
isForm: true, |
|
|
|
|
|
|
|
table: { |
|
|
|
width: 180, |
|
|
|
|
|
|
|
fixed: 'left' |
|
|
|
} |
|
|
|
}, |
|
|
|
isDetail: false, |
|
|
|
isTable: false, |
|
|
|
isTableForm: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '工程师角色', |
|
|
|
field: 'engineerRoleId', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return roleList.find((account) => account.id == cellValue)?.name |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '工程师角色', |
|
|
|
field: 'engineerRoleName', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: { |
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择角色', // 输入框占位文本
|
|
|
|
searchField: 'id', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '工程师角色', // 查询弹窗标题
|
|
|
|
searchAllSchemas: Role.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: roleApi.getRolePages, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [ |
|
|
|
// {
|
|
|
|
// key: 'deptGroup',
|
|
|
|
// value: 'factory',
|
|
|
|
// isMainValue: false
|
|
|
|
// }
|
|
|
|
] |
|
|
|
|
|
|
|
{ |
|
|
|
label: '名称', |
|
|
|
|
|
|
|
field: 'name', |
|
|
|
|
|
|
|
sort: 'custom' |
|
|
|
} |
|
|
|
]) |
|
|
|
) |
|
|
|
export const ClassType = useCrudSchemas( |
|
|
|
reactive<CrudSchema[]>([ |
|
|
|
{ |
|
|
|
label: '维修工角色', |
|
|
|
field: 'workerRoleId', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return roleList.find((item) => item.id == cellValue)?.name |
|
|
|
} |
|
|
|
}, |
|
|
|
isDetail: false, |
|
|
|
isTable: false, |
|
|
|
isTableForm: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '班组类型', |
|
|
|
field: 'type', |
|
|
|
dictType: DICT_TYPE.CLASS_TYPE, |
|
|
|
isSearch: true, |
|
|
|
dictClass: 'string', |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
component: 'Select' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '描述', |
|
|
|
field: 'describes', |
|
|
|
sort: 'custom', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '所属厂区', |
|
|
|
field: 'factoryAreaNumber', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
isSearch: true, |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
search: { |
|
|
|
show: true, |
|
|
|
component: 'Select', |
|
|
|
api: () => factoryList, |
|
|
|
componentProps: { |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'id' |
|
|
|
}, |
|
|
|
filterable: true, |
|
|
|
{ |
|
|
|
label: '维修工角色', |
|
|
|
field: 'workerRoleName', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: { |
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择角色', // 输入框占位文本
|
|
|
|
searchField: 'id', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '维修工角色', // 查询弹窗标题
|
|
|
|
searchAllSchemas: Role.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: roleApi.getRolePages, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [ |
|
|
|
// {
|
|
|
|
// key: 'deptGroup',
|
|
|
|
// value: 'factory',
|
|
|
|
// isMainValue: false
|
|
|
|
// }
|
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
isDetail: false, |
|
|
|
isTable: false, |
|
|
|
isTableForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '工程师角色', |
|
|
|
field: 'engineerRoleId', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return roleList.find((account) => account.id == cellValue)?.name |
|
|
|
} |
|
|
|
}, |
|
|
|
//给列表用的
|
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return FactoryAreaNoPage.find((account) => account.id == cellValue)?.name |
|
|
|
{ |
|
|
|
label: '工程师角色', |
|
|
|
field: 'engineerRoleName', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: { |
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择角色', // 输入框占位文本
|
|
|
|
searchField: 'id', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '工程师角色', // 查询弹窗标题
|
|
|
|
searchAllSchemas: Role.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: roleApi.getRolePages, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [ |
|
|
|
// {
|
|
|
|
// key: 'deptGroup',
|
|
|
|
// value: 'factory',
|
|
|
|
// isMainValue: false
|
|
|
|
// }
|
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
isDetail: false, |
|
|
|
isTable: false, |
|
|
|
isTableForm: false |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '所属厂区', |
|
|
|
field: 'factoryAreaName', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
isSearch: false, |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: { |
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择厂区', // 输入框占位文本
|
|
|
|
searchField: 'id', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '厂区信息', // 查询弹窗标题
|
|
|
|
searchAllSchemas: FactoryAreaNumbers.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: deptApi.getDeptPages, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [ |
|
|
|
{ |
|
|
|
key: 'deptGroup', |
|
|
|
value: 'factory', |
|
|
|
isMainValue: false |
|
|
|
} |
|
|
|
] |
|
|
|
{ |
|
|
|
label: '班组类型', |
|
|
|
field: 'type', |
|
|
|
dictType: DICT_TYPE.CLASS_TYPE, |
|
|
|
isSearch: true, |
|
|
|
dictClass: 'string', |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
component: 'Select' |
|
|
|
} |
|
|
|
}, |
|
|
|
isDetail: false, |
|
|
|
isTable: false, |
|
|
|
isTableForm: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建者', |
|
|
|
field: 'creator', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
|
hiddenSearchHigh: true, |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
|
|
|
|
{ |
|
|
|
label: '所属厂区', |
|
|
|
field: 'factoryAreaNumber', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
isSearch: true, |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
search: { |
|
|
|
show: true, |
|
|
|
component: 'Select', |
|
|
|
api: () => factoryList, |
|
|
|
componentProps: { |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'id' |
|
|
|
}, |
|
|
|
filterable: true |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|
field: 'createTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
hiddenSearchHigh: true, |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 170 |
|
|
|
//给列表用的
|
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return FactoryAreaNoPage.find((account) => account.id == cellValue)?.name |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '所属厂区', |
|
|
|
field: 'factoryAreaName', |
|
|
|
hiddenSearchHigh: true, |
|
|
|
isSearch: false, |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: { |
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择厂区', // 输入框占位文本
|
|
|
|
searchField: 'id', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '厂区信息', // 查询弹窗标题
|
|
|
|
searchAllSchemas: FactoryAreaNumbers.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: deptApi.getDeptPages, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [ |
|
|
|
{ |
|
|
|
key: 'deptGroup', |
|
|
|
value: 'factory', |
|
|
|
isMainValue: false |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '操作', |
|
|
|
field: 'action', |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 150, |
|
|
|
fixed: 'right' |
|
|
|
isDetail: false, |
|
|
|
isTable: false, |
|
|
|
isTableForm: false |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '描述', |
|
|
|
field: 'describes', |
|
|
|
sort: 'custom' |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建者', |
|
|
|
field: 'creator', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
|
hiddenSearchHigh: true, |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|
field: 'createTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
hiddenSearchHigh: true, |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 170 |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '操作', |
|
|
|
field: 'action', |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 150, |
|
|
|
fixed: 'right' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
])) |
|
|
|
]) |
|
|
|
) |
|
|
|