|
|
@@ -1,5 +1,57 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <h1>地址列表</h1>
|
|
|
+ <div class="address-list">
|
|
|
+ <el-table :data="tableData" style="width: 100%">
|
|
|
+ <el-table-column type="index" label="序号" width="200">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="addressid" label="地址ID">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="addressname" label="地址名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="longitude" label="地址经度">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="latitude" label="地址纬度">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
|
|
+ <!-- <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button> -->
|
|
|
+ <el-popconfirm title="确定删除吗?" @onConfirm="deleteConfirm(scope.row)" confirm-button-text="确定删除">
|
|
|
+ <el-button slot="reference" size="mini" type="danger">删除</el-button>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
-</template>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+// 引入地址列表接口方法
|
|
|
+import { getAddressList } from '@/api/address'
|
|
|
+export default {
|
|
|
+ name: 'AddressList',
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ tableData:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // 调用地址列表接口方法
|
|
|
+ this.getAddress()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 获取地址列表
|
|
|
+ getAddress() {
|
|
|
+ // 调用地址列表接口方法
|
|
|
+ getAddressList().then(res => {
|
|
|
+ console.log(res);
|
|
|
+ let newData = res.data.records;
|
|
|
+ this.tableData = newData;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.address-list{
|
|
|
+ padding:20px;
|
|
|
+}
|
|
|
+</style>
|