Browse Source

color

master
pengjun 2 years ago
parent
commit
8cab124b29
  1. 201
      src/components/doctorCheck/CheckItemList.vue

201
src/components/doctorCheck/CheckItemList.vue

@ -14,7 +14,7 @@
<el-table-column prop="itemName" label="项目" width="180" /> <el-table-column prop="itemName" label="项目" width="180" />
<el-table-column prop="result" label="结果" min-width="200"> <el-table-column prop="result" label="结果" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-autocomplete
<el-autocomplete
style="width: 100%;" style="width: 100%;"
type="textarea" type="textarea"
v-model="scope.row.result" v-model="scope.row.result"
@ -27,8 +27,8 @@
" "
:autosize="{ minRows: 1, maxRows: 100 }" :autosize="{ minRows: 1, maxRows: 100 }"
:data-ismultiline="scope.row.isMultiLine" :data-ismultiline="scope.row.isMultiLine"
@blur="madeTooltips(scope.$index)"
:class="scope.$index % 2 == 0 ? '1':'error'"
@input="madeTooltips(scope.$index)"
v-bind:class="scope.row.class"
/> />
</template> </template>
</el-table-column> </el-table-column>
@ -57,6 +57,24 @@ export default {
data() { data() {
return { return {
resultStatus:[], // resultStatus:[], //
tipsNormal:{
displayName: "正常",
dataInputPrompt: "正常",
reportPrompt: "正常",
reportBackgroundColor: 16777215,
reportFontColor: 0,
dataInputBackgroundColor: 16777215,
dataInputFontColor: 0,
}, //
tipsError:{}, //
tipsNegative:{}, //
tipsLowPositive:{}, //
tipsPositive:{}, //
tipsLow:{}, //
tipsHigh:{}, //
tipsSuperLow:{}, //
tipsSuperHigh:{}, //
restaurants: [], // restaurants: [], //
currentRow: -1, // currentRow: -1, //
}; };
@ -78,9 +96,125 @@ export default {
dictInit(){ dictInit(){
// //
getapi('/api/app/result-status').then(res =>{ getapi('/api/app/result-status').then(res =>{
if(res.code != -1) resultStatus = res.data.items
if(res.code != -1){
this.resultStatus = res.data.items
this.resultStatus.forEach(e => {
if(e.displayName.indexOf("正常") > -1){
this.colorTrans(e,'tipsNormal')
}else if(e.displayName.indexOf("错误") > -1){
this.colorTrans(e,'tipsError')
}else if(e.displayName.indexOf("阴性") > -1){
this.colorTrans(e,'tipsNegative')
}else if(e.displayName.indexOf("弱阳性") > -1){
this.colorTrans(e,'tipsLowPositive')
}else if(e.displayName.indexOf("阳性") > -1){
this.colorTrans(e,'tipsPositive')
}else if(e.displayName.indexOf("偏低") > -1){
this.colorTrans(e,'tipsLow')
}else if(e.displayName.indexOf("偏高") > -1){
this.colorTrans(e,'tipsHigh')
}else if(e.displayName.indexOf("危急值下限") > -1){
this.colorTrans(e,'tipsSuperLow')
}else if(e.displayName.indexOf("危急值上限") > -1){
this.colorTrans(e,'tipsSuperHigh')
}
});
}
}) })
}, },
//
// displayName: "",
// dataInputPrompt: "×",
// reportPrompt: "×",
// reportBackgroundColor: 2427166,
// reportFontColor: 1070166,
// dataInputBackgroundColor: 321313,
// dataInputFontColor: 12991019,
colorTrans(dataColor,frontColor){
let tempColor = '000000' + Number(dataColor.dataInputBackgroundColor).toString(16)
let backgroundColor = '#' + tempColor.substring(tempColor.length - 6)
tempColor = '000000' + Number(dataColor.dataInputFontColor).toString(16)
let color = '#' + tempColor.substring(tempColor.length - 6)
this[frontColor] = Object.assign(
{},
dataColor,
{backgroundColor,color}
)
console.log(`this.${frontColor}`,this[frontColor])
},
// "referenceRangeValue": "15-55",
// "referenceRangeTypeFlag": "1",
// "criticalRangeValue": null,
// "result"
madeTooltips(index){
// let ts = confirm('')
let checkItem = this.doctorCheck.checkItemList[index]
let tooltips = 'tipsNormal'
checkItem.class = tooltips
let referenceRangeTypeFlag = checkItem.referenceRangeTypeFlag||'0' //0-1-2-3-
// console.log('madeTooltips',index,referenceRangeTypeFlag)
switch (referenceRangeTypeFlag) {
case '3': // 1 3
case '1':
// console.log('13')
if(checkItem.result && checkItem.referenceRangeValue){
let tempResult = checkItem.result.replaceAll('<','').replaceAll('>','').replaceAll('=','').replaceAll('≤','').replaceAll('≥','').replaceAll(' ','')
// console.log('tempResult',isNaN(tempResult),tempResult)
if(isNaN(tempResult)) break;
let result = Number(tempResult)
let criticalRangeValue = checkItem.criticalRangeValue
let valueArr = checkItem.referenceRangeValue.split('-')
if(valueArr.length == 1) valueArr.unshift(0)
// console.log('valueArr',checkItem.referenceRangeValue,valueArr)
if(criticalRangeValue){
let criticalArr = criticalRangeValue.split('-')
if(criticalArr.length == 1) criticalArr.unshift(0)
// console.log('criticalArr',checkItem.criticalRangeValue,criticalArr)
if(result < Number(criticalArr[0])){
tooltips = 'tipsSuperLow'
}else if(result > Number(criticalArr[1])){
tooltips = 'tipsSuperHigh'
}else if(result < Number(valueArr[0])){
tooltips = 'tipsLow'
}else if(result > Number(valueArr[1])){
tooltips = 'tipsHigh'
}
}else{
if(result < Number(valueArr[0])){
tooltips = 'tipsLow'
}else if(result > Number(valueArr[1])){
tooltips = 'tipsHigh'
}
}
}
break;
case '2':
if(checkItem.result){
if(checkItem.result.indexOf('阴性') > -1 || checkItem.result.indexOf('-') > -1){
tooltips = 'tipsNegative'
}else if(checkItem.result.indexOf('弱阳性') > -1 || checkItem.result.indexOf('±') > -1){
tooltips = 'tipsLowPositive'
}else if(checkItem.result.indexOf('阳性') > -1 || checkItem.result.indexOf('+') > -1){
tooltips = 'tipsPositive'
}
}
break;
default:
break;
}
//
checkItem.class = tooltips
checkItem.tooltips = this[tooltips].dataInputPrompt
// console.log('checkItem',checkItem)
// console.log(`this.${tooltips}`,this[tooltips])
},
// //
rowClick(row) { rowClick(row) {
this.doctorCheck.checkItem = row; this.doctorCheck.checkItem = row;
@ -213,54 +347,59 @@ export default {
padding: 2px 15px 2px 2px; padding: 2px 15px 2px 2px;
} }
/*正常*/
::v-deep .tipsNormal .el-textarea__inner {
background-color: v-bind("tipsNormal.backgroundColor") !important;
color: v-bind("tipsNormal.color") !important;
}
/*错误*/ /*错误*/
::v-deep .error .el-textarea__inner {
background-color: yellow !important;
color: red !important;
::v-deep .tipsError .el-textarea__inner {
background-color: v-bind("tipsError.backgroundColor") !important;
color: v-bind("tipsError.color") !important;
} }
/*阴性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */ /*阴性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .negative .el-textarea__inner {
background-color: yellow !important;
color: red !important;
::v-deep .tipsNegative .el-textarea__inner {
background-color: v-bind("tipsNegative.backgroundColor") !important;
color: v-bind("tipsNegative.color") !important;
} }
/*阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .positive .el-textarea__inner {
background-color: yellow !important;
color: red !important;
/*阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .tipsLowPositive .el-textarea__inner {
background-color: v-bind("tipsLowPositive.backgroundColor") !important;
color: v-bind("tipsLowPositive.color") !important;
} }
/*阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .lowPositive .el-textarea__inner {
background-color: yellow !important;
color: red !important;
/*阳性 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .tipsPositive .el-textarea__inner {
background-color: v-bind("tipsPositive.backgroundColor") !important;
color: v-bind("tipsPositive.color") !important;
} }
/*偏低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */ /*偏低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .low .el-textarea__inner {
background-color: yellow !important;
color: red !important;
::v-deep .tipsLow .el-textarea__inner {
background-color: v-bind("tipsLow.backgroundColor") !important;
color: v-bind("tipsLow.color") !important;
} }
/*偏高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */ /*偏高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .high .el-textarea__inner {
background-color: yellow !important;
color: red !important;
::v-deep .tipsHigh .el-textarea__inner {
background-color: v-bind("tipsHigh.backgroundColor") !important;
color: v-bind("tipsHigh.color") !important;
} }
/*超低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */ /*超低 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .superLow .el-textarea__inner {
background-color: yellow !important;
color: red !important;
::v-deep .tipsSuperLow .el-textarea__inner {
background-color: v-bind("tipsSuperLow.backgroundColor") !important;
color: v-bind("tipsSuperLow.color") !important;
} }
/*偏高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */ /*偏高 v-bind("(window.pageHeight > 600 ? (window.pageHeight - 250) : 350) + 'px'") */
::v-deep .superHigh .el-textarea__inner {
background-color: yellow !important;
color: red !important;
::v-deep .tipsSuperHigh .el-textarea__inner {
background-color: v-bind("tipsSuperHigh.backgroundColor") !important;
color: v-bind("tipsSuperHigh.color") !important;
} }
</style> </style>

Loading…
Cancel
Save