|
|
@@ -0,0 +1,106 @@
|
|
|
+<template>
|
|
|
+ <div class="tab1">
|
|
|
+ <div class="insideTop">资料管理</div>
|
|
|
+ <div class="obstruct"></div>
|
|
|
+ <div class="conten">
|
|
|
+ <!-- <div class="search">
|
|
|
+ <span>村落名称:</span>
|
|
|
+ <el-input
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="name"
|
|
|
+ maxlength="25"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ <el-button type="primary">查询</el-button>
|
|
|
+ <el-button>重置</el-button>
|
|
|
+ </div> -->
|
|
|
+ <div class="table">
|
|
|
+ <el-table :data="tableData" style="width: 100%">
|
|
|
+ <el-table-column label="编号" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="id" label="编号" width="200"></el-table-column> -->
|
|
|
+ <el-table-column prop="name" label="村落名称"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="updateTime"
|
|
|
+ label="最近更新时间"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="$router.push(`/layout/tab1Main/${row.id}/1001`)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { villageList } from '@/apis/tab1'
|
|
|
+export default {
|
|
|
+ name: 'tab1',
|
|
|
+ components: {},
|
|
|
+ data () {
|
|
|
+ // 这里存放数据
|
|
|
+ return {
|
|
|
+ name: '',
|
|
|
+ tableData: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 监听属性 类似于data概念
|
|
|
+ computed: {},
|
|
|
+ // 监控data中的数据变化
|
|
|
+ watch: {},
|
|
|
+ // 方法集合
|
|
|
+ methods: {},
|
|
|
+ // 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ async created () {
|
|
|
+ const res = await villageList()
|
|
|
+ this.tableData = res.data
|
|
|
+ },
|
|
|
+ // 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted () {},
|
|
|
+ beforeCreate () {}, // 生命周期 - 创建之前
|
|
|
+ beforeMount () {}, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate () {}, // 生命周期 - 更新之前
|
|
|
+ updated () {}, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy () {}, // 生命周期 - 销毁之前
|
|
|
+ destroyed () {}, // 生命周期 - 销毁完成
|
|
|
+ activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang='less' scoped>
|
|
|
+.tab1 {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ .conten {
|
|
|
+ padding: 0 20px;
|
|
|
+ .search {
|
|
|
+ height: 70px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border-bottom: 1px solid black;
|
|
|
+ /deep/.el-input {
|
|
|
+ width: 300px;
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+ /deep/.el-input__inner {
|
|
|
+ padding-right: 45px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .table {
|
|
|
+ /deep/.el-table__row .el-table__cell {
|
|
|
+ padding: 3px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|