diff --git a/src/components/DictField/index.vue b/src/components/DictField/index.vue index a2c936f5..4a4e7520 100644 --- a/src/components/DictField/index.vue +++ b/src/components/DictField/index.vue @@ -12,7 +12,7 @@ - + @@ -86,9 +86,8 @@ } }, getMyColor(item){ - if(!item){ - return "" - } + if(item){ + if(this.getColor){ return this.getColor(item.id) } @@ -96,11 +95,17 @@ return item.color } return "" + + }else{ + if(this.getColor){ + return this.getColor(this.myVal) + }else{ + return "" + } + } }, getMyIcon(item){ - if(!item){ - return "" - } + if(item){ if(this.getIcon){ return this.getIcon(item.id) } @@ -108,6 +113,13 @@ return item.icon } return ""; + }else{ + if(this.getIcon){ + return this.getIcon(this.myVal) + }else{ + return "" + } + } }, initData(){ this.myVal=this.value diff --git a/src/components/DictSelect/index.vue b/src/components/DictSelect/index.vue index 42949f84..5c9a7d7c 100644 --- a/src/components/DictSelect/index.vue +++ b/src/components/DictSelect/index.vue @@ -4,7 +4,7 @@ - + {{item.name}} @@ -68,10 +68,10 @@ this.myVal=this.value }, + getMyColor(item){ - if(!item){ - return ""; - } + if(item){ + if(this.getColor){ return this.getColor(item.id) } @@ -79,11 +79,17 @@ return item.color } return "" + + }else{ + if(this.getColor){ + return this.getColor(this.myVal) + }else{ + return "" + } + } }, getMyIcon(item){ - if(!item){ - return ""; - } + if(item){ if(this.getIcon){ return this.getIcon(item.id) } @@ -91,6 +97,13 @@ return item.icon } return ""; + }else{ + if(this.getIcon){ + return this.getIcon(this.myVal) + }else{ + return "" + } + } }, onChange(data){ this.$emit('change',data) diff --git a/src/views/xm/core/xmTestPlanCase/TestStepResult.vue b/src/views/xm/core/xmTestPlanCase/TestStepResult.vue index 01fcdd9b..553b1fc6 100644 --- a/src/views/xm/core/xmTestPlanCase/TestStepResult.vue +++ b/src/views/xm/core/xmTestPlanCase/TestStepResult.vue @@ -125,6 +125,7 @@ getExecStatusIcon(execStatus){ + debugger; var icons=['el-icon-arrow-up','el-icon-right','el-icon-check','el-icon-minus','el-icon-close']; if(!execStatus){ return icons[0]