|
@@ -28,7 +28,7 @@
|
|
|
<HcTable :loading="tableLoading" :column="tableColumn" :datas="tableData">
|
|
|
<template #action="{row, index}">
|
|
|
<el-button type="primary" size="small" @click="editRowClick(row)">编辑</el-button>
|
|
|
- <el-button type="danger" size="small">删除</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="delRowClick(row)">删除</el-button>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
<template #action>
|
|
@@ -43,6 +43,7 @@ import mainApi from "~api/people/contract";
|
|
|
import {useRouter} from 'vue-router'
|
|
|
import {getuserList} from "~api/other";
|
|
|
import {getArrValue} from "js-fast-way";
|
|
|
+import {delMessage} from "~uti/tools";
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
@@ -115,4 +116,17 @@ const editRowClick = (row) => {
|
|
|
query: {id: row.id}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+//删除
|
|
|
+const delRowClick = (row) => {
|
|
|
+ delMessage(async () => {
|
|
|
+ const {error, code, msg} = await mainApi.remove({ids: row.id})
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message?.success(msg)
|
|
|
+ getTableData().then()
|
|
|
+ } else {
|
|
|
+ window.$message?.error(msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|