mixins.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // import Vue from 'vue'
  2. // import showDialog from './showDialog.js';
  3. // Vue.use(showDialog)
  4. export const checkVisual = {
  5. methods: {
  6. //查看可视化
  7. checkVisual(Scenario, eventId, eventName) {
  8. // this.$showDialog({
  9. // Scenario:Scenario,
  10. // eventId:eventId,
  11. // eventName:eventName
  12. // },true);
  13. this.$emit('checkVisual', {
  14. Scenario: Scenario,
  15. eventId: eventId,
  16. eventName: eventName
  17. })
  18. },
  19. handleDownload(row) {
  20. var FileUrl = `http://${this.$c.hostname}:8012/onlinePreview?url=` + btoa(encodeURIComponent(this.$p + row.url))
  21. // var FileUrl = `http://192.168.1.24:8012/onlinePreview?url=`+ btoa(encodeURIComponent(this.$p + row.url))
  22. const router = this.$router.resolve({
  23. path: '/checkFile',
  24. query: {
  25. row: JSON.stringify(row),
  26. FileUrl: FileUrl,
  27. isPicture: 0
  28. }
  29. })
  30. window.open(router.href, '_blank');
  31. },
  32. }
  33. }
  34. export const openVisual = {
  35. methods: {
  36. //查看可视化
  37. checkVisual({ Scenario, eventId, eventName }) {
  38. if (Scenario && Scenario.length > 0) {
  39. var visuals = {
  40. Scenario: Scenario,
  41. eventId: eventId,
  42. eventName: eventName
  43. }
  44. if (eventId) {
  45. this.$router.push({
  46. path: '/eventVisual',
  47. query: {
  48. visuals: JSON.stringify(visuals)
  49. }
  50. })
  51. return false
  52. }
  53. this.$refs.visualDialog.open(visuals)
  54. } else {
  55. this.$message.error('该事件下没有应用场景')
  56. }
  57. },
  58. }
  59. }