qgb-process 0.1.70 → 0.1.82

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qgb-process",
3
- "version": "0.1.70",
3
+ "version": "0.1.82",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "",
@@ -9,7 +9,7 @@
9
9
  "build": "node --max_old_space_size=10096 node_modules/@vue/cli-service/bin/vue-cli-service.js build",
10
10
  "build:test": "node --max_old_space_size=10096 node_modules/@vue/cli-service/bin/vue-cli-service.js build --mode test",
11
11
  "build:pre": "node --max_old_space_size=10096 node_modules/@vue/cli-service/bin/vue-cli-service.js build --mode pre",
12
- "lib": "node --max_old_space_size=10096 node_modules/@vue/cli-service/bin/vue-cli-service.js build --target lib --name qgb-process --dest lib packages/index.js --mode pre",
12
+ "lib": "node --max_old_space_size=10096 node_modules/@vue/cli-service/bin/vue-cli-service.js build --target lib --name qgb-process --dest lib packages/index.js",
13
13
  "lint": "vue-cli-service lint",
14
14
  "lint-fix": "eslint src/ --fix",
15
15
  "test:unit": "vue-cli-service test:unit",
package/src/App.vue CHANGED
@@ -16,7 +16,10 @@ export default {
16
16
  computed: {},
17
17
  watch: {},
18
18
  methods: {},
19
- mounted() {},
19
+ mounted() {
20
+ // window.process = process.env
21
+ // console.log(window)
22
+ },
20
23
  created() {}
21
24
  };
22
25
  </script>
@@ -1,8 +1,10 @@
1
1
  import request from "@/http"
2
- const url = process.env.VUE_APP_API
3
- const authUrlType = process.env.VUE_APP_EMTERPRISE
4
- const qiguan = process.env.VUE_APP_QIGUAN
5
- const urls = "http://192.168.2.184:9190"
2
+ const base = JSON.parse(localStorage.getItem("env"))
3
+ const url = base.VUE_APP_API
4
+ const authUrlType = base.VUE_APP_EMTERPRISE
5
+ const qiguan = base.VUE_APP_QIGUAN
6
+
7
+
6
8
  const apiMemberSelection = {
7
9
  getOrgsData:()=>request.get( url + authUrlType + `/v1/organization/getNewOrganizationAndContacts`),
8
10
  list: () => request.get(url + authUrlType + `/v1/organization/getOrganizationAndContacts`), // /v1/organization/getOrganization
@@ -7,13 +7,15 @@
7
7
  * @FilePath: \src\api\apiProcess.js
8
8
  **/
9
9
  import request from "@/http"
10
- const baseUrl = process.env.VUE_APP_API + "/sgb-meta-design"
11
- // const baseUrl = 'http://192.168.3.51:9096'
12
10
  import qs from "qs"
13
- const url = process.env.VUE_APP_API
14
- const qiguan = process.env.VUE_APP_QIGUAN
11
+ const base = JSON.parse(localStorage.getItem("env"))
12
+ const baseUrl = base.VUE_APP_API + "/sgb-meta-design"
13
+ const url = base.VUE_APP_API
14
+ const qiguan = base.VUE_APP_QIGUAN
15
15
  const appUrl = url + qiguan;
16
16
 
17
+ console.log(baseUrl)
18
+
17
19
  // 保存流程
18
20
  export const saveProcess = async(params) => request.postHeaders(`${baseUrl}/v1/pc/process/addProcess`, qs.stringify(params))
19
21
  // 新的保存流程
package/src/http/index.js CHANGED
@@ -24,8 +24,9 @@ const removePending = (config) => {
24
24
  }
25
25
 
26
26
  // axios 基础配置
27
+ const base = JSON.parse(localStorage.getItem("env"))
27
28
  axios.defaults.timeout = 50000
28
- axios.defaults.baseURL = process.env.VUE_APP_APIUSER
29
+ axios.defaults.baseURL = base.VUE_APP_APIUSER
29
30
 
30
31
  axios.interceptors.request.use(
31
32
  config => {
package/src/main.js CHANGED
@@ -34,9 +34,6 @@ if (window.__POWERED_BY_QIANKUN__) {
34
34
  __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
35
35
  }
36
36
 
37
-
38
-
39
-
40
37
  // 自定义指令
41
38
  Vue.directive('enterNumber', {
42
39
  bind: function(el, { value = 2 }) {
@@ -17,7 +17,7 @@
17
17
  <div class="approverSelectorItemCon rowDirection">
18
18
  <el-radio-group v-model="approverMode" @change="approverModeChange">
19
19
  <el-radio :label="1">指定成员</el-radio>
20
- <el-radio :label="2" v-if="$route.query.type | filterType">主管</el-radio>
20
+ <el-radio :label="2" v-if="queryInfo.type | filterType">主管</el-radio>
21
21
  </el-radio-group>
22
22
  <!-- 指定成员 -->
23
23
  <div v-if="approverMode == 1" class="selector-list">
@@ -119,7 +119,13 @@ export default {
119
119
  value: {
120
120
  type: Boolean,
121
121
  default: true
122
- }
122
+ },
123
+ queryInfo:{
124
+ type: Object,
125
+ default:()=>{
126
+ return {}
127
+ }
128
+ },
123
129
  },
124
130
  data() {
125
131
  return {
@@ -345,9 +351,9 @@ export default {
345
351
  computed: {
346
352
  // 过滤非主管的审批模块
347
353
  filterType(type) {
348
- if (this.$route.query.type == "notice") {
354
+ if (this.queryInfo.type == "notice") {
349
355
  return false
350
- } else if (this.$route.query.type == "officialDocument") {
356
+ } else if (this.queryInfo.type == "officialDocument") {
351
357
  return false
352
358
  } else {
353
359
  return true
@@ -171,6 +171,12 @@ export default {
171
171
  title: {
172
172
  type: String,
173
173
  default: ""
174
+ },
175
+ queryInfo:{
176
+ type: Object,
177
+ default:()=>{
178
+ return {}
179
+ }
174
180
  }
175
181
  },
176
182
  data() {
@@ -394,7 +400,7 @@ export default {
394
400
 
395
401
  // 设置条件
396
402
  async setConfig() {
397
- this.applyType = this.$route.query.type;
403
+ this.applyType = this.queryInfo.type;
398
404
  var configDefault = {
399
405
  ele: "sponsor",
400
406
  name: "发起人",
@@ -403,7 +409,7 @@ export default {
403
409
 
404
410
  this.configList = config[this.applyType] ? await config[this.applyType](this) : [];
405
411
 
406
- if (this.$route.query.type == "sealApproval" || this.$route.query.name == "用章申请" || this.$route.query.name == "用车申请" || this.$route.query.type == "carApproval") {
412
+ if (this.queryInfo.type == "sealApproval" || this.queryInfo.name == "用章申请" || this.queryInfo.name == "用车申请" || this.queryInfo.type == "carApproval") {
407
413
  configDefault = {};
408
414
  } else {
409
415
  this.configList.unshift(configDefault);
@@ -3,11 +3,9 @@
3
3
  <el-row v-if="tools">
4
4
  <el-col :span="24" class="right-plan">
5
5
  <div class="process-heard">
6
- <!-- v-if="$route.query.name" -->
7
- <template v-if="false">
6
+ <template v-if="queryName">
8
7
  <div v-if="isEdit">
9
- <!-- {{ $route.query.name }} -->
10
- <span class="process-title">流程</span>
8
+ <span class="process-title">{{queryName}}流程</span>
11
9
  <!-- <i class="el-icon-edit" @click.stop="isEdit = false; conName = name"></i> -->
12
10
  </div>
13
11
  <div v-else>
@@ -108,7 +106,7 @@ import lodash from "lodash";
108
106
  import * as api from "../../api/apiProcess";
109
107
  import * as ProcessBuilder from "../../views/formBuilder/service/ProcessBuilder";
110
108
  export default {
111
- props: ["tools"],
109
+ props: ["queryInfo","tools","path","userInfo"],
112
110
  data() {
113
111
  return {
114
112
  approverSelectorData: {
@@ -181,10 +179,7 @@ export default {
181
179
  }
182
180
  },
183
181
  created() {
184
- // this.type =
185
- // this.$route.path == "/index"
186
- // ? "customForm_" + this.$store.state.formBuilder.formDesId
187
- // : this.$route.query.type;
182
+ this.type = this.queryInfo.type
188
183
  },
189
184
  mounted() {
190
185
  this.jsPlumbInit();
@@ -192,9 +187,9 @@ export default {
192
187
  methods: {
193
188
  async save() {
194
189
  // const user = this.$store.state.user;
195
- const user = "";
190
+ const user = this.userInfo;
196
191
  const flg = false;
197
- if (this.$route.path == "/index") {
192
+ if (this.path == "/index") {
198
193
  // this.params.menuId = this.$store.state.formBuilder.menuId;
199
194
  this.params.menuId = ""
200
195
  }
@@ -538,9 +533,9 @@ export default {
538
533
  const content = JSON.parse(res.data.data.content);
539
534
  this.data = { nodeList: content.nodeList, lineList: content.lineList };
540
535
  // todo:
541
- // this.name = this.$route.query.name
542
- // ? this.$route.query.name + "流程"
543
- // : content.name;
536
+ this.name = this.queryInfo.name
537
+ ? this.queryInfo.name + "流程"
538
+ : content.name;
544
539
  this.isFlg = content.switchOn != 0;
545
540
  this.processId = res.data.data._id;
546
541
  this.version = res.data.data.rootNode.version;
@@ -553,10 +548,10 @@ export default {
553
548
  if (res.data.data && res.data.data._id) {
554
549
  this.processId = res.data.data._id;
555
550
  const processList = JSON.parse(res.data.data.content);
556
- // this.name = processList.name;
557
- // this.name = this.$route.query.name
558
- // ? this.$route.query.name + "流程"
559
- // : processList.name;
551
+ this.name = processList.name;
552
+ this.name = this.queryInfo.name
553
+ ? this.queryInfo.name + "流程"
554
+ : processList.name;
560
555
 
561
556
  this.isFlg = processList.switchOn != 0;
562
557
  this.version = res.data.data.rootNode.version;
@@ -574,17 +569,17 @@ export default {
574
569
  const res = await api.updateProcessToNew(data);
575
570
  }, 200);
576
571
  } else {
577
- // this.name = this.$route.query.name
578
- // ? this.$route.query.name + "流程"
579
- // : this.$store.state.formBuilder.name + "流程";
572
+ this.name = this.queryInfo.name
573
+ ? this.queryInfo.name + "流程"
574
+ : "流程";
580
575
  this.initProcess();
581
576
  const result = ProcessBuilder.treeToListLocal(this.root.lists);
582
577
  this.id = result.length + 10;
583
578
  }
584
579
  } else {
585
- // this.name = this.$route.query.name
586
- // ? this.$route.query.name + "流程"
587
- // : this.$store.state.formBuilder.name + "流程";
580
+ this.name = this.queryInfo.name
581
+ ? this.queryInfo.name + "流程"
582
+ : "流程";
588
583
  this.initProcess();
589
584
  const result = ProcessBuilder.treeToListLocal(this.root.lists);
590
585
  this.id = result.length + 10;
@@ -3,8 +3,7 @@
3
3
  <!-- 顶部导航栏 -->
4
4
  <div class="fd-nav sidePadding">
5
5
  <div class="fd-nav-left">
6
- <!-- {{$route.query.name}} -->
7
- <div class="fd-nav-title">流程</div>
6
+ <div class="fd-nav-title">{{queryInfo.name}}流程</div>
8
7
  </div>
9
8
  <div class="fd-nav-center"></div>
10
9
  <div class="fd-nav-right">
@@ -42,6 +41,7 @@
42
41
  :isTried.sync="isTried"
43
42
  :directorMaxLevel="directorMaxLevel"
44
43
  :tableId="processConfig.processId"
44
+ :queryInfo="queryInfo"
45
45
  />
46
46
  <div class="end-node">
47
47
  <div class="end-node-circle"></div>
@@ -75,15 +75,14 @@
75
75
  </span>
76
76
  </el-dialog>
77
77
 
78
- <!-- 老数据展示弹出 -->
79
- <!-- ${$route.query.name} -->
80
- <el-dialog :title="`老数据参考`" :visible.sync="oldModal" width="70%" :before-close="showOldModal">
81
- <OldProcess :tools="false"/>
82
- <span slot="footer" class="dialog-footer">
83
- <el-button @click="oldModal = false">取 消</el-button>
84
- <el-button type="primary" @click="oldModal = false">确 定</el-button>
85
- </span>
86
- </el-dialog>
78
+ <!-- 老数据展示弹出 -->
79
+ <el-dialog :title="`${queryInfo.name}老数据参考`" :visible.sync="oldModal" width="70%" :before-close="showOldModal">
80
+ <OldProcess :tools="false" :path="path" :userInfo="userInfo" :queryInfo="queryInfo"/>
81
+ <span slot="footer" class="dialog-footer">
82
+ <el-button @click="oldModal = false">取 消</el-button>
83
+ <el-button type="primary" @click="oldModal = false">确 定</el-button>
84
+ </span>
85
+ </el-dialog>
87
86
 
88
87
 
89
88
  </div>
@@ -95,13 +94,50 @@ import OldProcess from "./process-2"
95
94
  import nodeWrap from './workflow/nodeWrap'
96
95
 
97
96
 
98
-
99
97
  export default {
100
98
  name: 'Process',
101
99
  components: {
102
100
  OldProcess,
103
101
  nodeWrap
104
102
  },
103
+ props: {
104
+ // 路由地址
105
+ path: {
106
+ type: String,
107
+ default: () => {
108
+ return "/index"
109
+ }
110
+ },
111
+ // 类型数据
112
+ queryInfo:{
113
+ type:Object,
114
+ default:()=>{
115
+ return {
116
+ name:"公告管理",
117
+ type:"notice"
118
+ }
119
+ }
120
+ },
121
+ // 用户信息
122
+ userInfo: {
123
+ type: Object,
124
+ default:()=>{
125
+ return {
126
+ "companyNo":"202008267425615", // 公司no
127
+ "no":"", // 用户no
128
+ }
129
+ }
130
+ },
131
+ // formBuilder
132
+ formBuilder:{
133
+ type:Object,
134
+ default:()=>{
135
+ return {
136
+ formDesId:""
137
+ }
138
+ }
139
+ }
140
+ },
105
141
  data() {
106
142
  return {
107
143
  isTried: false,
@@ -122,12 +158,12 @@ export default {
122
158
  processId: null // 流程ID
123
159
  };
124
160
  },
161
+ mounted() {},
125
162
  created() {
126
163
  // 获取审批流程数据
127
164
  this.getProcessSet()
128
165
  // 设置类型
129
- // todo: 修改 this.$store.state.formBuilder.formDesId
130
- // this.type = this.$route.path == "/index" ? "customForm_" + this.$store.state.formBuilder.formDesId : this.$route.query.type;
166
+ this.type = this.path == "/index" ? "customForm_" + this.formBuilder.formDesId : this.queryInfo.type;
131
167
  },
132
168
  methods: {
133
169
  // 初始化数据
@@ -143,12 +179,9 @@ export default {
143
179
  "automaticPass": !!parseInt(this.processConfig.automaticPass)
144
180
  }
145
181
  },
146
-
147
182
  // 获取审批流程数据
148
183
  async getProcessSet() {
149
- // this.$store.state.user.companyNo
150
- // this.$route.query.type
151
- const param = { companyId: "", type: "" };
184
+ const param = { companyId: this.userInfo.companyNo, type: this.queryInfo.type };
152
185
  const result = await api.queryProcessByType(param);
153
186
  const { state, data } = result.data
154
187
  if (state == "ok" && data) {
@@ -330,11 +363,11 @@ export default {
330
363
  ...this.processConfig,
331
364
  "switchOn": this.workFlowDef.switchOn ? 1 : 0, // 审批状态
332
365
  "automaticPass": this.workFlowDef.automaticPass ? 1 : 0, // 重复审批人问题
333
- "creator": "", // 用户no this.$store.state.user.no
334
- "companyId": "", // 公司id this.$store.state.user.companyNo
335
- "type": "", // 流程类型 this.$route.query.type
336
- "processName": "", // 流程名称 ""this.$route.query.name
337
- "describe": "" // 流程描述 this.$route.query.name
366
+ "creator": this.userInfo.no, // 用户no this.$store.state.user.no
367
+ "companyId": this.userInfo.companyNo, // 公司id this.$store.state.user.companyNo
368
+ "type": this.queryInfo.type, // 流程类型 this.$route.query.type
369
+ "processName": this.queryInfo.name, // 流程名称 ""this.$route.query.name
370
+ "describe": this.queryInfo.name // 流程描述 this.$route.query.name
338
371
  }
339
372
 
340
373
 
@@ -75,13 +75,13 @@
75
75
  </div>
76
76
 
77
77
  <nodeWrap v-if="nodeConfig.childNode && nodeConfig.childNode" :nodeConfig.sync="nodeConfig.childNode" :tableId="tableId"
78
- :isTried.sync="isTried" :directorMaxLevel="directorMaxLevel"></nodeWrap>
78
+ :isTried.sync="isTried" :directorMaxLevel="directorMaxLevel" :queryInfo="queryInfo"></nodeWrap>
79
79
 
80
80
  <!-- 审批人 / 抄送人 -->
81
- <ApproverSelector ref="approverSelector"/>
81
+ <ApproverSelector ref="approverSelector" :queryInfo="queryInfo"/>
82
82
 
83
83
  <!-- 条件设置弹出窗口 -->
84
- <NodeConditionConfig ref="conditionForm" :formData="connection" :title="title"/>
84
+ <NodeConditionConfig ref="conditionForm" :formData="connection" :title="title" :queryInfo="queryInfo"/>
85
85
 
86
86
  <!-- TODO: 发起人 -->
87
87
 
@@ -95,7 +95,7 @@ import addNode from './addNode'
95
95
 
96
96
 
97
97
  export default {
98
- props: ["nodeConfig", "flowPermission", "directorMaxLevel", "isTried", "tableId"],
98
+ props: ["nodeConfig", "flowPermission", "directorMaxLevel", "isTried", "tableId","queryInfo"],
99
99
  components:{
100
100
  ApproverSelector,
101
101
  NodeConditionConfig,
@@ -143,6 +143,7 @@ export default {
143
143
  }
144
144
  }
145
145
  },
146
+ created(){},
146
147
  methods: {
147
148
  // 展示修改节点的输入框
148
149
  clickEvent(index) {