bigScreenApi.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import Vue from 'vue'
  2. // 大屏详情
  3. export function getScreenInfo (code) {
  4. return Vue.prototype.$dataRoomAxios.get(`/bigScreen/design/info/code/${code}`)
  5. }
  6. // 保存更新大屏
  7. export function saveScreen(data) {
  8. data.chartList.forEach((item) => {
  9. if (item.type == 'customComponent') {
  10. const a = JSON.parse(item.option)
  11. if (a.data) {
  12. a.data = []
  13. }
  14. item.option=JSON.stringify(a)
  15. item.setting=item.setting.map((x) => {
  16. const {field,value,...obj}=x
  17. return {field,value}
  18. })
  19. }
  20. })
  21. return Vue.prototype.$dataRoomAxios.post('/bigScreen/design/update', data)
  22. }
  23. // 根据数据集获取数据集详情
  24. export function getDataSetDetails (id) {
  25. return Vue.prototype.$dataRoomAxios.get('/dataset/datasetInfo/' + id)
  26. }
  27. // 根据数据集id获取数据
  28. export function getDataByDataSetId (dataSetId) {
  29. return Vue.prototype.$dataRoomAxios.post('/dataset/execute', {
  30. dataSetId,
  31. params: []
  32. })
  33. }
  34. // 得到图表详情
  35. export function getChatInfo (params) {
  36. return Vue.prototype.$dataRoomAxios.post('/bigScreen/chart/data/list', params)
  37. }
  38. // 得到图表的更新数据
  39. export function getUpdateChartInfo (params) {
  40. return Vue.prototype.$dataRoomAxios.post('/bigScreen/chart/data/chart', params)
  41. }
  42. // 业务组件列表
  43. export function getBizComponentPage (params) {
  44. return Vue.prototype.$dataRoomAxios.get('/bigScreen/bizComponent/page', params)
  45. }
  46. // 根据code获得业务组件的信息
  47. export function getBizComponentInfo (code) {
  48. return Vue.prototype.$dataRoomAxios.get(`/bigScreen/bizComponent/info/${code}`)
  49. }
  50. // 更新业务组件
  51. export function updateBizComponent (params) {
  52. return Vue.prototype.$dataRoomAxios.post('/bigScreen/bizComponent/update', params)
  53. }