隐患点风险点添加颜色
This commit is contained in:
@@ -16,7 +16,11 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr v-for="(tableData, index) in tableDatas" :key="index">
|
<tr
|
||||||
|
v-for="(tableData, index) in tableDatas"
|
||||||
|
:key="index"
|
||||||
|
:style="tableData.styles || {}"
|
||||||
|
>
|
||||||
<td class="label">{{ tableData.title }}</td>
|
<td class="label">{{ tableData.title }}</td>
|
||||||
<td>{{ tableData.content }}</td>
|
<td>{{ tableData.content }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -33,7 +37,7 @@
|
|||||||
title: string;
|
title: string;
|
||||||
data: Record<string, string>;
|
data: Record<string, string>;
|
||||||
field: Record<string, string>;
|
field: Record<string, string>;
|
||||||
color: Record<string, string> | null;
|
style?: Record<string, Record<string, string>>;
|
||||||
offsetX: number;
|
offsetX: number;
|
||||||
offsetY: number;
|
offsetY: number;
|
||||||
}>();
|
}>();
|
||||||
@@ -44,7 +48,8 @@
|
|||||||
const newOffsetX = ref(props.offsetX);
|
const newOffsetX = ref(props.offsetX);
|
||||||
const newOffsetY = ref(props.offsetY);
|
const newOffsetY = ref(props.offsetY);
|
||||||
|
|
||||||
const tableDatas: Ref<{ title: string; content: string }[]> = ref([]);
|
const tableDatas: Ref<{ title: string; content: string; styles?: Record<string, string> }[]> =
|
||||||
|
ref([]);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 判断是否超出屏幕,超出就重新定位
|
// 判断是否超出屏幕,超出就重新定位
|
||||||
@@ -59,10 +64,14 @@
|
|||||||
Object.entries(props.data).forEach(([key, value]) => {
|
Object.entries(props.data).forEach(([key, value]) => {
|
||||||
// 判断key是不是存在field中,存在就添加到表格数据,不存在则不添加
|
// 判断key是不是存在field中,存在就添加到表格数据,不存在则不添加
|
||||||
if (Object.hasOwn(props.field, key) && value) {
|
if (Object.hasOwn(props.field, key) && value) {
|
||||||
tableDatas.value.push({
|
const rowData: { title: string; content: string; styles?: Record<string, string> } = {
|
||||||
title: props.field[key],
|
title: props.field[key],
|
||||||
content: value,
|
content: value,
|
||||||
});
|
};
|
||||||
|
if (props.style && Object.hasOwn(props.style, key)) {
|
||||||
|
rowData.styles = props.style[key];
|
||||||
|
}
|
||||||
|
tableDatas.value.push(rowData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="collapsePointDetail as Record<string, any>"
|
:data="collapsePointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
:color="color"
|
:style="style"
|
||||||
v-if="loadingInformationStore.collapseHiddenPoint.loading"
|
v-if="loadingInformationStore.collapseHiddenPoint.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
const loadingResourceStore = useLoadingResourceStore();
|
const loadingResourceStore = useLoadingResourceStore();
|
||||||
const simulationIdStore = useSimulationIdStore();
|
const simulationIdStore = useSimulationIdStore();
|
||||||
|
|
||||||
const { field, color, getDisasterIcon } = useHiddenPoint();
|
const { field, style, getDisasterIcon } = useHiddenPoint();
|
||||||
|
|
||||||
// 信息框相关配置
|
// 信息框相关配置
|
||||||
const offsetX = ref(0);
|
const offsetX = ref(0);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="debrisFlowPointDetail as Record<string, any>"
|
:data="debrisFlowPointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
:color="color"
|
:style="style"
|
||||||
v-if="loadingInformationStore.debrisFlowHiddenPoint.loading"
|
v-if="loadingInformationStore.debrisFlowHiddenPoint.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
const loadingResourceStore = useLoadingResourceStore();
|
const loadingResourceStore = useLoadingResourceStore();
|
||||||
const simulationIdStore = useSimulationIdStore();
|
const simulationIdStore = useSimulationIdStore();
|
||||||
|
|
||||||
const { field, color, getDisasterIcon } = useHiddenPoint();
|
const { field, style, getDisasterIcon } = useHiddenPoint();
|
||||||
|
|
||||||
// 信息框相关配置
|
// 信息框相关配置
|
||||||
const offsetX = ref(0);
|
const offsetX = ref(0);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="flashFloodPointDetail as Record<string, any>"
|
:data="flashFloodPointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
:color="color"
|
:style="style"
|
||||||
v-if="loadingInformationStore.flashFloodHiddenPoint.loading"
|
v-if="loadingInformationStore.flashFloodHiddenPoint.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
const loadingResourceStore = useLoadingResourceStore();
|
const loadingResourceStore = useLoadingResourceStore();
|
||||||
const simulationIdStore = useSimulationIdStore();
|
const simulationIdStore = useSimulationIdStore();
|
||||||
|
|
||||||
const { field, color, getDisasterIcon } = useHiddenPoint();
|
const { field, style, getDisasterIcon } = useHiddenPoint();
|
||||||
|
|
||||||
// 信息框相关配置
|
// 信息框相关配置
|
||||||
const offsetX = ref(0);
|
const offsetX = ref(0);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="landslidePointDetail as Record<string, any>"
|
:data="landslidePointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
:color="color"
|
:style="style"
|
||||||
v-if="loadingInformationStore.landslideHiddenPoint.loading"
|
v-if="loadingInformationStore.landslideHiddenPoint.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
const loadingResourceStore = useLoadingResourceStore();
|
const loadingResourceStore = useLoadingResourceStore();
|
||||||
const simulationIdStore = useSimulationIdStore();
|
const simulationIdStore = useSimulationIdStore();
|
||||||
|
|
||||||
const { field, color, getDisasterIcon } = useHiddenPoint();
|
const { field, style, getDisasterIcon } = useHiddenPoint();
|
||||||
|
|
||||||
// 信息框相关配置
|
// 信息框相关配置
|
||||||
const offsetX = ref(0);
|
const offsetX = ref(0);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="riskPointDetail as Record<string, any>"
|
:data="riskPointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
:color="color"
|
:style="style"
|
||||||
v-if="loadingInformationStore.riskPoint.loading"
|
v-if="loadingInformationStore.riskPoint.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
const riskPointDetail = ref<Point>();
|
const riskPointDetail = ref<Point>();
|
||||||
|
|
||||||
// 获取钩子函数
|
// 获取钩子函数
|
||||||
const { informationBoxTitle, field, color, getDisasterIcon } = useRiskPoint();
|
const { informationBoxTitle, field, style, getDisasterIcon } = useRiskPoint();
|
||||||
|
|
||||||
$api.riskSpots.getBasePoints().then((res) => {
|
$api.riskSpots.getBasePoints().then((res) => {
|
||||||
riskPoints.value = res.data;
|
riskPoints.value = res.data;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="waterLoggingPointDetail as Record<string, any>"
|
:data="waterLoggingPointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
:color="color"
|
:style="style"
|
||||||
v-if="loadingInformationStore.waterLoggingHiddenPoint.loading"
|
v-if="loadingInformationStore.waterLoggingHiddenPoint.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
const loadingResourceStore = useLoadingResourceStore();
|
const loadingResourceStore = useLoadingResourceStore();
|
||||||
const simulationIdStore = useSimulationIdStore();
|
const simulationIdStore = useSimulationIdStore();
|
||||||
|
|
||||||
const { field, color, getDisasterIcon } = useHiddenPoint();
|
const { field, style, getDisasterIcon } = useHiddenPoint();
|
||||||
|
|
||||||
// 信息框相关配置
|
// 信息框相关配置
|
||||||
const offsetX = ref(0);
|
const offsetX = ref(0);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="storePointDetail as Record<string, any>"
|
:data="storePointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.bridge.loading"
|
v-if="loadingInformationStore.bridge.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="dangerousSourcePointDetail as Record<string, any>"
|
:data="dangerousSourcePointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.dangerousSource.loading"
|
v-if="loadingInformationStore.dangerousSource.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="emergencyShelterPointDetail as Record<string, any>"
|
:data="emergencyShelterPointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.emergencyShelter.loading"
|
v-if="loadingInformationStore.emergencyShelter.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="fireStationPointDetail as Record<string, any>"
|
:data="fireStationPointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.fireStation.loading"
|
v-if="loadingInformationStore.fireStation.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="hospitalPointDetail as Record<string, any>"
|
:data="hospitalPointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.hospital.loading"
|
v-if="loadingInformationStore.hospital.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="reservoirDetail as Record<string, any>"
|
:data="reservoirDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.reservoir.loading"
|
v-if="loadingInformationStore.reservoir.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="schoolDetail as Record<string, any>"
|
:data="schoolDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.school.loading"
|
v-if="loadingInformationStore.school.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="storePointDetail as Record<string, any>"
|
:data="storePointDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.storePoints.loading"
|
v-if="loadingInformationStore.storePoints.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<InformationBox
|
<InformationBox
|
||||||
:data="subwayStationDetail as Record<string, any>"
|
:data="subwayStationDetail as Record<string, any>"
|
||||||
:field="field"
|
:field="field"
|
||||||
|
:style="{}"
|
||||||
v-if="loadingInformationStore.subwayStation.loading"
|
v-if="loadingInformationStore.subwayStation.loading"
|
||||||
:title="informationBoxTitle"
|
:title="informationBoxTitle"
|
||||||
:offset-x="offsetX"
|
:offset-x="offsetX"
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ export const useHiddenPoint = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 颜色
|
* 样式
|
||||||
*/
|
*/
|
||||||
const color = {
|
const style = {
|
||||||
probability: 'red',
|
probability: { background: '#888888' },
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,5 +59,5 @@ export const useHiddenPoint = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { field, color, getDisasterIcon };
|
return { field, style, getDisasterIcon };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ export const useRiskPoint = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 颜色
|
* 样式
|
||||||
*/
|
*/
|
||||||
const color = {
|
const style = {
|
||||||
probability: 'red',
|
probability: { background: '#888888' },
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,5 +43,5 @@ export const useRiskPoint = () => {
|
|||||||
return riskAreaIcon;
|
return riskAreaIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { informationBoxTitle, field, color, getDisasterIcon };
|
return { informationBoxTitle, field, style, getDisasterIcon };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user