sasp-flow-render 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +31 -0
  2. package/package.json +3 -2
package/index.js CHANGED
@@ -42,6 +42,35 @@ let components = [
42
42
  flowInstView
43
43
  ];
44
44
 
45
+ let createAxiosIfNotExists = (Vue,props) => {
46
+ let newAxios = (props || {}).axios;
47
+ if (!newAxios) {
48
+ if(Vue.prototype.shareAxios){
49
+ (props || {}).axios = Vue.prototype.shareAxios;
50
+ return;
51
+ }
52
+ newAxios = axios.create({
53
+ baseURL:(props || {}).SERVICE_URL,
54
+ headers: {
55
+ 'Content-Type': 'application/x-www-form-urlencoded',
56
+ common: {
57
+ Authorization: (localStorage["Authorization" + (window.projectSuffix || "")] || "")
58
+ }
59
+ },
60
+ transformRequest: [
61
+ function (data) {
62
+ return data;
63
+ }
64
+ ],
65
+ })
66
+ newAxios.all = axios.all;
67
+ newAxios.spread = axios.spread;
68
+ Vue.prototype.axios = newAxios;
69
+ Vue.prototype.shareAxios = newAxios;
70
+ (props || {}).axios = newAxios;
71
+ }
72
+ }
73
+
45
74
  /**
46
75
  * 初始化axios设置
47
76
  * @param Vue
@@ -79,6 +108,8 @@ let initAxios = (Vue, props) => {
79
108
  const install = function (Vue, opts = {}) {
80
109
  SaspModuleUtil.registerModuleName(Vue, "flow");
81
110
 
111
+ createAxiosIfNotExists(Vue,opts);
112
+
82
113
  Vue.prototype.USE_SASP_FLOW = true; // 说明安装了流程插件,我们使用此参数作为表单对接的依据
83
114
  Vue.use(flowInstall, opts);
84
115
  Vue.use(flowGlobal, opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sasp-flow-render",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "业务应用支撑平台-智慧流程渲染组件",
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build"
@@ -11,7 +11,8 @@
11
11
  "bpmn-js-properties-panel": "^0.33.2",
12
12
  "camunda-bpmn-moddle": "^4.4.0",
13
13
  "diagram-js": "^6.6.1",
14
- "diagram-js-minimap": "^2.0.3"
14
+ "diagram-js-minimap": "^2.0.3",
15
+ "sasp-base": "2.5.4"
15
16
  },
16
17
  "browserslist": [
17
18
  "> 1%",