Skip to content

Commit 444e37b

Browse files
committed
Merge remote-tracking branch 'origin/dev-1.2.0_k8s' into dev-1.2.0_k8s
2 parents 4cfdba8 + 5b17f77 commit 444e37b

File tree

1 file changed

+41
-5
lines changed
  • web/src/apps/dataGovernance/view/assetsSearch

1 file changed

+41
-5
lines changed

web/src/apps/dataGovernance/view/assetsSearch/index.vue

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
@on-choose="onChooseCard"
165165
></tab-card>
166166
</Scroll>
167+
<Divider v-if="isCompleted" orientation="center">到底了</Divider>
167168
</div>
168169
<div class="assets-index-b-r" v-else>
169170
<div style="text-align: center; margin-top: 50px; font-weight: bolder">
@@ -206,6 +207,7 @@ export default {
206207
isLoading: false,
207208
subjectList: [],
208209
layerList: [],
210+
isCompleted: false,
209211
};
210212
},
211213
created() {
@@ -218,6 +220,11 @@ export default {
218220
getHiveTbls(JSON.parse(searchParams))
219221
.then((data) => {
220222
if (data.result) {
223+
if( data.result.length == this.searchOption.limit ) {
224+
this.isCompleted = false
225+
} else {
226+
this.isCompleted = true
227+
}
221228
this.cardTabs = data.result;
222229
}
223230
})
@@ -228,6 +235,11 @@ export default {
228235
getHiveTbls({ query: "", limit: 10, offset: 0 })
229236
.then((data) => {
230237
if (data.result) {
238+
if( data.result.length == this.searchOption.limit ) {
239+
this.isCompleted = false
240+
} else {
241+
this.isCompleted = true
242+
}
231243
this.cardTabs = data.result;
232244
}
233245
})
@@ -282,6 +294,11 @@ export default {
282294
getHiveTbls(params)
283295
.then((data) => {
284296
if (data.result) {
297+
if( data.result.length == this.searchOption.limit ) {
298+
this.isCompleted = false
299+
} else {
300+
this.isCompleted = true
301+
}
285302
if( this.queryForTbls ) {
286303
this.cardTabs = this.foamtDataToHighLigth(data.result, this.queryForTbls)
287304
} else {
@@ -327,6 +344,11 @@ export default {
327344
getHiveTbls(params)
328345
.then((data) => {
329346
if (data.result) {
347+
if( data.result.length == this.searchOption.limit ) {
348+
this.isCompleted = false
349+
} else {
350+
this.isCompleted = true
351+
}
330352
that.cardTabs = res.concat(data.result);
331353
} else {
332354
that.$Message.success("所有数据已加载完成");
@@ -432,22 +454,36 @@ export default {
432454
this.onSearch();
433455
},
434456
435-
// 处理高亮
457+
// 处理高亮 并过滤没有 高亮 的结果
436458
foamtDataToHighLigth(result, query) {
437459
const _result = result.slice() || []
438460
const _query = `<span>${query}</span>`
439461
const reg = new RegExp(query, 'g')
440-
_result.forEach(item => {
462+
const filter_arr = []
463+
_result.forEach((item, idx) => {
464+
let flag = false
441465
Object.keys(item).forEach(key => {
442-
if( typeof item[key] == 'string' ) {
466+
if( key == 'classifications' && item['classifications'] && item['classifications'].length > 0 ) {
467+
item['classifications'].forEach(item => {
468+
if( item['typeName'].indexOf(query) > -1 ) {
469+
flag = true
470+
}
471+
})
472+
}
473+
if( typeof item[key] == 'string' && item[key].indexOf(query) > -1 ) {
443474
item[key] = item[key].replace(reg, _query)
475+
flag = true
444476
}
445-
if( item[key] instanceof Array && item[key].length > 0 && typeof item[key][0] == 'string' ) {
477+
if( item[key] instanceof Array && item[key].length > 0 && typeof item[key][0] == 'string' && item[key].join('@').indexOf(query) > -1 ) {
446478
item[key] = item[key].join('@').replace(reg, _query).split('@')
479+
flag = true
447480
}
448481
})
482+
if( !flag ){
483+
filter_arr.push(idx)
484+
}
449485
})
450-
return _result
486+
return _result.filter((item, idx) => !filter_arr.includes(idx))
451487
}
452488
},
453489
};

0 commit comments

Comments
 (0)