three-trees-ui 1.0.96 → 1.0.98
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/lib/three-trees-ui.common.js +942 -645
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +942 -645
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +4 -2
- package/packages/Collapse/src/HtCollapse.vue +4 -1
- package/packages/CustomDialog/src/customDialog.vue +26 -9
- package/packages/CustomDialog/src/main.vue +171 -115
- package/packages/DimensionSelector/src/main.vue +44 -43
- package/packages/JobSelector/src/main.vue +85 -81
- package/packages/OnlineForm/src/Form.vue +155 -5
- package/packages/OrgSelector/src/main.vue +87 -85
- package/packages/PostSelector/src/main.vue +86 -81
- package/packages/Preview/src/FrameViewer.vue +0 -5
- package/packages/RoleSelector/src/main.vue +87 -81
- package/packages/SubEditModeDialog/index.js +7 -0
- package/packages/SubEditModeDialog/src/main.vue +115 -0
- package/packages/TemplateForm/src/main.vue +1 -0
- package/packages/UserSelector/src/main.vue +96 -101
- package/src/directive/formulas.js +7 -1
- package/src/index.js +2 -0
- package/src/mixins/onlineSubtable.js +63 -19
- package/src/styles/selector.scss +42 -2
- package/src/styles/variables.scss +6 -5
- package/src/utils.js +7 -0
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,28 @@ 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: {
|
|
18
|
+
showMobileEdit() {
|
|
19
|
+
return (subName) => {
|
|
20
|
+
if (this.permission && this.permission.fields[subName]) {
|
|
21
|
+
return Object.keys(this.permission.fields[subName]).some((k) => {
|
|
22
|
+
return (
|
|
23
|
+
this.permission.fields[subName][k] == 'b' ||
|
|
24
|
+
this.permission.fields[subName][k] == 'w'
|
|
25
|
+
)
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
return false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
16
31
|
// 子表前端分页过滤器
|
|
17
32
|
pagingSubData() {
|
|
18
33
|
const me = this
|
|
19
|
-
return function
|
|
34
|
+
return function(datapath) {
|
|
20
35
|
// 通过子表数据路径获取分页数据
|
|
21
36
|
return SubPagination.pagingByPath(datapath, me)
|
|
22
37
|
}
|
|
@@ -54,6 +69,25 @@ export default {
|
|
|
54
69
|
}
|
|
55
70
|
},
|
|
56
71
|
methods: {
|
|
72
|
+
getSunExpandArr(data, type) {
|
|
73
|
+
return this.getExpandArr(data, type)
|
|
74
|
+
},
|
|
75
|
+
getSubEditModeData(data = {}, type) {
|
|
76
|
+
if (type === 'edit') return
|
|
77
|
+
this.$root.$emit(
|
|
78
|
+
'add-new-collapse-item',
|
|
79
|
+
data.sub_guid,
|
|
80
|
+
this.collapseType
|
|
81
|
+
)
|
|
82
|
+
this.subDataArr.push(data)
|
|
83
|
+
},
|
|
84
|
+
editSubRow(row, name) {
|
|
85
|
+
this.$refs[`HtSubEditModeDialog_${name}`].showDialog({
|
|
86
|
+
data: row,
|
|
87
|
+
mainData: this.data,
|
|
88
|
+
type: 'edit',
|
|
89
|
+
})
|
|
90
|
+
},
|
|
57
91
|
//合计计算
|
|
58
92
|
getSummaries(param, list) {
|
|
59
93
|
let CancelTheCalculation = sessionStorage.getItem(
|
|
@@ -257,7 +291,7 @@ export default {
|
|
|
257
291
|
let exp = calc.mathExp
|
|
258
292
|
if (!exp) return null
|
|
259
293
|
var reg = /([\[|\{]).*?\((.*?)\)[\}|\]]/g
|
|
260
|
-
exp = exp.replace(reg, function
|
|
294
|
+
exp = exp.replace(reg, function() {
|
|
261
295
|
var symbol = arguments[1],
|
|
262
296
|
name = arguments[2]
|
|
263
297
|
const prop = name.split('.')[1]
|
|
@@ -354,6 +388,7 @@ export default {
|
|
|
354
388
|
return num
|
|
355
389
|
},
|
|
356
390
|
getExpandArr(data, type) {
|
|
391
|
+
this.collapseType = type
|
|
357
392
|
if (type === 'expand' && data) {
|
|
358
393
|
let arr = []
|
|
359
394
|
data.forEach((item) => {
|
|
@@ -368,7 +403,7 @@ export default {
|
|
|
368
403
|
if (this.isPrint) {
|
|
369
404
|
this.$router.go(-1)
|
|
370
405
|
}
|
|
371
|
-
setTimeout(function
|
|
406
|
+
setTimeout(function() {
|
|
372
407
|
location.reload()
|
|
373
408
|
}, 200)
|
|
374
409
|
},
|
|
@@ -454,7 +489,7 @@ export default {
|
|
|
454
489
|
this.$forceUpdate()
|
|
455
490
|
},
|
|
456
491
|
//子表默认值回填
|
|
457
|
-
addSubTab(subTabPath) {
|
|
492
|
+
addSubTab(subTabPath, subEditMode, name) {
|
|
458
493
|
let pathArr = subTabPath.split('.')
|
|
459
494
|
if (pathArr.length < 3) {
|
|
460
495
|
this.$message({
|
|
@@ -474,9 +509,9 @@ export default {
|
|
|
474
509
|
//把数组里面的值为 null 转换为空字符串
|
|
475
510
|
let str = JSON.stringify(subInitData).replace(/null/g, '""')
|
|
476
511
|
let subData = JSON.parse(str)
|
|
477
|
-
|
|
512
|
+
this.subDataArr = this.data[pathArr[1]][pathArr[2]]
|
|
478
513
|
//子表添加后的长度,因为在nextTick中,子表已经添加完毕。
|
|
479
|
-
const nextIndex = subDataArr.length
|
|
514
|
+
const nextIndex = this.subDataArr.length
|
|
480
515
|
for (var key in subData) {
|
|
481
516
|
//点添加时判断要新增子表记录中的孙表是否有值
|
|
482
517
|
if (key.indexOf('sub_') == 0) {
|
|
@@ -497,8 +532,16 @@ export default {
|
|
|
497
532
|
}
|
|
498
533
|
let fillObj = this.toFillOrg(pathArr[1] + '.' + pathArr[2], subData)
|
|
499
534
|
fillObj.sub_guid = this.guid()
|
|
535
|
+
if (subEditMode == 2) {
|
|
536
|
+
this.$refs[`HtSubEditModeDialog_${name}`].showDialog({
|
|
537
|
+
data: fillObj,
|
|
538
|
+
mainData: this.data,
|
|
539
|
+
type: 'add',
|
|
540
|
+
})
|
|
541
|
+
return
|
|
542
|
+
}
|
|
500
543
|
this.$root.$emit('add-new-collapse-item', fillObj.sub_guid)
|
|
501
|
-
subDataArr.push(fillObj)
|
|
544
|
+
this.subDataArr.push(fillObj)
|
|
502
545
|
}
|
|
503
546
|
},
|
|
504
547
|
//子表添加头部样式
|
|
@@ -514,14 +557,13 @@ export default {
|
|
|
514
557
|
return { '--headerBgColor': color ? color : '#f4f4f4' }
|
|
515
558
|
},
|
|
516
559
|
guid() {
|
|
517
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
)
|
|
560
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(
|
|
561
|
+
c
|
|
562
|
+
) {
|
|
563
|
+
var r = (Math.random() * 16) | 0,
|
|
564
|
+
v = c == 'x' ? r : (r & 0x3) | 0x8
|
|
565
|
+
return v.toString(16)
|
|
566
|
+
})
|
|
525
567
|
},
|
|
526
568
|
//孙表默认值回填
|
|
527
569
|
addSunTab(subTabPath, index) {
|
|
@@ -798,15 +840,17 @@ export default {
|
|
|
798
840
|
if (conf.code) {
|
|
799
841
|
const codePath = conf.code.split('.')
|
|
800
842
|
if (!this.data[paths[0]][paths[1]][0][codePath[2]]) {
|
|
801
|
-
this.data[paths[0]][paths[1]][0][
|
|
802
|
-
|
|
843
|
+
this.data[paths[0]][paths[1]][0][
|
|
844
|
+
codePath[2]
|
|
845
|
+
] = this.fillOrg.code
|
|
803
846
|
}
|
|
804
847
|
}
|
|
805
848
|
if (conf.name) {
|
|
806
849
|
const namePath = conf.name.split('.')
|
|
807
850
|
if (!this.data[paths[0]][paths[1]][0][namePath[2]]) {
|
|
808
|
-
this.data[paths[0]][paths[1]][0][
|
|
809
|
-
|
|
851
|
+
this.data[paths[0]][paths[1]][0][
|
|
852
|
+
namePath[2]
|
|
853
|
+
] = this.fillOrg.name
|
|
810
854
|
}
|
|
811
855
|
}
|
|
812
856
|
}
|
package/src/styles/selector.scss
CHANGED
|
@@ -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
|
-
|
|
100
|
-
|
|
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
|
// 在数组上扩展一个删除指定项的方法
|