77bb57a2
YunaiV
开始制作 vue 页面的模板
|
1
2
|
<template>
<div class="app-container">
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
3
4
|
<!-- 搜索工作栏 -->
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
5
6
7
8
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
#foreach($column in $columns)
#if ($column.listOperation)
#set ($dictType=$column.dictType)
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
9
|
#set ($javaField = $column.javaField)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
10
11
|
#set ($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#set ($comment=$column.columnComment)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
12
|
#if ($column.htmlType == "input")
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
13
14
|
<el-form-item label="${comment}" prop="${javaField}">
<el-input v-model="queryParams.${javaField}" placeholder="请输入${comment}" clearable size="small" @keyup.enter.native="handleQuery"/>
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
15
16
|
</el-form-item>
#elseif ($column.htmlType == "select" || $column.htmlType == "radio")
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
17
18
19
|
<el-form-item label="${comment}" prop="${javaField}">
<el-select v-model="queryParams.${javaField}" placeholder="请选择${comment}" clearable size="small">
#if ("" != $dictType)## 设置了 dictType 数据字典的情况
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
20
|
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.$dictType.toUpperCase())"
|
0c8f92fa
YunaiV
基本完成代码生成器
|
21
|
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
22
|
#else## 未设置 dictType 数据字典的情况
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
23
24
25
26
27
|
<el-option label="请选择字典生成" value="" />
#end
</el-select>
</el-form-item>
#elseif($column.htmlType == "datetime")
|
0c8f92fa
YunaiV
基本完成代码生成器
|
28
|
#if ($column.listOperationCondition != "BETWEEN")## 非范围
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
29
30
|
<el-form-item label="${comment}" prop="${javaField}">
<el-date-picker clearable size="small" v-model="queryParams.${javaField}" type="date" value-format="yyyy-MM-dd" placeholder="选择${comment}" />
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
31
|
</el-form-item>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
32
|
#else## 范围
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<el-form-item label="${comment}">
<el-date-picker v-model="dateRange${AttrName}" size="small" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
#end
#end
#end
#end
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
47
|
<!-- 操作工具栏 -->
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
48
49
50
|
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
51
|
v-hasPermi="['${permissionPrefix}:create']">新增</el-button>
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
52
53
54
|
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
55
|
v-hasPermi="['${permissionPrefix}:export']">导出</el-button>
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
56
57
58
59
|
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
60
|
<!-- 列表 -->
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
61
|
<el-table v-loading="loading" :data="list">
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
62
|
#foreach($column in $columns)
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
63
|
#if ($column.listOperationResult)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
64
|
#set ($dictType=$column.dictType)
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
65
|
#set ($javaField = $column.javaField)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
66
67
|
#set ($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#set ($comment=$column.columnComment)
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
68
|
#if ($column.javaType == "Date")## 时间类型
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
69
70
71
72
73
|
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
74
75
76
|
#elseif("" != $column.dictType)## 数据字典
<el-table-column label="${comment}" align="center" prop="${javaField}">
<template slot-scope="scope">
|
0c8f92fa
YunaiV
基本完成代码生成器
|
77
|
<span>{{ getDictDataLabel(DICT_TYPE.$dictType.toUpperCase(), scope.row.${column.javaField}) }}</span>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
78
79
80
|
</template>
</el-table-column>>
#else
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
81
82
83
|
<el-table-column label="${comment}" align="center" prop="${javaField}" />
#end
#end
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
84
|
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
85
86
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
87
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
88
|
v-hasPermi="['${permissionPrefix}:update']">修改</el-button>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
89
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
90
|
v-hasPermi="['${permissionPrefix}:delete']">删除</el-button>
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
91
92
93
|
</template>
</el-table-column>
</el-table>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
94
95
96
|
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
97
|
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
98
|
<!-- 对话框(添加 / 修改) -->
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
99
100
101
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
#foreach($column in $columns)
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
102
103
104
105
106
|
#if ($column.createOperation || $column.updateOperation)
#set ($dictType = $column.dictType)
#set ($javaField = $column.javaField)
#set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#set ($comment = $column.columnComment)
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
107
108
109
110
|
#if ($column.htmlType == "input")
#if (!$column.primaryKey)## 忽略主键,不用在表单里
<el-form-item label="${comment}" prop="${javaField}">
<el-input v-model="form.${javaField}" placeholder="请输入${comment}" />
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
111
|
</el-form-item>
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
112
|
#end
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
113
|
#elseif($column.htmlType == "imageUpload")## 图片上传
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
114
|
#set ($hasImageUploadColumn = true)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
115
|
<el-form-item label="${comment}">
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
116
|
<imageUpload v-model="form.${javaField}"/>
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
117
|
</el-form-item>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
118
|
#elseif($column.htmlType == "fileUpload")## 文件上传
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
119
|
#set ($hasFileUploadColumn = true)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
120
|
<el-form-item label="${comment}">
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
121
|
<fileUpload v-model="form.${javaField}"/>
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
122
|
</el-form-item>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
123
|
#elseif($column.htmlType == "editor")## 文本编辑器
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
124
|
#set ($hasEditorColumn = true)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
125
|
<el-form-item label="${comment}">
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
126
|
<editor v-model="form.${javaField}" :min-height="192"/>
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
127
|
</el-form-item>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
128
|
#elseif($column.htmlType == "select")## 下拉框
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
129
130
|
<el-form-item label="${comment}" prop="${javaField}">
<el-select v-model="form.${javaField}" placeholder="请选择${comment}">
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
131
132
133
134
|
#if ("" != $dictType)## 有数据字典
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.$dictType.toUpperCase())"
:key="dict.value" :label="dict.label" #if ($column.javaType == "Integer" || $column.javaType == "Long"):value="parseInt(dict.value)"#else:value="dict.value"#end />
#else##没数据字典
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
135
|
<el-option label="请选择字典生成" value="" />
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
136
|
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
137
138
|
</el-select>
</el-form-item>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
139
|
#elseif($column.htmlType == "checkbox")## 多选框
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
140
|
<el-form-item label="${comment}">
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
141
|
<el-checkbox-group v-model="form.${javaField}">
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
142
143
144
145
|
#if ("" != $dictType)## 有数据字典
<el-checkbox v-for="dict in this.getDictDatas(DICT_TYPE.$dictType.toUpperCase())"
:key="dict.value" #if($column.javaType == "Integer" || $column.javaType == "Long"):label="parseInt(dict.value)"#else:label="dict.value"#end>{{dict.label}}</el-checkbox>
#else##没数据字典
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
146
|
<el-checkbox>请选择字典生成</el-checkbox>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
147
|
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
148
149
|
</el-checkbox-group>
</el-form-item>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
150
|
#elseif($column.htmlType == "radio")## 单选框
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
151
|
<el-form-item label="${comment}">
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
152
|
<el-radio-group v-model="form.${javaField}">
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
153
154
155
156
|
#if ("" != $dictType)## 有数据字典
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.$dictType.toUpperCase())"
:key="dict.value" #if($column.javaType == "Integer" || $column.javaType == "Long"):label="parseInt(dict.value)"#else:label="dict.value"#end>{{dict.label}}</el-radio>
#else##没数据字典
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
157
|
<el-radio label="1">请选择字典生成</el-radio>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
158
|
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
159
160
|
</el-radio-group>
</el-form-item>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
161
|
#elseif($column.htmlType == "datetime")## 时间框
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
162
|
<el-form-item label="${comment}" prop="${javaField}">
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
163
|
<el-date-picker clearable size="small" v-model="form.${javaField}" type="date" value-format="yyyy-MM-dd" placeholder="选择${comment}" />
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
164
|
</el-form-item>
|
ab09b7c6
YunaiV
完成 vue 的添加/修改表单部分的模板
|
165
|
#elseif($column.htmlType == "textarea")## 文本框
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
166
167
|
<el-form-item label="${comment}" prop="${javaField}">
<el-input v-model="form.${javaField}" type="textarea" placeholder="请输入内容" />
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
168
169
170
171
|
</el-form-item>
#end
#end
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
172
173
174
175
176
177
178
179
180
181
|
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
182
183
|
import { create${simpleClassName}, update${simpleClassName}, delete${simpleClassName}, get${simpleClassName}, get${simpleClassName}Page, export${simpleClassName}Excel } from "@/api/${table.moduleName}/${classNameVar}";
#if ($hasImageUploadColumn)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
184
|
import ImageUpload from '@/components/ImageUpload';
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
185
|
#end
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
186
|
#if ($hasFileUploadColumn)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
187
|
import FileUpload from '@/components/FileUpload';
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
188
|
#end
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
189
|
#if ($hasEditorColumn)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
190
|
import Editor from '@/components/Editor';
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
191
192
193
|
#end
export default {
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
194
|
name: "${simpleClassName}",
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
195
|
components: {
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
196
|
#if ($hasImageUploadColumn)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
197
|
ImageUpload,
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
198
|
#end
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
199
|
#if ($hasFileUploadColumn)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
200
|
FileUpload,
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
201
|
#end
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
202
|
#if ($hasEditorColumn)
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
203
|
Editor,
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
204
205
206
207
208
209
|
#end
},
data() {
return {
// 遮罩层
loading: true,
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
210
211
212
213
|
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
214
|
// ${table.classComment}列表
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
215
|
list: [],
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
216
217
218
219
|
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
220
|
#foreach ($column in $columns)## 时间范围
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
221
|
#if ($column.listOperation)
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
222
223
|
#if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN")
#set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
224
|
dateRange${AttrName}: [],
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
225
226
|
#end
#end
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
227
|
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
228
229
|
// 查询参数
queryParams: {
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
230
|
pageNo: 1,
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
231
|
pageSize: 10,
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
232
233
234
235
236
|
#foreach ($column in $columns)
#if ($column.listOperation && $column.listOperationCondition != 'BETWEEN')
$column.javaField: null,
#end
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
237
238
239
240
241
|
},
// 表单参数
form: {},
// 表单校验
rules: {
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
242
243
244
245
246
247
|
#foreach ($column in $columns)
#if (($column.createOperation || $column.updateOperation) && !$column.nullable && !${column.primaryKey})## 创建或者更新操作 && 要求非空 && 非主键
#set($comment=$column.columnComment)
$column.javaField: [{ required: true, message: "${comment}不能为空", trigger: #if($column.htmlType == "select")"change"#else"blur"#end }],
#end
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
248
249
250
251
252
|
}
};
},
created() {
this.getList();
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
253
254
|
},
methods: {
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
255
|
/** 查询列表 */
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
256
257
|
getList() {
this.loading = true;
|
0c8f92fa
YunaiV
基本完成代码生成器
|
258
|
// 处理查询参数
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
259
260
|
let params = {...this.queryParams};
#foreach ($column in $columns)
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
261
|
#if ($column.listOperation)
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
262
263
|
#if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN")
#set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
0c8f92fa
YunaiV
基本完成代码生成器
|
264
|
this.addBeginAndEndTime(params, this.dateRange${AttrName}, '${column.javaField}');
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
265
266
|
#end
#end
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
267
|
#end
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
268
269
270
271
|
// 执行查询
get${simpleClassName}Page(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
272
273
274
|
this.loading = false;
});
},
|
2f66829a
YunaiV
完成代码生成器~
|
275
|
/** 取消按钮 */
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
276
277
278
279
|
cancel() {
this.open = false;
this.reset();
},
|
2f66829a
YunaiV
完成代码生成器~
|
280
|
/** 表单重置 */
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
281
282
|
reset() {
this.form = {
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
283
|
#foreach ($column in $columns)
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
284
285
|
#if ($column.createOperation || $column.updateOperation)
#if ($column.htmlType == "checkbox")
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
286
287
|
$column.javaField: [],
#else
|
0c8f92fa
YunaiV
基本完成代码生成器
|
288
|
$column.javaField: undefined,
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
289
290
|
#end
#end
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
291
|
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
292
|
};
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
293
294
295
296
|
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
|
802e80f6
YunaiV
完成 vue 搜索、列表部分
|
297
|
this.queryParams.pageNo = 1;
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
298
299
300
301
|
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
302
|
#foreach ($column in $columns)
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
303
|
#if ($column.listOperation)
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
304
305
|
#if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN")
#set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
306
|
this.dateRange${AttrName} = [];
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
307
308
|
#end
#end
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
309
|
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
310
311
312
|
this.resetForm("queryForm");
this.handleQuery();
},
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
313
314
315
316
|
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
317
|
this.title = "添加${table.classComment}";
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
318
319
320
321
|
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
322
323
|
const ${primaryColumn.javaField} = row.${primaryColumn.javaField};
get${simpleClassName}(${primaryColumn.javaField}).then(response => {
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
324
|
this.form = response.data;
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
325
326
|
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")## checkbox 特殊处理
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
327
|
this.form.$column.javaField = this.form.${column.javaField}.split(",");
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
328
329
|
#end
#end
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
330
|
this.open = true;
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
331
|
this.title = "修改${table.classComment}";
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
332
333
334
335
336
|
});
},
/** 提交按钮 */
submitForm() {
this.#[[$]]#refs["form"].validate(valid => {
|
0c8f92fa
YunaiV
基本完成代码生成器
|
337
|
if (!valid) {
|
0b25eb1c
YunaiV
继续完善 index.vue.vm...
|
338
339
|
return;
}
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
340
341
342
343
344
345
346
347
348
349
350
351
352
|
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
this.form.$column.javaField = this.form.${column.javaField}.join(",");
#end
#end
// 修改的提交
if (this.form.${primaryColumn.javaField} != null) {
update${simpleClassName}(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
353
|
}
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
354
355
356
357
358
359
|
// 添加的提交
create${simpleClassName}(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
360
361
362
363
|
});
},
/** 删除按钮操作 */
handleDelete(row) {
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
364
|
const ${primaryColumn.javaField} = row.${primaryColumn.javaField};
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
365
|
this.$confirm('是否确认删除${table.classComment}编号为"' + ${primaryColumn.javaField} + '"的数据项?', "警告", {
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
366
367
368
369
|
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
370
|
return delete${simpleClassName}(${primaryColumn.javaField});
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
371
372
373
374
375
|
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
376
377
|
/** 导出按钮操作 */
handleExport() {
|
0c8f92fa
YunaiV
基本完成代码生成器
|
378
379
380
381
382
|
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
#foreach ($column in $columns)
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
383
|
#if ($column.listOperation)
|
0c8f92fa
YunaiV
基本完成代码生成器
|
384
385
386
387
388
|
#if ($column.htmlType == "datetime" && $column.listOperationCondition == "BETWEEN")
#set ($AttrName = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
this.addBeginAndEndTime(params, this.dateRange${AttrName}, '${column.javaField}');
#end
#end
|
bc1504d9
YunaiV
1. 完成 Job 的新增和修改
|
389
|
#end
|
0c8f92fa
YunaiV
基本完成代码生成器
|
390
|
// 执行导出
|
937c51f4
YunaiV
完成代码生成器的 sql 生成
|
391
|
this.$confirm('是否确认导出所有${table.classComment}数据项?', "警告", {
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
392
393
394
395
|
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
|
0c8f92fa
YunaiV
基本完成代码生成器
|
396
|
return export${simpleClassName}Excel(params);
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
397
|
}).then(response => {
|
b8351f50
YunaiV
基本完成 index.vue.vm 模板
|
398
|
this.downloadExcel(response, '${table.classComment}.xls');
|
77bb57a2
YunaiV
开始制作 vue 页面的模板
|
399
400
401
402
403
|
})
}
}
};
</script>
|