Merge branch 'dev-3.3' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.3
This commit is contained in:
@@ -359,7 +359,10 @@ export default {
|
||||
this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].groupShow(item.param.collapse)
|
||||
this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].$refs.chart && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id] && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id].$refs.chartList.resize()
|
||||
}
|
||||
this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].resize()
|
||||
try {
|
||||
this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].resize()
|
||||
} catch (error) {
|
||||
}
|
||||
})
|
||||
},
|
||||
refreshPanel () {
|
||||
@@ -448,10 +451,10 @@ export default {
|
||||
// 监听查看模式变化
|
||||
'$store.state.panel.mode': {
|
||||
immediate: true,
|
||||
handler () {
|
||||
handler (val) {
|
||||
setTimeout(() => {
|
||||
this.resize()
|
||||
}, 100)
|
||||
}, 200)
|
||||
}
|
||||
},
|
||||
dataList: {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import bus from '@/libs/bus'
|
||||
export default {
|
||||
name: 'deleteButton',
|
||||
props: {
|
||||
@@ -44,6 +45,7 @@ export default {
|
||||
if (response.code === 200) {
|
||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
||||
this.$emit('after')
|
||||
bus.$emit('delTableRow', this.deleteObjs.map(item => item.id))
|
||||
} else {
|
||||
this.$message.error(response.msg)
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ export default {
|
||||
self.delFlag = true
|
||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
||||
self.getTableData()
|
||||
bus.$emit('delTableRow', [row.id])
|
||||
} else {
|
||||
this.$message.error(response.msg)
|
||||
}
|
||||
@@ -354,6 +355,8 @@ export default {
|
||||
}
|
||||
if (this.$route.query.orderBy && !this.isSubList) {
|
||||
this.orderBy = this.$route.query.orderBy
|
||||
} else if (this.isSubList) {
|
||||
return
|
||||
}
|
||||
let searchKeys = {}
|
||||
if (path === 'dc') {
|
||||
|
||||
@@ -244,7 +244,7 @@ export default {
|
||||
tempEndpoint: {},
|
||||
tempEndpoint2: {},
|
||||
assetLoading: true,
|
||||
rightBox: { show: false, title: this.$t('overall.createEndpoin'), isEdit: false },
|
||||
rightBox: { show: false, title: this.$t('overall.createEndpoint'), isEdit: false },
|
||||
optionType: 'batch',
|
||||
blankEndpoint: {
|
||||
id: '',
|
||||
|
||||
@@ -268,7 +268,7 @@ export default {
|
||||
tempEndpoint: {},
|
||||
tempEndpoint2: {},
|
||||
assetLoading: true,
|
||||
rightBox: { show: false, title: this.$t('overall.createEndpoin'), isEdit: false },
|
||||
rightBox: { show: false, title: this.$t('overall.createEndpoint'), isEdit: false },
|
||||
optionType: 'batchAdd',
|
||||
endpointTableTitle: [ // 原始table列
|
||||
{
|
||||
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
tempEndpoint: {},
|
||||
tempEndpoint2: {},
|
||||
assetLoading: true,
|
||||
rightBox: { show: false, title: this.$t('overall.createEndpoin'), isEdit: false },
|
||||
rightBox: { show: false, title: this.$t('overall.createEndpoint'), isEdit: false },
|
||||
blankEndpoint: {
|
||||
id: '',
|
||||
projectId: '',
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
{{ $t("project.module.batchEndpoint")}}
|
||||
</span>
|
||||
<span v-if="optionType === 'add'">
|
||||
{{ $t("overall.createEndpoin")}}
|
||||
{{ $t("overall.createEndpoint")}}
|
||||
</span>
|
||||
<span v-if="optionType === 'batchAdd'">
|
||||
{{ $t("overall.createEndpoin")}}
|
||||
{{ $t("overall.createEndpoint")}}
|
||||
</span>
|
||||
</div>
|
||||
<!-- end--标题-->
|
||||
|
||||
@@ -104,6 +104,7 @@ import { fromRoute } from '@/components/common/js/constants'
|
||||
import bottomBox from '@/components/common/bottomBox/bottomBox'
|
||||
import { bottomBoxWindow } from '@/components/common/js/tools'
|
||||
import panelChart from '@/components/chart/panelChart'
|
||||
import bus from '@/libs/bus'
|
||||
export default {
|
||||
name: 'nzDataList',
|
||||
components: {
|
||||
@@ -154,7 +155,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
sign:'',
|
||||
sign: '',
|
||||
fromRoute: fromRoute,
|
||||
/* 二级页面相关 */
|
||||
bottomBox: {
|
||||
@@ -175,7 +176,23 @@ export default {
|
||||
timeRange: [new Date(), new Date()]
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
bus.$on('delTableRow', this.delTableRow)
|
||||
},
|
||||
methods: {
|
||||
delTableRow (ids) { // 接收一个 删除的id数组 判断当前底部弹窗id 是否包含 包含则关闭当前弹窗
|
||||
if (ids.indexOf(this.bottomBox.object.id) !== -1) {
|
||||
this.bottomBox = {
|
||||
object: {},
|
||||
mainResizeShow: true, // dom高度改变时是否展示|隐藏
|
||||
subResizeShow: true,
|
||||
isFullScreen: false, // 全屏状态
|
||||
showSubList: false, // 是否显示二级列表
|
||||
targetTab: '', // 显示二级列表中的哪个页签
|
||||
inTransform: false // 搜索框相关,搜索条件下拉框是否在transform里
|
||||
}
|
||||
}
|
||||
},
|
||||
updateCustomTableTitle (custom) {
|
||||
this.$emit('update:customTableTitle', custom)
|
||||
},
|
||||
@@ -225,6 +242,9 @@ export default {
|
||||
this.showLayout = [...n]
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
bus.$off('delTableRow', this.delTableRow)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -92,9 +92,9 @@
|
||||
class="date-range-history-item"
|
||||
@click="historyChange(item)"
|
||||
>
|
||||
{{ timeFormate(item.start) }}
|
||||
{{ momentTz(item.start) }}
|
||||
{{ $t("dashboard.panel.to") }}
|
||||
{{ timeFormate(item.end) }}
|
||||
{{ momentTz(item.end) }}
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -340,8 +340,8 @@ export default {
|
||||
}
|
||||
this.isCustom = true
|
||||
this.rangeHistory.unshift({
|
||||
start: item[0],
|
||||
end: item[1]
|
||||
start: this.momentStrToTimestamp(item[0]),
|
||||
end: this.momentStrToTimestamp(item[1])
|
||||
})
|
||||
localStorage.setItem(
|
||||
'date-range-history' + this.sign,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div style="display: flex;flex-direction: column">
|
||||
<!-- <i class="nz-icon nz-icon-arrow-down"/>-->
|
||||
<div style="font-size: 18px;font-weight: 600;color: #333;margin-bottom: 3px;text-align: right"> {{dataJson.panel.data.name}} </div>
|
||||
<span> {{timeFormate(dataJson.start * 1000)}} - {{timeFormate(dataJson.end * 1000)}} </span>
|
||||
<span> {{dateFormat(dataJson.start * 1000)}} - {{dateFormat(dataJson.end * 1000)}} ({{dataJson.timezone}})</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dashboardScrollbar" class="box-content" ref="dashboardScrollbar" style='overflow:hidden; overflow-y: auto;height: calc(100% - 60px)'>
|
||||
@@ -50,7 +50,6 @@ import chartList from '@/components/chart/chartList.vue'
|
||||
import moment from 'moment-timezone'
|
||||
import { loadI18n } from '@/components/common/i18n'
|
||||
import i18nData from '@/entrance/exportHtml/i18nData'
|
||||
|
||||
const dataJson = window.dataJson || {}
|
||||
export default {
|
||||
name: 'Entrance',
|
||||
@@ -67,7 +66,8 @@ export default {
|
||||
created () {
|
||||
this.$i18n.locale = this.dataJson.language
|
||||
loadI18n(i18nData)
|
||||
const localOffset = moment.tz.guess()// 默认 一分钟显示时区偏移的结果
|
||||
const localOffset = this.dataJson.timezone || moment.tz.guess()
|
||||
this.dataJson.timezone = localOffset
|
||||
localStorage.setItem('nz-sys-timezone', localOffset)
|
||||
},
|
||||
mounted () {
|
||||
@@ -78,7 +78,13 @@ export default {
|
||||
delChart () {},
|
||||
addGroupItem () {},
|
||||
chartListLoading () {},
|
||||
refreshPanel () {}
|
||||
refreshPanel () {},
|
||||
// 时间戳转为UTC格式
|
||||
dateFormat (time) {
|
||||
let offset = localStorage.getItem('nz-sys-timezone')
|
||||
offset = moment.tz(offset).format('Z')
|
||||
return moment(time).utcOffset(offset).format()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user