From 8f36a203bbee6c74c6531331a7cf00572120bfab Mon Sep 17 00:00:00 2001
From: web <candymxq888@outlook.com>
Date: 星期日, 27 四月 2025 17:28:59 +0800
Subject: [PATCH] fix:修改配置

---
 src/views/facility/facilityList/index.vue |   28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/src/views/facility/facilityList/index.vue b/src/views/facility/facilityList/index.vue
index b54b6a9..b9b63b4 100644
--- a/src/views/facility/facilityList/index.vue
+++ b/src/views/facility/facilityList/index.vue
@@ -1,16 +1,14 @@
 <script setup>
 import facilityApi from "@/api/facility/index";
 import pointApi from "@/api/facility/point";
-import supplierApi from "@/api/facility/supplier.js";
 import facilityTypeApi from "@/api/facility/facilityType.js";
 import commonParameters from "@/api/configuration/commonParameters/index.js";
 import waterFacilityParameter from "@/api/facility/parameter.js";
-import {PREURL} from '@/config/index'
 import setPostParams from "@/utils/searchParams.js";
 import {onMounted} from "vue";
 const route = useRoute();
-const preUrl = ref(PREURL);
 const {proxy} = getCurrentInstance();
+const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL //图片前缀
 
 /**
  * 搜索相关
@@ -81,9 +79,10 @@
 });
 //查询监控点
 const pointList = ref();
+const cascaderOption = { label: 'pointName', value: 'id', children: 'childrenList', checkStrictly: true, expandTrigger: 'hover', emitPath: false }; //级联选择器配置
 const getPoint = async () => {
-    await pointApi().search({limit: 100, page: 1}).then((res) => {
-        pointList.value = res.data.list
+    await pointApi().getParentPoint().then((res) => {
+        pointList.value = res.data
     })
 }
 
@@ -209,7 +208,7 @@
 }
 //上传文件,添加图片地址信息
 const uploadData = (data) => {
-    form.value.facilityUrl = data.toString();
+    form.value.facilityUrl = imgBaseUrl + data.toString();
 }
 
 /** 提交按钮 */
@@ -316,7 +315,7 @@
             >
                 <template #default="scope">
                     <div v-if="key.toString() === 'facilityUrl'" style="height: 50px;margin: 0 auto">
-                        <img :src="preUrl + scope.row.facilityUrl" class="table-headImg"/>
+                        <img :src="imgBaseUrl + scope.row.facilityUrl" class="table-headImg" alt="" />
                     </div>
                 </template>
             </el-table-column>
@@ -359,14 +358,7 @@
                     </el-select>
                 </el-form-item>
                 <el-form-item label="选择监控点" prop="pointId">
-                    <el-select v-model="form.pointId" :placeholder="inpTip+formLabel.pointId">
-                        <el-option
-                                v-for="(item,index) in pointList"
-                                :label="item.pointName"
-                                :value="item.id"
-                                :key="index"
-                        ></el-option>
-                    </el-select>
+                    <el-cascader v-model="form.pointId" :options="pointList" :show-all-levels="false" :props="cascaderOption" />
                 </el-form-item>
                 <el-form-item label="安装日期" prop="installDate">
                     <el-date-picker
@@ -382,8 +374,7 @@
                     <el-input v-model="form.remark" :placeholder="inpTip+formLabel.remark" />
                 </el-form-item>
                 <el-form-item label="资料上传" prop="facilityUrl" style="flex: 1">
-                    <upload-icons @uploadData="uploadData" :imageList="form.facilityUrl" :limit="1"
-                                  :disabled='isDetail ? true : false'></upload-icons>
+                    <upload-icons @uploadData="uploadData" :imageList="form.facilityUrl" :limit="1"></upload-icons>
                     <span style="display: block;">(请上传1张设备图片)</span>
                 </el-form-item>
             </el-form>
@@ -424,6 +415,9 @@
 }
 .form-box{
     justify-content: normal;
+    :deep(.el-cascader){
+        flex-grow: 1;
+    }
 }
 </style>
  
\ No newline at end of file

--
Gitblit v1.9.3