智慧园区前端大屏
shuishen
2024-10-31 9fe73388fdea13fa87c0a4894019eb66887abaad
src/views/survey/components/box/fireTrend.vue
@@ -10,6 +10,37 @@
-->
<script setup>
import publicContent from './publicContent.vue'
import { ref, reactive } from 'vue'
import { getPage } from '../../../../api/indParkInfo'
let parkQy = ref([])
let searchQuery = ref('')
onMounted(() => {
    getPages()
})
function getPages() {
    getPage().then(res => {
        parkQy.value = res.data.data.records
        console.log(res)
    }).catch(err => {
        console.log(err)
    })
}
function search() {
    getPage({ name: searchQuery.value }).then(res => {
        parkQy.value = res.data.data.records
        console.log(res)
    }).catch(err => {
        console.log(err)
    })
}
</script>
<template>
@@ -19,19 +50,15 @@
        <div>
            <div class="search-container">
                <input type="text" v-model="searchQuery" placeholder="请输入企业名称" class="search-input"
                    @keyup.enter="handleSearch" />
                <button class="search-button" @click="handleSearch">搜索</button>
                <input type="text" v-model="searchQuery" placeholder="请输入企业名称" class="search-input" />
                <button class="search-button" @click="search">搜索</button>
            </div>
        </div>
        <div>
            <div v-for="item in 5">
                <div class="data-content-item">
                    <div> 测试企业111111</div>
                    <el-button size="small" type="primary">进入企业</el-button>
                </div>
        <div class="data-content-list">
            <div class="data-content-item" v-for="item in parkQy" :key="item.id">
                <div> {{ item.name }}</div>
                <el-button size="small" type="primary">进入园区</el-button>
            </div>
        </div>
    </div>
@@ -49,6 +76,14 @@
    align-items: center;
    justify-content: center;
    margin: 10px 0px;
}
.data-content-list {
    height: 50%;
    overflow: scroll;
    // 隐藏滚动条
    scrollbar-width: none;
    text-indent: 1em;
}
.search-input {
@@ -76,11 +111,12 @@
.data-content-item {
    display: flex;
    margin: 2px 2px;
    margin: 2px 10px;
    padding: 5px 0;
    background-color: #747bff;
    justify-content: space-between;
    // 超过高度自动显示滚动条
    overflow-y: auto;
    border-radius: 5px;
}
</style>