|
@ -13,23 +13,22 @@ export const ClassTypeRules = reactive({ |
|
|
engineerRoleName: [required], |
|
|
engineerRoleName: [required], |
|
|
type: [required], |
|
|
type: [required], |
|
|
factoryAreaNumber: [required], |
|
|
factoryAreaNumber: [required], |
|
|
factoryAreaName: [required], |
|
|
factoryAreaName: [required] |
|
|
}) |
|
|
}) |
|
|
const userStore = useUserStore() |
|
|
const userStore = useUserStore() |
|
|
const FactoryAreaNoPage = await deptApi.getDeptPage({'deptGroup':'factory'}) |
|
|
const FactoryAreaNoPage = await deptApi.getDeptPage({ deptGroup: 'factory' }) |
|
|
const roleList = await roleApi.getSimpleRoleList({}) |
|
|
const roleList = await roleApi.getSimpleRoleList({}) |
|
|
const factoryList = await selectAllFactoryArea() |
|
|
const factoryList = await selectAllFactoryArea() |
|
|
// 假设你想添加一个新的工厂区域
|
|
|
// 假设你想添加一个新的工厂区域
|
|
|
// const factoryList = [...factoryListResult, {
|
|
|
// const factoryList = [...factoryListResult, {
|
|
|
// ...userStore.userSelfInfo.dept
|
|
|
// ...userStore.userSelfInfo.dept
|
|
|
// }]
|
|
|
// }]
|
|
|
console.log('FactoryAreaNoPage',FactoryAreaNoPage); |
|
|
console.log('FactoryAreaNoPage', FactoryAreaNoPage) |
|
|
console.log('roleList',roleList); |
|
|
console.log('roleList', roleList) |
|
|
|
|
|
|
|
|
const FactoryAreaNumbers = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const FactoryAreaNumbers = useCrudSchemas( |
|
|
|
|
|
reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
label: '编号', |
|
|
label: '编号', |
|
|
|
|
|
|
|
|
field: 'id', |
|
|
field: 'id', |
|
@ -40,27 +39,23 @@ console.log('roleList',roleList); |
|
|
isForm: true, |
|
|
isForm: true, |
|
|
|
|
|
|
|
|
table: { |
|
|
table: { |
|
|
|
|
|
|
|
|
width: 180, |
|
|
width: 180, |
|
|
|
|
|
|
|
|
fixed: 'left' |
|
|
fixed: 'left' |
|
|
|
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
label: '名称', |
|
|
label: '名称', |
|
|
|
|
|
|
|
|
field: 'name', |
|
|
field: 'name', |
|
|
|
|
|
|
|
|
sort: 'custom', |
|
|
sort: 'custom' |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
]) |
|
|
])) |
|
|
) |
|
|
export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
export const ClassType = useCrudSchemas( |
|
|
|
|
|
reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
label: '维修工角色', |
|
|
label: '维修工角色', |
|
|
field: 'workerRoleId', |
|
|
field: 'workerRoleId', |
|
@ -69,7 +64,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isForm: false, |
|
|
isForm: false, |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
return roleList.find((item) => item.id == cellValue)?.name |
|
|
return roleList.find((item) => item.id == cellValue)?.name |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '维修工角色', |
|
|
label: '维修工角色', |
|
@ -96,7 +91,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
}, |
|
|
}, |
|
|
isDetail: false, |
|
|
isDetail: false, |
|
|
isTable: false, |
|
|
isTable: false, |
|
|
isTableForm: false, |
|
|
isTableForm: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '工程师角色', |
|
|
label: '工程师角色', |
|
@ -106,7 +101,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isForm: false, |
|
|
isForm: false, |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
return roleList.find((account) => account.id == cellValue)?.name |
|
|
return roleList.find((account) => account.id == cellValue)?.name |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '工程师角色', |
|
|
label: '工程师角色', |
|
@ -133,7 +128,7 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
}, |
|
|
}, |
|
|
isDetail: false, |
|
|
isDetail: false, |
|
|
isTable: false, |
|
|
isTable: false, |
|
|
isTableForm: false, |
|
|
isTableForm: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '班组类型', |
|
|
label: '班组类型', |
|
@ -144,13 +139,9 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
form: { |
|
|
form: { |
|
|
component: 'Select' |
|
|
component: 'Select' |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '描述', |
|
|
|
|
|
field: 'describes', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
{ |
|
|
label: '所属厂区', |
|
|
label: '所属厂区', |
|
|
field: 'factoryAreaNumber', |
|
|
field: 'factoryAreaNumber', |
|
@ -167,13 +158,13 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
labelField: 'name', |
|
|
labelField: 'name', |
|
|
valueField: 'id' |
|
|
valueField: 'id' |
|
|
}, |
|
|
}, |
|
|
filterable: true, |
|
|
filterable: true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
//给列表用的
|
|
|
//给列表用的
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
return FactoryAreaNoPage.find((account) => account.id == cellValue)?.name |
|
|
return FactoryAreaNoPage.find((account) => account.id == cellValue)?.name |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '所属厂区', |
|
|
label: '所属厂区', |
|
@ -201,7 +192,13 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
}, |
|
|
}, |
|
|
isDetail: false, |
|
|
isDetail: false, |
|
|
isTable: false, |
|
|
isTable: false, |
|
|
isTableForm: false, |
|
|
isTableForm: false |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
label: '描述', |
|
|
|
|
|
field: 'describes', |
|
|
|
|
|
sort: 'custom' |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '创建者', |
|
|
label: '创建者', |
|
@ -234,4 +231,5 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
fixed: 'right' |
|
|
fixed: 'right' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
])) |
|
|
]) |
|
|
|
|
|
) |
|
|