解决一些问题
parent
9c77e67531
commit
d1439b8bb1
|
@ -20,18 +20,17 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
enable: function (val) {
|
enable: function (val) {
|
||||||
|
console.log("ENABLE"+val)
|
||||||
if(val)
|
if(val)
|
||||||
this.initEcharts();
|
this.initEcharts();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
mounted() {
|
||||||
getTotalNumber() {
|
console.log("ENABLE"+this.enable)
|
||||||
return this.dataList.reduce((prev, item) => {
|
if(this.enable)
|
||||||
prev += item.value
|
this.initEcharts();
|
||||||
return prev
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 获取配置
|
// 获取配置
|
||||||
getOption() {
|
getOption() {
|
||||||
|
|
|
@ -20,14 +20,19 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
task: {}
|
task: null
|
||||||
},
|
},
|
||||||
|
emits: ['mounted'],
|
||||||
watch: {
|
watch: {
|
||||||
task: function (val) {
|
task: function (val) {
|
||||||
|
console.log("initEchartsBar")
|
||||||
|
console.log(this.task)
|
||||||
this.initEcharts()
|
this.initEcharts()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$emit("mounted");
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,9 +118,10 @@ export default {
|
||||||
this.init()
|
this.init()
|
||||||
|
|
||||||
});
|
});
|
||||||
|
const that = this
|
||||||
//this.chart.setOption(option);
|
//this.chart.setOption(option);
|
||||||
window.addEventListener("resize", function () {
|
window.addEventListener("resize", function () {
|
||||||
this.chart.resize();
|
that.chart.resize();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div style="margin: 0 10px 0 10px;display: flex;flex-direction: row;justify-content: space-between"
|
<div style="margin: 0 10px 0 10px;display: flex;flex-direction: row;justify-content: space-between"
|
||||||
ref="left_title_Ref">
|
ref="left_title_Ref">
|
||||||
<p style="text-align:center; 'Segoe UI',sans-serif;font-size: 20px;font-weight: bold;color: #606266">项目团队</p>
|
<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>
|
||||||
<div style="flex: 1; margin: 30px 0 0 0; background-color: white; border-radius: 10px;padding: 20px;
|
<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">
|
display: flex;flex-direction: column;justify-content: space-between">
|
||||||
|
|
|
@ -52,17 +52,12 @@
|
||||||
display: flex;flex-direction:row; justify-content: space-between;background-color: white; border-radius: 10px;">
|
display: flex;flex-direction:row; justify-content: space-between;background-color: white; border-radius: 10px;">
|
||||||
<div style="width: 50%;">
|
<div style="width: 50%;">
|
||||||
<p class="p-subtitle" style="margin-left: 10px;margin-top: 10px">项目</p>
|
<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%;">
|
<div style="width: 50%;">
|
||||||
<p class="p-subtitle" style="margin-left: 10px;margin-top: 10px">个人</p>
|
<p class="p-subtitle" style="margin-left: 10px;margin-top: 10px">个人</p>
|
||||||
<echartsBar :task="selftaskStat" style="height: 190px; weight: 100%"></echartsBar></div>
|
<echartsBar @mounted="getselfTaskStats" :task="selftaskStat" style="height: 190px; weight: 100%"></echartsBar>
|
||||||
<!-- <div style="width: 50%;"><selfechartsBar style="height: 190px; weight: 100%"></selfechartsBar></div> -->
|
</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> -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -73,7 +68,9 @@
|
||||||
<div style="margin: 0 10px 0 10px;
|
<div style="margin: 0 10px 0 10px;
|
||||||
display: flex;flex-direction: row;justify-content: space-between">
|
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>
|
<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>
|
||||||
<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; ">
|
||||||
|
@ -283,6 +280,7 @@ import moment from "moment";
|
||||||
import EditProjectDialog from "../components/EditProjectDialog";
|
import EditProjectDialog from "../components/EditProjectDialog";
|
||||||
import TendencyChart from "../components/TendencyChart";
|
import TendencyChart from "../components/TendencyChart";
|
||||||
import EchartsBar from "../components/echartsBar"
|
import EchartsBar from "../components/echartsBar"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ProjectInfo",
|
name: "ProjectInfo",
|
||||||
components: {EditProjectDialog, TendencyChart, EchartsBar},
|
components: {EditProjectDialog, TendencyChart, EchartsBar},
|
||||||
|
@ -419,11 +417,12 @@ export default {
|
||||||
getTaskStats() {
|
getTaskStats() {
|
||||||
const that = this
|
const that = this
|
||||||
request({
|
request({
|
||||||
url: 'project/' + this.$route.params.projectId + '/task/stats' ,
|
url: 'project/' + this.$route.params.projectId + '/task/stats',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
|
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
if (response.data.code === 200) {
|
if (response.data.code === 200) {
|
||||||
|
|
||||||
that.taskStat = {
|
that.taskStat = {
|
||||||
require: response.data.data.records[0],
|
require: response.data.data.records[0],
|
||||||
task: response.data.data.records[1],
|
task: response.data.data.records[1],
|
||||||
|
@ -439,11 +438,12 @@ export default {
|
||||||
getselfTaskStats() {
|
getselfTaskStats() {
|
||||||
const that = this
|
const that = this
|
||||||
request({
|
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'
|
method: 'get'
|
||||||
|
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
if (response.data.code === 200) {
|
if (response.data.code === 200) {
|
||||||
|
|
||||||
that.selftaskStat = {
|
that.selftaskStat = {
|
||||||
require: response.data.data.records[0],
|
require: response.data.data.records[0],
|
||||||
task: response.data.data.records[1],
|
task: response.data.data.records[1],
|
||||||
|
|
Loading…
Reference in New Issue