three-trees-ui 1.0.93 → 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/LICENSE +21 -21
- package/lib/three-trees-ui.common.js +839 -624
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +839 -624
- 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 +43 -13
- 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 +56 -4
- package/packages/OrgSelector/src/main.vue +87 -85
- package/packages/PostSelector/src/main.vue +86 -81
- package/packages/Preview/src/FrameViewer.vue +12 -6
- 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/UserSelector/src/main.vue +96 -101
- package/src/directive/formulas.js +7 -1
- package/src/index.js +2 -0
- package/src/mixins/onlineSubtable.js +50 -19
- package/src/styles/selector.scss +42 -2
- package/src/styles/variables.scss +6 -5
- package/src/utils.js +7 -0
|
@@ -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
|
+
<role-selector-mobile-dialog
|
|
58
|
+
v-if="isMobile"
|
|
59
|
+
ref="roleSelectorMobileDialog"
|
|
60
|
+
v-model="selectors"
|
|
61
|
+
:search-placeholder="searchPlaceholder"
|
|
62
|
+
:single="single"
|
|
63
|
+
:data="data"
|
|
64
|
+
:table-columns="tableColumns"
|
|
65
|
+
:pagination="pagination"
|
|
66
|
+
:select-label="selectLabel"
|
|
67
|
+
:quick-search-props="quickSearchProps"
|
|
68
|
+
:append-to-body="appendToBody"
|
|
69
|
+
:title="title"
|
|
70
|
+
:primary-field="primaryField"
|
|
71
|
+
@search="(word) => $emit('search', word)"
|
|
72
|
+
@reset="() => $emit('reset')"
|
|
73
|
+
@row-click="(row) => $emit('row-click', row)"
|
|
74
|
+
@select-data="(data) => $emit('select-data', data)"
|
|
75
|
+
@page-change="(page) => $emit('page-change', page)"
|
|
76
|
+
/>
|
|
77
|
+
<role-selector-dialog
|
|
78
|
+
v-else
|
|
79
|
+
ref="roleSelectorDialog"
|
|
80
|
+
v-model="selectors"
|
|
81
|
+
:title="title"
|
|
82
|
+
:append-to-body="appendToBody"
|
|
83
|
+
:data="data"
|
|
84
|
+
:pagination="pagination"
|
|
85
|
+
:select-label="selectLabel"
|
|
86
|
+
:quick-search-props="quickSearchProps"
|
|
87
|
+
:single="single"
|
|
88
|
+
:search-placeholder="searchPlaceholder"
|
|
89
|
+
:primary-field="primaryField"
|
|
90
|
+
:mode="mode"
|
|
91
|
+
@filter-type-change="(type) => $emit('filter-type-change', type)"
|
|
92
|
+
@search="(word) => $emit('search', word)"
|
|
93
|
+
@reset="() => $emit('reset')"
|
|
94
|
+
@row-click="(row) => $emit('row-click', row)"
|
|
95
|
+
@select-data="(data) => $emit('select-data', data)"
|
|
96
|
+
@page-change="(page) => $emit('page-change', page)"
|
|
97
|
+
@size-change="(size) => $emit('size-change', size)"
|
|
98
|
+
/>
|
|
99
|
+
</template>
|
|
109
100
|
</div>
|
|
110
101
|
</template>
|
|
111
102
|
<script>
|
|
@@ -182,11 +173,23 @@
|
|
|
182
173
|
},
|
|
183
174
|
data() {
|
|
184
175
|
return {
|
|
176
|
+
isDialogShow: false,
|
|
185
177
|
inputSuffixHeight: 30,
|
|
186
178
|
selectors: [],
|
|
187
179
|
}
|
|
188
180
|
},
|
|
189
181
|
computed: {
|
|
182
|
+
calcInputValue: function() {
|
|
183
|
+
let name = ''
|
|
184
|
+
if (this.selectors) {
|
|
185
|
+
name = this.selectors
|
|
186
|
+
.map((k) => {
|
|
187
|
+
return k.name
|
|
188
|
+
})
|
|
189
|
+
.join(',')
|
|
190
|
+
}
|
|
191
|
+
return name
|
|
192
|
+
},
|
|
190
193
|
primaryField: function() {
|
|
191
194
|
return this.config && this.config.hasOwnProperty('id')
|
|
192
195
|
? 'id'
|
|
@@ -245,14 +248,8 @@
|
|
|
245
248
|
// 通过valueChange事件发布值变更消息
|
|
246
249
|
this.$emit('valueChange', ary.join(','), newVal)
|
|
247
250
|
setTimeout(() => {
|
|
248
|
-
if (newVal.length > 0) {
|
|
249
|
-
this.calacInputSuffixHeight()
|
|
250
|
-
} else {
|
|
251
|
-
this.inputSuffixHeight = 30
|
|
252
|
-
}
|
|
253
251
|
if (this.$refs.inputEl) {
|
|
254
|
-
this.$
|
|
255
|
-
this.$refs.inputEl.blur()
|
|
252
|
+
this.$validator.validate(this.inputName)
|
|
256
253
|
}
|
|
257
254
|
}, 10)
|
|
258
255
|
},
|
|
@@ -317,10 +314,14 @@
|
|
|
317
314
|
this.selectors = tmpAry
|
|
318
315
|
}
|
|
319
316
|
},
|
|
320
|
-
showDialog() {
|
|
317
|
+
async showDialog() {
|
|
321
318
|
if (!this.inputWriteable) {
|
|
322
319
|
return
|
|
323
320
|
}
|
|
321
|
+
if (this.isDialogShow === false) {
|
|
322
|
+
this.isDialogShow = true
|
|
323
|
+
await this.$nextTick()
|
|
324
|
+
}
|
|
324
325
|
if (this.isMobile) {
|
|
325
326
|
this.$refs.roleSelectorMobileDialog.showDialog()
|
|
326
327
|
} else {
|
|
@@ -337,12 +338,12 @@
|
|
|
337
338
|
},
|
|
338
339
|
// 更新当前输入框的高度来适配已选数据的高度
|
|
339
340
|
calacInputSuffixHeight() {
|
|
340
|
-
if (!this.$refs.tagSpans) return
|
|
341
|
-
if (this.$refs.tagSpans.offsetHeight) {
|
|
342
|
-
|
|
343
|
-
} else {
|
|
344
|
-
|
|
345
|
-
}
|
|
341
|
+
// if (!this.$refs.tagSpans) return
|
|
342
|
+
// if (this.$refs.tagSpans.offsetHeight) {
|
|
343
|
+
// this.inputSuffixHeight = this.$refs.tagSpans.offsetHeight + 5
|
|
344
|
+
// } else {
|
|
345
|
+
// this.inputSuffixHeight = 30
|
|
346
|
+
// }
|
|
346
347
|
},
|
|
347
348
|
},
|
|
348
349
|
}
|
|
@@ -353,6 +354,11 @@
|
|
|
353
354
|
margin-left: 1px;
|
|
354
355
|
}
|
|
355
356
|
|
|
357
|
+
.el-input__inner {
|
|
358
|
+
height: 32px;
|
|
359
|
+
line-height: 32px;
|
|
360
|
+
}
|
|
361
|
+
|
|
356
362
|
.el-select__tags_readonly {
|
|
357
363
|
position: relative;
|
|
358
364
|
top: 50%;
|
|
@@ -0,0 +1,115 @@
|
|
|
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>
|
|
@@ -16,48 +16,23 @@
|
|
|
16
16
|
@click="showDialog"
|
|
17
17
|
>
|
|
18
18
|
<div
|
|
19
|
-
|
|
20
|
-
class="
|
|
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.stop="handleRemove(item)"
|
|
38
|
-
></i>
|
|
39
|
-
</span>
|
|
40
|
-
<template v-if="!selectors.length && value">
|
|
41
|
-
<span
|
|
42
|
-
v-for="(item, index) in value.split(',')"
|
|
43
|
-
:key="index"
|
|
44
|
-
class="el-tag el-tag--info el-tag--small"
|
|
45
|
-
@click.stop
|
|
46
|
-
>
|
|
47
|
-
<span class="el-select__tags-text">{{ item }}</span>
|
|
48
|
-
<i
|
|
49
|
-
v-if="inputWriteable"
|
|
50
|
-
class="el-tag__close el-icon-close"
|
|
51
|
-
@click.stop="handleRemoveText(index)"
|
|
52
|
-
></i>
|
|
53
|
-
</span>
|
|
54
|
-
</template>
|
|
55
|
-
</span>
|
|
56
|
-
</div>
|
|
57
|
-
<div v-if="inputWriteable" class="el-input el-input--suffix">
|
|
29
|
+
<span>{{ item.fullname }}</span>
|
|
30
|
+
<i class="el-icon-error" @click.stop="handleRemove(item)"></i>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
58
33
|
<input
|
|
59
34
|
ref="inputEl"
|
|
60
|
-
v-model="
|
|
35
|
+
v-model="calcInputValue"
|
|
61
36
|
v-validate="inputValidate"
|
|
62
37
|
type="text"
|
|
63
38
|
readonly="readonly"
|
|
@@ -65,66 +40,71 @@
|
|
|
65
40
|
autocomplete="off"
|
|
66
41
|
class="el-input__inner"
|
|
67
42
|
:placeholder="placeholder"
|
|
68
|
-
:style="{
|
|
69
|
-
height: inputSuffixHeight + 'px',
|
|
70
|
-
lineHeight: inputSuffixHeight + 'px',
|
|
71
|
-
}"
|
|
72
43
|
/>
|
|
73
44
|
<span class="el-input__suffix">
|
|
74
45
|
<span class="el-input__suffix-inner">
|
|
75
|
-
<i
|
|
46
|
+
<i
|
|
47
|
+
v-if="value"
|
|
48
|
+
class="el-icon-circle-close clear-icon"
|
|
49
|
+
@click.stop="clear"
|
|
50
|
+
></i>
|
|
76
51
|
<ht-icon name="user" class="user-icon" />
|
|
77
52
|
</span>
|
|
78
53
|
</span>
|
|
79
54
|
</div>
|
|
55
|
+
<div v-else class="el-select__tags_readonly">
|
|
56
|
+
<span>{{ calcInputValue }}</span>
|
|
57
|
+
</div>
|
|
80
58
|
</div>
|
|
81
59
|
<ht-field-tail :field-name="inputName" :input-value="value" />
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
60
|
+
<template v-if="isDialogShow">
|
|
61
|
+
<user-selector-dialog
|
|
62
|
+
v-if="!isMobile"
|
|
63
|
+
ref="userSelectorDialog"
|
|
64
|
+
v-model="selectors"
|
|
65
|
+
:title="title"
|
|
66
|
+
:append-to-body="appendToBody"
|
|
67
|
+
:data="data"
|
|
68
|
+
:pagination="pagination"
|
|
69
|
+
:select-label="selectLabel"
|
|
70
|
+
:quick-search-props="quickSearchProps"
|
|
71
|
+
:single="single"
|
|
72
|
+
:search-placeholder="searchPlaceholder"
|
|
73
|
+
:primary-field="primaryField"
|
|
74
|
+
:mode="mode"
|
|
75
|
+
@filter-type-change="(type) => $emit('filter-type-change', type)"
|
|
76
|
+
@search="(word) => $emit('search', word)"
|
|
77
|
+
@reset="() => $emit('reset')"
|
|
78
|
+
@row-click="(row) => $emit('row-click', row)"
|
|
79
|
+
@select-data="(data) => $emit('select-data', data)"
|
|
80
|
+
@page-change="(page) => $emit('page-change', page)"
|
|
81
|
+
@size-change="(size) => $emit('size-change', size)"
|
|
82
|
+
@contact-group-change="(group) => $emit('contact-group-change', group)"
|
|
83
|
+
@load-org-user="(org) => $emit('load-org-user', org)"
|
|
84
|
+
@load-policy-user="(policy) => $emit('load-policy-user', policy)"
|
|
85
|
+
@load-role-user="(role) => $emit('load-role-user', role)"
|
|
86
|
+
/>
|
|
87
|
+
<user-selector-mobile-dialog
|
|
88
|
+
v-else
|
|
89
|
+
ref="userSelectorMobileDialog"
|
|
90
|
+
v-model="selectors"
|
|
91
|
+
:title="title"
|
|
92
|
+
:append-to-body="appendToBody"
|
|
93
|
+
:data="data"
|
|
94
|
+
:pagination="pagination"
|
|
95
|
+
:select-label="selectLabel"
|
|
96
|
+
:quick-search-props="quickSearchProps"
|
|
97
|
+
:single="single"
|
|
98
|
+
:search-placeholder="searchPlaceholder"
|
|
99
|
+
:primary-field="primaryField"
|
|
100
|
+
@search="(word) => $emit('search', word)"
|
|
101
|
+
@reset="() => $emit('reset')"
|
|
102
|
+
@row-click="(row) => $emit('row-click', row)"
|
|
103
|
+
@select-data="(data) => $emit('select-data', data)"
|
|
104
|
+
@page-change="(page) => $emit('page-change', page)"
|
|
105
|
+
@getCustomQuerys="(querys) => $emit('getCustomQuerys', querys)"
|
|
106
|
+
/>
|
|
107
|
+
</template>
|
|
128
108
|
</div>
|
|
129
109
|
</template>
|
|
130
110
|
<script>
|
|
@@ -198,11 +178,23 @@
|
|
|
198
178
|
},
|
|
199
179
|
data() {
|
|
200
180
|
return {
|
|
181
|
+
isDialogShow: false,
|
|
201
182
|
inputSuffixHeight: 30,
|
|
202
183
|
selectors: [],
|
|
203
184
|
}
|
|
204
185
|
},
|
|
205
186
|
computed: {
|
|
187
|
+
calcInputValue: function() {
|
|
188
|
+
let name = ''
|
|
189
|
+
if (this.selectors) {
|
|
190
|
+
name = this.selectors
|
|
191
|
+
.map((k) => {
|
|
192
|
+
return k.fullname
|
|
193
|
+
})
|
|
194
|
+
.join(',')
|
|
195
|
+
}
|
|
196
|
+
return name
|
|
197
|
+
},
|
|
206
198
|
primaryField: function() {
|
|
207
199
|
return this.config && this.config.hasOwnProperty('id')
|
|
208
200
|
? 'id'
|
|
@@ -316,14 +308,8 @@
|
|
|
316
308
|
// 通过valueChange事件发布值变更消息
|
|
317
309
|
setTimeout(() => {
|
|
318
310
|
this.$emit('valueChange', ary.join(','), newVal)
|
|
319
|
-
if (newVal.length > 0) {
|
|
320
|
-
this.calacInputSuffixHeight()
|
|
321
|
-
} else {
|
|
322
|
-
this.inputSuffixHeight = 30
|
|
323
|
-
}
|
|
324
311
|
if (this.$refs.inputEl) {
|
|
325
|
-
this.$
|
|
326
|
-
this.$refs.inputEl.blur()
|
|
312
|
+
this.$validator.validate(this.inputName)
|
|
327
313
|
}
|
|
328
314
|
}, 10)
|
|
329
315
|
},
|
|
@@ -461,10 +447,14 @@
|
|
|
461
447
|
this.selectors = tmpAry
|
|
462
448
|
}
|
|
463
449
|
},
|
|
464
|
-
showDialog() {
|
|
450
|
+
async showDialog() {
|
|
465
451
|
if (!this.inputWriteable) {
|
|
466
452
|
return
|
|
467
453
|
}
|
|
454
|
+
if (this.isDialogShow === false) {
|
|
455
|
+
this.isDialogShow = true
|
|
456
|
+
await this.$nextTick()
|
|
457
|
+
}
|
|
468
458
|
if (this.isMobile) {
|
|
469
459
|
this.$refs.userSelectorMobileDialog.showDialog()
|
|
470
460
|
} else {
|
|
@@ -480,12 +470,12 @@
|
|
|
480
470
|
},
|
|
481
471
|
// 更新当前输入框的高度来适配已选数据的高度
|
|
482
472
|
calacInputSuffixHeight() {
|
|
483
|
-
if (!this.$refs.tagSpans) return
|
|
484
|
-
if (this.$refs.tagSpans.offsetHeight) {
|
|
485
|
-
|
|
486
|
-
} else {
|
|
487
|
-
|
|
488
|
-
}
|
|
473
|
+
// if (!this.$refs.tagSpans) return
|
|
474
|
+
// if (this.$refs.tagSpans.offsetHeight) {
|
|
475
|
+
// this.inputSuffixHeight = this.$refs.tagSpans.offsetHeight + 5
|
|
476
|
+
// } else {
|
|
477
|
+
// this.inputSuffixHeight = 30
|
|
478
|
+
// }
|
|
489
479
|
},
|
|
490
480
|
handleRemoveText(index) {
|
|
491
481
|
if (!this.value) {
|
|
@@ -499,6 +489,7 @@
|
|
|
499
489
|
}
|
|
500
490
|
</script>
|
|
501
491
|
<style lang="scss" scoped>
|
|
492
|
+
@import '~@/styles/selector.scss';
|
|
502
493
|
.user-selector_block {
|
|
503
494
|
width: calc(100% - 25px);
|
|
504
495
|
background: #fff;
|
|
@@ -509,6 +500,10 @@
|
|
|
509
500
|
top: 50%;
|
|
510
501
|
background: unset !important;
|
|
511
502
|
}
|
|
503
|
+
.el-input__inner {
|
|
504
|
+
height: 32px;
|
|
505
|
+
line-height: 32px;
|
|
506
|
+
}
|
|
512
507
|
|
|
513
508
|
.el-input__inner[aria-invalid='true'] {
|
|
514
509
|
border-color: #f56c6c;
|
|
@@ -32,8 +32,14 @@ const formula = {
|
|
|
32
32
|
vnode.context.$set(vnode.context.data[pathAry[1]], pathAry[2], '')
|
|
33
33
|
} else if (pathAry.length == 4) {
|
|
34
34
|
let key = /^(\w+)\[(\d+)\]$/.exec(pathAry[2])
|
|
35
|
+
// 存在dialogData则是子表编辑模式,dialogData.dialogVisible为true则是打开弹窗
|
|
36
|
+
const name = (pathAry[2] || '').substring(4).split('[')
|
|
37
|
+
const dialogData =
|
|
38
|
+
vnode.context.$refs[`HtSubEditModeDialog_${name[0]}`] || {}
|
|
35
39
|
vnode.context.$set(
|
|
36
|
-
|
|
40
|
+
dialogData.dialogVisible
|
|
41
|
+
? dialogData.row
|
|
42
|
+
: vnode.context.data[pathAry[1]][key[1]][key[2]],
|
|
37
43
|
pathAry[3],
|
|
38
44
|
''
|
|
39
45
|
)
|