Browse Source

下拉框bug修改

bobo04052021@163.com 3 months ago
parent
commit
bcdd128f0a
1 changed files with 11 additions and 4 deletions
  1. 11 4
      src/views/vent/dust/dustMonitorTable/index.vue

+ 11 - 4
src/views/vent/dust/dustMonitorTable/index.vue

@@ -15,8 +15,15 @@
           <a-tabs v-model:activeKey="activeTab">
             <a-tab-pane key="workplace" class="tab1" tab="监测地点粉尘情况分析">
               <div class="filter-container">
-                <a-select v-model="selectedWorkplace" @change="workPlaceChange" placeholder="选择工作场所" style="width: 280px; margin: 5px">
-                  <a-select-option v-for="workplace in workplaceList" :key="workplace" :value="workplace">
+                <a-select
+                  :key="DefaultValue"
+                  :default-value="DefaultValue"
+                  v-model="selectedWorkplace"
+                  @change="workPlaceChange"
+                  placeholder="选择工作场所"
+                  style="width: 280px; margin: 5px"
+                >
+                  <a-select-option v-for="workplace in workplaceList" :key="workplace.index" :value="workplace">
                     {{ workplace }}
                   </a-select-option>
                 </a-select>
@@ -50,7 +57,7 @@ let workplaceList = ref<any[]>([]); //根据工作场所查询的数据
 let activeTab = ref<string>('workplace');
 let selectedFileId = ref<string | null>(null);
 let selectedWorkplace = ref<string | null>(null);
-
+let DefaultValue = ref<string | null>(null);
 let formSearch = reactive({
   pageNum: 1,
   pageSize: 1000,
@@ -67,7 +74,7 @@ async function getTableList(params: any) {
   processTableData(contentArr);
   if (workplaceList.value.length > 0) {
     console.log(workplaceList.value, 'workplaceList');
-    selectedWorkplace.value = workplaceList.value[0];
+    DefaultValue.value = workplaceList.value[0];
     workPlaceChange(selectedWorkplace.value);
   }
 }