| | |
| | | --> |
| | | <script setup> |
| | | import publicContent from './publicContent.vue' |
| | | // import { ref, reactive } from 'vue' |
| | | import { ref, reactive } from 'vue' |
| | | |
| | | import { getPage } from '../../../../api/indParkInfo' |
| | | |
| | | var parkQy = ref([]) |
| | | let parkQy = ref([]) |
| | | |
| | | var searchQuery = ref('') |
| | | let searchQuery = ref('') |
| | | |
| | | onMounted(() => { |
| | | getPages() |
| | |
| | | |
| | | function getPages() { |
| | | getPage().then(res => { |
| | | parkQy = res.data.data.records |
| | | 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) |
| | |
| | | <div> |
| | | <div class="search-container"> |
| | | <input type="text" v-model="searchQuery" placeholder="请输入企业名称" class="search-input" /> |
| | | <button class="search-button">搜索</button> |
| | | <button class="search-button" @click="search">搜索</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="data-content-list"> |
| | | <div v-for="item in parkQy" :key="item.id"> |
| | | <div class="data-content-item"> |
| | | <div> {{ item.name }}</div> |
| | | <el-button size="small" type="primary">{{ item.categoryName }}</el-button> |
| | | </div> |
| | | |
| | | <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> |
| | |
| | | } |
| | | |
| | | .data-content-list { |
| | | height: auto; |
| | | height: 50%; |
| | | overflow: scroll; |
| | | // 隐藏滚动条 |
| | | scrollbar-width: none; |
| | | text-indent: 1em; |
| | | } |
| | | |
| | | .search-input { |
| | |
| | | |
| | | .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> |