|
@@ -13,10 +13,10 @@
|
|
|
:loading="loading"
|
|
|
bordered
|
|
|
>
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
+ <template #bodyCell="{ column, index }">
|
|
|
<template v-if="column.dataIndex === 'operation'">
|
|
|
- <qm-button type="text" @click="onEdit(record)">编辑</qm-button>
|
|
|
- <qm-button type="text" @click="onDelete(record)">删除</qm-button>
|
|
|
+ <qm-button type="text" @click="onEdit(index)">编辑</qm-button>
|
|
|
+ <qm-button type="text" @click="onDelete(index)">删除</qm-button>
|
|
|
</template>
|
|
|
</template>
|
|
|
</a-table>
|
|
@@ -82,21 +82,22 @@ const { dataList, pagination, loading, getList, toPage, deletePageLastItem } =
|
|
|
|
|
|
const modifyMarkSiteRef = ref();
|
|
|
function onAdd() {
|
|
|
- curRow.value = {};
|
|
|
+ curRow.value = {} as MarkSiteListItem;
|
|
|
modifyMarkSiteRef.value?.open();
|
|
|
}
|
|
|
|
|
|
-async function onEdit(record: MarkSiteListItem) {
|
|
|
- curRow.value = record;
|
|
|
+async function onEdit(index: number) {
|
|
|
+ curRow.value = dataList.value[index];
|
|
|
modifyMarkSiteRef.value?.open();
|
|
|
}
|
|
|
|
|
|
-async function onDelete(record: MarkSiteListItem) {
|
|
|
+async function onDelete(index: number) {
|
|
|
const confirm = await showConfirm({
|
|
|
content: "确定要删除此评卷点信息?",
|
|
|
}).catch(() => false);
|
|
|
if (confirm !== "confirm") return;
|
|
|
|
|
|
+ const record = dataList.value[index];
|
|
|
const res = await markSiteDelete(record.id).catch(() => false);
|
|
|
if (!res) return;
|
|
|
|