setting.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!--
  2. * @description: 指标组件案例设计面板
  3. * @Date: 2022-08-17 16:53:28
  4. * @Author: xingheng
  5. -->
  6. <template>
  7. <div class="setting-wrap">
  8. <el-form
  9. ref="form"
  10. label-width="100px"
  11. label-position="left"
  12. :model="config"
  13. class="bs-el-form"
  14. >
  15. <SettingTitle>标题</SettingTitle>
  16. <el-form-item
  17. class="lc-field-body"
  18. label="标题"
  19. label-width="100px"
  20. >
  21. <el-input
  22. v-model="config.title"
  23. placeholder="请输入标题"
  24. />
  25. </el-form-item>
  26. <SettingTitle>位置</SettingTitle>
  27. <div class="lc-field-body">
  28. <PosWhSetting :config="config" />
  29. </div>
  30. <SettingTitle v-if="config.border">边框</SettingTitle>
  31. <div class="lc-field-body">
  32. <BorderSetting
  33. v-if="config.border"
  34. label-width="100px"
  35. :config="config.border"
  36. :bigTitle='config.title'
  37. />
  38. </div>
  39. <SettingTitle>旋转</SettingTitle>
  40. <div class="lc-field-body">
  41. <RotateSetting
  42. :config="config"
  43. />
  44. </div>
  45. <SettingTitle>基础</SettingTitle>
  46. <div class="lc-field-body">
  47. <el-form-item
  48. label="字体大小"
  49. label-width="100px"
  50. >
  51. <el-input-number
  52. v-model="config.customize.fontSize"
  53. class="bs-el-input-number"
  54. placeholder="请输入字体大小"
  55. :min="0"
  56. />
  57. </el-form-item>
  58. <el-form-item
  59. label="字体权重"
  60. label-width="100px"
  61. >
  62. <el-input-number
  63. v-model="config.customize.fontWeight"
  64. class="bs-el-input-number"
  65. placeholder="请输入字体权重"
  66. />
  67. </el-form-item>
  68. <el-form-item
  69. label="字体类型"
  70. label-width="100px"
  71. >
  72. <el-select
  73. v-model="config.customize.fontFamily"
  74. popper-class="bs-el-select"
  75. class="bs-el-select"
  76. >
  77. <el-option
  78. v-for="item in fontFamilyList"
  79. :key="item.value"
  80. :label="item.label"
  81. :value="item.value"
  82. />
  83. </el-select>
  84. </el-form-item>
  85. <el-form-item
  86. label="字体颜色"
  87. label-width="100px"
  88. >
  89. <el-color-picker
  90. v-model="config.customize.color"
  91. popper-class="bs-el-color-picker"
  92. class="bs-el-color-picker"
  93. />
  94. </el-form-item>
  95. <el-form-item
  96. label="结束日期"
  97. label-width="100px"
  98. >
  99. <el-date-picker
  100. v-model="config.endTime"
  101. style="position: relative;"
  102. popper-class="bs-el-date-picker"
  103. type="datetime"
  104. align="left"
  105. size="mini"
  106. placeholder="请选择结束日期"
  107. :picker-options="pickerOptions"
  108. value-format="timestamp"
  109. :append-to-body="false"
  110. />
  111. </el-form-item>
  112. </div>
  113. </el-form>
  114. </div>
  115. </template>
  116. <script>
  117. import SettingTitle from 'data-room-ui/SettingTitle/index.vue'
  118. import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue'
  119. import BorderSetting from 'data-room-ui/BigScreenDesign/RightSetting/BorderSetting.vue'
  120. import RotateSetting from 'data-room-ui/BigScreenDesign/RightSetting/RotateSetting.vue'
  121. import fontList from 'data-room-ui/js/utils/fontList'
  122. export default {
  123. name: 'TimeCountDownSetting',
  124. components: {
  125. PosWhSetting,
  126. SettingTitle,
  127. BorderSetting,
  128. RotateSetting
  129. },
  130. data () {
  131. return {
  132. fontFamilyList: fontList,
  133. pickerOptions: {
  134. disabledDate (time) {
  135. return time.getTime() < Date.now() - 8.64e7
  136. }
  137. },
  138. HeaderFontSizeList: [
  139. { label: '正常', value: 16 },
  140. { label: '较小', value: 14 },
  141. { label: '较大', value: 30 }
  142. ],
  143. numberFormatList: [
  144. { label: '原始数据', value: 'value' },
  145. { label: '千位分隔', value: 'kilobit' }
  146. ]
  147. }
  148. },
  149. computed: {
  150. config: {
  151. get () {
  152. return this.$store.state.bigScreen.activeItemConfig
  153. },
  154. set (val) {
  155. this.$store.state.bigScreen.activeItemConfig = val
  156. }
  157. }
  158. },
  159. watch: {},
  160. mounted () {
  161. this.initEndTime()
  162. },
  163. methods: {
  164. initEndTime () {
  165. if (this.config.endTime) {
  166. this.config.endTime = new Date(this.config.endTime).getTime()
  167. }
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. @import "../../assets/style/settingWrap.scss";
  174. .setting-wrap {
  175. padding-top: 16px;
  176. }
  177. .el-date-editor.el-input,
  178. .el-date-editor.el-input__inner {
  179. width: 100%;
  180. }
  181. .lc-field-body {
  182. padding: 12px 16px;
  183. }
  184. </style>