bigScreenApi.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. a[a.dataKey] = []
  12. item.option=JSON.stringify(a)
  13. item.setting=item.setting.map((x) => {
  14. const {field,value,...obj}=x
  15. return {field,value}
  16. })
  17. }
  18. })
  19. return Vue.prototype.$dataRoomAxios.post('/bigScreen/design/update', data)
  20. }
  21. // 根据数据集获取数据集详情
  22. export function getDataSetDetails (id) {
  23. return Vue.prototype.$dataRoomAxios.get('/dataset/datasetInfo/' + id)
  24. }
  25. // 根据数据集id获取数据
  26. export function getDataByDataSetId (dataSetId) {
  27. return Vue.prototype.$dataRoomAxios.post('/dataset/execute', {
  28. dataSetId,
  29. params: []
  30. })
  31. }
  32. // 得到图表详情
  33. export function getChatInfo (params) {
  34. return Vue.prototype.$dataRoomAxios.post('/bigScreen/chart/data/list', params)
  35. }
  36. // 得到图表的更新数据
  37. export function getUpdateChartInfo (params) {
  38. return Vue.prototype.$dataRoomAxios.post('/bigScreen/chart/data/chart', params)
  39. }
  40. // 业务组件列表
  41. export function getBizComponentPage (params) {
  42. return Vue.prototype.$dataRoomAxios.get('/bigScreen/bizComponent/page', params)
  43. }
  44. // 根据code获得业务组件的信息
  45. export function getBizComponentInfo (code) {
  46. return Vue.prototype.$dataRoomAxios.get(`/bigScreen/bizComponent/info/${code}`)
  47. }
  48. // 更新业务组件
  49. export function updateBizComponent (params) {
  50. return Vue.prototype.$dataRoomAxios.post('/bigScreen/bizComponent/update', params)
  51. }