监测点代码优化

This commit is contained in:
仲么了
2024-02-29 10:50:14 +08:00
parent 8175de04bb
commit d9a5a7c9d7
5 changed files with 9 additions and 5 deletions

View File

@@ -16,7 +16,8 @@ const props = defineProps(['options'])
let chart: echarts.ECharts | any = null let chart: echarts.ECharts | any = null
const resizeHandler = () => { const resizeHandler = () => {
// 不在视野中的时候不进行resize // 不在视野中的时候不进行resize
if(chartRef.value!.offsetHeight == 0) return if (!chartRef.value) return
if (chartRef.value.offsetHeight == 0) return
chart.getZr().painter.getViewportRoot().style.display = 'none' chart.getZr().painter.getViewportRoot().style.display = 'none'
requestAnimationFrame(() => { requestAnimationFrame(() => {
chart.resize() chart.resize()

View File

@@ -103,7 +103,7 @@ const loadData = () => {
if (nodeKey) { if (nodeKey) {
nextTick(() => { nextTick(() => {
treeRef.value.treeRef.setCurrentKey(nodeKey) treeRef.value.treeRef.setCurrentKey(nodeKey)
treeRef.value.treeRef.setExpandedKeys(nodeKey) // treeRef.value.treeRef.setExpandedKeys(nodeKey)
}) })
} }
}) })

View File

@@ -39,7 +39,7 @@
<Shishishuju /> <Shishishuju />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div class="monitoring-point" v-if="!monitoringPoint.state.showCheckBox"> <div class="monitoring-point" v-if="!monitoringPoint.state.showCheckBox && monitoringPoint.state.lineName">
当前位置{{ monitoringPoint.state.lineName }} 当前位置{{ monitoringPoint.state.lineName }}
</div> </div>
</div> </div>
@@ -72,7 +72,7 @@ const pointTree = ref()
const size = ref(0) const size = ref(0)
const isReload = ref(false) const isReload = ref(false)
const height = mainHeight(40) const height = mainHeight(40)
const activeName = ref('3') const activeName = ref('1')
onMounted(() => { onMounted(() => {
const dom = document.getElementById('navigation-splitpanes') const dom = document.getElementById('navigation-splitpanes')
if (dom) { if (dom) {

View File

@@ -41,6 +41,9 @@ const grade = gradeColor5.map((item, index) => {
const init = () => { const init = () => {
loading.value = true loading.value = true
if (!monitoringPoint.state.lineId) {
return
}
formData.id = monitoringPoint.state.lineId formData.id = monitoringPoint.state.lineId
formData.searchBeginTime = datePickerRef.value.timeValue[0] formData.searchBeginTime = datePickerRef.value.timeValue[0]
formData.searchEndTime = datePickerRef.value.timeValue[1] formData.searchEndTime = datePickerRef.value.timeValue[1]

View File

@@ -11,7 +11,7 @@ export default defineConfig({
host: '0.0.0.0', host: '0.0.0.0',
proxy: { proxy: {
'/api': { '/api': {
target: 'http://192.168.1.81:10215', //数据中心 target: 'http://192.168.1.31:10215', //数据中心
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '') //路径重写,把'/api'替换为'' rewrite: path => path.replace(/^\/api/, '') //路径重写,把'/api'替换为''
}, },