|
|
|
@ -2,16 +2,59 @@
|
|
|
|
|
<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 class="col-12">
|
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="dataTables_wrapper dt-bootstrap4">
|
|
|
|
|
<div class="row" style="padding-bottom:10px;" v-if="hasPermissions()">
|
|
|
|
|
<div class="col-sm-12 col-md-6">
|
|
|
|
|
<button class="btn btn-default" v-if="hasPermission('Add')">新建</button>
|
|
|
|
|
<button class="btn btn-danger" v-if="hasPermission('Delete')">删除</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-sm-12 col-md-6">
|
|
|
|
|
<div style="text-align:right;">
|
|
|
|
|
<a href="javascript:;" class="btn btn-primary" v-if="hasPermission('Read')">查询</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<table class="table table-bordered">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>
|
|
|
|
|
<input type="checkbox" class="select_all" />
|
|
|
|
|
</th>
|
|
|
|
|
<th v-for="(value,key,index) in schema.properties" v-if="key!=='id'">{{value.title}}</th>
|
|
|
|
|
<th v-if="hasPermission('Edit')">编辑</th>
|
|
|
|
|
<th v-if="hasPermission('Delete')">删除</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr v-for="item in data.list">
|
|
|
|
|
<td>
|
|
|
|
|
<input type="checkbox" name="list[]" :value="item.Id" />
|
|
|
|
|
</td>
|
|
|
|
|
<td v-for="(value,key,index) in schema.properties" v-if="key!=='id'">{{item[key]}}</td>
|
|
|
|
|
<td v-if="hasPermission('Edit')">
|
|
|
|
|
<a href="javascript:;" class="btn btn-sm btn-info">编辑</a>
|
|
|
|
|
</td>
|
|
|
|
|
<td v-if="hasPermission('Delete')">
|
|
|
|
|
<a href="javascript:;" class="btn btn-sm btn-danger">删除</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<pagination :nav="load" :index="data.pageIndex" :size="data.pageSize" :total="data.totalCount" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<pagination :nav="load" :index="data.pageIndex" :size="data.pageSize" :total="data.totalCount" />
|
|
|
|
|
</layout>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
@ -20,6 +63,7 @@
|
|
|
|
|
return {
|
|
|
|
|
title: '列表页',
|
|
|
|
|
url: '/IoTCenter/Admin/' + this.$route.query.entity + '/GetEditSchema',
|
|
|
|
|
entity: this.$route.query.entity,
|
|
|
|
|
schema: {},
|
|
|
|
|
data: {
|
|
|
|
|
list: []
|
|
|
|
@ -40,6 +84,13 @@
|
|
|
|
|
vm.data = response.data;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
hasPermission: function (cmd) {
|
|
|
|
|
var permission = cmd + '-' + this.entity;
|
|
|
|
|
return Enumerable.from(store.state.permissions).any(o => o === permission);
|
|
|
|
|
},
|
|
|
|
|
hasPermissions: function () {
|
|
|
|
|
return this.hasPermission('Read') || this.hasPermission('Add') || this.hasPermission('Edit') || this.hasPermission('Delete');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|