a000c6acbb0d0f54057d02a0a5d05b092a167d1b.svn-base 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import i18n from '@/i18n'
  2. export const sqlFunc = {
  3. sum: i18n.t('config.sum'),
  4. avg: i18n.t('config.avg'),
  5. max: i18n.t('config.max'),
  6. min: i18n.t('config.min'),
  7. count: i18n.t('config.count'),
  8. none: i18n.t('config.none'),
  9. custbiaozhun: i18n.t('config.custbiaozhun'),
  10. custbianyi: i18n.t('config.custbianyi')
  11. }
  12. export const filterOperator = [
  13. { operator: '=', name: 'config.is', paramNum: 1 },
  14. { operator: '>', name: 'config.greater', paramNum: 1 },
  15. { operator: '<', name: 'config.less', paramNum: 1 },
  16. { operator: '>=', name: 'config.greaterOrEqual', paramNum: 1 },
  17. { operator: '<=', name: 'config.lessorEqual', paramNum: 1 },
  18. { operator: '!=', name: 'config.isNot', paramNum: 1 },
  19. { operator: 'BETWEEN', name: 'config.between', paramNum: 2 },
  20. { operator: 'IN', name: 'config.in', paramNum: -1 },
  21. { operator: 'LIKE', name: 'config.like', paramNum: 1 },
  22. ]
  23. export function getFilterOperator() {
  24. return filterOperator.map(item => {
  25. const i18nItem = { ...item }
  26. i18nItem.name = i18n.t(item.name)
  27. return i18nItem
  28. })
  29. }
  30. export const dataType = [
  31. { name: 'tinyint', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  32. { name: 'smallint', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  33. { name: 'mediumint', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  34. { name: 'int', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  35. { name: 'bigint', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  36. { name: 'float', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  37. { name: 'double', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  38. { name: 'real', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  39. { name: 'decimal', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] },
  40. { name: 'timestamp', needQuotation: false, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  41. { name: 'date', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  42. { name: 'time', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  43. { name: 'datetime', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  44. { name: 'year', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  45. { name: 'char', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  46. { name: 'varchar', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  47. { name: 'tinytext', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  48. { name: 'text', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  49. { name: 'mediumtext', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  50. { name: 'longtext', needQuotation: true, availableFunc: ['count', 'none', 'custbiaozhun', 'custbianyi'] },
  51. { name: 'integer', needQuotation: false, availableFunc: ['sum', 'avg', 'max', 'min', 'count', 'none', 'custbiaozhun', 'custbianyi'] }
  52. ]