Commit a8ccbb6e46aed164e1054a98ffabfb5fb15055d2
1 parent
990f4a72
add new page
Showing
3 changed files
with
96 additions
and
17 deletions
src/api/community/index.ts
0 → 100644
| 1 | +import request from '../request' | ||
| 2 | + | ||
| 3 | +// export const getTableList = async ( params: any ) => { | ||
| 4 | +// let res: any = await request.post( '/neighborhood/getList', params, {headers: {'X-Token': '2ebb4ca07a7ac8af47a1c4b182ea124435f4001e'}} ) | ||
| 5 | +// return res | ||
| 6 | +// } | ||
| 7 | +// export const getTableList = async ( params: any ) => { | ||
| 8 | +// let res: any = await request.get( '/neighborhood/getList',{headers: {'X-Token': '2ebb4ca07a7ac8af47a1c4b182ea124435f4001e'}} ) | ||
| 9 | +// return res | ||
| 10 | +// } | ||
| 11 | +export function getTableList(params) { | ||
| 12 | + return request({ | ||
| 13 | + method: 'post', | ||
| 14 | + url: '/neighborhood/getList', | ||
| 15 | + params: params, | ||
| 16 | + headers: {'X-Token': '2ebb4ca07a7ac8af47a1c4b182ea124435f4001e'} | ||
| 17 | + }) | ||
| 18 | +} |
src/style/reset.scss
src/views/community/index.vue
| 1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> |
| 2 | +import { reactive,onMounted } from "vue"; | ||
| 3 | +import { getTableList } from "@/api/community"; | ||
| 4 | +import Pagination from "@/components/Pagination/index.vue"; | ||
| 5 | +// 搜索列表参数 | ||
| 6 | +const form = reactive({ | ||
| 7 | + propertyId: 1, | ||
| 8 | + type:0, | ||
| 9 | + name: null, | ||
| 10 | +}); | ||
| 11 | + | ||
| 12 | +// 表格 | ||
| 13 | +const tableList = [ | ||
| 14 | + { | ||
| 15 | + propertyId: 1, | ||
| 16 | + name: null, | ||
| 17 | + }, | ||
| 18 | + { | ||
| 19 | + propertyId: 1, | ||
| 20 | + name: null, | ||
| 21 | + }, | ||
| 22 | +]; | ||
| 23 | +/** | ||
| 24 | + * 列表查询 | ||
| 25 | + */ | ||
| 26 | +const search = () => { | ||
| 27 | + getTableList(form) | ||
| 28 | + .then((res) => { | ||
| 29 | + console.log(res); | ||
| 30 | + }) | ||
| 31 | + .catch((err) => { | ||
| 32 | + console.log(err); | ||
| 33 | + }); | ||
| 34 | +}; | ||
| 35 | +onMounted(()=>{ | ||
| 36 | + search() | ||
| 37 | +// console.log() | ||
| 38 | +}) | ||
| 2 | </script> | 39 | </script> |
| 3 | <template> | 40 | <template> |
| 4 | -<div class="app-container"> | ||
| 5 | -<p>啦啦啦</p> | ||
| 6 | -<!-- <el-form> | ||
| 7 | -<el-button type="primary">查询</el-button> | ||
| 8 | - | ||
| 9 | -</el-form> --> | ||
| 10 | - | ||
| 11 | -</div> | 41 | + <div class="app-container"> |
| 42 | + <el-form :inline="true" :model="form"> | ||
| 43 | + <el-form-item> | ||
| 44 | + <el-input placeholder="请输入社区名称" v-model="form.name"></el-input> | ||
| 45 | + </el-form-item> | ||
| 46 | + <el-form-item | ||
| 47 | + ><el-button type="primary" @click="search" | ||
| 48 | + >查询</el-button | ||
| 49 | + ></el-form-item | ||
| 50 | + > | ||
| 51 | + <el-row> | ||
| 52 | + <el-form-item> | ||
| 53 | + <el-button type="primary">导入</el-button> | ||
| 54 | + <el-button type="primary">导出</el-button> | ||
| 55 | + <el-button type="primary">新增</el-button> | ||
| 56 | + </el-form-item> | ||
| 57 | + </el-row> | ||
| 58 | + </el-form> | ||
| 59 | + <el-table border :data="tableList"> | ||
| 60 | + <el-table-column label="小区名称"></el-table-column> | ||
| 61 | + <el-table-column label="楼座数"></el-table-column> | ||
| 62 | + <el-table-column label="储藏室数"></el-table-column> | ||
| 63 | + <el-table-column label="车位数"></el-table-column> | ||
| 64 | + <el-table-column label="所在地区"></el-table-column> | ||
| 65 | + <el-table-column label="详细地址"></el-table-column> | ||
| 66 | + <el-table-column label="操作"> | ||
| 67 | + <template #default> | ||
| 68 | + <el-button type="text" size="mini">编辑</el-button> | ||
| 69 | + <el-button type="text" size="mini">删除</el-button> | ||
| 70 | + <el-button type="text" size="mini">楼宇管理</el-button> | ||
| 71 | + </template> | ||
| 72 | + </el-table-column> | ||
| 73 | + </el-table> | ||
| 74 | + <!-- <Pagination | ||
| 75 | + | ||
| 76 | + ></Pagination> --> | ||
| 77 | + </div> | ||
| 12 | </template> | 78 | </template> |
| 13 | 79 | ||
| 14 | -<style> | ||
| 15 | - | ||
| 16 | -.app-container { | ||
| 17 | - padding: 30px; | ||
| 18 | - border: 1px solid #000 | ||
| 19 | -} | ||
| 20 | - | ||
| 21 | - | ||
| 22 | -</style> | ||
| 23 | \ No newline at end of file | 80 | \ No newline at end of file |
| 81 | +<style></style> |