riku
2025-04-27 233a467167e2b363098cc7fa63e7f26d1d15507b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
 * 设备运行状态
 */
const status = [
  { value: '0', label: '未联网' },
  { value: '1', label: '上线中' },
  { value: '2', label: '已下线' },
  { value: '3', label: '已拆除' },
];
 
function toLabel(value) {
  let r = status.find(item => {
    return item.value == value;
  });
  if (!r) r = status[0]
  return r.label
}
 
function toValue(label) {
  const r = status.find(item => {
    return item.label == label;
  });
  return r.value
}
 
export { status, toLabel, toValue };