Bläddra i källkod

增加删除分组

huangsn 5 år sedan
förälder
incheckning
8b7f470f1f

+ 10 - 0
src/pages/fengkong/features/group/index.js

@@ -4,6 +4,7 @@ import { Link } from 'dva/router'
 import { thanos } from '@/conf/config'
 import { Button } from 'antd'
 import { Divider, message, Popconfirm } from 'antd'
+import { delItem } from './service.js'
 
 const apiUrl = `${thanos}/thanos-admin/api/v1/group/list`
 
@@ -93,6 +94,15 @@ class GroupList extends React.PureComponent {
       this.refresh = refresh
     }
   }
+    // 点击删除按钮时的事件处理函数
+    delItem = (record) => {
+      delItem({ id: record.id, name: record.name }).then(res => {
+        if (res.code === 0) {
+          message.success('删除成功')
+          this.refresh()
+        }
+      })
+    }
 
   render () {
     return (

+ 6 - 0
src/pages/fengkong/features/group/service.js

@@ -24,3 +24,9 @@ export async function update (params) {
   const url = `${thanos}/thanos-admin/api/v1/group/update`
   return fetchApi(url, params)
 }
+
+//删除
+export async function delItem (params) {
+  const url = `${thanos}/thanos-admin/api/v1/group/delete`
+  return fetchApi(url, params)
+}