three-trees-ui 1.0.94 → 1.0.95

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/src/index.js CHANGED
@@ -42,6 +42,7 @@ import HtEditor from '../packages/Editor/index'
42
42
  import HtPicture from '../packages/picture/index'
43
43
  import HtExplain from '../packages/Explain/index'
44
44
  import HtAvatarImage from '../packages/Avatar/index'
45
+ import HtSubEditModeDialog from '../packages/SubEditModeDialog/index'
45
46
  import {
46
47
  HtH1,
47
48
  HtH2,
@@ -230,6 +231,7 @@ const HotentUi = {
230
231
  HtPostDialog,
231
232
  HtJobDialog,
232
233
  HtRoleDialog,
234
+ HtSubEditModeDialog,
233
235
  }
234
236
 
235
237
  HotentUi.install = (Vue, opts = {}) => {
@@ -10,13 +10,15 @@ export default {
10
10
  transitionIndex: -1,
11
11
  left_image: '',
12
12
  right_image: '',
13
+ collapseType: 'expand',
14
+ subDataArr: [],
13
15
  }
14
16
  },
15
17
  computed: {
16
18
  // 子表前端分页过滤器
17
19
  pagingSubData() {
18
20
  const me = this
19
- return function (datapath) {
21
+ return function(datapath) {
20
22
  // 通过子表数据路径获取分页数据
21
23
  return SubPagination.pagingByPath(datapath, me)
22
24
  }
@@ -54,6 +56,25 @@ export default {
54
56
  }
55
57
  },
56
58
  methods: {
59
+ getSunExpandArr(data, type) {
60
+ return this.getExpandArr(data, type)
61
+ },
62
+ getSubEditModeData(data = {}, type) {
63
+ if (type === 'edit') return
64
+ this.$root.$emit(
65
+ 'add-new-collapse-item',
66
+ data.sub_guid,
67
+ this.collapseType
68
+ )
69
+ this.subDataArr.push(data)
70
+ },
71
+ editSubRow(row, name) {
72
+ this.$refs[`HtSubEditModeDialog_${name}`].showDialog({
73
+ data: row,
74
+ mainData: this.data,
75
+ type: 'edit',
76
+ })
77
+ },
57
78
  //合计计算
58
79
  getSummaries(param, list) {
59
80
  let CancelTheCalculation = sessionStorage.getItem(
@@ -257,7 +278,7 @@ export default {
257
278
  let exp = calc.mathExp
258
279
  if (!exp) return null
259
280
  var reg = /([\[|\{]).*?\((.*?)\)[\}|\]]/g
260
- exp = exp.replace(reg, function () {
281
+ exp = exp.replace(reg, function() {
261
282
  var symbol = arguments[1],
262
283
  name = arguments[2]
263
284
  const prop = name.split('.')[1]
@@ -354,6 +375,7 @@ export default {
354
375
  return num
355
376
  },
356
377
  getExpandArr(data, type) {
378
+ this.collapseType = type
357
379
  if (type === 'expand' && data) {
358
380
  let arr = []
359
381
  data.forEach((item) => {
@@ -368,7 +390,7 @@ export default {
368
390
  if (this.isPrint) {
369
391
  this.$router.go(-1)
370
392
  }
371
- setTimeout(function () {
393
+ setTimeout(function() {
372
394
  location.reload()
373
395
  }, 200)
374
396
  },
@@ -454,7 +476,7 @@ export default {
454
476
  this.$forceUpdate()
455
477
  },
456
478
  //子表默认值回填
457
- addSubTab(subTabPath) {
479
+ addSubTab(subTabPath, subEditMode, name) {
458
480
  let pathArr = subTabPath.split('.')
459
481
  if (pathArr.length < 3) {
460
482
  this.$message({
@@ -474,9 +496,9 @@ export default {
474
496
  //把数组里面的值为 null 转换为空字符串
475
497
  let str = JSON.stringify(subInitData).replace(/null/g, '""')
476
498
  let subData = JSON.parse(str)
477
- const subDataArr = this.data[pathArr[1]][pathArr[2]]
499
+ this.subDataArr = this.data[pathArr[1]][pathArr[2]]
478
500
  //子表添加后的长度,因为在nextTick中,子表已经添加完毕。
479
- const nextIndex = subDataArr.length
501
+ const nextIndex = this.subDataArr.length
480
502
  for (var key in subData) {
481
503
  //点添加时判断要新增子表记录中的孙表是否有值
482
504
  if (key.indexOf('sub_') == 0) {
@@ -497,8 +519,16 @@ export default {
497
519
  }
498
520
  let fillObj = this.toFillOrg(pathArr[1] + '.' + pathArr[2], subData)
499
521
  fillObj.sub_guid = this.guid()
522
+ if (subEditMode == 2) {
523
+ this.$refs[`HtSubEditModeDialog_${name}`].showDialog({
524
+ data: fillObj,
525
+ mainData: this.data,
526
+ type: 'add',
527
+ })
528
+ return
529
+ }
500
530
  this.$root.$emit('add-new-collapse-item', fillObj.sub_guid)
501
- subDataArr.push(fillObj)
531
+ this.subDataArr.push(fillObj)
502
532
  }
503
533
  },
504
534
  //子表添加头部样式
@@ -514,14 +544,13 @@ export default {
514
544
  return { '--headerBgColor': color ? color : '#f4f4f4' }
515
545
  },
516
546
  guid() {
517
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
518
- /[xy]/g,
519
- function (c) {
520
- var r = (Math.random() * 16) | 0,
521
- v = c == 'x' ? r : (r & 0x3) | 0x8
522
- return v.toString(16)
523
- }
524
- )
547
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(
548
+ c
549
+ ) {
550
+ var r = (Math.random() * 16) | 0,
551
+ v = c == 'x' ? r : (r & 0x3) | 0x8
552
+ return v.toString(16)
553
+ })
525
554
  },
526
555
  //孙表默认值回填
527
556
  addSunTab(subTabPath, index) {
@@ -798,15 +827,17 @@ export default {
798
827
  if (conf.code) {
799
828
  const codePath = conf.code.split('.')
800
829
  if (!this.data[paths[0]][paths[1]][0][codePath[2]]) {
801
- this.data[paths[0]][paths[1]][0][codePath[2]] =
802
- this.fillOrg.code
830
+ this.data[paths[0]][paths[1]][0][
831
+ codePath[2]
832
+ ] = this.fillOrg.code
803
833
  }
804
834
  }
805
835
  if (conf.name) {
806
836
  const namePath = conf.name.split('.')
807
837
  if (!this.data[paths[0]][paths[1]][0][namePath[2]]) {
808
- this.data[paths[0]][paths[1]][0][namePath[2]] =
809
- this.fillOrg.name
838
+ this.data[paths[0]][paths[1]][0][
839
+ namePath[2]
840
+ ] = this.fillOrg.name
810
841
  }
811
842
  }
812
843
  }
@@ -11,10 +11,10 @@
11
11
  .ht-selector__table {
12
12
  height: 380px;
13
13
  }
14
- .el-pagination{
14
+ .el-pagination {
15
15
  white-space: pre-wrap !important;
16
16
  }
17
- }
17
+ }
18
18
  }
19
19
 
20
20
  @media (min-width: 1400px) {
@@ -128,3 +128,43 @@
128
128
  }
129
129
  }
130
130
  }
131
+
132
+ .custom-selector-mobile {
133
+ .custom-selector-mobile-box {
134
+ display: flex;
135
+ min-height: 32px;
136
+ align-items: center;
137
+ padding: 4px 14px;
138
+ flex-wrap: wrap;
139
+ gap: 4px;
140
+ line-height: 22px;
141
+ padding-right: 40px;
142
+ box-sizing: border-box;
143
+ .el-icon-error {
144
+ color: #909399;
145
+ }
146
+ }
147
+ .el-input__inner {
148
+ position: absolute;
149
+ left: 0;
150
+ top: 0;
151
+ right: 0;
152
+ bottom: 0;
153
+ user-select: none;
154
+ background: none;
155
+ color: transparent !important;
156
+ pointer-events: none;
157
+ height: 100%;
158
+ }
159
+ .el-input__suffix-inner {
160
+ display: flex;
161
+ align-items: center;
162
+ }
163
+ .el-icon-circle-close {
164
+ margin-right: 3px;
165
+ }
166
+ .user-icon,
167
+ .el-icon-circle-close {
168
+ display: inline-block !important;
169
+ }
170
+ }
@@ -90,16 +90,17 @@ col[width='1'] {
90
90
  cursor: pointer;
91
91
  color: #dbdbdb;
92
92
  }
93
+ .el-icon-search,
93
94
  .user-icon,
94
95
  .org-icon {
95
96
  display: none;
96
97
  }
97
98
  }
98
- .el-input {
99
- .el-input__inner {
100
- color: #fff;
101
- }
102
- }
99
+ // .el-input {
100
+ // .el-input__inner {
101
+ // color: #fff;
102
+ // }
103
+ // }
103
104
  }
104
105
  .el-select__tags_readonly {
105
106
  .tag-wrap {
package/src/utils.js CHANGED
@@ -1163,6 +1163,13 @@ var utils = {
1163
1163
  return url
1164
1164
  }
1165
1165
  },
1166
+ guid: () => {
1167
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
1168
+ var r = (Math.random() * 16) | 0,
1169
+ v = c == 'x' ? r : (r & 0x3) | 0x8
1170
+ return v.toString(16)
1171
+ })
1172
+ },
1166
1173
  }
1167
1174
 
1168
1175
  // 在数组上扩展一个删除指定项的方法