setting.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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>基础</SettingTitle>
  31. <div class="lc-field-body">
  32. <el-form-item
  33. label="字体大小"
  34. label-width="100px"
  35. >
  36. <el-input-number
  37. v-model="config.customize.fontSize"
  38. class="bs-el-input-number"
  39. placeholder="请输入字体大小"
  40. :min="0"
  41. />
  42. </el-form-item>
  43. <el-form-item
  44. label="字体权重"
  45. label-width="100px"
  46. >
  47. <el-input-number
  48. v-model="config.customize.fontWeight"
  49. class="bs-el-input-number"
  50. placeholder="请输入字体权重"
  51. />
  52. </el-form-item>
  53. <el-form-item
  54. label="字体颜色"
  55. label-width="100px"
  56. >
  57. <el-color-picker
  58. v-model="config.customize.color"
  59. popper-class="bs-el-color-picker"
  60. class="bs-el-color-picker"
  61. />
  62. </el-form-item>
  63. <el-form-item
  64. label="结束日期"
  65. label-width="100px"
  66. >
  67. <el-date-picker
  68. v-model="config.endTime"
  69. style="position: relative;"
  70. popper-class="bs-el-date-picker"
  71. type="datetime"
  72. align="left"
  73. size="mini"
  74. placeholder="请选择结束日期"
  75. :picker-options="pickerOptions"
  76. value-format="timestamp"
  77. :append-to-body="false"
  78. />
  79. </el-form-item>
  80. </div>
  81. </el-form>
  82. </div>
  83. </template>
  84. <script>
  85. import SettingTitle from 'data-room-ui/SettingTitle/index.vue'
  86. import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue'
  87. export default {
  88. name: 'TimeCountDownSetting',
  89. components: {
  90. PosWhSetting,
  91. SettingTitle
  92. },
  93. data () {
  94. return {
  95. pickerOptions: {
  96. disabledDate (time) {
  97. return time.getTime() < Date.now() - 8.64e7
  98. }
  99. },
  100. HeaderFontSizeList: [
  101. { label: '正常', value: 16 },
  102. { label: '较小', value: 14 },
  103. { label: '较大', value: 30 }
  104. ],
  105. numberFormatList: [
  106. { label: '原始数据', value: 'value' },
  107. { label: '千位分隔', value: 'kilobit' }
  108. ]
  109. }
  110. },
  111. computed: {
  112. config: {
  113. get () {
  114. return this.$store.state.bigScreen.activeItemConfig
  115. },
  116. set (val) {
  117. this.$store.state.bigScreen.activeItemConfig = val
  118. }
  119. }
  120. },
  121. watch: {},
  122. mounted () {
  123. this.initEndTime()
  124. },
  125. methods: {
  126. initEndTime () {
  127. if (this.config.endTime) {
  128. this.config.endTime = new Date(this.config.endTime).getTime()
  129. }
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. @import "../../assets/style/settingWrap.scss";
  136. .setting-wrap {
  137. padding-top: 16px;
  138. }
  139. .el-date-editor.el-input,
  140. .el-date-editor.el-input__inner {
  141. width: 100%;
  142. }
  143. .lc-field-body {
  144. padding: 12px 16px;
  145. }
  146. </style>