imatrix-ui 2.8.28 → 2.8.29

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.
@@ -169,10 +169,12 @@
169
169
  />
170
170
  </span>
171
171
  <span v-else :id="column.prop+'DomData'+scope.$index" class="cell--span">
172
- <span v-if="$escapeHtml(getLabel(scope.row,scope.$index))">
173
- <i class="el-icon-zoom-in annex-cell" @click="previewImg(scope.row)" />
174
- </span>
175
- {{ $escapeHtml(getLabel(scope.row,scope.$index)) }}
172
+ <FsPreview
173
+ :label="$escapeHtml(getLabel(scope.row,scope.$index))"
174
+ :entity="scope.row"
175
+ :file-set-obj=" JSON.parse(column.fileSet)"
176
+ :is-sql="isSql"
177
+ />
176
178
  </span>
177
179
  </span>
178
180
  <span v-else-if="column.formatter && column.formatter.type === 'files'">
@@ -727,9 +727,15 @@ export default {
727
727
  const that = this
728
728
  const isShowUserTreeDialog =
729
729
  document.querySelector('.user-tree') !== null
730
+ // 列表页面中是否有弹框,例如:按钮区点击一个按钮dialog弹框时,如果有弹框,则列表的回车事件不生效,否则会导致页面刷新
731
+ let isPageHasDialog = window.sessionStorage.getItem(this.pageCode + '-isShowPageDialog')
732
+ if (isPageHasDialog === undefined) {
733
+ isPageHasDialog = false
734
+ }
735
+ console.log('super-grid-----this.pageCode=', this.pageCode, 'isPageHasDialog=', isPageHasDialog)
730
736
  // 当前页面监视键盘输入
731
737
  document.querySelector('.' + this.code).onkeydown = function(e) {
732
- if (!that.isShowPageDialog && !isShowUserTreeDialog) {
738
+ if (!that.isShowPageDialog && !isShowUserTreeDialog && !isPageHasDialog) {
733
739
  // 当前列表页面没有弹框或选人弹框,才走键盘监视事件
734
740
  // 事件对象兼容
735
741
  // eslint-disable-next-line no-caller
@@ -760,7 +766,10 @@ export default {
760
766
  }
761
767
  } else if (e1 && e1.keyCode === 13) {
762
768
  // 回车
763
- that.enterOperation(that)
769
+ if (that.isCallEnterEvent(that)) {
770
+ // 不是子表时,才需要回车事件,子表时不处理回车事件,扫码枪回车事件和平台的回车事件冲突了。子表时用户一般不会主动回车取消行编辑。
771
+ that.enterOperation(that)
772
+ }
764
773
  } else if (e1 && e1.keyCode === 27) {
765
774
  // ESC
766
775
  that.escOperation(that)
@@ -792,6 +801,18 @@ export default {
792
801
  ...publicMethods,
793
802
  ...superGridService,
794
803
  ...apis,
804
+ // 是否触发回车事件
805
+ isCallEnterEvent(that) {
806
+ let canCall = true
807
+ if (this.options.isEnableEnterEvent !== undefined && this.options.isEnableEnterEvent === false) {
808
+ canCall = false
809
+ }
810
+ const gridParams = store.get(that.code)
811
+ if (gridParams.options && gridParams.options.isFormSubTable) {
812
+ canCall = false
813
+ }
814
+ return canCall
815
+ },
795
816
  isShowPageArea() {
796
817
  if (this.isFormSubTable) {
797
818
  return this.options.showPageArea !== undefined && this.options.showPageArea === true
@@ -2656,7 +2677,7 @@ export default {
2656
2677
  // api方法,super-pages中有调用该方法
2657
2678
  closePageDialog(popParams) {
2658
2679
  // popParams格式为:{ entity, pageCode }
2659
- console.log('列表组件--closePageDialog---this.jumpPageSetting=', this.jumpPageSetting )
2680
+ console.log('列表组件--closePageDialog---this.jumpPageSetting=', this.jumpPageSetting)
2660
2681
  if (this.jumpPageSetting) {
2661
2682
  // 调用关闭弹框事件
2662
2683
  const gridParams = store.get(this.code)
@@ -0,0 +1,90 @@
1
+ import localStorage from '../../src/utils/local-storage'
2
+ const memoryCacheUtils = {
3
+ memorySearch(queryString, cb) {
4
+ var memoryCacheData = this.memoryCacheData
5
+ var results = memoryCacheData
6
+ setTimeout(() => {
7
+ cb(results)
8
+ }, 10 * Math.random())
9
+ },
10
+ setMemoryCacheData(row, componentType) {
11
+ if (componentType === 'departmentUser') {
12
+ this.setDepartmentUserMemoryCacheData(row)
13
+ } else if (componentType === 'department') {
14
+ this.setDepartmentMemoryCacheData(row)
15
+ }
16
+ },
17
+ getMemoryCacheData(componentType) {
18
+ if (componentType === 'departmentUser') {
19
+ this.getDepartmentUserMemoryCacheData()
20
+ } else if (componentType === 'department') {
21
+ this.getDepartmentMemoryCacheData()
22
+ }
23
+ },
24
+ setDepartmentUserMemoryCacheData(selectUser) {
25
+ const cacheLength = 10
26
+ var memoryCacheData = localStorage.getObject(this.memoryCacheKey)
27
+ var name = (selectUser.name === undefined || selectUser.name === null || selectUser.name === 'undefined') ? '' : selectUser.name
28
+ var loginName = (selectUser.loginName === undefined || selectUser.loginName === null || selectUser.loginName === 'undefined') ? '' : selectUser.loginName
29
+ var mainDepartmentName = (selectUser.mainDepartmentName === undefined || selectUser.mainDepartmentName === null || selectUser.mainDepartmentName === 'undefined') ? '' : selectUser.mainDepartmentName
30
+ const valueKey = name + '(' + loginName + '/' + mainDepartmentName + ')'
31
+ var index = -1
32
+ if (memoryCacheData && memoryCacheData.length > 0) {
33
+ index = memoryCacheData.findIndex(item => item.loginName === selectUser.loginName)
34
+ } else {
35
+ memoryCacheData = []
36
+ }
37
+ selectUser['value'] = valueKey
38
+ if (index < 0) {
39
+ if (memoryCacheData.length === cacheLength) {
40
+ memoryCacheData.splice(cacheLength - 1, 1)
41
+ }
42
+ memoryCacheData.unshift(selectUser)
43
+ localStorage.setObject(this.memoryCacheKey, memoryCacheData)
44
+ } else {
45
+ // 最后选中优先排序
46
+ memoryCacheData.splice(index, 1)
47
+ memoryCacheData.unshift(selectUser)
48
+ localStorage.setObject(this.memoryCacheKey, memoryCacheData)
49
+ }
50
+ },
51
+ setDepartmentMemoryCacheData(selectDept) {
52
+ const cacheLength = 10
53
+ var memoryCacheData = localStorage.getObject(this.memoryCacheKey)
54
+ var name = (selectDept.name === undefined || selectDept.name === null || selectDept.name === 'undefined') ? '' : selectDept.name
55
+ var code = (selectDept.code === undefined || selectDept.code === null || selectDept.code === 'undefined') ? '' : selectDept.code
56
+ const valueKey = name + '(' + code + ')'
57
+ var index = -1
58
+ if (memoryCacheData && memoryCacheData.length > 0) {
59
+ index = memoryCacheData.findIndex(item => item.code === selectDept.code)
60
+ } else {
61
+ memoryCacheData = []
62
+ }
63
+ selectDept['value'] = valueKey
64
+ if (index < 0) {
65
+ if (memoryCacheData.length === cacheLength) {
66
+ memoryCacheData.splice(cacheLength - 1, 1)
67
+ }
68
+ memoryCacheData.unshift(selectDept)
69
+ localStorage.setObject(this.memoryCacheKey, memoryCacheData)
70
+ } else {
71
+ // 最后选中优先排序
72
+ memoryCacheData.splice(index, 1)
73
+ memoryCacheData.unshift(selectDept)
74
+ localStorage.setObject(this.memoryCacheKey, memoryCacheData)
75
+ }
76
+ },
77
+ getDepartmentUserMemoryCacheData() {
78
+ var memoryCacheData = localStorage.getObject(this.memoryCacheKey)
79
+ if (memoryCacheData && memoryCacheData.length > 0) {
80
+ this.memoryCacheData = memoryCacheData
81
+ }
82
+ },
83
+ getDepartmentMemoryCacheData() {
84
+ var memoryCacheData = localStorage.getObject(this.memoryCacheKey)
85
+ if (memoryCacheData && memoryCacheData.length > 0) {
86
+ this.memoryCacheData = memoryCacheData
87
+ }
88
+ }
89
+ }
90
+ export default memoryCacheUtils
@@ -331,12 +331,14 @@ function packagePathParams(dataId, path, jumpPage, ids, buttonCode, isHasIdParam
331
331
  }
332
332
  }
333
333
  if (ids && ids.length > 0) {
334
+ const idsStr = ids.join(',')
335
+ const idsPath = 'ids=' + idsStr + '&_idsStr=' + idsStr
334
336
  if (path.indexOf('?') !== -1) {
335
337
  path += '&'
336
- path += 'ids=' + ids.join(',')
338
+ path += idsPath
337
339
  } else {
338
340
  path += '?'
339
- path += 'ids=' + ids.join(',')
341
+ path += idsPath
340
342
  }
341
343
  }
342
344
  if (buttonCode) {