vue2-client 1.9.8 → 1.9.10

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.
@@ -16,7 +16,7 @@
16
16
  * sql.query(sql别名 string,sql参数 string,页数 int,每页行数 int) 执行已经注册的sql 返回 org.json.JSONArray
17
17
  * sql.querySQL(sql名称,sql语句) 执行一个没有注册的sql语句 返回 org.json.JSONArray
18
18
  * sql.querySQL(sql名称,sql语句,页数 int,每页行数 int) ) 执行一个没有注册的sql语句 返回 org.json.JSONArray
19
- * sql.execSQL(sql名称,sql语句,页数 int,每页行数 int) ) 执行一个增删改sql语句 返回 org.json.JSONArray
19
+ * sql.execSQL(sql名称,sql语句) 执行一个增删改sql语句 返回 org.json.JSONArray
20
20
  - entity 对应 EntityService 类,其中有方法
21
21
  * entity.partialSave(实体名称 string,保存参数 org.json.JSONObject) 返回整个实体 JSONObject
22
22
  * entity.delete(实体名称 string,id Object)
@@ -4,10 +4,12 @@
4
4
  - 用this.函数函数调用方式调用相应功能。
5
5
 
6
6
  # 通过this可以调用的函数
7
+ - openDialog(configName, selectedId, mixinData):打开一个对话框,例如:this.openDialog('xxx', 5, {})
7
8
  - openDialog(configName, selectedId, mixinData, outEnv):打开一个对话框:
8
9
  * selectId:id号,formtable选择时,用selectId过滤数据 可以传递 json {a_id: 1} 或者 传递 1 ,传递数值会默认拼接查询条件 {selected_id:1}
9
10
  * mixinData: form表单需要的数据
10
11
  * outEnv: 传递给打开的界面的数据,在打开界面的js中通过this.outEnv可以访问
12
+ * getOutEnv 获取获取 outEnv
11
13
  ```js
12
14
  this.openDialog('xxx', 5, {}, {})
13
15
  ```
@@ -17,31 +19,7 @@ this.openDialog('xxx', 5, {}, {})
17
19
  - 先给组件起名字,命名规范:main,left,right,top,bottom
18
20
  - 用 this.getComponentByName('main') 拿到组件。
19
21
 
20
- # 特殊处理
21
- - form表单提交数据到列表,而非后台。用 `this.outEnv.data.push(...[])`刷新列表数据。
22
-
23
22
  # x-form-table 可以使用的函数/数据
24
- - getTableData(): 获取所有数据
25
- - 获取selectedid getSelectedId()
26
- - 重新查询 refreshTable()
27
- ```js
28
- 假如组件名称叫 xtable
29
- // 所有选中的id
30
- const allid = this.$refs.xtable.table_selectedRowKeys
31
- // 所有选中的行 table_selectedRowKeys
32
- const allrecord = this.$refs.xtable.table_selectedRows
33
-
34
- // xtable 所调用事件
35
- // 新增修改后调用事件
36
- afterSubmit( type(新增/修改/擦和讯), id: (所操作的主键id), form: (请求的表单内容))
37
- // 查询后
38
- afterQuery( res (查询后数据), querparams (查询参数))
39
- // 删除后
40
- afterDelete( res (删除接口返回数据))
41
- // 操作按钮
42
- action(record (当前记录), id (当前记录主键), actionType (操作类型))
43
- ```
44
-
45
23
  - table_selectedRowKeys 获取选中的id /不用加 () 这是一个data 中的变量
46
24
  - table_selectedRows 获取选中的行 /不用加 () 这是一个data 中的变量
47
25
  - getSelectedId 获取获取selectedid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -71,6 +71,7 @@ export default {
71
71
  getSelectedId: () => this.getSelectedId(),
72
72
  getSelectedData: () => { return this.selectedId },
73
73
  getMixinData: () => { return this.mixinData },
74
+ getOutEnv: () => { return this.outEnv },
74
75
  isInAModal: () => { return true }
75
76
  }
76
77
  },
@@ -134,7 +134,7 @@ export default {
134
134
  XAddReport,
135
135
  XImportExcel
136
136
  },
137
- inject: ['getSelectedId', 'getSelectedData', 'getMixinData'],
137
+ inject: ['getSelectedId', 'getSelectedData', 'getMixinData', 'getOutEnv'],
138
138
  data () {
139
139
  return {
140
140
  // 加载状态
@@ -374,7 +374,8 @@ export default {
374
374
  env: this.env,
375
375
  form: this.$refs.xForm.form,
376
376
  allowedCardMode: res.allowedCardMode,
377
- cardModeConfig: res.cardModeConfig
377
+ cardModeConfig: res.cardModeConfig,
378
+ summaryUpdate: true
378
379
  })
379
380
  }
380
381
  this.loading = false
@@ -490,7 +490,7 @@ export default {
490
490
  // tableConfig: {}
491
491
  }
492
492
  },
493
- inject: ['openDialog', 'registerComponent', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData'],
493
+ inject: ['openDialog', 'registerComponent', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData', 'getOutEnv'],
494
494
  methods: {
495
495
  onComponentMounted (h, cell, cellIndex) {
496
496
  if (this.getMixinData && this.getMixinData()) {
@@ -36,7 +36,7 @@ export default {
36
36
  XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
37
37
  XReportGrid: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue')
38
38
  },
39
- inject: ['isInAModal', 'getSelectedId', 'getSelectedData'],
39
+ inject: ['isInAModal', 'getSelectedId', 'getSelectedData', 'getOutEnv'],
40
40
  data () {
41
41
  return {
42
42
  activeKey: 0,
@@ -213,6 +213,7 @@
213
213
  :closable="false"
214
214
  :visible="summaryDrawerVisible"
215
215
  :z-index="2000"
216
+ width="25%"
216
217
  :after-visible-change="afterVisibleChange"
217
218
  @close="onClose"
218
219
  >
@@ -224,7 +225,15 @@
224
225
  :title="f.title + ':'"
225
226
  :value="f.value"
226
227
  :precision="2"
227
- style="margin-right: 50px"/>
228
+ style="margin-right: 50px">
229
+ <template #prefix>
230
+ <a-spin :spinning="f.loading">
231
+ </a-spin>
232
+ </template>
233
+ <template #suffix>
234
+ <a-icon v-show="!f.loading" :type="f.success !== false ? 'check-circle' : 'close-circle'" :style="{color: f.success !== false ? 'green' : 'red'}"/>
235
+ </template>
236
+ </a-statistic>
228
237
  </div>
229
238
  </template>
230
239
  </a-drawer>
@@ -255,7 +264,9 @@ import {
255
264
  querySummary,
256
265
  queryWithResource,
257
266
  remove,
258
- asyncRunTask, editRowSave
267
+ asyncRunTask,
268
+ editRowSave,
269
+ runLogic
259
270
  } from '@vue2-client/services/api/common'
260
271
  import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
261
272
  import { Modal } from 'ant-design-vue'
@@ -356,6 +367,8 @@ export default {
356
367
  buttonPermissions: [],
357
368
  // 是否展示汇总
358
369
  showSummary: false,
370
+ // 自定义汇总
371
+ showCustomSummary: false,
359
372
  summaryData: [],
360
373
  // 图标样式
361
374
  iconStyle: {
@@ -370,6 +383,7 @@ export default {
370
383
  summaryDrawerVisible: false,
371
384
  // 汇总更新标志
372
385
  summaryUpdate: false,
386
+ customSummaryArray: [],
373
387
  formItems: [],
374
388
  // 是否为编辑模式
375
389
  isEditMode: false,
@@ -535,15 +549,42 @@ export default {
535
549
  form,
536
550
  serviceName,
537
551
  tableSummaryMap = {},
552
+ customTableSummaryArray = [
553
+ ],
538
554
  viewMode,
539
555
  formItems,
540
556
  env = 'prod',
541
557
  createdQuery = true,
542
558
  primaryKey,
543
559
  allowedCardMode = false,
544
- cardModeConfig
560
+ cardModeConfig,
561
+ summaryUpdate
545
562
  } = params
546
563
  this.showSummary = Object.keys(tableSummaryMap).length > 0
564
+ if (this.showSummary) {
565
+ Object.keys(tableSummaryMap).forEach(item => {
566
+ this.summaryData.push({
567
+ key: item,
568
+ title: tableSummaryMap[item],
569
+ value: ' ',
570
+ loading: true,
571
+ success: false
572
+ })
573
+ })
574
+ }
575
+ if (customTableSummaryArray.length > 0) {
576
+ customTableSummaryArray.forEach(item => {
577
+ this.summaryData.push({
578
+ key: item.key,
579
+ title: item.title,
580
+ value: ' ',
581
+ loading: true,
582
+ success: false
583
+ })
584
+ })
585
+ this.showCustomSummary = true
586
+ this.customSummaryArray = customTableSummaryArray
587
+ }
547
588
  this.queryParams = queryParams
548
589
  this.tableColumns = JSON.parse(JSON.stringify(tableColumns))
549
590
  if (this.tableColumns.length === 0) {
@@ -562,6 +603,7 @@ export default {
562
603
  this.rowKey = this.getPrimaryKeyName()
563
604
  this.allowedCardMode = allowedCardMode
564
605
  this.cardModeConfig = cardModeConfig
606
+ this.summaryUpdate = summaryUpdate
565
607
  let totalWidth = 0
566
608
  for (let i = 0; i < this.tableColumns.length; i++) {
567
609
  const item = this.tableColumns[i]
@@ -979,11 +1021,49 @@ export default {
979
1021
  },
980
1022
  async retrieveSummaryData () {
981
1023
  if (this.requestParameters.querySummary) {
982
- this.summaryData = await querySummary(Object.assign(this.requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
1024
+ querySummary(Object.assign(this.requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev').then(res => {
1025
+ if (res.length > 0) {
1026
+ this.summaryData.forEach(item => {
1027
+ res.forEach(summary => {
1028
+ if (item.title === summary.title) {
1029
+ item.value = summary.value
1030
+ item.success = true
1031
+ item.loading = false
1032
+ }
1033
+ })
1034
+ })
1035
+ }
1036
+ })
1037
+ }
1038
+ if (this.showCustomSummary) {
1039
+ this.customSummaryArray.forEach(item => {
1040
+ runLogic(item.source, Object.assign(this.requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev').then((res) => {
1041
+ this.summaryData.forEach(summary => {
1042
+ if (item.key === summary.key) {
1043
+ summary.value = res.value
1044
+ summary.success = true
1045
+ summary.loading = false
1046
+ }
1047
+ })
1048
+ }).catch(e => {
1049
+ this.summaryData.forEach(summary => {
1050
+ if (item.key === summary.key) {
1051
+ summary.value = 0
1052
+ summary.success = false
1053
+ summary.loading = false
1054
+ }
1055
+ })
1056
+ })
1057
+ })
983
1058
  }
984
1059
  },
985
1060
  showDrawer () {
986
1061
  if (this.summaryUpdate) {
1062
+ this.summaryData.forEach(item => {
1063
+ item.loading = true
1064
+ item.success = false
1065
+ item.value = ' '
1066
+ })
987
1067
  this.summaryDrawerVisible = true
988
1068
  } else {
989
1069
  this.$message.warning('请查询后再来查看')
@@ -8,12 +8,23 @@ export default {
8
8
  this.$refs.workFlow.init({
9
9
  workflowId: '9'
10
10
  })
11
+ },
12
+ methods: {
13
+ /**
14
+ * 流程详情页成功
15
+ * @param note 备注信息
16
+ * @param form 表单信息
17
+ * @param workflowId
18
+ */
19
+ success ({ note, form, workflowId }) {
20
+ console.log('success', note, form, workflowId)
21
+ }
11
22
  }
12
23
  }
13
24
  </script>
14
25
 
15
26
  <template>
16
- <WorkflowDetail ref="workFlow"></WorkflowDetail>
27
+ <WorkflowDetail ref="workFlow" @success="success"></WorkflowDetail>
17
28
  </template>
18
29
 
19
30
  <style scoped lang="less">
@@ -35,15 +35,19 @@
35
35
  :taskName="details.f_task_name"
36
36
  :details="details"
37
37
  @refresh="stepChanged"
38
+ @success="success"
38
39
  />
39
40
  </a-tab-pane>
40
41
  <a-tab-pane key="2" tab="任务流转记录">
41
- <workflow-log v-if="activeKey === '2'" :workflow-id="workflowId" />
42
+ <workflow-log v-if="activeKey === '2'" :workflow-id="workflowId"/>
42
43
  </a-tab-pane>
43
44
  <a-tab-pane key="4">
44
45
  <span slot="tab">
45
46
  <span>任务留言</span>
46
- <a-badge :count="messageList.length" :offset="[4, -4]" :number-style="{ backgroundColor: '#b2b2b2' }"></a-badge>
47
+ <a-badge
48
+ :count="messageList.length"
49
+ :offset="[4, -4]"
50
+ :number-style="{ backgroundColor: '#b2b2b2' }"></a-badge>
47
51
  </span>
48
52
  <a-row>
49
53
  <a-col :span="14">
@@ -116,8 +120,7 @@ export default {
116
120
  ...mapState('account', { currUser: 'user' }),
117
121
  ...mapState('setting', ['isMobile'])
118
122
  },
119
- props: {
120
- },
123
+ props: {},
121
124
  mounted () {
122
125
  // this.init()
123
126
  },
@@ -187,8 +190,9 @@ export default {
187
190
  this.activeKey = id
188
191
  },
189
192
  // 提交完成后事件
190
- success () {
191
- this.$emit('success')
193
+ success (res) {
194
+ this.visible = false
195
+ this.$emit('success', res)
192
196
  }
193
197
  }
194
198
  }
@@ -418,29 +418,23 @@ export default {
418
418
  },
419
419
  // 完工按钮
420
420
  async lastStepNextClick () {
421
- await this.$refs.xAddForm.onSubmit()
422
- if (!this.formValid) {
423
- console.log('nothing')
424
- } else {
425
- return postByServiceName(workFlowViewApi.afterWorkFlowFinalStepSubmit, {
421
+ this.$refs.xAddForm.asyncSubmit().then((res) => {
422
+ this.submitForm(res)
423
+ postByServiceName(workFlowViewApi.afterWorkFlowFinalStepSubmit, {
426
424
  workflowId: this.workflowId
427
- })
428
- .then(
429
- res => {
430
- this.saveWorkflowLog('确认完工', '最后一步: ' + this.getStepNameByStepId(this.currentStepId), { notes: this.note.trim() })
431
- this.$message.success('已完工!')
432
- this.loading = true
433
- this.loadingHistory = true
434
- this.onClose()
435
- this.init()
436
- this.$emit('refresh')
437
- this.$emit('success')
438
- },
439
- () => {
440
- this.$message.error('提交失败!')
441
- }
442
- )
443
- }
425
+ }).then(_res => {
426
+ this.saveWorkflowLog('确认完工', '最后一步: ' + this.getStepNameByStepId(this.currentStepId), { notes: this.note.trim() })
427
+ this.$message.success('已完工!')
428
+ this.loading = true
429
+ this.loadingHistory = true
430
+ this.onClose()
431
+ this.$emit('success', { note: this.note.trim(), form: res.realForm, workflowId: this.workflowId })
432
+ },
433
+ () => {
434
+ this.$message.error('提交失败!')
435
+ }
436
+ )
437
+ })
444
438
  },
445
439
  // 三个按钮点击后逻辑
446
440
  async nextClick () {
@@ -458,11 +452,9 @@ export default {
458
452
  }
459
453
  })
460
454
  })
461
- await this.$refs.xAddForm.onSubmit()
462
- if (!this.formValid) {
463
- console.log('nothing')
464
- } else {
465
- return postByServiceName(workFlowViewApi.submitToNextStep, extraData)
455
+ this.$refs.xAddForm.asyncSubmit().then(res => {
456
+ this.submitForm(res)
457
+ postByServiceName(workFlowViewApi.submitToNextStep, extraData)
466
458
  .then(
467
459
  res => {
468
460
  const extra = {
@@ -483,7 +475,7 @@ export default {
483
475
  console.log(err)
484
476
  }
485
477
  )
486
- }
478
+ })
487
479
  },
488
480
  async preClick () {
489
481
  const notes = this.note.trim()
@@ -516,11 +508,9 @@ export default {
516
508
  if (!extraData) {
517
509
  return
518
510
  }
519
- await this.$refs.xAddForm.onSubmit()
520
- if (!this.formValid) {
521
- console.log('nothing')
522
- } else {
523
- return postByServiceName(workFlowViewApi.submitToNextStep, extraData)
511
+ this.$refs.xAddForm.asyncSubmit().then(res => {
512
+ this.submitForm(res)
513
+ postByServiceName(workFlowViewApi.submitToNextStep, extraData)
524
514
  .then(
525
515
  res => {
526
516
  const extra = {
@@ -541,7 +531,7 @@ export default {
541
531
  console.log(err)
542
532
  }
543
533
  )
544
- }
534
+ })
545
535
  },
546
536
  // 获取当前步骤节点,连通的节点
547
537
  getDirection () {
@@ -83,9 +83,9 @@ routerResource.example = {
83
83
  {
84
84
  path: 'default',
85
85
  name: '示例页面',
86
- component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
86
+ // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
87
87
  // component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
88
- // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
88
+ component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
89
89
  meta: {
90
90
  // 菜单中不显示
91
91
  invisible: true,
package/vue.config.js CHANGED
@@ -11,11 +11,11 @@ const productionGzipExtensions = ['js', 'css']
11
11
  const isProd = process.env.NODE_ENV === 'production'
12
12
 
13
13
  // v4 产品演示
14
- const v3Server = 'http://192.168.11.160:31467/'
14
+ const v3Server = 'http://aote-office.8866.org:31567'
15
15
  const gateway = 'http://192.168.50.67:31467'
16
16
  const testUpload = 'http://123.60.214.109:8406'
17
17
  const OSSServerDev = 'http://192.168.50.67:30351'
18
- const revenue = 'http://192.168.11.160:31467/'
18
+ const revenue = 'http://aote-office.8866.org:31567'
19
19
  // const OSSServerProd = 'http://192.168.50.67:31351'
20
20
  // const testUploadLocal = 'http://127.0.0.1:9001'
21
21
  // v3 铜川