From c9571c465c756deedbfe424b5eab2d7591119f77 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 19 五月 2023 17:04:45 +0800
Subject: [PATCH] 新增选项组件,修改组合式函数fetchData

---
 src/views/baseinfo/fysp/scene/SceneInfo.vue |   52 +++++++++++++++++++++++++---------------------------
 1 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/src/views/baseinfo/fysp/scene/SceneInfo.vue b/src/views/baseinfo/fysp/scene/SceneInfo.vue
index 3f7d8c5..9fe1c9e 100644
--- a/src/views/baseinfo/fysp/scene/SceneInfo.vue
+++ b/src/views/baseinfo/fysp/scene/SceneInfo.vue
@@ -2,16 +2,26 @@
   <el-row ref="searchRef">
     <el-form :inline="true" :model="formSearch">
       <el-form-item label="鐪�/甯�/鍖�/闀�" prop="_locations">
-        <el-cascader
+        <!-- <el-cascader
           v-model="formSearch._locations"
           :options="locations"
           placeholder="鐪�/甯�/鍖�/闀�"
           :props="props"
           style="width: 280px"
-        />
+        /> -->
+        <OptionLocation
+          :allOption="true"
+          :level="4"
+          v-model:value="formSearch._locations"
+        ></OptionLocation>
       </el-form-item>
-      <el-form-item label="鍦烘櫙绫诲瀷" prop="scensetypeid">
-        <el-select
+      <el-form-item label="鍦烘櫙绫诲瀷" prop="scensetype">
+        <OptionScene
+          :allOption="true"
+          :type="2"
+          v-model:value="formSearch.scensetype"
+        ></OptionScene>
+        <!-- <el-select
           v-model="formSearch.scensetypeid"
           placeholder="鍦烘櫙绫诲瀷"
           style="width: 150px"
@@ -22,10 +32,14 @@
             :label="s.label"
             :value="s.value"
           />
-        </el-select>
+        </el-select> -->
       </el-form-item>
       <el-form-item label="涓婄嚎鐘舵��" prop="online">
-        <el-select
+        <OptionOnlineStatus
+          :allOption="true"
+          v-model:value="formSearch.online"
+        ></OptionOnlineStatus>
+        <!-- <el-select
           v-model="formSearch.online"
           placeholder="涓婄嚎鐘舵��"
           style="width: 75px"
@@ -36,7 +50,7 @@
             :label="s.label"
             :value="s.value"
           />
-        </el-select>
+        </el-select> -->
       </el-form-item>
       <el-form-item>
         <el-button icon="Search" type="primary" @click="onSearch"
@@ -106,9 +120,6 @@
 </template>
 
 <script>
-import { enumScene_2 } from '@/enum/scene';
-import { enumLocation } from '@/enum/location';
-import { enumOnlineStatus } from '@/enum/onlineStatus';
 import sceneApi from '@/api/fysp/sceneApi';
 import { useLoadingStore } from '@/stores/loadingStore';
 import { mapStores } from 'pinia';
@@ -117,20 +128,10 @@
 export default {
   data() {
     return {
-      locations: enumLocation(),
-      sceneTypes: enumScene_2(),
-      onlineStatus: enumOnlineStatus(),
       formSearch: {
         _locations: [],
-        provincecode: '',
-        citycode: '',
-        districtcode: '',
-        towncode: '',
-        scensetypeid: '',
-        online: '',
-      },
-      props: {
-        checkStrictly: true,
+        scensetype: {},
+        online: {},
       },
 
       tableData: [],
@@ -177,10 +178,10 @@
         ? (area.towncode = f._locations[3][0])
         : (area.towncode = null);
       // 鍦烘櫙绫诲瀷
-      area.scensetypeid = f.scensetypeid;
+      area.scensetypeid = f.scensetype.value;
       if (area.scensetypeid == '0') area.scensetypeid = null;
       // 涓婁笅绾跨姸鎬�
-      area.online = f.online;
+      area.online = f.online.value;
 
       sceneApi
         .searchScene(area, this.currentPage, this.pageSize)
@@ -234,9 +235,6 @@
     },
   },
   mounted() {
-    this.formSearch.scensetypeid = this.sceneTypes[0].value;
-    this.formSearch._locations = [this.locations[0].value];
-    this.formSearch.online = this.onlineStatus[0].value;
     this.tableHeight = this.calcTableHeight();
     this.onSearch();
   },

--
Gitblit v1.9.3