rate.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import { Config } from "@/types/config";
  2. const config: Config = {
  3. url: "https://element.eleme.cn/#/zh-CN/component/rate",
  4. attrs: {
  5. max: {
  6. type: "number",
  7. label: "最大分值",
  8. attrs: {
  9. min: 0
  10. }
  11. },
  12. allowHalf: {
  13. type: "switch",
  14. label: "是否允许半选"
  15. },
  16. lowThreshold: {
  17. type: "number",
  18. label: "低分和中等分数的界限值,值本身被划分在低分中",
  19. attrs: {
  20. min: 0
  21. }
  22. },
  23. highThreshold: {
  24. type: "number",
  25. label: "高分和中等分数的界限值,值本身被划分在高分中",
  26. attrs: {
  27. min: 0
  28. }
  29. },
  30. colors: {
  31. type: "json-editor",
  32. label: "icon 的颜色(3个元素)"
  33. },
  34. voidColor: {
  35. type: "color",
  36. label: "未选中 icon 的颜色"
  37. },
  38. disabledVoidColor: {
  39. type: "color",
  40. label: "只读时未选中 icon 的颜色"
  41. },
  42. iconClasses: {
  43. type: "json-editor",
  44. label: "icon 的类名"
  45. },
  46. voidIconClass: {
  47. type: "input",
  48. label: "未选中 icon 的类名"
  49. },
  50. disabledVoidIconClass: {
  51. type: "input",
  52. label: "只读时未选中 icon 的类名"
  53. },
  54. showText: {
  55. type: "switch",
  56. label:
  57. "是否显示辅助文字,若为真,则会从 texts 数组中选取当前分数对应的文字内容"
  58. },
  59. showScore: {
  60. type: "switch",
  61. label: "是否显示当前分数,show-score 和 show-text 不能同时为真"
  62. },
  63. textColor: {
  64. type: "color",
  65. label: "辅助文字的颜色"
  66. },
  67. texts: {
  68. type: "json-editor",
  69. label: "辅助文字数组"
  70. },
  71. scoreTemplate: {
  72. type: "input",
  73. label: "分数显示模板"
  74. }
  75. },
  76. attrsData: {},
  77. attrsDefaultData: {
  78. max: 5,
  79. allowHalf: false,
  80. lowThreshold: 2,
  81. highThreshold: 4,
  82. colors: ["#F7BA2A", "#F7BA2A", "#F7BA2A"],
  83. voidColor: "#C6D1DE",
  84. disabledVoidColor: "#EFF2F7",
  85. iconClasses: ["el-icon-star-on", "el-icon-star-on", "el-icon-star-on"],
  86. voidIconClass: "el-icon-star-off",
  87. disabledVoidIconClass: "el-icon-star-on",
  88. showText: false,
  89. showScore: false,
  90. textColor: "#1F2D3D",
  91. texts: ["极差", "失望", "一般", "满意", "惊喜"],
  92. scoreTemplate: "{value}"
  93. },
  94. common: {
  95. default: {
  96. type: "number",
  97. label: "默认值"
  98. }
  99. },
  100. commonData: {},
  101. commonDefaultData: {
  102. default: 0
  103. }
  104. };
  105. export default config;