setting.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <!--
  2. * @description: 标题属性设置面板
  3. * @Date: 2022-08-17 16:53:28
  4. * @Author: shiyi
  5. -->
  6. <template>
  7. <div class="bs-setting-wrap">
  8. <el-form
  9. ref="form"
  10. label-width="100px"
  11. label-position="left"
  12. :model="config"
  13. :rules="rules"
  14. class="bs-el-form"
  15. >
  16. <SettingTitle>标题</SettingTitle>
  17. <div class="bs-setting-wrap">
  18. <el-form-item
  19. label="标题"
  20. label-width="100px"
  21. prop="title"
  22. >
  23. <el-input
  24. v-model="config.title"
  25. placeholder="请输入标题"
  26. clearable
  27. />
  28. </el-form-item>
  29. </div>
  30. <SettingTitle>位置</SettingTitle>
  31. <div class="lc-field-body">
  32. <PosWhSetting :config="config" />
  33. </div>
  34. <SettingTitle v-if="config.border">
  35. 边框
  36. </SettingTitle>
  37. <div class="lc-field-body">
  38. <BorderSetting
  39. v-if="config.border"
  40. label-width="100px"
  41. :config="config.border"
  42. :big-title="config.title"
  43. />
  44. </div>
  45. <SettingTitle>旋转</SettingTitle>
  46. <div class="lc-field-body">
  47. <RotateSetting
  48. :config="config"
  49. />
  50. </div>
  51. <SettingTitle>基础</SettingTitle>
  52. <div class="lc-field-body">
  53. <el-form-item
  54. label="字体大小"
  55. label-width="100px"
  56. >
  57. <el-input
  58. v-model="config.customize.fontSize"
  59. placeholder="请输入字体大小"
  60. clearable
  61. >
  62. <template slot="append">
  63. px
  64. </template>
  65. </el-input>
  66. </el-form-item>
  67. <el-form-item
  68. label="数字权重"
  69. label-width="100px"
  70. >
  71. <el-input-number
  72. v-model="config.customize.fontWeight"
  73. class="bs-el-input-number"
  74. placeholder="请输入数字权重"
  75. :min="0"
  76. :step="100"
  77. />
  78. </el-form-item>
  79. <el-form-item
  80. label="数字间距"
  81. label-width="100px"
  82. >
  83. <el-input-number
  84. v-model="config.customize.letterSpacing"
  85. class="bs-el-input-number"
  86. placeholder="请输入数字间距"
  87. />
  88. </el-form-item>
  89. <el-form-item
  90. label="字体类型"
  91. label-width="100px"
  92. >
  93. <el-select
  94. v-model="config.customize.fontFamily"
  95. popper-class="bs-el-select"
  96. class="bs-el-select"
  97. >
  98. <el-option
  99. v-for="item in fontFamilyList"
  100. :key="item.value"
  101. :label="item.label"
  102. :value="item.value"
  103. />
  104. </el-select>
  105. </el-form-item>
  106. <el-form-item
  107. label="数字对齐方式"
  108. label-width="100px"
  109. >
  110. <el-select
  111. v-model="config.customize.align"
  112. popper-class="bs-el-select"
  113. class="bs-el-select"
  114. >
  115. <el-option
  116. v-for="item in alignList"
  117. :key="item.value"
  118. :label="item.label"
  119. :value="item.value"
  120. />
  121. </el-select>
  122. </el-form-item>
  123. <!-- 是否开启语音播报 -->
  124. <el-form-item
  125. label="千分位分隔"
  126. label-width="100px"
  127. >
  128. <el-switch
  129. v-model="config.customize.thousands"
  130. :active-value="true"
  131. :inactive-value="false"
  132. class="bs-el-switch"
  133. />
  134. </el-form-item>
  135. <TextGradient
  136. v-model="config.customize.color"
  137. label="数字"
  138. />
  139. </div>
  140. </el-form>
  141. </div>
  142. </template>
  143. <script>
  144. import SettingTitle from 'data-room-ui/SettingTitle/index.vue'
  145. import BorderSetting from 'data-room-ui/BigScreenDesign/RightSetting/BorderSetting.vue'
  146. import TextGradient from 'data-room-ui/BigScreenDesign/RightSetting/TextGradient/index'
  147. import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue'
  148. import RotateSetting from 'data-room-ui/BigScreenDesign/RightSetting/RotateSetting.vue'
  149. import fontList from 'data-room-ui/js/utils/fontList'
  150. import { mapMutations } from 'vuex'
  151. export default {
  152. name: 'NumberSetting',
  153. components: {
  154. TextGradient,
  155. PosWhSetting,
  156. SettingTitle,
  157. BorderSetting,
  158. RotateSetting
  159. },
  160. data () {
  161. return {
  162. fontFamilyList: fontList,
  163. alignList: [{
  164. label: '靠左',
  165. value: 'left'
  166. },
  167. {
  168. label: '居中',
  169. value: 'center'
  170. },
  171. {
  172. label: '靠右',
  173. value: 'right'
  174. }],
  175. rules: {
  176. title: [
  177. { required: true, message: '请输入标题', trigger: 'blur' }
  178. ]
  179. }
  180. }
  181. },
  182. computed: {
  183. config: {
  184. get () {
  185. return this.$store.state.bigScreen.activeItemConfig
  186. },
  187. set (val) {
  188. this.$store.state.bigScreen.activeItemConfig = val
  189. }
  190. }
  191. },
  192. watch: {
  193. },
  194. mounted () {},
  195. methods: {
  196. ...mapMutations({
  197. updateDataset: 'bigScreen/updateDataset',
  198. updateComputedDatas: 'bigScreen/updateComputedDatas'
  199. })
  200. }
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. @import "../../assets/style/settingWrap.scss";
  205. .bs-setting-wrap{
  206. padding-top: 16px;
  207. }
  208. .lc-field-body {
  209. padding: 12px 16px;
  210. }
  211. </style>