Browse Source

更改生成模板

master
zhangyuan 3 years ago
parent
commit
8db73367ca
  1. 73
      epmet-cloud-generator/src/main/resources/template/index.vue.vm

73
epmet-cloud-generator/src/main/resources/template/index.vue.vm

@ -1,29 +1,29 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-${moduleName}__${pathName}}">
<div class="mod-${moduleName}__${pathName}} resi-container">
<el-card ref="searchCard" class="search-card">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.${pk.attrname}" placeholder="${pk.attrname}" clearable></el-input>
<el-input size="small" v-model="dataForm.${pk.attrname}" placeholder="${pk.attrname}" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('${moduleName}:${pathName}:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('${moduleName}:${pathName}:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
<el-button type="primary" size="small" @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
</el-card>
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button class="diy-button--add" type="primary" size="small" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<el-button class="diy-button--add" type="danger" size="small" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</div>
<el-table v-loading="dataListLoading" class="resi-table" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%" :height="tableHeight">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
#foreach($column in $columns)
<el-table-column prop="${column.attrname}" label="${column.comments}" header-align="center" align="center"></el-table-column>
#end
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('${moduleName}:${pathName}:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('${moduleName}:${pathName}:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -36,16 +36,16 @@
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
</el-card>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './'
import AddOrUpdate from './${pathName}-add-or-update'
import { mapGetters } from 'vuex'
export default {
mixins: [mixinViewModule],
data () {
@ -56,13 +56,52 @@
deleteURL: '/${moduleName}/${pathName}',
deleteIsBatch: true
},
dataForm: {;
dataForm: {
${pk.attrname}: ''
}
}
},
components: {
AddOrUpdate
},
computed: {
...mapGetters(["clientHeight", "iframeHeight"]),
tableHeight() {
const h = this.clientHeight - 360 + this.iframeHeight;
const _h = this.clientHeight - 360;
return this.$store.state.inIframe ? h : _h;
},
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/buttonstyle.scss";
.resi-container .resi-card-table {
::v-deep .el-table th {
color: #fff;
background-color: rgba(33, 149, 254, 1);
}
}
.resi-table {
::v-deep .el-button--text {
text-decoration: underline;
}
}
.search-card {
.el-card__body {
padding: 20px 20px 0 20px;
}
}
.resi-row-btn {
margin-bottom: 13px;
.upload-btn {
display: inline-block;
margin: 0 10px;
}
}
</style>

Loading…
Cancel
Save