refactor: 轮播图模态框
This commit is contained in:
1 parent
0558261ba7
commit
73fb136b91
5 files changed
+45
-38
No files matched your search
@@ -40,12 +40,12 @@ const isEdit = ref<boolean>(false)
|
||||
const currentTableData = ref<CarousalResult | null>(null)
|
||||
|
||||
|
||||
const editClick = (row: object): void => {
|
||||
const handleEdit = (row: object): void => {
|
||||
isEdit.value = true
|
||||
currentTableData.value = Object.assign({}, row)
|
||||
carousalDialogVisible.value = true
|
||||
}
|
||||
const showClick = async (res: CarousalResult): Promise<void> => {
|
||||
const handleShow = async (res: CarousalResult): Promise<void> => {
|
||||
if (res.status === 'active') {
|
||||
await inactiveCarousal(res.id)
|
||||
} else {
|
||||
@@ -53,7 +53,7 @@ const showClick = async (res: CarousalResult): Promise<void> => {
|
||||
}
|
||||
await fetchData()
|
||||
}
|
||||
const delClick = async (row: CarousalResult): Promise<void> => {
|
||||
const handleDelete = async (row: CarousalResult): Promise<void> => {
|
||||
await deleteCarousal(row.id)
|
||||
await fetchData()
|
||||
}
|
||||
@@ -62,7 +62,6 @@ const handleCreateCarousal = (): void => {
|
||||
carousalDialogVisible.value = true
|
||||
currentTableData.value = {}
|
||||
}
|
||||
|
||||
const handleSuccessDialog = async (): Promise<void> => {
|
||||
await fetchData()
|
||||
carousalDialogVisible.value = false
|
||||
@@ -109,11 +108,11 @@ const handleSuccessDialog = async (): Promise<void> => {
|
||||
</TSpace>
|
||||
</template>
|
||||
<template #operation="{ row }">
|
||||
<TButton variant="text" size="small" theme="primary" @click="editClick(row)">编辑</TButton>
|
||||
<TButton variant="text" size="small" theme="primary" @click="showClick(row)">{{
|
||||
<TButton variant="text" size="small" theme="primary" @click="handleEdit(row)">编辑</TButton>
|
||||
<TButton variant="text" size="small" theme="primary" @click="handleShow(row)">{{
|
||||
row.status === 'active' ? '关闭显示' : '开启显示'
|
||||
}}</TButton>
|
||||
<TButton variant="text" size="small" theme="danger" @click="delClick(row)">删除</TButton>
|
||||
<TButton variant="text" size="small" theme="danger" @click="handleDelete(row)">删除</TButton>
|
||||
</template>
|
||||
</TTable>
|
||||
<CarousalDialog
|
||||
|
||||
Reference in new issue
Block a user