From 263cd8a65d89614859b1c273ca8adc6813594bbf Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期五, 24 四月 2026 16:05:30 +0800
Subject: [PATCH] fix(operationWorkbench): 修复点位面板关闭逻辑与表单验证问题

---
 src/views/businessOperations/operationWorkbench/components/PointPanel.vue |    2 
 src/views/businessOperations/operationWorkbench/map.vue                   |   40 +++++++++++++++++---
 src/views/businessOperations/operationWorkbench/list.vue                  |   19 +++------
 src/views/businessOperations/operationWorkbench/map.scss                  |    2 
 4 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/src/views/businessOperations/operationWorkbench/components/PointPanel.vue b/src/views/businessOperations/operationWorkbench/components/PointPanel.vue
index 2e5a99a..dd9f80a 100644
--- a/src/views/businessOperations/operationWorkbench/components/PointPanel.vue
+++ b/src/views/businessOperations/operationWorkbench/components/PointPanel.vue
@@ -224,7 +224,7 @@
 
 <template>
   <div class="point-detail-shell">
-    <button class="collapse-btn" type="button" @click="emit('close-panel')">
+    <button v-if="!createMode" class="collapse-btn" type="button" @click="emit('close-panel')">
       <img src="../../../../assets/point/close-point.png" class="collapse-icon">
     </button>
     <template v-if="editMode || createMode">
diff --git a/src/views/businessOperations/operationWorkbench/list.vue b/src/views/businessOperations/operationWorkbench/list.vue
index 45bf15f..6103e86 100644
--- a/src/views/businessOperations/operationWorkbench/list.vue
+++ b/src/views/businessOperations/operationWorkbench/list.vue
@@ -688,14 +688,7 @@
   const statusText = getPointStatusText(row.operationStatus, row.verificationStatus)
 
   if (statusText === '已停用') {
-    const stopReason = String(
-      row?.stopReason
-      || row?.disableReason
-      || row?.failureReason
-      || row?.remark
-      || row?.remarks
-      || '',
-    ).trim()
+    const stopReason = String(row?.hoverStatusDes  || '' ).trim()
     return stopReason || ''
   }
 
@@ -715,11 +708,11 @@
   const stationName = String(row?.stationName || '').trim()
 
   if (electronicName && stationName)
-    return `${electronicName} / ${stationName}`
+    return `[区]${electronicName} , [场]${stationName}`
   if (electronicName)
-    return electronicName
+    return `[区]${electronicName}`
   if (stationName)
-    return stationName
+    return `[场]${stationName}`
   return '-'
 }
 
@@ -734,6 +727,7 @@
     lineHeight: '16px',
     textAlign: 'center' as const,
     margin: '0 4px',
+    cursor: 'pointer',
   }
 
   switch (getStatusClass(statusText)) {
@@ -1842,7 +1836,7 @@
       ellipsis: true,
       resizable: true,
       render(row) {
-        return row.pointOnOffName || '-'
+        return row.pointOnOffName ||'上下车均可'|| '-'
       },
     },
     {
@@ -2289,6 +2283,7 @@
   line-height: 16px;
   text-align: center;
   margin: 0 4px;
+  cursor: pointer;
 
   &.wait-test {
     background: #fff6ea;
diff --git a/src/views/businessOperations/operationWorkbench/map.scss b/src/views/businessOperations/operationWorkbench/map.scss
index db2e20b..2da314c 100644
--- a/src/views/businessOperations/operationWorkbench/map.scss
+++ b/src/views/businessOperations/operationWorkbench/map.scss
@@ -731,7 +731,7 @@
   justify-content: center;
   cursor: pointer;
   transform: translateY(-50%);
-  transition: right 0.3s ease-in-out;
+  // transition: right 0.3s ease-in-out;
 
   &.collapsed {
     right: 0;
diff --git a/src/views/businessOperations/operationWorkbench/map.vue b/src/views/businessOperations/operationWorkbench/map.vue
index bf5ed2d..63f31ee 100644
--- a/src/views/businessOperations/operationWorkbench/map.vue
+++ b/src/views/businessOperations/operationWorkbench/map.vue
@@ -1057,6 +1057,15 @@
     : "3";
 }
 
+function ensurePointParkingTimeLimitByStatus(statusText?: string) {
+  if (
+    ["可运营", "待生效", "启用中"].includes(String(statusText || "")) &&
+    !String(pointForm.value.parkingTimeLimit || "").trim()
+  ) {
+    pointForm.value.parkingTimeLimit = "3";
+  }
+}
+
 const currentStatusOptions = computed(
   () => statusOptionsMap[activeTab.value] || []
 );
@@ -3804,6 +3813,21 @@
 });
 
 watch(
+  () => pointForm.value.pointOnOff,
+  (value) => {
+    const normalized = normalizePointOnOff(value);
+    if (value !== normalized) {
+      pointForm.value.pointOnOff = normalized;
+    }
+  },
+  { immediate: true }
+);
+
+watch(currentPointStatusText, (status) => {
+  ensurePointParkingTimeLimitByStatus(status);
+});
+
+watch(
   () => [route.name, route.fullPath, workbenchStore.version],
   () => {
     if (route.name !== "operationWorkbenchMap") return;
@@ -4044,10 +4068,12 @@
   if (isPointFormMode.value && !(await confirmDiscardPointEdit())) return;
   pointPanelClosed.value = true;
   selectedId.value = "";
+  if (pointCreateMode.value) {
+    exitPointCreateMode();
+    return;
+  }
   pointDetailData.value = null;
   pointEditMode.value = false;
-  pointCreateMode.value = false;
-  pointCreateReady.value = false;
   pointEditSnapshot.value = "";
   cleanupPointEditMapState();
 }
@@ -5790,7 +5816,9 @@
     fenceId = "0";
     pointType = 2;
   }
-  const pointOnOff = normalizePointOnOff(pointForm.value.pointOnOff);
+  const pointOnOff = normalizePointOnOff(
+    pointForm.value.pointOnOff || pointDetailData.value?.pointOnOff || "3"
+  );
   pointForm.value.pointOnOff = pointOnOff;
   pointSaving.value = true;
   try {
@@ -5806,7 +5834,7 @@
       ...administrativeInfo,
       pointName: pointForm.value.pointName.trim(),
       pointAddress: pointForm.value.pointAddress.trim(),
-      pointOnOff,
+      pointOnOff: Number(pointOnOff),
       parkingTimeLimit: pointForm.value.parkingTimeLimit || undefined,
       remarks: pointForm.value.remarks.trim() || undefined,
       pointLon: pointForm.value.pointLon ?? undefined,
@@ -5878,10 +5906,10 @@
       syncPointDetailFromSelected();
       return;
     }
-    window.$message?.error(res.msg || "保存失败");
+    // window.$message?.error(res.msg || "保存失败");
   } catch (error) {
     console.error("保存点位失败:", error);
-    window.$message?.error("保存失败");
+    // window.$message?.error("保存失败");
   } finally {
     pointSaving.value = false;
   }

--
Gitblit v1.7.1