Browse Source

生成模板修改

dev_zufangUpdate
zhangyuan 3 years ago
parent
commit
313ffb6270
  1. 6
      epmet-cloud-generator/src/main/resources/application.yml
  2. 72
      epmet-cloud-generator/src/main/resources/template/index.vue.vm

6
epmet-cloud-generator/src/main/resources/application.yml

@ -9,9 +9,9 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置 #MySQL配置
driverClassName: com.mysql.jdbc.Driver driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://rm-bp1l2b53j508j1176xo.mysql.rds.aliyuncs.com:3306/epmet_pli_power?useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://192.168.1.140:3306/epmet_pli_power?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: epmet_pli_power_user
password: Abc@123456 password: EpmEt-db-UsEr
#oracle配置 #oracle配置
# driverClassName: oracle.jdbc.OracleDriver # driverClassName: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@192.168.10.10:1521:helowin # url: jdbc:oracle:thin:@192.168.10.10:1521:helowin

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

@ -1,29 +1,29 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <div class="mod-${moduleName}__${pathName}} resi-container">
<div class="mod-${moduleName}__${pathName}}"> <el-card ref="searchCard" class="search-card">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <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-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button type="primary" size="small" @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-form-item> </el-form-item>
</el-form> </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> <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
#foreach($column in $columns) #foreach($column in $columns)
<el-table-column prop="${column.attrname}" label="${column.comments}" header-align="center" align="center"></el-table-column> <el-table-column prop="${column.attrname}" label="${column.comments}" header-align="center" align="center"></el-table-column>
#end #end
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <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 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="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -36,15 +36,16 @@
@size-change="pageSizeChangeHandle" @size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle">
</el-pagination> </el-pagination>
</el-card>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './${pathName}-add-or-update' import AddOrUpdate from './${pathName}-add-or-update'
import { mapGetters } from 'vuex'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data () {
@ -62,6 +63,45 @@ export default {
}, },
components: { components: {
AddOrUpdate 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> </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