<template> <el-form ref="activityRefForm" :model="activityRemark" label-width="20%" :rules="activityRules"> <el-form-item label="ID"> <div class="detail">{{activityDetail.id}} </div> </el-form-item> <el-form-item label="负责人"> <div class="detail"> {{activityDetail.ownerDO.name}} </div> </el-form-item> <el-form-item label="活动名称"> <div class="detail">{{activityDetail.name}} </div> </el-form-item> <el-form-item label="开始时间"> <div class="detail">{{activityDetail.startDate}} </div> </el-form-item> <el-form-item label="结束时间"> <div class="detail">{{activityDetail.endDate}} </div> </el-form-item> <el-form-item label="活动预算"> <div class="detail">{{activityDetail.cost}} </div> </el-form-item> <el-form-item label="活动描述"> <div class="detail">{{activityDetail.description}} </div> </el-form-item> <el-form-item label="创建时间"> <div class="detail">{{activityDetail.createTime}} </div> </el-form-item> <el-form-item label="创建人"> <div class="detail">{{activityDetail.createByDO.name}} </div> </el-form-item> <el-form-item label="编辑时间"> <div class="detail">{{activityDetail.editTime}} </div> </el-form-item> <el-form-item label="编辑人"> <div class="detail">{{activityDetail.editByDO.name}} </div> </el-form-item> </el-form> </template> <script> import { doGet } from '../http/httpRequest'; import { messageTip } from '../util/util.js'; export default { name : "activityDetail", mounted(){ this.loadActivityDetail(); }, data(){ return { activityRemark : {}, activityRules : {}, activityDetail : { ownerDO : {}, createByDO : {}, editByDO : {} } } }, methods : { loadActivityDetail(){ let id = this.$route.params.id; doGet("/api/activity/"+id,{}).then(resp => { if(resp.data.code === 200){ this.activityDetail = resp.data.data; if(!this.activityDetail.ownerDO){ this.activityDetail.ownerDO = {}; } if(!this.activityDetail.createByDO){ this.activityDetail.createByDO = {}; } if(!this.activityDetail.editByDO){ this.activityDetail.editByDO = {}; } this.activityDetail.id = id; } else{ messageTip("网络错误","error"); } }); } } } </script> <style> </style>
<template>
<el-form ref="activityRefForm" :model="activityRemark" label-width="20%" :rules="activityRules">
<el-form-item label="ID">
<div class="detail">{{activityDetail.id}} </div>
</el-form-item>
<el-form-item label="负责人">
<div class="detail"> {{activityDetail.ownerDO.name}} </div>
</el-form-item>
<el-form-item label="活动名称">
<div class="detail">{{activityDetail.name}} </div>
</el-form-item>
<el-form-item label="开始时间">
<div class="detail">{{activityDetail.startDate}} </div>
</el-form-item>
<el-form-item label="结束时间">
<div class="detail">{{activityDetail.endDate}} </div>
</el-form-item>
<el-form-item label="活动预算">
<div class="detail">{{activityDetail.cost}} </div>
</el-form-item>
<el-form-item label="活动描述">
<div class="detail">{{activityDetail.description}} </div>
</el-form-item>
<el-form-item label="创建时间">
<div class="detail">{{activityDetail.createTime}} </div>
</el-form-item>
<el-form-item label="创建人">
<div class="detail">{{activityDetail.createByDO.name}} </div>
</el-form-item>
<el-form-item label="编辑时间">
<div class="detail">{{activityDetail.editTime}} </div>
</el-form-item>
<el-form-item label="编辑人">
<div class="detail">{{activityDetail.editByDO.name}} </div>
</el-form-item>
</el-form>
</template>
<script>
import { doGet } from '../http/httpRequest';
import { messageTip } from '../util/util.js';
export default {
name : "activityDetail",
mounted(){
this.loadActivityDetail();
},
data(){
return {
activityRemark : {},
activityRules : {},
activityDetail : {
ownerDO : {},
createByDO : {},
editByDO : {}
}
}
},
methods : {
loadActivityDetail(){
let id = this.$route.params.id;
doGet("/api/activity/"+id,{}).then(resp => {
if(resp.data.code === 200){
this.activityDetail = resp.data.data;
if(!this.activityDetail.ownerDO){
this.activityDetail.ownerDO = {};
}
if(!this.activityDetail.createByDO){
this.activityDetail.createByDO = {};
}
if(!this.activityDetail.editByDO){
this.activityDetail.editByDO = {};
}
this.activityDetail.id = id;
}
else{
messageTip("网络错误","error");
}
});
}
}
}
</script>
<style>
</style>
<template> <!-- 渲染前端地址的页面组件 --> <router-view></router-view> </template> <script> export default { name : "App", } </script> <style> .parent{ position:relative; } .el-pagination{ position:absolute; left:50%; transform:translateX(-50%); } .el-pagination{ margin-top: 3%; } .el-table{ margin-top: 3%; } .detail{ background-color: azure; width: 100%; padding-left: 1%; } </style>
<template>
<!-- 渲染前端地址的页面组件 -->
<router-view></router-view>
</template>
<script>
export default {
name : "App",
}
</script>
<style>
.parent{
position:relative;
}
.el-pagination{
position:absolute;
left:50%;
transform:translateX(-50%);
}
.el-pagination{
margin-top: 3%;
}
.el-table{
margin-top: 3%;
}
.detail{
background-color: azure;
width: 100%;
padding-left: 1%;
}
</style>