|
@@ -14,14 +14,14 @@
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<!--列表-->
|
|
<!--列表-->
|
|
- <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
|
|
|
|
+ <!-- <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
<el-table-column type="index" width="60"></el-table-column>
|
|
<el-table-column type="index" width="60"></el-table-column>
|
|
<el-table-column prop="name" label="人员名称" sortable></el-table-column>
|
|
<el-table-column prop="name" label="人员名称" sortable></el-table-column>
|
|
<el-table-column prop="cost" label="分配时长(h)" sortable></el-table-column>
|
|
<el-table-column prop="cost" label="分配时长(h)" sortable></el-table-column>
|
|
- </el-table>
|
|
|
|
|
|
+ </el-table> -->
|
|
|
|
|
|
<!--工具条-->
|
|
<!--工具条-->
|
|
- <el-col :span="24" class="toolbar">
|
|
|
|
|
|
+ <!-- <el-col :span="24" class="toolbar">
|
|
<el-pagination
|
|
<el-pagination
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
@@ -31,7 +31,9 @@
|
|
:total="total"
|
|
:total="total"
|
|
style="float:right;"
|
|
style="float:right;"
|
|
></el-pagination>
|
|
></el-pagination>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col> -->
|
|
|
|
+
|
|
|
|
+ <div id="container" :style="'height:' + tableHeight + 'px'"></div>
|
|
</section>
|
|
</section>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -47,11 +49,8 @@
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
|
|
|
tableHeight: 0,
|
|
tableHeight: 0,
|
|
- listLoading: false,
|
|
|
|
- total: 0,
|
|
|
|
- page: 1,
|
|
|
|
- size: 20,
|
|
|
|
- list: [],
|
|
|
|
|
|
+
|
|
|
|
+ echart: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -60,17 +59,6 @@
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
},
|
|
},
|
|
|
|
|
|
- //分页
|
|
|
|
- handleCurrentChange(val) {
|
|
|
|
- this.page = val;
|
|
|
|
- this.getList();
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- handleSizeChange(val) {
|
|
|
|
- this.size = val;
|
|
|
|
- this.getList();
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
//获取项目列表
|
|
//获取项目列表
|
|
getList() {
|
|
getList() {
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
@@ -79,9 +67,56 @@
|
|
},
|
|
},
|
|
res => {
|
|
res => {
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
|
|
+ var _this = this;
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
- this.list = res.data//.records;
|
|
|
|
- this.total = res.data.total;
|
|
|
|
|
|
+ var xList = [],yList = [] , list = res.data;
|
|
|
|
+ for(var i in list) {
|
|
|
|
+ xList.push(list[i].name);
|
|
|
|
+ yList.push(list[i].cost);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var myChart = echarts.init(document.getElementById("container"));
|
|
|
|
+ _this.myChart = myChart;
|
|
|
|
+ var option = {
|
|
|
|
+ // 工具箱
|
|
|
|
+ toolbox: {
|
|
|
|
+ show: true,
|
|
|
|
+ feature:{
|
|
|
|
+ saveAsImage:{
|
|
|
|
+ show:true
|
|
|
|
+ },
|
|
|
|
+ restore:{
|
|
|
|
+ show:true
|
|
|
|
+ },
|
|
|
|
+ dataView:{
|
|
|
|
+ show:true
|
|
|
|
+ },
|
|
|
|
+ dataZoom:{
|
|
|
|
+ show:true
|
|
|
|
+ },
|
|
|
|
+ magicType:{
|
|
|
|
+ type:['line','bar']
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ tooltip:{
|
|
|
|
+ trigger:'axis'
|
|
|
|
+ },
|
|
|
|
+ xAxis: {
|
|
|
|
+ data: xList,
|
|
|
|
+ axisLabel: {
|
|
|
|
+ interval:0,rotate:40
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ yAxis: {},
|
|
|
|
+ series: [{
|
|
|
|
+ name: '工作时长(h)',
|
|
|
|
+ type: 'bar',
|
|
|
|
+ barMaxWidth: 30,
|
|
|
|
+ data: yList,
|
|
|
|
+ }]
|
|
|
|
+ };
|
|
|
|
+ myChart.setOption(option);
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -100,14 +135,18 @@
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
let height = window.innerHeight;
|
|
let height = window.innerHeight;
|
|
- this.tableHeight = height - 195;
|
|
|
|
|
|
+ this.tableHeight = height - 145;
|
|
const that = this;
|
|
const that = this;
|
|
window.onresize = function temp() {
|
|
window.onresize = function temp() {
|
|
- that.tableHeight = window.innerHeight - 195;
|
|
|
|
|
|
+ that.tableHeight = window.innerHeight - 145;
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.getList();
|
|
this.getList();
|
|
|
|
+ var _this = this;
|
|
|
|
+ window.addEventListener("resize", function() {
|
|
|
|
+ _this.myChart.resize();
|
|
|
|
+ });
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -136,6 +175,11 @@
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ #container {
|
|
|
|
+ float: left;
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|