imatrix-ui 2.9.29-dw → 2.9.30-dw-tmp1

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": "imatrix-ui",
3
- "version": "2.9.29-dw",
3
+ "version": "2.9.30-dw-tmp1",
4
4
  "description": "前端组件库:表格、表单、组织结构树等",
5
5
  "main": "lib/super-ui.umd.min.js",
6
6
  "private": false,
@@ -5,12 +5,12 @@
5
5
  ref="dynamicDataSourceRef"
6
6
  :value="value"
7
7
  v-bind="myProps"
8
- filterable
9
8
  :remote="remote"
10
9
  :remote-method="remoteMethod"
11
10
  :value-key="valueAttribute"
12
11
  :loading="loading"
13
12
  :reserve-keyword="true"
13
+ filterable
14
14
  clearable
15
15
  style="width:100%;height:100%"
16
16
  @input="inputValue"
@@ -18,7 +18,7 @@
18
18
  @visible-change="visibleChange"
19
19
  @remove-tag="removeTag(remote,$event)"
20
20
  @clear="clear"
21
- @blur="blur"
21
+ @blur="blurEvent($event)"
22
22
  @focus="focus"
23
23
  >
24
24
  <el-option
@@ -187,6 +187,12 @@ export default {
187
187
  this.watchAttrValueChange(initWatchValue)
188
188
  }
189
189
  this.isLoaded = true
190
+ // 解决当监控值变化时,数据源重新加载后select输入框中显示的值和下拉中的值不一致问题
191
+ if (this.baseProps.multiple !== undefined && this.baseProps.multiple === true) {
192
+ this.$nextTick(() => {
193
+ this.$refs['dynamicDataSourceRef'].setSelected()
194
+ })
195
+ }
190
196
  })
191
197
  .catch(error => {
192
198
  console.log(error)
@@ -199,6 +205,15 @@ export default {
199
205
  methods: {
200
206
  ...dynamicSourceSelectService,
201
207
  ...events,
208
+ blurEvent(event) {
209
+ // 解决当监控值变化时,数据源重新加载后select输入框中显示的值和下拉中的值不一致问题
210
+ if (this.baseProps.multiple !== undefined && this.baseProps.multiple === false) {
211
+ this.$nextTick(() => {
212
+ this.$refs['dynamicDataSourceRef'].setSelected()
213
+ })
214
+ }
215
+ this.$emit('blur', event)
216
+ },
202
217
  // 必须有该方法,否则无法给字段赋值
203
218
  inputValue(newValue) {
204
219
  this.$emit('input', newValue)
@@ -220,14 +235,6 @@ export default {
220
235
  if (dynamicDataSourceDto) {
221
236
  if (dynamicDataSourceDto.options) {
222
237
  this.optionItems = dynamicDataSourceDto.options
223
- if (this.watchAttr) {
224
- // 解决当监控值变化时,数据源重新加载后select输入框中显示的值和下拉中的值不一致问题
225
- if (this.baseProps.multiple !== undefined && this.baseProps.multiple === true) {
226
- this.$nextTick(() => {
227
- this.$refs['dynamicDataSourceRef'].setSelected()
228
- })
229
- }
230
- }
231
238
  //
232
239
  if (this.column) { // 只有行编辑时处理
233
240
  // 设置选项组数据、 选项组值字段、 映射关系
@@ -317,6 +324,12 @@ export default {
317
324
  this.loading = true
318
325
  this.packageDynamicDataSourceInfo(this.dynamicDataSourceCode, param)
319
326
  .then(dynamicDataSourceDto => {
327
+ // 解决当监控值变化时,数据源重新加载后select输入框中显示的值和下拉中的值不一致问题
328
+ if (this.baseProps.multiple !== undefined && this.baseProps.multiple === true) {
329
+ this.$nextTick(() => {
330
+ this.$refs['dynamicDataSourceRef'].setSelected()
331
+ })
332
+ }
320
333
  this.loading = false
321
334
  })
322
335
  .catch(error => {
@@ -20,9 +20,9 @@ import {
20
20
  * @param {*} listCode 如果是九宫格组件导出时,如果页面中有多个九宫格时,该属性需要传“listCode~gridId”,例如:
21
21
  * @param {*} exportOptions
22
22
  */
23
- function exportData(dataParam, excelName, listCode, functionCode, uuid, exportOptions, isAsync, pageCode) {
23
+ function exportData(dataParam, excelName, listCode, functionCode, uuid, exportOptions, isAsync, pageCode, isPermission) {
24
24
  return new Promise((resolve, reject) => {
25
- exportResultData(dataParam, excelName, listCode, exportOptions, functionCode, uuid, isAsync, pageCode).then(result => {
25
+ exportResultData(dataParam, excelName, listCode, exportOptions, functionCode, uuid, isAsync, pageCode, isPermission).then(result => {
26
26
  // 表示导出成功,需要执行导出成功回调方法
27
27
  if (isHasTheOption('afterExport', exportOptions) && typeof (exportOptions.afterExport) === 'function') {
28
28
  exportOptions.afterExport.call(this)
@@ -39,7 +39,7 @@ function exportData(dataParam, excelName, listCode, functionCode, uuid, exportOp
39
39
  /**
40
40
  * 导出数据
41
41
  */
42
- function exportResultData(dataParam, excelName, listCode, exportOptions, functionCode, uuid, isAsync, pageCode) {
42
+ function exportResultData(dataParam, excelName, listCode, exportOptions, functionCode, uuid, isAsync, pageCode, isPermission) {
43
43
  return new Promise((resolve, reject) => {
44
44
  // 从store缓存中取出列表信息
45
45
  if (store.get(listCode + 'basicInfo')) {
@@ -76,7 +76,7 @@ function exportResultData(dataParam, excelName, listCode, exportOptions, functio
76
76
  // })
77
77
  }
78
78
  // 导出台账数据,有查询条件则导出查询条件对应的数据,没有查询条件则导出所有记录
79
- exportListData(excelName, listCode, dataParam.data, functionCode, uuid, isAsync, pageCode).then((result) => {
79
+ exportListData(excelName, listCode, dataParam.data, functionCode, uuid, isAsync, pageCode, isPermission).then((result) => {
80
80
  resolve(result)
81
81
  }).catch(error => {
82
82
  reject(error)
@@ -190,7 +190,7 @@ function getExportParamByGridParam(listCode) {
190
190
  return param
191
191
  }
192
192
  // 导出当前台账数据
193
- function exportListData(excelName, listCode, data, functionCode, uuid, isAsync, pageCode) {
193
+ function exportListData(excelName, listCode, data, functionCode, uuid, isAsync, pageCode, isPermission) {
194
194
  return new Promise((resolve, reject) => {
195
195
  const gridParams = getGridParams(listCode)
196
196
  if (gridParams === undefined || gridParams === null) {
@@ -229,6 +229,8 @@ function exportListData(excelName, listCode, data, functionCode, uuid, isAsync,
229
229
  param['async'] = isAsync
230
230
  // 页面编码
231
231
  param['pageCode'] = pageCode
232
+ // 导出按钮是否需要验证权限
233
+ param['isPermission'] = isPermission
232
234
  Vue.prototype.$http.post(Vue.prototype.baseURL + '/dsc/commons/export-list-data', param).then(data => {
233
235
  if (isAsync) {
234
236
  Message({
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <el-table
3
3
  v-if="loaded"
4
+ ref="historyList"
5
+ style="width: 100%"
4
6
  :data="histories"
5
7
  element-loading-text="Loading"
6
8
  border
@@ -97,7 +99,8 @@ export default {
97
99
  loaded: false,
98
100
  histories,
99
101
  processI18n: null,
100
- processNameI18n: null
102
+ processNameI18n: null,
103
+ tableHeight: null
101
104
  }
102
105
  },
103
106
  computed: {
@@ -118,7 +121,9 @@ export default {
118
121
  })
119
122
  },
120
123
  mounted() {
121
-
124
+ this.$nextTick(() => {
125
+ this.tableHeight = window.innerHeight - this.$refs.historyList.$el.offsetTop
126
+ })
122
127
  },
123
128
  methods: {
124
129
  ...ApiJs,
package/src/utils/util.js CHANGED
@@ -27,9 +27,9 @@ export function getLanguageWithLocale() {
27
27
  * @param {*} entity 实体信息
28
28
  * @returns
29
29
  */
30
- export function findOptionsByDynamicDataSource(dynamicSourceCode, searchText, entity, additionalParameterStr) {
30
+ export function findOptionsByDynamicDataSource(dynamicSourceCode, searchText, entity, additionalParameterStr, searchParam) {
31
31
  return new Promise((resolve, reject) => {
32
- findDynamicDataSourceByCode(dynamicSourceCode, searchText, entity, additionalParameterStr).then(dynamicDataSourceDto => {
32
+ findDynamicDataSourceByCode(dynamicSourceCode, searchText, entity, additionalParameterStr, searchParam).then(dynamicDataSourceDto => {
33
33
  let options = []
34
34
  if (dynamicDataSourceDto && dynamicDataSourceDto.options) {
35
35
  const setOptions = dynamicDataSourceDto.options
@@ -68,26 +68,70 @@ export function findOptionsByDynamicDataSource(dynamicSourceCode, searchText, en
68
68
  * @param {*} entity 实体信息
69
69
  * @returns
70
70
  */
71
- export function findDynamicDataSourceByCode(dynamicSourceCode, searchText, entity, additionalParameterStr) {
72
- return new Promise((resolve, reject) => {
73
- if (searchText === undefined || searchText === null) {
74
- searchText = ''
75
- }
76
- const params = {
77
- searchText
78
- }
79
- // const additionalParameterStr = sessionStorage.getItem('additionalParamMap')
80
- if (additionalParameterStr) {
81
- params.additionalParamMap = JSON.parse(additionalParameterStr)
71
+ export function findDynamicDataSourceByCode(dynamicSourceCode, searchText, entity, additionalParameterStr, searchParam) {
72
+ let watchAttrValue
73
+ let parentEntity
74
+ let listCode
75
+ let formCode
76
+ let tableName
77
+ if (searchParam) {
78
+ watchAttrValue = searchParam.watchAttrValue
79
+ if (watchAttrValue === undefined || watchAttrValue === null) {
80
+ watchAttrValue = ''
82
81
  }
83
- if (entity && entity !== null) {
84
- params.entity = entity
82
+ parentEntity = searchParam.parent
83
+ listCode = searchParam._listCode
84
+ formCode = searchParam._formCode
85
+ tableName = searchParam._tableName
86
+ }
87
+ const params = {
88
+ searchText,
89
+ watchAttrValue,
90
+ parent: parentEntity
91
+
92
+ }
93
+ if (additionalParameterStr && typeof (additionalParameterStr) === 'object') {
94
+ params.additionalParamMap = additionalParameterStr
95
+ } else if (additionalParameterStr && typeof (additionalParameterStr) === 'string') {
96
+ params.additionalParamMap = JSON.parse(additionalParameterStr)
97
+ }
98
+ if (params.additionalParamMap === undefined) {
99
+ params.additionalParamMap = {}
100
+ }
101
+ if (listCode) {
102
+ params.additionalParamMap._listCode = listCode
103
+ }
104
+ if (formCode) {
105
+ params.additionalParamMap._formCode = formCode
106
+ }
107
+ if (tableName) {
108
+ params.additionalParamMap._tableName = tableName
109
+ }
110
+ if (entity && entity !== null) {
111
+ params.entity = entity
112
+ }
113
+ const backendUrl = Vue.prototype.baseURL
114
+
115
+ return new Promise((resolve, reject) => {
116
+ // 页面设计不请求动态数据源
117
+ if (Vue.prototype.systemCode !== undefined && Vue.prototype.systemCode === 'iMatrix') {
118
+ resolve()
119
+ } else {
120
+ Vue.prototype.$http.post(backendUrl + '/common/dynamic-data-source/' + dynamicSourceCode, params).then(result => {
121
+ if (result.backendUrl) {
122
+ // result.backendUrl表示需要使用动态数据源所属的系统路径重新获得一次数据
123
+ Vue.prototype.$http.post(result.backendUrl + '/common/dynamic-data-source/' + dynamicSourceCode, params).then(finallyResult => {
124
+ resolve(finallyResult)
125
+ }).catch(error => {
126
+ reject(error)
127
+ })
128
+ } else {
129
+ resolve(result)
130
+ }
131
+ }).catch(error => {
132
+ reject(error)
133
+ })
85
134
  }
86
- Vue.prototype.$http.post(Vue.prototype.baseURL + '/common/dynamic-data-source/' + dynamicSourceCode, params).then(dynamicDataSourceDto => {
87
- resolve(dynamicDataSourceDto)
88
- }).catch(error => {
89
- reject(error)
90
- })
91
135
  })
92
136
  }
93
137