1001510044_edit.jsp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <html>
  2. <head>
  3. <link rel="stylesheet" type="text/css" href="/apps/space/plug-in/gooflow/css/GooFlow.css" />
  4. <script src="/apps/space/plug-in/gooflow/GooFlow.js" type="text/javascript" charset="utf-8"></script>
  5. <script src="/apps/space/plug-in/gooflow/GooFunc.js" type="text/javascript" charset="utf-8"></script>
  6. </head>
  7. <body>
  8. <div id="space-content">
  9. <div class="demo"></div>
  10. </div>
  11. </body>
  12. <script type="text/javascript">
  13. space.vue = new Vue({
  14. el: space.appContent,
  15. data() {
  16. return {
  17. serviceUrl: {
  18. flowChartUrl: '@service{ name:`sys_flow_chart`}@'
  19. },
  20. // GooFlow 实例化与改变节点属性时需要的
  21. gooFlow: {
  22. // GooFlow 元素标签,
  23. el: '.demo',
  24. // 初始化流程图的参数
  25. property: {
  26. width: 1200,
  27. height: 500
  28. },
  29. initData: {}
  30. },
  31. gooFlowObj: undefined
  32. }
  33. },
  34. created: function() {
  35. console.log('初始化工作')
  36. this.initFlowChart();
  37. },
  38. mounted: function() {
  39. // 设置 gooFlow 的宽高
  40. this.gooFlowObj = $.createGooFlow($(this.gooFlow.el), this.gooFlow.property, this)
  41. console.log('流程节点数据', this.gooFlow.initData)
  42. // this.gooFlowObj.loadData(this.gooFlow.initData);
  43. },
  44. methods: {
  45. /**
  46. * 初始化流程图
  47. */
  48. initFlowChart() {
  49. var _this = this;
  50. space.utils.ajax({
  51. url: _this.serviceUrl.flowChartUrl,
  52. dataType: 'json',
  53. success: function(data) {
  54. _this.gooFlow.initData = data.data
  55. console.log(_this.gooFlow.initData)
  56. _this.gooFlowObj.loadData(_this.gooFlow.initData);
  57. }
  58. });
  59. }
  60. }
  61. })
  62. </script>
  63. </html>