three-trees-ui 1.0.95 → 1.0.96
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/LICENSE +21 -21
- package/lib/three-trees-ui.common.js +626 -835
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +626 -835
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +2 -4
- package/packages/Collapse/src/HtCollapse.vue +1 -4
- package/packages/CustomDialog/src/customDialog.vue +9 -26
- package/packages/CustomDialog/src/main.vue +115 -171
- package/packages/DimensionSelector/src/main.vue +43 -44
- package/packages/JobSelector/src/main.vue +81 -85
- package/packages/OnlineForm/src/Form.vue +4 -56
- package/packages/OrgSelector/src/main.vue +85 -87
- package/packages/PostSelector/src/main.vue +81 -86
- package/packages/Preview/src/FrameViewer.vue +5 -6
- package/packages/RoleSelector/src/main.vue +81 -87
- package/packages/UserSelector/src/main.vue +101 -96
- package/src/directive/formulas.js +1 -7
- package/src/index.js +0 -2
- package/src/mixins/onlineSubtable.js +19 -50
- package/src/styles/selector.scss +2 -42
- package/src/styles/variables.scss +5 -6
- package/src/utils.js +0 -7
- package/packages/SubEditModeDialog/index.js +0 -7
- package/packages/SubEditModeDialog/src/main.vue +0 -115
|
@@ -10,15 +10,13 @@ export default {
|
|
|
10
10
|
transitionIndex: -1,
|
|
11
11
|
left_image: '',
|
|
12
12
|
right_image: '',
|
|
13
|
-
collapseType: 'expand',
|
|
14
|
-
subDataArr: [],
|
|
15
13
|
}
|
|
16
14
|
},
|
|
17
15
|
computed: {
|
|
18
16
|
// 子表前端分页过滤器
|
|
19
17
|
pagingSubData() {
|
|
20
18
|
const me = this
|
|
21
|
-
return function(datapath) {
|
|
19
|
+
return function (datapath) {
|
|
22
20
|
// 通过子表数据路径获取分页数据
|
|
23
21
|
return SubPagination.pagingByPath(datapath, me)
|
|
24
22
|
}
|
|
@@ -56,25 +54,6 @@ export default {
|
|
|
56
54
|
}
|
|
57
55
|
},
|
|
58
56
|
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
|
-
},
|
|
78
57
|
//合计计算
|
|
79
58
|
getSummaries(param, list) {
|
|
80
59
|
let CancelTheCalculation = sessionStorage.getItem(
|
|
@@ -278,7 +257,7 @@ export default {
|
|
|
278
257
|
let exp = calc.mathExp
|
|
279
258
|
if (!exp) return null
|
|
280
259
|
var reg = /([\[|\{]).*?\((.*?)\)[\}|\]]/g
|
|
281
|
-
exp = exp.replace(reg, function() {
|
|
260
|
+
exp = exp.replace(reg, function () {
|
|
282
261
|
var symbol = arguments[1],
|
|
283
262
|
name = arguments[2]
|
|
284
263
|
const prop = name.split('.')[1]
|
|
@@ -375,7 +354,6 @@ export default {
|
|
|
375
354
|
return num
|
|
376
355
|
},
|
|
377
356
|
getExpandArr(data, type) {
|
|
378
|
-
this.collapseType = type
|
|
379
357
|
if (type === 'expand' && data) {
|
|
380
358
|
let arr = []
|
|
381
359
|
data.forEach((item) => {
|
|
@@ -390,7 +368,7 @@ export default {
|
|
|
390
368
|
if (this.isPrint) {
|
|
391
369
|
this.$router.go(-1)
|
|
392
370
|
}
|
|
393
|
-
setTimeout(function() {
|
|
371
|
+
setTimeout(function () {
|
|
394
372
|
location.reload()
|
|
395
373
|
}, 200)
|
|
396
374
|
},
|
|
@@ -476,7 +454,7 @@ export default {
|
|
|
476
454
|
this.$forceUpdate()
|
|
477
455
|
},
|
|
478
456
|
//子表默认值回填
|
|
479
|
-
addSubTab(subTabPath
|
|
457
|
+
addSubTab(subTabPath) {
|
|
480
458
|
let pathArr = subTabPath.split('.')
|
|
481
459
|
if (pathArr.length < 3) {
|
|
482
460
|
this.$message({
|
|
@@ -496,9 +474,9 @@ export default {
|
|
|
496
474
|
//把数组里面的值为 null 转换为空字符串
|
|
497
475
|
let str = JSON.stringify(subInitData).replace(/null/g, '""')
|
|
498
476
|
let subData = JSON.parse(str)
|
|
499
|
-
|
|
477
|
+
const subDataArr = this.data[pathArr[1]][pathArr[2]]
|
|
500
478
|
//子表添加后的长度,因为在nextTick中,子表已经添加完毕。
|
|
501
|
-
const nextIndex =
|
|
479
|
+
const nextIndex = subDataArr.length
|
|
502
480
|
for (var key in subData) {
|
|
503
481
|
//点添加时判断要新增子表记录中的孙表是否有值
|
|
504
482
|
if (key.indexOf('sub_') == 0) {
|
|
@@ -519,16 +497,8 @@ export default {
|
|
|
519
497
|
}
|
|
520
498
|
let fillObj = this.toFillOrg(pathArr[1] + '.' + pathArr[2], subData)
|
|
521
499
|
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
|
-
}
|
|
530
500
|
this.$root.$emit('add-new-collapse-item', fillObj.sub_guid)
|
|
531
|
-
|
|
501
|
+
subDataArr.push(fillObj)
|
|
532
502
|
}
|
|
533
503
|
},
|
|
534
504
|
//子表添加头部样式
|
|
@@ -544,13 +514,14 @@ export default {
|
|
|
544
514
|
return { '--headerBgColor': color ? color : '#f4f4f4' }
|
|
545
515
|
},
|
|
546
516
|
guid() {
|
|
547
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
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
|
+
)
|
|
554
525
|
},
|
|
555
526
|
//孙表默认值回填
|
|
556
527
|
addSunTab(subTabPath, index) {
|
|
@@ -827,17 +798,15 @@ export default {
|
|
|
827
798
|
if (conf.code) {
|
|
828
799
|
const codePath = conf.code.split('.')
|
|
829
800
|
if (!this.data[paths[0]][paths[1]][0][codePath[2]]) {
|
|
830
|
-
this.data[paths[0]][paths[1]][0][
|
|
831
|
-
|
|
832
|
-
] = this.fillOrg.code
|
|
801
|
+
this.data[paths[0]][paths[1]][0][codePath[2]] =
|
|
802
|
+
this.fillOrg.code
|
|
833
803
|
}
|
|
834
804
|
}
|
|
835
805
|
if (conf.name) {
|
|
836
806
|
const namePath = conf.name.split('.')
|
|
837
807
|
if (!this.data[paths[0]][paths[1]][0][namePath[2]]) {
|
|
838
|
-
this.data[paths[0]][paths[1]][0][
|
|
839
|
-
|
|
840
|
-
] = this.fillOrg.name
|
|
808
|
+
this.data[paths[0]][paths[1]][0][namePath[2]] =
|
|
809
|
+
this.fillOrg.name
|
|
841
810
|
}
|
|
842
811
|
}
|
|
843
812
|
}
|
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,43 +128,3 @@
|
|
|
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,17 +90,16 @@ col[width='1'] {
|
|
|
90
90
|
cursor: pointer;
|
|
91
91
|
color: #dbdbdb;
|
|
92
92
|
}
|
|
93
|
-
.el-icon-search,
|
|
94
93
|
.user-icon,
|
|
95
94
|
.org-icon {
|
|
96
95
|
display: none;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
.el-input {
|
|
99
|
+
.el-input__inner {
|
|
100
|
+
color: #fff;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
104
103
|
}
|
|
105
104
|
.el-select__tags_readonly {
|
|
106
105
|
.tag-wrap {
|
package/src/utils.js
CHANGED
|
@@ -1163,13 +1163,6 @@ 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
|
-
},
|
|
1173
1166
|
}
|
|
1174
1167
|
|
|
1175
1168
|
// 在数组上扩展一个删除指定项的方法
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<van-popup
|
|
3
|
-
v-if="dialogVisible"
|
|
4
|
-
v-model="dialogVisible"
|
|
5
|
-
position="right"
|
|
6
|
-
get-container="body"
|
|
7
|
-
class="ht-sub-edit-mode-dialog"
|
|
8
|
-
>
|
|
9
|
-
<van-nav-bar
|
|
10
|
-
title="子表编辑"
|
|
11
|
-
left-arrow
|
|
12
|
-
@click-left="dialogVisible = false"
|
|
13
|
-
/>
|
|
14
|
-
<el-form
|
|
15
|
-
v-if="dialogVisible"
|
|
16
|
-
v-form="{
|
|
17
|
-
formItemAlign: 'top',
|
|
18
|
-
inputsDisplay: 'block',
|
|
19
|
-
roInputDisplayMode: 'text',
|
|
20
|
-
}"
|
|
21
|
-
class="sub-edit-main"
|
|
22
|
-
:data-vv-scope="searchFormScope"
|
|
23
|
-
label-position="top"
|
|
24
|
-
>
|
|
25
|
-
<slot :row="{ row, index: 0 }"></slot>
|
|
26
|
-
</el-form>
|
|
27
|
-
<div class="sub-edit-footer">
|
|
28
|
-
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
29
|
-
<el-button type="primary" @click="handleConfirm">确 定</el-button>
|
|
30
|
-
</div>
|
|
31
|
-
</van-popup>
|
|
32
|
-
</template>
|
|
33
|
-
<script>
|
|
34
|
-
import { cloneDeep } from 'lodash'
|
|
35
|
-
import utils from '@/utils.js'
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
name: 'HtSubEditModeDialog',
|
|
39
|
-
props: {},
|
|
40
|
-
data() {
|
|
41
|
-
return {
|
|
42
|
-
dialogVisible: false,
|
|
43
|
-
dialogType: 'add',
|
|
44
|
-
row: {},
|
|
45
|
-
orgRow: {}, // 存储原始数据,用来修改子表的数据
|
|
46
|
-
data: {}, // 主表数据,用来处理参数绑定、值回显等问题
|
|
47
|
-
permission: {},
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
computed: {
|
|
51
|
-
searchFormScope() {
|
|
52
|
-
return `Form${utils.guid()}`
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
methods: {
|
|
56
|
-
showDialog({ type, data, mainData }) {
|
|
57
|
-
this.dialogVisible = true
|
|
58
|
-
this.permission = utils.getOnlineFormInstance(this).permission || {}
|
|
59
|
-
this.dialogType = type
|
|
60
|
-
this.orgRow = data
|
|
61
|
-
this.data = mainData
|
|
62
|
-
this.row = cloneDeep(data)
|
|
63
|
-
},
|
|
64
|
-
handleConfirm() {
|
|
65
|
-
utils
|
|
66
|
-
.validateForm(this, this.searchFormScope)
|
|
67
|
-
.then(() => {
|
|
68
|
-
this.dialogVisible = false
|
|
69
|
-
// 点击确认更新子表数据
|
|
70
|
-
const keys = Object.keys(this.orgRow || {})
|
|
71
|
-
keys.forEach((key) => {
|
|
72
|
-
if (this.orgRow[key] !== this.row[key]) {
|
|
73
|
-
this.orgRow[key] = this.row[key]
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
this.$emit('getSubEditModeData', this.row, this.dialogType)
|
|
77
|
-
})
|
|
78
|
-
.catch(() => {})
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
}
|
|
82
|
-
</script>
|
|
83
|
-
<style lang="scss" scoped>
|
|
84
|
-
::v-deep {
|
|
85
|
-
.el-row {
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-wrap: wrap;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
</style>
|
|
91
|
-
<style lang="scss">
|
|
92
|
-
.ht-sub-edit-mode-dialog {
|
|
93
|
-
width: 100%;
|
|
94
|
-
height: 100vh;
|
|
95
|
-
display: flex;
|
|
96
|
-
flex-direction: column;
|
|
97
|
-
|
|
98
|
-
.sub-edit-main {
|
|
99
|
-
flex: 1;
|
|
100
|
-
padding: 16px;
|
|
101
|
-
overflow-y: auto;
|
|
102
|
-
&.el-form--label-top .el-form-item__label {
|
|
103
|
-
padding-bottom: 0;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
.sub-edit-footer {
|
|
107
|
-
height: 46px;
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
justify-content: center;
|
|
111
|
-
padding: 0 24px;
|
|
112
|
-
border-top: 1px solid #ebebeb;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
</style>
|