Ver código fonte

代码提交

cxs 2 semanas atrás
pai
commit
3b34836cbf

+ 92 - 86
src/views/alarm/gis/index.vue

@@ -16,7 +16,7 @@
                   <el-icon class="el-input__icon"><search /></el-icon>
                 </template>
           </el-select>
-        </el-form-item> 
+        </el-form-item>
 
         <el-form-item label="所属基地:" prop="base">
           <el-select v-model="searchParam.base" placeholder="请选择" style="width: 200px">
@@ -27,15 +27,15 @@
         <el-form-item><div class="lv-state">设备正常3</div></el-form-item>
         <el-form-item><div class="hong-state">设备故障2</div></el-form-item>
         <el-form-item><div class="cheng-state">危险天气1{{ info.one }}</div></el-form-item> <!-- 操作1     -->
-        
+
         <!-- 基本信息 -->
         <el-form-item>
-          <el-popover 
-            v-model="visible" 
+          <el-popover
+            v-model="visible"
             @show="handleShowChange"
-            @hide="handleHideChange" 
-            placement="bottom" 
-            :width="200" 
+            @hide="handleHideChange"
+            placement="bottom"
+            :width="200"
             trigger="click">
             <el-checkbox-group v-model="checkList">
               <!--鹰眼  -->
@@ -54,7 +54,7 @@
                   size="large"
                   v-model="showNineGrid"
                     inline-prompt
-                    active-text="开九宫格"    
+                    active-text="开九宫格"
                     inactive-text="关九宫格"
                 />
               </el-form-item>
@@ -97,7 +97,7 @@
                     active-text="街道地图"
                     inactive-text="关闭"
                 />
-              </el-form-item>             
+              </el-form-item>
             </el-checkbox-group>
             <template #reference>
               <div :class="visible ? 'hei-state-primary' : 'hei-state'">基本功能</div>
@@ -105,7 +105,7 @@
           </el-popover>
         </el-form-item>
 
-      </el-form>      
+      </el-form>
       <!-- 右侧功能栏 -->
       <div class="header-button-ri">
         <el-popover
@@ -129,7 +129,7 @@
                 <template v-for="item in elementList" :key="item.id"  >
                   <div v-if="item.data_type==='温湿度'"  :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
                 </template>
-              </div>  
+              </div>
             </el-tab-pane>
 
             <!-- 气压 -->
@@ -144,7 +144,7 @@
                 <template v-for="item in elementList" :key="item.id"  >
                   <div v-if="item.data_type==='气压'"  :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
                 </template>
-              </div>  
+              </div>
             </el-tab-pane>
 
             <!-- 湿度 -->
@@ -159,9 +159,9 @@
                 <template v-for="item in elementList" :key="item.id"  >
                   <div v-if="item.data_type==='温湿度'"  :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
                 </template>
-              </div>  
+              </div>
             </el-tab-pane>
-           
+
             <!-- 风 -->
             <el-tab-pane>
               <template #label>
@@ -177,19 +177,19 @@
               </div>
             </el-tab-pane>
 
-            <!-- 降雨 -->   
+            <!-- 降雨 -->
             <el-tab-pane>
               <template #label>
                 <div class="gis-c">
                   <span>降雨</span>
                   <img class="gis-icon" src="../../../assets/images/rainfall.svg">
                 </div>
-              </template>              
+              </template>
               <div class="container-tag" style="overflow-y:auto; height:300px ">
                 <template v-for="item in elementList" :key="item.id"  >
                   <div v-if="item.data_type==='降水'"  :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
                 </template>
-              </div>             
+              </div>
 
             </el-tab-pane>
 
@@ -206,7 +206,7 @@
                 <template v-for="item in elementList" :key="item.id"  >
                   <div v-if="item.data_type==='云'"  :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
                 </template>
-              </div>  
+              </div>
             </el-tab-pane>
 
             <!-- 能见度 -->
@@ -221,7 +221,7 @@
                 <template v-for="item in elementList" :key="item.id"  >
                   <div v-if="item.data_type==='能见度'"  :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
                 </template>
-              </div>  
+              </div>
             </el-tab-pane>
 
             <!-- 天气现象 -->
@@ -236,7 +236,7 @@
                 <template v-for="item in elementList" :key="item.id"  >
                   <div v-if="item.data_type==='天气现象'"  :class="item.isSelected?'item-tag-active':'item-tag'" @click="toggleSelection(item)" >{{item.data_name}}</div>
                 </template>
-              </div>  
+              </div>
             </el-tab-pane>
           </el-tabs>
           <template #reference>
@@ -248,8 +248,8 @@
           </template>
         </el-popover>
       </div>
-    </div>  
-    
+    </div>
+
     <!-- 地图与经纬度显示区域 -->
     <div id="map" class="map" style="width: 100%; height: 100vh;">
       <!-- 九宫格盒子 -->
@@ -258,13 +258,13 @@
           {{ value }}
         </div>
       </div>
-      
-    </div> 
+
+    </div>
     <!-- 右下角经纬度显示 -->
-    <div id="mouse-position" class="mouse-position">经纬度: </div>    
+    <div id="mouse-position" class="mouse-position">经纬度: </div>
 
     <!-- 地图底部控制栏 -->
-    <div class="gis-bottom-box">  
+    <div class="gis-bottom-box">
       <div class="gis-bottom-item">
         <div class="button-bg" @click="isPlay=!isPlay">
           <img v-if="isPlay" class="button-bg-c" style="margin-left: 3px"  src="../../../assets/images/stop.svg"/>
@@ -292,38 +292,39 @@
 
       <!-- 动态绑定事件间隔 timeInterval -->
       <div class="gis-bottom-item">
-        <el-slider          
+        <el-slider
+          @change="chageSlider"
           :min="0"
           :max="1439"
           :format-tooltip="formatTooltip"
-          v-model="value2"            
+          v-model="value2"
           style="width: 720px;margin: 0px 0px 0px 10px" />
-        <img src="../../../assets/images/scale.svg" style="width: 720px;margin-top: -10px"/>        
+        <img src="../../../assets/images/scale.svg" style="width: 720px;margin-top: -10px"/>
       </div>
-     
+
       <div class="gis-bottom-item">
         <div class="button-bg" @click="handleForward">
           <img class="button-bg-c"  src="../../../assets/images/forward.svg"/>
-        </div> 
+        </div>
         <div style="margin-left: 2px" class="gis-bottom-text">下一个</div>
       </div>
-      
-      
+
+
       <!-- 添加事件下拉框 -->
-      <div class="gis-bottom-item">                
+      <div class="gis-bottom-item">
         <el-select v-model="timeInterval" placeholder="选择时间间隔" style="width: 150px;">
           <el-option label="5秒间隔" :value="5000"></el-option>
           <el-option label="2分钟间隔" :value="120000"></el-option>
           <el-option label="5分钟间隔" :value="300000"></el-option>
           <el-option label="10分钟间隔" :value="600000"></el-option>
-          <el-option label="60分钟间隔" :value="3600000"></el-option>          
-        </el-select>         
+          <el-option label="60分钟间隔" :value="3600000"></el-option>
+        </el-select>
       </div>
 
       <div class="gis-bottom-item">
         <div class="gis-bottom-hei-state">当前时间 {{formatTooltip(value2)}}</div>
       </div>
-    </div> 
+    </div>
 
   </div>
 </template>
@@ -358,7 +359,7 @@
   import { METERS_PER_UNIT } from 'ol/proj/Units';
   import { labelZoomSize, colorRGBtoHex } from "@/assets/map/maptool";
   import { Draw } from 'ol/interaction';
-  
+
 
 
 
@@ -377,7 +378,7 @@ const timeInterval = ref(5000); // 默认毫秒时间间隔
 
 // 获取当前时间分钟数(以一天的分钟为单位)
 const now = new Date();
-const currentMinutes = now.getHours() * 60 + now.getMinutes(); 
+const currentMinutes = now.getHours() * 60 + now.getMinutes();
 const currentDate = ref(new Date()); // 创建一个响应式变量 currentDate,初始化为当前日期
 const updateTime = () =>{
   const fullYear = currentDate.value.getFullYear(); // 获取当前年份
@@ -400,13 +401,13 @@ const handleIntervalChange = (newInterval: number) => {
 
 
   const showNineGrid = ref(false); // 控制九宫格显示与否
-  const dataValues = ref(Array(9).fill(0)); // 替换为实际的数据 
+  const dataValues = ref(Array(9).fill(0)); // 替换为实际的数据
   const currentStationIndex = ref(0); // 选择的站点索引
-  
+
 
   // 存储站点的经纬度和数据值
   const stations = ref([
-    { lat: 34.638163632, lon: 116.426066261, value: 10 }, 
+    { lat: 34.638163632, lon: 116.426066261, value: 10 },
     { lat: 34.638263632, lon: 116.426166261, value: 20 },
     { lat: 34.638363632, lon: 116.426266261, value: 30 },
     // 继续添加其他站点
@@ -464,11 +465,11 @@ const handleIntervalChange = (newInterval: number) => {
   const checkList = ref(['Value selected and disabled', 'Value A']);
   const isPlay = ref(true);
   const isEagleEyeOn = ref(true); // 鹰眼开关状态
-  const isjGG = ref(false); // 九宫格开关状态 默认关闭  
-  const isboxDrawn = ref(false); // 框选开关状态 默认关闭  boxDrawn 
+  const isjGG = ref(false); // 九宫格开关状态 默认关闭
+  const isboxDrawn = ref(false); // 框选开关状态 默认关闭  boxDrawn
   const isstationName = ref(false); // 站名开关状态 默认关闭  isstationName
   const isstationCode = ref(true); // 站号开关状态 默认打开  isstationCode
-  const isstreet = ref(true); // 街道地图开关状态 默认关闭  
+  const isstreet = ref(true); // 街道地图开关状态 默认关闭
   const searchParam = reactive({ base: undefined, station: undefined });
   const baseOptions = ref([{ value: 0, label: '基地1' }, { value: 1, label: '基地2' }]);
   const stationOptions = ref([{ value: 0, label: 'M1986' }, { value: 1, label: 'M1987' }]);
@@ -478,9 +479,9 @@ const handleIntervalChange = (newInterval: number) => {
   // 监听站号开关变化
   watch(isstationCode,(newValue) =>{
     if(newValue){
-      // 打开站号 - 
+      // 打开站号 -
       showStationCodes(); // 显示站号
-      
+
     }else{
       hideStationCodes();// 关闭站号
     }
@@ -519,7 +520,7 @@ function showStationCodes() {
 }
 // 隐藏站号的函数
 function hideStationCodes() {
-  stationSource.clear(); // 清除所有站号 
+  stationSource.clear(); // 清除所有站号
 }
 
 
@@ -528,7 +529,7 @@ function hideStationCodes() {
   // 监听站名开关变化
   watch(isstationName,(newValue) =>{
     if(newValue){
-      showStationName();// 打开站号 
+      showStationName();// 打开站号
     }else{
       hideStationName()// 关闭站号
     }
@@ -581,14 +582,14 @@ function hideStationName() {
   const getPlatforms = async () => {
     try{
       const { data } = await getPlatformList(queryas.value);
-      platformList.value = data.list;    
-      console.log("platformList.value:",+ platformList.value); // 在控制台输出平台列表    
+      platformList.value = data.list;
+      console.log("platformList.value:",+ platformList.value); // 在控制台输出平台列表
 
       getStations(data.list);
       // console.log("打印data.list的数据:",+data.list)
     }catch(error){
       console.log("获取平台列表失败:",error)
-    }    
+    }
   };
 
   const pageable = ref<any>({
@@ -608,7 +609,7 @@ function hideStationName() {
       const { data } = await getDataItemList(pageable.value); // 假设此函数调用成功并返回数据
       processTableData.value = data.list || []; //保证processTableData不会为null
       getStations(platformList.value);  //更新getStation更新站点
-      
+
       return data.list; // 确保返回数据
     } catch (error) {
       console.error("获取数据时出错:", error);
@@ -616,17 +617,17 @@ function hideStationName() {
     }
   };
 
-  // 地图台站信息标注 
+  // 地图台站信息标注
   const getStations = (stations) => {
-    console.log(stations,'getstation2');  
-    
+    console.log(stations,'getstation2');
+
     stationSource.clear();  // 清除之前的站点标记
     stations.forEach(station => {
-      console.log(processTableData.value,'11');    
-    
+      console.log(processTableData.value,'11');
+
       if (station.as_lon && station.as_lat) {
       const result = processTableData.value.find(item => item.as_code === station.as_code)
-      console.log(result,'......result');    
+      console.log(result,'......result');
 
         const latitude = parseFloat(station.as_lat.replace('N', ''));
         const longitude = parseFloat(station.as_lon.replace('E', ''));
@@ -680,8 +681,8 @@ function hideStationName() {
 
         // 将站点特征添加到站点源
         stationSource.addFeature(feature);
-        
-      } 
+
+      }
     });
   };
 
@@ -760,6 +761,11 @@ const createWMSLayer = ({ layerName, minZoom, maxZoom, opacity = 1 }) => {
   });
 };
 
+const chageSlider = (row) => {
+  if(value2.value>1000){
+    value2.value = 500
+  }
+}
 
 let map:any; // 定义为全局变量
 let overviewMapControl: OverviewMap;
@@ -780,7 +786,7 @@ const initializeMap = () => {
     view: view
   });
 
- 
+
   // 定义鹰眼视图层
   const overviewMapLayer = new TileLayer({
     source: new TileWMS({
@@ -802,7 +808,7 @@ const initializeMap = () => {
     layers: [overviewMapLayer]
   });
   map.addControl(overviewMapControl);
-  
+
   // 显示小数点经纬度
   map.on('pointermove', (evt) => {
       // const [lon, lat] = toLonLat(map.getCoordinateFromPixel(evt.pixel));
@@ -815,8 +821,8 @@ const initializeMap = () => {
 watch(isEagleEyeOn, (newValue) => {
   overviewMapControl.setCollapsed(!newValue);
 });
-// 鹰眼图层的初始化  
-const initializeOverviewMap = () => {   
+// 鹰眼图层的初始化
+const initializeOverviewMap = () => {
   const overviewMapLayer = new TileLayer({
     source: new TileWMS({
       url: 'http://192.168.127.124:8080/geoserver/wms',
@@ -830,7 +836,7 @@ const initializeOverviewMap = () => {
       serverType: 'geoserver'
     })
   })
-};   
+};
 
 // 查询所有人工要素字典表
 const elementList =ref<any>([])
@@ -842,10 +848,10 @@ const getAllRgDataList = async () => {
 
 // 存放选中要素列表
 const copiedCustomizeColumns = ref<any>([]);
-// 要素的选中和取消  
+// 要素的选中和取消
 const toggleSelection = (item) => {
   item.isSelected = !item.isSelected;
-  
+
   if (item.isSelected) {
     // 添加选中的要素
     copiedCustomizeColumns.value.push(item);
@@ -865,14 +871,14 @@ const toggleSelection = (item) => {
 
 };
 
-  // 在组件挂载时初始化地图 
+  // 在组件挂载时初始化地图
   onMounted(() => {
     // startInterval(); // 组件中挂载启动时间器
     updateTime(); // 页面加载时更新时间
     // selectedTime.value = new Date(currentDate.value.getFullYear(), currentDate.value.getMonth(), currentDate.getDate(), currentDate.getHours(), currentDate.getMinutes());
     getAllRgDataList(); // 存放人工选择的要素列表
     initializeMap();
-    getPlatforms();    
+    getPlatforms();
   });
   // 在组件卸载时清除定时器
 onUnmounted(() => {
@@ -892,7 +898,7 @@ onUnmounted(() => {
 </style>
 
 <style scoped>
-.map { 
+.map {
   width: 100%;
   /* height: 100vh; */
   height: calc(100vh - 50px); /* 使用 calc() 来确保地图占满视口高度,减去上方的固定高度 */
@@ -925,33 +931,33 @@ onUnmounted(() => {
 }
 
 
-.slider-scale { 
-  width: 720px; 
-  margin-top: -10px; 
+.slider-scale {
+  width: 720px;
+  margin-top: -10px;
 }
 
 .gis-bottom-box {
-  display: flex; 
-  align-items: center; 
+  display: flex;
+  align-items: center;
   }
 
 /* 经纬度所在位置 */
 .mouse-position {
-  position: absolute; 
-  bottom: 0px; 
-  right: 1px; 
-  background-color: rgba(255, 255, 255, 0.7); 
-  padding: 3px; 
-  border: 1px solid #ccc; 
-  font-size: 14px; 
-  z-index: 1000; 
+  position: absolute;
+  bottom: 0px;
+  right: 1px;
+  background-color: rgba(255, 255, 255, 0.7);
+  padding: 3px;
+  border: 1px solid #ccc;
+  font-size: 14px;
+  z-index: 1000;
 }
 /**时间轴样式 */
 .gis-bottom-hei-state {
-  display: flex;  
+  display: flex;
   align-items: center;
   justify-content: center;
-  padding: 4px 0px 0px 4px; /*上、右、下、左内边距。增加右侧间距*/  
+  padding: 4px 0px 0px 4px; /*上、右、下、左内边距。增加右侧间距*/
   background-color: #fffdfd; /* 背景颜色 */
   border-radius: 4px;
   display: inline-block; /* 让容器适应内容大小 */

+ 515 - 149
src/views/system/stations/components/parametersBasic.vue

@@ -66,7 +66,7 @@
           </el-col>
           <el-col :span="4">
             <el-form-item label="上传间隔" prop="interval" style="width: 200px">
-              <div  style="display:flex;align-items: center">
+              <div style="display:flex;align-items: center">
                 <el-select v-model="selectData.update_space" disabled style="width: 180px">
                   <el-option label="1" :value="1"></el-option>
                   <el-option label="5" :value="5"></el-option>
@@ -102,7 +102,7 @@
         <el-row :gutter="20">
           <el-col :span="4">
             <el-form-item label="相对县城距离" prop="interval" style="width: 200px">
-              <div  style="display:flex;align-items: center">
+              <div style="display:flex;align-items: center">
                 <el-input v-model="selectData.county_dist" disabled style="width: 160px"></el-input>
                 <span style="padding-left: 10px">公里</span>
               </div>
@@ -114,7 +114,7 @@
                 <el-option label="东方" :value="0"></el-option>
                 <el-option label="南方" :value="1"></el-option>
                 <el-option label="西方" :value="2"></el-option>
-                <el-option label="北方"  :value="3"></el-option>
+                <el-option label="北方" :value="3"></el-option>
                 <el-option label="东南方" :value="4"></el-option>
                 <el-option label="东北方" :value="5"></el-option>
                 <el-option label="东北方" :value="6"></el-option>
@@ -124,29 +124,29 @@
           </el-col>
           <el-col :span="4">
             <el-form-item label="经度" prop="longitude" style="width: 200px">
-              <div  style="display:flex;align-items: center">
+              <div style="display:flex;align-items: center">
                 <el-input v-model="selectData.as_lon" disabled></el-input>
-<!--                <el-select v-model="formInline.longitude2" placeholder="" style="width: 60px;margin-left: 10px">-->
-<!--                  <el-option label="E" value="E"></el-option>-->
-<!--                  <el-option label="W" value="W"></el-option>-->
-<!--                </el-select>-->
+                <!--                <el-select v-model="formInline.longitude2" placeholder="" style="width: 60px;margin-left: 10px">-->
+                <!--                  <el-option label="E" value="E"></el-option>-->
+                <!--                  <el-option label="W" value="W"></el-option>-->
+                <!--                </el-select>-->
               </div>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <el-form-item label="纬度" prop="latitude" style="width: 200px">
-              <div  style="display:flex;align-items: center">
+              <div style="display:flex;align-items: center">
                 <el-input v-model="selectData.as_lat" disabled></el-input>
-<!--                <el-select v-model="formInline.latitude2" placeholder=""  style="width: 60px;margin-left: 10px">-->
-<!--                  <el-option label="N" value="N"></el-option>-->
-<!--                  <el-option label="S" value="S"></el-option>-->
-<!--                </el-select>-->
+                <!--                <el-select v-model="formInline.latitude2" placeholder=""  style="width: 60px;margin-left: 10px">-->
+                <!--                  <el-option label="N" value="N"></el-option>-->
+                <!--                  <el-option label="S" value="S"></el-option>-->
+                <!--                </el-select>-->
               </div>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <el-form-item label="观测场海拔高度" prop="fieldElevation" style="width: 200px">
-              <div  style="display:flex;align-items: center">
+              <div style="display:flex;align-items: center">
                 <el-input v-model="selectData.observe_height" disabled style="width: 180px"></el-input>
                 <span style="padding-left: 10px">米</span>
               </div>
@@ -154,8 +154,8 @@
           </el-col>
           <el-col :span="4">
             <el-form-item label="气压传感器海拔高度" prop="sensorElevation" style="width: 200px">
-              <div  style="display:flex;align-items: center">
-                <el-input v-model="selectData.pressure_height" disabled  style="width: 180px"></el-input>
+              <div style="display:flex;align-items: center">
+                <el-input v-model="selectData.pressure_height" disabled style="width: 180px"></el-input>
                 <span style="padding-left: 10px">米</span>
               </div>
             </el-form-item>
@@ -164,7 +164,7 @@
         <el-row :gutter="20">
           <el-col :span="4">
             <el-form-item label="测风器距地高度" prop="heightAnmometers" style="width: 200px">
-              <div  style="display:flex;align-items: center">
+              <div style="display:flex;align-items: center">
                 <el-input v-model="selectData.tower_height" disabled style="width: 180px"></el-input>
                 <span style="padding-left: 10px">米</span>
               </div>
@@ -215,7 +215,7 @@
           </el-col>
           <el-col :span="4">
             <el-form-item label="观测次数" prop="numberObservation" style="width: 200px">
-              <div  style="display:flex;align-items: center">
+              <div style="display:flex;align-items: center">
                 <el-input v-model="selectedItems.length" style="width: 180px" disabled></el-input>
                 <span style="padding-left: 10px">次</span>
               </div>
@@ -229,7 +229,8 @@
                 <span>观测时次</span>
                 <el-checkbox v-model="allTime" style="margin-left: 10px" label="全选" disabled/>
               </div>
-              <sCheckbox style="margin-top: 5px" :data="selectedItemData" :data2="selectedItems" @update:data2="updateSelectedItems"></sCheckbox>
+              <sCheckbox style="margin-top: 5px" :data="selectedItemData" :data2="selectedItems"
+                         @update:data2="updateSelectedItems"></sCheckbox>
             </el-form-item>
           </el-col>
         </el-row>
@@ -238,7 +239,7 @@
           <el-col :span="20">
             <div style="display: flex;align-items: center;margin-bottom: 5px">
               <span>主通信</span>
-              <el-checkbox v-model="isFromCommunication" disabled style="margin-left: 10px" label="启用从通信" />
+              <el-checkbox v-model="isFromCommunication"  disabled style="margin-left: 10px" label="启用从通信"/>
             </div>
           </el-col>
         </el-row>
@@ -254,23 +255,81 @@
               </el-select>
             </el-form-item>
           </el-col>
-<!--          <el-col :span="4">-->
-<!--            <el-form-item label="传输协议" prop="agreement" style="width: 200px">-->
-<!--              <el-select v-model="formInline.agreement">-->
-<!--                <el-option label="主动+补收" value="0"></el-option>-->
-<!--              </el-select>-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
-<!--          <el-col :span="4">-->
-<!--            <el-form-item label="SIM卡号" prop="sim" style="width: 200px">-->
-<!--              <el-input v-model="formInline.sim"></el-input>-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
-<!--          <el-col :span="4">-->
-<!--            <el-form-item label="通信模块ID" prop="modelId" style="width: 200px">-->
-<!--              <el-input v-model="formInline.modelId"></el-input>-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
+
+
+          <el-col :span="4" v-if="primaryCommunications.comm_type===0">
+            <el-form-item label="串口号" prop="port" style="width: 200px">
+              <el-input v-model="stringSlogans" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="primaryCommunications.comm_type===0">
+            <el-form-item label="通信参数" prop="port" style="width: 200px">
+              <el-input v-model="parameter" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="4" v-if="primaryCommunications.comm_type===1">
+            <el-form-item label="自动站通信机ID" prop="port" style="width: 200px">
+              <el-input v-model="comID" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="primaryCommunications.comm_type===1">
+            <el-form-item label="服务端通信机ID" prop="port" style="width: 200px">
+              <el-input v-model="serveID" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="4" v-if="primaryCommunications.comm_type===2">
+            <el-form-item label="传输协议" prop="agreement" disabled="" style="width: 200px">
+              <el-select v-model="comID4g">
+                <el-option label="TCP" value="TCP"></el-option>
+                <el-option label="TCP+DDP" value="TCP+DDP"></el-option>
+                <el-option label="UDP" value="UDP"></el-option>
+                <el-option label="UDP+DDP" value="UDP+DDP"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="primaryCommunications.comm_type===2">
+            <el-form-item label="SIM卡号" prop="sim" style="width: 200px">
+              <el-input v-model="sim" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="primaryCommunications.comm_type===2">
+            <el-form-item label="通信模块ID" prop="modelId" style="width: 200px">
+              <el-input v-model="serveID4g" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="4" v-if="primaryCommunications.comm_type===2">
+            <el-form-item label="端口号" prop="modelId"  style="width: 200px">
+              <el-input v-model="port4g" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+
+          <el-col :span="4" v-if="primaryCommunications.comm_type===3">
+            <el-form-item label="扫码间隔" prop="agreement"  style="width: 200px">
+              <el-select v-model="intervalFile" disabled>
+                <el-option label="1分钟" value="1"></el-option>
+                <el-option label="10分钟" value="10"></el-option>
+                <el-option label="60分钟" value="60"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="primaryCommunications.comm_type===3">
+            <el-form-item label="文件类型" prop="sim" style="width: 200px">
+              <el-select v-model="typeFile" disabled>
+                <el-option label="mdb" value="0"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="primaryCommunications.comm_type===3">
+            <el-form-item label="文件路径" prop="modelId" style="width: 200px">
+              <el-input v-model="urlFile" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+
           <el-col :span="4" v-if="primaryCommunications.comm_type===4">
             <el-form-item label="ip地址" prop="port" style="width: 200px">
               <el-input v-model="ip" disabled></el-input>
@@ -281,7 +340,8 @@
               <el-input v-model="port" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="4" v-if="primaryCommunications.comm_type===4">
+          <el-col :span="4"
+                  v-if="primaryCommunications.comm_type===4||primaryCommunications.comm_type===0||primaryCommunications.comm_type===1">
             <el-form-item label="通信模式" prop="communicationMode" style="width: 200px">
               <el-select v-model="primaryCommunications.comm_mode" disabled>
                 <el-option label="主动+补发" :value="0"></el-option>
@@ -297,30 +357,34 @@
             <el-form-item label="" prop="modeObservation" style="width: 200px">
               <div style="display: flex;align-items: center">
                 <span>命令设置</span>
-<!--                <el-button type="primary" plain style="margin-left: 10px">设置命令</el-button>-->
+                <!-- <el-button type="primary" plain style="margin-left: 10px">设置命令</el-button>-->
               </div>
             </el-form-item>
             <!-- 表格主体 -->
             <div class="table-box" style="width:920px;">
-            <el-table stripe ref="tableRef" :border="true" :data="processTableData"  size="small" height="150">
-              <template v-for="item in columns" :key="item">
-                <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'" :show-overflow-tooltip="true">
-                </el-table-column>
-              </template>
-
-              <!-- 无数据 -->
-              <template #empty>
-                <div class="table-empty">
-                  <slot name="empty">
-                    <div>暂无数据</div>
-                  </slot>
-                </div>
-              </template>
-            </el-table>
+              <el-table stripe ref="tableRef" :border="true" :data="primaryTableData" size="small" height="140">
+                <template v-for="item in columns" :key="item">
+                  <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'"
+                                   :show-overflow-tooltip="true">
+                  </el-table-column>
+                </template>
+
+                <!-- 无数据 -->
+                <template #empty>
+                  <div class="table-empty">
+                    <slot name="empty">
+                      <div>暂无数据</div>
+                    </slot>
+                  </div>
+                </template>
+              </el-table>
             </div>
           </el-col>
         </el-row>
 
+
+
+
         <el-row :gutter="20">
           <el-col :span="20">
             <div style="display: flex;align-items: center;margin-bottom: 5px;margin-top: 20px">
@@ -331,47 +395,126 @@
         <el-row :gutter="20">
           <el-col :span="4">
             <el-form-item label="通信方式" prop="methods" style="width: 200px">
-              <el-select v-model="formInline.methods">
-                <el-option label="串口" value="2"></el-option>
+              <el-select v-model="fromCommunication.comm_type" disabled>
+                <el-option label="串口" :value="0"></el-option>
+                <el-option label="北斗" :value="1"></el-option>
+                <el-option label="4G" :value="2"></el-option>
+                <el-option label="文件" :value="3"></el-option>
+                <el-option label="TCPClient" :value="4"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="4">
-            <el-form-item label="串口号" prop="agreement" style="width: 200px">
-              <el-select v-model="formInline.agreement">
-                <el-option label="/dev/ttyAMAO" value="2"></el-option>
+
+
+          <el-col :span="4" v-if="fromCommunication.comm_type===0">
+            <el-form-item label="串口号" prop="port" style="width: 200px">
+              <el-input v-model="stringSlogans2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="fromCommunication.comm_type===0">
+            <el-form-item label="通信参数" prop="port" style="width: 200px">
+              <el-input v-model="parameter2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="4" v-if="fromCommunication.comm_type===1">
+            <el-form-item label="自动站通信机ID" prop="port" style="width: 200px">
+              <el-input v-model="comID2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="fromCommunication.comm_type===1">
+            <el-form-item label="服务端通信机ID" prop="port" style="width: 200px">
+              <el-input v-model="serveID2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="4" v-if="fromCommunication.comm_type===2">
+            <el-form-item label="传输协议" prop="agreement" disabled="" style="width: 200px">
+              <el-select v-model="comID4g2">
+                <el-option label="TCP" value="TCP"></el-option>
+                <el-option label="TCP+DDP" value="TCP+DDP"></el-option>
+                <el-option label="UDP" value="UDP"></el-option>
+                <el-option label="UDP+DDP" value="UDP+DDP"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="4">
-            <el-form-item label="通信参数" prop="agreement" style="width: 200px">
-              <el-select v-model="formInline.agreement">
-                <el-option label="9600,N8,1" value="2"></el-option>
+          <el-col :span="4" v-if="fromCommunication.comm_type===2">
+            <el-form-item label="SIM卡号" prop="sim" style="width: 200px">
+              <el-input v-model="sim2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="fromCommunication.comm_type===2">
+            <el-form-item label="通信模块ID" prop="modelId" style="width: 200px">
+              <el-input v-model="serveID4g2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="4" v-if="fromCommunication.comm_type===2">
+            <el-form-item label="端口号" prop="modelId"  style="width: 200px">
+              <el-input v-model="port4g2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+
+          <el-col :span="4" v-if="fromCommunication.comm_type===3">
+            <el-form-item label="扫码间隔" prop="agreement"  style="width: 200px">
+              <el-select v-model="intervalFile2" disabled>
+                <el-option label="1分钟" value="1"></el-option>
+                <el-option label="10分钟" value="10"></el-option>
+                <el-option label="60分钟" value="60"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="4">
+          <el-col :span="4" v-if="fromCommunication.comm_type===3">
+            <el-form-item label="文件类型" prop="sim" style="width: 200px">
+              <el-select v-model="typeFile2" disabled>
+                <el-option label="mdb" value="0"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="fromCommunication.comm_type===3">
+            <el-form-item label="文件路径" prop="modelId" style="width: 200px">
+              <el-input v-model="urlFile2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+
+
+          <el-col :span="4" v-if="fromCommunication.comm_type===4">
+            <el-form-item label="ip地址" prop="port" style="width: 200px">
+              <el-input v-model="ip2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4" v-if="fromCommunication.comm_type===4">
+            <el-form-item label="端口号" prop="port" style="width: 200px">
+              <el-input v-model="port2" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4"
+                  v-if="fromCommunication.comm_type===4||fromCommunication.comm_type===0||fromCommunication.comm_type===1">
             <el-form-item label="通信模式" prop="communicationMode" style="width: 200px">
-              <el-select v-model="formInline.communicationMode">
-                <el-option label="主动+补发" value="2"></el-option>
+              <el-select v-model="fromCommunication.comm_mode" disabled>
+                <el-option label="主动+补发" :value="0"></el-option>
+                <el-option label="被动" :value="1"></el-option>
+                <el-option label="主动" :value="2"></el-option>
+                <el-option label="被动 + 补收" :value="3"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="20">
+        <el-row :gutter="20" v-if="fromCommunication.comm_type!==3">
           <el-col :span="20">
             <el-form-item label="" prop="modeObservation" style="width: 200px">
               <div style="display: flex;align-items: center">
                 <span>命令设置</span>
-                <el-button type="primary" plain style="margin-left: 10px">设置命令</el-button>
+                <!-- <el-button type="primary" plain style="margin-left: 10px">设置命令</el-button>-->
               </div>
             </el-form-item>
             <!-- 表格主体 -->
             <div class="table-box" style="width:920px;">
-              <el-table stripe ref="tableRef" :border="true" :data="processTableData"  size="small">
+              <el-table stripe ref="tableRef" :border="true" :data="primaryTableData2" size="small" height="140">
                 <template v-for="item in columns" :key="item">
-                  <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'" :show-overflow-tooltip="true">
-                    <template #default="scope"></template>
+                  <el-table-column v-bind="item" :align="item.align ?? 'left'" :reserve-selection="item.type == 'selection'"
+                                   :show-overflow-tooltip="true">
                   </el-table-column>
                 </template>
 
@@ -389,78 +532,79 @@
         </el-row>
       </div>
       <div class="disposition-bottom">
-        <el-button > 取消 </el-button>
-        <el-button type="primary"> 下一步 </el-button>
+        <el-button> 取消</el-button>
+        <el-button type="primary"> 下一步</el-button>
       </div>
     </div>
   </el-form>
 </template>
 
 <script setup lang="tsx">
-import sCheckbox from "@/components/SCheckbox/index.vue"
+import sCheckbox from "../../../../components/SCheckbox/index.vue"
 import {defineProps, onMounted, reactive, ref} from "vue";
 import {ColumnProps} from "@/components/ProTable/interface";
-import {getYasaverage, getYascomm} from "@/api/modules/allData";
+import {getYascomm} from "@/api/modules/allData";
+
 const props = defineProps<{
   selectData?: {};
 }>();
 const formRef = ref<any>();
 const formInline = ref<any>({
-  division:"",
-  name:"",
-  numberStation:"",
-  level:"",
-  base:"",
-  brigade:"",
-  methodErection:"",
-  interval:"",
-  provinces:"",
-  cities:"",
-  districts:"",
-  townships:"",
-  distance:"",
-  direction:"",
+  division: "",
+  name: "",
+  numberStation: "",
+  level: "",
+  base: "",
+  brigade: "",
+  methodErection: "",
+  interval: "",
+  provinces: "",
+  cities: "",
+  districts: "",
+  townships: "",
+  distance: "",
+  direction: "",
   longitude: "",
   longitude2: "E",
-  latitude:"",
-  latitude2:"N",
-  fieldElevation:"",
-  sensorElevation:"",
-  modeObservation:"",
-  numberObservation:"",
-  heightAnmometers:"",
-  buildWebsiteTime:"",
-  leader:"",
-  drector:"",
-  preExaminer:"",
-  grantPermission:"",
-  allTime:"",
-  enableCorrespondence:"",
-  methods:"",
-  agreement:"",
-  sim:"",
-  modelId:"",
-  port:"",
-  communicationMode:""
+  latitude: "",
+  latitude2: "N",
+  fieldElevation: "",
+  sensorElevation: "",
+  modeObservation: "",
+  numberObservation: "",
+  heightAnmometers: "",
+  buildWebsiteTime: "",
+  leader: "",
+  drector: "",
+  preExaminer: "",
+  grantPermission: "",
+  allTime: "",
+  enableCorrespondence: "",
+  methods: "",
+  agreement: "",
+  sim: "",
+  modelId: "",
+  port: "",
+  communicationMode: ""
 })
 
 const rules = ref<any>(
   {
-    division: [{ required: true, message: "部别不能为空", trigger: "blur" }],
-    name: [{ required: true, message: "台站名称不能为空", trigger: "blur" }],
-    numberStation: [{ required: true, message: "站号不能为空", trigger: "blur" }],
-    base: [{ required: true, message: "所属基地不能为空", trigger: "blur" }],
-    brigade: [{ required: true, message: "所属旅不能为空", trigger: "blur" }],
-    methodErection: [{ required: true, message: "架设方式不能为空", trigger: "blur" }],
-    provinces: [{ required: true, message: "省不能为空", trigger: "blur" }],
-    cities: [{ required: true, message: "市县不能为空", trigger: "blur" }],
-    districts: [{ required: true, message: "区镇不能为空", trigger: "blur" }],
-    townships: [{ required: true, message: "乡镇不能为空", trigger: "blur" }],
-    distance: [{ required: true, message: "相对县城距离不能为空", trigger: "blur" }],
-    longitude: [{ required: true, message: "相对县城方向不能为空", trigger: "blur" }],
-    latitude: [{ required: true, message: "相对县城方向不能为空", trigger: "blur" }],
-    fieldElevation: [{ required: true, message: "观测场海拔高度不能为空", trigger: "blur" }],
-    sensorElevation: [{ required: true, message: "气压传感器海拔高度不能为空", trigger: "blur" }],
+    division: [{required: true, message: "部别不能为空", trigger: "blur"}],
+    name: [{required: true, message: "台站名称不能为空", trigger: "blur"}],
+    numberStation: [{required: true, message: "站号不能为空", trigger: "blur"}],
+    base: [{required: true, message: "所属基地不能为空", trigger: "blur"}],
+    brigade: [{required: true, message: "所属旅不能为空", trigger: "blur"}],
+    methodErection: [{required: true, message: "架设方式不能为空", trigger: "blur"}],
+    provinces: [{required: true, message: "省不能为空", trigger: "blur"}],
+    cities: [{required: true, message: "市县不能为空", trigger: "blur"}],
+    districts: [{required: true, message: "区镇不能为空", trigger: "blur"}],
+    townships: [{required: true, message: "乡镇不能为空", trigger: "blur"}],
+    distance: [{required: true, message: "相对县城距离不能为空", trigger: "blur"}],
+    longitude: [{required: true, message: "相对县城方向不能为空", trigger: "blur"}],
+    latitude: [{required: true, message: "相对县城方向不能为空", trigger: "blur"}],
+    fieldElevation: [{required: true, message: "观测场海拔高度不能为空", trigger: "blur"}],
+    sensorElevation: [{required: true, message: "气压传感器海拔高度不能为空", trigger: "blur"}],
 
   }
 );
@@ -474,7 +618,7 @@ const submitForm = () => {
   });
 }
 
-const selectedItemData = ref<number[]>([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]);
+const selectedItemData = ref<number[]>([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]);
 const selectedItems = ref<number[]>([]);
 
 function updateSelectedItems(newSelectedItems: number[]) {
@@ -484,9 +628,6 @@ function updateSelectedItems(newSelectedItems: number[]) {
 const allTime = ref(false)
 
 
-
-
-
 const pageable = ref<any>({
   asCode: props.selectData.as_code,
   pageNum: 1,
@@ -495,53 +636,278 @@ const pageable = ref<any>({
 
 const primaryCommunications = ref({});
 const fromCommunication = ref({});
-const isFromCommunication =ref(false)
+const isFromCommunication = ref(true)
+
+//串口
+const stringSlogans = ref()
+const parameter = ref()
+const stringSlogans2 = ref()
+const parameter2 = ref()
+
+//北斗
+const comID = ref()
+const serveID = ref()
+const comID2 = ref()
+const serveID2 = ref()
+
+//4G
+const comID4g = ref()
+const sim = ref()
+const serveID4g = ref()
+const port4g = ref()
+const comID4g2 = ref()
+const sim2 = ref()
+const serveID4g2 = ref()
+const port4g2 = ref()
+
+//文件
+const intervalFile = ref()
+const typeFile = ref()
+const urlFile = ref()
+const intervalFile2 = ref()
+const typeFile2 = ref()
+const urlFile2 = ref()
+
+//TPC
 const ip = ref()
-const port =ref()
+const port = ref()
+const ip2 = ref()
+const port2 = ref()
+
 
-const getYascommList= async ()=> {
+//主表格数据
+const primaryTableData = ref([]);
+const primaryTableData2 = ref([]);
+
+const getYascommList = async () => {
   const {data} = await getYascomm(pageable.value);
   const averageList = data[props.selectData.as_code]
-  if(averageList!=undefined){
+  if (averageList != undefined) {
     primaryCommunications.value = averageList.find(station => station.comm_level === 0);
-    console.log("=====================")
-    console.log(primaryCommunications.value)
-    if (primaryCommunications.value.comm_type===4){
-      if(primaryCommunications.value.comm_param){
-        const params = primaryCommunications.value.comm_param.split(',');
-        if (params.length === 2) {
-          ip.value= params[0].trim(),
-          port.value= params[1].trim()
+    if(primaryCommunications.value){
+      // 分析串口类型数据
+      if (primaryCommunications.value.comm_type === 0) {
+        // 通信基本信息
+        if (primaryCommunications.value.comm_param) {
+          const params = primaryCommunications.value.comm_param.split(',');
+          if (params.length > 1) {
+            stringSlogans.value= params[0],
+            parameter.value= params.slice(1).join(',')
+          }
+        }
+
+        //通信命令数据
+        if (primaryCommunications.value.comm_cmd) {
+          primaryTableData.value = parseCommandData(primaryCommunications.value.comm_cmd)
+        }
+      }
+      // 北斗
+      else if (primaryCommunications.value.comm_type === 1) {
+        // 通信基本信息
+        if (primaryCommunications.value.comm_param) {
+          const params = primaryCommunications.value.comm_param.split(',');
+          if (params.length >= 2) {
+            comID.value = params[0].trim()
+              serveID.value = params[1].trim()
+          }
+
+        }
+
+        //通信命令数据
+        if (primaryCommunications.value.comm_cmd) {
+          primaryTableData.value = parseCommandData(primaryCommunications.value.comm_cmd)
+        }
+      }
+      //4G
+      else if (primaryCommunications.value.comm_type === 2) {
+        // 通信基本信息
+        if (primaryCommunications.value.comm_param) {
+          const params = primaryCommunications.value.comm_param.split(',');
+          if (params.length >= 4) {
+            comID4g.value = params[0].trim()
+              sim.value = params[1].trim()
+            serveID4g.value = params[2].trim()
+            port4g.value = params[3].trim()
+          }
+        }
 
+        //通信命令数据
+        if (primaryCommunications.value.comm_cmd) {
+          primaryTableData.value = parseCommandData(primaryCommunications.value.comm_cmd)
         }
       }
+      //文件
+      else if (primaryCommunications.value.comm_type === 3) {
+        // 通信基本信息
+        if (primaryCommunications.value.comm_param) {
+          const params = primaryCommunications.value.comm_param.split(',');
+          if (params.length >=3) {
+            intervalFile.value = params[1].trim()
+              typeFile.value = params[0].trim()
+            urlFile.value = params[2].trim()
 
+          }
+        }
+      }
+      // 分析TCP类型数据
+      else if (primaryCommunications.value.comm_type === 4) {
+        // 通信基本信息
+        if (primaryCommunications.value.comm_param) {
+          const params = primaryCommunications.value.comm_param.split(',');
+          if (params.length === 2) {
+            ip.value = params[0].trim()
+              port.value = params[1].trim()
+          }
+        }
+
+        //通信命令数据
+        if (primaryCommunications.value.comm_cmd) {
+          primaryTableData.value = parseCommandData(primaryCommunications.value.comm_cmd)
+        }
+      }
     }
 
+    fromCommunication.value = averageList.find(station => station.comm_level === 1);
+    if(fromCommunication.value){
+      isFromCommunication.value = fromCommunication.value.use_able === 1 ? true : false
+      // 分析串口类型数据
+      if (primaryCommunications.value.comm_type === 0) {
+        // 通信基本信息
+        if (fromCommunication.value.comm_param) {
+          const params = fromCommunication.value.comm_param.split(',');
+          if (params.length > 1) {
+            stringSlogans2.value= params[0],
+            parameter2.value= params.slice(1).join(',')
+          }
+        }
+
+        //通信命令数据
+        if (fromCommunication.value.comm_cmd) {
+          primaryTableData2.value = parseCommandData(fromCommunication.value.comm_cmd)
+        }
+      }
+      // 北斗
+      else if (fromCommunication.value.comm_type === 1) {
+        // 通信基本信息
+        if (fromCommunication.value.comm_param) {
+          const params = fromCommunication.value.comm_param.split(',');
+          if (params.length >= 2) {
+            comID2.value = params[0].trim()
+            serveID2.value = params[1].trim()
+          }
+
+        }
+
+        //通信命令数据
+        if (fromCommunication.value.comm_cmd) {
+          primaryTableData2.value = parseCommandData(fromCommunication.value.comm_cmd)
+        }
+      }
+      //4G
+      else if (fromCommunication.value.comm_type === 2) {
+        // 通信基本信息
+        if (fromCommunication.value.comm_param) {
+          const params = fromCommunication.value.comm_param.split(',');
+          if (params.length >= 4) {
+            comID4g2.value = params[0].trim()
+            sim2.value = params[1].trim()
+            serveID4g2.value = params[2].trim()
+            port4g2.value = params[3].trim()
+          }
+        }
+
+        //通信命令数据
+        if (fromCommunication.value.comm_cmd) {
+          primaryTableData2.value = parseCommandData(fromCommunication.value.comm_cmd)
+        }
+      }
+      //文件
+      else if (fromCommunication.value.comm_type === 3) {
+        // 通信基本信息
+        if (fromCommunication.value.comm_param) {
+          const params = fromCommunication.value.comm_param.split(',');
+          if (params.length >=3) {
+            intervalFile2.value = params[1].trim()
+            typeFile2.value = params[0].trim()
+            urlFile2.value = params[2].trim()
 
+          }
+        }
+      }
+      // 分析TCP类型数据
+      else if (fromCommunication.value.comm_type === 4) {
+        // 通信基本信息
+        if (fromCommunication.value.comm_param) {
+          const params = fromCommunication.value.comm_param.split(',');
+          if (params.length === 2) {
+            ip2.value = params[0].trim()
+            port2.value = params[1].trim()
+          }
+        }
 
+        //通信命令数据
+        if (fromCommunication.value.comm_cmd) {
+          primaryTableData2.value = parseCommandData(fromCommunication.value.comm_cmd)
+        }
+      }
+    }
+  }
+}
 
-    fromCommunication.value = averageList.find(station => station.comm_level === 0);
-    isFromCommunication.value = fromCommunication.value.user_able === 1? true:false
+// 命令类型数据映射
+const commandTypeData = {
+  0: "观测数据",
+  1: "工况数据",
+  2: "数据"
+};
+
+// 解析数据的方法
+function parseCommandData(data) {
+  if(data===';'){
+    return ;
   }
+  // 分割命令组
+  const commands = data.split(";");
+  commands.shift();
+  // 存储解析后的命令数据
+  const parsedCommands = [];
+
+  // 遍历每个命令组
+  commands.forEach(commandGroup => {
+    // 分割命令名称、命令间隔和命令类型
+    const [commandName, commandInterval, commandType] = commandGroup.split("|");
+
+    // 根据命令类型获取对应的描述
+    const commandTypeDesc = commandTypeData[parseInt(commandType)] || "未知类型";
+
+    // 添加解析后的命令数据到数组
+    parsedCommands.push({
+      commandName,
+      commandInterval: parseInt(commandInterval),
+      commandTypeDesc
+    });
+  });
+
+  return parsedCommands;
 }
 
 const processTableData = ref([]);
 
 // 表格配置项
 const columns = reactive<ColumnProps[]>([
-  { prop: "a", label: "命令名称"},
-  { prop: "b", label: "命令标识符"},
-  { prop: "c", label: "命令类型" },
-  { prop: "d", label: "间隔时间(分钟)"}
+  {prop: "commandName", label: "命令名称"},
+  {prop: "commandName", label: "命令标识符"},
+  {prop: "commandTypeDesc", label: "命令类型"},
+  {prop: "commandInterval", label: "间隔时间(分钟)"}
 ]);
 
 onMounted(() => {
   const observe_time = props.selectData.observe_time
   if (observe_time) {
     const timeArray = observe_time.split(';').map(item => parseInt(item, 10));
+    console.log(timeArray)
     selectedItems.value = timeArray;
-    allTime.value = selectedItems.value.length===24? true:false
+    allTime.value = selectedItems.value.length === 24 ? true : false
   }
   getYascommList()
 })
@@ -550,7 +916,7 @@ console.log(props.selectData)
 </script>
 
 <style scoped>
-.table-box{
+.table-box {
   height: auto;
 }
 </style>

+ 21 - 20
src/views/system/stations/components/translation.vue

@@ -157,39 +157,40 @@ const platformInfo=ref<any>({})
 const getPlatformListInfo = async () => {
   let { data } = await getPlatformList({ pageNum: 1, pageSize: 20, asCode: props.selectData?.as_code })
   // platformInfo.value = data.list[0]
+  const dataInfo = data.list[0]
   platformInfo.value={
-    fybsjjgList:data.list[0].fybsjjg.split('|'),
-    mfbqytjList:data.list[0].mfbqytj.split('|'),
-    mfsdbdxhgxsList:data.list[0].mfsdbdxhgxs.split('|'),
-    fxcgqzbpcList:data.list[0].fxcgqzbpc.split('|'),
-    lbszdfxhqx:data.list[0].lbszdfxhqs,
-    jyyszdfxhqx:data.list[0].jyyszdfxhqs,
-    ljszdfxhqx:data.list[0].ljszdfxhqs,
-    bdy300mdyszdfxhqx:data.list[0].bdy300mdyszdfxhqs,
+    fybsjjgList:dataInfo.fybsjjg.split('|'),
+    mfbqytjList:dataInfo.mfbqytj.split('|'),
+    mfsdbdxhgxsList:dataInfo.mfsdbdxhgxs.split('|'),
+    fxcgqzbpcList:dataInfo.fxcgqzbpc.split('|'),
+    lbszdfxhqx:dataInfo.lbszdfxhqs,
+    jyyszdfxhqx:dataInfo.jyyszdfxhqs,
+    ljszdfxhqx:dataInfo.ljszdfxhqs,
+    bdy300mdyszdfxhqx:dataInfo.bdy300mdyszdfxhqs,
     typeList:[{
       name:'球状干湿表(自然通风速度)',
-      nofrozen:data.list[0].qzgsb_zrtfsd.split('|')[1],
+      nofrozen:dataInfo.qzgsb_zrtfsd.split('|')[1],
 
-      frozen:data.list[0].qzgsb_zrtfsd.split('|')[2],
+      frozen:dataInfo.qzgsb_zrtfsd.split('|')[2],
     },{
       name:'通风干湿表(通风速度0.8m/s)',
-      nofrozen:data.list[0].tfgsb_0_8.split('|')[1],
-      frozen:data.list[0].tfgsb_0_8.split('|')[2],
+      nofrozen:dataInfo.tfgsb_0_8.split('|')[1],
+      frozen:dataInfo.tfgsb_0_8.split('|')[2],
     },{
       name:'通风干湿表(通风速度0.5m/s)',
-      nofrozen:data.list[0].tfgsb_0_5.split('|')[1],
-      frozen:data.list[0].tfgsb_0_5.split('|')[2],
+      nofrozen:dataInfo.tfgsb_0_5.split('|')[1],
+      frozen:dataInfo.tfgsb_0_5.split('|')[2],
     },{
       name:'球状干湿表(自然通风)*',
-      nofrozen:data.list[0].qzgsb_zrtf.split('|')[1],
-      frozen:data.list[0].qzgsb_zrtf.split('|')[2],
+      nofrozen:dataInfo.qzgsb_zrtf.split('|')[1],
+      frozen:dataInfo.qzgsb_zrtf.split('|')[2],
     },{
       name:'柱状干湿表(自然通风)*',
-      nofrozen:data.list[0].zzgsb_zrtf.split('|')[1],
-      frozen:data.list[0].zzgsb_zrtf.split('|')[2],
+      nofrozen:dataInfo.zzgsb_zrtf.split('|')[1],
+      frozen:dataInfo.zzgsb_zrtf.split('|')[2],
     }]
   }
-  console.log(data, '平台');
+  console.log(platformInfo.value, '平台');
 
 }
 
@@ -228,7 +229,7 @@ const handleSelectionChange = (val: []) => {
 function findNameByType(check, type) {
   if (check === 1) {
     let foundObject = allPart.value.find(obj => obj.part_type === type);
-    return foundObject ? foundObject.part_name : '参数错误'; // 如果找到了对象,返回其name属性,否则返回null  
+    return foundObject ? foundObject.part_name : '参数错误'; // 如果找到了对象,返回其name属性,否则返回null
   } else {
     let foundObject = sensorList.value.find(obj => obj.se_type === type);
     return foundObject ? foundObject.se_name : '参数错误'; // 如果找到了对象,返回其name属性,否则返回null

+ 1 - 1
src/views/system/stations/index.vue

@@ -89,7 +89,7 @@
           <ParametersBasic :select-data="rowItem"></ParametersBasic>
         </el-tab-pane>
         <el-tab-pane label="观测要素">
-         <Translation :select-data="rowItem"></Translation>
+<!--         <Translation :select-data="rowItem"></Translation>-->
         </el-tab-pane>
         <el-tab-pane label="仪器检定证">
           <VerificationCertificate :select-data="rowItem"></VerificationCertificate>