fix: 修复知识库更新结束或者在上传页面返回后柱状图消失的问题

This commit is contained in:
chenjinsong
2023-10-30 11:26:24 +08:00
parent dbc68077ca
commit a7d6ffb4b4
3 changed files with 1402 additions and 1392 deletions

View File

@@ -38,8 +38,8 @@
margin-right:20px; margin-right:20px;
margin-top: 20px; margin-top: 20px;
} }
} }
.top-tool-btn--user_defined_library { .top-tool-btn--user_defined_library {
background: #F5F8FA; background: #F5F8FA;
border: 1px solid rgba(222,222,222,1); border: 1px solid rgba(222,222,222,1);
box-shadow: 0px 2px 4px 0px rgba(51,51,51,0.02); box-shadow: 0px 2px 4px 0px rgba(51,51,51,0.02);
@@ -58,13 +58,13 @@
font-size:14px !important; font-size:14px !important;
margin-right:6px; margin-right:6px;
} }
} }
.top-tool-btn--user_defined_library:hover { .top-tool-btn--user_defined_library:hover {
border: 1px solid $--border-color-primary; border: 1px solid $--border-color-primary;
background-color: $--button-gray-hover-background-color; background-color: $--button-gray-hover-background-color;
cursor: pointer; cursor: pointer;
} }
.knowledge-base-built-in__content { .knowledge-base-built-in__content {
display:flex; display:flex;
flex-direction:row; flex-direction:row;
padding:12px 0 20px 20px; padding:12px 0 20px 20px;
@@ -356,8 +356,8 @@
} }
} }
} }
} }
.knowledge-base-user-defined__content { .knowledge-base-user-defined__content {
display:flex; display:flex;
flex-direction:row; flex-direction:row;
padding:12px 20px 20px 20px; padding:12px 20px 20px 20px;
@@ -962,35 +962,35 @@
box-shadow: 0 -1px 4px 0 rgba(0,0,0,0.07); box-shadow: 0 -1px 4px 0 rgba(0,0,0,0.07);
} }
} }
} }
} }
.reference-tag__tip { .reference-tag__tip {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
font-size: 12px; font-size: 12px;
color: #575757; color: #575757;
font-weight: 400; font-weight: 400;
min-width:130px; min-width:130px;
max-height:240px; max-height:240px;
overflow-y:auto; overflow-y:auto;
cursor:pointer; cursor:pointer;
.reference-tag { .reference-tag {
height:24px; height:24px;
min-height:24px; min-height:24px;
padding-top: 3px; padding-top: 3px;
} }
} }
.edit-knowledge-base { .edit-knowledge-base {
height: 100%; height: 100%;
.edit-knowledge-base__header { .edit-knowledge-base__header {
padding: 30px 0 30px 20px; padding: 30px 0 30px 20px;
font-size: 24px; font-size: 24px;
line-height: 24px; line-height: 24px;
font-weight: 900; font-weight: 900;
color: #353636; color: #353636;
} }
.edit-knowledge-base__body { .edit-knowledge-base__body {
display: flex; display: flex;
height: calc(100% - 147px); height: calc(100% - 147px);
padding-left: 20px; padding-left: 20px;
@@ -1379,8 +1379,8 @@ height: 100%;
display: none; display: none;
} }
} }
} }
.edit-knowledge-base__footer { .edit-knowledge-base__footer {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -1419,48 +1419,48 @@ height: 100%;
opacity: .6; opacity: .6;
cursor: default; cursor: default;
} }
} }
} }
.addTagBtn { .addTagBtn {
position: absolute; position: absolute;
bottom: 9px; bottom: 9px;
height:24px !important; height:24px !important;
min-height: 24px !important; min-height: 24px !important;
font-size: 12px; font-size: 12px;
color: #353636; color: #353636;
font-weight: 500; font-weight: 500;
width: 598px; width: 598px;
margin-left: 10px; margin-left: 10px;
background: rgb(245, 248, 250); background: rgb(245, 248, 250);
border: 1px #DEDEDE solid; border: 1px #DEDEDE solid;
padding: 0 !important; padding: 0 !important;
box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02); box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02);
border-radius: 2px; border-radius: 2px;
font-family:NotoSansHans-Medium !important; font-family:NotoSansHans-Medium !important;
.add-tag-btn { .add-tag-btn {
color: #575757 !important; color: #575757 !important;
font-size: 9px !important; font-size: 9px !important;
margin: 0 8px 2px 8px; margin: 0 8px 2px 8px;
} }
&:hover { &:hover {
i { i {
color: #699DC9 !important; color: #699DC9 !important;
} }
} }
span { span {
font-family:NotoSansHans-Medium !important; font-family:NotoSansHans-Medium !important;
} }
} }
.del-model-hint { .del-model-hint {
display:flex; display:flex;
flex-direction: column; flex-direction: column;
padding-bottom:0px !important; padding-bottom:0px !important;
width:480px !important; width:480px !important;
height:300px !important; height:300px !important;
.el-dialog__header{ .el-dialog__header{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
border-bottom:1px solid #eee; border-bottom:1px solid #eee;
@@ -1490,8 +1490,8 @@ height:300px !important;
letter-spacing: 0; letter-spacing: 0;
font-weight: 400; font-weight: 400;
} }
} }
.el-dialog__body { .el-dialog__body {
height:206px; height:206px;
min-height:206px; min-height:206px;
font-size: 14px; font-size: 14px;
@@ -1517,8 +1517,8 @@ height:300px !important;
background-color: #38ACD2; background-color: #38ACD2;
border-color: #38ACD2; border-color: #38ACD2;
} }
} }
.el-dialog__footer { .el-dialog__footer {
height:52px; height:52px;
min-height:52px; min-height:52px;
border-top:1px solid #eee; border-top:1px solid #eee;
@@ -1548,7 +1548,7 @@ height:300px !important;
background-color:#2d8cf0; background-color:#2d8cf0;
border-color:#2d8cf0; border-color:#2d8cf0;
} }
} }
} }
.confirm-knowledge-switch { .confirm-knowledge-switch {
display: flex; display: flex;
@@ -1894,16 +1894,17 @@ height:300px !important;
.update-dialog__table { .update-dialog__table {
border-bottom: none; border-bottom: none;
border-radius: 0.28571rem; border-radius: 0.28571rem;
height:calc(90vh - 190px - 200px - 50px - 10px);//dialog为屏幕的90% - 表格以上内容的高度 - pishon3柱状图的高度 - 表格和柱状图之间的距离 - 底部留白的距离 height: calc(100% - 125px);//dialog为屏幕的90% - 表格以上内容的高度 - pishon3柱状图的高度 - 表格和柱状图之间的距离 - 底部留白的距离
max-height:calc(90vh - 190px - 200px - 50px - 10px);
//min-height:250px;
.el-table--border th, .el-table--border td { .el-table--border th, .el-table--border td {
border-right: none; border-right: none;
} }
.el-table__body-wrapper { .el-table__body-wrapper {
height: 100%; height: calc(100% - 48px);
overflow-y: auto; overflow-y: auto;
} }
&.update-dialog__table--psiphon3 {
height: calc(90vh - 190px - 200px - 50px - 10px);
}
} }
.update-knowledge-form { .update-knowledge-form {
.el-upload { .el-upload {

View File

@@ -126,7 +126,7 @@
</button> </button>
</div> </div>
</div> </div>
<div style="height: calc(90vh - 190px - 200px - 50px - 10px - 42px);margin-top: 42px; position: absolute; width: calc(100% - 60px)"> <div :style="{height: updateKnowledge.source === 'cn_psiphon3_ip' ? 'calc(90vh - 190px - 200px - 50px - 42px)' : 'calc(100% - 242px)', marginTop: '42px', position: 'absolute', width: 'calc(100% - 60px)'}">
<loading :loading="updateLogLoading"></loading> <loading :loading="updateLogLoading"></loading>
</div> </div>
<el-table ref="updateDataTable" <el-table ref="updateDataTable"
@@ -134,7 +134,8 @@
:data="updateHistoryList" :data="updateHistoryList"
@selection-change="secondSelectionChange" @selection-change="secondSelectionChange"
width="100%" width="100%"
class="update-dialog__table" :class="updateKnowledge.source === 'cn_psiphon3_ip' ? 'update-dialog__table update-dialog__table--psiphon3' : 'update-dialog__table'"
:header-cell-style="{background:'#f5f7fa',color:'#353636',fontWeight: '400',fontSize: '12px',borderRight: 'none',borderBottom: 'none'}"
cell-style="padding:6px 0px;font-size: 12px;color: #353636;font-weight: 400;line-height: 20px;border-right:none;" cell-style="padding:6px 0px;font-size: 12px;color: #353636;font-weight: 400;line-height: 20px;border-right:none;"
header-cell-style="padding:8px 0px;font-size: 12px;color: #353636;font-weight: 500;border-right:none;"> header-cell-style="padding:8px 0px;font-size: 12px;color: #353636;font-weight: 500;border-right:none;">
<el-table-column prop="opTime" :label="$t('entities.tab.informationAggregation.updateTime')" width="150" ></el-table-column> <el-table-column prop="opTime" :label="$t('entities.tab.informationAggregation.updateTime')" width="150" ></el-table-column>
@@ -153,7 +154,7 @@
</template> </template>
</el-table> </el-table>
<div class="psiphon3"> <div class="psiphon3" v-if="updateKnowledge.source === 'cn_psiphon3_ip'">
<div class="psiphon3-title">{{$t('knowledgeBase.psiphon3IpCount')}}</div> <div class="psiphon3-title">{{$t('knowledgeBase.psiphon3IpCount')}}</div>
<div class="psiphon3-bar"> <div class="psiphon3-bar">
<chart-error v-if="showErrorForPsiphon3" :content="errorMsgForPsiphon3"/> <chart-error v-if="showErrorForPsiphon3" :content="errorMsgForPsiphon3"/>
@@ -576,6 +577,7 @@ export default {
this.$message.success(this.$t('tip.success')) this.$message.success(this.$t('tip.success'))
this.showAddUpdateDialog = false this.showAddUpdateDialog = false
this.getCurTabData() this.getCurTabData()
this.init()
/* } else { /* } else {
this.$message.error(this.$t('tip.uploadFailed', { msg: response.message })) this.$message.error(this.$t('tip.uploadFailed', { msg: response.message }))
} */ } */
@@ -748,6 +750,7 @@ export default {
}, },
tableData: { tableData: {
handler (n) { handler (n) {
console.info(n)
if (this.tableData && this.tableData.length > 0) { if (this.tableData && this.tableData.length > 0) {
this.aiTaggingList = [] this.aiTaggingList = []
this.websketchList = [] this.websketchList = []
@@ -773,6 +776,12 @@ export default {
handler (n) { handler (n) {
if (!n) { if (!n) {
this.fileList = [] this.fileList = []
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
this.init()
}
} else {
this.myChart && this.myChart.dispose()
this.myChart = null
} }
} }
} }

View File

@@ -121,7 +121,7 @@ export function xAxisTimeFormatter (value) {
':' + ':' +
(date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()) (date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes())
// 如果是一天的开始 // 如果是一天的开始
console.info(date, dayStart, hourStart, HHmm) console.info(date.getTime(), dayStart.getTime(), hourStart.getTime(), date.getTime() === dayStart.getTime(), date.getTime() === hourStart.getTime())
if (date.getTime() === dayStart.getTime()) { if (date.getTime() === dayStart.getTime()) {
return '{day|' + dateFormat(date, 'YYYY-MM-DD') + '}' return '{day|' + dateFormat(date, 'YYYY-MM-DD') + '}'
} else if (date.getTime() === hourStart.getTime()) { } else if (date.getTime() === hourStart.getTime()) {