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

File diff suppressed because it is too large Load Diff

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()) {