|
@@ -3,6 +3,8 @@ import { FilterTable } from 'wptpc-design'
|
|
import { Link } from 'dva/router'
|
|
import { Link } from 'dva/router'
|
|
import { thanos } from '@/conf/config'
|
|
import { thanos } from '@/conf/config'
|
|
import { Button } from 'antd'
|
|
import { Button } from 'antd'
|
|
|
|
+import { Divider, message, Popconfirm } from 'antd'
|
|
|
|
+import { delItem } from './service.js'
|
|
|
|
|
|
const apiUrl = `${thanos}/thanos-admin/api/v1/group/list`
|
|
const apiUrl = `${thanos}/thanos-admin/api/v1/group/list`
|
|
|
|
|
|
@@ -66,12 +68,41 @@ class GroupList extends React.PureComponent {
|
|
{
|
|
{
|
|
title: '修改人',
|
|
title: '修改人',
|
|
dataIndex: 'updateUser'
|
|
dataIndex: 'updateUser'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '操作',
|
|
|
|
+ dataIndex: 'actions',
|
|
|
|
+ // 所有需要弹窗操作的都可以用编辑的逻辑;所有不需要弹窗的操作,比如上架、发布等,都可以用”删除“的逻辑
|
|
|
|
+ render: (text, record) => (
|
|
|
|
+ <span>
|
|
|
|
+ <Link
|
|
|
|
+ to={{
|
|
|
|
+ pathname: './edit/' + record.name,
|
|
|
|
+ state: record
|
|
|
|
+ }}
|
|
|
|
+ >编辑</Link>
|
|
|
|
+ <Divider type="vertical"/>
|
|
|
|
+ <Popconfirm
|
|
|
|
+ title="确定删除"
|
|
|
|
+ onConfirm={() => this.delItem(record)}>
|
|
|
|
+ <a>删除</a>
|
|
|
|
+ </Popconfirm>
|
|
|
|
+ </span>)
|
|
}
|
|
}
|
|
],
|
|
],
|
|
getRefresh: refresh => {
|
|
getRefresh: refresh => {
|
|
this.refresh = refresh
|
|
this.refresh = refresh
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 点击删除按钮时的事件处理函数
|
|
|
|
+ delItem = (record) => {
|
|
|
|
+ delItem({ id: record.id, name: record.name }).then(res => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ message.success('删除成功')
|
|
|
|
+ this.refresh()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
render () {
|
|
render () {
|
|
return (
|
|
return (
|