apply-clients 3.3.78 → 3.3.83
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/package.json +1 -1
- package/src/apply.js +5 -0
- package/src/applyAndroid.js +5 -0
- package/src/components/android/AppOnetomany.vue +50 -8
- package/src/components/android/AppServiceView.vue +88 -8
- package/src/components/android/AreaSelect/AppResAreaSelect.vue +108 -0
- package/src/components/android/AreaSelect/AppResAreaSelectGroup.vue +135 -0
- package/src/components/android/Process/AppExplorationUser.vue +4 -1
- package/src/components/android/Process/AppServiceControl.vue +71 -1
- package/src/components/android/Process/Processes/AppSupplementalAgreement.vue +1 -0
- package/src/components/android/Process/Processes/selectApply.vue +1 -1
- package/src/components/android/Process/Processes/selectUserinfo.vue +1 -1
- package/src/components/product/AreaSelect/MyAreaSelect.vue +423 -0
- package/src/components/product/AreaSelect/ResAreaSelect.vue +106 -0
- package/src/components/product/AreaSelect/ResAreaSelectGroup.vue +150 -0
- package/src/components/product/AreaSelect/utils/EventListener.js +29 -0
- package/src/components/product/AreaSelect/utils/coerceBoolean.js +7 -0
- package/src/components/product/Onetomany.vue +49 -7
- package/src/components/product/Print/BuildOrder/buildOrderList.vue +8 -4
- package/src/components/product/Print/BuildOrder/printBuildOrder.vue +4 -0
- package/src/components/product/Process/ExplorationSelect.vue +36 -23
- package/src/components/product/Process/Service/ServiceControl.vue +62 -0
- package/src/components/product/ServiceView.vue +276 -6
- package/src/components/product/Supervisory/SupervisoryList.vue +29 -11
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-el:group class="btn-group" v-bind:class="{open: show, dropup: direction === 'up'}" :style="{width:width}">
|
|
3
|
+
<button v-el:btn type="button" class="btn btn-default dropdown-toggle select-style" style="min-width: 100%;"
|
|
4
|
+
:id="'vc-select-button-'+attach"
|
|
5
|
+
@click="toggleDropdown"
|
|
6
|
+
@blur="show = (search ? show : false)"
|
|
7
|
+
v-bind="{disabled: disabled}"
|
|
8
|
+
>
|
|
9
|
+
<span class="btn-placeholder" v-show="showPlaceholder">{{ placeholder }}</span>
|
|
10
|
+
<span class="btn-content" :style="{textOverflow:'ellipsis',overflow: 'hidden'}">{{ selectedItems }}</span>
|
|
11
|
+
<span class="caret"></span>
|
|
12
|
+
</button>
|
|
13
|
+
<ul class="dropdown-menu" v-bind:class="{'menu-align-right': align=== 'right'}"
|
|
14
|
+
:style="{overflow:'scroll',maxHeight: maxHeight + 'px',width:'auto',minWidth:minWidth,left:left+'px' }"
|
|
15
|
+
v-el:dropdown>
|
|
16
|
+
<template v-if="options.length">
|
|
17
|
+
<li v-if="search" class="bs-searchbox" style="white-space: nowrap">
|
|
18
|
+
<input type="text" placeholder="Search"
|
|
19
|
+
style="width: 80%;display: inline"
|
|
20
|
+
v-model="searchText"
|
|
21
|
+
class="form-control" autocomplete="off"
|
|
22
|
+
@keyup.enter="putOptions(searchText)">
|
|
23
|
+
|
|
24
|
+
<span style="width: 20%;display: inline"
|
|
25
|
+
v-if="search&&multiple&&show&&!isSelectAll"
|
|
26
|
+
@mousedown.prevent="selectAll(options)">全选</span>
|
|
27
|
+
<span style="width: 20%;display: inline"
|
|
28
|
+
v-if="search&&multiple&&show&&isSelectAll"
|
|
29
|
+
@mousedown.prevent="selectAll(options)">取消</span>
|
|
30
|
+
</li>
|
|
31
|
+
<li v-for="option in options | findBy searchText " style="position:relative">
|
|
32
|
+
<a @mousedown.prevent="select(option.value,null)" style="cursor:pointer"
|
|
33
|
+
:id="'vc-select-a-'+attach+'-'+$index">
|
|
34
|
+
{{ option.label }}
|
|
35
|
+
<span class="glyphicon glyphicon-ok check-mark" v-show="isSelected(option.value)"></span>
|
|
36
|
+
</a>
|
|
37
|
+
</li>
|
|
38
|
+
</template>
|
|
39
|
+
<slot v-else></slot>
|
|
40
|
+
<div class="notify" v-show="showNotify" transition="fadein">Limit reached ({{ limit }} items max).
|
|
41
|
+
</div>
|
|
42
|
+
</ul>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import EventListener from './utils/EventListener.js'
|
|
48
|
+
import coerceBoolean from './utils/coerceBoolean.js'
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
props: {
|
|
52
|
+
options: {
|
|
53
|
+
type: Array,
|
|
54
|
+
default() {
|
|
55
|
+
return []
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
value: {
|
|
59
|
+
twoWay: true
|
|
60
|
+
},
|
|
61
|
+
placeholder: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: '请选择'
|
|
64
|
+
},
|
|
65
|
+
multiple: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
coerce: coerceBoolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
search: { // Allow searching (only works when options are provided)
|
|
71
|
+
type: Boolean,
|
|
72
|
+
coerce: coerceBoolean,
|
|
73
|
+
default: true
|
|
74
|
+
},
|
|
75
|
+
limit: {
|
|
76
|
+
type: Number,
|
|
77
|
+
default: 1024
|
|
78
|
+
},
|
|
79
|
+
closeOnSelect: { // only works when multiple==false
|
|
80
|
+
type: Boolean,
|
|
81
|
+
coerce: coerceBoolean,
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
84
|
+
disabled: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
coerce: coerceBoolean,
|
|
87
|
+
default: false
|
|
88
|
+
},
|
|
89
|
+
attach: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: 'vuestrap'
|
|
92
|
+
},
|
|
93
|
+
enterPush: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
dafault: false
|
|
96
|
+
},
|
|
97
|
+
maxHeight: {
|
|
98
|
+
type: [Number, String],
|
|
99
|
+
default: 300
|
|
100
|
+
},
|
|
101
|
+
minWidth: {
|
|
102
|
+
type: [Number, String],
|
|
103
|
+
default: '100%'
|
|
104
|
+
},
|
|
105
|
+
valueSingle: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false
|
|
108
|
+
},
|
|
109
|
+
//全选标志位
|
|
110
|
+
isSelectAll: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false
|
|
113
|
+
},
|
|
114
|
+
filerKey: {
|
|
115
|
+
default: 'id'
|
|
116
|
+
},
|
|
117
|
+
direction: { // 展开方向,默认为向下,可以向上up
|
|
118
|
+
type: String,
|
|
119
|
+
default: 'down'
|
|
120
|
+
},
|
|
121
|
+
align: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: 'left' // 内内容框对齐方式,默认是左对齐,也可以right,右对齐
|
|
124
|
+
},
|
|
125
|
+
width: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: '60%'
|
|
128
|
+
},
|
|
129
|
+
timeout: {
|
|
130
|
+
type: Number,
|
|
131
|
+
default: 300
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
ready() {
|
|
135
|
+
if (this.search && this.multiple) {
|
|
136
|
+
this.minWidth = '190px'
|
|
137
|
+
}
|
|
138
|
+
// 如果this.value不存在或正length不等于0
|
|
139
|
+
if ((this.value === false ? false : !this.value) || this.value.length === 0) {
|
|
140
|
+
if (this.valueSingle) {
|
|
141
|
+
this.value = ''
|
|
142
|
+
} else {
|
|
143
|
+
this.value = []
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
// 如果this.value不是数组
|
|
147
|
+
if (this.value.constructor !== Array) {
|
|
148
|
+
if (!this.valueSingle) {
|
|
149
|
+
this.value = [this.value]
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
// this.value不是数组并且不是多选
|
|
153
|
+
if (!this.multiple && this.value.length > 1) {
|
|
154
|
+
this.value = this.value.slice(0, 1)
|
|
155
|
+
} else if (this.multiple && this.value.length > this.limit) {
|
|
156
|
+
this.value = this.value.slice(0, this.limit)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
let el = this.$els.dropdown
|
|
161
|
+
let elbtn = this.$els.btn
|
|
162
|
+
this._closeEvent = EventListener.listen(window, 'mouseup', (e) => {
|
|
163
|
+
if (!el.contains(e.target) && this.show && !elbtn.contains(e.target)) {
|
|
164
|
+
this.show = false
|
|
165
|
+
}
|
|
166
|
+
})
|
|
167
|
+
},
|
|
168
|
+
data() {
|
|
169
|
+
return {
|
|
170
|
+
left: '0',
|
|
171
|
+
|
|
172
|
+
searchText: null,
|
|
173
|
+
show: false,
|
|
174
|
+
showNotify: false,
|
|
175
|
+
paramsData: [],
|
|
176
|
+
// isShowModify: false
|
|
177
|
+
timer: null
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
computed: {
|
|
181
|
+
// 返回显示的选择内容
|
|
182
|
+
selectedItems() {
|
|
183
|
+
// 值为空,返回空串
|
|
184
|
+
if (this.value === false ? false : !this.value) {
|
|
185
|
+
return ''
|
|
186
|
+
}
|
|
187
|
+
if (this.value == null || this.value.length === 0) {
|
|
188
|
+
return ''
|
|
189
|
+
}
|
|
190
|
+
// 把单选变成数组
|
|
191
|
+
let value
|
|
192
|
+
if (this.valueSingle) {
|
|
193
|
+
value = [this.value]
|
|
194
|
+
} else {
|
|
195
|
+
value = this.value
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// 根据value值,找到label
|
|
199
|
+
let foundItems = []
|
|
200
|
+
if (value === false ? true : value && value.length) {
|
|
201
|
+
for (var item of value) {
|
|
202
|
+
// 如果没有可选项,直接value内容
|
|
203
|
+
// 改动 没有可选项 直接为空
|
|
204
|
+
if (this.options.length === 0) {
|
|
205
|
+
// foundItems = value;
|
|
206
|
+
foundItems = [];
|
|
207
|
+
}
|
|
208
|
+
// 有可选项
|
|
209
|
+
else {
|
|
210
|
+
// 如果是对象,显示对象给定的列
|
|
211
|
+
if (typeof item === "object") {
|
|
212
|
+
for (let o of this.options) {
|
|
213
|
+
// 选中对象鱼可选项value值相同,取选项的label
|
|
214
|
+
if ((o.value === false ? true : o.value) && o.value[this.filerKey] === item[this.filerKey]) {
|
|
215
|
+
foundItems.push(o.label)
|
|
216
|
+
break
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
// 否则,显示值本身
|
|
221
|
+
let option
|
|
222
|
+
this.options.some(o => {
|
|
223
|
+
if (o.value === item) {
|
|
224
|
+
option = o
|
|
225
|
+
return true
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
option && foundItems.push(option.label)
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (foundItems.length === 0 || foundItems[0].constructor === Object) {
|
|
233
|
+
return ''
|
|
234
|
+
}
|
|
235
|
+
//选中的
|
|
236
|
+
let str = foundItems.join(', ')
|
|
237
|
+
// if(str.length > 4)
|
|
238
|
+
// return str.substring(0,4)+'...'
|
|
239
|
+
// else
|
|
240
|
+
return str
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
showPlaceholder() {
|
|
244
|
+
if (this.value === false ? true : this.value) {
|
|
245
|
+
return this.value.length === 0 || this.selectedItems === ''
|
|
246
|
+
}
|
|
247
|
+
return true
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
watch: {
|
|
251
|
+
value(val) {
|
|
252
|
+
this.$emit('change', val)
|
|
253
|
+
this.$emit('selected', this.selected)
|
|
254
|
+
if (val && val.length > this.limit) {
|
|
255
|
+
this.showNotify = true
|
|
256
|
+
this.value.pop()
|
|
257
|
+
setTimeout(() => this.showNotify = false, 1000)
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
show() {
|
|
261
|
+
this.judgBoundary();
|
|
262
|
+
},
|
|
263
|
+
searchText() {
|
|
264
|
+
// 防抖
|
|
265
|
+
if (this.timer) {
|
|
266
|
+
clearTimeout(this.timer)
|
|
267
|
+
}
|
|
268
|
+
this.timer = setTimeout(() => {
|
|
269
|
+
this.$emit('select-search', this.searchText)
|
|
270
|
+
}, this.timeout)
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
methods: {
|
|
274
|
+
//全选
|
|
275
|
+
selectAll(v) {
|
|
276
|
+
this.isSelectAll = !this.isSelectAll
|
|
277
|
+
if (this.searchText === null) {
|
|
278
|
+
v.forEach((item) => {
|
|
279
|
+
this.select(item.value, this.isSelectAll)
|
|
280
|
+
})
|
|
281
|
+
} else {
|
|
282
|
+
let result = v.filter((item) => {
|
|
283
|
+
return item.label.includes(this.searchText)
|
|
284
|
+
}).forEach((item) => {
|
|
285
|
+
this.select(item.value, this.isSelectAll)
|
|
286
|
+
})
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
select(v, flag) {
|
|
290
|
+
if (flag == true) {
|
|
291
|
+
if (this.multiple) {
|
|
292
|
+
this.value.$remove(v)
|
|
293
|
+
this.value.push(v)
|
|
294
|
+
}
|
|
295
|
+
if (this.closeOnSelect) {
|
|
296
|
+
this.toggleDropdown()
|
|
297
|
+
}
|
|
298
|
+
} else if (flag == false) {
|
|
299
|
+
if (this.multiple) {
|
|
300
|
+
this.value.$remove(v)
|
|
301
|
+
}
|
|
302
|
+
if (this.closeOnSelect) {
|
|
303
|
+
this.toggleDropdown()
|
|
304
|
+
}
|
|
305
|
+
} else if (flag == null) {
|
|
306
|
+
if (this.valueSingle || !this.value || this.value.indexOf(v) === -1) {
|
|
307
|
+
if (this.multiple) {
|
|
308
|
+
this.value.push(v)
|
|
309
|
+
} else {
|
|
310
|
+
if (this.valueSingle) {
|
|
311
|
+
this.value = v
|
|
312
|
+
} else {
|
|
313
|
+
this.value = [v]
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
if (this.multiple || this.value) {
|
|
318
|
+
this.value.$remove(v)
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (this.closeOnSelect) {
|
|
322
|
+
this.toggleDropdown()
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
this.judgBoundary();
|
|
326
|
+
},
|
|
327
|
+
isSelected(v) {
|
|
328
|
+
if (this.value === false ? false : !this.value) {
|
|
329
|
+
return false
|
|
330
|
+
}
|
|
331
|
+
if (this.value.constructor !== Array) {
|
|
332
|
+
return this.value == v
|
|
333
|
+
} else {
|
|
334
|
+
return this.value.indexOf(v) !== -1
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
},
|
|
338
|
+
toggleDropdown() {
|
|
339
|
+
this.width = this.$els.group.clientWidth * this.width + 'px'
|
|
340
|
+
this.show = !this.show
|
|
341
|
+
},
|
|
342
|
+
putOptions(val) {
|
|
343
|
+
if (this.enterPush) {
|
|
344
|
+
let sign = false
|
|
345
|
+
this.options.forEach((item) => {
|
|
346
|
+
if (val === item.label) {
|
|
347
|
+
sign = true
|
|
348
|
+
}
|
|
349
|
+
})
|
|
350
|
+
if (!sign) {
|
|
351
|
+
let tmp = {label: val, value: val}
|
|
352
|
+
this.options.push(tmp)
|
|
353
|
+
}
|
|
354
|
+
this.select(val, null)
|
|
355
|
+
}
|
|
356
|
+
this.judgBoundary();
|
|
357
|
+
},
|
|
358
|
+
judgBoundary() {
|
|
359
|
+
//判断是否超出边界,超出移动
|
|
360
|
+
if (document.documentElement.offsetWidth < this.$els.dropdown.getBoundingClientRect().right) {
|
|
361
|
+
this.left = document.documentElement.offsetWidth - this.$els.dropdown.getBoundingClientRect().right - 25
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
beforeDestroy() {
|
|
366
|
+
if (this._closeEvent) this._closeEvent.remove()
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
</script>
|
|
370
|
+
|
|
371
|
+
<style scoped>
|
|
372
|
+
.bs-searchbox {
|
|
373
|
+
padding: 4px 8px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.menu-align-right {
|
|
377
|
+
left: unset;
|
|
378
|
+
right: 0;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.btn-group .dropdown-menu .notify {
|
|
382
|
+
position: absolute;
|
|
383
|
+
bottom: 5px;
|
|
384
|
+
width: 96%;
|
|
385
|
+
margin: 0 2%;
|
|
386
|
+
min-height: 26px;
|
|
387
|
+
padding: 3px 5px;
|
|
388
|
+
background: #f5f5f5;
|
|
389
|
+
/*border: 1px solid #e3e3e3;*/
|
|
390
|
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
|
|
391
|
+
pointer-events: none;
|
|
392
|
+
opacity: .9;
|
|
393
|
+
overflow: hidden;
|
|
394
|
+
text-overflow: ellipsis;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.select-style {
|
|
398
|
+
border: 0px;
|
|
399
|
+
/*border-bottom: 2px solid #C9CCCF;*/
|
|
400
|
+
border: 1px solid #93B2D3;
|
|
401
|
+
border-radius: 0px;
|
|
402
|
+
color: #555;
|
|
403
|
+
overflow: hidden;
|
|
404
|
+
text-overflow: ellipsis;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* 为新产品增加修改菜单选项 */
|
|
408
|
+
.vselect-self-style {
|
|
409
|
+
text-align: center;
|
|
410
|
+
border: 2px dashed #ccc;
|
|
411
|
+
margin: 5px 10px;
|
|
412
|
+
border-radius: 5px;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* 当内容超过最大时,显示省略,长度不能超过最大值 */
|
|
416
|
+
.btn-group > button {
|
|
417
|
+
max-width: 100%;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.btn-group > button .btn-content {
|
|
421
|
+
max-width: 100%;
|
|
422
|
+
}
|
|
423
|
+
</style>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!--<v-select :options='options' placeholder='请选择'-->
|
|
3
|
+
<!-- :value.sync="selectres"-->
|
|
4
|
+
<!-- :multiple="!isMul"-->
|
|
5
|
+
<!-- :search="issearch"-->
|
|
6
|
+
<!-- :close-on-select="isMul"-->
|
|
7
|
+
<!-- @change="resChange"-->
|
|
8
|
+
<!-->-->
|
|
9
|
+
<!--</v-select>-->
|
|
10
|
+
<area-select :options='options' placeholder='请选择'
|
|
11
|
+
:value.sync="selectres"
|
|
12
|
+
:multiple="!isMul"
|
|
13
|
+
:search="issearch"
|
|
14
|
+
:close-on-select="isMul"
|
|
15
|
+
@change="resChange"
|
|
16
|
+
:value-single="true"
|
|
17
|
+
>
|
|
18
|
+
</area-select>
|
|
19
|
+
</template>
|
|
20
|
+
<script>
|
|
21
|
+
import {HttpResetClass} from 'vue-client'
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
title: '资源管理',
|
|
25
|
+
props: {
|
|
26
|
+
//资源类型
|
|
27
|
+
restype:'',
|
|
28
|
+
//资源数据
|
|
29
|
+
resObj:{},
|
|
30
|
+
options:[],
|
|
31
|
+
isMul: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
35
|
+
issearch: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
//资源初始化数据 默认选中值
|
|
40
|
+
initresid: {
|
|
41
|
+
type: Array,
|
|
42
|
+
default() { return [] },
|
|
43
|
+
},
|
|
44
|
+
//父层id
|
|
45
|
+
parentresid: {
|
|
46
|
+
type: Array,
|
|
47
|
+
default() { return [] },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
data () {
|
|
51
|
+
return {
|
|
52
|
+
//资源数据
|
|
53
|
+
resObj:{},
|
|
54
|
+
//资源数据列表
|
|
55
|
+
resoptions:[],
|
|
56
|
+
//选中资源数据
|
|
57
|
+
selectres: []
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
ready () {
|
|
61
|
+
//获取资源列表
|
|
62
|
+
this.getResList()
|
|
63
|
+
},
|
|
64
|
+
methods:{
|
|
65
|
+
//资源改变
|
|
66
|
+
resChange(val){
|
|
67
|
+
let orgnames=[]
|
|
68
|
+
Object.keys(this.options).forEach((key) => {
|
|
69
|
+
if(this.selectres.includes(this.options[key].value))
|
|
70
|
+
orgnames.push(this.options[key].label)
|
|
71
|
+
})
|
|
72
|
+
// console.log("资源变化:",this.selectres, orgnames,this.options)
|
|
73
|
+
this.$dispatch('res-select', this.selectres, orgnames,this.options)
|
|
74
|
+
},
|
|
75
|
+
//获取资源数据
|
|
76
|
+
async getResList() {
|
|
77
|
+
this.dealdata()
|
|
78
|
+
},
|
|
79
|
+
async dealdata(){
|
|
80
|
+
//赋值资源数据选中初始值
|
|
81
|
+
let arryselect=[]
|
|
82
|
+
this.options.forEach((item) => {
|
|
83
|
+
if(this.initresid.length>0){
|
|
84
|
+
this.initresid.forEach((init) => {
|
|
85
|
+
if(item.value==init){
|
|
86
|
+
arryselect.push(item.value)
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
//赋值资源选中初始值
|
|
92
|
+
this.selectres=arryselect
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
watch: {
|
|
96
|
+
//监听初始化资源id
|
|
97
|
+
'initresid.length'(){
|
|
98
|
+
this.dealdata()
|
|
99
|
+
},
|
|
100
|
+
//监听初始化资源id
|
|
101
|
+
'parentresid'(){
|
|
102
|
+
this.dealdata()
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="style">
|
|
3
|
+
<label :class="labelstyle" :style="shijifontColors">市  县</label>
|
|
4
|
+
<res-area-select
|
|
5
|
+
:options=options
|
|
6
|
+
@res-select="getXian"
|
|
7
|
+
:issearch="false"
|
|
8
|
+
:initresid="initres"
|
|
9
|
+
>
|
|
10
|
+
</res-area-select>
|
|
11
|
+
</div>
|
|
12
|
+
<div :class="style">
|
|
13
|
+
<label :class="labelstyle" :style="xianfontColors">街道/乡镇</label>
|
|
14
|
+
<res-area-select
|
|
15
|
+
:options=xian_options
|
|
16
|
+
@res-select="getjdao"
|
|
17
|
+
:issearch="false"
|
|
18
|
+
:initresid="xianginitres"
|
|
19
|
+
>
|
|
20
|
+
</res-area-select>
|
|
21
|
+
</div>
|
|
22
|
+
<div :class="style">
|
|
23
|
+
<label :class="labelstyle" :style="shequfontColors">社  区</label>
|
|
24
|
+
<res-area-select
|
|
25
|
+
:options=jdao_options
|
|
26
|
+
@res-select="getshequ"
|
|
27
|
+
:issearch="false"
|
|
28
|
+
:initresid="jdaoinitres"
|
|
29
|
+
>
|
|
30
|
+
</res-area-select>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
<script>
|
|
34
|
+
|
|
35
|
+
import {HttpResetClass} from 'vue-client'
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
title: '区域选择分组',
|
|
39
|
+
props: {
|
|
40
|
+
style: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'col-sm-3 form-group'
|
|
43
|
+
},
|
|
44
|
+
labelstyle: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: 'font_normal_title'
|
|
47
|
+
},
|
|
48
|
+
mul: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
}
|
|
52
|
+
//初始值 默认选中值
|
|
53
|
+
// initres: {
|
|
54
|
+
// type: Object,
|
|
55
|
+
// default: null,
|
|
56
|
+
// }
|
|
57
|
+
},
|
|
58
|
+
data() {
|
|
59
|
+
return {
|
|
60
|
+
orgresid: [this.$login.f.orgid],
|
|
61
|
+
options: [],
|
|
62
|
+
initres: [],
|
|
63
|
+
xianginitres: [],
|
|
64
|
+
jdaoinitres: [],
|
|
65
|
+
xian_options: [],
|
|
66
|
+
jdao_options: [],
|
|
67
|
+
shijifontColors:"color: #cd5c5c",//红色
|
|
68
|
+
xianfontColors:"color: #cd5c5c",//红色
|
|
69
|
+
shequfontColors:"color: #cd5c5c",//红色
|
|
70
|
+
pubColors:"color: #0c2e4d",// 黑色
|
|
71
|
+
pub2Colors:"color: #cd5c5c"// 红色
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
ready() {
|
|
75
|
+
this.getResList();
|
|
76
|
+
},
|
|
77
|
+
methods: {
|
|
78
|
+
//获取区域地址
|
|
79
|
+
async getResList() {
|
|
80
|
+
let http = new HttpResetClass()
|
|
81
|
+
let req = await http.load('POST', '/rs/logic/resAreaSelect', {
|
|
82
|
+
userid: this.$login.f.id,
|
|
83
|
+
orgid: this.$login.f.orgid
|
|
84
|
+
}, {resolveMsg: null, rejectMsg: '获取区域地址失败'})
|
|
85
|
+
this.options = []
|
|
86
|
+
this.options = req.data
|
|
87
|
+
//设置市区默认值
|
|
88
|
+
// if (this.options.length > 0) {
|
|
89
|
+
// this.initres = []
|
|
90
|
+
// this.initres.push(this.options[0].value)
|
|
91
|
+
// }
|
|
92
|
+
},
|
|
93
|
+
async getXian(value, lable, obj) {
|
|
94
|
+
this.xian_options = []
|
|
95
|
+
this.jdao_options = []
|
|
96
|
+
let newFilArr = obj.filter((item, i) => {
|
|
97
|
+
if (item.value == value) {
|
|
98
|
+
return item
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
if (newFilArr.length > 0) {
|
|
102
|
+
this.xian_options = newFilArr[0].children
|
|
103
|
+
// if (this.xian_options.length > 0) {
|
|
104
|
+
// this.xianginitres = []
|
|
105
|
+
// this.xianginitres.push(this.xian_options[0].value)
|
|
106
|
+
// }
|
|
107
|
+
}
|
|
108
|
+
if (value !=null && value.length!=0){
|
|
109
|
+
this.shijifontColors = this.pubColors
|
|
110
|
+
}else {
|
|
111
|
+
this.shijifontColors = this.pub2Colors
|
|
112
|
+
this.xianfontColors = this.pub2Colors
|
|
113
|
+
this.shequfontColors = this.pub2Colors
|
|
114
|
+
}
|
|
115
|
+
this.$dispatch('shiji-select', value, lable)
|
|
116
|
+
},
|
|
117
|
+
async getjdao(value, lable, obj) {
|
|
118
|
+
this.jdao_options = []
|
|
119
|
+
let newFilArr = obj.filter((item, i) => {
|
|
120
|
+
if (item.value == value) {
|
|
121
|
+
return item
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
if (newFilArr.length > 0) {
|
|
125
|
+
this.jdao_options = newFilArr[0].children
|
|
126
|
+
// this.jdaoinitres = []
|
|
127
|
+
// if (this.jdao_options.length > 0) {
|
|
128
|
+
// this.jdaoinitres.push(this.jdao_options[0].value)
|
|
129
|
+
// }
|
|
130
|
+
}
|
|
131
|
+
if (value !=null && value.length!=0){
|
|
132
|
+
this.xianfontColors = this.pubColors
|
|
133
|
+
}else {
|
|
134
|
+
this.xianfontColors = this.pub2Colors
|
|
135
|
+
this.shequfontColors = this.pub2Colors
|
|
136
|
+
}
|
|
137
|
+
this.$dispatch('xian-select',value, lable)
|
|
138
|
+
},
|
|
139
|
+
async getshequ(value, lable, obj) {
|
|
140
|
+
if (value !=null && value.length!=0){
|
|
141
|
+
this.shequfontColors = this.pubColors
|
|
142
|
+
}else {
|
|
143
|
+
this.shequfontColors = this.pub2Colors
|
|
144
|
+
}
|
|
145
|
+
this.$dispatch('shequ-select',value, lable)
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
watch: {}
|
|
149
|
+
}
|
|
150
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const EventListener = {
|
|
2
|
+
/**
|
|
3
|
+
* Listen to DOM events during the bubble phase.
|
|
4
|
+
*
|
|
5
|
+
* @param {DOMEventTarget} target DOM element to register listener on.
|
|
6
|
+
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
|
7
|
+
* @param {function} callback Callback function.
|
|
8
|
+
* @return {object} Object with a `remove` method.
|
|
9
|
+
*/
|
|
10
|
+
listen(target, eventType, callback) {
|
|
11
|
+
if (target.addEventListener) {
|
|
12
|
+
target.addEventListener(eventType, callback, false)
|
|
13
|
+
return {
|
|
14
|
+
remove() {
|
|
15
|
+
target.removeEventListener(eventType, callback, false)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
} else if (target.attachEvent) {
|
|
19
|
+
target.attachEvent('on' + eventType, callback)
|
|
20
|
+
return {
|
|
21
|
+
remove() {
|
|
22
|
+
target.detachEvent('on' + eventType, callback)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default EventListener
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Attempt to convert a string value to a Boolean. Otherwise, return the value
|
|
2
|
+
// without modification so Vue can throw a warning.
|
|
3
|
+
export default (val) => (typeof val !== "string" ? val :
|
|
4
|
+
val === "true" ? true :
|
|
5
|
+
val === "false" ? false :
|
|
6
|
+
val === "null" ? false :
|
|
7
|
+
val === "undefined" ? false : val)
|