three-trees-ui 1.1.2 → 1.1.4
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 +824 -530
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +824 -530
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +1 -1
- 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 +6 -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
|
@@ -16,35 +16,23 @@
|
|
|
16
16
|
@click="showDialog"
|
|
17
17
|
>
|
|
18
18
|
<div
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
:class="{
|
|
22
|
-
'el-select__tags_readonly': !inputWriteable,
|
|
23
|
-
'el-select__tags': inputWriteable,
|
|
24
|
-
}"
|
|
19
|
+
v-if="inputWriteable"
|
|
20
|
+
class="el-input el-input--suffix"
|
|
21
|
+
:class="{ 'custom-selector-mobile': isMobile }"
|
|
25
22
|
>
|
|
26
|
-
<
|
|
27
|
-
<
|
|
23
|
+
<div v-if="isMobile" class="custom-selector-mobile-box">
|
|
24
|
+
<div
|
|
28
25
|
v-for="(item, index) in selectors"
|
|
29
26
|
:key="index"
|
|
30
|
-
class="
|
|
31
|
-
@click.stop
|
|
27
|
+
class="common-selector-tag"
|
|
32
28
|
>
|
|
33
|
-
<span
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
v-if="inputWriteable"
|
|
38
|
-
class="el-tag__close el-icon-close"
|
|
39
|
-
@click="handleRemove(item)"
|
|
40
|
-
></i>
|
|
41
|
-
</span>
|
|
42
|
-
</span>
|
|
43
|
-
</div>
|
|
44
|
-
<div v-if="inputWriteable" class="el-input el-input--suffix">
|
|
29
|
+
<span>{{ item.name }}</span>
|
|
30
|
+
<i class="el-icon-error" @click.stop="handleRemove(item)"></i>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
45
33
|
<input
|
|
46
34
|
ref="inputEl"
|
|
47
|
-
v-model="
|
|
35
|
+
v-model="calcInputValue"
|
|
48
36
|
v-validate="inputValidate"
|
|
49
37
|
type="text"
|
|
50
38
|
readonly="readonly"
|
|
@@ -52,10 +40,6 @@
|
|
|
52
40
|
autocomplete="off"
|
|
53
41
|
class="el-input__inner"
|
|
54
42
|
:placeholder="placeholder"
|
|
55
|
-
:style="{
|
|
56
|
-
height: inputSuffixHeight + 'px',
|
|
57
|
-
lineHeight: inputSuffixHeight + 'px',
|
|
58
|
-
}"
|
|
59
43
|
/>
|
|
60
44
|
<span class="el-input__suffix">
|
|
61
45
|
<span class="el-input__suffix-inner">
|
|
@@ -64,51 +48,56 @@
|
|
|
64
48
|
</span>
|
|
65
49
|
</span>
|
|
66
50
|
</div>
|
|
51
|
+
<div v-else class="el-select__tags_readonly">
|
|
52
|
+
<span>{{ calcInputValue }}</span>
|
|
53
|
+
</div>
|
|
67
54
|
</div>
|
|
68
55
|
<ht-field-tail :field-name="inputName" :input-value="value" />
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
56
|
+
<template v-if="isDialogShow">
|
|
57
|
+
<org-selector-dialog
|
|
58
|
+
v-if="!isMobile"
|
|
59
|
+
ref="orgSelectorDialog"
|
|
60
|
+
v-model="selectors"
|
|
61
|
+
:title="title"
|
|
62
|
+
:append-to-body="appendToBody"
|
|
63
|
+
:data="data"
|
|
64
|
+
:pagination="pagination"
|
|
65
|
+
:select-label="selectLabel"
|
|
66
|
+
:quick-search-props="quickSearchProps"
|
|
67
|
+
:single="single"
|
|
68
|
+
:search-placeholder="searchPlaceholder"
|
|
69
|
+
:primary-field="primaryField"
|
|
70
|
+
:mode="mode"
|
|
71
|
+
@filter-type-change="(type) => $emit('filter-type-change', type)"
|
|
72
|
+
@search="(word) => $emit('search', word)"
|
|
73
|
+
@reset="() => $emit('reset')"
|
|
74
|
+
@row-click="(row) => $emit('row-click', row)"
|
|
75
|
+
@select-data="(data) => $emit('select-data', data)"
|
|
76
|
+
@page-change="(page) => $emit('page-change', page)"
|
|
77
|
+
@size-change="(size) => $emit('size-change', size)"
|
|
78
|
+
@contact-group-change="(group) => $emit('contact-group-change', group)"
|
|
79
|
+
@load-org="(org) => $emit('load-org', org)"
|
|
80
|
+
@load-policy-org="(policy) => $emit('load-policy-org', policy)"
|
|
81
|
+
/>
|
|
82
|
+
<org-selector-mobile-dialog
|
|
83
|
+
v-else
|
|
84
|
+
ref="orgSelectorMobileDialog"
|
|
85
|
+
v-model="selectors"
|
|
86
|
+
:title="title"
|
|
87
|
+
:append-to-body="appendToBody"
|
|
88
|
+
:data="data"
|
|
89
|
+
:pagination="pagination"
|
|
90
|
+
:select-label="selectLabel"
|
|
91
|
+
:single="single"
|
|
92
|
+
:search-placeholder="searchPlaceholder"
|
|
93
|
+
:primary-field="primaryField"
|
|
94
|
+
@search="(word) => $emit('search', word)"
|
|
95
|
+
@reset="() => $emit('reset')"
|
|
96
|
+
@row-click="(row) => $emit('row-click', row)"
|
|
97
|
+
@select-data="(data) => $emit('select-data', data)"
|
|
98
|
+
@page-change="(page) => $emit('page-change', page)"
|
|
99
|
+
/>
|
|
100
|
+
</template>
|
|
112
101
|
</div>
|
|
113
102
|
</template>
|
|
114
103
|
<script>
|
|
@@ -186,11 +175,23 @@
|
|
|
186
175
|
},
|
|
187
176
|
data() {
|
|
188
177
|
return {
|
|
178
|
+
isDialogShow: false,
|
|
189
179
|
inputSuffixHeight: 30,
|
|
190
180
|
selectors: [],
|
|
191
181
|
}
|
|
192
182
|
},
|
|
193
183
|
computed: {
|
|
184
|
+
calcInputValue: function() {
|
|
185
|
+
let name = ''
|
|
186
|
+
if (this.selectors) {
|
|
187
|
+
name = this.selectors
|
|
188
|
+
.map((k) => {
|
|
189
|
+
return this.showPath ? k.pathName : k.name
|
|
190
|
+
})
|
|
191
|
+
.join(',')
|
|
192
|
+
}
|
|
193
|
+
return name
|
|
194
|
+
},
|
|
194
195
|
primaryField: function() {
|
|
195
196
|
return this.config && this.config.hasOwnProperty('id')
|
|
196
197
|
? 'id'
|
|
@@ -262,14 +263,8 @@
|
|
|
262
263
|
// 通过valueChange事件发布值变更消息
|
|
263
264
|
this.$emit('valueChange', ary.join(','), newVal)
|
|
264
265
|
setTimeout(() => {
|
|
265
|
-
if (newVal.length > 0) {
|
|
266
|
-
this.calacInputSuffixHeight()
|
|
267
|
-
} else {
|
|
268
|
-
this.inputSuffixHeight = 30
|
|
269
|
-
}
|
|
270
266
|
if (this.$refs.inputEl) {
|
|
271
|
-
this.$
|
|
272
|
-
this.$refs.inputEl.blur()
|
|
267
|
+
this.$validator.validate(this.inputName)
|
|
273
268
|
}
|
|
274
269
|
}, 10)
|
|
275
270
|
},
|
|
@@ -350,10 +345,14 @@
|
|
|
350
345
|
this.selectors = tmpAry
|
|
351
346
|
}
|
|
352
347
|
},
|
|
353
|
-
showDialog() {
|
|
348
|
+
async showDialog() {
|
|
354
349
|
if (!this.inputWriteable) {
|
|
355
350
|
return
|
|
356
351
|
}
|
|
352
|
+
if (this.isDialogShow === false) {
|
|
353
|
+
this.isDialogShow = true
|
|
354
|
+
await this.$nextTick()
|
|
355
|
+
}
|
|
357
356
|
if (this.isMobile) {
|
|
358
357
|
this.$refs.orgSelectorMobileDialog.showDialog()
|
|
359
358
|
} else {
|
|
@@ -369,12 +368,12 @@
|
|
|
369
368
|
},
|
|
370
369
|
// 更新当前输入框的高度来适配已选数据的高度
|
|
371
370
|
calacInputSuffixHeight() {
|
|
372
|
-
if (!this.$refs.tagSpans) return
|
|
373
|
-
if (this.$refs.tagSpans.offsetHeight) {
|
|
374
|
-
|
|
375
|
-
} else {
|
|
376
|
-
|
|
377
|
-
}
|
|
371
|
+
// if (!this.$refs.tagSpans) return
|
|
372
|
+
// if (this.$refs.tagSpans.offsetHeight) {
|
|
373
|
+
// this.inputSuffixHeight = this.$refs.tagSpans.offsetHeight + 5
|
|
374
|
+
// } else {
|
|
375
|
+
// this.inputSuffixHeight = 30
|
|
376
|
+
// }
|
|
378
377
|
},
|
|
379
378
|
},
|
|
380
379
|
}
|
|
@@ -391,7 +390,10 @@
|
|
|
391
390
|
position: relative;
|
|
392
391
|
top: 50%;
|
|
393
392
|
}
|
|
394
|
-
|
|
393
|
+
.el-input__inner {
|
|
394
|
+
height: 32px;
|
|
395
|
+
line-height: 32px;
|
|
396
|
+
}
|
|
395
397
|
.el-input__inner[aria-invalid='true'] {
|
|
396
398
|
border-color: #f56c6c;
|
|
397
399
|
}
|
|
@@ -16,33 +16,23 @@
|
|
|
16
16
|
@click="showDialog"
|
|
17
17
|
>
|
|
18
18
|
<div
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
:class="{
|
|
22
|
-
'el-select__tags_readonly': !inputWriteable,
|
|
23
|
-
'el-select__tags': inputWriteable,
|
|
24
|
-
}"
|
|
19
|
+
v-if="inputWriteable"
|
|
20
|
+
class="el-input el-input--suffix"
|
|
21
|
+
:class="{ 'custom-selector-mobile': isMobile }"
|
|
25
22
|
>
|
|
26
|
-
<
|
|
27
|
-
<
|
|
23
|
+
<div v-if="isMobile" class="custom-selector-mobile-box">
|
|
24
|
+
<div
|
|
28
25
|
v-for="(item, index) in selectors"
|
|
29
26
|
:key="index"
|
|
30
|
-
class="
|
|
31
|
-
@click.stop
|
|
27
|
+
class="common-selector-tag"
|
|
32
28
|
>
|
|
33
|
-
<span
|
|
34
|
-
<i
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@click="handleRemove(item)"
|
|
38
|
-
></i>
|
|
39
|
-
</span>
|
|
40
|
-
</span>
|
|
41
|
-
</div>
|
|
42
|
-
<div v-if="inputWriteable" class="el-input el-input--suffix">
|
|
29
|
+
<span>{{ item.name }}</span>
|
|
30
|
+
<i class="el-icon-error" @click.stop="handleRemove(item)"></i>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
43
33
|
<input
|
|
44
34
|
ref="inputEl"
|
|
45
|
-
v-model="
|
|
35
|
+
v-model="calcInputValue"
|
|
46
36
|
v-validate="inputValidate"
|
|
47
37
|
type="text"
|
|
48
38
|
readonly="readonly"
|
|
@@ -50,10 +40,6 @@
|
|
|
50
40
|
autocomplete="off"
|
|
51
41
|
class="el-input__inner"
|
|
52
42
|
:placeholder="placeholder"
|
|
53
|
-
:style="{
|
|
54
|
-
height: inputSuffixHeight + 'px',
|
|
55
|
-
lineHeight: inputSuffixHeight + 'px',
|
|
56
|
-
}"
|
|
57
43
|
/>
|
|
58
44
|
<span class="el-input__suffix">
|
|
59
45
|
<span class="el-input__suffix-inner">
|
|
@@ -62,50 +48,55 @@
|
|
|
62
48
|
</span>
|
|
63
49
|
</span>
|
|
64
50
|
</div>
|
|
51
|
+
<div v-else class="el-select__tags_readonly">
|
|
52
|
+
<span>{{ calcInputValue }}</span>
|
|
53
|
+
</div>
|
|
65
54
|
</div>
|
|
66
55
|
<ht-field-tail :field-name="inputName" :input-value="value" />
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
56
|
+
<template v-if="isDialogShow">
|
|
57
|
+
<post-selector-dialog
|
|
58
|
+
v-if="!isMobile"
|
|
59
|
+
ref="postSelectorDialog"
|
|
60
|
+
v-model="selectors"
|
|
61
|
+
:title="title"
|
|
62
|
+
:append-to-body="appendToBody"
|
|
63
|
+
:data="data"
|
|
64
|
+
:pagination="pagination"
|
|
65
|
+
:select-label="selectLabel"
|
|
66
|
+
:quick-search-props="quickSearchProps"
|
|
67
|
+
:single="single"
|
|
68
|
+
:search-placeholder="searchPlaceholder"
|
|
69
|
+
:primary-field="primaryField"
|
|
70
|
+
:mode="mode"
|
|
71
|
+
@filter-type-change="(type) => $emit('filter-type-change', type)"
|
|
72
|
+
@search="(word) => $emit('search', word)"
|
|
73
|
+
@reset="() => $emit('reset')"
|
|
74
|
+
@row-click="(row) => $emit('row-click', row)"
|
|
75
|
+
@select-data="(data) => $emit('select-data', data)"
|
|
76
|
+
@page-change="(page) => $emit('page-change', page)"
|
|
77
|
+
@size-change="(size) => $emit('size-change', size)"
|
|
78
|
+
@load-org-post="(org) => $emit('load-org-post', org)"
|
|
79
|
+
@load-policy-post="(policy) => $emit('load-policy-post', policy)"
|
|
80
|
+
/>
|
|
81
|
+
<post-selector-mobile-dialog
|
|
82
|
+
v-else
|
|
83
|
+
ref="postSelectorMobileDialog"
|
|
84
|
+
v-model="selectors"
|
|
85
|
+
:title="title"
|
|
86
|
+
:append-to-body="appendToBody"
|
|
87
|
+
:data="data"
|
|
88
|
+
:pagination="pagination"
|
|
89
|
+
:select-label="selectLabel"
|
|
90
|
+
:single="single"
|
|
91
|
+
:search-placeholder="searchPlaceholder"
|
|
92
|
+
:primary-field="primaryField"
|
|
93
|
+
@search="(word) => $emit('search', word)"
|
|
94
|
+
@reset="() => $emit('reset')"
|
|
95
|
+
@row-click="(row) => $emit('row-click', row)"
|
|
96
|
+
@select-data="(data) => $emit('select-data', data)"
|
|
97
|
+
@page-change="(page) => $emit('page-change', page)"
|
|
98
|
+
/>
|
|
99
|
+
</template>
|
|
109
100
|
</div>
|
|
110
101
|
</template>
|
|
111
102
|
<script>
|
|
@@ -185,11 +176,23 @@
|
|
|
185
176
|
},
|
|
186
177
|
data() {
|
|
187
178
|
return {
|
|
179
|
+
isDialogShow: false,
|
|
188
180
|
inputSuffixHeight: 30,
|
|
189
181
|
selectors: [],
|
|
190
182
|
}
|
|
191
183
|
},
|
|
192
184
|
computed: {
|
|
185
|
+
calcInputValue: function() {
|
|
186
|
+
let name = ''
|
|
187
|
+
if (this.selectors) {
|
|
188
|
+
name = this.selectors
|
|
189
|
+
.map((k) => {
|
|
190
|
+
return k.name
|
|
191
|
+
})
|
|
192
|
+
.join(',')
|
|
193
|
+
}
|
|
194
|
+
return name
|
|
195
|
+
},
|
|
193
196
|
primaryField: function() {
|
|
194
197
|
return this.config && this.config.hasOwnProperty('id')
|
|
195
198
|
? 'id'
|
|
@@ -248,14 +251,8 @@
|
|
|
248
251
|
// 通过valueChange事件发布值变更消息
|
|
249
252
|
this.$emit('valueChange', ary.join(','), newVal)
|
|
250
253
|
setTimeout(() => {
|
|
251
|
-
if (newVal.length > 0) {
|
|
252
|
-
this.calacInputSuffixHeight()
|
|
253
|
-
} else {
|
|
254
|
-
this.inputSuffixHeight = 30
|
|
255
|
-
}
|
|
256
254
|
if (this.$refs.inputEl) {
|
|
257
|
-
this.$
|
|
258
|
-
this.$refs.inputEl.blur()
|
|
255
|
+
this.$validator.validate(this.inputName)
|
|
259
256
|
}
|
|
260
257
|
}, 10)
|
|
261
258
|
},
|
|
@@ -321,10 +318,14 @@
|
|
|
321
318
|
this.selectors = tmpAry
|
|
322
319
|
}
|
|
323
320
|
},
|
|
324
|
-
showDialog() {
|
|
321
|
+
async showDialog() {
|
|
325
322
|
if (!this.inputWriteable) {
|
|
326
323
|
return
|
|
327
324
|
}
|
|
325
|
+
if (this.isDialogShow === false) {
|
|
326
|
+
this.isDialogShow = true
|
|
327
|
+
await this.$nextTick()
|
|
328
|
+
}
|
|
328
329
|
if (this.isMobile) {
|
|
329
330
|
this.$refs.postSelectorMobileDialog.showDialog()
|
|
330
331
|
} else {
|
|
@@ -340,12 +341,12 @@
|
|
|
340
341
|
},
|
|
341
342
|
// 更新当前输入框的高度来适配已选数据的高度
|
|
342
343
|
calacInputSuffixHeight() {
|
|
343
|
-
if (!this.$refs.tagSpans) return
|
|
344
|
-
if (this.$refs.tagSpans.offsetHeight) {
|
|
345
|
-
|
|
346
|
-
} else {
|
|
347
|
-
|
|
348
|
-
}
|
|
344
|
+
// if (!this.$refs.tagSpans) return
|
|
345
|
+
// if (this.$refs.tagSpans.offsetHeight) {
|
|
346
|
+
// this.inputSuffixHeight = this.$refs.tagSpans.offsetHeight + 5
|
|
347
|
+
// } else {
|
|
348
|
+
// this.inputSuffixHeight = 30
|
|
349
|
+
// }
|
|
349
350
|
},
|
|
350
351
|
},
|
|
351
352
|
}
|
|
@@ -356,6 +357,10 @@
|
|
|
356
357
|
margin-left: 1px;
|
|
357
358
|
}
|
|
358
359
|
|
|
360
|
+
.el-input__inner {
|
|
361
|
+
height: 32px;
|
|
362
|
+
line-height: 32px;
|
|
363
|
+
}
|
|
359
364
|
.el-select__tags_readonly {
|
|
360
365
|
position: relative;
|
|
361
366
|
top: 50%;
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
v-else-if="contentType.indexOf('image') > -1"
|
|
7
7
|
class="frame-viewer__img"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
9
|
+
<el-image
|
|
10
|
+
style="width: 100px; height: 100px"
|
|
10
11
|
:src="dataSrc"
|
|
11
|
-
:
|
|
12
|
-
|
|
12
|
+
:preview-src-list="[dataSrc]"
|
|
13
|
+
></el-image>
|
|
13
14
|
</div>
|
|
14
15
|
<iframe
|
|
15
16
|
v-else
|
|
@@ -124,12 +125,12 @@
|
|
|
124
125
|
return
|
|
125
126
|
}
|
|
126
127
|
if (iframe.attachEvent) {
|
|
127
|
-
iframe.attachEvent('onload', function() {
|
|
128
|
+
iframe.attachEvent('onload', function () {
|
|
128
129
|
that.setFrameBody(this.contentWindow.document)
|
|
129
130
|
that.watermarkRender()
|
|
130
131
|
})
|
|
131
132
|
} else {
|
|
132
|
-
iframe.onload = function() {
|
|
133
|
+
iframe.onload = function () {
|
|
133
134
|
that.setFrameBody(this.contentWindow.document)
|
|
134
135
|
that.watermarkRender()
|
|
135
136
|
}
|