|
@@ -2,16 +2,15 @@
|
|
|
<div class="info-container">
|
|
<div class="info-container">
|
|
|
<BasicForm ref="basicFormRef" :formData="ruleFormData" :formRules="formRules" :formConfig="ruleFormConfig">
|
|
<BasicForm ref="basicFormRef" :formData="ruleFormData" :formRules="formRules" :formConfig="ruleFormConfig">
|
|
|
<template #deptName>
|
|
<template #deptName>
|
|
|
- <el-tree-select
|
|
|
|
|
|
|
+ <el-select
|
|
|
v-model="ruleFormData.deptIdList"
|
|
v-model="ruleFormData.deptIdList"
|
|
|
- :data="deptList"
|
|
|
|
|
- check-strictly
|
|
|
|
|
multiple
|
|
multiple
|
|
|
- node-key="id"
|
|
|
|
|
- :props="{ label: 'deptName', children: 'children' }"
|
|
|
|
|
placeholder="请选择被检查(自查)单位"
|
|
placeholder="请选择被检查(自查)单位"
|
|
|
- class="custom-tree-select"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ filterable
|
|
|
|
|
+ class="custom-select"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option v-for="item in firstLevelDepts" :key="item.id" :label="item.deptName" :value="item.id" />
|
|
|
|
|
+ </el-select>
|
|
|
</template>
|
|
</template>
|
|
|
<template #inspectType>
|
|
<template #inspectType>
|
|
|
<div class="task-type-container">
|
|
<div class="task-type-container">
|
|
@@ -24,14 +23,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<template #userGroupList>
|
|
<template #userGroupList>
|
|
|
- <div class="user-group-list">
|
|
|
|
|
- <el-select v-model="ruleFormData.userGroupList" multiple placeholder="请选择检查责任人" filterable>
|
|
|
|
|
- <el-option v-for="item in groupOptions" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- <span class="group-info-span" @click="showGroupInfo" v-show="ruleFormData.userGroupList.length > 0">
|
|
|
|
|
- 人员详情
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <GroupSelect v-model="ruleFormData.userGroupList" :groupOptions="groupOptions" />
|
|
|
</template>
|
|
</template>
|
|
|
<template #isPush>
|
|
<template #isPush>
|
|
|
<el-radio-group v-model="ruleFormData.isPush">
|
|
<el-radio-group v-model="ruleFormData.isPush">
|
|
@@ -40,16 +32,6 @@
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</template>
|
|
</template>
|
|
|
</BasicForm>
|
|
</BasicForm>
|
|
|
- <el-dialog
|
|
|
|
|
- v-model="groupInfo"
|
|
|
|
|
- title="人员详情"
|
|
|
|
|
- align-center
|
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
|
- :destroy-on-close="true"
|
|
|
|
|
- class="customDialog--pushObject"
|
|
|
|
|
- >
|
|
|
|
|
- <Group :userGroupInfo="userGroupInfo" />
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -62,35 +44,20 @@
|
|
|
import { INSPECT_TYPE_OPTIONS } from '../constants/task-execution';
|
|
import { INSPECT_TYPE_OPTIONS } from '../constants/task-execution';
|
|
|
import { TASK_TEMPLATE_LIST } from '../constants/template-detail';
|
|
import { TASK_TEMPLATE_LIST } from '../constants/template-detail';
|
|
|
import { IS_PUSH } from '@/views/disaster/constant';
|
|
import { IS_PUSH } from '@/views/disaster/constant';
|
|
|
- import type { UserGroupOption, UserGroupInfo } from '@/types/push-object';
|
|
|
|
|
- import { getUserGroupDetailByIds, getAllUserGroup } from '@/api/push-object';
|
|
|
|
|
- import Group from '@/views/disaster/components/Group.vue';
|
|
|
|
|
|
|
+ import type { UserGroupOption } from '@/types/person-group/type';
|
|
|
|
|
+ import { getAllUserGroup } from '@/api/system/person-group';
|
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
|
- import type { DeptTreeItem } from '@/types/dept/type';
|
|
|
|
|
|
|
+ import type { DeptTree } from '@/types/dept/type';
|
|
|
|
|
+ import GroupSelect from '@/views/disaster/components/GroupSelect.vue';
|
|
|
|
|
+ import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
|
|
|
import { useUserInfoHook } from '@/views/disaster/hooks/userInfo';
|
|
import { useUserInfoHook } from '@/views/disaster/hooks/userInfo';
|
|
|
|
|
|
|
|
const { realname } = useUserInfoHook();
|
|
const { realname } = useUserInfoHook();
|
|
|
|
|
|
|
|
const groupOptions = ref<UserGroupOption[]>([]);
|
|
const groupOptions = ref<UserGroupOption[]>([]);
|
|
|
- const groupInfo = ref(false);
|
|
|
|
|
- const userGroupInfo = ref<UserGroupInfo[]>([]);
|
|
|
|
|
- const deptList = ref<DeptTreeItem[]>([]);
|
|
|
|
|
|
|
+ const firstLevelDepts = ref<DeptTree[]>([]);
|
|
|
const basicFormRef = ref<InstanceType<typeof BasicForm>>();
|
|
const basicFormRef = ref<InstanceType<typeof BasicForm>>();
|
|
|
|
|
|
|
|
- const getUserGroupInfo = async () => {
|
|
|
|
|
- const res = await getUserGroupDetailByIds(ruleFormData.userGroupList);
|
|
|
|
|
- userGroupInfo.value = res.map((item) => ({
|
|
|
|
|
- ...item,
|
|
|
|
|
- isExpand: false,
|
|
|
|
|
- isHidden: false,
|
|
|
|
|
- }));
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const showGroupInfo = () => {
|
|
|
|
|
- groupInfo.value = true;
|
|
|
|
|
- getUserGroupInfo();
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const handleTaskTypeChange = (taskType: number | null) => {
|
|
const handleTaskTypeChange = (taskType: number | null) => {
|
|
|
ruleFormData.templateId = taskType;
|
|
ruleFormData.templateId = taskType;
|
|
|
};
|
|
};
|
|
@@ -113,7 +80,7 @@
|
|
|
};
|
|
};
|
|
|
const getDeptList = async () => {
|
|
const getDeptList = async () => {
|
|
|
const res = await getAllDepartments();
|
|
const res = await getAllDepartments();
|
|
|
- deptList.value = res;
|
|
|
|
|
|
|
+ firstLevelDepts.value = formatDeptTree(res);
|
|
|
};
|
|
};
|
|
|
const getUserGroupList = async () => {
|
|
const getUserGroupList = async () => {
|
|
|
const res = await getAllUserGroup();
|
|
const res = await getAllUserGroup();
|
|
@@ -136,7 +103,7 @@
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
@use '@/views/disaster/style/info-container.scss' as *;
|
|
@use '@/views/disaster/style/info-container.scss' as *;
|
|
|
@use '../style/task-item.scss' as *;
|
|
@use '../style/task-item.scss' as *;
|
|
|
- .custom-tree-select {
|
|
|
|
|
|
|
+ .custom-select {
|
|
|
:deep(.el-select__selection) {
|
|
:deep(.el-select__selection) {
|
|
|
min-height: 24px;
|
|
min-height: 24px;
|
|
|
max-height: 64px;
|
|
max-height: 64px;
|