master
parent
3c52374634
commit
3b08287552
@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listProject(params) {
|
||||
return request({
|
||||
url: '/api/admin/pms/item',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function listStatus(params) {
|
||||
return request({
|
||||
url: '/api/admin/pms/status',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div>
|
||||
<xy-table ref="xyTable" :stripe="true" :header-cell-style="headerStyle" :cell-style="cellStyle" :list="list"
|
||||
:is-page="false" :table-item="tableColumn">
|
||||
<template v-slot:btns>
|
||||
<div></div>
|
||||
</template>
|
||||
</xy-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
// tableColumn: {
|
||||
// type: Array,
|
||||
// default: () => []
|
||||
// }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumn:[
|
||||
{
|
||||
label: "项目",
|
||||
prop: 'project_name',
|
||||
align: 'left',
|
||||
width:200,
|
||||
fixed:"left"
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function(){
|
||||
this.creatCustom()
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
list(val) {
|
||||
this.$nextTick(function(){
|
||||
this.creatCustom()
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
headerStyle({
|
||||
row,
|
||||
column,
|
||||
rowIndex,
|
||||
columnIndex
|
||||
}) {
|
||||
return {
|
||||
backgroundColor: '#d70c25!important',
|
||||
color: '#fff',
|
||||
border: "none",
|
||||
lineHeight: "40px",
|
||||
fontSize: "15px",
|
||||
textAlign:"left"
|
||||
}
|
||||
},
|
||||
cellStyle() {
|
||||
return {
|
||||
border: "none",
|
||||
lineHeight: "40px",
|
||||
fontSize: "15px"
|
||||
}
|
||||
},
|
||||
creatCustom() {
|
||||
this.tableColumn=[
|
||||
{
|
||||
label: "项目",
|
||||
prop: 'project_name',
|
||||
align: 'left',
|
||||
width:200,
|
||||
sortable: false,
|
||||
fixed:"left"
|
||||
}
|
||||
]
|
||||
if(this.list.length==0){
|
||||
this.tableColumn=[]
|
||||
return
|
||||
}
|
||||
// return
|
||||
let that = this
|
||||
for(let item in this.list[0]){
|
||||
if (item != 'project_name') {
|
||||
if (item == '合计') {
|
||||
this.tableColumn.push({
|
||||
label: item,
|
||||
prop: item+'.total',
|
||||
align: "left",
|
||||
sortable: false,
|
||||
fixed: 'right',
|
||||
width: 220,
|
||||
customFn:(cell)=>{
|
||||
// let ingtotal = cell[item].design_total + cell[item].devel_total
|
||||
let proPer = parseInt((cell[item].end_total/cell[item].total)*100)
|
||||
proPer = isNaN(proPer)?0:proPer
|
||||
return ( <div class="prototal">
|
||||
<div class="proinfo">
|
||||
{
|
||||
!isNaN(proPer)?
|
||||
<div>
|
||||
<span class="fontColor">{cell[item].total}</span>
|
||||
<span>/{cell[item].end_total}</span>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
|
||||
{
|
||||
cell[item].design_total>0?<div> {cell[item].design_total}个设计任务 </div>:""
|
||||
}
|
||||
{
|
||||
cell[item].devel_total>0?<div> {cell[item].devel_total}个开发任务 </div>:""
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="progress">
|
||||
<el-progress color="#d70c25" width={60} type="circle" percentage={proPer}></el-progress>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.tableColumn.push({
|
||||
label: item,
|
||||
prop: item+'.devel_total',
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: 180,
|
||||
customFn:(cell)=>{
|
||||
// let ingtotal = cell[item].design_total + cell[item].devel_total
|
||||
let proPer = parseInt((cell[item].end_total/cell[item].total)*100)
|
||||
return ( <div>
|
||||
{
|
||||
!isNaN(proPer)?
|
||||
<div>
|
||||
<span class="fontColor">{cell[item].total}</span>
|
||||
<span>/{cell[item].end_total}</span>
|
||||
</div>
|
||||
:""
|
||||
}
|
||||
{
|
||||
cell[item].design_total>0?<div> {cell[item].design_total}个设计任务 </div>:""
|
||||
}
|
||||
{
|
||||
cell[item].devel_total>0?<div> {cell[item].devel_total}个开发任务 </div>:""
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fontColor {
|
||||
color: #d70c25;
|
||||
font-size: 24px
|
||||
}
|
||||
.prototal{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.proinfo{
|
||||
width:110px;
|
||||
display: inline-block;
|
||||
}
|
||||
.progress{
|
||||
/* vertical-align: super; */
|
||||
display: inline-block;
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue