const EcCodeTypes = [
|
{ value: null, label: '全部' },
|
{ value: '0', label: '绿码' },
|
{ value: '1', label: '黄码' },
|
{ value: '2', label: '红码' },
|
];
|
|
function toLabel(value) {
|
let r = EcCodeTypes.find(item => {
|
return item.value == value;
|
});
|
if (!r) r = RiskTypes[0]
|
return r.label
|
}
|
|
function toLabel2(value) {
|
let l = toLabel(value)
|
if (l == EcCodeTypes[0].label) {
|
l = '/'
|
}
|
return l
|
}
|
|
function toValue(label) {
|
const r = EcCodeTypes.find(item => {
|
return item.label == label;
|
});
|
return r.value
|
}
|
|
export { EcCodeTypes, toLabel, toLabel2, toValue };
|