xsh пре 3 година
родитељ
комит
d87bfc5970

+ 16 - 8
src/components/areaZz.vue

@@ -2,7 +2,7 @@
   <div>
     <el-cascader
         size="mini"
-        :options="options"
+        :options="selectOption"
         v-model="selectedOptions"
         :props="{ checkStrictly: true }"
         ref="area"
@@ -460,7 +460,6 @@ export default {
         }
       ],
       selectOption: [],
-
     }
   },
   props: ['countyCode'],
@@ -468,16 +467,25 @@ export default {
     handleChange(value) {
       this.$emit('getCityCode', value);
     },
-    getFilter() {
-      this.options.filter(product => {
-        product.children.some(item => item.value === this.countyCode);
-      }).map(product => product);
-      console.log(this.options);
+    getFilter(list,target ) {
+      let childrenList = [];
+      const targetList = list.filter((item) => {
+        if (item.value == target) {
+          return true;
+        } else if (item.children && item.children.length) {
+          childrenList = childrenList.concat(this.getFilter(item.children, target));
+          return false
+        } else {
+          return false;
+        }
+      });
+      return targetList.concat(childrenList);
     }
   },
   mounted() {
     this.selectedOptions = [this.countyCode];
-    this.getFilter();
+    this.selectOption = this.getFilter(this.options, this.countyCode);
+    // console.log(arr);
     console.log(this.selectedOptions);
   }
 }

+ 0 - 9
src/views/MainLayout.vue

@@ -225,15 +225,6 @@ export default {
     background-color: #4098CA;
     color: white;
   }
-  .header_title {
-    height: 40px;
-    background-color: #F7F7F7;
-    border: 1px solid #ddd;
-    line-height: 40px;
-    color: #6FA8C8;
-    margin-bottom: 10px;
-    padding-left: 20px;
-  }
   .overY {
     height: calc(100vh - 180px - 52px);
     overflow-y: scroll;

+ 12 - 2
src/views/pastureData/dataDetail.vue

@@ -3,7 +3,7 @@
     <div>
       <div class="header_title">
         <span>耳标 <strong style="color: mediumturquoise;"> {{earTag}}</strong> 详情</span>
-        <div class="back" @click="jump">回上一页</div>
+        <div class="back" @click="jump">回上一页</div>
       </div>
       <div class="box">
         <div>耳标</div>
@@ -229,7 +229,7 @@ export default {
         endTime: this.value2[1]
       }
       this.$http({
-        url: this.$http.adornUrl('http://122.112.224.199:9000/eartagdata/list_deatils'),
+        url: this.$http.adornUrl('http://122.112.224.199:9500/manager/eartagdata/list_deatils'),
         method: 'get',
         params: this.$http.adornParams(params)
       })
@@ -343,4 +343,14 @@ export default {
   width: 100%;
   height: 1000px;
 }
+.header_title {
+  height: 40px;
+  background-color: #F7F7F7;
+  border: 1px solid #ddd;
+  line-height: 40px;
+  color: #6FA8C8;
+  margin-bottom: 10px;
+  padding-left: 20px;
+  position: relative;
+}
 </style>

+ 1 - 1
src/views/pastureData/homeComponent/city.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="header_title">牧场概况--{{title}}
-      <div class="right_float" @click="backBtn">回上一页</div>
+      <div class="right_float" @click="backBtn">回上一页</div>
     </div>
     <div>
       <div class="box">

+ 1 - 1
src/views/pastureData/homeComponent/district.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="header_title">牧场概况--{{title}}
-      <div class="right_float" @click="backBtn">回上一页</div>
+      <div class="right_float" @click="backBtn">回上一页</div>
     </div>
     <div>
       <div class="box">

+ 1 - 1
src/views/pastureData/homeComponent/farm.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="header_title">牧场概况--{{farmName}}
-      <div class="right_float" @click="backBtn">回上一页</div>
+      <div class="right_float" @click="backBtn">回上一页</div>
     </div>
     <div>
       <div class="box">