提交 f4c05be2 编写于 作者: KK's avatar KK

代码表颜色、图标

上级 13c8a4ee
<template> <template>
<div class="app-mob-span"> <div class="app-mob-span">
<ion-input v-if="!codeListType" readonly :value="text" ></ion-input> <ion-icon v-if="currentItem && currentItem.iconcls" :name="currentItem.iconcls"></ion-icon><ion-input :style="{color:currentItem && currentItem.color?currentItem.color:''}" v-if="!codeListType" readonly :value="text" ></ion-input>
<ion-input v-if="codeListType == 'DYNAMIC'" readonly :value="($t('userCustom.'+tag+'.'+value)!== ('userCustom.'+tag+'.'+value))?$t('userCustom.'+tag+'.'+value) : text" ></ion-input> <ion-input :style="{color:currentItem && currentItem.color?currentItem.color:''}" v-if="codeListType == 'DYNAMIC'" readonly :value="($t('userCustom.'+tag+'.'+value)!== ('userCustom.'+tag+'.'+value))?$t('userCustom.'+tag+'.'+value) : text" ></ion-input>
<ion-input v-if="codeListType == 'STATIC'" readonly :value="($t('codelist.'+tag+'.'+value)!== ('codelist.'+tag+'.'+value))?$t('codelist.'+tag+'.'+value) : text" ></ion-input> <ion-input :style="{color:currentItem && currentItem.color?currentItem.color:''}" v-if="codeListType == 'STATIC'" readonly :value="($t('codelist.'+tag+'.'+value)!== ('codelist.'+tag+'.'+value))?$t('codelist.'+tag+'.'+value) : text" ></ion-input>
</div> </div>
</template> </template>
...@@ -119,6 +119,14 @@ export default class AppSpan extends Vue { ...@@ -119,6 +119,14 @@ export default class AppSpan extends Vue {
*/ */
@Prop({ default: {} }) protected context?: any; @Prop({ default: {} }) protected context?: any;
/**
* 当前值项
*
* @type {*}
* @memberof AppSpan
*/
public currentItem :any = {};
/** /**
* 监控值 * 监控值
...@@ -167,11 +175,11 @@ export default class AppSpan extends Vue { ...@@ -167,11 +175,11 @@ export default class AppSpan extends Vue {
*/ */
public setText(){ public setText(){
if(this.items.length>0){ if(this.items.length>0){
let currentItem:any = this.items.find((item:any)=>{ this.currentItem= this.items.find((item:any)=>{
return item.value == this.value; return item.value == this.value;
}); });
if(currentItem){ if(this.currentItem){
this.text = currentItem.text; this.text = this.currentItem.text;
}else{ }else{
// 不匹配显示原值,不存在显示空值 // 不匹配显示原值,不存在显示空值
if(this.value){ if(this.value){
...@@ -188,5 +196,6 @@ export default class AppSpan extends Vue { ...@@ -188,5 +196,6 @@ export default class AppSpan extends Vue {
<style lang="less"> <style lang="less">
.app-mob-span{ .app-mob-span{
width: 100%; width: 100%;
display: flex;
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册