浏览代码

更新工作人员端的任务管理

libushang 6 月之前
父节点
当前提交
ba74de942a

+ 9 - 0
src/api/emergencyCommandMap/JointDuty.ts

@@ -109,3 +109,12 @@ export function deleteTask(data) {
     data: data
   });
 }
+
+// 任务查询(小屏专用)
+export function getTaskList(params) {
+  return request({
+    url: "/api/taskRegistration/list",
+    method: "get",
+    params: params
+  });
+}

+ 2 - 2
src/views/worker/eventManagement/index.vue

@@ -8,8 +8,8 @@
       </div>
       <div class="content">
         <eventList v-if="activeIndex === 'event'" @changIndex="handleClickTab" />
+        <taskList v-else-if="activeIndex === 'task'" />
         <!--
-        <HiddenSource v-else-if="activeIndex === 'task'" />
         <investigationRecords v-else-if="activeIndex === 'job'" />
       -->
       </div>
@@ -18,7 +18,7 @@
   <script setup lang="ts">
   import { ref } from "vue";
   import eventList from "./eventList.vue";
-  //import HiddenSource from "./HiddenSource.vue";
+  import taskList from "./taskList.vue";
   //import dangerousSource from "./dangerousSource.vue";
 
   let activeIndex = ref('event');

+ 315 - 0
src/views/worker/eventManagement/taskList.vue

@@ -0,0 +1,315 @@
+<template>
+    <div class="container">
+      <!--搜索框-->
+      <van-search
+        v-model="queryParams.search_keyword"
+        class="common-search"
+        placeholder="请输入任务内容"
+        :left-icon="searchImg"
+        :right-icon="closeImg"
+        :clearable="false"
+        @search="on_search_keyword"
+        @click-right-icon.stop="on_search_cancel"
+      />
+      <!-- 两个类型选择 -->
+      <van-dropdown-menu>
+        <van-dropdown-item
+          v-model="queryParams.task_type"
+          :title="!!queryParams.task_type ? '' : '类型'"
+          :options="opt_task_type"
+          @change="change_task_type"
+        />
+        <van-dropdown-item
+          v-model="queryParams.processing_status"
+          :title="!!queryParams.processing_status ? '' : '状态'"
+          :options="opt_processing_status"
+          @change="change_processing_status"
+        />
+      </van-dropdown-menu>
+  
+      <van-list
+        v-model:loading="loading"
+        v-model:error="error"
+        error-text="请求失败,点击重新加载"
+        :finished="finished"
+        finished-text="没有更多事件了"
+        class="list"
+        @load="getList"
+      >
+        <div
+          v-for="(item, index) in task_list"
+          :key="item.id"
+          class="event-list-item"
+        >
+          <div class="item-title">
+            <div class="task_type">
+              {{ get_task_type_text(item.task_type) }}
+            </div>
+            <div class="item-title-text">办理时间:
+              {{ item.creation_time }}
+            </div>
+          </div>
+          <div class="item-status">
+            <div class="task_status">{{item.event_name}}</div>
+            <div class="task_status">{{item.processing_status}}</div>
+          </div>
+          <div class="item-content">
+            {{ item.task_description || "暂无任务内容"}}
+          </div>
+          <div class="item-bottom" v-if="item.processing_status != '已完成'">
+            <van-button
+              type="primary"
+              @click="handleRequest(index)"
+            >
+              请示领导
+            </van-button>
+
+            <van-button
+              type="primary"
+              @click="handleFeedback(index)"
+            >
+              任务反馈
+            </van-button>
+          </div>
+          <div class="item-bottom" v-else>
+            <van-button
+              type="primary"
+              @click="handleFeedback(index)"
+            >
+              查看反馈
+            </van-button>
+          </div>
+        </div>
+      </van-list>
+    </div>
+  </template>
+  
+  <script lang="ts" setup>
+  import { getCurrentInstance, ref} from "vue";
+  import { useRouter } from "vue-router";
+  import { getTaskList } from '@/api/emergencyCommandMap/JointDuty';
+  import searchImg from "@/assets/images/search.png";
+  import closeImg from "@/assets/images/close.png";
+  
+  const proxy = getCurrentInstance()?.proxy;
+  //const { mm_event_type, mm_event_level, mm_event_state } = toRefs<any>(
+  //  proxy?.useDict("mm_event_type", "mm_event_level", "mm_event_state")
+  //);
+
+  
+  const router = useRouter();
+  
+  const opt_task_type = [
+    { text: "全部", value: "" },
+    { text: "事件处置", value: "0" },
+    { text: "防范措施", value: "1" },
+    { text: "险情处理", value: "2" },
+    { text: "督办任务", value: "3" }
+  ];
+  
+  const opt_processing_status = [
+    { text: "全部", value: "" },
+    { text: "处理中", value: "处理中" },
+    { text: "已完成", value: "已完成" }
+  ];
+
+  const get_task_type_text = (val) => {
+    return opt_task_type.find(item => item.value == val).text
+  }
+  
+  const current_item = ref(null);
+  const task_list = ref([]);
+  const total = ref(0);
+  const loading = ref(false);
+  const error = ref(false);
+  const finished = ref(false);
+  const queryParams = ref({
+    page: 0,
+    page_size: 10,
+    task_type: "",
+    processing_status: "",
+    search_keyword: ""
+  });
+  
+  const on_search_keyword = val => {
+    queryParams.value.search_keyword = val;
+    queryParams.value.page = 0;
+    getList();
+  };
+  
+  const on_search_cancel = () => {
+    queryParams.value.search_keyword = "";
+    queryParams.value.page = 0;
+    getList();
+  };
+  
+  const change_task_type = () => {
+    queryParams.value.page = 0;
+    getList();
+  };
+
+  const change_processing_status = () => {
+    queryParams.value.page = 0;
+    getList();
+  };
+  
+  const getList = () => {
+    queryParams.value.page++;
+    getTaskList(queryParams.value)
+      .then(res => {
+        var items = res.data || [];
+        total.value = res.total;
+        if (queryParams.value.page == 1) {
+            task_list.value = [];
+        }
+        items.forEach(val => {
+            task_list.value.push(val);
+        });
+        if (queryParams.value.page_size * queryParams.value.page >= total.value) {
+          finished.value = true;
+        } else {
+          finished.value = false;
+        }
+      })
+      .catch(() => {
+        error.value = true;
+        finished.value = false;
+      })
+      .finally(() => {
+        loading.value = false;
+      });
+  };
+  
+  const handleRequest = (index) => {
+    current_item.value = task_list.value[index];
+    //router.push("/event/detail?event_id=" + current_item.value.event_id+"&nocontrol=1");
+  };
+
+  const handleFeedback = (index) => {
+    current_item.value = task_list.value[index];
+    //router.push("/event/detail?event_id=" + current_item.value.event_id+"&nocontrol=1");
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  .list {
+    height: calc(100vh - 102px);
+    overflow-y: auto;
+  }
+  .van-doc-block__title {
+    color: var(--van-doc-text-color-4);
+    margin: 0;
+    padding: 32px 16px 16px;
+    font-size: 14px;
+    font-weight: 400;
+    line-height: 16px;
+  }
+  
+  .event-list-item {
+    position: relative;
+    margin: 16px 16px 0;
+    background: #ffffff;
+    border-radius: 4px;
+    border: 0.5px solid #eaedf7;
+    box-shadow: 0 0 4px 0 #4554661a;
+    &:first-child {
+      margin-top: 0;
+    }
+    .item-title {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      min-height: 46px;
+      background-image: linear-gradient(180deg, #f3f7fd 0%, #ffffff 100%);
+      padding: 0 12px;
+      .item-title-text {
+        font-size: 14px;
+        color: #414f64;
+      }
+  
+      .item-title-control {
+        display: inline-flex;
+        justify-content: center;
+        align-items: center;
+      }
+      .van-button {
+        width: 73px;
+        height: 24px;
+        padding: 0;
+      }
+
+      .task_type {
+            font-size: 14px;
+            padding: 3px 10px;
+            color:#fff;
+            background: #2c81ff;
+        }
+    }
+
+    .item-status {
+        font-size: 14px;
+        display: flex;
+        flex-direction: row;
+        align-items: flex-start;
+        justify-content: start;
+        line-height: 20px;
+        padding: 0 12px 12px;
+        
+        .task_status {
+            padding: 2px 8px;
+            color: #414f64;
+            background: #ccc;
+            border: 0.8px solid #999;
+            border-radius: 2px;
+            margin-right:10px;
+            max-width: 220px;
+            white-space: nowrap;
+            text-overflow: ellipsis;
+            overflow: hidden;
+        }
+    }
+    .item-content {
+      padding: 0 12px 12px;
+      font-size: 14px;
+      color: #414f64;
+    }
+
+    .item-bottom {
+        display: flex;
+        align-items: center;
+        justify-content: flex-end;
+
+        .van-button {
+            width: 76px;
+            height: 30px;
+            padding: 0;
+            margin-right: 16px;
+            margin-bottom: 16px;
+            }
+    }
+  }
+  .van-dropdown-menu {
+    :deep(.van-dropdown-menu__bar) {
+      background: transparent;
+      box-shadow: none;
+    }
+  }
+  .common-search {
+    :deep(.van-field__left-icon) {
+      .van-icon__image {
+        width: 12px;
+        height: 12px;
+      }
+    }
+    :deep(.van-field__right-icon) {
+      width: 30px;
+      height: 30px;
+      padding: 0;
+      .van-icon__image {
+        width: 30px;
+        height: 30px;
+      }
+    }
+  }
+  </style>
+