n20-common-lib 1.3.0 → 1.3.3
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/components/ECharts/mixins/resize.js +1 -1
- package/src/components/FileImport/index.vue +1 -1
- package/src/components/NstcG6Components/Form/DatepickerCustom/index.vue +32 -32
- package/src/components/NstcG6Components/NstcBranchLazyLoad/NstcBranchLazyLoad.vue +37 -33
- package/src/components/NstcG6Components/NstcCharts/mixins/resize.js +1 -1
- package/src/components/NstcG6Components/NstcDropdownTree/NstcDropdownTree.vue +141 -137
- package/src/components/NstcG6Components/NstcExcelExport/NstcExcelExport.vue +47 -47
- package/src/components/NstcG6Components/NstcExcelImport/NstcExcelImport.vue +1 -1
- package/src/components/NstcG6Components/NstcExcelImportN/NstcExcelImportN.vue +186 -188
- package/src/components/NstcG6Components/NstcFileUpload/NstcFileUpload.vue +429 -451
- package/src/components/NstcG6Components/NstcForm/BusinessSpecific/InputMultiple.vue +66 -68
- package/src/components/NstcG6Components/NstcForm/CascaderCustom/index.vue +7 -7
- package/src/components/NstcG6Components/NstcForm/DatepickerCustom/index.vue +32 -32
- package/src/components/NstcG6Components/NstcForm/InputAndDialog/NstcInputAndDialog.vue +1 -1
- package/src/components/NstcG6Components/NstcForm/InputCustom/index.vue +1 -1
- package/src/components/NstcG6Components/NstcForm/SelectAccount/NstcSelectAccount.vue +1 -1
- package/src/components/NstcG6Components/NstcForm/SelectAndDialog/NstcSelectAndDialog.vue +1 -1
- package/src/components/NstcG6Components/NstcForm/SelectCustom/index.vue +1 -1
- package/src/components/NstcG6Components/NstcForm/SelectindialogCustom/index.vue +1 -1
- package/src/components/NstcG6Components/NstcForm/UploadCustom/index.vue +1 -1
- package/src/components/NstcG6Components/NstcSelectTree/NstcSelectTree.vue +172 -172
- package/src/components/NstcG6Components/NstcSelectTreeList/NstcSelectTreeList.vue +1 -1
- package/src/components/NstcG6Components/NstcSvgIcon/NstcSvgIcon.vue +7 -12
- package/src/components/NstcG6Components/NstcTable/NstcTable.vue +145 -145
- package/src/components/NstcG6Components/NstcTableSet/NstcTableSet.vue +4 -4
- package/src/components/NstcG6Components/NstcWorkBench/NstcWorkBench.vue +45 -36
- package/src/components/NstcG6Components/Search/NstcSearch.vue +6 -6
- package/src/components/NstcG6Components/approvelTwo/main.vue +1 -1
- package/src/components/NstcG6Components/approvelTwo/progress.vue +1 -1
- package/src/components/Search/index.vue +8 -8
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
class="custom-tree-node"
|
|
37
37
|
slot-scope="{ data }"
|
|
38
38
|
:class="{
|
|
39
|
-
'not-allow': defaultProps.disabled && !!data[defaultProps.disabled]
|
|
39
|
+
'not-allow': defaultProps.disabled && !!data[defaultProps.disabled]
|
|
40
40
|
}"
|
|
41
41
|
>
|
|
42
42
|
<span v-if="nodeKey === 'cashFlowNo'">
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
:props="tagProps"
|
|
53
53
|
@input-value="
|
|
54
54
|
(val) => {
|
|
55
|
-
filterText = val
|
|
56
|
-
inputChange()
|
|
55
|
+
filterText = val
|
|
56
|
+
inputChange()
|
|
57
57
|
}
|
|
58
58
|
"
|
|
59
59
|
slot="reference"
|
|
@@ -117,149 +117,149 @@
|
|
|
117
117
|
</template>
|
|
118
118
|
|
|
119
119
|
<script>
|
|
120
|
-
import axios from
|
|
121
|
-
import InputTag from
|
|
122
|
-
import clickoutside from
|
|
120
|
+
import axios from '../../../utils/axios'
|
|
121
|
+
import InputTag from '../InputTag/InputTag'
|
|
122
|
+
import clickoutside from 'element-ui/src/utils/clickoutside'
|
|
123
123
|
export default {
|
|
124
|
-
name:
|
|
124
|
+
name: 'NstcSelectTree', // 单位按树模块查询
|
|
125
125
|
components: {
|
|
126
|
-
InputTag
|
|
126
|
+
InputTag
|
|
127
127
|
},
|
|
128
128
|
directives: {
|
|
129
|
-
clickoutside
|
|
129
|
+
clickoutside
|
|
130
130
|
},
|
|
131
131
|
props: {
|
|
132
132
|
value: {
|
|
133
133
|
type: [String, Number, Array, Object],
|
|
134
134
|
default: () => {
|
|
135
|
-
return
|
|
136
|
-
}
|
|
135
|
+
return ''
|
|
136
|
+
}
|
|
137
137
|
},
|
|
138
138
|
checkStrictly: {
|
|
139
139
|
//false:上下级节点有联动;true:上下级节点没有联动
|
|
140
140
|
type: Boolean,
|
|
141
|
-
default: false
|
|
141
|
+
default: false
|
|
142
142
|
},
|
|
143
143
|
lazy: {
|
|
144
144
|
type: Boolean,
|
|
145
|
-
default: false
|
|
145
|
+
default: false
|
|
146
146
|
},
|
|
147
147
|
|
|
148
148
|
inputWidth: {
|
|
149
149
|
type: String,
|
|
150
|
-
default:
|
|
150
|
+
default: ''
|
|
151
151
|
},
|
|
152
152
|
|
|
153
153
|
multiple: {
|
|
154
154
|
type: Boolean,
|
|
155
|
-
default: false
|
|
155
|
+
default: false
|
|
156
156
|
},
|
|
157
157
|
|
|
158
158
|
url: {
|
|
159
159
|
type: String,
|
|
160
|
-
default:
|
|
160
|
+
default: ''
|
|
161
161
|
},
|
|
162
162
|
requestMethod: {
|
|
163
163
|
type: String,
|
|
164
|
-
default:
|
|
164
|
+
default: 'get'
|
|
165
165
|
},
|
|
166
166
|
|
|
167
167
|
nodeKey: {
|
|
168
168
|
type: String,
|
|
169
|
-
default:
|
|
169
|
+
default: 'id'
|
|
170
170
|
},
|
|
171
171
|
|
|
172
172
|
defaultProps: {
|
|
173
173
|
type: Object,
|
|
174
174
|
default: () => {
|
|
175
175
|
return {
|
|
176
|
-
children:
|
|
177
|
-
label:
|
|
178
|
-
}
|
|
179
|
-
}
|
|
176
|
+
children: 'children',
|
|
177
|
+
label: 'cashName'
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
180
|
},
|
|
181
181
|
|
|
182
182
|
tagProps: {
|
|
183
183
|
type: Object,
|
|
184
184
|
default: () => {
|
|
185
185
|
return {
|
|
186
|
-
label:
|
|
187
|
-
value:
|
|
188
|
-
}
|
|
189
|
-
}
|
|
186
|
+
label: 'label',
|
|
187
|
+
value: 'value'
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
190
|
},
|
|
191
191
|
|
|
192
192
|
params: {
|
|
193
193
|
type: Object,
|
|
194
194
|
default: () => {
|
|
195
|
-
return {}
|
|
196
|
-
}
|
|
195
|
+
return {}
|
|
196
|
+
}
|
|
197
197
|
},
|
|
198
198
|
filterParams: {
|
|
199
199
|
type: Object,
|
|
200
200
|
default: () => {
|
|
201
|
-
return {}
|
|
202
|
-
}
|
|
201
|
+
return {}
|
|
202
|
+
}
|
|
203
203
|
},
|
|
204
204
|
|
|
205
205
|
queryKey: {
|
|
206
206
|
type: String,
|
|
207
|
-
default:
|
|
207
|
+
default: 'query'
|
|
208
208
|
},
|
|
209
209
|
|
|
210
210
|
label: {
|
|
211
211
|
type: [String, Number],
|
|
212
|
-
default:
|
|
212
|
+
default: ''
|
|
213
213
|
},
|
|
214
214
|
|
|
215
215
|
// 额外的查询参数
|
|
216
216
|
query: {
|
|
217
217
|
type: Object,
|
|
218
218
|
default: () => {
|
|
219
|
-
return {}
|
|
220
|
-
}
|
|
219
|
+
return {}
|
|
220
|
+
}
|
|
221
221
|
},
|
|
222
222
|
|
|
223
223
|
// 组件的大小
|
|
224
224
|
size: {
|
|
225
225
|
type: String,
|
|
226
226
|
default: () => {
|
|
227
|
-
return
|
|
228
|
-
}
|
|
227
|
+
return 'normal'
|
|
228
|
+
}
|
|
229
229
|
},
|
|
230
230
|
//是否添加 无
|
|
231
231
|
showNull: {
|
|
232
232
|
type: Boolean,
|
|
233
|
-
default: false
|
|
233
|
+
default: false
|
|
234
234
|
},
|
|
235
235
|
// 图标类型:搜索(任意)、下拉(drop)
|
|
236
236
|
nullLabel: {
|
|
237
237
|
type: String,
|
|
238
|
-
default:
|
|
238
|
+
default: '全部单位'
|
|
239
239
|
},
|
|
240
240
|
// 只能点击叶子节点
|
|
241
241
|
onlyClickLeaf: {
|
|
242
242
|
type: Boolean,
|
|
243
|
-
default: false
|
|
243
|
+
default: false
|
|
244
244
|
},
|
|
245
245
|
// 是否可清空
|
|
246
246
|
clearable: {
|
|
247
247
|
type: Boolean,
|
|
248
|
-
default: true
|
|
248
|
+
default: true
|
|
249
249
|
},
|
|
250
250
|
// 是否可清空
|
|
251
251
|
disabled: {
|
|
252
252
|
type: Boolean,
|
|
253
|
-
default: false
|
|
253
|
+
default: false
|
|
254
254
|
},
|
|
255
255
|
// 图标类型:搜索(任意)、下拉(drop)
|
|
256
256
|
iconType: {
|
|
257
257
|
type: String,
|
|
258
|
-
default:
|
|
258
|
+
default: ''
|
|
259
259
|
},
|
|
260
260
|
disableUnclickLeaf: {
|
|
261
261
|
type: Boolean,
|
|
262
|
-
default: false
|
|
262
|
+
default: false
|
|
263
263
|
},
|
|
264
264
|
// filterTreeData 是否要对数据进行处理
|
|
265
265
|
filterTreeData: {
|
|
@@ -283,115 +283,115 @@ export default {
|
|
|
283
283
|
// unitNo: "",
|
|
284
284
|
// },
|
|
285
285
|
],
|
|
286
|
-
treeRefName:
|
|
286
|
+
treeRefName: '',
|
|
287
287
|
inputRefName: this.getRefName(),
|
|
288
288
|
queryFlag: true,
|
|
289
|
-
placeholder:
|
|
289
|
+
placeholder: '请选择',
|
|
290
290
|
windowEventFlag: false,
|
|
291
|
-
timeTemp: null
|
|
292
|
-
}
|
|
291
|
+
timeTemp: null
|
|
292
|
+
}
|
|
293
293
|
},
|
|
294
294
|
computed: {
|
|
295
295
|
_value: {
|
|
296
296
|
get() {
|
|
297
|
-
return this.value
|
|
297
|
+
return this.value
|
|
298
298
|
},
|
|
299
299
|
set(val) {
|
|
300
|
-
this.checkedValue = val
|
|
301
|
-
this.$emit(
|
|
302
|
-
}
|
|
303
|
-
}
|
|
300
|
+
this.checkedValue = val
|
|
301
|
+
this.$emit('input', val)
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
304
|
},
|
|
305
305
|
watch: {
|
|
306
306
|
label: {
|
|
307
307
|
handler(val) {
|
|
308
308
|
this.$nextTick(() => {
|
|
309
|
-
this.filterText = val
|
|
310
|
-
})
|
|
309
|
+
this.filterText = val
|
|
310
|
+
})
|
|
311
311
|
},
|
|
312
|
-
immediate: true
|
|
312
|
+
immediate: true
|
|
313
313
|
},
|
|
314
314
|
value: {
|
|
315
315
|
handler(val) {
|
|
316
|
-
if ([
|
|
317
|
-
this.filterText = null
|
|
318
|
-
this.placeholder = null
|
|
319
|
-
this.checkedValue = []
|
|
320
|
-
this.treeRefName && this.$refs[this.treeRefName].setCheckedKeys([])
|
|
316
|
+
if (['', null].includes(val)) {
|
|
317
|
+
this.filterText = null
|
|
318
|
+
this.placeholder = null
|
|
319
|
+
this.checkedValue = []
|
|
320
|
+
this.treeRefName && this.$refs[this.treeRefName].setCheckedKeys([])
|
|
321
321
|
} else {
|
|
322
322
|
this.$nextTick(() => {
|
|
323
|
-
if (typeof val ==
|
|
323
|
+
if (typeof val == 'object') {
|
|
324
324
|
if (!Array.isArray(val)) {
|
|
325
|
-
this.filterText = val.label
|
|
325
|
+
this.filterText = val.label
|
|
326
326
|
} else {
|
|
327
|
-
this.checkedValue = this.value
|
|
328
|
-
const val = this.value.map((item) => item[this.nodeKey])
|
|
329
|
-
this.$refs[this.treeRefName].setCheckedKeys(val)
|
|
327
|
+
this.checkedValue = this.value
|
|
328
|
+
const val = this.value.map((item) => item[this.nodeKey])
|
|
329
|
+
this.$refs[this.treeRefName].setCheckedKeys(val)
|
|
330
330
|
}
|
|
331
331
|
} else {
|
|
332
|
-
this.filterText = this.filterText || this.label
|
|
332
|
+
this.filterText = this.filterText || this.label
|
|
333
333
|
}
|
|
334
|
-
})
|
|
334
|
+
})
|
|
335
335
|
}
|
|
336
336
|
},
|
|
337
|
-
immediate: true
|
|
337
|
+
immediate: true
|
|
338
338
|
},
|
|
339
339
|
showPopoverFlag(val) {
|
|
340
340
|
if (val) {
|
|
341
|
-
const value = this.checkedValue ===
|
|
342
|
-
this.$refs[this.treeRefName].setCurrentKey(value)
|
|
341
|
+
const value = this.checkedValue === '' ? null : this.checkedValue
|
|
342
|
+
this.$refs[this.treeRefName].setCurrentKey(value)
|
|
343
343
|
}
|
|
344
|
-
}
|
|
344
|
+
}
|
|
345
345
|
},
|
|
346
346
|
|
|
347
347
|
created() {
|
|
348
348
|
//
|
|
349
|
-
this.treeRefName = this.getRefName()
|
|
349
|
+
this.treeRefName = this.getRefName()
|
|
350
350
|
// 默认加载一次
|
|
351
|
-
this.remoteMethod(
|
|
351
|
+
this.remoteMethod('first')
|
|
352
352
|
|
|
353
|
-
this.filterText = this.label
|
|
353
|
+
this.filterText = this.label
|
|
354
354
|
|
|
355
355
|
// 点击其他地方关闭关闭下拉
|
|
356
|
-
const that = this
|
|
356
|
+
const that = this
|
|
357
357
|
document.documentElement.onclick = function () {
|
|
358
358
|
if (that.windowEventFlag) {
|
|
359
|
-
that.clearFilterText()
|
|
360
|
-
this.showPopoverFlag = false
|
|
359
|
+
that.clearFilterText()
|
|
360
|
+
this.showPopoverFlag = false
|
|
361
361
|
}
|
|
362
|
-
}
|
|
362
|
+
}
|
|
363
363
|
},
|
|
364
364
|
mounted() {
|
|
365
365
|
// 关闭筛选弹窗中的二级popover
|
|
366
|
-
this.$bus.$on(
|
|
367
|
-
this.showPopoverFlag = false
|
|
368
|
-
})
|
|
366
|
+
this.$bus.$on('closePopoverInSearch', () => {
|
|
367
|
+
this.showPopoverFlag = false
|
|
368
|
+
})
|
|
369
369
|
},
|
|
370
370
|
methods: {
|
|
371
371
|
/**
|
|
372
372
|
* input 输入框变化事件
|
|
373
373
|
*/
|
|
374
374
|
inputChange() {
|
|
375
|
-
const that = this
|
|
376
|
-
this.timeTemp && clearTimeout(that.timeTemp)
|
|
375
|
+
const that = this
|
|
376
|
+
this.timeTemp && clearTimeout(that.timeTemp)
|
|
377
377
|
this.timeTemp = setTimeout(() => {
|
|
378
|
-
console.log(
|
|
379
|
-
this.queryFlag && this.remoteMethod()
|
|
380
|
-
this.queryFlag = true
|
|
381
|
-
}, 300)
|
|
378
|
+
console.log('input change', this.filterText)
|
|
379
|
+
this.queryFlag && this.remoteMethod()
|
|
380
|
+
this.queryFlag = true
|
|
381
|
+
}, 300)
|
|
382
382
|
},
|
|
383
383
|
|
|
384
384
|
inputChangeAction(val) {
|
|
385
|
-
console.log(
|
|
386
|
-
this.$emit(
|
|
385
|
+
console.log('change')
|
|
386
|
+
this.$emit('inputChangeAction', val)
|
|
387
387
|
},
|
|
388
388
|
|
|
389
389
|
/**
|
|
390
390
|
* 本地模糊查询
|
|
391
391
|
*/
|
|
392
392
|
filterNode(value, data) {
|
|
393
|
-
if (!value) return true
|
|
394
|
-
return data.label.indexOf(value) !== -1
|
|
393
|
+
if (!value) return true
|
|
394
|
+
return data.label.indexOf(value) !== -1
|
|
395
395
|
},
|
|
396
396
|
|
|
397
397
|
/**
|
|
@@ -400,43 +400,43 @@ export default {
|
|
|
400
400
|
getRefName() {
|
|
401
401
|
return `ref_${new Date().getTime()}_${Math.random()
|
|
402
402
|
.toString()
|
|
403
|
-
.slice(5, 13)}
|
|
403
|
+
.slice(5, 13)}`
|
|
404
404
|
},
|
|
405
405
|
|
|
406
406
|
/**
|
|
407
407
|
* 远程查询
|
|
408
408
|
*/
|
|
409
409
|
remoteMethod(type) {
|
|
410
|
-
const that = this
|
|
411
|
-
let params = {}
|
|
410
|
+
const that = this
|
|
411
|
+
let params = {}
|
|
412
412
|
if (this.filterText) {
|
|
413
413
|
// 过滤时,默认查列表,若父组件指定了filterParams,则按照filterParams进行查询
|
|
414
414
|
params = {
|
|
415
415
|
...this.params,
|
|
416
416
|
...this.filterParams,
|
|
417
|
-
resultType: this.filterParams.resultType || 0
|
|
417
|
+
resultType: this.filterParams.resultType || 0
|
|
418
418
|
}
|
|
419
419
|
} else {
|
|
420
420
|
// 默认查树, 若父组件指定了params,则取params中的resultType
|
|
421
421
|
params = {
|
|
422
422
|
...this.params,
|
|
423
|
-
resultType: this.params.resultType || 1
|
|
424
|
-
}
|
|
423
|
+
resultType: this.params.resultType || 1
|
|
424
|
+
}
|
|
425
425
|
}
|
|
426
|
-
console.log(
|
|
427
|
-
this.isRequestByFilterText = that.filterText ? true : false
|
|
426
|
+
console.log('params', params)
|
|
427
|
+
this.isRequestByFilterText = that.filterText ? true : false
|
|
428
428
|
axios({
|
|
429
429
|
url: that.url,
|
|
430
430
|
method: that.requestMethod,
|
|
431
431
|
loading: false,
|
|
432
|
-
[that.requestMethod.toLowerCase() ==
|
|
433
|
-
[that.queryKey]: type ===
|
|
434
|
-
...params
|
|
435
|
-
}
|
|
432
|
+
[that.requestMethod.toLowerCase() == 'get' ? 'params' : 'data']: {
|
|
433
|
+
[that.queryKey]: type === 'first' ? '' : that.filterText,
|
|
434
|
+
...params
|
|
435
|
+
}
|
|
436
436
|
})
|
|
437
437
|
.then((data) => {
|
|
438
|
-
console.log(data,
|
|
439
|
-
that.treeData = data.list ? data.list : data.data ? data.data : data
|
|
438
|
+
console.log(data, 'data')
|
|
439
|
+
that.treeData = data.list ? data.list : data.data ? data.data : data
|
|
440
440
|
that.treeData = this.filterTreeData(that.treeData)
|
|
441
441
|
if (that.showNull) {
|
|
442
442
|
let map = {
|
|
@@ -507,24 +507,24 @@ export default {
|
|
|
507
507
|
tradeId: null,
|
|
508
508
|
treasurer: null,
|
|
509
509
|
treasurerPhone: null,
|
|
510
|
-
treeNo:
|
|
511
|
-
unitName: that.nullLabel ||
|
|
512
|
-
unitNo:
|
|
510
|
+
treeNo: '',
|
|
511
|
+
unitName: that.nullLabel || '全部单位',
|
|
512
|
+
unitNo: '1',
|
|
513
513
|
website: null,
|
|
514
|
-
wfdeptViewList: null
|
|
515
|
-
}
|
|
514
|
+
wfdeptViewList: null
|
|
515
|
+
}
|
|
516
516
|
// eslint-disable-next-line no-debugger
|
|
517
517
|
// debugger;
|
|
518
|
-
that.treeData.unshift(map)
|
|
518
|
+
that.treeData.unshift(map)
|
|
519
519
|
}
|
|
520
520
|
if (this.multiple && this.onlyClickLeaf && this.disableUnclickLeaf) {
|
|
521
|
-
this.setOnlyLeafChecked(that.treeData)
|
|
521
|
+
this.setOnlyLeafChecked(that.treeData)
|
|
522
522
|
}
|
|
523
523
|
that.$nextTick(() => {
|
|
524
|
-
that.$forceUpdate()
|
|
525
|
-
})
|
|
524
|
+
that.$forceUpdate()
|
|
525
|
+
})
|
|
526
526
|
})
|
|
527
|
-
.catch(() => {})
|
|
527
|
+
.catch(() => {})
|
|
528
528
|
},
|
|
529
529
|
|
|
530
530
|
/**
|
|
@@ -533,12 +533,12 @@ export default {
|
|
|
533
533
|
setOnlyLeafChecked(treeData) {
|
|
534
534
|
treeData.forEach((item) => {
|
|
535
535
|
if (item.children && item.children.length) {
|
|
536
|
-
item.disabled = true
|
|
537
|
-
this.setOnlyLeafChecked(item.children)
|
|
536
|
+
item.disabled = true
|
|
537
|
+
this.setOnlyLeafChecked(item.children)
|
|
538
538
|
} else {
|
|
539
|
-
item.disabled = false
|
|
539
|
+
item.disabled = false
|
|
540
540
|
}
|
|
541
|
-
})
|
|
541
|
+
})
|
|
542
542
|
},
|
|
543
543
|
|
|
544
544
|
/**
|
|
@@ -547,24 +547,24 @@ export default {
|
|
|
547
547
|
*/
|
|
548
548
|
treeNodeClick(data, node, tree) {
|
|
549
549
|
if (!this.multiple) {
|
|
550
|
-
if (this.onlyClickLeaf && !node.isLeaf) return
|
|
550
|
+
if (this.onlyClickLeaf && !node.isLeaf) return
|
|
551
551
|
if (this.defaultProps.disabled && !!data[this.defaultProps.disabled])
|
|
552
|
-
return
|
|
553
|
-
this.queryFlag = false
|
|
552
|
+
return
|
|
553
|
+
this.queryFlag = false
|
|
554
554
|
|
|
555
|
-
const k = this.defaultProps.label ||
|
|
556
|
-
console.log(data,
|
|
555
|
+
const k = this.defaultProps.label || 'label'
|
|
556
|
+
console.log(data, 'data', k, 'K')
|
|
557
557
|
|
|
558
|
-
this.filterText = data[k]
|
|
559
|
-
this.placeholder = this.filterText
|
|
558
|
+
this.filterText = data[k]
|
|
559
|
+
this.placeholder = this.filterText
|
|
560
560
|
|
|
561
|
-
this._value = data[this.nodeKey]
|
|
561
|
+
this._value = data[this.nodeKey]
|
|
562
562
|
|
|
563
563
|
// 主动让input框失去交单
|
|
564
|
-
this.$refs[this.inputRefName].blur()
|
|
565
|
-
this.showPopoverFlag = false
|
|
566
|
-
this.isRequestByFilterText && this.remoteMethod()
|
|
567
|
-
this.$emit(
|
|
564
|
+
this.$refs[this.inputRefName].blur()
|
|
565
|
+
this.showPopoverFlag = false
|
|
566
|
+
this.isRequestByFilterText && this.remoteMethod()
|
|
567
|
+
this.$emit('treeNodeClick', data, node, tree)
|
|
568
568
|
}
|
|
569
569
|
},
|
|
570
570
|
|
|
@@ -573,70 +573,70 @@ export default {
|
|
|
573
573
|
* 回调参数: data, node, tree
|
|
574
574
|
*/
|
|
575
575
|
handleCheckChange(data, checked) {
|
|
576
|
-
console.log(checked)
|
|
577
|
-
this.queryFlag = false
|
|
576
|
+
console.log(checked)
|
|
577
|
+
this.queryFlag = false
|
|
578
578
|
|
|
579
579
|
// const k = this.defaultProps.label || "label";
|
|
580
580
|
// this.filterText = checkedKeys[k];
|
|
581
|
-
let newText = []
|
|
581
|
+
let newText = []
|
|
582
582
|
if (this.onlyClickLeaf && !this.checkStrictly) {
|
|
583
583
|
//如果是增加父子节点联动性并且只能点击子节点
|
|
584
|
-
checked[
|
|
585
|
-
checked[
|
|
584
|
+
checked['checkedNodes'].forEach((item) => {
|
|
585
|
+
checked['checkedKeys'].forEach((el) => {
|
|
586
586
|
if (item.unitNo === el && !item.children) {
|
|
587
|
-
newText.push(item.unitName)
|
|
587
|
+
newText.push(item.unitName)
|
|
588
588
|
}
|
|
589
|
-
})
|
|
590
|
-
})
|
|
589
|
+
})
|
|
590
|
+
})
|
|
591
591
|
} else {
|
|
592
|
-
checked[
|
|
593
|
-
checked[
|
|
592
|
+
checked['checkedNodes'].forEach((item) => {
|
|
593
|
+
checked['checkedKeys'].forEach((el) => {
|
|
594
594
|
if (item.unitNo === el) {
|
|
595
|
-
newText.push(item.unitName)
|
|
595
|
+
newText.push(item.unitName)
|
|
596
596
|
}
|
|
597
|
-
})
|
|
598
|
-
})
|
|
597
|
+
})
|
|
598
|
+
})
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
-
this.filterText = newText.toString()
|
|
601
|
+
this.filterText = newText.toString()
|
|
602
602
|
|
|
603
|
-
this.placeholder = this.filterText
|
|
603
|
+
this.placeholder = this.filterText
|
|
604
604
|
if (this.onlyClickLeaf && !this.checkStrictly) {
|
|
605
605
|
this._value = checked.checkedNodes
|
|
606
606
|
.filter((item) => {
|
|
607
|
-
return !item.children
|
|
607
|
+
return !item.children
|
|
608
608
|
})
|
|
609
609
|
.map((item) => {
|
|
610
610
|
return {
|
|
611
611
|
[this.nodeKey]: item[this.nodeKey],
|
|
612
|
-
[this.queryKey]: item[this.queryKey]
|
|
613
|
-
}
|
|
614
|
-
})
|
|
612
|
+
[this.queryKey]: item[this.queryKey]
|
|
613
|
+
}
|
|
614
|
+
})
|
|
615
615
|
} else {
|
|
616
616
|
this._value = checked.checkedNodes.map((item) => {
|
|
617
617
|
return {
|
|
618
618
|
[this.nodeKey]: item[this.nodeKey],
|
|
619
|
-
[this.queryKey]: item[this.queryKey]
|
|
620
|
-
}
|
|
621
|
-
})
|
|
619
|
+
[this.queryKey]: item[this.queryKey]
|
|
620
|
+
}
|
|
621
|
+
})
|
|
622
622
|
}
|
|
623
|
-
console.log(this._value)
|
|
624
|
-
this.$emit(
|
|
623
|
+
console.log(this._value)
|
|
624
|
+
this.$emit('checkedClick', checked)
|
|
625
625
|
},
|
|
626
626
|
|
|
627
627
|
/**
|
|
628
628
|
* input框失去焦点
|
|
629
629
|
*/
|
|
630
630
|
clearFilterText() {
|
|
631
|
-
this.changeSuffix = false
|
|
631
|
+
this.changeSuffix = false
|
|
632
632
|
if (!this.multiple) {
|
|
633
|
-
this.filterText = this.placeholder
|
|
634
|
-
this.placeholder = null
|
|
633
|
+
this.filterText = this.placeholder
|
|
634
|
+
this.placeholder = null
|
|
635
635
|
// this.showPopoverFlag = false;
|
|
636
636
|
this.$nextTick(() => {
|
|
637
|
-
this.$forceUpdate()
|
|
638
|
-
})
|
|
639
|
-
this.$emit(
|
|
637
|
+
this.$forceUpdate()
|
|
638
|
+
})
|
|
639
|
+
this.$emit('filterText', this.filterText)
|
|
640
640
|
}
|
|
641
641
|
},
|
|
642
642
|
|
|
@@ -644,22 +644,22 @@ export default {
|
|
|
644
644
|
* input聚焦时
|
|
645
645
|
*/
|
|
646
646
|
inputFocus() {
|
|
647
|
-
this.changeSuffix = true
|
|
647
|
+
this.changeSuffix = true
|
|
648
648
|
if (this.filterText) {
|
|
649
|
-
this.timeTemp && clearTimeout(this.timeTemp)
|
|
650
|
-
this.windowEventFlag = false
|
|
651
|
-
this.placeholder = this.filterText
|
|
652
|
-
this.filterText =
|
|
653
|
-
this.queryFlag = true
|
|
649
|
+
this.timeTemp && clearTimeout(this.timeTemp)
|
|
650
|
+
this.windowEventFlag = false
|
|
651
|
+
this.placeholder = this.filterText
|
|
652
|
+
this.filterText = ''
|
|
653
|
+
this.queryFlag = true
|
|
654
654
|
} else {
|
|
655
|
-
this.remoteMethod()
|
|
655
|
+
this.remoteMethod()
|
|
656
656
|
}
|
|
657
657
|
},
|
|
658
658
|
onClickOutside() {
|
|
659
|
-
this.showPopoverFlag = false
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}
|
|
659
|
+
this.showPopoverFlag = false
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
663
|
</script>
|
|
664
664
|
|
|
665
665
|
<style lang="scss">
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
</template>
|
|
119
119
|
|
|
120
120
|
<script>
|
|
121
|
-
import axios from '
|
|
121
|
+
import axios from '../../../utils/axios'
|
|
122
122
|
// import InputTag from "../../InputTag/index";
|
|
123
123
|
import clickoutside from 'element-ui/src/utils/clickoutside'
|
|
124
124
|
export default {
|