setting.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <div class="bs-setting-wrap">
  3. <el-form
  4. ref="form"
  5. :model="config"
  6. label-width="90px"
  7. label-position="left"
  8. class="setting-body bs-el-form"
  9. >
  10. <SettingTitle>标题</SettingTitle>
  11. <div class="lc-field-body">
  12. <el-form-item
  13. label="标题"
  14. label-width="100px"
  15. >
  16. <el-input
  17. v-model="config.title"
  18. placeholder="请输入标题"
  19. clearable
  20. />
  21. </el-form-item>
  22. </div>
  23. <SettingTitle>位置</SettingTitle>
  24. <div class="lc-field-body">
  25. <PosWhSetting :config="config" />
  26. </div>
  27. <SettingTitle v-if="config.border">
  28. 边框
  29. </SettingTitle>
  30. <div class="lc-field-body">
  31. <BorderSetting
  32. v-if="config.border"
  33. label-width="100px"
  34. :config="config.border"
  35. :big-title="config.title"
  36. />
  37. </div>
  38. <SettingTitle>旋转</SettingTitle>
  39. <div class="lc-field-body">
  40. <RotateSetting
  41. :config="config"
  42. />
  43. </div>
  44. <SettingTitle>图表</SettingTitle>
  45. <div class="lc-field-body">
  46. <el-form-item
  47. label="图形背景色"
  48. label-width="100px"
  49. >
  50. <el-radio-group
  51. v-model="lineColorType"
  52. style="margin-bottom: 8px;"
  53. >
  54. <el-radio :label="'theme'">
  55. 颜色字段
  56. </el-radio>
  57. <el-radio :label="'customize'">
  58. 自定义
  59. </el-radio>
  60. </el-radio-group>
  61. <el-select
  62. v-if="lineColorType === 'theme'"
  63. v-model="config.customize.normal.lineColor"
  64. popper-class="bs-el-select"
  65. class="bs-el-select"
  66. placeholder="请选择颜色字段"
  67. >
  68. <el-option
  69. v-for="item in colorFields"
  70. :key="item.value"
  71. :label="item.label"
  72. :value="item.value"
  73. />
  74. </el-select>
  75. <ColorPicker
  76. v-if="lineColorType === 'customize'"
  77. v-model="config.customize.normal.lineColor"
  78. :predefine-colors="predefineThemeColors"
  79. />
  80. </el-form-item>
  81. <el-form-item
  82. label="图形弯曲度"
  83. label-width="100px"
  84. >
  85. <el-input-number
  86. v-model="config.customize.normal.lineCurveness"
  87. class="bs-el-input-number"
  88. />
  89. </el-form-item>
  90. <el-form-item
  91. label="矩形边框色"
  92. label-width="100px"
  93. >
  94. <ColorPicker
  95. v-model="config.customize.normal.itemBorderColor"
  96. :predefine-colors="predefineThemeColors"
  97. />
  98. </el-form-item>
  99. <el-form-item
  100. label="矩形边框宽度"
  101. label-width="100px"
  102. >
  103. <el-input-number
  104. v-model="config.customize.normal.itemBorderWidth"
  105. class="bs-el-input-number"
  106. />
  107. </el-form-item>
  108. <el-form-item
  109. label="矩形边框样式"
  110. label-width="100px"
  111. >
  112. <el-select
  113. v-model="config.customize.normal.itemBorderType"
  114. popper-class="bs-el-select"
  115. class="bs-el-select"
  116. placeholder="请选择位置"
  117. >
  118. <el-option
  119. v-for="item in borderTypeList"
  120. :key="item.value"
  121. :label="item.label"
  122. :value="item.value"
  123. />
  124. </el-select>
  125. </el-form-item>
  126. <el-form-item
  127. label="标签位置"
  128. label-width="100px"
  129. >
  130. <el-select
  131. v-model="config.customize.normal.labelPosition"
  132. popper-class="bs-el-select"
  133. class="bs-el-select"
  134. placeholder="请选择位置"
  135. >
  136. <el-option
  137. v-for="item in labelPositionList"
  138. :key="item.value"
  139. :label="item.label"
  140. :value="item.value"
  141. />
  142. </el-select>
  143. </el-form-item>
  144. <el-form-item
  145. label="标签颜色"
  146. label-width="100px"
  147. >
  148. <ColorPicker
  149. v-model="config.customize.normal.labelColor"
  150. :predefine-colors="predefineThemeColors"
  151. />
  152. </el-form-item>
  153. <el-form-item
  154. label="标签字体大小"
  155. label-width="100px"
  156. >
  157. <el-input-number
  158. v-model="config.customize.normal.labelSize"
  159. class="bs-el-input-number"
  160. />
  161. </el-form-item>
  162. <el-form-item
  163. label="标签字体粗细"
  164. label-width="100px"
  165. >
  166. <el-select
  167. v-model="config.customize.normal.labelFontWeight"
  168. popper-class="bs-el-select"
  169. class="bs-el-select"
  170. placeholder="请选择位置"
  171. >
  172. <el-option
  173. v-for="item in fontWeightList"
  174. :key="item.value"
  175. :label="item.label"
  176. :value="item.value"
  177. />
  178. </el-select>
  179. </el-form-item>
  180. </div>
  181. <SettingTitle>
  182. 高亮设置
  183. </SettingTitle>
  184. <div class="lc-field-body">
  185. <el-form-item
  186. label="图形背景色"
  187. label-width="100px"
  188. >
  189. <el-radio-group v-model="lineColorType">
  190. <el-radio :label="'theme'">
  191. 颜色字段
  192. </el-radio>
  193. <el-radio :label="'customize'">
  194. 自定义
  195. </el-radio>
  196. </el-radio-group>
  197. <el-select
  198. v-if="lineColorType === 'theme'"
  199. v-model="config.customize.emphasis.lineColor"
  200. popper-class="bs-el-select"
  201. class="bs-el-select"
  202. placeholder="请选择颜色字段"
  203. >
  204. <el-option
  205. v-for="item in colorFields"
  206. :key="item.value"
  207. :label="item.label"
  208. :value="item.value"
  209. />
  210. </el-select>
  211. <ColorPicker
  212. v-if="lineColorType === 'customize'"
  213. v-model="config.customize.emphasis.lineColor"
  214. :predefine-colors="predefineThemeColors"
  215. />
  216. </el-form-item>
  217. <el-form-item
  218. label="矩形边框色"
  219. label-width="100px"
  220. >
  221. <ColorPicker
  222. v-model="config.customize.emphasis.itemBorderColor"
  223. :predefine-colors="predefineThemeColors"
  224. />
  225. </el-form-item>
  226. <el-form-item
  227. label="矩形边框宽度"
  228. label-width="100px"
  229. >
  230. <el-input-number
  231. v-model="config.customize.emphasis.itemBorderWidth"
  232. class="bs-el-input-number"
  233. />
  234. </el-form-item>
  235. <el-form-item
  236. label="矩形边框样式"
  237. label-width="100px"
  238. >
  239. <el-select
  240. v-model="config.customize.emphasis.itemBorderType"
  241. popper-class="bs-el-select"
  242. class="bs-el-select"
  243. placeholder="请选择位置"
  244. >
  245. <el-option
  246. v-for="item in borderTypeList"
  247. :key="item.value"
  248. :label="item.label"
  249. :value="item.value"
  250. />
  251. </el-select>
  252. </el-form-item>
  253. <el-form-item
  254. label="标签颜色"
  255. label-width="100px"
  256. >
  257. <ColorPicker
  258. v-model="config.customize.emphasis.labelColor"
  259. :predefine-colors="predefineThemeColors"
  260. />
  261. </el-form-item>
  262. <el-form-item
  263. label="标签字体大小"
  264. label-width="100px"
  265. >
  266. <el-input-number
  267. v-model="config.customize.emphasis.labelSize"
  268. class="bs-el-input-number"
  269. />
  270. </el-form-item>
  271. <el-form-item
  272. label="标签字体粗细"
  273. label-width="100px"
  274. >
  275. <el-select
  276. v-model="config.customize.emphasis.labelFontWeight"
  277. popper-class="bs-el-select"
  278. class="bs-el-select"
  279. placeholder="请选择位置"
  280. >
  281. <el-option
  282. v-for="item in fontWeightList"
  283. :key="item.value"
  284. :label="item.label"
  285. :value="item.value"
  286. />
  287. </el-select>
  288. </el-form-item>
  289. </div>
  290. </el-form>
  291. </div>
  292. </template>
  293. <script>
  294. import SettingTitle from 'data-room-ui/SettingTitle/index.vue'
  295. import { chartSettingMixins } from 'data-room-ui/js/mixins/chartSettingMixins'
  296. import ColorSelect from 'data-room-ui/ColorMultipleSelect/index.vue'
  297. import ColorPicker from 'data-room-ui/ColorPicker/index.vue'
  298. import BorderSetting from 'data-room-ui/BigScreenDesign/RightSetting/BorderSetting.vue'
  299. import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue'
  300. import RotateSetting from 'data-room-ui/BigScreenDesign/RightSetting/RotateSetting.vue'
  301. import { predefineColors } from 'data-room-ui/js/utils/colorList'
  302. export default {
  303. name: 'BarSetting',
  304. components: {
  305. ColorPicker,
  306. SettingTitle,
  307. PosWhSetting,
  308. BorderSetting,
  309. RotateSetting
  310. },
  311. mixins: [chartSettingMixins],
  312. props: {},
  313. data () {
  314. return {
  315. lineColorType: 'theme',
  316. fontWeightList: [
  317. {
  318. label: '正常',
  319. value: 'normal'
  320. },
  321. {
  322. label: '粗体',
  323. value: 'bold'
  324. },
  325. {
  326. label: '加粗',
  327. value: 'bolder'
  328. },
  329. {
  330. label: '细体',
  331. value: 'lighter'
  332. }
  333. ],
  334. colorFields: [
  335. {
  336. label: '起始字段',
  337. value: 'source'
  338. },
  339. {
  340. label: '目标字段',
  341. value: 'target'
  342. },
  343. {
  344. label: '渐变色',
  345. value: 'gradient'
  346. }
  347. ],
  348. borderTypeList: [
  349. {
  350. label: '实线',
  351. value: 'solid'
  352. },
  353. {
  354. label: '虚线',
  355. value: 'dashed'
  356. },
  357. {
  358. label: '点线',
  359. value: 'dotted'
  360. }
  361. ],
  362. labelPositionList: [
  363. {
  364. label: '顶部',
  365. value: 'top'
  366. },
  367. {
  368. label: '底部',
  369. value: 'bottom'
  370. },
  371. {
  372. label: '靠左',
  373. value: 'left'
  374. },
  375. {
  376. label: '靠右',
  377. value: 'right'
  378. },
  379. {
  380. label: '内部',
  381. value: 'inside'
  382. },
  383. {
  384. label: '内部靠左',
  385. value: 'insideLeft'
  386. },
  387. {
  388. label: '内部靠右',
  389. value: 'insideRight'
  390. },
  391. {
  392. label: '内部顶部',
  393. value: 'insideTop '
  394. },
  395. {
  396. label: '内部底部',
  397. value: 'insideBottom'
  398. },
  399. {
  400. label: '内部左上',
  401. value: 'insideTopLeft'
  402. },
  403. {
  404. label: '内部右上',
  405. value: 'insideTopRight'
  406. },
  407. {
  408. label: '内部左下',
  409. value: 'insideBottomLeft'
  410. },
  411. {
  412. label: '内部右下',
  413. value: 'insideBottomRight'
  414. }
  415. ],
  416. colors: [],
  417. mapList: [],
  418. predefineThemeColors: predefineColors,
  419. mapTree: [],
  420. currentMap: {},
  421. axisPositionList: [
  422. {
  423. label: '左',
  424. value: 'start'
  425. },
  426. {
  427. label: '中',
  428. value: 'center'
  429. },
  430. {
  431. label: '右',
  432. value: 'end'
  433. }]
  434. }
  435. },
  436. computed: {
  437. config: {
  438. get () {
  439. return this.$store.state.bigScreen.activeItemConfig
  440. },
  441. set (val) {
  442. this.$store.state.bigScreen.activeItemConfig = val
  443. }
  444. }
  445. },
  446. watch: {},
  447. mounted () {
  448. this.colors = this.config.customize.rangeColor
  449. },
  450. methods: {
  451. delColor () {
  452. if (this.colors.length <= 2) return
  453. this.colors.pop()
  454. this.config.customize.rangeColor.pop()
  455. },
  456. addColor () {
  457. this.colors.push('#fff')
  458. },
  459. updateColorScheme (colors) {
  460. this.colors = [...colors]
  461. this.config.customize.rangeColor = [...colors]
  462. }
  463. }
  464. }
  465. </script>
  466. <style lang="scss" scoped>
  467. @import '../../assets/style/settingWrap.scss';
  468. @import '../../assets/style/bsTheme.scss';
  469. // 筛选条件的按钮样式
  470. .add-filter-box {
  471. position: relative;
  472. .add-filter {
  473. margin-left: 90px;
  474. margin-bottom: 10px;
  475. }
  476. .add-filter-btn {
  477. position: absolute;
  478. top: 0;
  479. }
  480. }
  481. .lc-field-body {
  482. padding: 12px 16px;
  483. }
  484. ::v-deep .bs-el-slider-dark {
  485. .el-slider__runway {
  486. background-color: var(--bs-el-background-1) !important;
  487. }
  488. }
  489. </style>