Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

Hwf 5 hónapja
szülő
commit
14bcef55e2

+ 1 - 0
auto-imports.d.ts

@@ -7,6 +7,7 @@
 export {}
 declare global {
   const EffectScope: typeof import('vue')['EffectScope']
+  const ElIcon: typeof import('element-plus/es')['ElIcon']
   const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
   const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
   const autoResetRef: typeof import('@vueuse/core')['autoResetRef']

BIN
src/assets/images/tabBar/threepro.png


BIN
src/assets/images/tabBar/threeproActive.png


BIN
src/assets/images/tempImage/weizhi.png


+ 2 - 2
src/components/Tabbar/index.vue

@@ -52,8 +52,8 @@ watch(
           }
         },
         {
-          icon: "command",
-          iconActive: "commandActive",
+          icon: "threepro",
+          iconActive: "threeproActive",
           title: "三防责任人",
           to: {
             name: "ThreePreventionResponsiblePerson"

+ 121 - 95
src/views/threePreventionResponsiblePerson/index.vue

@@ -8,12 +8,9 @@
       @search="onSearch"
     />
     <div class="select-box">
-      <div
-        style="padding-top: 10px; width: 50%; margin-left: 20px"
-        @click="showStructure"
-
-      >
-        {{adressContent}}
+      <div class="adress-box" @click="showStructure">
+        <div class="blue-rectangle" />
+        <div style="margin-left: 5px">{{upOneLevel}}>{{ adressContent }}</div>
       </div>
       <div>
         <van-field
@@ -21,6 +18,7 @@
           is-link
           readonly
           placeholder="选择类型"
+          style="width: 122px"
           @click="showPicker = true"
         />
         <van-popup
@@ -39,6 +37,7 @@
         </van-popup>
       </div>
     </div>
+    <hr style="color: #f9f9f9" />
   </div>
   <div
     style="
@@ -61,7 +60,7 @@
           <div class="information-card">
             <div class="one">
               <div>{{ item.name }}</div>
-              <div class="isOnline" :class="{ notOnline: item.state }">
+              <div class="notOnline" :class="{ isOnline: item.state }">
                 {{ item.state === false ? "离线" : "在线" }}
               </div>
             </div>
@@ -76,7 +75,6 @@
       </div>
     </van-list>
   </div>
-
   <div>
     <van-overlay :show="isShowStructure">
       <div class="block1">
@@ -101,15 +99,9 @@
         <hr />
         <div style="margin-top: 1px">
           <el-tree
-            ref="treeRef"
-            class="filter-tree"
             :data="treeData"
-            show-checkbox
             :props="defaultProps"
-            :filter-node-method="filterNode"
-            node-key="uuid"
             default-expand-all
-            @check-change="handleCheckChange"
             style="
               height: calc(-145px - 70px + 100vh);
               overflow: scroll;
@@ -117,18 +109,31 @@
             "
           >
             <template #default="{ node, data }">
-              <span class="custom-tree-node">
-                <span>{{ node.label }}</span>
-                <span>
-                  <a @click="append(data)" style="color: #d6d6d7"> [{{ data.personSum }}] </a>
-                </span>
+              <div v-if="!data.isShowSelect" class="custom-tree-node">
+                {{ node.label }}
+              </div>
+              <div
+                v-else
+                class="custom-tree-node"
+                @click="handleCheckChange(data)"
+              >
+                <img :src="adressImage" class="addressImage" />
+                {{ node.label }}
+              </div>
+              <span>
+                <a
+                  style="color: #d6d6d7; margin-right: 12px"
+                  @click="append(data)"
+                >
+                  [ {{ data.personSum }} ]
+                </a>
               </span>
             </template>
           </el-tree>
         </div>
         <div class="footer">
-          <div class="cancel-btn" @click="handleCancel">取消</div>
-          <div class="confirm-btn" @click="handleConfirm">确认</div>
+          <div class="cancel-btn" @click="handleCancel">组织架构</div>
+          <div class="confirm-btn">个人信息</div>
         </div>
       </div>
     </van-overlay>
@@ -136,20 +141,19 @@
 </template>
 
 <script setup lang="ts">
-import {reactive, ref, watch} from "vue";
 import profile from "@/assets/images/tempImage/用户.png";
+import adressImage from "@/assets/images/tempImage/weizhi.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 { ElTree } from "element-plus";
-import {showConfirmDialog, showFailToast, showToast} from "vant";
-import {create_by_dept_ids} from "@/api/onlineRollCall";
+import { ElTree, ElCheckboxGroup, ElCheckbox } from "element-plus";
+import { showConfirmDialog, showFailToast, showToast } from "vant";
 
 const router = useRouter();
 const keywords = ref("");
 let responsibility_type = ref([]);
-const fieldValue = ref("");
+const fieldValue = ref("三防指挥部");
 const showPicker = ref(false);
 const onConfirm = ({ selectedValues, selectedOptions }) => {
   showPicker.value = false; //用于控制 van-picker 组件的显示状态,将其设置为 false 表示隐藏选择器。
@@ -210,7 +214,7 @@ const onLoad = () => {
           position: "茂名市委员会 茂名市委常委",
           type: ["重点部门"],
           profile_picture: profile,
-          state: true
+          state: false
         },
         {
           id: 5,
@@ -309,26 +313,36 @@ let keyword = ref("");
 let treeData = ref([
   {
     id: 1,
-    deptType: true,
     label: "茂南区",
     personSum: 34643,
+    isShowSelect: false,
     children: [
       {
         id: 2,
-        deptType: true,
         label: "茂南区政府",
         personSum: 343,
+        isShowSelect: false,
+        parentLabel: "茂南区",
         children: [
           {
             id: 3,
-            deptType: true,
-            label: "茂南区应急管理局",
+            label: "应急管理局",
             personSum: 5687,
+            isShowSelect: false,
+            parentLabel: "茂南区政府",
             children: [
               {
-                id: 3,
-                deptType: true,
-                label: "茂南区应急管理局",
+                id: 4,
+                label: "应急管理局2",
+                isShowSelect: true,
+                parentLabel: "应急管理局",
+                personSum: 5687
+              },
+              {
+                id: 30,
+                label: "茂南区应急管理局3",
+                isShowSelect: true,
+                parentLabel: "茂南区应急管理局",
                 personSum: 5687
               }
             ]
@@ -338,27 +352,31 @@ let treeData = ref([
     ]
   },
   {
-    id: 1,
+    id: 5,
     deptType: true,
     label: "茂南区",
     personSum: 34643,
+    isShowSelect: false,
     children: [
       {
-        id: 2,
+        id: 6,
         deptType: true,
         label: "茂南区政府",
         personSum: 343,
+        isShowSelect: false,
         children: [
           {
-            id: 3,
+            id: 7,
             deptType: true,
             label: "茂南区应急管理局",
             personSum: 5687,
+            isShowSelect: false,
             children: [
               {
-                id: 3,
+                id: 8,
                 deptType: true,
                 label: "茂南区应急管理局",
+                isShowSelect: true,
                 personSum: 5687
               }
             ]
@@ -368,27 +386,31 @@ let treeData = ref([
     ]
   },
   {
-    id: 1,
+    id: 9,
     deptType: true,
     label: "茂南区",
     personSum: 34643,
+    isShowSelect: false,
     children: [
       {
-        id: 2,
+        id: 10,
         deptType: true,
         label: "茂南区政府",
         personSum: 343,
+        isShowSelect: false,
         children: [
           {
-            id: 3,
+            id: 11,
             deptType: true,
             label: "茂南区应急管理局",
             personSum: 5687,
+            isShowSelect: false,
             children: [
               {
-                id: 3,
+                id: 12,
                 deptType: true,
                 label: "茂南区应急管理局",
+                isShowSelect: true,
                 personSum: 5687
               }
             ]
@@ -398,27 +420,31 @@ let treeData = ref([
     ]
   },
   {
-    id: 1,
+    id: 13,
     deptType: true,
     label: "茂南区",
     personSum: 34643,
+    isShowSelect: false,
     children: [
       {
-        id: 2,
+        id: 14,
         deptType: true,
         label: "茂南区政府",
         personSum: 343,
+        isShowSelect: false,
         children: [
           {
-            id: 3,
+            id: 15,
             deptType: true,
             label: "茂南区应急管理局",
             personSum: 5687,
+            isShowSelect: false,
             children: [
               {
-                id: 3,
+                id: 16,
                 deptType: true,
                 label: "茂南区应急管理局",
+                isShowSelect: true,
                 personSum: 5687
               }
             ]
@@ -428,27 +454,31 @@ let treeData = ref([
     ]
   },
   {
-    id: 1,
+    id: 17,
     deptType: true,
     label: "茂南区",
     personSum: 34643,
+    isShowSelect: false,
     children: [
       {
-        id: 2,
+        id: 18,
         deptType: true,
         label: "茂南区政府",
         personSum: 343,
+        isShowSelect: false,
         children: [
           {
-            id: 3,
+            id: 19,
             deptType: true,
             label: "茂南区应急管理局",
             personSum: 5687,
+            isShowSelect: false,
             children: [
               {
-                id: 3,
+                id: 20,
                 deptType: true,
                 label: "茂南区应急管理局",
+                isShowSelect: true,
                 personSum: 5687
               }
             ]
@@ -458,27 +488,31 @@ let treeData = ref([
     ]
   },
   {
-    id: 1,
+    id: 21,
     deptType: true,
     label: "茂南区",
     personSum: 34643,
+    isShowSelect: false,
     children: [
       {
-        id: 2,
+        id: 22,
         deptType: true,
         label: "茂南区政府",
         personSum: 343,
+        isShowSelect: false,
         children: [
           {
-            id: 3,
+            id: 23,
             deptType: true,
             label: "茂南区应急管理局",
             personSum: 5687,
+            isShowSelect: false,
             children: [
               {
-                id: 3,
+                id: 24,
                 deptType: true,
                 label: "茂南区应急管理局",
+                isShowSelect: true,
                 personSum: 5687
               }
             ]
@@ -488,27 +522,31 @@ let treeData = ref([
     ]
   },
   {
-    id: 1,
+    id: 25,
     deptType: true,
     label: "茂南区",
     personSum: 34643,
+    isShowSelect: false,
     children: [
       {
-        id: 2,
+        id: 26,
         deptType: true,
         label: "茂南区政府",
         personSum: 343,
+        isShowSelect: false,
         children: [
           {
-            id: 3,
+            id: 27,
             deptType: true,
             label: "茂南区应急管理局",
             personSum: 5687,
+            isShowSelect: false,
             children: [
               {
-                id: 3,
+                id: 28,
                 deptType: true,
                 label: "茂南区应急管理局",
+                isShowSelect: true,
                 personSum: 5687
               }
             ]
@@ -529,28 +567,8 @@ const onSearchCancel = () => {};
 const handleCancel = () => {
   isShowStructure.value = false;
 };
-const adressContent = ref("");
-const handleConfirm = () => {
-  if (checkData.value.length > 0) {
-    showConfirmDialog({
-      title: '提示',
-      message: '确认选择?'
-    })
-        .then(() => {
-          // create_by_dept_ids({depts: checkData.value, remark:''}).then((res) => {
-          //   showToast({type: 'success', message: res.msg, onClose:()=>{
-          //       router.push({ name : 'RollCallDetails', query: { id: res.data }})
-          //     }});
-          // })
-          adressContent.value = checkData.value;
-          isShowStructure.value = false;
-    });
-    // router.push({ name : 'RollCallDetails', query: { id: 'test' }})
-  } else {
-    showFailToast('请先选择点名单位')
-  }
-}
-
+const adressContent = ref();
+const upOneLevel = ref();
 let defaultProps = reactive({
   children: "children",
   label: "label",
@@ -560,16 +578,11 @@ const filterNode = (value, data) => {
   if (!value) return true;
   return data.label.indexOf(value) !== -1;
 };
-watch(keyword, (val) => {
-  treeRef.value!.filter(val);
-});
-const handleCheckChange = () => {
-  const data = [];
-  const treeData = treeRef.value.getCheckedNodes(false, false);
-  treeData.forEach((item) => {
-    data.push(item.id);
-  });
-  checkData.value = data;
+let selectedTreeId = ref([]);
+const handleCheckChange = data => {
+    adressContent.value = data.label;
+    upOneLevel.value = data.parentLabel;
+    isShowStructure.value = false;
 };
 </script>
 
@@ -577,6 +590,7 @@ const handleCheckChange = () => {
 .select-box {
   display: flex;
   flex-direction: row;
+  justify-content: space-between;
   margin-top: -2px;
   background: #fff;
 }
@@ -637,13 +651,15 @@ const handleCheckChange = () => {
   margin-top: 15px;
   align-items: center;
 }
-.isOnline {
+.notOnline {
   font-size: 12px;
   background-color: #b3b3b3;
   padding: 0px 10px;
   height: 15px;
+  padding-bottom: 18px;
+  border-radius: 4px;
 }
-.notOnline {
+.isOnline {
   background-color: limegreen;
 }
 .wrapper {
@@ -700,15 +716,16 @@ const handleCheckChange = () => {
 .structure-head {
   display: flex;
   background-color: #ffffff;
-  padding-left: 10px;
+  padding-left: 20px;
   padding-bottom: 5px;
   align-items: center;
 }
 .blue-rectangle {
   width: 6px;
-  height: 17px;
+  height: 20px;
   background-image: linear-gradient(180deg, #00fce7 0%, #2c81ff 100%);
   border-radius: 0 3px 0 0;
+  margin-left: -10px;
 }
 .head-card {
   display: flex;
@@ -755,7 +772,16 @@ const handleCheckChange = () => {
 .custom-tree-node {
   display: flex;
   width: 100%;
-  justify-content: space-between;
   margin-right: 12px;
 }
+.addressImage {
+  height: 15px;
+}
+.adress-box {
+  display: flex;
+  flex-direction: row;
+  padding-top: 10px;
+  width: 50%;
+  margin-left: 20px;
+}
 </style>