解决一些问题

main
wuyize 2022-07-13 17:11:51 +08:00
parent 9c77e67531
commit d1439b8bb1
4 changed files with 29 additions and 24 deletions

View File

@ -20,18 +20,17 @@ export default {
},
watch: {
enable: function (val) {
console.log("ENABLE"+val)
if(val)
this.initEcharts();
},
},
computed: {
getTotalNumber() {
return this.dataList.reduce((prev, item) => {
prev += item.value
return prev
}, 0);
}
mounted() {
console.log("ENABLE"+this.enable)
if(this.enable)
this.initEcharts();
},
methods: {
//
getOption() {

View File

@ -20,14 +20,19 @@ export default {
}
},
props: {
task: {}
task: null
},
emits: ['mounted'],
watch: {
task: function (val) {
console.log("initEchartsBar")
console.log(this.task)
this.initEcharts()
}
},
mounted() {
this.$emit("mounted");
},
methods: {
@ -113,9 +118,10 @@ export default {
this.init()
});
const that = this
//this.chart.setOption(option);
window.addEventListener("resize", function () {
this.chart.resize();
that.chart.resize();
});
}

View File

@ -5,7 +5,7 @@
<div style="margin: 0 10px 0 10px;display: flex;flex-direction: row;justify-content: space-between"
ref="left_title_Ref">
<p style="text-align:center; 'Segoe UI',sans-serif;font-size: 20px;font-weight: bold;color: #606266">项目团队</p>
<el-button v-if="!project.completed" type="primary" @click="onCreatePerson"></el-button>
<el-button v-if="!project.completed&&projectAccessLevel<3" type="primary" @click="onCreatePerson"></el-button>
</div>
<div style="flex: 1; margin: 30px 0 0 0; background-color: white; border-radius: 10px;padding: 20px;
display: flex;flex-direction: column;justify-content: space-between">

View File

@ -52,17 +52,12 @@
display: flex;flex-direction:row; justify-content: space-between;background-color: white; border-radius: 10px;">
<div style="width: 50%;">
<p class="p-subtitle" style="margin-left: 10px;margin-top: 10px">项目</p>
<echartsBar :task="taskStat" style="height: 190px; weight: 100%"></echartsBar></div>
<echartsBar @mounted="getTaskStats" :task="taskStat" style="height: 190px; weight: 100%"></echartsBar>
</div>
<div style="width: 50%;">
<p class="p-subtitle" style="margin-left: 10px;margin-top: 10px">个人</p>
<echartsBar :task="selftaskStat" style="height: 190px; weight: 100%"></echartsBar></div>
<!-- <div style="width: 50%;"><selfechartsBar style="height: 190px; weight: 100%"></selfechartsBar></div> -->
<!-- <el-tabs :tab-position="tabPosition" style="height: 200px; margin-top: -15px;" class="demo-tabs">
<el-tab-pane label="项目">
<echartsBar style="height: 190px; weight: 100%"></echartsBar>
</el-tab-pane>
<el-tab-pane label="个人"><echartsBar style="height: 190px; weight: 100%"></echartsBar></el-tab-pane>
</el-tabs> -->
<echartsBar @mounted="getselfTaskStats" :task="selftaskStat" style="height: 190px; weight: 100%"></echartsBar>
</div>
</div>
</div>
@ -73,7 +68,9 @@
<div style="margin: 0 10px 0 10px;
display: flex;flex-direction: row;justify-content: space-between">
<p style="font-family: 'Segoe UI',sans-serif;font-size: 20px;font-weight: bold;color: #606266">详细信息</p>
<el-button v-if="!project.completed&&projectAccessLevel===1" type="primary" @click.native="onEditProjectClick"></el-button>
<el-button v-if="!project.completed&&projectAccessLevel===1" type="primary"
@click.native="onEditProjectClick">编辑
</el-button>
</div>
<div style="flex:1;margin-top: 30px;padding: 20px;
display: flex;flex-direction: column; justify-content: space-between;background-color: white; border-radius: 10px; ">
@ -283,6 +280,7 @@ import moment from "moment";
import EditProjectDialog from "../components/EditProjectDialog";
import TendencyChart from "../components/TendencyChart";
import EchartsBar from "../components/echartsBar"
export default {
name: "ProjectInfo",
components: {EditProjectDialog, TendencyChart, EchartsBar},
@ -419,11 +417,12 @@ export default {
getTaskStats() {
const that = this
request({
url: 'project/' + this.$route.params.projectId + '/task/stats' ,
url: 'project/' + this.$route.params.projectId + '/task/stats',
method: 'get'
}).then(response => {
if (response.data.code === 200) {
that.taskStat = {
require: response.data.data.records[0],
task: response.data.data.records[1],
@ -439,11 +438,12 @@ export default {
getselfTaskStats() {
const that = this
request({
url: 'project/' + this.$route.params.projectId + '/task/stats/'+this.$store.state.staff.staffId ,
url: 'project/' + this.$route.params.projectId + '/task/stats/' + this.$store.state.staff.staffId,
method: 'get'
}).then(response => {
if (response.data.code === 200) {
that.selftaskStat = {
require: response.data.data.records[0],
task: response.data.data.records[1],