Преглед изворни кода

Merge remote-tracking branch 'origin/dev' into dev

hmm пре 10 месеци
родитељ
комит
abeb292cc2

+ 120 - 111
src/views/emergencyCommandMap/RightSection/RenWuDengJi.vue

@@ -1,45 +1,42 @@
 <template>
-  <div v-if="showRegisterDialog" class="dialog">
+  <Dialog v-model="showRegisterDialog" type="md" title="任务登记" hide-footer>
     <div class="dialog-content">
-      <div class="dialog-header">
-        <span>任务登记</span>
-        <button @click="closeDialog">×</button>
-      </div>
-
       <div class="dialog-body">
-        <div class="form-group">
-          <label>任务内容:</label>
-          <!--          <textarea v-model="newTask.description" placeholder="请输入相关任务描述"></textarea>-->
-          <el-input
-            v-model="newTask.task_description"
-            style="font-size: 36px; width: 100%"
-            :rows="1"
-            type="textarea"
-            placeholder="请输入相关任务描述"
-          />
-        </div>
-        <div class="form-group">
-          <label>执行单位:</label>
-          <!--          <select v-model="newTask.unit">
-            <option disabled value="">请选择执行单位</option>
-            <option v-for="unit in units" :key="unit.value" :value="unit.value">{{ unit.label }}</option>
-          </select>-->
-          <el-select v-model="newTask.unit_name" placeholder="请选择执行单位" class="custom-el-select" style="width: 100%">
-            <el-option v-for="unit in units" :key="unit.value" :label="unit.label" :value="unit.value" />
-          </el-select>
-        </div>
-        <div class="form-group">
-          <label>登记人:</label>
-          <input v-model="newTask.registrar" type="text" readonly />
-        </div>
+        <el-form ref="taskFormRef" :model="newTask">
+          <el-form-item label="任务内容" label-width="200px">
+            <el-input
+              v-model="newTask.task_description"
+              class="custom-input2"
+              clearable
+              placeholder="请输入相关任务描述"
+            />
+          </el-form-item>
+          <el-form-item label="执行单位" label-width="200px">
+            <el-select
+              v-model="newTask.unit_name"
+              placeholder="全部"
+              class="custom-select"
+              size="large"
+              popper-class="custom-select-popper"
+              :teleported="false"
+              clearable
+            >
+              <el-option v-for="unit in units" :key="unit.value" :label="unit.label" :value="unit.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="登记人" label-width="200px">
+            <el-input v-model="newTask.registrar" class="custom-input2" type="text" readonly />
+          </el-form-item>
+        </el-form>
       </div>
-
       <div class="dialog-footer">
-        <button @click="confirmRegister">确定</button>
-        <button @click="closeDialog">取消</button>
+        <div class="flex">
+          <div class="common-btn-primary" @click="confirmRegister" style="margin-top: -32px">确定</div>
+          <div class="common-btn" @click="closeDialog">取消</div>
+        </div>
       </div>
     </div>
-  </div>
+  </Dialog>
 </template>
 
 <script lang="ts" setup>
@@ -50,7 +47,7 @@ const showRegisterDialog = ref(true);
 const newTask = reactive({
   task_description: '',
   unit_name: '',
-  registrar: '当前用户' // 这里应该是从全局状态或API获取的当前用户
+  registrar: '当前用户'
 });
 const units = ref([]);
 
@@ -58,12 +55,11 @@ const props = defineProps<{
   eventId?: string;
 }>();
 
-// 获取单位数据
 const fetchUnits = async () => {
   try {
     const response = await getUnits();
     if (response.code === 200) {
-      units.value = response.data; // 假设返回的数据是数组 [{ label: '单位A', value: 'unitA' }, ...]
+      units.value = response.data;
     } else {
       console.error('获取单位数据失败:', response.msg);
     }
@@ -72,15 +68,12 @@ const fetchUnits = async () => {
   }
 };
 
-// 定义事件发射器
 const emit = defineEmits(['update:show']);
 
-// 对话框关闭时执行的操作
 const closeDialog = () => {
   emit('update:show', false);
 };
 
-// 确认登记任务
 const confirmRegister = async () => {
   try {
     newTask.event_code = props.eventId;
@@ -96,90 +89,106 @@ const confirmRegister = async () => {
   }
 };
 
-// 在组件挂载时获取单位数据
 onMounted(() => {
   fetchUnits();
 });
-
-// 监听 eventId 的变化
-watch(
-  () => props.eventId,
-  () => {
-    if (!!props.eventId) {
-      console.log('Received eventId in RenWuDengJi3333:', props.eventId);
-    }
-  }
-);
 </script>
 
 <style lang="scss" scoped>
-.dialog {
+.dialog-wrap {
   position: fixed;
-  top: 50%;
-  left: 50%;
-  transform: translate(-50%, -50%);
-  background-color: white;
-  border-radius: 8px;
-  box-shadow: 0 50px 50px rgba(0, 0, 0, 0.1);
-  width: 1500px;
-}
-
-.dialog-header {
+  top: 0;
+  right: 0;
+  left: 0;
+  bottom: 0;
+  z-index: 2000;
+  width: 100%;
+  height: 100%;
   display: flex;
-  justify-content: space-between;
   align-items: center;
-  border-bottom: 1px solid #eee;
-  padding: 10px;
-}
-
-.dialog-body {
-  padding: 10px;
+  justify-content: center;
+  .overlay {
+    background-color: rgba(0, 0, 0, 0.5);
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: -1;
+    cursor: pointer;
+  }
+  .dialog {
+    width: 5000px;
+    height: 2000px;
+    margin: 0 auto;
+    background-color: #fff;
+    border-radius: 20px;
+  }
 }
-
-.form-group {
-  margin-bottom: 15px;
+.dialog {
+  padding: 0 50px;
+  .dialog-header {
+    width: 100%;
+    height: 150px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .icon-close {
+      cursor: pointer;
+    }
+  }
 }
-
-.dialog-footer {
+.footer {
+  height: 64px;
   display: flex;
   justify-content: flex-end;
-  padding: 10px;
-}
-
-button {
-  margin-left: 10px;
-  padding: 5px 15px;
-  border: none;
-  background-color: #3498db;
-  color: white;
-  border-radius: 4px;
-  cursor: pointer;
-  font-size: 36px;
-}
-
-button:hover {
-  background-color: #2980b9;
-}
-
-textarea,
-select,
-input[type='text'] {
-  width: 100%;
-  box-sizing: border-box;
-  padding: 5px;
-  margin-top: 5px;
-  border-radius: 4px;
-  border: 1px solid #ccc;
-  font-size: 36px;
-}
-.custom-el-select {
-  :deep(.el-select__wrapper) {
-    height: 60px; // 根据你的字体大小适配高度
-    line-height: 60px; // 保持与高度一致
-    font-size: 36px;
+  margin-bottom: 30px;
+  .pagination-container {
+    height: 64px;
+    margin: 0;
   }
-  :deep(.el-select__placeholder) {
-    font-size: 36px;
+  :deep(.el-pagination__total) {
+    color: #a7ccdf;
+    font-size: 32px;
   }
+  :deep(.el-pagination) {
+    .btn-next,
+    .btn-prev {
+      background-color: transparent;
+      border: none;
+      .el-icon {
+        font-size: 22px;
+        color: #a7ccdf;
+      }
+    }
+    .btn-prev:disabled,
+    .btn-next:disabled {
+      background-color: transparent;
+      border: none;
+    }
+    .el-pager li {
+      width: 64px;
+      height: 64px;
+      line-height: 64px;
+      text-align: center;
+      font-size: 32px;
+      color: #a7ccdf;
+      background-color: #0e3064;
+      border: 1px solid #0c57a7;
+      margin: 0 6px;
+      &:hover {
+        background-color: #038dff;
+        border: 1px solid #038dff;
+      }
+    }
+    .el-pager li.is-active {
+      background-color: #038dff;
+      border: 1px solid #038dff;
+    }
+  }
+}
+.flex {
+  display: flex;
+  align-items: flex-start;
 }
 </style>

+ 0 - 1
src/views/emergencyCommandMap/RightSection/RenWuGenZong.vue

@@ -22,7 +22,6 @@
     :task="selectedTask"
     :event-id="eventId"
     title="任务进度更新"
-    width="70%"
     @update-success="handleUpdateSuccess"
   />
 

+ 35 - 29
src/views/emergencyCommandMap/RightSection/RenWuGengXin.vue

@@ -1,33 +1,35 @@
 <template>
-  <Dialog v-model="visible" type="xl" title="任务进度更新" hide-footer>
-    <div class="dialog-body">
-      <el-form ref="taskForm" :model="newTask">
-        <el-row :gutter="20">
-          <el-col :span="24">
-            <el-form-item label="任务描述">
-              <el-input v-model="newTask.task_description" readonly />
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="执行单位">
-              <el-input v-model="newTask.unit_name" readonly />
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="完成进度">
-              <el-select v-model="newTask.registrar">
-                <el-option v-for="unit in units" :key="unit" :label="unit" :value="unit"></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-    </div>
+  <Dialog v-model="visible" type="sm" title="任务进度更新" height="auto" hide-footer>
+    <div class="dialog-content">
+      <div class="dialog-body">
+        <el-form ref="taskForm" :model="newTask">
+          <el-row :gutter="20">
+            <el-col :span="24">
+              <el-form-item label="任务描述">
+                <el-input v-model="newTask.task_description" class="custom-input2" readonly />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="执行单位">
+                <el-input v-model="newTask.unit_name" class="custom-input2" readonly />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="完成进度">
+                <el-select v-model="newTask.registrar" class="custom-select" size="large" popper-class="custom-select-popper">
+                  <el-option v-for="unit in units" :key="unit" :label="unit" :value="unit"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
 
-    <div class="footer">
-      <div class="flex">
-        <div class="common-btn-primary" :disabled="!isFormValid" @click="confirmRegister">确定</div>
-        <div class="common-btn" @click="closeDialog">取消</div>
+      <div class="footer">
+        <div class="flex">
+          <div class="common-btn-primary" :disabled="!isFormValid" @click="confirmRegister">确定</div>
+          <div class="common-btn" @click="closeDialog">取消</div>
+        </div>
       </div>
     </div>
   </Dialog>
@@ -45,7 +47,7 @@ const props = defineProps({
 
 const emit = defineEmits(['update:modelValue', 'update-success']);
 const newTask = reactive({ ...props.task });
-const units = ref(['处理', '已完成']);
+const units = ref(['处理', '已完成']);
 
 const visible = computed({
   get: () => props.modelValue,
@@ -94,6 +96,10 @@ watch(
 </script>
 
 <style lang="scss" scoped>
+.custom-select {
+  width: 500px !important; // 使用 !important 强制覆盖默认样式
+}
+
 .dialog-body {
   padding: 20px;
 }

+ 14 - 24
src/views/emergencyCommandMap/RightSection/TaskDelivery.vue

@@ -1,10 +1,7 @@
 <template>
-  <!-- 主对话框 -->
   <el-dialog ref="formDialogRef" v-model="props.modelValue" :title="props.title" width="900px" @close="closeDialog">
-    <!-- 子对话框 -->
-    <el-dialog v-model="dialogVisible" title="预任务任务下发" width="70%" :append-to-body="true" @close="handleClose">
-      <div v-if="dialogVisible" class="task-list">
-        <!-- 加载提示 -->
+    <transition name="fade">
+      <div v-if="dialogVisible" class="mb-[20px]">
         <el-skeleton :loading="loading" animated>
           <template #template>
             <div v-for="n in 3" :key="n" class="task-item">
@@ -13,7 +10,6 @@
             </div>
           </template>
           <template #default>
-            <!-- 使用 v-for 循环遍历任务列表 -->
             <div v-for="(task, index) in tasks" :key="index" class="task-item">
               <p class="unit-name">{{ task.dept_name }}</p>
               <p class="task-description">{{ task.content }}</p>
@@ -21,14 +17,13 @@
           </template>
         </el-skeleton>
       </div>
-      <!-- 对话框底部按钮区域 -->
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="sendTasks">确认发送H5短信</el-button>
-        </div>
-      </template>
-    </el-dialog>
+    </transition>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="sendTasks">确认发送H5短信</el-button>
+      </div>
+    </template>
   </el-dialog>
 </template>
 
@@ -131,37 +126,32 @@ const sendTasks = () => {
 </script>
 
 <style scoped>
-/* 任务列表容器样式 */
 .task-list {
   padding: 20px;
 }
 
-/* 单个任务项样式 */
 .task-item {
   display: block;
   padding: 10px;
   margin-bottom: 10px;
-  background-color: #f9f9f9; /* 浅色背景 */
+  background-color: #f9f9f9;
   border: 1px solid #ddd;
   border-radius: 4px;
 }
 
-/* 任务单位名称样式 */
 .unit-name {
   font-weight: bold;
   margin-bottom: 5px;
-  word-break: break-all; /* 允许在单词中间换行 */
+  word-break: break-all;
 }
 
-/* 任务描述样式 */
 .task-description {
-  word-break: break-all; /* 允许在单词中间换行 */
-  white-space: pre-wrap; /* 保留空格和换行符 */
+  word-break: break-all;
+  white-space: pre-wrap;
 }
 
-/* 对话框底部按钮区域样式 */
 .dialog-footer {
   display: flex;
-  justify-content: flex-end; /* 按钮靠右对齐 */
+  justify-content: flex-end;
 }
 </style>

+ 5 - 5
src/views/globalMap/RightMenu/DrawTools.vue

@@ -4,7 +4,7 @@
       <div class="item-label">画笔选择</div>
       <i class="color-box" :style="{ backgroundColor: colorList[drawerColorIndex]?.value }" />
       <!--弹窗选择器-->
-      <div v-show="showColorSelect" ref="selectBoxRef" class="select-box" style="top: -149px; padding-bottom: 20px">
+      <div v-show="showColorSelect" ref="selectBoxRef" class="select-box" style="top: -242px; padding-bottom: 20px">
         <div class="box-content">
           <div
             v-for="(item, index) in colorList"
@@ -21,7 +21,7 @@
     <div class="draw-item" @mouseover="showDrawTypeSelect = true" @mouseleave="showDrawTypeSelect = false">
       <div class="item-label">框面类型</div>
       <!--弹窗选择器-->
-      <div v-show="showDrawTypeSelect" ref="selectBoxRef2" class="select-box" style="top: -82px; padding-bottom: 20px">
+      <div v-show="showDrawTypeSelect" ref="selectBoxRef2" class="select-box" style="top: -127px; padding-bottom: 20px">
         <div class="box-content">
           <div
             v-for="(item, index) in drawTypeList"
@@ -37,7 +37,7 @@
     <div class="draw-item" @mouseover="showGraphicsTypeSelect = true" @mouseleave="showGraphicsTypeSelect = false">
       <div class="item-label">图像类型</div>
       <!--弹窗选择器-151-->
-      <div v-show="showGraphicsTypeSelect" ref="selectBoxRef2" class="select-box" style="top: -115.5px; padding-bottom: 20px">
+      <div v-show="showGraphicsTypeSelect" ref="selectBoxRef2" class="select-box" style="top: -184.5px; padding-bottom: 20px">
         <div class="box-content">
           <div
             v-for="(item, index) in graphicsTypeList"
@@ -345,8 +345,8 @@ const analysisSpatial = (data) => {
 <style lang="scss" scoped>
 .draw-tools-container {
   position: absolute;
-  left: -2400px;
-  bottom: -530px;
+  right: 255px;
+  bottom: 390px;
   background-color: #304468;
   border-radius: 5px;
   display: flex;

+ 13 - 7
src/views/globalMap/RightMenu/SpatialAnalysis.vue

@@ -30,15 +30,16 @@
       </div>
     </div>
   </div>
-  <DrawTools @handleAnalysisData="handleAnalysisData" />
 </template>
 
 <script lang="ts" setup name="AnalyzeDataDialog">
-import DrawTools from './DrawTools.vue';
 import { validateNum } from '@/utils/ruoyi';
 import { getSpatialAnalysis } from '@/api/globalMap';
 import { deepClone } from '@/utils';
 
+const props = defineProps({
+  updateLocation: []
+});
 const emits = defineEmits(['handleMenu']);
 const keyword = ref('');
 let analysisData = ref({
@@ -77,6 +78,16 @@ const filteredSubItems = (parentItem) => {
   });
 };
 const location = ref([]);
+watch(
+  () => props.updateLocation,
+  () => {
+    location.value = props.updateLocation;
+  },
+  {
+    immediate: true,
+    deep: true
+  }
+);
 watch(
   () => location,
   () => {
@@ -98,11 +109,6 @@ watch(
     deep: true
   }
 );
-
-const handleAnalysisData = (data) => {
-  location.value = data;
-  emits('handleMenu', '空间分析');
-};
 </script>
 
 <style lang="scss" scoped>

+ 14 - 6
src/views/globalMap/RightMenu/index.vue

@@ -23,7 +23,7 @@
         <!--图层分析-->
         <LayerAnalysis v-if="menuState.showMenu && menuState.menuData[menuState.activeIndex]?.name === '图层分析'" :point-type="pointType" />
         <!--空间分析-->
-        <SpatialAnalysis v-if="menuState.showMenu && menuState.menuData[menuState.activeIndex]?.name === '空间分析'" @handle-menu="handleMenu" />
+        <SpatialAnalysis v-if="menuState.showMenu && menuState.menuData[menuState.activeIndex]?.name === '空间分析'" :updateLocation="location" @handle-menu="handleMenu" />
         <!--江湖河库-->
         <Reservoir v-if="menuState.showMenu && menuState.menuData[menuState.activeIndex]?.name === '江湖河库'" />
         <!--路网视频-->
@@ -109,13 +109,19 @@ const clickMenu = (index) => {
   menuState.showMenu = true;
   menuState.activeIndex = index;
 };
-
+let location = ref([]);
 // 显示菜单
-const handleMenu = (name) => {
+const handleMenu = (name, data) => {
   let index = menuState.menuData.findIndex((item) => {
     return item.name === name;
   });
-  if (index > -1) {
+  if (name === '空间分析') {
+    menuState.showMenu = true;
+    menuState.activeIndex = index;
+    nextTick(() => {
+      location.value = data;
+    });
+  } else if (index > -1) {
     clickMenu(index);
   }
 };
@@ -142,8 +148,10 @@ const updateMenu = (type, menu) => {
     }
   }
 };
-
-defineExpose({ handleMenu, clickContractMenu, updateMenu });
+const getMenuState = () => {
+  return menuState;
+};
+defineExpose({ handleMenu, clickContractMenu, updateMenu, getMenuState });
 </script>
 
 <style lang="scss" scoped>

+ 5 - 2
src/views/globalMap/index.vue

@@ -13,6 +13,7 @@
       <SwitchMapTool :active-map="activeMap" class="tool-box" @switch-map="switchMap" />
       <!--时间轴-->
       <TimeAxis />
+      <DrawTools v-if="showDrawTools" @handleAnalysisData="handleAnalysisData" />
       <NearbyVideos v-if="showNearbyVideos" v-model="showNearbyVideos" :location="location" />
     </div>
   </div>
@@ -30,6 +31,7 @@ import { deepClone } from '@/utils';
 import { getPointInfo } from '@/api/globalMap';
 import RightMenu from './RightMenu/index.vue';
 import { PointType } from '@/api/globalMap/type';
+import DrawTools from '@/views/globalMap/RightMenu/DrawTools.vue';
 
 const rightMenuRef = ref(null);
 const mapData = reactive(logicalData);
@@ -41,7 +43,6 @@ let activeMap = ref('logical');
 const switchMap = (key) => {
   activeMap.value = key;
 };
-
 let pointType = ref<PointType[]>([]);
 let markerList = ref([]);
 const addMarkers = (item) => {
@@ -142,7 +143,9 @@ const selectSearchMarker = (item) => {
   }
   dom.addSearchMarker(item2);
 };
-
+const handleAnalysisData = (data) => {
+  rightMenuRef.value.handleMenu('空间分析', data);
+};
 // 获取地图元素操作
 const getMap = () => {
   if (['satellite2', 'satellite3'].includes(activeMap.value)) {