constants.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import OperatorTypes from 'utils/operatorTypes'
  2. import { ITableConditionStyle } from './types'
  3. export enum TableCellStyleTypes {
  4. Column,
  5. RowTotal,
  6. ColumnTotal
  7. }
  8. export enum TableConditionStyleTypes {
  9. BackgroundColor = 'backgroundColor',
  10. TextColor = 'textColor',
  11. NumericBar = 'numericBar',
  12. Custom = 'custom'
  13. }
  14. export enum TableConditionStyleFieldTypes {
  15. Column,
  16. RowTotal,
  17. ColumnTotal
  18. }
  19. export const AvailableTableConditionStyleTypes = {
  20. [TableConditionStyleTypes.BackgroundColor]: '背景颜色',
  21. [TableConditionStyleTypes.TextColor]: '字体颜色',
  22. [TableConditionStyleTypes.NumericBar]: '条形图',
  23. [TableConditionStyleTypes.Custom]: '自定义'
  24. }
  25. export const TableConditionStyleTypesSetting = {
  26. [TableConditionStyleTypes.BackgroundColor]: ['string', 'geoCountry', 'geoProvince', 'geoCity', 'number', 'date'],
  27. [TableConditionStyleTypes.TextColor]: ['string', 'geoCountry', 'geoProvince', 'geoCity', 'number', 'date'],
  28. [TableConditionStyleTypes.NumericBar]: ['number'],
  29. [TableConditionStyleTypes.Custom]: ['string', 'geoCountry', 'geoProvince', 'geoCity', 'number', 'date']
  30. }
  31. export const defaultConditionStyle: ITableConditionStyle = {
  32. key: '',
  33. type: TableConditionStyleTypes.BackgroundColor,
  34. operatorType: OperatorTypes.Equal,
  35. conditionValues: [],
  36. colors: {
  37. background: '#000',
  38. fore: '#fff',
  39. positive: '#008fff',
  40. negative: '#5cc504'
  41. },
  42. zeroPosition: 'auto',
  43. bar: {
  44. mode: 'auto'
  45. },
  46. customTemplate: ''
  47. }