|
|
@ -1,9 +1,10 @@ |
|
|
|
<template> |
|
|
|
<ContentContainer class="homepage-beta-wrapper"> |
|
|
|
<el-tabs v-model="activeName" type="card" > |
|
|
|
<el-tab-pane label="资源负荷" name="evaluation" v-loading="evaluationLoading"> |
|
|
|
<el-tab-pane label="资源负荷" name="evaluation"> |
|
|
|
<Evaluation |
|
|
|
v-if="evaluationDataOld.length != 0" |
|
|
|
:evaluationNewLoading="evaluationNewLoading" |
|
|
|
:evaluationOldLoading="evaluationOldLoading" |
|
|
|
:evaluationDataNew="evaluationDataNew" |
|
|
|
:evaluationDataOld="evaluationDataOld" |
|
|
|
@handleModeChange="handleModeChange" |
|
|
@ -14,7 +15,7 @@ |
|
|
|
ref="resourceLoadComponents" |
|
|
|
:resourceId="resourceId" |
|
|
|
:resourceType="resourceType" |
|
|
|
:Height="tableHeight+'px'" |
|
|
|
:Height="tableHeight" |
|
|
|
@calculateTableHeight="calculateTableHeight" |
|
|
|
@handleCancelResource="handleCancelResource" /> |
|
|
|
</el-tab-pane> |
|
|
@ -43,20 +44,25 @@ export default { |
|
|
|
type: String, |
|
|
|
default:"" |
|
|
|
}, |
|
|
|
changeMpsPlanParam:{ |
|
|
|
type: Object, |
|
|
|
default: ()=> {} |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableHeight:0, |
|
|
|
evaluationLoading:false, |
|
|
|
tableHeight:"100%", |
|
|
|
evaluationNewLoading:false, |
|
|
|
evaluationOldLoading:false, |
|
|
|
evaluationDataNew: [], |
|
|
|
evaluationDataOld: [], |
|
|
|
activeName: 'resourceLoad' |
|
|
|
activeName: 'evaluation' |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
calculateTableHeight(height) { |
|
|
|
console.log('%cindex.vue line:58 height', 'color: #007acc;', height); |
|
|
|
this.tableHeight = (height -10)+""; |
|
|
|
|
|
|
|
this.tableHeight = (height -10)+"px"; |
|
|
|
}, |
|
|
|
// 发布数据 |
|
|
|
handlePublic(param){ |
|
|
@ -72,12 +78,21 @@ export default { |
|
|
|
handleModeChange(param){ |
|
|
|
// param.resouceid = "0102" // 模拟临时数据 |
|
|
|
param.data = JSON.stringify(param.data); |
|
|
|
if(this.resourceType == 1) { |
|
|
|
param.resouceid = this.resourceId |
|
|
|
} |
|
|
|
if(this.resourceType == 2) { |
|
|
|
param.secondresourceid = param.resouceid |
|
|
|
param.secondresourceid = this.resourceId |
|
|
|
} |
|
|
|
this.evaluationNewLoading = true |
|
|
|
this.evaluationDataNew = [] |
|
|
|
changeMpsPlan(param).then( ({ data = []}) => { |
|
|
|
this.evaluationNewLoading = false |
|
|
|
this.evaluationDataNew = data['ArticleResourceMpsGroupLst'] |
|
|
|
} ) |
|
|
|
console.log('%cindex.vue line:87 this.evaluationDataNew', 'color: #007acc;', this.evaluationDataNew); |
|
|
|
} ).catch(()=> { |
|
|
|
this.evaluationNewLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 取消资源ID |
|
|
|
handleCancelResource(){ |
|
|
@ -86,11 +101,23 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
changeMpsPlanParam:function(param) { |
|
|
|
this.evaluationNewLoading = true |
|
|
|
this.evaluationDataNew = [] |
|
|
|
changeMpsPlan(param).then( ({ data = []}) => { |
|
|
|
this.evaluationNewLoading = false |
|
|
|
this.evaluationDataNew = data['ArticleResourceMpsGroupLst'] |
|
|
|
console.log('%cindex.vue line:87 this.evaluationDataNew', 'color: #007acc;', this.evaluationDataNew); |
|
|
|
} ).catch(()=> { |
|
|
|
this.evaluationNewLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
resourceId:function(value) { |
|
|
|
this.evaluationDataOld = this.evaluationDataNew = [] |
|
|
|
this.$refs.resourceLoadComponents.isCancelResource = false |
|
|
|
if(this.activeName == "evaluation") { |
|
|
|
this.evaluationLoading = true |
|
|
|
this.evaluationNewLoading = true |
|
|
|
this.evaluationOldLoading = true |
|
|
|
let queryParam = {} |
|
|
|
if(this.resourceType == 1) { |
|
|
|
queryParam.resouceid = value |
|
|
@ -99,7 +126,8 @@ export default { |
|
|
|
} |
|
|
|
getMpsPlan(queryParam).then( ({data = [] }) => { |
|
|
|
this.evaluationDataOld = this.evaluationDataNew = data?data:[] |
|
|
|
this.evaluationLoading = false |
|
|
|
this.evaluationNewLoading = false |
|
|
|
this.evaluationOldLoading = false |
|
|
|
if(this.evaluationDataOld.length == 0) { |
|
|
|
this.$message({ |
|
|
|
type:"error", |
|
|
@ -107,7 +135,8 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.evaluationLoading = false |
|
|
|
this.evaluationNewLoading = false |
|
|
|
this.evaluationOldLoading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -119,14 +148,14 @@ export default { |
|
|
|
height: 100%; |
|
|
|
overflow-y: auto; |
|
|
|
overflow-x: hidden; |
|
|
|
padding: 0; |
|
|
|
padding: 0 !important; |
|
|
|
.el-tabs { |
|
|
|
el-tabs__header{ |
|
|
|
margin:0; |
|
|
|
} |
|
|
|
.el-tabs__content { |
|
|
|
overflow: inherit; |
|
|
|
height: 100%; |
|
|
|
height: calc(100% - 60px) !important; |
|
|
|
} |
|
|
|
} |
|
|
|
} |