| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="/apps/space/plug-in/gooflow/css/GooFlow.css" />
- <script src="/apps/space/plug-in/gooflow/GooFlow.js" type="text/javascript" charset="utf-8"></script>
- <script src="/apps/space/plug-in/gooflow/GooFunc.js" type="text/javascript" charset="utf-8"></script>
- </head>
- <body>
- <div id="space-content">
- <div class="demo"></div>
- </div>
- </body>
- <script type="text/javascript">
- space.vue = new Vue({
- el: space.appContent,
- data() {
- return {
- serviceUrl: {
- flowChartUrl: '@service{ name:`sys_flow_chart`}@'
- },
- // GooFlow 实例化与改变节点属性时需要的
- gooFlow: {
- // GooFlow 元素标签,
- el: '.demo',
- // 初始化流程图的参数
- property: {
- width: 1200,
- height: 500
- },
- initData: {}
- },
- gooFlowObj: undefined
- }
- },
- created: function() {
- console.log('初始化工作')
- this.initFlowChart();
- },
- mounted: function() {
- // 设置 gooFlow 的宽高
- this.gooFlowObj = $.createGooFlow($(this.gooFlow.el), this.gooFlow.property, this)
- console.log('流程节点数据', this.gooFlow.initData)
- // this.gooFlowObj.loadData(this.gooFlow.initData);
- },
- methods: {
- /**
- * 初始化流程图
- */
- initFlowChart() {
- var _this = this;
- space.utils.ajax({
- url: _this.serviceUrl.flowChartUrl,
- dataType: 'json',
- success: function(data) {
- _this.gooFlow.initData = data.data
- console.log(_this.gooFlow.initData)
- _this.gooFlowObj.loadData(_this.gooFlow.initData);
- }
- });
- }
- }
- })
- </script>
- </html>
|