1 changed files with 0 additions and 49 deletions
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
import { useStore } from 'vuex'; |
||||
// const {
|
||||
// state: { dict },
|
||||
// } = useStore();
|
||||
const dict = {}; |
||||
|
||||
export const getValue = ( |
||||
row: any, |
||||
column: string, |
||||
value: any, |
||||
index?: number |
||||
) => { |
||||
if ((value == null || value == '') && value !== 0) { |
||||
return '--'; |
||||
} |
||||
return value; |
||||
}; |
||||
|
||||
export const formatter = (row: any, column: any, value: any, index: number) => { |
||||
return formatterByDist(row.scheme + '_' + column.property, value); |
||||
}; |
||||
|
||||
export const formatterByDist = (dictKey, value) => { |
||||
if (!dictKey) { |
||||
return getValue(null, '', value); |
||||
} |
||||
const mapping = dict[dictKey]; |
||||
if (mapping == null) { |
||||
return getValue(null, '', value); |
||||
} |
||||
return mapping[value] == null ? value : mapping[value]; |
||||
}; |
||||
|
||||
// export const formartLink = (row) => {
|
||||
// const up = row.ambr.uplink;
|
||||
// const down = row.ambr.downlink;
|
||||
// return (
|
||||
// down.value + dict.units[down.unit] + '/' + up.value + dict.units[up.unit]
|
||||
// );
|
||||
// };
|
||||
|
||||
// export const formartApn = (row, index) => {
|
||||
// const session = row.slice[0].session[index];
|
||||
// if (session) {
|
||||
// return session.name + '-' + session.qos.index;
|
||||
// } else {
|
||||
// return '';
|
||||
// }
|
||||
// };
|
Loading…
Reference in new issue