input.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // 输入框组件
  2. import { positionList } from './article';
  3. import { commonSetProperty, serialNumberStyleList } from './common';
  4. // 模式列表
  5. export const modelList = [
  6. {
  7. value: 'pinyin',
  8. label: '拼音',
  9. },
  10. {
  11. value: 'chinese',
  12. label: '汉字',
  13. },
  14. {
  15. value: 'english',
  16. label: '英文',
  17. },
  18. ];
  19. // 输入框样式
  20. export const inputStyleList = [
  21. {
  22. value: 'horizontal_line',
  23. label: '横线',
  24. },
  25. {
  26. value: 'input',
  27. label: '输入框',
  28. },
  29. ];
  30. export const fontList = [
  31. {
  32. value: 'arial, helvetica, sans-serif',
  33. label: 'Arial',
  34. isPinyin: false,
  35. },
  36. {
  37. value: 'League',
  38. label: '拼音=League',
  39. isPinyin: true,
  40. },
  41. {
  42. value: '楷体,微软雅黑',
  43. label: '楷体=楷体,微软雅黑',
  44. isPinyin: false,
  45. },
  46. {
  47. value: '黑体,微软雅黑',
  48. label: '黑体=黑体,微软雅黑;',
  49. isPinyin: false,
  50. },
  51. {
  52. value: '宋体,微软雅黑',
  53. label: '宋体=宋体,微软雅黑;',
  54. isPinyin: false,
  55. },
  56. ];
  57. export const fontSizeList = [12, 14, 16, 18, 20, 22, 24, 26, 28, 30];
  58. export const textAlignList = [
  59. {
  60. value: 'left',
  61. label: '左对齐',
  62. },
  63. {
  64. value: 'center',
  65. label: '居中对齐',
  66. },
  67. {
  68. value: 'right',
  69. label: '右对齐',
  70. },
  71. ];
  72. export function getInputProperty() {
  73. return {
  74. ...commonSetProperty,
  75. sn_style: serialNumberStyleList[0].value,
  76. sn_background_color: '#ea3232', // 序号背景色
  77. is_enable_pinyin: true, // 是否启用拼音
  78. pinyin_position: positionList[0].value, // 拼音位置
  79. is_enable_sentence_case: true, // 句首大写
  80. is_enable_auto_correct: true, // 自动修正
  81. model: modelList[0].value, // 模式
  82. input_style: inputStyleList[0].value, // 输入框样式
  83. font: fontList[1].value, // 字体
  84. font_size: fontSizeList[3], // 字体大小
  85. text_align: textAlignList[0].value, // 文本对齐方式
  86. text_color: '#1d2129', // 文本颜色
  87. background_color: '#ffffff', // 背景色
  88. };
  89. }
  90. export function getInputData() {
  91. return {
  92. type: 'input',
  93. title: '输入框',
  94. property: getInputProperty(),
  95. answer: {
  96. text: '', // 答案文本
  97. },
  98. content: '', // 文本内容
  99. };
  100. }