模板文件

dongdingding
许宏杰 2 years ago
parent e22a92c89e
commit fb230db903

@ -1,5 +1,6 @@
<template> <template>
<div class="app-container"> <div class="container-main" ref="main">
<div class="search-hearder" ref="topSearch">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="auto"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="auto">
#foreach($column in $columns) #foreach($column in $columns)
#if($column.query) #if($column.query)
@ -68,55 +69,39 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div>
<el-row :gutter="10" class="mb8"> <div class="layui-table-tool" ref="tableTool">
<el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain
icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd()"
v-hasPermi="['${moduleName}:${businessName}:add']" v-hasPermi="['${moduleName}:${businessName}:add']"
>新增</el-button> >新增</el-button
</el-col> >
<el-col :span="1.5">
<el-button <el-button
type="success" type="success"
plain
icon="el-icon-edit"
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['${moduleName}:${businessName}:edit']" v-hasPermi="['${moduleName}:${businessName}:edit']"
>修改</el-button> >修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
plain
icon="el-icon-delete"
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['${moduleName}:${businessName}:remove']" v-hasPermi="['${moduleName}:${businessName}:remove']"
>删除</el-button> >删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain
icon="el-icon-download"
size="mini" size="mini"
:loading="exportLoading" :loading="exportLoading"
@click="handleExport" @click="handleExport"
v-hasPermi="['${moduleName}:${businessName}:export']" v-hasPermi="['${moduleName}:${businessName}:export']"
>导出</el-button> >导出</el-button
</el-col> >
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </div>
</el-row> <el-table v-loading="loading" :data="${businessName}List" :height="tableHeigth" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
#foreach($column in $columns) #foreach($column in $columns)
#set($javaField=$column.javaField) #set($javaField=$column.javaField)
@ -148,24 +133,20 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text"
icon="el-icon-view"
@click="handleInfo(scope.row)" @click="handleInfo(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:list']" v-hasPermi="['${moduleName}:${businessName}:list']"
> >
查看 查看
</el-button> </el-button>
<el-button <el-button
type="primary"
size="mini" size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:edit']" v-hasPermi="['${moduleName}:${businessName}:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:remove']" v-hasPermi="['${moduleName}:${businessName}:remove']"
>删除</el-button> >删除</el-button>
@ -182,7 +163,8 @@
/> />
<!-- 添加或修改${functionName}对话框 --> <!-- 添加或修改${functionName}对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :visible.sync="open" width="500px" append-to-body custom-class="dialog-box">
<div slot="title" class="dialog-title">{{ title }}</div>
<el-form ref="form" :model="form" :rules="rules" label-width="auto"> <el-form ref="form" :model="form" :rules="rules" label-width="auto">
#foreach($column in $columns) #foreach($column in $columns)
#set($field=$column.javaField) #set($field=$column.javaField)
@ -320,16 +302,16 @@
</el-dialog> </el-dialog>
<!--查看${functionName}详情页--> <!--查看${functionName}详情页-->
<el-dialog <el-dialog
:title="infoTitle"
:visible.sync="infoOpen" :visible.sync="infoOpen"
width="90%" width="90%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
:destroy-on-close="true" :destroy-on-close="true"
custom-class="dialog-box"
> >
<div class="info_box"> <div slot="title" class="dialog-title">{{ infoTitle }}</div>
<el-descriptions title="${functionName}" :column="2" border> <el-descriptions title="${functionName}" :column="2" border labelClassName="desLable">
#foreach($column in $columns) #foreach($column in $columns)
#set($field=$column.javaField) #set($field=$column.javaField)
#if($column.insert && !$column.pk) #if($column.insert && !$column.pk)
@ -347,14 +329,18 @@
#end #end
#end #end
</el-descriptions> </el-descriptions>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}"; import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
export default { export default {
computed: {
...mapGetters(["townList"]),
},
name: "${BusinessName}", name: "${BusinessName}",
//注释字典 //注释字典
#if(${dicts} != '') #if(${dicts} != '')
@ -362,6 +348,7 @@
#end #end
data() { data() {
return { return {
tableHeigth: 0,
//查看详情 //查看详情
infoOpen:false, infoOpen:false,
//详情标题 //详情标题
@ -434,7 +421,15 @@
}; };
}, },
created() { created() {
// //给表格一个固定值
this.$nextTick(() => {
this.tableHeigth =
this.$refs.main.offsetHeight -
(this.$refs.topSearch.offsetHeight +
this.$refs.tableTool.offsetHeight) -
46;
this.getList(); this.getList();
});
}, },
methods: { methods: {
/** 查询${functionName}列表 */ /** 查询${functionName}列表 */
@ -565,13 +560,13 @@
#end #end
if (this.form.${pkColumn.javaField} != null) { if (this.form.${pkColumn.javaField} != null) {
update${BusinessName}(this.form).then(response => { update${BusinessName}(this.form).then(response => {
this.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
add${BusinessName}(this.form).then(response => { add${BusinessName}(this.form).then(response => {
this.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });

Loading…
Cancel
Save