|
@ -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> |
|
@ -66,7 +66,6 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import {connection} from "@antv/x6/es/registry/attr/connection"; |
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'SampleCode' }) |
|
|
defineOptions({ name: 'SampleCode' }) |
|
|
|
|
|
|
|
@ -139,11 +138,22 @@ const buttonBaseClick = (val, item) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
const isShowMainButton = (row,val) => { |
|
|
const butttondata = [ |
|
|
if (val.indexOf(row.available) > -1) { |
|
|
defaultButtons.mainListEditBtn({hasPermi:'qms:sampleCode:update'}), // 编辑 |
|
|
return false |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'qms:sampleCode:delete'}), // 删除 |
|
|
} else { |
|
|
] |
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const butttondata = (row) => { |
|
|
|
|
|
return [ |
|
|
|
|
|
defaultButtons.mainListEditBtn({hasPermi: 'qms:sampleCode:update'}), |
|
|
|
|
|
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:sampleCode:enable'}), |
|
|
|
|
|
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:sampleCode:disable'}), |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
@ -151,6 +161,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.id) |
|
|
|
|
|
}else if (val == 'disable') { |
|
|
|
|
|
handleDisable(row.id) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -207,6 +221,22 @@ const handleDelete = async (id: number) => { |
|
|
await getList() |
|
|
await getList() |
|
|
} catch {} |
|
|
} catch {} |
|
|
} |
|
|
} |
|
|
|
|
|
const handleEnable = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await SampleCodeApi.enableSampleCode(id) |
|
|
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
const handleDisable = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await SampleCodeApi.disableSampleCode(id) |
|
|
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|