Home页添加过渡动画
parent
129a0ff9e5
commit
055a2cc7d0
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<router-view></router-view>
|
<router-view style="width: 100%;max-height: 100%;overflow: hidden"></router-view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
|
|
|
@ -0,0 +1,115 @@
|
||||||
|
<template>
|
||||||
|
<div id="TendencyChart" style="width: 100%;height: 100%;"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from 'echarts'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TendencyChart",
|
||||||
|
props: {
|
||||||
|
// 是否要上角图例
|
||||||
|
isLegend: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 是否为满圆
|
||||||
|
isRadius: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 数据列表
|
||||||
|
dataList: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
myChart: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initEcharts();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
getTotalNumber() {
|
||||||
|
let total = this.dataList.reduce((prev, item) => {
|
||||||
|
prev += item.value
|
||||||
|
return prev
|
||||||
|
}, 0)
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取配置
|
||||||
|
getOption() {
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
let option = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '统计',
|
||||||
|
type: 'pie',
|
||||||
|
center: ['45%', '55%'],
|
||||||
|
// radius: ['40%', '70%'],
|
||||||
|
avoidLabelOverlap: false,
|
||||||
|
label: {
|
||||||
|
show: false,
|
||||||
|
position: 'center'
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
fontSize: '40',
|
||||||
|
fontWeight: 'bold'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
data: this.dataList
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
if (this.isLegend) {
|
||||||
|
option.legend = {
|
||||||
|
type: 'scroll',
|
||||||
|
orient: 'vertical',
|
||||||
|
right: 10,
|
||||||
|
top: 20,
|
||||||
|
bottom: 20,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
option.series[0].radius = this.isRadius ? '80%' : ['50%', '80%'];
|
||||||
|
return option;
|
||||||
|
},
|
||||||
|
// 初始化图表
|
||||||
|
initEcharts() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.myChart = echarts.init(document.getElementById(this.id));
|
||||||
|
// 使用刚指定的配置项和数据显示图表。
|
||||||
|
this.myChart.setOption(this.getOption());
|
||||||
|
});
|
||||||
|
let that = this;
|
||||||
|
window.addEventListener('resize', function () {
|
||||||
|
console.log("addEventListener");
|
||||||
|
// 让我们的图表调用 resize这个方法
|
||||||
|
//that.$nextTick(()=>{
|
||||||
|
that.myChart.resize();
|
||||||
|
//});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 更新图表
|
||||||
|
updateEcharts() {
|
||||||
|
this.myChart.setOption(this.getOption(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
|
@ -60,9 +60,9 @@ const tableHeight = ref();
|
||||||
const {proxy, ctx} = getCurrentInstance()
|
const {proxy, ctx} = getCurrentInstance()
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 设置表格初始高度为innerHeight-offsetTop-表格底部与浏览器底部距离110
|
// 设置表格初始高度为innerHeight-offsetTop-表格底部与浏览器底部距离110
|
||||||
tableHeight.value = window.innerHeight - tableRef.value.$el.offsetTop - 110;
|
tableHeight.value = window.innerHeight /*- tableRef.value.$el.offsetTop*/ - 400;
|
||||||
window.onresize = () => {
|
window.onresize = () => {
|
||||||
tableHeight.value = window.innerHeight - tableRef.value.$el.offsetTop - 110;
|
tableHeight.value = window.innerHeight /*- tableRef.value.$el.offsetTop*/ - 400;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
|
@ -49,8 +49,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main style="overflow: unset">
|
<el-main style="overflow: hidden;">
|
||||||
<router-view></router-view>
|
<router-view v-slot="{ Component }">
|
||||||
|
<transition name="slide-right" mode="out-in">
|
||||||
|
<component :is="Component" />
|
||||||
|
</transition>
|
||||||
|
</router-view>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
@ -187,4 +191,30 @@ export default {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slide-left-enter-active,
|
||||||
|
.slide-left-leave-active,
|
||||||
|
.slide-right-enter-active,
|
||||||
|
.slide-right-leave-active {
|
||||||
|
will-change: transform;
|
||||||
|
transition: all 500ms cubic-bezier(.55,0,.1,1);
|
||||||
|
backface-visibility: hidden;
|
||||||
|
}
|
||||||
|
.slide-right-enter-from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translate3d(0, -100%, 0);
|
||||||
|
}
|
||||||
|
.slide-right-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translate3d(0, 30%, 0);
|
||||||
|
}
|
||||||
|
.slide-left-enter-from{
|
||||||
|
opacity: 0;
|
||||||
|
transform: translate3d(0, 100%, 0);
|
||||||
|
}
|
||||||
|
.slide-left-leave-to{
|
||||||
|
opacity: 0;
|
||||||
|
transform: translate3d(0, -30%, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -55,9 +55,10 @@
|
||||||
style="float: right;margin-top: 20px;">
|
style="float: right;margin-top: 20px;">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<CreateProjectDialog v-model:dialogFormVisible="dialogFormVisible" :projectClasses="projectClasses"
|
<CreateProjectDialog v-model:dialogFormVisible="dialogFormVisible" :projectClasses="projectClasses"
|
||||||
:projectSubClasses="projectSubClasses" @created="getProjects"></CreateProjectDialog>
|
:projectSubClasses="projectSubClasses" @created="getProjects"></CreateProjectDialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -73,9 +74,9 @@ const tableHeight = ref();
|
||||||
const {proxy, ctx} = getCurrentInstance()
|
const {proxy, ctx} = getCurrentInstance()
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 设置表格初始高度为innerHeight-offsetTop-表格底部与浏览器底部距离110
|
// 设置表格初始高度为innerHeight-offsetTop-表格底部与浏览器底部距离110
|
||||||
tableHeight.value = window.innerHeight - tableRef.value.$el.offsetTop - 110;
|
tableHeight.value = window.innerHeight /*- tableRef.value.$el.offsetTop*/ - 400;
|
||||||
window.onresize = () => {
|
window.onresize = () => {
|
||||||
tableHeight.value = window.innerHeight - tableRef.value.$el.offsetTop - 110;
|
tableHeight.value = window.innerHeight /*- tableRef.value.$el.offsetTop*/ - 400;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 1;margin-left: 30px;display: flex;flex-direction: column">
|
<div style="flex: 1;margin-left: 30px;display: flex;flex-direction: column">
|
||||||
<p class="p-title" style="margin-left: 10px">公告</p>
|
<p class="p-title" style="margin-left: 10px">公告</p>
|
||||||
<div style="flex:1;margin-top: 30px;padding: 20px;
|
<div style="flex:1;margin-top: 34px;padding: 20px;
|
||||||
display: flex;flex-direction: column; justify-content: space-between;background-color: white; border-radius: 10px;">
|
display: flex;flex-direction: column; justify-content: space-between;background-color: white; border-radius: 10px;">
|
||||||
<p>{{ project.projectDescription }}</p>
|
<p>{{ project.projectDescription }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -157,54 +157,11 @@
|
||||||
|
|
||||||
<div style="height: 300px;margin: 0 30px 30px 30px;
|
<div style="height: 300px;margin: 0 30px 30px 30px;
|
||||||
display: flex;flex-direction: row;justify-content: space-between">
|
display: flex;flex-direction: row;justify-content: space-between">
|
||||||
<div style="width: 32%; height: 100%;display: flex;flex-direction: column">
|
<div style="flex: 1;height: 100%;display: flex;flex-direction: column">
|
||||||
<p class="p-title" style="margin-left: 10px">工作项完成趋势</p>
|
|
||||||
<div style="flex:1;margin-top: 30px;padding: 20px;
|
|
||||||
display: flex;flex-direction: column; justify-content: space-between;background-color: white; border-radius: 10px; ">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<p class="p-subtitle">状态</p>
|
|
||||||
<div>
|
|
||||||
<div v-if="project.completed === false">
|
|
||||||
<el-tag>进行中</el-tag>
|
|
||||||
</div>
|
|
||||||
<div v-if="project.completed === true">
|
|
||||||
<el-tag type="info">已结项</el-tag>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<p class="p-subtitle">项目经理</p>
|
|
||||||
<p>{{ projectCreatorName }}</p>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<p class="p-subtitle">开始时间</p>
|
|
||||||
<p>{{ formatDate(project.projectCreatedTime) }}</p>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<p class="p-subtitle">结束时间</p>
|
|
||||||
<p>{{ formatDate(project.projectClosedDate) }}</p>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<p class="p-subtitle">进度</p>
|
|
||||||
<el-progress
|
|
||||||
:status="(totalNum!==0&&completeNum===totalNum) ? 'success' : ''"
|
|
||||||
:percentage="totalNum===0?0:Math.round(completeNum*100/totalNum)"/>
|
|
||||||
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div style="flex: 1;margin-left: 30px;height: 100%;display: flex;flex-direction: column">
|
|
||||||
<p class="p-title" style="margin-left: 10px">工作项统计</p>
|
<p class="p-title" style="margin-left: 10px">工作项统计</p>
|
||||||
<div style="flex:1;margin-top: 30px;padding: 20px;
|
<div style="flex:1;margin-top: 30px;padding: 20px;
|
||||||
display: flex;flex-direction: column; justify-content: space-between;background-color: white; border-radius: 10px;">
|
display: flex;flex-direction: column; justify-content: space-between;background-color: white; border-radius: 10px;align-items: stretch">
|
||||||
|
<div style="background-color: #67c23a;flex: 1;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue