|
|
@ -32,8 +32,8 @@ |
|
|
|
<span>{{ row.recordNo }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<template #action="{ row,$index }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -154,13 +154,24 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
//defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:update'}), // 编辑 |
|
|
|
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceRecordMain:delete'}), // 删除 |
|
|
|
defaultButtons.maintainExperienceBtn({ hasPermi: 'eam:equipmentMaintenanceRecordMain:maintainExperience' }) // 生成保养经验 |
|
|
|
] |
|
|
|
|
|
|
|
const butttondata = (row,$index) => { |
|
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
|
if(findIndex>-1&&findIndex<$index){ |
|
|
|
return [] |
|
|
|
} |
|
|
|
return [ |
|
|
|
defaultButtons.repairExperienceBtn({ hide:isShowMainButton(row,['0']),hasPermi: 'eam:equipmentMaintenanceRecordMain:maintainExperience' }) // 生成维修经验 |
|
|
|
] |
|
|
|
} |
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
console.log(row.isExperience) |
|
|
|
if (val.indexOf(row.isExperience) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|