setting.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. />
  76. </el-form-item>
  77. <el-form-item
  78. label="文字间距"
  79. label-width="100px"
  80. >
  81. <el-input-number
  82. v-model="config.customize.letterSpacing"
  83. class="bs-el-input-number"
  84. placeholder="请输入文字间距"
  85. />
  86. </el-form-item>
  87. <el-form-item
  88. label="文字类型"
  89. label-width="100px"
  90. >
  91. <el-select
  92. v-model="config.customize.fontFamily"
  93. popper-class="bs-el-select"
  94. class="bs-el-select"
  95. >
  96. <el-option
  97. v-for="item in fontFamilyList"
  98. :key="item.value"
  99. :label="item.label"
  100. :value="item.value"
  101. />
  102. </el-select>
  103. </el-form-item>
  104. <el-form-item
  105. label="文字对齐方式"
  106. label-width="100px"
  107. >
  108. <el-select
  109. v-model="config.customize.align"
  110. popper-class="bs-el-select"
  111. class="bs-el-select"
  112. >
  113. <el-option
  114. v-for="item in alignList"
  115. :key="item.value"
  116. :label="item.label"
  117. :value="item.value"
  118. />
  119. </el-select>
  120. </el-form-item>
  121. <TextGradient v-model="config.customize.color" />
  122. </div>
  123. </el-form>
  124. </div>
  125. </template>
  126. <script>
  127. import SettingTitle from 'data-room-ui/SettingTitle/index.vue'
  128. import BorderSetting from 'data-room-ui/BigScreenDesign/RightSetting/BorderSetting.vue'
  129. import TextGradient from 'data-room-ui/BigScreenDesign/RightSetting/TextGradient/index'
  130. import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue'
  131. import RotateSetting from 'data-room-ui/BigScreenDesign/RightSetting/RotateSetting.vue'
  132. import fontList from 'data-room-ui/js/utils/fontList'
  133. import { mapMutations } from 'vuex'
  134. export default {
  135. name: 'TextSetting',
  136. components: {
  137. TextGradient,
  138. PosWhSetting,
  139. SettingTitle,
  140. BorderSetting,
  141. RotateSetting
  142. },
  143. data () {
  144. return {
  145. fontFamilyList: fontList,
  146. alignList: [{
  147. label: '靠左',
  148. value: 'left'
  149. },
  150. {
  151. label: '居中',
  152. value: 'center'
  153. },
  154. {
  155. label: '靠右',
  156. value: 'right'
  157. }],
  158. rules: {
  159. title: [
  160. { required: true, message: '请输入标题', trigger: 'blur' }
  161. ]
  162. }
  163. }
  164. },
  165. computed: {
  166. config: {
  167. get () {
  168. return this.$store.state.bigScreen.activeItemConfig
  169. },
  170. set (val) {
  171. this.$store.state.bigScreen.activeItemConfig = val
  172. }
  173. }
  174. },
  175. watch: {
  176. },
  177. mounted () {},
  178. methods: {
  179. ...mapMutations({
  180. updateDataset: 'bigScreen/updateDataset',
  181. updateComputedDatas: 'bigScreen/updateComputedDatas'
  182. })
  183. }
  184. }
  185. </script>
  186. <style lang="scss" scoped>
  187. @import "../../assets/style/settingWrap.scss";
  188. .bs-setting-wrap{
  189. padding-top: 16px;
  190. }
  191. .lc-field-body {
  192. padding: 12px 16px;
  193. }
  194. </style>