|
@ -33,7 +33,7 @@ |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
@ -90,6 +90,15 @@ const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const judgeStatus = (row) =>{ |
|
|
|
|
|
if(row.available === 'TRUE'){ |
|
|
|
|
|
return true |
|
|
|
|
|
}else{ |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: EquipmentManufacturerApi.getEquipmentManufacturerPage // 分页接口 |
|
|
getListApi: EquipmentManufacturerApi.getEquipmentManufacturerPage // 分页接口 |
|
|
}) |
|
|
}) |
|
@ -132,10 +141,13 @@ const buttonBaseClick = (val, item) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = (row) => { |
|
|
|
|
|
return [ |
|
|
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-manufacturer:update'}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-manufacturer:update'}), // 编辑 |
|
|
|
|
|
defaultButtons.mainListEnableBtn({hasPermi:'eam:inspection-item:enable',hide: judgeStatus(row)}), // 启用 |
|
|
|
|
|
defaultButtons.mainListDisableBtn({hasPermi:'eam:inspection-item:disable',hide: !judgeStatus(row)}), // 禁用 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-manufacturer:delete'}), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-manufacturer:delete'}), // 删除 |
|
|
] |
|
|
]} |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
@ -143,6 +155,10 @@ const buttonTableClick = async (val, row) => { |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
|
|
|
} else if (val == 'enable') { // 启用 |
|
|
|
|
|
handleEnable(row,'TRUE') |
|
|
|
|
|
}else if (val == 'disable') {// 禁用 |
|
|
|
|
|
handleEnable(row,'FALSE') |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -235,6 +251,17 @@ const searchFormClick = (searchData) => { |
|
|
getList() // 刷新当前列表 |
|
|
getList() // 刷新当前列表 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleEnable = (row,enable) =>{ |
|
|
|
|
|
message.confirm(t('您确定'+(enable=='TRUE'?'启用':'禁用')+'该项吗, 是否继续?')).then(() => { |
|
|
|
|
|
row.available = enable |
|
|
|
|
|
EquipmentManufacturerApi.updateEquipmentManufacturer(row).then(res => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
getList() |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|