mode
This commit is contained in:
parent
d2c3a9601c
commit
b488863e70
|
@ -6,6 +6,11 @@ import FeTable from "@/components/table"
|
|||
|
||||
const { Option } = Select
|
||||
|
||||
var status = {
|
||||
name: '',
|
||||
sort: ''
|
||||
}
|
||||
|
||||
class UserSet extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
@ -37,12 +42,10 @@ class UserSet extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
submit = (value) => {
|
||||
submit = (search, sort) => {
|
||||
const obj = {
|
||||
search: value || {},
|
||||
sort: {
|
||||
创建时间: value.sort || 'desc'
|
||||
},
|
||||
search: search || {},
|
||||
sort: sort || {},
|
||||
page_size: 10,
|
||||
page_no: 1
|
||||
}
|
||||
|
@ -55,6 +58,8 @@ class UserSet extends Component {
|
|||
dataIndex: item,
|
||||
key,
|
||||
align: 'center',
|
||||
sorter: item !== 'uid' ? (a, b, c) => { this.sort(c, item, search) } : null,
|
||||
defaultSortOrder: 'descend',
|
||||
}
|
||||
})
|
||||
col.push(
|
||||
|
@ -85,6 +90,20 @@ class UserSet extends Component {
|
|||
}
|
||||
|
||||
|
||||
sort = (c, item, search) => {
|
||||
if (status.name === item && status.sort === c) {
|
||||
return false
|
||||
} else {
|
||||
status = {
|
||||
name: item,
|
||||
sort: c
|
||||
}
|
||||
var sort = { [item]: "" }
|
||||
c === 'ascend' ? sort[item] = 'asc' : sort[item] = 'desc'
|
||||
this.submit(search, sort)
|
||||
}
|
||||
}
|
||||
|
||||
callback = (e, value) => {
|
||||
if (e === "停 用") {
|
||||
api.get("/admin/user/disable_user", { UID: value.UID }).then(res => {
|
||||
|
@ -147,12 +166,6 @@ class UserSet extends Component {
|
|||
<Form.Item name="邮箱" label="邮箱">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item name="sort" label="排序">
|
||||
<Select style={{ width: 150 }} defaultValue="降序">
|
||||
<Option value="asc">升序</Option>
|
||||
<Option value="desc">降序</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="状态" label="状态">
|
||||
<Select style={{ width: 150 }}>
|
||||
<Option value="正常">正常</Option>
|
||||
|
|
Loading…
Reference in New Issue