Skip to content

Commit 716da95

Browse files
author
汪鸣峰
committed
Merge branch 'fixbug-dataGovernance' into 'develop'
修改数据治理bug See merge request luban/dataspherestudio!258
2 parents 4ad5e47 + 96b39c2 commit 716da95

File tree

6 files changed

+63
-35
lines changed

6 files changed

+63
-35
lines changed

web/src/apps/dataGovernance/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dataAssetsIndex": "Data Assets Index",
88
"overallMeasurement": "Overall measurement",
99
"menu": "Menu",
10-
"pleaseEnterATableName": "Please enter a table name / description to search the database table",
10+
"pleaseEnterATableName": "Please enter [database name / table name / field name / table description] to search the data table vaguely",
1111
"search": "Search"
1212
}
1313
}

web/src/apps/dataGovernance/i18n/zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dataAssetsIndex": "数据资产目录",
88
"overallMeasurement": "总体计量",
99
"menu": "目录",
10-
"pleaseEnterATableName": "请输入表名/描述搜索数据库表",
10+
"pleaseEnterATableName": "请输入 [数据库名/表名/字段名/表描述] 来模糊搜索数据表",
1111
"search": "搜索"
1212
}
1313
}

web/src/apps/dataGovernance/module/common/tabCard/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default {
8686
<style lang="scss" scoped>
8787
@import "@/common/style/variables.scss";
8888
.tab-card-wrap {
89-
min-height: 99px;
89+
min-height: 10.5vh;
9090
padding-left: 24px;
9191
padding-right: 24px;
9292
border: 1px solid #dee4ec;

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

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<Icon
124124
type="md-checkmark"
125125
v-else
126-
@click="changeClassifications"
126+
@click.once="changeClassifications"
127127
style="position: absolute; right:0; top: -15px;cursor: pointer;"
128128
></Icon>
129129
<label>分层</label>
@@ -149,8 +149,7 @@
149149

150150
<div class="assets-info-b-r">
151151
<Tabs type="card" class="assets-tabs" v-model="curTab">
152-
<TabPane label="字段信息"
153-
name="info"
152+
<TabPane label="字段信息" name="info"
154153
><field-info
155154
:fieldInfo="fieldInfo"
156155
:rangeFieldInfo="rangeFieldInfo"
@@ -194,8 +193,8 @@ import {
194193
getLayersAll,
195194
updateClassifications
196195
} from "../../service/api";
197-
import util from '@/common/util'
198-
import { EventBus } from "../../module/common/eventBus/event-bus"
196+
import util from "@/common/util";
197+
import { EventBus } from "../../module/common/eventBus/event-bus";
199198
200199
export default {
201200
name: "assetsInfo",
@@ -227,7 +226,7 @@ export default {
227226
layerList: [],
228227
isChangingClassifications: false,
229228
editable: false,
230-
curTab: 'info'
229+
curTab: "info"
231230
};
232231
},
233232
watch: {
@@ -248,21 +247,21 @@ export default {
248247
this.layerList = result;
249248
});
250249
251-
util.Hub.$on('register_click_hive_table', data => {
252-
this.$nextTick(()=> {
253-
$(`#${data.guid}`).on('click', () => {
254-
this.curTab = 'info'
250+
util.Hub.$on("register_click_hive_table", data => {
251+
this.$nextTick(() => {
252+
$(`#${data.guid}`).on("click", () => {
253+
this.curTab = "info";
255254
EventBus.$emit("on-choose-card", data);
256255
const workspaceId = this.$route.query.workspaceId,
257-
guid = data.guid
256+
guid = data.guid;
258257
this.$router.push({
259258
name: "dataGovernance/assets/info",
260259
params: { guid },
261260
query: { workspaceId }
262261
});
263-
})
264-
})
265-
})
262+
});
263+
});
264+
});
266265
},
267266
methods: {
268267
init() {
@@ -305,22 +304,22 @@ export default {
305304
classifications
306305
} = data.result;
307306
if (parseInt(basic.store)) {
308-
let tempLen = Math.floor(basic.store.length / 4)
309-
let len = tempLen > 2 ? 3 : tempLen
310-
basic.store = (basic.store / Math.pow(1024, len + 1)).toFixed(2)
311-
switch(len){
307+
let tempLen = Math.floor(basic.store.length / 4);
308+
let len = tempLen > 2 ? 3 : tempLen;
309+
basic.store = (basic.store / Math.pow(1024, len + 1)).toFixed(2);
310+
switch (len) {
312311
case 0:
313-
basic.store = basic.store + 'KB'
314-
break
312+
basic.store = basic.store + "KB";
313+
break;
315314
case 1:
316-
basic.store = basic.store + 'MB'
317-
break
315+
basic.store = basic.store + "MB";
316+
break;
318317
case 2:
319-
basic.store = basic.store + 'GB'
320-
break
318+
basic.store = basic.store + "GB";
319+
break;
321320
default:
322-
basic.store = basic.store + 'TB'
323-
break
321+
basic.store = basic.store + "TB";
322+
break;
324323
}
325324
}
326325
this.basicData = basic;
@@ -364,6 +363,28 @@ export default {
364363
.then(data => {
365364
if (data.result) {
366365
this.rangeInfo = data.result;
366+
this.rangeInfo.forEach(item => {
367+
item.store = item.store + "";
368+
let tempLen = Math.floor(item.store.length / 4);
369+
let len = tempLen > 2 ? 3 : tempLen;
370+
item.store = (
371+
item.store / Math.pow(1024, len + 1)
372+
).toFixed(2);
373+
switch (len) {
374+
case 0:
375+
item.store = item.store + "KB";
376+
break;
377+
case 1:
378+
item.store = item.store + "MB";
379+
break;
380+
case 2:
381+
item.store = item.store + "GB";
382+
break;
383+
default:
384+
item.store = item.store + "TB";
385+
break;
386+
}
387+
});
367388
}
368389
})
369390
.catch(err => {

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,14 @@
9595

9696
<!-- right -->
9797
<div class="assets-index-b-r" v-if="cardTabs.length">
98-
<template v-for="model in cardTabs">
98+
<Scroll :on-reach-bottom="handleReachBottom" height="100vh">
9999
<tab-card
100+
v-for="model in cardTabs"
100101
:model="model"
101102
:key="model.guid"
102103
@on-choose="onChooseCard"
103104
></tab-card>
104-
</template>
105+
</Scroll>
105106
</div>
106107
<div class="assets-index-b-r" v-else>
107108
<div style="text-align: center; margin-top:50px; font-weight: bolder;">暂无数据</div>
@@ -175,9 +176,10 @@ export default {
175176
mounted() {
176177
let _this = this;
177178
this.throttleLoad = throttle(() => {
179+
console.log('scroll')
178180
_this.scrollHander();
179181
}, 300);
180-
window.addEventListener("scroll", this.throttleLoad);
182+
window.addEventListener("scroll", this.throttleLoad, false);
181183
getThemedomains().then(res => {
182184
let { result } = res;
183185
this.subjectList = result;
@@ -315,7 +317,8 @@ export default {
315317
} else {
316318
clientHeight = Math.max(
317319
document.body.clientHeight,
318-
document.documentElement.clientHeight
320+
document.documentElement.clientHeight,
321+
document.querySelector('.layout').clientHeight
319322
);
320323
}
321324
return clientHeight;
@@ -326,7 +329,11 @@ export default {
326329
document.documentElement.scrollHeight
327330
);
328331
};
329-
if (getScrollTop() + getClientHeight() === getScrollHeight()) {
332+
let st = getScrollTop();
333+
let ch = getClientHeight();
334+
let sh = getScrollHeight();
335+
console.log(st,ch,sh)
336+
if (st + ch + 54 >= sh) {
330337
// 拉数据
331338
this.handleReachBottom();
332339
}

web/vue.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ module.exports = {
250250
target: "http://***REMOVED***:8088",
251251
//target: 'http://***REMOVED***:9202', //yichao
252252
// target: "http://***REMOVED***:9202", //jiawei
253-
//target: "http://luban.ctyun.cn:8088",
253+
// target: "http://luban.ctyun.cn:8088",
254254
//target: "http://devluban.ctyun.cn:8088",
255255
changeOrigin: true,
256256
pathRewrite: {

0 commit comments

Comments
 (0)