소스 검색

完成任务管理模块

chauncey 11 달 전
부모
커밋
411128ae63

+ 70 - 24
src/api/disaster-precaution/index.ts

@@ -1,41 +1,87 @@
 import { http } from '@/utils/http/axios';
 import type {
+  TaskManagementListQuery,
   TaskManagementListResponse,
   TaskExecutionListResponse,
   TaskManagementItemResponse,
 } from '@/types/disaster-precaution';
+import type { QueryPageRequest, QueryPageResponse } from '@/types/disaster';
+import type { TaskManagementRuleForm } from '@/views/disaster/disaster-precaution/src/type';
 /**
  * 获取任务管理表格数据
  */
-export function getTaskManagementListData() {
-  return http.request<TaskManagementListResponse[]>(
-    {
-      url: '/admin/task/getTaskManagementList',
-      method: 'get',
-    },
-    {
-      ignoreTargetTenantId: true,
-    },
-  );
+export function getTaskManagementList(query: QueryPageRequest<TaskManagementListQuery>) {
+  return http.request<QueryPageResponse<TaskManagementListResponse>>({
+    url: '/preventInspectTask/queryPreventInspectTaskPage',
+    method: 'post',
+    data: query,
+  });
 }
 
 /**
- * 获取任务管理详情
+ * 添加任务管理项
  */
-export function getTaskManagementItem(id: number) {
-  return http.request<TaskManagementItemResponse>(
-    {
-      url: '/admin/task/getTaskManagementItem',
-      method: 'get',
-      params: {
-        id,
-      },
-    },
-    {
-      ignoreTargetTenantId: true,
+export const createTaskManagementItem = (data: Omit<TaskManagementRuleForm, 'realname'>) => {
+  return http.request({
+    url: '/preventInspectTask/savePreventInspectTask',
+    method: 'post',
+    data,
+  });
+};
+
+/**
+ * 编辑任务管理项
+ */
+export const editTaskManagementItem = (data: Omit<TaskManagementRuleForm, 'realname'>) => {
+  return http.request({
+    url: '/preventInspectTask/updatePreventInspectTask',
+    method: 'post',
+    data,
+  });
+};
+
+/**
+ * 查看任务管理项
+ */
+export const viewTaskManagementDetail = (preventInspectTaskId: number) => {
+  return http.request<TaskManagementRuleForm>({
+    url: '/preventInspectTask/queryPreventInspectTaskById',
+    method: 'get',
+    params: {
+      preventInspectTaskId,
     },
-  );
-}
+  });
+};
+
+/**
+ * 发布任务管理任务 批量/单个
+ */
+export const publishTaskManagementItem = (preventInspectTaskIds: number[] | number) => {
+  return http.request({
+    url: `/preventInspectTask/updateTaskEffect?preventInspectTaskIds=${preventInspectTaskIds}`,
+    method: 'post',
+  });
+};
+
+/**
+ * 撤回任务管理任务 批量/单个
+ */
+export const withdrawTaskManagementItem = (preventInspectTaskIds: number[] | number) => {
+  return http.request({
+    url: `/preventInspectTask/updateTaskLossEffect?preventInspectTaskIds=${preventInspectTaskIds}`,
+    method: 'post',
+  });
+};
+
+/**
+ * 删除任务管理任务 批量/单个
+ */
+export const deleteTaskManagementItem = (preventInspectTaskIds: number[] | number) => {
+  return http.request({
+    url: `/preventInspectTask/deletePreventInspectTasks?preventInspectTaskIds=${preventInspectTaskIds}`,
+    method: 'post',
+  });
+};
 /**
  * 获取任务执行表格数据
  */

+ 21 - 20
src/types/disaster-precaution/index.ts

@@ -1,31 +1,32 @@
-import type { UserInfo } from '@/types/push-object';
-interface BasicResponse {
-  id: number;
-  taskName: string;
-  selfCheckUnit: string;
-  taskType: number;
-  shouldCompleteTime: string;
-  taskStage: number;
-  isOverdue: number;
+export interface TaskManagementListQuery {
+  inspectType?: string;
+  effectStatus?: string;
+  taskState?: string;
 }
 
-interface checkUser {
-  checkUser: UserInfo[];
+interface BasicResponse {
+  id: number;
+  name: string;
+  deptName: string; // 被检查单位名称
+  inspectType: number; // 检查类型
+  dueCompleteTime: string;
+  taskState: number;
+  overdue: boolean;
+  userGroupList: number[];
 }
 
 export interface TaskManagementListResponse extends BasicResponse {
-  activeStatus: number;
+  effectStatus: number;
 }
 
-export interface TaskExecutionListResponse extends BasicResponse, checkUser {}
+export interface TaskExecutionListResponse extends BasicResponse {}
 
 export interface TaskManagementItemResponse
-  extends checkUser,
-    Omit<TaskManagementListResponse, 'selfCheckUnit' | 'taskStage' | 'isOverdue' | 'activeStatus' | 'taskType'> {
-  taskType: number | null;
-  selfCheckUnit: string[] | string;
-  checkRequirement: string;
-  createUser: string;
+  extends Omit<TaskManagementListResponse, 'deptName' | 'inspectType' | 'overdue' | 'effectStatus' | 'taskState'> {
+  inspectType: number | null;
+  deptIdList: string[] | string;
+  inspectRequirement: string;
+  realname: string;
   isPush: boolean | null;
-  taskTemplate: number | null;
+  templateId: number | null;
 }

+ 1 - 0
src/views/disaster/constant/index.ts

@@ -159,4 +159,5 @@ export const DISASTER_LEVEL = [
 export const DISASTER_PERMISSIONS = {
   WARNING_INFO: 'disaster_business_module:warn_info',
   DEFENSE_NOTICE: 'disaster_business_module:defense_notice',
+  TASK_MANAGEMENT: 'disaster_business_module:prevent_inspect',
 };

+ 46 - 3
src/views/disaster/disaster-precaution/PageTaskItem.vue

@@ -11,6 +11,7 @@
       <el-button @click="router.back()">取消</el-button>
       <el-button type="primary" @click="submit">提交</el-button>
     </footer>
+    <UploadLoading :form-loading="formLoading" v-if="formLoading" />
   </div>
 </template>
 
@@ -19,10 +20,15 @@
   import { useRoute, useRouter } from 'vue-router';
   import BackIcon from 'assets/svg/back.svg';
   import { ElMessage } from 'element-plus';
+  import { createTaskManagementItem, editTaskManagementItem } from '@/api/disaster-precaution';
+  import type { TaskManagementRuleForm } from './src/type';
+  import UploadLoading from '@/components/UploadLoading.vue';
+
   const router = useRouter();
   const route = useRoute();
   const operate = route.query.operate;
   const id = route.query.id;
+  const formLoading = ref(false);
   const headerTitle = computed(() => {
     if (operate === 'create') {
       return '创建灾害检测任务';
@@ -40,14 +46,51 @@
     return defineAsyncComponent(() => import('./src/components/ViewTaskItem.vue'));
   });
   const dynamicComponentRef = ref();
+  const createTaskManagementItemFunc = async (formData: TaskManagementRuleForm) => {
+    const createParam = {
+      name: formData.name,
+      deptIdList: formData.deptIdList,
+      inspectType: formData.inspectType,
+      templateId: formData.templateId,
+      dueCompleteTime: formData.dueCompleteTime,
+      inspectRequirement: formData.inspectRequirement,
+      isPush: formData.isPush,
+      userGroupList: formData.userGroupList,
+    };
+    await createTaskManagementItem(createParam);
+  };
+  const editTaskManagementItemFunc = async (formData: TaskManagementRuleForm) => {
+    const editParam = {
+      id,
+      name: formData.name,
+      inspectType: formData.inspectType,
+      templateId: formData.templateId,
+      dueCompleteTime: formData.dueCompleteTime,
+      inspectRequirement: formData.inspectRequirement,
+      isPush: formData.isPush,
+      userGroupList: formData.userGroupList,
+    };
+    await editTaskManagementItem(editParam);
+  };
   const submit = async () => {
     if (!dynamicComponentRef.value) return;
     const res = await dynamicComponentRef.value.handleValidate();
     if (res) {
       const formData = dynamicComponentRef.value.getFormData();
-      console.log(formData);
-      ElMessage.success('提交成功');
-      router.back();
+      let message;
+      try {
+        if (operate === 'create') {
+          await createTaskManagementItemFunc(formData);
+          message = '创建成功';
+        } else if (operate === 'edit') {
+          await editTaskManagementItemFunc(formData);
+          message = '编辑成功';
+        }
+        ElMessage.success(message);
+        router.back();
+      } finally {
+        formLoading.value = false;
+      }
     } else {
       console.log('不提交');
     }

+ 111 - 38
src/views/disaster/disaster-precaution/PageTaskManagement.vue

@@ -6,7 +6,13 @@
     <main class="disaster-precaution-container__main">
       <div class="disaster-precaution">
         <header class="disaster-precaution__header">
-          <el-button type="primary" class="disaster-precaution__header--button" :icon="Plus" @click="handleCreateTask">
+          <el-button
+            type="primary"
+            class="disaster-precaution__header--button"
+            :icon="Plus"
+            @click="handleCreateTask"
+            v-if="taskManagementPermissions"
+          >
             创建检查任务单
           </el-button>
           <Search
@@ -14,12 +20,12 @@
             :searchData="searchData"
             @update:searchData="handleSearch"
           />
-          <div class="batch-operation--div fadeIn" v-show="selectionItems.length > 0">
+          <div class="batch-operation--div fadeIn" v-show="selectionItems.length > 0 && taskManagementPermissions">
             <span>已选{{ selectionItems.length }}项</span>
             <div class="batch-operation--div--button">
-              <el-button type="success" v-show="isBatchPublish" @click="handleBatchPublish">批量发布</el-button>
+              <el-button type="primary" v-show="isBatchPublish" @click="handleBatchPublish">批量发布</el-button>
               <el-button type="primary" v-show="isBatchWithdraw" @click="handleBatchWithdraw">批量撤回</el-button>
-              <el-button type="danger" @click="handleBatchDelete">批量删除</el-button>
+              <el-button type="primary" v-show="isBatchDelete" @click="handleBatchDelete">批量删除</el-button>
             </div>
           </div>
         </header>
@@ -33,31 +39,31 @@
         >
           <template #taskName="scope">
             <div class="task-name--div">
-              <el-tooltip :content="scope.row.taskName" placement="top" effect="light">
-                <span>{{ scope.row.taskName }}</span>
+              <el-tooltip :content="scope.row.name" placement="top" effect="light">
+                <span>{{ scope.row.name }}</span>
               </el-tooltip>
-              <img :src="OverdueIcon" alt="overdue" v-if="scope.row.isOverdue === OVERDUE_STATUS.OVERDUE" />
+              <img :src="OverdueIcon" alt="overdue" v-if="scope.row.overdue" />
             </div>
           </template>
-          <template #taskType="scope">
-            <span>{{ TASK_TYPE_MAP[scope.row.taskType] }}</span>
+          <template #inspectType="scope">
+            <span>{{ INSPECT_TYPE_MAP[scope.row.inspectType] }}</span>
           </template>
-          <template #activeStatus="scope">
+          <template #effectStatus="scope">
             <div class="active-status--div">
               <div
                 class="dot"
-                :style="{ backgroundColor: ACTIVE_STATUS_COLOR[scope.row.activeStatus as ACTIVE_STATUS] }"
+                :style="{ backgroundColor: ACTIVE_STATUS_COLOR[scope.row.effectStatus as ACTIVE_STATUS] }"
               ></div>
-              <span>{{ ACTIVE_STATUS_MAP[scope.row.activeStatus] }}</span>
+              <span>{{ ACTIVE_STATUS_MAP[scope.row.effectStatus] }}</span>
             </div>
           </template>
           <template #taskStage="scope">
-            <span>{{ TASK_STAGE_MAP[scope.row.taskStage] }}</span>
+            <span>{{ TASK_STAGE_MAP[scope.row.taskState] }}</span>
           </template>
           <template #action="scope">
             <ActionButton
               text="编辑"
-              v-if="scope.row.activeStatus === ACTIVE_STATUS.NOT_EFFECTIVE"
+              v-if="scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE && taskManagementPermissions"
               @click="handleEditTask(scope.row.id)"
             />
             <ActionButton text="查看" @click="handleViewTask(scope.row.id)" />
@@ -66,21 +72,24 @@
               :popconfirm="{
                 title: '确定要发布?',
               }"
-              v-if="scope.row.activeStatus === ACTIVE_STATUS.NOT_EFFECTIVE"
+              v-if="scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE && taskManagementPermissions"
+              @confirm="handlePublishTask(scope.row.id)"
             />
             <ActionButton
               text="撤回"
               :popconfirm="{
                 title: '确定要撤回?',
               }"
-              v-else-if="scope.row.activeStatus === ACTIVE_STATUS.ACTIVE"
+              v-else-if="scope.row.effectStatus === ACTIVE_STATUS.ACTIVE && taskManagementPermissions"
+              @confirm="handleWithdrawTask(scope.row.id)"
             />
             <ActionButton
               text="删除"
               :popconfirm="{
                 title: '确定要删除?',
               }"
-              v-if="scope.row.activeStatus === ACTIVE_STATUS.NOT_EFFECTIVE"
+              v-if="scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE && taskManagementPermissions"
+              @confirm="handleDeleteTask(scope.row.id)"
             />
           </template>
         </BasicTable>
@@ -96,11 +105,16 @@
   import ActionButton from '@/components/ActionButton.vue';
   import Search from '@/views/disaster/components/Search.vue';
   import useTableConfig from '@/hooks/useTableConfigHook';
-  import { getTaskManagementListData } from '@/api/disaster-precaution';
-  import type { TaskManagementListResponse } from '@/types/disaster-precaution';
+  import {
+    getTaskManagementList,
+    deleteTaskManagementItem,
+    withdrawTaskManagementItem,
+    publishTaskManagementItem,
+  } from '@/api/disaster-precaution';
+  import type { TaskManagementListQuery, TaskManagementListResponse } from '@/types/disaster-precaution';
   import OverdueIcon from '@/assets/svg/overdue.svg';
   import { ElMessageBox, ElMessage } from 'element-plus';
-  import { OVERDUE_STATUS, TASK_TYPE_MAP, TASK_STAGE_MAP } from './src/constants/task-execution';
+  import { INSPECT_TYPE_MAP, TASK_STAGE_MAP } from './src/constants/task-execution';
   import { ACTIVE_STATUS, ACTIVE_STATUS_COLOR, ACTIVE_STATUS_MAP } from '@/views/disaster/constant';
   import {
     TABLE_OPTIONS_MANAGEMENT,
@@ -108,23 +122,46 @@
     TASK_MANAGEMENT_SEARCH_CONFIG,
     TABLE_MANAGEMENT_HEIGHT_DEFAULT,
     TABLE_MANAGEMENT_HEIGHT_BATCH_OPERATION,
+    TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION,
   } from './src/config';
   import { useRouter } from 'vue-router';
+  import type { QueryPageRequest } from '@/types/disaster';
+  import { DISASTER_PERMISSIONS } from '@/views/disaster/constant';
+  import { useUserInfoHook } from '@/views/disaster/hooks/userInfo';
+
+  const { permissions } = useUserInfoHook();
+
   const router = useRouter();
   const searchData = reactive({
-    taskType: '',
-    activeStatus: '',
-    taskStage: '',
+    inspectType: '',
+    effectStatus: '',
+    taskState: '',
   });
-  const handleSearch = (data: any) => {
-    console.log(data);
+  const { tableConfig, pagination } = useTableConfig(TASK_MANAGEMENT_TABLE_COLUMNS, TABLE_OPTIONS_MANAGEMENT);
+  let taskManagementListQuery: QueryPageRequest<TaskManagementListQuery> = {
+    pageNumber: pagination.pageNumber,
+    pageSize: pagination.pageSize,
+    queryParam: {},
+  };
+  const handleSearch = () => {
+    taskManagementListQuery.queryParam = {};
+    if (searchData.inspectType !== '') {
+      taskManagementListQuery.queryParam.inspectType = searchData.inspectType;
+    }
+    if (searchData.effectStatus !== '') {
+      taskManagementListQuery.queryParam.effectStatus = searchData.effectStatus;
+    }
+    if (searchData.taskState !== '') {
+      taskManagementListQuery.queryParam.taskState = searchData.taskState;
+    }
     getTableData();
   };
   const selectionItems = ref<any[]>([]);
   const isBatchPublish = ref(false);
   const isBatchWithdraw = ref(false);
+  const isBatchDelete = ref(false);
   const getSelectionIds = (option: ACTIVE_STATUS) => {
-    return selectionItems.value.filter((item) => item.activeStatus === option).map((item) => item.id);
+    return selectionItems.value.filter((item) => item.effectStatus === option).map((item) => item.id);
   };
   const handleSelectionChange = (selection: any[]) => {
     selectionItems.value = selection;
@@ -132,6 +169,7 @@
     isBatchPublish.value = Boolean(publishIds.length);
     const withdrawIds = getSelectionIds(ACTIVE_STATUS.ACTIVE);
     isBatchWithdraw.value = Boolean(withdrawIds.length);
+    isBatchDelete.value = Boolean(selectionItems.value.length === publishIds.length);
   };
   const openMessageBox = (title: string) => {
     return ElMessageBox.confirm('', title, {
@@ -149,29 +187,56 @@
     const confirmed = await openMessageBox('确认发布任务吗?');
     if (!confirmed) return;
     const publishIds = getSelectionIds(ACTIVE_STATUS.NOT_EFFECTIVE);
-    ElMessage.success('批量发布成功');
-    getTableData();
+    try {
+      await publishTaskManagementItem(publishIds);
+      ElMessage.success('批量发布成功');
+    } finally {
+      getTableData();
+    }
   };
   const handleBatchWithdraw = async () => {
     const confirmed = await openMessageBox('确认撤回已发布任务吗?');
     if (!confirmed) return;
     const withdrawIds = getSelectionIds(ACTIVE_STATUS.ACTIVE);
-    ElMessage.success('批量撤回成功');
-    getTableData();
+    try {
+      await withdrawTaskManagementItem(withdrawIds);
+      ElMessage.success('批量撤回成功');
+    } finally {
+      getTableData();
+    }
   };
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
   const handleBatchDelete = async () => {
     const confirmed = await openMessageBox('删除后任务不可恢复,确认删除吗?');
     if (!confirmed) return;
     const deleteIds = getSelectionIds(ACTIVE_STATUS.NOT_EFFECTIVE);
+    await deleteTaskManagementItem(deleteIds);
     ElMessage.success('批量删除成功');
     getTableData();
   };
 
-  const defaultPath = '/disaster-prevention/disaster-precaution/task-item';
+  const handlePublishTask = async (id: number) => {
+    await publishTaskManagementItem(id);
+    getTableData();
+    ElMessage.success('发布成功');
+  };
+
+  const handleWithdrawTask = async (id: number) => {
+    await withdrawTaskManagementItem(id);
+    getTableData();
+    ElMessage.success('撤回成功');
+  };
+
+  const handleDeleteTask = async (id: number) => {
+    await deleteTaskManagementItem(id);
+    getTableData();
+    ElMessage.success('删除成功');
+  };
+
+  const defaultName = 'disaster-precaution-task-item';
   const handleCreateTask = () => {
     router.push({
-      name: defaultPath,
+      name: defaultName,
       query: {
         operate: 'create',
       },
@@ -179,18 +244,17 @@
   };
   const handleEditTask = (id: number) => {
     router.push({
-      name: defaultPath,
+      name: defaultName,
       query: { operate: 'edit', id },
     });
   };
   const handleViewTask = (id: number) => {
     router.push({
-      name: defaultPath,
+      name: defaultName,
       query: { id },
     });
   };
   const tableData = ref<TaskManagementListResponse[]>([]);
-  const { tableConfig, pagination } = useTableConfig(TASK_MANAGEMENT_TABLE_COLUMNS, TABLE_OPTIONS_MANAGEMENT);
   const handleSizeChange = (value: number) => {
     pagination.pageSize = value;
     getTableData();
@@ -201,17 +265,26 @@
   };
   const getTableData = async () => {
     tableConfig.loading = true;
-    const res = await getTaskManagementListData();
-    tableData.value = res;
-    pagination.total = tableData.value.length;
+    const res = await getTaskManagementList(taskManagementListQuery);
+    tableData.value = res.records;
+    pagination.total = res.totalRow;
     tableConfig.loading = false;
   };
+  const taskManagementPermissions = ref<Boolean>(false);
   onMounted(() => {
     getTableData();
+    taskManagementPermissions.value = Boolean(
+      permissions.find((item: { code: string }) => item.code === DISASTER_PERMISSIONS.TASK_MANAGEMENT),
+    );
+    tableConfig.height = taskManagementPermissions.value
+      ? TABLE_MANAGEMENT_HEIGHT_DEFAULT
+      : TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION;
   });
   watch(
     () => selectionItems.value.length,
     (newLength) => {
+      // 如果没有权限,则不显示批量操作
+      if (!taskManagementPermissions.value) return;
       if (newLength > 0) {
         tableConfig.height = TABLE_MANAGEMENT_HEIGHT_BATCH_OPERATION;
       } else {

+ 1 - 1
src/views/disaster/disaster-precaution/PageTaskTemplate.vue

@@ -27,7 +27,7 @@
   const router = useRouter();
   const toTemplateDetail = (id: number) => {
     router.push({
-      name: '/disaster-prevention/disaster-precaution/template-detail',
+      name: 'disaster-precaution-template-detail',
       params: {
         id,
       },

+ 78 - 37
src/views/disaster/disaster-precaution/src/components/CreateTaskItem.vue

@@ -1,48 +1,54 @@
 <template>
   <div class="info-container">
     <BasicForm ref="basicFormRef" :formData="ruleFormData" :formRules="formRules" :formConfig="ruleFormConfig">
-      <template #taskType>
+      <template #deptName>
+        <el-tree-select
+          v-model="ruleFormData.deptIdList"
+          :data="deptList"
+          check-strictly
+          multiple
+          node-key="id"
+          :props="{ label: 'deptName', children: 'children' }"
+          placeholder="请选择被检查(自查)单位"
+          class="custom-tree-select"
+        />
+      </template>
+      <template #inspectType>
         <div class="task-type-container">
-          <el-select v-model="ruleFormData.taskType" placeholder="请选择检查类型" @change="handleTaskTypeChange">
-            <el-option v-for="item in TASK_TYPE_OPTIONS" :key="item.value" :label="item.label" :value="item.value" />
+          <el-select v-model="ruleFormData.inspectType" placeholder="请选择检查类型" @change="handleTaskTypeChange">
+            <el-option v-for="item in INSPECT_TYPE_OPTIONS" :key="item.value" :label="item.label" :value="item.value" />
           </el-select>
-          <el-select v-model="ruleFormData.taskTemplate" placeholder="请选择关联模板" disabled>
+          <el-select v-model="ruleFormData.templateId" placeholder="请选择关联模板" disabled>
             <el-option v-for="item in TASK_TEMPLATE_LIST" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
         </div>
       </template>
-      <template #checkUser>
-        <el-select
-          v-model="ruleFormData.checkUser"
-          value-key="id"
-          multiple
-          placeholder="请选择人员"
-          @click="userInfo = true"
-        >
-          <el-option
-            v-for="user in userOptions"
-            :key="user.id"
-            :label="`${user.username}-${user.realname}`"
-            :value="user"
-          />
-        </el-select>
+      <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>
       </template>
       <template #isPush>
         <el-radio-group v-model="ruleFormData.isPush">
-          <el-radio :value="true">是</el-radio>
-          <el-radio :value="false">否</el-radio>
+          <el-radio :value="IS_PUSH.PUSH">是</el-radio>
+          <el-radio :value="IS_PUSH.NOT_PUSH">否</el-radio>
         </el-radio-group>
       </template>
     </BasicForm>
     <el-dialog
-      v-model="userInfo"
-      title="添加人员"
+      v-model="groupInfo"
+      title="人员详情"
       align-center
       :close-on-click-modal="false"
       :destroy-on-close="true"
       class="customDialog--pushObject"
     >
-      <User :customUserList="ruleFormData.checkUser" @cancel="userInfo = false" @submit="handleSubmit" />
+      <Group :userGroupInfo="userGroupInfo" />
     </el-dialog>
   </div>
 </template>
@@ -53,17 +59,40 @@
   import { TASK_MANAGEMENT_FROM_CONFIG_CREATE, TASK_MANAGEMENT_FROM_DATA, TASK_MANAGEMENT_FROM_RULES } from '../config';
   import { onMounted, ref } from 'vue';
   import { TaskManagementRuleForm } from '../type';
-  import { TASK_TYPE_OPTIONS } from '../constants/task-execution';
+  import { INSPECT_TYPE_OPTIONS } from '../constants/task-execution';
   import { TASK_TEMPLATE_LIST } from '../constants/template-detail';
-  import User from '@/views/disaster/components/User.vue';
-  import type { UserInfo } from '@/types/push-object';
+  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 { getAllDepartments } from '@/api/auth/dept';
+  import type { DeptTreeItem } from '@/types/dept/type';
+  import { useUserInfoHook } from '@/views/disaster/hooks/userInfo';
+
+  const { realname } = useUserInfoHook();
 
-  const userInfo = ref(false);
-  const userOptions = ref<UserInfo[]>([]);
+  const groupOptions = ref<UserGroupOption[]>([]);
+  const groupInfo = ref(false);
+  const userGroupInfo = ref<UserGroupInfo[]>([]);
+  const deptList = ref<DeptTreeItem[]>([]);
   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) => {
-    ruleFormData.taskTemplate = taskType;
+    ruleFormData.templateId = taskType;
   };
 
   const { ruleFormConfig, ruleFormData, formRules, cloneRuleFormData, beforeRouteLeave } =
@@ -73,11 +102,6 @@
       TASK_MANAGEMENT_FROM_RULES,
     );
 
-  const handleSubmit = (selectedPersonList: UserInfo[]) => {
-    ruleFormData.checkUser = selectedPersonList;
-    userOptions.value = ruleFormData.checkUser;
-  };
-
   const handleValidate = async () => {
     if (!basicFormRef.value) return;
     const parentValidateResult = await basicFormRef.value.validateForm();
@@ -87,19 +111,36 @@
     cloneRuleFormData();
     return ruleFormData;
   };
+  const getDeptList = async () => {
+    const res = await getAllDepartments();
+    deptList.value = res;
+  };
+  const getUserGroupList = async () => {
+    const res = await getAllUserGroup();
+    groupOptions.value = res.groupVOList;
+  };
   defineExpose({
     handleValidate,
     getFormData,
   });
 
-  onMounted(() => {
-    ruleFormData.createUser = 'XXX';
+  onMounted(async () => {
+    ruleFormData.realname = realname;
     cloneRuleFormData();
     beforeRouteLeave();
+    await getDeptList();
+    await getUserGroupList();
   });
 </script>
 
 <style scoped lang="scss">
   @use '@/views/disaster/style/info-container.scss' as *;
   @use '../style/task-item.scss' as *;
+  .custom-tree-select {
+    :deep(.el-select__selection) {
+      min-height: 24px;
+      max-height: 64px;
+      overflow-y: auto;
+    }
+  }
 </style>

+ 68 - 49
src/views/disaster/disaster-precaution/src/components/EditTaskItem.vue

@@ -1,100 +1,106 @@
 <template>
   <div class="info-container">
     <BasicForm ref="basicFormRef" :formData="ruleFormData" :formRules="formRules" :formConfig="ruleFormConfig">
-      <template #taskType>
+      <template #inspectType>
         <div class="task-type-container">
-          <el-select v-model="ruleFormData.taskType" placeholder="请选择检查类型" @change="handleTaskTypeChange">
-            <el-option v-for="item in TASK_TYPE_OPTIONS" :key="item.value" :label="item.label" :value="item.value" />
+          <el-select v-model="ruleFormData.inspectType" placeholder="请选择检查类型" @change="handleTaskTypeChange">
+            <el-option v-for="item in INSPECT_TYPE_OPTIONS" :key="item.value" :label="item.label" :value="item.value" />
           </el-select>
-          <el-select v-model="ruleFormData.taskTemplate" placeholder="请选择关联模板" disabled>
+          <el-select v-model="ruleFormData.templateId" placeholder="请选择关联模板" disabled>
             <el-option v-for="item in TASK_TEMPLATE_LIST" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
         </div>
       </template>
-      <template #checkUser>
-        <el-select
-          v-model="ruleFormData.checkUser"
-          value-key="id"
-          multiple
-          placeholder="请选择人员"
-          @click="userInfo = true"
-        >
-          <el-option
-            v-for="user in userOptions"
-            :key="user.id"
-            :label="`${user.username}-${user.realname}`"
-            :value="user"
-          />
-        </el-select>
+      <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>
       </template>
       <template #isPush>
         <el-radio-group v-model="ruleFormData.isPush">
-          <el-radio :value="true">是</el-radio>
-          <el-radio :value="false">否</el-radio>
+          <el-radio :value="IS_PUSH.PUSH">是</el-radio>
+          <el-radio :value="IS_PUSH.NOT_PUSH">否</el-radio>
         </el-radio-group>
       </template>
     </BasicForm>
     <el-dialog
-      v-model="userInfo"
-      title="添加人员"
+      v-model="groupInfo"
+      title="人员详情"
       align-center
       :close-on-click-modal="false"
       :destroy-on-close="true"
       class="customDialog--pushObject"
     >
-      <User :customUserList="ruleFormData.checkUser" @cancel="userInfo = false" @submit="handleSubmit" />
+      <Group :userGroupInfo="userGroupInfo" />
     </el-dialog>
   </div>
 </template>
 
 <script setup lang="ts">
   import BasicForm from '@/components/BasicForm.vue';
-  import User from '@/views/disaster/components/User.vue';
   import { useFormConfigHook } from '@/hooks/useFormConfigHook';
   import { TASK_MANAGEMENT_FROM_CONFIG_EDIT, TASK_MANAGEMENT_FROM_DATA, TASK_MANAGEMENT_FROM_RULES } from '../config';
   import { onMounted, ref } from 'vue';
   import { TaskManagementRuleForm } from '../type';
-  import { TASK_TYPE_OPTIONS } from '../constants/task-execution';
+  import { INSPECT_TYPE_OPTIONS } from '../constants/task-execution';
   import { TASK_TEMPLATE_LIST } from '../constants/template-detail';
-  import { getTaskManagementItem } from '@/api/disaster-precaution';
-  import type { UserInfo } from '@/types/push-object';
+  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 { viewTaskManagementDetail } from '@/api/disaster-precaution';
 
   const props = defineProps<{
     id: number;
   }>();
 
-  const userInfo = ref(false);
-
-  const userOptions = ref<UserInfo[]>([]);
+  const groupOptions = ref<UserGroupOption[]>([]);
+  const groupInfo = ref(false);
+  const userGroupInfo = ref<UserGroupInfo[]>([]);
   const basicFormRef = ref<InstanceType<typeof BasicForm>>();
 
-  const handleTaskTypeChange = (taskType: number | null) => {
-    ruleFormData.taskTemplate = taskType;
-  };
-
-  const { ruleFormConfig, ruleFormData, formRules,cloneRuleFormData, beforeRouteLeave } =
-    useFormConfigHook<TaskManagementRuleForm>(
-      TASK_MANAGEMENT_FROM_CONFIG_EDIT,
-      TASK_MANAGEMENT_FROM_DATA,
-      TASK_MANAGEMENT_FROM_RULES,
-    );
-
-  const handleSubmit = (selectedPersonList: UserInfo[]) => {
-    ruleFormData.checkUser = selectedPersonList;
-    userOptions.value = ruleFormData.checkUser;
+  const getUserGroupInfo = async () => {
+    const res = await getUserGroupDetailByIds(ruleFormData.userGroupList);
+    userGroupInfo.value = res.map((item) => ({
+      ...item,
+      isExpand: false,
+      isHidden: false,
+    }));
   };
 
   const getTaskManagementItemInfo = async () => {
-    const res = await getTaskManagementItem(props.id);
-    userOptions.value = res.checkUser;
+    const res = await viewTaskManagementDetail(props.id);
     for (const key in res) {
       if (key in ruleFormData) {
         ruleFormData[key] = res[key as keyof typeof res];
+        ruleFormData.userGroupList = JSON.parse(res.userGroupList as unknown as string);
       }
     }
+    ruleFormData.deptName = res.deptName;
     cloneRuleFormData();
   };
 
+  const showGroupInfo = () => {
+    groupInfo.value = true;
+    getUserGroupInfo();
+  };
+
+  const handleTaskTypeChange = (taskType: number | null) => {
+    ruleFormData.templateId = taskType;
+  };
+
+  const { ruleFormConfig, ruleFormData, formRules, cloneRuleFormData, beforeRouteLeave } =
+    useFormConfigHook<TaskManagementRuleForm>(
+      TASK_MANAGEMENT_FROM_CONFIG_EDIT,
+      TASK_MANAGEMENT_FROM_DATA,
+      TASK_MANAGEMENT_FROM_RULES,
+    );
+
   const handleValidate = async () => {
     if (!basicFormRef.value) return;
     const parentValidateResult = await basicFormRef.value.validateForm();
@@ -104,18 +110,31 @@
     cloneRuleFormData();
     return ruleFormData;
   };
+  const getUserGroupList = async () => {
+    const res = await getAllUserGroup();
+    groupOptions.value = res.groupVOList;
+  };
   defineExpose({
     handleValidate,
     getFormData,
   });
 
-  onMounted(() => {
-    getTaskManagementItemInfo();
+  onMounted(async () => {
+    cloneRuleFormData();
     beforeRouteLeave();
+    await getTaskManagementItemInfo();
+    await getUserGroupList();
   });
 </script>
 
 <style scoped lang="scss">
   @use '@/views/disaster/style/info-container.scss' as *;
   @use '../style/task-item.scss' as *;
+  .custom-tree-select {
+    :deep(.el-select__selection) {
+      min-height: 24px;
+      max-height: 64px;
+      overflow-y: auto;
+    }
+  }
 </style>

+ 55 - 21
src/views/disaster/disaster-precaution/src/components/ViewTaskItem.vue

@@ -1,59 +1,72 @@
 <template>
   <div class="info-container">
     <BasicForm ref="basicFormRef" :formData="ruleFormData" :formConfig="ruleFormConfig">
-      <template #taskType>
+      <template #inspectType>
         <div class="task-type-container">
           <el-select
-            v-model="ruleFormData.taskType"
+            v-model="ruleFormData.inspectType"
             placeholder="请选择检查类型"
             @change="handleTaskTypeChange"
             disabled
           >
-            <el-option v-for="item in TASK_TYPE_OPTIONS" :key="item.value" :label="item.label" :value="item.value" />
+            <el-option v-for="item in INSPECT_TYPE_OPTIONS" :key="item.value" :label="item.label" :value="item.value" />
           </el-select>
-          <el-select v-model="ruleFormData.taskTemplate" placeholder="请选择关联模板" disabled>
+          <el-select v-model="ruleFormData.templateId" placeholder="请选择关联模板" disabled>
             <el-option v-for="item in TASK_TEMPLATE_LIST" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
         </div>
       </template>
-      <template #checkUser>
-        <el-select v-model="ruleFormData.checkUser" value-key="id" multiple placeholder="请选择人员" disabled>
-          <el-option
-            v-for="user in userOptions"
-            :key="user.id"
-            :label="`${user.username}-${user.realname}`"
-            :value="user"
-          />
-        </el-select>
+      <template #userGroupList>
+        <div class="user-group-list">
+          <el-select v-model="ruleFormData.userGroupList" multiple placeholder="请选择检查责任人" disabled>
+            <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"> 人员详情 </span>
+        </div>
       </template>
       <template #isPush>
         <el-radio-group v-model="ruleFormData.isPush" disabled>
-          <el-radio :value="true">是</el-radio>
-          <el-radio :value="false">否</el-radio>
+          <el-radio :value="IS_PUSH.PUSH">是</el-radio>
+          <el-radio :value="IS_PUSH.NOT_PUSH">否</el-radio>
         </el-radio-group>
       </template>
     </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>
 </template>
 
 <script setup lang="ts">
   import BasicForm from '@/components/BasicForm.vue';
   import { useFormConfigHook } from '@/hooks/useFormConfigHook';
+  import Group from '@/views/disaster/components/Group.vue';
   import { TASK_MANAGEMENT_FROM_CONFIG_EDIT, TASK_MANAGEMENT_FROM_DATA, TASK_MANAGEMENT_FROM_RULES } from '../config';
   import { onMounted, ref } from 'vue';
   import { TaskManagementRuleForm } from '../type';
-  import { TASK_TYPE_OPTIONS } from '../constants/task-execution';
+  import { getAllUserGroup, getUserGroupDetailByIds } from '@/api/push-object';
+  import type { UserGroupOption, UserGroupInfo } from '@/types/push-object';
+  import { INSPECT_TYPE_OPTIONS } from '../constants/task-execution';
   import { TASK_TEMPLATE_LIST } from '../constants/template-detail';
-  import { getTaskManagementItem } from '@/api/disaster-precaution';
-  import type { UserInfo } from '@/types/push-object';
+  import { IS_PUSH } from '@/views/disaster/constant';
+  import { viewTaskManagementDetail } from '@/api/disaster-precaution';
   import { cloneDeep } from 'lodash-es';
 
   const props = defineProps<{
     id: number;
   }>();
 
-  const userOptions = ref<UserInfo[]>([]);
   const basicFormRef = ref<InstanceType<typeof BasicForm>>();
+  const groupOptions = ref<UserGroupOption[]>([]);
+  const groupInfo = ref(false);
+  const userGroupInfo = ref<UserGroupInfo[]>([]);
 
   const handleTaskTypeChange = (taskType: number | null) => {
     ruleFormData.taskTemplate = taskType;
@@ -73,18 +86,39 @@
   );
 
   const getTaskManagementItemInfo = async () => {
-    const res = await getTaskManagementItem(props.id);
-    userOptions.value = res.checkUser;
+    const res = await viewTaskManagementDetail(props.id);
     for (const key in res) {
       if (key in ruleFormData) {
         ruleFormData[key] = res[key as keyof typeof res];
+        ruleFormData.userGroupList = JSON.parse(res.userGroupList as unknown as string);
       }
     }
+    ruleFormData.deptName = res.deptName;
     cloneRuleFormData();
   };
 
+  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 getUserGroupList = async () => {
+    const res = await getAllUserGroup();
+    groupOptions.value = res.groupVOList;
+  };
+
   onMounted(() => {
     getTaskManagementItemInfo();
+    getUserGroupList();
   });
 </script>
 

+ 48 - 61
src/views/disaster/disaster-precaution/src/config/form.ts

@@ -8,7 +8,7 @@ import type { TaskManagementRuleForm } from '../type';
 const BASIC_FORM_CONFIG = {
   TASK_NAME: {
     label: '任务名称',
-    prop: 'taskName',
+    prop: 'name',
     component: 'ElInput',
     componentProps: {
       placeholder: '请输入任务名称',
@@ -16,14 +16,14 @@ const BASIC_FORM_CONFIG = {
       showWordLimit: true,
     },
   },
-  TASK_TYPE: {
+  INSPECT_TYPE: {
     label: '检查类型',
-    prop: 'taskType',
-    slot: 'taskType',
+    prop: 'inspectType',
+    slot: 'inspectType',
   },
-  SHOULD_COMPLETE_TIME: {
+  DUE_COMPLETE_TIME: {
     label: '应完成时间',
-    prop: 'shouldCompleteTime',
+    prop: 'dueCompleteTime',
     component: 'ElDatePicker',
     componentProps: {
       placeholder: '请选择应完成时间',
@@ -31,12 +31,25 @@ const BASIC_FORM_CONFIG = {
       format: 'YYYY-MM-DD HH:mm',
       dateFormat: 'MMM DD, YYYY',
       timeFormat: 'HH:mm',
+      valueFormat: 'YYYY-MM-DD HH:mm',
     },
   },
-  CHECK_USER: {
-    label: '检查人员',
-    prop: 'checkUser',
-    slot: 'checkUser',
+  INSPECT_REQUIREMENT: {
+    label: '检查要求',
+    prop: 'inspectRequirement',
+    component: 'ElInput',
+    componentProps: {
+      type: 'textarea',
+      rows: 5,
+      placeholder: '请输入检查要求',
+      maxlength: 500,
+      showWordLimit: true,
+    },
+  },
+  USER_GROUP_LIST: {
+    label: '检查责任人',
+    prop: 'userGroupList',
+    slot: 'userGroupList',
   },
   IS_PUSH: {
     label: '是否推送',
@@ -45,7 +58,7 @@ const BASIC_FORM_CONFIG = {
   },
   CREATE_USER: {
     label: '创建人',
-    prop: 'createUser',
+    prop: 'realname',
     component: 'ElInput',
     componentProps: {
       disabled: true,
@@ -57,28 +70,13 @@ export const TASK_MANAGEMENT_FROM_CONFIG_CREATE: FormConfig[] = [
   BASIC_FORM_CONFIG.TASK_NAME,
   {
     label: '被检查(自查)单位',
-    prop: 'selfCheckUnit',
-    component: 'ElSelect',
-    componentProps: {
-      placeholder: '请选择被检查(自查)单位',
-      multiple: true,
-    },
+    prop: 'deptName',
+    slot: 'deptName',
   },
-  {
-    label: '应完成时间',
-    prop: 'shouldCompleteTime',
-    component: 'ElDatePicker',
-    componentProps: {
-      placeholder: '请选择应完成时间',
-      type: 'datetime',
-      format: 'YYYY-MM-DD HH:mm',
-      dateFormat: 'MMM DD, YYYY',
-      timeFormat: 'HH:mm',
-    },
-  },
-  BASIC_FORM_CONFIG.TASK_TYPE,
-  BASIC_FORM_CONFIG.SHOULD_COMPLETE_TIME,
-  BASIC_FORM_CONFIG.CHECK_USER,
+  BASIC_FORM_CONFIG.INSPECT_TYPE,
+  BASIC_FORM_CONFIG.DUE_COMPLETE_TIME,
+  BASIC_FORM_CONFIG.INSPECT_REQUIREMENT,
+  BASIC_FORM_CONFIG.USER_GROUP_LIST,
   BASIC_FORM_CONFIG.IS_PUSH,
   BASIC_FORM_CONFIG.CREATE_USER,
 ];
@@ -88,51 +86,40 @@ export const TASK_MANAGEMENT_FROM_CONFIG_EDIT: FormConfig[] = [
   BASIC_FORM_CONFIG.TASK_NAME,
   {
     label: '被检查(自查)单位',
-    prop: 'selfCheckUnit',
+    prop: 'deptName',
     component: 'ElInput',
     componentProps: {
       placeholder: '请输入被检查(自查)单位',
       disabled: true,
     },
   },
-  {
-    label: '应完成时间',
-    prop: 'shouldCompleteTime',
-    component: 'ElDatePicker',
-    componentProps: {
-      placeholder: '请选择应完成时间',
-      type: 'datetime',
-      format: 'YYYY-MM-DD HH:mm',
-      dateFormat: 'MMM DD, YYYY',
-      timeFormat: 'HH:mm',
-    },
-  },
-  BASIC_FORM_CONFIG.TASK_TYPE,
-  BASIC_FORM_CONFIG.SHOULD_COMPLETE_TIME,
-  BASIC_FORM_CONFIG.CHECK_USER,
+  BASIC_FORM_CONFIG.INSPECT_TYPE,
+  BASIC_FORM_CONFIG.DUE_COMPLETE_TIME,
+  BASIC_FORM_CONFIG.INSPECT_REQUIREMENT,
+  BASIC_FORM_CONFIG.USER_GROUP_LIST,
   BASIC_FORM_CONFIG.IS_PUSH,
   BASIC_FORM_CONFIG.CREATE_USER,
 ];
 
 // 任务管理表单数据
 export const TASK_MANAGEMENT_FROM_DATA: TaskManagementRuleForm = {
-  taskName: '',
-  selfCheckUnit: '',
-  taskType: null,
-  taskTemplate: null,
-  shouldCompleteTime: '',
-  checkRequirement: '',
-  checkUser: [],
+  name: '',
+  deptIdList: [],
+  inspectType: null,
+  dueCompleteTime: '',
+  inspectRequirement: '',
+  userGroupList: [],
   isPush: null,
-  createUser: '',
+  realname: '',
+  templateId: null,
 };
 
 // 任务管理表单规则
 export const TASK_MANAGEMENT_FROM_RULES = {
-  taskName: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
-  // selfCheckUnit: [{ required: true, message: '请选择被检查(自查)单位', trigger: 'change' }],
-  taskType: [{ required: true, message: '请选择检查类型', trigger: 'change' }],
-  shouldCompleteTime: [{ required: true, message: '请选择应完成时间', trigger: 'change' }],
-  checkUser: [{ required: true, message: '请选择检查人员', trigger: 'change' }],
+  name: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
+  deptIdList: [{ required: true, message: '请选择被检查(自查)单位', trigger: 'change' }],
+  inspectType: [{ required: true, message: '请选择检查类型', trigger: 'change' }],
+  dueCompleteTime: [{ required: true, message: '请选择应完成时间', trigger: 'change' }],
+  userGroupList: [{ required: true, message: '请选择检查责任人', trigger: 'change' }],
   isPush: [{ required: true, message: '请选择是否推送', trigger: 'change' }],
 };

+ 2 - 0
src/views/disaster/disaster-precaution/src/config/index.ts

@@ -4,6 +4,7 @@ import {
   TASK_MANAGEMENT_TABLE_COLUMNS,
   TASK_EXECUTION_TABLE_COLUMNS,
   TABLE_MANAGEMENT_HEIGHT_DEFAULT,
+  TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION,
   TABLE_MANAGEMENT_HEIGHT_BATCH_OPERATION,
 } from './table';
 import { TASK_MANAGEMENT_SEARCH_CONFIG, TASK_EXECUTION_SEARCH_CONFIG } from './search';
@@ -26,5 +27,6 @@ export {
   TASK_MANAGEMENT_FROM_DATA,
   TASK_MANAGEMENT_FROM_RULES,
   TABLE_MANAGEMENT_HEIGHT_DEFAULT,
+  TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION,
   TABLE_MANAGEMENT_HEIGHT_BATCH_OPERATION,
 };

+ 7 - 7
src/views/disaster/disaster-precaution/src/config/search.ts

@@ -3,7 +3,7 @@
  */
 import type { SearchConfig } from '@/views/disaster/types';
 import {
-  TASK_TYPE_OPTIONS,
+  INSPECT_TYPE_OPTIONS,
   TASK_STAGE_OPTIONS_MANAGEMENT,
   TASK_STAGE_OPTIONS_EXECUTION,
 } from '../constants/task-execution';
@@ -11,11 +11,11 @@ import { ACTIVE_STATUS_OPTIONS } from '@/views/disaster/constant';
 
 // 通用搜索配置
 const BASIC_SEARCH_CONFIG = {
-  TASK_TYPE: {
+  INSPECT_TYPE: {
     label: '检查类型',
-    prop: 'taskType',
+    prop: 'inspectType',
     component: 'ElSelect',
-    selectOptions: TASK_TYPE_OPTIONS,
+    selectOptions: INSPECT_TYPE_OPTIONS,
     componentProps: {
       placeholder: '请选择检查类型',
     },
@@ -24,10 +24,10 @@ const BASIC_SEARCH_CONFIG = {
 
 // 任务管理搜索配置
 export const TASK_MANAGEMENT_SEARCH_CONFIG: SearchConfig[] = [
-  BASIC_SEARCH_CONFIG.TASK_TYPE,
+  BASIC_SEARCH_CONFIG.INSPECT_TYPE,
   {
     label: '生效状态',
-    prop: 'activeStatus',
+    prop: 'effectStatus',
     component: 'ElSelect',
     selectOptions: ACTIVE_STATUS_OPTIONS,
     componentProps: {
@@ -36,7 +36,7 @@ export const TASK_MANAGEMENT_SEARCH_CONFIG: SearchConfig[] = [
   },
   {
     label: '任务阶段',
-    prop: 'taskStage',
+    prop: 'taskState',
     component: 'ElSelect',
     selectOptions: TASK_STAGE_OPTIONS_MANAGEMENT,
     componentProps: {

+ 17 - 15
src/views/disaster/disaster-precaution/src/config/table.ts

@@ -3,8 +3,9 @@
  */
 import type { TableColumnProps } from '@/types/basic-table';
 
-export const TABLE_MANAGEMENT_HEIGHT_DEFAULT = '60vh';
-export const TABLE_MANAGEMENT_HEIGHT_BATCH_OPERATION = 'calc(60vh - 50px)';
+export const TABLE_MANAGEMENT_HEIGHT_DEFAULT = 'calc(65vh - 20px)';
+export const TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION = 'calc(70vh - 20px)';
+export const TABLE_MANAGEMENT_HEIGHT_BATCH_OPERATION = 'calc(65vh - 95px)';
 
 // 基础表格样式配置
 const TABLE_OPTIONS_DEFAULT = {
@@ -15,7 +16,6 @@ const TABLE_OPTIONS_DEFAULT = {
 // 任务管理表格样式配置
 export const TABLE_OPTIONS_MANAGEMENT = {
   ...TABLE_OPTIONS_DEFAULT,
-  height: TABLE_MANAGEMENT_HEIGHT_DEFAULT,
 };
 // 任务执行表格样式配置
 export const TABLE_OPTIONS_EXECUTION = {
@@ -26,29 +26,30 @@ export const TABLE_OPTIONS_EXECUTION = {
 // 基础表格列配置
 const BASIC_TABLE_COLUMNS = {
   TASK_NAME: {
-    prop: 'taskName',
+    prop: 'name',
     label: '任务名称',
     align: 'center',
     slot: 'taskName',
+    width: '150cpx',
   },
   SELF_CHECK_UNIT: {
-    prop: 'selfCheckUnit',
+    prop: 'deptName',
     label: '被检查(自查)单位',
     align: 'center',
   },
-  TASK_TYPE: {
-    prop: 'taskType',
+  INSPECT_TYPE: {
+    prop: 'inspectType',
     label: '检查类型',
     align: 'center',
-    slot: 'taskType',
+    slot: 'inspectType',
   },
-  SHOUDLE_COMPLETE_TIME: {
-    prop: 'shouldCompleteTime',
+  DUE_COMPLETE_TIME: {
+    prop: 'dueCompleteTime',
     label: '应完成时间',
     align: 'center',
   },
   TASK_STAGE: {
-    prop: 'taskStage',
+    prop: 'taskState',
     label: '任务阶段',
     align: 'center',
     slot: 'taskStage',
@@ -74,13 +75,14 @@ export const TASK_MANAGEMENT_TABLE_COLUMNS: TableColumnProps[] = [
   },
   BASIC_TABLE_COLUMNS.TASK_NAME,
   BASIC_TABLE_COLUMNS.SELF_CHECK_UNIT,
-  BASIC_TABLE_COLUMNS.TASK_TYPE,
-  BASIC_TABLE_COLUMNS.SHOUDLE_COMPLETE_TIME,
+  BASIC_TABLE_COLUMNS.INSPECT_TYPE,
+  BASIC_TABLE_COLUMNS.DUE_COMPLETE_TIME,
   {
-    prop: 'activeStatus',
+    prop: 'effectStatus',
     label: '生效状态',
     align: 'center',
-    slot: 'activeStatus',
+    slot: 'effectStatus',
+    width: '120cpx',
   },
   BASIC_TABLE_COLUMNS.TASK_STAGE,
   BASIC_TABLE_COLUMNS.ACTION,

+ 16 - 16
src/views/disaster/disaster-precaution/src/constants/task-execution.ts

@@ -1,21 +1,21 @@
 /**
  * 任务执行常量
  */
-export enum TASK_TYPE {
-  Previous = 0,
-  Midterm = 1,
-  Later = 2,
+export enum INSPECT_TYPE {
+  Previous = 1,
+  Midterm,
+  Later,
 }
 
-export enum OVERDUE_STATUS {
-  OVERDUE = 1,
-  NOT_OVERDUE = 0,
-}
+// export enum OVERDUE_STATUS {
+//   OVERDUE = 1,
+//   NOT_OVERDUE = 0,
+// }
 
-export const TASK_TYPE_MAP: Record<number, string> = {
-  [TASK_TYPE.Previous]: '台讯前期',
-  [TASK_TYPE.Midterm]: '台讯中期',
-  [TASK_TYPE.Later]: '台讯后期',
+export const INSPECT_TYPE_MAP: Record<number, string> = {
+  [INSPECT_TYPE.Previous]: '台讯前期',
+  [INSPECT_TYPE.Midterm]: '台讯中期',
+  [INSPECT_TYPE.Later]: '台讯后期',
 };
 
 export enum TASK_STAGE {
@@ -32,18 +32,18 @@ export const TASK_STAGE_MAP: Record<number, string> = {
   [TASK_STAGE.COMPLETED]: '已完成',
 };
 
-export const TASK_TYPE_OPTIONS = [
+export const INSPECT_TYPE_OPTIONS = [
   {
     label: '台讯前期',
-    value: TASK_TYPE.Previous,
+    value: INSPECT_TYPE.Previous,
   },
   {
     label: '台讯中期',
-    value: TASK_TYPE.Midterm,
+    value: INSPECT_TYPE.Midterm,
   },
   {
     label: '台讯后期',
-    value: TASK_TYPE.Later,
+    value: INSPECT_TYPE.Later,
   },
 ];
 

+ 4 - 4
src/views/disaster/disaster-precaution/src/constants/template-detail.ts

@@ -4,7 +4,7 @@
 import Previous from '../images/previous@1X.png';
 import Midterm from '../images/midterm@1X.png';
 import Later from '../images/later@1X.png';
-import { TASK_TYPE } from './task-execution';
+import { INSPECT_TYPE } from './task-execution';
 // 模板前、中、后期数据
 export const PREVIOUS_TEMPLATE_DATA = [
   {
@@ -445,19 +445,19 @@ export const LATER_TEMPLATE_DATA = [
 ];
 export const TASK_TEMPLATE_LIST = [
   {
-    id: TASK_TYPE.Previous,
+    id: INSPECT_TYPE.Previous,
     name: '台讯前期安全检查模版',
     img: Previous,
     data: PREVIOUS_TEMPLATE_DATA,
   },
   {
-    id: TASK_TYPE.Midterm,
+    id: INSPECT_TYPE.Midterm,
     name: '台讯中期安全检查任务模版',
     img: Midterm,
     data: MIDTERM_TEMPLATE_DATA,
   },
   {
-    id: TASK_TYPE.Later,
+    id: INSPECT_TYPE.Later,
     name: '台讯后期安全检查模版',
     img: Later,
     data: LATER_TEMPLATE_DATA,

+ 4 - 0
src/views/disaster/disaster-precaution/src/style/task-execution.scss

@@ -4,8 +4,12 @@
   width: 100%;
   span {
     flex: 1;
+    text-align: left;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
   }
+  img {
+    width: 36cpx;
+  }
 }

+ 13 - 0
src/views/disaster/disaster-precaution/src/style/task-item.scss

@@ -1,3 +1,4 @@
+@use '@/styles/variables.scss' as *;
 :deep(.el-date-editor) {
   --el-date-editor-width: 100%;
 }
@@ -7,3 +8,15 @@
   gap: 10cpx;
   width: 100%;
 }
+.user-group-list {
+  width: 100%;
+  position: relative;
+}
+.group-info-span {
+  position: absolute;
+  left: 0;
+  bottom: -30px;
+  cursor: pointer;
+  font-size: 10cpx;
+  color: $primary-color;
+}

+ 2 - 0
src/views/disaster/disaster-precaution/src/type.ts

@@ -25,5 +25,7 @@ export type MergedRow = MainRow | FooterRow;
 import type { TaskManagementItemResponse } from '@/types/disaster-precaution';
 // 任务管理表单类型
 export interface TaskManagementRuleForm extends Omit<TaskManagementItemResponse, 'id'> {
+  id?: number;
+  deptName?: string;
   [key: string]: any;
 }

+ 4 - 4
src/views/disaster/disaster-warning/PageDefenseNotice.vue

@@ -119,16 +119,16 @@
 
   const tableData = ref<DefenseNoticeListResponse[]>([]);
   const router = useRouter();
-  const defaultPath = '/disaster-prevention/disaster-warning/defense-notice-item';
+  const defaultName = 'defense-notice-item';
   const handleEditDefenseNotice = (id: number) => {
     router.push({
-      path: defaultPath,
+      name: defaultName,
       query: { id, operate: 'edit' },
     });
   };
   const handleCreateDefenseNotice = () => {
     router.push({
-      path: defaultPath,
+      name: defaultName,
       query: {
         operate: 'create',
       },
@@ -136,7 +136,7 @@
   };
   const handleViewDefenseNotice = (id: number) => {
     router.push({
-      path: defaultPath,
+      name: defaultName,
       query: { id },
     });
   };

+ 3 - 3
src/views/disaster/disaster-warning/PageWarningInfo.vue

@@ -131,10 +131,10 @@
     const icon = WEATHER_DISASTER_ALERT_TYPE.find((item) => item.label === disasterType)?.icon;
     return icon ?? PlaceHolderWeather;
   };
-  const defaultPath = '/disaster-prevention/disaster-warning/warning-info-item';
+  const defaultName = 'warning-info-item';
   const handleCreateWarningInfo = () => {
     router.push({
-      path: defaultPath,
+      name: defaultName,
       query: {
         operate: 'create',
       },
@@ -142,7 +142,7 @@
   };
   const handleEditWarningInfo = (id: number) => {
     router.push({
-      path: defaultPath,
+      name: defaultName,
       query: {
         operate: 'edit',
         id,