vue2-client 1.9.1 → 1.9.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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  # 通过this可以调用的函数
7
7
  - openDialog(configName, selectedId, mixinData, outEnv):打开一个对话框:
8
- * selectId:id号,formtable选择时,用selectId过滤数据
8
+ * selectId:id号,formtable选择时,用selectId过滤数据 可以传递 json {a_id: 1} 或者 传递 1 ,传递数值会默认拼接查询条件 {selected_id:1}
9
9
  * mixinData: form表单需要的数据
10
10
  * outEnv: 传递给打开的界面的数据,在打开界面的js中通过this.outEnv可以访问
11
11
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -68,7 +68,7 @@ export default {
68
68
  },
69
69
  provide () {
70
70
  return {
71
- getSelectedId: () => { return this.selectedId },
71
+ getSelectedId: () => this.getSelectedId(),
72
72
  getMixinData: () => { return this.mixinData },
73
73
  isInAModal: () => { return true }
74
74
  }
@@ -100,6 +100,15 @@ export default {
100
100
  // 把打开时的环境传递给打开窗口,以便js脚本中使用
101
101
  this.outEnv = outEnv
102
102
  },
103
+ getSelectedId () {
104
+ if (typeof this.selectedId === 'object') {
105
+ if (Object.keys(this.selectedId) > 0) {
106
+ return this.selectedId[Object.keys(this.selectedId)[0]]
107
+ }
108
+ } else {
109
+ return this.selectedId
110
+ }
111
+ },
103
112
  selectRow (selectedRowKeys, selectedRows) {
104
113
  this.table_selectedRowKeys = selectedRowKeys
105
114
  this.table_selectedRows = selectedRows
@@ -608,10 +608,16 @@ export default {
608
608
  }
609
609
  },
610
610
  mounted () {
611
- if (this.getSelectedId && this.getSelectedId()) {
612
- console.log('注入数据', this.getSelectedId()) // 访问祖先组件的数据
613
- Object.assign(this.fixedAddForm, { selected_id: this.getSelectedId() })
614
- Object.assign(this.fixedQueryForm, { selected_id: this.getSelectedId() })
611
+ if (this.getSelectedId && typeof this.this.getSelectedId === 'function') {
612
+ const selectedId = this.getSelectedId()
613
+ console.log('注入数据', selectedId)
614
+ if (typeof selectedId === 'object') {
615
+ Object.assign(this.fixedAddForm, selectedId)
616
+ Object.assign(this.fixedQueryForm, selectedId)
617
+ } else {
618
+ Object.assign(this.fixedAddForm, { selected_id: selectedId })
619
+ Object.assign(this.fixedQueryForm, { selected_id: selectedId })
620
+ }
615
621
  }
616
622
  }
617
623
  }
@@ -504,16 +504,21 @@ export default {
504
504
  // 如果配置了 表单初始化logic
505
505
  // 调用 logic 获取参数
506
506
  let param = { ...this.mixinData }
507
+ let selectedId
507
508
  if (res.paramLogicName) {
508
- param = Object.assign(param, await runLogic(res.paramLogicName, {
509
- selectedId: (!!this.getSelectedId && this.getSelectedId()) || undefined,
510
- }, cell.serviceName))
509
+ if (!!this.getSelectedId) {
510
+ selectedId = this.getSelectedId()
511
+ if (typeof selectedId !== 'object') {
512
+ selectedId = { selectedId: selectedId }
513
+ }
514
+ }
515
+ param = Object.assign(param, await runLogic(res.paramLogicName, selectedId, cell.serviceName))
511
516
  }
512
517
  this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
513
518
  serviceName: cell.serviceName,
514
519
  formItems: res.formJson,
515
520
  showSubmitBtn: !this.isInAModal,
516
- businessType: '新增',
521
+ businessType: param.businessType || '新增',
517
522
  layout: res.xAddFormLayout,
518
523
  ...res,
519
524
  fixedAddForm: param,
@@ -82,11 +82,15 @@ export default {
82
82
  // 如果配置了 表单初始化logic
83
83
  // 调用 logic 获取参数
84
84
  let param = {}
85
+ let selectedId
85
86
  if (res.paramLogicName) {
86
- param = Object.assign(param, await runLogic(res.paramLogicName, {
87
- selectedId: (!!this.getSelectedId && this.getSelectedId()) || undefined,
88
- ...this.mixinData
89
- }, tab.serviceName))
87
+ if (!!this.getSelectedId) {
88
+ selectedId = this.getSelectedId()
89
+ if (typeof selectedId !== 'object') {
90
+ selectedId = { selectedId: selectedId }
91
+ }
92
+ }
93
+ param = Object.assign(param, await runLogic(res.paramLogicName, selectedId, tab.serviceName))
90
94
  }
91
95
  this.$refs[`tab_com_${tab.slotType}_${index}`][0].init({
92
96
  formItems: res.formJson,
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://aote-office.8866.org:31567'
14
+ const v3Server = 'http://192.168.11.160:31467/'
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://aote-office.8866.org:31567'
18
+ const revenue = 'http://192.168.11.160:31467/'
19
19
  // const OSSServerProd = 'http://192.168.50.67:31351'
20
20
  // const testUploadLocal = 'http://127.0.0.1:9001'
21
21
  // v3 铜川