index.vue.vm
2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
<div class="app-container">
<div class="block">
<el-row>
<el-col :span="24">
<el-button type="success" size="mini" icon="el-icon-plus" @click.native="add">{{ $t('button.add') }}</el-button>
<el-button type="primary" size="mini" icon="el-icon-edit" @click.native="edit">{{ $t('button.edit') }}</el-button>
<el-button type="danger" size="mini" icon="el-icon-delete" @click.native="remove">{{ $t('button.delete') }}</el-button>
</el-col>
</el-row>
</div>
<el-table :data="list" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row
@current-change="handleCurrentChange">
#foreach ($column in $table.LabeledColumns)
<el-table-column label="${column.label}">
<template slot-scope="scope">
{{scope.row.${column.FieldName}}}
</template>
</el-table-column>
#end
</el-table>
<el-pagination
background
layout="total, sizes, prev, pager, next, jumper"
:page-sizes="[10, 20, 50, 100,500]"
:page-size="listQuery.limit"
:total="total"
@size-change="changeSize"
@current-change="fetchPage"
@prev-click="fetchPrev"
@next-click="fetchNext">
</el-pagination>
<el-dialog
:title="formTitle"
:visible.sync="formVisible"
width="70%">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
#foreach ($column in $table.LabeledColumns)
<el-col :span="12">
<el-form-item label="${column.label}" >
<el-input v-model="form.${column.FieldName}" minlength=1></el-input>
</el-form-item>
</el-col>
#end
</el-row>
<el-form-item>
<el-button type="primary" @click="save">{{ $t('button.submit') }}</el-button>
<el-button @click.native="formVisible = false">{{ $t('button.cancel') }}</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script src="./${table.entityNameLowerFirstChar}.js"></script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/common.scss";
</style>