|
|
@@ -2,7 +2,7 @@
|
|
|
<div>
|
|
|
<el-card>
|
|
|
<template #header>
|
|
|
- <el-button type="primary" @click="openDrawer()">
|
|
|
+ <el-button type="primary" @click="openEditDrawer()">
|
|
|
<template #icon>
|
|
|
<el-icon>
|
|
|
<PlusOutlined />
|
|
|
@@ -12,18 +12,18 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
|
|
|
- <el-table height="calc(100vh - 300px)" :data="personGroupList">
|
|
|
+ <el-table height="calc(100vh - 256px)" :data="personGroupList">
|
|
|
<el-table-column label="分组名" width="300" prop="name" />
|
|
|
<el-table-column label="分组描述" prop="description" />
|
|
|
- <el-table-column label="人员数量" width="100" prop="total" />
|
|
|
+ <el-table-column label="人员数量" width="200" prop="total" />
|
|
|
<el-table-column label="创建人" width="200" prop="operatorName" />
|
|
|
<el-table-column label="创建时间" width="200" prop="operationTime" />
|
|
|
<el-table-column label="操作" width="240">
|
|
|
<template #default="{ row }">
|
|
|
<section class="actions">
|
|
|
- <el-buton type="primary" link @click="">查看</el-buton>
|
|
|
- <el-buton type="primary" link @click="">编辑</el-buton>
|
|
|
- <el-buton type="primary" link @click="">删除</el-buton>
|
|
|
+ <el-button type="primary" link @click="openCheckDrawer(row)">查看</el-button>
|
|
|
+ <el-button type="primary" link @click="openEditDrawer(row)">编辑</el-button>
|
|
|
+ <el-button type="primary" link @click="deleteGroup(row)">删除</el-button>
|
|
|
</section>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -40,8 +40,8 @@
|
|
|
@change="queryPersonGroupList"
|
|
|
/>
|
|
|
</section>
|
|
|
-
|
|
|
- <PersonGroupDrawer :title="drawerTitle" ref="drawerInstance" @submitted="onSubmit" />
|
|
|
+ <PersonGroupEditDrawer :title="drawerTitle" ref="editDrawerInstance" @submitted="onSubmit" />
|
|
|
+ <PersonGroupExhibitionDrawer :title="drawerTitle" ref="exhibitionDrawerInstance" />
|
|
|
</el-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -49,18 +49,42 @@
|
|
|
<script setup lang="ts">
|
|
|
import { PlusOutlined } from '@vicons/antd';
|
|
|
import { QueryPersonGroupPageParams, PersonGroupListItem } from '@/types/person-group/type';
|
|
|
+ import { deleteUserGroup } from '@/api/system/person-group';
|
|
|
import usePersonGroupListQuery from './hooks/usePersonGroupListQuery';
|
|
|
- import PersonGroupDrawer from './components/PersonGroupDrawer.vue';
|
|
|
+ import PersonGroupEditDrawer from './components/PersonGroupEditDrawer.vue';
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
+ import PersonGroupExhibitionDrawer from './components/PersonGroupExhibitionDrawer.vue';
|
|
|
+ import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
|
|
|
const { personGroupListRequestParams, personGroupList, total, setRequestParams, queryPersonGroupList } =
|
|
|
usePersonGroupListQuery();
|
|
|
|
|
|
const drawerTitle = ref('');
|
|
|
- const drawerInstance = ref();
|
|
|
- function openDrawer(row?: PersonGroupListItem) {
|
|
|
+ const editDrawerInstance = ref();
|
|
|
+ const exhibitionDrawerInstance = ref();
|
|
|
+ function openEditDrawer(row?: PersonGroupListItem) {
|
|
|
drawerTitle.value = row ? '编辑人员分组' : '新建人员分组';
|
|
|
- drawerInstance.value?.open(row);
|
|
|
+ editDrawerInstance.value?.open(row);
|
|
|
+ }
|
|
|
+
|
|
|
+ function openCheckDrawer(row: PersonGroupListItem) {
|
|
|
+ drawerTitle.value = '查看人员分组';
|
|
|
+ exhibitionDrawerInstance.value?.open(row);
|
|
|
+ }
|
|
|
+ function deleteGroup(row: PersonGroupListItem) {
|
|
|
+ ElMessageBox.confirm('确认删除,删除后无法恢复,确认删除吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ deleteUserGroup(row.id).then(() => {
|
|
|
+ queryPersonGroupList();
|
|
|
+ ElMessage.success('删除成功');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ ElMessage.error(e);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
const onSubmit = () => {
|