feat: handle delete
parent
9c60aa3640
commit
1701c5dae1
|
@ -46,7 +46,7 @@ import { nextTick, ref } from 'vue'
|
||||||
import { getListSimpleUsersApi } from '@/api/system/user'
|
import { getListSimpleUsersApi } from '@/api/system/user'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
const { createMessage } = useMessage()
|
const { createConfirm, createMessage } = useMessage()
|
||||||
const [registerModal, { openModal }] = useModal()
|
const [registerModal, { openModal }] = useModal()
|
||||||
|
|
||||||
const [register, { expandAll, collapseAll, getForm, reload }] = useTable({
|
const [register, { expandAll, collapseAll, getForm, reload }] = useTable({
|
||||||
|
@ -113,12 +113,16 @@ function handleEdit(record: Recordable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) {
|
async function handleDelete(record: Recordable) {
|
||||||
console.log(record)
|
createConfirm({
|
||||||
const res = await deleteDeptApi(record.id)
|
title: '删除',
|
||||||
if (res) {
|
iconType: 'warning',
|
||||||
createMessage.success('删除成功')
|
content: '是否要删除数据?',
|
||||||
reload()
|
async onOk() {
|
||||||
}
|
await deleteDeptApi(record.id)
|
||||||
|
createMessage.success('删除成功')
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFetchSuccess() {
|
function onFetchSuccess() {
|
||||||
|
|
|
@ -87,11 +87,15 @@ async function handleExport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) {
|
async function handleDelete(record: Recordable) {
|
||||||
console.log(record)
|
createConfirm({
|
||||||
const res = await deleteErrorCodeApi(record.id)
|
title: '删除',
|
||||||
if (res) {
|
iconType: 'warning',
|
||||||
createMessage.success('删除成功')
|
content: '是否要删除数据?',
|
||||||
reload()
|
async onOk() {
|
||||||
}
|
await deleteErrorCodeApi(record.id)
|
||||||
|
createMessage.success('删除成功')
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -33,15 +33,14 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="Menu">
|
<script lang="ts" setup name="Menu">
|
||||||
import { BasicTable, useTable, TableAction } from '@/components/Table'
|
import { BasicTable, useTable, TableAction } from '@/components/Table'
|
||||||
import { getMenuListApi } from '@/api/system/menu'
|
import { deleteMenuApi, getMenuListApi } from '@/api/system/menu'
|
||||||
import { columns, searchFormSchema } from './menu.data'
|
import { columns, searchFormSchema } from './menu.data'
|
||||||
import { useModal } from '@/components/Modal'
|
import { useModal } from '@/components/Modal'
|
||||||
import DeptModel from './MenuModel.vue'
|
import DeptModel from './MenuModel.vue'
|
||||||
import { useMessage } from '@/hooks/web/useMessage'
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
import { handleTree } from '@/utils/tree'
|
import { handleTree } from '@/utils/tree'
|
||||||
import { deleteDeptApi } from '@/api/system/dept'
|
|
||||||
|
|
||||||
const { createMessage } = useMessage()
|
const { createConfirm, createMessage } = useMessage()
|
||||||
const [registerModal, { openModal }] = useModal()
|
const [registerModal, { openModal }] = useModal()
|
||||||
|
|
||||||
const [register, { expandAll, collapseAll, getForm, reload }] = useTable({
|
const [register, { expandAll, collapseAll, getForm, reload }] = useTable({
|
||||||
|
@ -87,11 +86,15 @@ function handleEdit(record: Recordable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) {
|
async function handleDelete(record: Recordable) {
|
||||||
console.log(record)
|
createConfirm({
|
||||||
const res = await deleteDeptApi(record.id)
|
title: '删除',
|
||||||
if (res) {
|
iconType: 'warning',
|
||||||
createMessage.success('删除成功')
|
content: '是否要删除数据?',
|
||||||
reload()
|
async onOk() {
|
||||||
}
|
await deleteMenuApi(record.id)
|
||||||
|
createMessage.success('删除成功')
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -37,7 +37,7 @@ import NoticeModal from './NoticeModel.vue'
|
||||||
import { columns, searchFormSchema } from './notice.data'
|
import { columns, searchFormSchema } from './notice.data'
|
||||||
import { useMessage } from '@/hooks/web/useMessage'
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
|
|
||||||
const { createMessage } = useMessage()
|
const { createConfirm, createMessage } = useMessage()
|
||||||
const [registerModal, { openModal }] = useModal()
|
const [registerModal, { openModal }] = useModal()
|
||||||
const [registerTable, { reload }] = useTable({
|
const [registerTable, { reload }] = useTable({
|
||||||
title: '公告列表',
|
title: '公告列表',
|
||||||
|
@ -72,11 +72,15 @@ function handleEdit(record: Recordable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) {
|
async function handleDelete(record: Recordable) {
|
||||||
console.log(record)
|
createConfirm({
|
||||||
const res = await deleteNoticeApi(record.id)
|
title: '删除',
|
||||||
if (res) {
|
iconType: 'warning',
|
||||||
createMessage.success('删除成功')
|
content: '是否要删除数据?',
|
||||||
reload()
|
async onOk() {
|
||||||
}
|
await deleteNoticeApi(record.id)
|
||||||
|
createMessage.success('删除成功')
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -87,11 +87,15 @@ async function handleExport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) {
|
async function handleDelete(record: Recordable) {
|
||||||
console.log(record)
|
createConfirm({
|
||||||
const res = await deletePostApi(record.id)
|
title: '删除',
|
||||||
if (res) {
|
iconType: 'warning',
|
||||||
createMessage.success('删除成功')
|
content: '是否要删除数据?',
|
||||||
reload()
|
async onOk() {
|
||||||
}
|
await deletePostApi(record.id)
|
||||||
|
createMessage.success('删除成功')
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -92,11 +92,15 @@ async function handleExport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) {
|
async function handleDelete(record: Recordable) {
|
||||||
console.log(record)
|
createConfirm({
|
||||||
const res = await deleteSensitiveWordApi(record.id)
|
title: '删除',
|
||||||
if (res) {
|
iconType: 'warning',
|
||||||
createMessage.success('删除成功')
|
content: '是否要删除数据?',
|
||||||
reload()
|
async onOk() {
|
||||||
}
|
await deleteSensitiveWordApi(record.id)
|
||||||
|
createMessage.success('删除成功')
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -39,8 +39,10 @@ import { useModal } from '@/components/Modal'
|
||||||
import UserModel from './UserModel.vue'
|
import UserModel from './UserModel.vue'
|
||||||
import DeptTree from './DeptTree.vue'
|
import DeptTree from './DeptTree.vue'
|
||||||
import { columns, searchFormSchema } from './user.data'
|
import { columns, searchFormSchema } from './user.data'
|
||||||
import { getUserPageApi } from '@/api/system/user'
|
import { deleteUserApi, getUserPageApi } from '@/api/system/user'
|
||||||
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
|
|
||||||
|
const { createConfirm, createMessage } = useMessage()
|
||||||
const [registerModal, { openModal }] = useModal()
|
const [registerModal, { openModal }] = useModal()
|
||||||
const searchInfo = reactive<Recordable>({})
|
const searchInfo = reactive<Recordable>({})
|
||||||
|
|
||||||
|
@ -71,15 +73,23 @@ function handleCreate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEdit(record: Recordable) {
|
function handleEdit(record: Recordable) {
|
||||||
console.log(record)
|
|
||||||
openModal(true, {
|
openModal(true, {
|
||||||
record,
|
record,
|
||||||
isUpdate: true
|
isUpdate: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDelete(record: Recordable) {
|
async function handleDelete(record: Recordable) {
|
||||||
console.log(record)
|
createConfirm({
|
||||||
|
title: '删除',
|
||||||
|
iconType: 'warning',
|
||||||
|
content: '是否要删除数据?',
|
||||||
|
async onOk() {
|
||||||
|
await deleteUserApi(record.id)
|
||||||
|
createMessage.success('删除成功')
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSuccess({ isUpdate, values }) {
|
function handleSuccess({ isUpdate, values }) {
|
||||||
|
|
Loading…
Reference in New Issue