Преглед изворни кода

选择编辑接口先请求位置信息

xiebeibei пре 4 година
родитељ
комит
3064e96516
1 измењених фајлова са 21 додато и 19 уклоњено
  1. 21 19
      src/components/edit/edit-dialog.vue

+ 21 - 19
src/components/edit/edit-dialog.vue

@@ -14,18 +14,19 @@
                     <div class="select">
                         <a-select style="width: 236px;margin: 0 10px" :default-value="majorId">
                             <a-select-opt-group>
-                                <span slot="label">设备设施</span>
-                                <a-select-option v-for="item in majorList" :value="item.id" @click="handleChange(item)">
-                                    {{item.name}}
-                                </a-select-option>
-                            </a-select-opt-group>
-                            <a-select-opt-group>
                                 <span slot="label">位置区域</span>
                                 <a-select-option v-for="item in locationList" :value="item.id"
                                                  @click="handleChange(item)">
                                     {{item.name}}
+                            </a-select-option>
+                            <a-select-opt-group>
+                                <span slot="label">设备设施</span>
+                                <a-select-option v-for="item in majorList" :value="item.id" @click="handleChange(item)">
+                                    {{item.name}}
                                 </a-select-option>
                             </a-select-opt-group>
+
+                            </a-select-opt-group>
                         </a-select>
                         <!--            <Select style="margin: 0 10px"-->
                         <!--                    v-model="majorId"-->
@@ -394,35 +395,36 @@
             },
             //获取设备大类和位置大类
             getQuerySmsxt() {
-                // if (this.typeEdit=='Image'){
-                getQuerySmsxt({}).then(res => {
+                queryWzfldl({}).then(res => {
                     if (res.result == 'success') {
                         if (res.data) {
                             const data = res.data;
                             data.map(item => {
-                                item.id = item.code;
-                                item.name = item.name;
-                                item.type = 'Image';
+                                item.id = item.dl;
+                                item.name = item.dl;
+                                item.type = 'Zone'
                             })
-                            this.majorList = data;
+                            this.locationList = data;
                         }
                     }
                 })
-                // }else if(this.typeEdit =='Zone'){
-
-                queryWzfldl({}).then(res => {
+                // if (this.typeEdit=='Image'){
+                getQuerySmsxt({}).then(res => {
                     if (res.result == 'success') {
                         if (res.data) {
                             const data = res.data;
                             data.map(item => {
-                                item.id = item.dl;
-                                item.name = item.dl;
-                                item.type = 'Zone'
+                                item.id = item.code;
+                                item.name = item.name;
+                                item.type = 'Image';
                             })
-                            this.locationList = data;
+                            this.majorList = data;
                         }
                     }
                 })
+                // }else if(this.typeEdit =='Zone'){
+
+
                 // }
 
             },