liyongli 2 tahun lalu
induk
melakukan
58f6a37b51

+ 1 - 1
src/view/allMedia/analysis.vue

@@ -65,7 +65,7 @@
         <analysisList ref="analysisListEle" />
       </div>
   
-      <analysisHotList @changeSearch="hotList" />
+      <analysisHotList @changeSearch="hotList" :province="areaification[searchActive.area] ? areaification[searchActive.area].name : undefined"/>
       <el-icon :size="45" class="upload" v-show="showUpload" @click="upload"
         ><Upload
       /></el-icon>

+ 1 - 6
src/view/allMedia/analysis_map.vue

@@ -98,7 +98,7 @@
       <analysisList ref="analysisListEle" />
     </div>
 
-    <analysisHotList @changeSearch="hotList" />
+    <analysisHotList @changeSearch="hotList" :province="areaification[searchActive.area] ? areaification[searchActive.area].name : undefined" />
     <el-icon :size="45" class="upload" v-show="showUpload" @click="upload"
       ><Upload
     /></el-icon>
@@ -165,9 +165,6 @@ let page = 1;
 onMounted(() => {
   getList();
 });
-if (localStorage.getItem('Economize')) {
-  areaification.value = JSON.parse(localStorage.getItem('Economize'));
-} else
   getEconomize({
     data: {
     //   key: 'b264662362c25150a1e6612013a7b921',
@@ -199,8 +196,6 @@ if (localStorage.getItem('Economize')) {
         id: i,
       });
     }
-    localStorage.setItem('Economize', JSON.stringify(areaification.value));
-    console.log(areaification.value);
   });
 
 getClass({}).then(res => {

+ 19 - 3
src/view/allMedia/components/analysis_hot_list.vue

@@ -20,19 +20,35 @@
 </template>
 
 <script setup>
-import { ref, defineEmits } from 'vue';
+import { ref, defineEmits, defineProps, watch } from 'vue';
 import { hotRank } from '../../../api/index';
 import hotIcon from '../../../assets/img/hot.png';
 const emit = defineEmits(['changeSearch']);
 const listHot = ref([]);
 const colorRanking = ['#FE2D46', '#F60', '#FAA90E'];
+const props = defineProps({
+  province: String,
+});
+
+const hot = () => {
+  hotRank({
+    data: {
+      province: props.province || undefined,
+    },
+  }).then(res => {
+    listHot.value = res || [];
+  });
+};
 
-hotRank({}).then(res => {
-  listHot.value = res || [];
+watch(props, () => {
+  console.log(props.province);
+  hot();
 });
+
 const searchHot = text => {
   emit('changeSearch', text);
 };
+hot();
 </script>
 
 <style scoped>