Bläddra i källkod

Merge branch 'dev_officer' of maoming/yjxp-web into master

yangyuxuan 6 månader sedan
förälder
incheckning
bda16c7a38

BIN
src/assets/images/index/videoImage2.png


+ 20 - 0
src/router/routes.ts

@@ -564,6 +564,26 @@ export const leaderRoute: Array<RouteRecordRaw> = [
           title: "专家个人信息",
           noCache: true
         }
+      },
+      {
+        path: "emergencyofficials",
+        name: "EmergencyOfficials",
+        component: () =>
+          import("@/views/disasterRiskMonitor/emergencyOfficials.vue"),
+        meta: {
+          title: "应急干部",
+          noCache: true
+        }
+      },
+      {
+        path: "cadreinformation",
+        name: "CadreInformation",
+        component: () =>
+            import("@/views/disasterRiskMonitor/cadreInformation.vue"),
+        meta: {
+          title: "应急干部",
+          noCache: true
+        }
       }
     ]
   }

+ 236 - 0
src/views/disasterRiskMonitor/cadreInformation.vue

@@ -0,0 +1,236 @@
+<template>
+  <div class="container">
+    <div class="wrapper" @click.stop>
+      <div class="block">
+        <div
+          style="
+            background-color: #ffffff;
+            height: 140px;
+            width: 100%;
+            margin-top: -15px;
+          "
+        >
+          <div class="information-box">
+            <div class="circle2">
+              <img
+                :src="
+                  personalInformation.state === false ? onlineUser : offlineUser
+                "
+                alt=""
+              />
+            </div>
+            <div style="margin: 30px 15px">
+              <div class="online-box">
+                <div style="font-size: 18px; font-weight: bold">
+                  {{ personalInformation.name }}
+                </div>
+                <div
+                  class="isOnline"
+                  :class="{ notOnline: personalInformation.state }"
+                >
+                  {{ personalInformation.state === false ? "在线" : "离线" }}
+                </div>
+              </div>
+              <div style="margin-top: 15px">行政区划:茂名市</div>
+            </div>
+          </div>
+        </div>
+        <div class="unit1-box">
+          <div class="text" style="margin: 5px 0">所属单位</div>
+          <div class="info-content">{{ personalInformation.unit_name }}</div>
+        </div>
+        <div class="unit1-box">
+          <div class="text" style="margin: 5px 0">职务</div>
+          <div class="info-content">
+            {{ personalInformation.position }}
+          </div>
+        </div>
+        <div
+          class="unit1-box"
+          style="display: flex; justify-content: space-between"
+        >
+          <div class="text" style="margin: 10px 0">视频通话</div>
+          <div style="display: flex; justify-content: center; align-items: center;">
+            <div class="video">
+              <img
+                  src="@/assets/images/index/videoImage2.png"
+                  style="height: 20px"
+              />
+              <div style="color: #5991d0; margin-left: 5px">视频</div>
+            </div>
+          </div>
+
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref } from "vue";
+import profile from "@/assets/images/tempImage/用户.png";
+import offlineUser from "@/assets/images/threePreventionResponsiblePerson/offlineUsers.png";
+import onlineUser from "@/assets/images/threePreventionResponsiblePerson/onlineUsers.png";
+import { getPersonalCard } from "@/api/persons";
+
+const isShowInformation = ref(false);
+const personalInformation = ref({});
+const requestParameters = ref({
+  id: "",
+  name: "",
+  type: [],
+  type_parent_id: "",
+  checkedId: ""
+});
+const route = useRoute();
+const userId = ref(route.query.id);
+getPersonalCard(userId.value).then(res => {
+  personalInformation.value = res.data || [];
+});
+
+// const personType = personalInformation.value.type.toString();
+const showPersonalInformation = item => {
+  isShowInformation.value = true;
+  personalInformation.value = item;
+};
+</script>
+
+<style scoped lang="scss">
+.select-box {
+  display: flex;
+  flex-direction: row;
+}
+.container {
+  height: calc(100vh - 55px);
+}
+.circle {
+  width: 80px;
+  height: 80px;
+  border-radius: 50%;
+  background-color: #eaeaea;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: black;
+  font-size: 15px;
+  margin: 15px 5px 15px;
+}
+.circle2 {
+  width: 100px;
+  height: 100px;
+  border-radius: 50%;
+  background-color: #eaeaea;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: black;
+  font-size: 15px;
+  margin: 15px 5px 15px;
+}
+.person-box {
+  display: flex;
+  flex-direction: row;
+}
+.information-card {
+  display: flex;
+  flex-direction: column;
+  margin-left: 10px;
+}
+.type-name {
+  background-color: #cde6ff;
+  padding: 3px 15px;
+  font-size: 13px;
+  color: dodgerblue;
+  margin-right: 3px;
+  border-radius: 2px;
+  &:nth-last-child {
+    margin-right: 0;
+  }
+  margin-bottom: 3px;
+}
+.text-ellipsis {
+  margin-top: 5px;
+  width: 250px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  font-size: 14px;
+}
+.one {
+  display: flex;
+  justify-content: space-between;
+  margin-top: 15px;
+  align-items: center;
+}
+.isOnline {
+  font-size: 12px;
+  color: #ffffff;
+  background-color: #b3b3b3;
+  padding: 0px 10px;
+  height: 15px;
+  margin-left: 15px;
+  margin-top: 4px;
+  padding-bottom: 18px;
+  border-radius: 2px;
+}
+.notOnline {
+  background-color: limegreen;
+}
+.wrapper {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 100%;
+}
+.block {
+  width: 100%;
+  height: 100%;
+  background-color: #f2f2f2;
+}
+.information-box {
+  display: flex;
+  flex-direction: row;
+  padding: 10px 10px;
+}
+.unit-box {
+  display: flex;
+  flex-direction: row;
+  background-color: #ffffff;
+  height: 35px;
+  width: 100%;
+  margin-top: 5px;
+}
+.unit1-box {
+  display: flex;
+  flex-direction: row;
+  background-color: #ffffff;
+  width: 100%;
+  margin-top: 2px;
+  padding-top: 5px;
+  padding-bottom: 5px;
+}
+.info-content {
+  margin: 10px 20px;
+}
+.text {
+  flex-shrink: 0;
+  color: grey;
+  width: 85px;
+  padding: 5px 10px;
+  text-align-last: justify;
+}
+.online-box {
+  display: flex;
+  flex-direction: row;
+}
+.video {
+  background-color: #f6f8fd;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 90px;
+  height: 40px;
+  margin-right: 15px;
+  border-radius: 10%;
+}
+</style>

+ 336 - 0
src/views/disasterRiskMonitor/emergencyOfficials.vue

@@ -0,0 +1,336 @@
+<template>
+  <div class="container">
+    <div v-show="!isShowStructure" class="page-head">
+      <van-search
+          v-model="keywords"
+          placeholder="请输入搜索关键词"
+          :left-icon="searchImg"
+          :right-icon="closeImg"
+          @search="onSearch"
+      />
+      <div class="select-box">
+        <div class="adress-box" @click="showStructure">
+          <div class="blue-rectangle" />
+          <div v-if="!!requestParameters.checkedId" class="block1">
+            <div>{{ upOneLevel }}</div>
+            <div style="margin: 0 5px">{{ ">" }}</div>
+            <div style="color: #1d92ff">{{ adressContent }}</div>
+          </div>
+          <div v-else class="block1" style="height: 27px">
+            <div>广东省</div>
+            <div style="margin: 0 5px">{{ ">" }}</div>
+            <div style="color: #1d92ff">茂名市</div>
+          </div>
+        </div>
+        <div />
+      </div>
+      <hr style="color: #f9f9f9" />
+    </div>
+    <div v-show="!isShowStructure" class="scroll-list">
+      <van-list
+          v-model:loading="loading"
+          :finished="finished"
+          finished-text="没有更多了"
+          @load="onLoad"
+      >
+        <div v-for="(item, index) in list" :key="item.id">
+          <div class="person-box2" @click="personInform(item)">
+            <div class="circle">
+              <img :src="onlineUser" alt="" />
+            </div>
+            <div style="display: flex">
+              <div class="information-card2">
+                <div style="display: flex">
+                  <div style="font-weight: bold">{{ item.name }}</div>
+                </div>
+                <div style="display: flex">
+                  <div style="font-size: 13px; margin-top: 5px; color: #979797">
+                    {{ item.unit }}&nbsp;&nbsp;{{ item.position }}
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="link-top" />
+        </div>
+      </van-list>
+    </div>
+    <organizationalStructure
+        v-if="isShowStructure"
+        v-model:isShowStructure="isShowStructure"
+        @confirm="handleSelect"
+    />
+  </div>
+
+</template>
+
+<script setup lang="ts">
+import offlineUser from "@/assets/images/threePreventionResponsiblePerson/offlineUsers.png";
+import onlineUser from "@/assets/images/threePreventionResponsiblePerson/onlineUsers.png";
+import { getDicts } from "@/api/system/dict/data";
+import { getEventList } from "@/api/event";
+import searchImg from "@/assets/images/search.png";
+import closeImg from "@/assets/images/close.png";
+import OrganizationalStructure from "@/views/threePreventionResponsiblePerson/organizationalStructure.vue";
+import { getPersonalData, getPersonalType } from "@/api/persons";
+
+const list = ref([
+  {
+    id: "1",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "2",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "3",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "4",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "5",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "6",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "7",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "8",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "9",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  },
+  {
+    id: "10",
+    name: "谢和平",
+    unit: "茂名市应急管理局",
+    position: "一级科员",
+    title: "教授",
+    expertType: "其它突发事件"
+  }
+]);
+const router = useRouter();
+const keywords = ref("");
+let responsibility_type = ref([]);
+const fieldValue = ref("三防指挥部");
+const showPicker = ref(false);
+const onConfirm = ({ selectedValues, selectedOptions }) => {
+  showPicker.value = false; //用于控制 van-picker 组件的显示状态,将其设置为 false 表示隐藏选择器。
+  requestParameters.value.type_parent_id = selectedValues.toString(); //将用户选择的值(selectedValues)保存到 requestParameters 对象的 type_content 属性中
+  fieldValue.value = selectedOptions[0].dictLabel; //将用户选择的第一个选项的 dictLabel 属性值保存到 fieldValue 中
+  requestParameters.value.page = 1;
+  onLoad();
+};
+const loading = ref(false);
+const finished = ref(false);
+const customFieldName = {
+  text: "dictLabel",
+  value: "dictValue"
+};
+const requestParameters = ref({
+  name: "",
+  type: [],
+  type_parent_id: "",
+  page: 1,
+  pageSize: 10,
+  Name: keywords,
+  checkedId: ""
+});
+const personInform = item => {
+  router.push({ name: "CadreInformation", query: { id: item.id } });
+};
+const persons = ref([]);
+const onLoad = () => {
+  getPersonalData(requestParameters.value).then(res => {
+    var item = res.data || [];
+    // 重置 persons 数组(如果是第一页)
+    if (requestParameters.value.page == 1) {
+      persons.value = [];
+    }
+    // 将新数据添加到 persons 数组中
+    item.forEach(temp => {
+      persons.value.push(temp);
+    });
+    // 检查是否加载了所有数据
+    if (persons.value.length >= res.total) {
+      finished.value = true;
+    } else {
+      finished.value = false;
+    }
+    requestParameters.value.page++;
+    loading.value = false;
+  });
+};
+onMounted(() => {
+  getDicts("responsibility_type").then(res => {
+    res.data.unshift({ dictLabel: "所有类型", dictValue: "" });
+    responsibility_type.value = res.data;
+  });
+  getPersonalType(requestParameters.value).then(res => {
+    responsibility_type = res.data || [];
+  });
+});
+const onSearch = keywords => {
+  requestParameters.value.page = 1;
+  onLoad();
+};
+const showPersonalInformation = item => {
+  router.push({ name: "PersonInformation", query: { id: item.id } });
+};
+let keyword = ref("");
+let treeRef = ref();
+let checkData = ref([]);
+const isShowStructure = ref(false);
+const showStructure = () => {
+  isShowStructure.value = true;
+};
+
+const adressContent = ref();
+const upOneLevel = ref();
+
+const filterNode = (value, data) => {
+  if (!value) return true;
+  return data.label.indexOf(value) !== -1;
+};
+let selectedTreeId = ref([]);
+const handleSelect = data => {
+  adressContent.value = data.label;
+  upOneLevel.value = data.value;
+  requestParameters.value.checkedId = data.id;
+};
+</script>
+
+<style scoped lang="scss">
+.container {
+  height: calc(100vh - 55px);
+  display: flex;
+  flex-direction: column;
+}
+.select-box {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  margin-top: -2px;
+  background: #fff;
+}
+.circle {
+  width: 55px;
+  height: 55px;
+  border-radius: 50%;
+  background-color: #eaeaea;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: black;
+  font-size: 15px;
+  margin: 15px 5px 15px;
+}
+.person-box {
+  display: flex;
+  flex-direction: row;
+  margin-left: 10px;
+}
+.person-box2 {
+  display: flex;
+  flex-direction: row;
+  padding-left: 8px;
+  background-color: #ffffff;
+}
+.information-card {
+  display: flex;
+  flex-direction: column;
+  margin-left: 10px;
+  width: 250px;
+}
+.block {
+  width: 100%;
+  height: 100%;
+  background-color: #f2f2f2;
+}
+.page-head {
+  width: 100%;
+}
+.blue-rectangle {
+  width: 6px;
+  height: 20px;
+  background-image: linear-gradient(180deg, #00fce7 0%, #2c81ff 100%);
+  border-radius: 0 3px 0 0;
+  margin-left: -10px;
+}
+
+.adress-box {
+  display: flex;
+  flex-direction: row;
+  padding-top: 10px;
+  width: 50%;
+  margin-left: 20px;
+}
+.link-top {
+  height: 0.5px;
+  border-top: solid #f2f2f2 1px;
+}
+.block1 {
+  display: flex;
+  flex-direction: row;
+  margin-left: 5px;
+}
+.scroll-list {
+  flex: 1;
+  overflow: scroll;
+}
+.information-card2 {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  margin-left: 10px;
+  width: 230px;
+  margin-top: 2px;
+}
+</style>

+ 1 - 0
src/views/leader/index.vue

@@ -133,6 +133,7 @@ const menu2 = ref([
       { name: "易涝点视频", icon: "easyToflood", url: "EasyToFloodPoint" },
       { name: "地震速报", icon: "earthquakeReport", url: "EarthquakeRapidReport" },
       { name: "专家库", icon: "expertDatabase", url: "ExpertDatabase" },
+      { name: "应急干部", icon: "expertDatabase", url: "EmergencyOfficials" },
     ]
   },
   {

+ 1 - 0
src/views/threePreventionResponsiblePerson/organizationalStructure.vue

@@ -115,6 +115,7 @@ const fetchData = async (resolve, id) => {
   let res = await getTree(id);
   return resolve(res.data);
 };
+
 const handleCheckChange = data => {
   emits("confirm", {
     label: data.label,

+ 4 - 1
src/views/threePreventionResponsiblePerson/personInformation.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="background-color: #1d92ff; height: calc(100vh - 55px)">
+  <div class="container">
     <div class="wrapper" @click.stop>
       <div class="block">
         <div
@@ -98,6 +98,9 @@ const showPersonalInformation = item => {
   display: flex;
   flex-direction: row;
 }
+.container {
+  height: calc(100vh - 55px)
+}
 .circle {
   width: 80px;
   height: 80px;