From ccc42f61458f289365c444147c7909b4812d7489 Mon Sep 17 00:00:00 2001 From: mengyxu Date: Tue, 18 Jul 2023 11:43:10 +0800 Subject: [PATCH] Delete formatter.ts --- plugs/formatter.ts | 49 ---------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 plugs/formatter.ts diff --git a/plugs/formatter.ts b/plugs/formatter.ts deleted file mode 100644 index 7c1c898..0000000 --- a/plugs/formatter.ts +++ /dev/null @@ -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 ''; -// } -// };