fix
13404089107
2025-04-07 a8de18c6332fa766a673078b730215f6734988d4
fix
3个文件已修改
31 ■■■■ 已修改文件
src/components/datascreen/CenterPanel.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/DataScreen.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/datascreen/CenterPanel.vue
@@ -39,7 +39,7 @@
    <div class="center-bott">
      <div class="bottom-search">
        <div class="search-box">
          <input type="text" placeholder="请输入户主名称进行搜索" v-model="searchText">
          <input type="text" placeholder="请输入户主名称进行搜索" v-model="searchText" @keydown="searchForText($event)">
          <img src="@/assets/search.png" class="search-icon" alt="">
        </div>
      </div>
@@ -82,6 +82,10 @@
    data: {
      type: Object,
      default: () => { },
    },
    searchText: {
      type: String,
      default: '',
    }
  },
  components: {
@@ -94,11 +98,18 @@
        { label: '已审核', value: '2021103000002', percentage: 70 },
        { label: '已完成', value: '2021103000003', percentage: 50 }
      ],
      searchText: '', // 搜索文本
      // searchText: '', // 搜索文本
      compensationList: [
      ]
    };
  },
  methods: {
    searchForText(event) {
      if (event.key === 'Enter') { // 监听回车键事件
        this.$emit('searchForText', this.searchText); // 触发搜索事件并传递搜索文本
      }
    }
  }
};
</script>
src/store/index.js
@@ -5,6 +5,7 @@
export default new Vuex.Store({
  state: {
    searchText: ''
  },
  getters: {
  },
src/views/DataScreen.vue
@@ -8,7 +8,7 @@
    </div>
    <header-panel />
    <left-panel v-if="!loading" :data="data" />
    <center-panel v-if="!loading" :data="data" />
    <center-panel :searchText="searchText" @searchForText="searchForText" v-if="!loading" :data="data" />
    <right-panel v-if="!loading" :data="data" />
  </div>
</template>
@@ -39,7 +39,8 @@
      data: {},
      loading: true,
      isFullscreen: false,
      timer: null
      timer: null,
      searchText: ''
    };
  },
  created() {
@@ -49,7 +50,7 @@
      this.loading = false;
    });
    this.timer = setInterval(() => {
      getData().then(res => {
      getData({houseHead:this.searchText}).then(res => {
        this.data = res.data;
        this.loading = false;
      });
@@ -72,6 +73,14 @@
    clearInterval(this.timer);
  },
  methods: {
    searchForText(text) {
      this.searchText = text;
      this.loading = true;
      getData({houseHead:text}).then(res => {
        this.data = res.data;
        this.loading = false;
      });
    },
    handleResize() {
      const widthScale = window.innerWidth / 1920;
      const heightScale = window.innerHeight / 1080;