|
|
@ -33,7 +33,7 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -132,18 +132,29 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'qms:aql:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'qms:aql:delete'}), // 删除 |
|
|
|
] |
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
if (val.indexOf(row.available) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi: 'qms:aql:update'}), |
|
|
|
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:aql:enable'}), |
|
|
|
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:aql:disable'}), |
|
|
|
] |
|
|
|
} |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'enable') { |
|
|
|
handleEnable(row.id) |
|
|
|
}else if (val == 'disable') { |
|
|
|
handleDisable(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -195,6 +206,22 @@ const handleDelete = async (id: number) => { |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
const handleEnable = async (id: number) => { |
|
|
|
try { |
|
|
|
await AqlApi.enableAql(id) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
const handleDisable = async (id: number) => { |
|
|
|
try { |
|
|
|
await AqlApi.disableAql(id) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|