优化代码生成模板
This commit is contained in:
@@ -15,7 +15,7 @@ namespace {DtosNamespace}.Dto
|
||||
|
||||
public class {ModelTypeName}QueryDto: PagerInfo
|
||||
{
|
||||
|
||||
|
||||
public DateTime? BeginTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +1,31 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="24">
|
||||
<!-- :model属性用于表单验证使用 比如下面的el-form-item 的 prop属性用于对表单值进行验证操作 -->
|
||||
<el-form :model="queryParams" label-position="left" inline ref="queryForm" :label-width="labelWidth" v-show="showSearch" @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="文本文字">
|
||||
<el-input v-model="queryParams.xxx" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="数字">
|
||||
<el-input v-model.number="queryParams.xxx" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="下拉框">
|
||||
<el-select v-model="queryParams.xxx" placeholder="">
|
||||
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="时间范围">
|
||||
<el-date-picker size="small" style="width: 240px" v-model="timeRange" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" style="text-align:center;">
|
||||
<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-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-form :model="queryParams" label-position="left" inline ref="queryForm" :label-width="labelWidth" v-show="showSearch" @submit.native.prevent>
|
||||
<el-form-item label="文本文字">
|
||||
<el-input v-model="queryParams.xxx" placeholder="" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数字">
|
||||
<el-input v-model.number="queryParams.xxx" placeholder="" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="下拉框">
|
||||
<el-select v-model="queryParams.xxx" placeholder="">
|
||||
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="时间范围">
|
||||
<el-date-picker size="small" style="width: 240px" v-model="timeRange" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-row class="mb8" style="text-align:center">
|
||||
<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-row>
|
||||
</el-form>
|
||||
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
@@ -60,16 +53,16 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
<el-pagination class="mt10" background :total="total" :current-page.sync="queryParams.pageNum" :page-size="queryParams.pageSize" :page-sizes="[20, 30, 50, 100]" @size-change="handleSizeChange" @current-change="getList" />
|
||||
|
||||
<!-- 添加或修改菜单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-dialog :title="title" :lock-scroll="false" :visible.sync="open" >
|
||||
<el-form ref="form" :model="form" :rules="rules" :label-width="formLabelWidth">
|
||||
{VueViewFormContent}
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="btnSubmitVisible">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@@ -89,6 +82,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
labelWidth: "100px",
|
||||
formLabelWidth:"100px",
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
@@ -161,6 +155,7 @@ export default {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
//TODO 重置字段
|
||||
};
|
||||
},
|
||||
@@ -170,6 +165,12 @@ export default {
|
||||
this.single = selection.length!=1
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 选择每页显示数量*/
|
||||
handleSizeChange(val) {
|
||||
this.queryParams.pageSize = val;
|
||||
this.queryParams.pageNum = 1;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.getList();
|
||||
@@ -179,8 +180,6 @@ export default {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加";
|
||||
|
||||
//TODO 业务代码
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
@@ -201,6 +200,9 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
beforeFileUpload(file) { },
|
||||
//文件上传成功方法
|
||||
{vueJsMethod}
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
@@ -230,4 +232,14 @@ export default {
|
||||
.table-td-thumb {
|
||||
width: 80px;
|
||||
}
|
||||
.icon {
|
||||
width: 100px;
|
||||
}
|
||||
.uploader-icon {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
border: 1px dashed #ccc;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user