|
@@ -23,14 +23,14 @@
|
|
|
<template v-if="column.key === 'action'">
|
|
<template v-if="column.key === 'action'">
|
|
|
<a-space>
|
|
<a-space>
|
|
|
<a href="#" @click="openModal('update', record)" >编辑</a>
|
|
<a href="#" @click="openModal('update', record)" >编辑</a>
|
|
|
- <a-popconfirm
|
|
|
|
|
|
|
+ <!-- <a-popconfirm
|
|
|
title="确实要删除吗?"
|
|
title="确实要删除吗?"
|
|
|
ok-text="确定"
|
|
ok-text="确定"
|
|
|
cancel-text="取消"
|
|
cancel-text="取消"
|
|
|
@confirm="delUser(record.id)"
|
|
@confirm="delUser(record.id)"
|
|
|
>
|
|
>
|
|
|
<a href="#">删除</a>
|
|
<a href="#">删除</a>
|
|
|
- </a-popconfirm>
|
|
|
|
|
|
|
+ </a-popconfirm> -->
|
|
|
</a-space>
|
|
</a-space>
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
@@ -84,15 +84,22 @@ const useForm = Form.useForm
|
|
|
|
|
|
|
|
const queryState = reactive({
|
|
const queryState = reactive({
|
|
|
page: 1,
|
|
page: 1,
|
|
|
- pageSize: 10
|
|
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ total: 0
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const state = reactive({
|
|
|
|
|
|
|
+const state = reactive<{
|
|
|
|
|
+ loading: boolean
|
|
|
|
|
+ dataSource: USER.User.Detail[]
|
|
|
|
|
+ opraState: 'add' | 'update'
|
|
|
|
|
+ visible: boolean,
|
|
|
|
|
+ detail: USER.User.Detail | null
|
|
|
|
|
+}>({
|
|
|
loading: false,
|
|
loading: false,
|
|
|
dataSource: [],
|
|
dataSource: [],
|
|
|
opraState: 'add',
|
|
opraState: 'add',
|
|
|
visible: false,
|
|
visible: false,
|
|
|
- detail: {}
|
|
|
|
|
|
|
+ detail: null
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const modelRef = reactive({
|
|
const modelRef = reactive({
|
|
@@ -123,10 +130,10 @@ const submit = () => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const delUser = async (id: string) => {
|
|
|
|
|
- await UserController.del(id)
|
|
|
|
|
- getUserList()
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// const delUser = async (id: string) => {
|
|
|
|
|
+// await UserController.del(id)
|
|
|
|
|
+// getUserList()
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
const changePage = ({ current }) => {
|
|
const changePage = ({ current }) => {
|
|
|
queryState.page = current
|
|
queryState.page = current
|
|
@@ -135,12 +142,14 @@ const changePage = ({ current }) => {
|
|
|
|
|
|
|
|
const getUserList = async () => {
|
|
const getUserList = async () => {
|
|
|
state.loading = true
|
|
state.loading = true
|
|
|
- const { data } = await UserController.page(queryState)
|
|
|
|
|
|
|
+ const { data, sum } = await UserController.page(queryState)
|
|
|
|
|
+ state.dataSource = data
|
|
|
|
|
+ queryState.total = sum
|
|
|
state.loading = false
|
|
state.loading = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- // getUserList()
|
|
|
|
|
|
|
+ getUserList()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|