Browse Source

接口传值问题

xiaohaizhao 6 months ago
parent
commit
920b72dd65

+ 1 - 1
src/operation/moduleNormal/positionControl/index.vue

@@ -139,7 +139,7 @@
               </div>
             </div>
           </div>
-          <devices />
+          <devices systemname='valvesystem' />
         </ContentBox>
       </div>
       <div class="control_content-right">

+ 1 - 1
src/operation/moduleNormal/pressureControl/index.vue

@@ -196,7 +196,7 @@
               </div>
             </div>
           </div>
-          <devices />
+          <devices systemname='wpressuresystem' />
         </ContentBox>
       </div>
       <div class="control_content-right">

+ 25 - 6
src/operation/moduleNormal/pressureControl/modules/devices.vue

@@ -127,11 +127,13 @@
         <img style="width: 100%" :src="item.attinfos[0].url" alt="" />
       </ContentBox>
     </div>
-    <a-empty :image="simpleImage" v-else>
-      <template #description>
-        <span style="color: #ffffff">暂无数据</span>
-      </template>
-    </a-empty>
+    <div class="empty-box" v-else>
+      <a-empty :image="simpleImage">
+        <template #description>
+          <span style="color: #ffffff">暂无数据</span>
+        </template>
+      </a-empty>
+    </div>
   </div>
 </template>
 
@@ -149,6 +151,10 @@ const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
 const router = useRouter();
 let isShowMap = ref(true);
 
+let props = defineProps({
+  systemname: String,
+});
+
 /* 地图 */
 let infoPanel = ref({
     baseInfo: "",
@@ -280,9 +286,11 @@ let autoRange = (map, points_arr) => {
 /* 列表 */
 let DeviceTotalPage = ref(0);
 let deviceList = ref([]);
+
 let deviceParam = ref({
   id: 20230914133302,
   content: {
+    systemname: props.systemname,
     pageNumber: 1,
     pageSize: 15,
   },
@@ -291,12 +299,12 @@ let deviceParam = ref({
 let deviceLoad = () => {
   if (deviceParam.value.content.pageNumber == DeviceTotalPage.value) return;
   deviceParam.value.content.pageNumber += 1;
-  console.log(deviceParam.value);
   getDeviceData();
 };
 
 let getDeviceData = async () => {
   let res = await Api.requested(deviceParam.value);
+  console.log("deviceParam.value", deviceParam.value);
   console.log("获取列表", res);
   deviceList.value =
     deviceParam.value.content.pageNumber == 1
@@ -336,6 +344,17 @@ onMounted(async () => {
   --color1: #16fff6;
   --color2: rgba(255, 164, 6);
 }
+.empty-box {
+  position: absolute;
+  width: 220rem;
+  height: 220rem;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
 /* 地图 */
 .M-map {
   width: 100%;