AnalysisSystemForRadionucli.../src/views/system/UserList.vue

180 lines
4.3 KiB
Vue
Raw Normal View History

2023-05-06 15:58:45 +08:00
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<search-form :items="formItems" v-model="queryParam" @search="searchQuery">
<a-space style="float: right" class="btn-group" slot="additional">
<a-button @click="handleAdd" type="primary">
<img src="@/assets/images/global/add.png" alt="" />
Add
2023-05-06 15:58:45 +08:00
</a-button>
<a-button @click="handleAdd" type="primary">
<img src="@/assets/images/global/edit.png" alt="" />
Edit
</a-button>
<a-button @click="handleAdd" type="primary">
<img src="@/assets/images/global/delete.png" alt="" />
Delete
</a-button>
<a-button @click="handleAdd" type="primary">
<img src="@/assets/images/global/reset-pwd.png" alt="" />
Reset pwd
</a-button>
</a-space>
</search-form>
2023-05-06 15:58:45 +08:00
<div>
<a-table
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange"
>
<template slot="index" slot-scope="text, record, index">
{{ index + 1 }}
2023-05-06 15:58:45 +08:00
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
2023-05-06 15:58:45 +08:00
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link"> 更多 <a-icon type="down" /> </a>
2023-05-06 15:58:45 +08:00
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleChangePassword(record.username)">密码</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
<a-menu-item v-if="record.status == 1">
<a-popconfirm title="确定冻结吗?" @confirm="() => handleFrozen(record.id, 2, record.username)">
2023-05-06 15:58:45 +08:00
<a>冻结</a>
</a-popconfirm>
</a-menu-item>
<a-menu-item v-if="record.status == 2">
<a-popconfirm title="确定解冻吗?" @confirm="() => handleFrozen(record.id, 1, record.username)">
2023-05-06 15:58:45 +08:00
<a>解冻</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- table区域-end -->
</a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import SearchForm from '@/components/SearchForm'
const formItems = [
{
type: 'a-input',
label: 'User',
name: 'username',
span: 4
},
{
type: 'a-input',
label: 'Name',
name: 'realname',
span: 4
},
{
type: 'custom-select',
label: 'Role',
name: 'role',
span: 4,
props: {
options: [
{
label: 'test',
value: '1'
2023-05-06 15:58:45 +08:00
},
{
label: 'test2',
value: '2'
2023-05-06 15:58:45 +08:00
}
]
}
}
]
export default {
name: 'UserList',
mixins: [JeecgListMixin],
components: {
SearchForm
},
data() {
this.formItems = formItems
return {
queryParam: {},
columns: [
{
title: 'NO',
align: 'center',
width: 100,
scopedSlots: {
customRender: 'index'
2023-05-06 15:58:45 +08:00
}
},
{
title: 'USER',
align: 'center',
dataIndex: 'username',
width: 100
},
{
title: 'NAME',
align: 'center',
width: 100,
dataIndex: 'realname'
},
{
title: 'ROLE',
align: 'center',
width: 100,
dataIndex: 'roleCode'
},
{
title: 'PHONE',
align: 'center',
width: 100,
dataIndex: 'phone'
2023-05-06 15:58:45 +08:00
}
],
url: {
list: '/sys/user/list',
delete: '/sys/user/delete'
}
2023-05-06 15:58:45 +08:00
}
},
methods: {}
}
2023-05-06 15:58:45 +08:00
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.btn-group {
img {
margin-right: 12px;
height: 18px;
}
}
</style>