| | |
| | | <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> |
| | |
| | | data: { |
| | | type: Object, |
| | | default: () => { }, |
| | | }, |
| | | searchText: { |
| | | type: String, |
| | | default: '', |
| | | } |
| | | }, |
| | | components: { |
| | |
| | | { 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> |
| | |
| | | |
| | | export default new Vuex.Store({ |
| | | state: { |
| | | searchText: '' |
| | | }, |
| | | getters: { |
| | | }, |
| | |
| | | </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> |
| | |
| | | data: {}, |
| | | loading: true, |
| | | isFullscreen: false, |
| | | timer: null |
| | | timer: null, |
| | | searchText: '' |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | this.loading = false; |
| | | }); |
| | | this.timer = setInterval(() => { |
| | | getData().then(res => { |
| | | getData({houseHead:this.searchText}).then(res => { |
| | | this.data = res.data; |
| | | this.loading = false; |
| | | }); |
| | |
| | | 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; |