You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/WebMVC/wwwroot/pages/admin/list.html

46 lines
1.6 KiB

<template>
<layout v-bind:title="title">
<h1>{{schema.title}}</h1>
<div class="row">
<table class="table table-bordered table-hover">
<tr>
<th v-for="item in schema.properties">{{item.title}}</th>
</tr>
<tr v-for="item in data.list">
<td v-for="(value,key,index) in schema.properties">{{item[key]}}</td>
</tr>
</table>
</div>
<pagination :nav="load" :index="data.pageIndex" :size="data.pageSize" :total="data.totalCount" />
</layout>
</template>
<script>
export default {
data: function () {
return {
title: '列表页',
url: '/IoTCenter/Admin/' + this.$route.query.entity + '/GetEditSchema',
schema: {},
data: {
list: []
}
}
},
mounted: function () {
this.load(1, 20);
},
methods: {
load: function (index, size) {
var url = config.baseUrl + this.url;
var vm = this;
axios.post(url).then(function (response) {
vm.schema = response.data;
var url = config.baseUrl + '/IoTCenter/Admin/' + vm.$route.query.entity + '/Index?pageIndex=' + index + '&pageSize=' + size;
axios.get(url).then(function (response) {
vm.data = response.data;
});
});
}
}
}
</script>