setting.vue 3.9 KB

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