|
|
@@ -2,7 +2,7 @@
|
|
|
<div class="ignition-view manual-view">
|
|
|
<!-- 左:人工录入 -->
|
|
|
<ModuleCommon
|
|
|
- :show-style="panelShowStyle(23, 105, 335, 934)"
|
|
|
+ :show-style="panelShowStyle(20, 132, 353, 907)"
|
|
|
:module-data="EMPTY_MODULE_DATA"
|
|
|
module-name="人工录入"
|
|
|
device-type="ignition_manual_input"
|
|
|
@@ -11,10 +11,6 @@
|
|
|
>
|
|
|
<div class="manual-form">
|
|
|
<div class="form-toolbar">
|
|
|
- <div class="target-row">
|
|
|
- <span class="target-label">评价对象:</span>
|
|
|
- <PanelSelect v-model="manageSystemId" :options="sceneSelectOptions" @update:model-value="loadLatest" />
|
|
|
- </div>
|
|
|
<div class="eval-type-tabs">
|
|
|
<span :class="{ active: evalType === 1 }" @click="changeEvalType(1)">采前评价</span>
|
|
|
<span :class="{ active: evalType === 2 }" @click="changeEvalType(2)">采中评价</span>
|
|
|
@@ -66,7 +62,7 @@
|
|
|
|
|
|
<!-- 右:评价结果 -->
|
|
|
<ModuleCommon
|
|
|
- :show-style="panelShowStyle(1523, 105, 337, 934)"
|
|
|
+ :show-style="panelShowStyle(1545, 132, 353, 907)"
|
|
|
:module-data="EMPTY_MODULE_DATA"
|
|
|
module-name="评价结果"
|
|
|
device-type="ignition_evaluation_result"
|
|
|
@@ -116,99 +112,42 @@
|
|
|
<span>{{ item.colorName }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="suggestion-box">
|
|
|
- <span class="suggestion-icon"></span>
|
|
|
- <p>{{ resultSuggestion }}</p>
|
|
|
- </div>
|
|
|
-
|
|
|
- <button class="action-button report-button" :disabled="!hasEvaluation" @click="showReport = true">查看评价报告</button>
|
|
|
</div>
|
|
|
</ModuleCommon>
|
|
|
-
|
|
|
- <Transition name="ignition-fade">
|
|
|
- <div v-if="showReport" class="report-mask" @click.self="showReport = false">
|
|
|
- <div class="report-dialog">
|
|
|
- <div class="report-title">自然发火安全评价报告</div>
|
|
|
- <div class="report-body">
|
|
|
- <div class="report-row"
|
|
|
- ><span>评价对象</span><em>{{ resultTarget }}</em></div
|
|
|
- >
|
|
|
- <div class="report-row"
|
|
|
- ><span>评价类型</span><em>{{ evalTypeText }}</em></div
|
|
|
- >
|
|
|
- <div class="report-row"
|
|
|
- ><span>安全评价得分</span><em>{{ resultScore }}</em></div
|
|
|
- >
|
|
|
- <div class="report-row"
|
|
|
- ><span>风险等级</span><em :style="{ color: resultRiskColor }">{{ resultTagText }}</em></div
|
|
|
- >
|
|
|
- <div class="report-row"
|
|
|
- ><span>数据时间</span><em>{{ resultTime }}</em></div
|
|
|
- >
|
|
|
- <div class="report-row"><span>数据来源</span><em>人工录入</em></div>
|
|
|
- <div class="report-suggestion">
|
|
|
- <span class="suggestion-icon"></span>
|
|
|
- <p>{{ resultSuggestion }}</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <button class="action-button report-close" @click="showReport = false">关闭</button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Transition>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
- import { computed, onMounted, reactive, ref } from 'vue';
|
|
|
- import { useRoute } from 'vue-router';
|
|
|
+ import { computed, onMounted, reactive, ref, watch } from 'vue';
|
|
|
import ModuleCommon from '../../configurable/components/ModuleCommon.vue';
|
|
|
import PanelSelect from './PanelSelect.vue';
|
|
|
import { EMPTY_MODULE_DATA, panelShowStyle } from '../utils';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- import {
|
|
|
- calculateSafetyEvaluation,
|
|
|
- getSafetyEvaluationByScene,
|
|
|
- getSafetyItemOptions,
|
|
|
- getSafetySceneList,
|
|
|
- saveSafetyEvaluation,
|
|
|
- } from '../safetyEvaluation.api';
|
|
|
- import { EVAL_RISK_LEVELS, EVAL_RISK_MAP, FIELD_BY_CODE, FALLBACK_SAFETY_ITEMS, FALLBACK_SCENE } from '../evaluation.config';
|
|
|
- import type { SafetyEvaluationEntity, SafetyItem, SafetyScene } from '../evaluation.config';
|
|
|
-
|
|
|
- const route = useRoute();
|
|
|
+ import { calculateSafetyEvaluation, getSafetyEvaluationByScene, getSafetyItemOptions, saveSafetyEvaluation } from '../safetyEvaluation.api';
|
|
|
+ import { EVAL_RISK_LEVELS, EVAL_RISK_MAP, FIELD_BY_CODE, FALLBACK_SAFETY_ITEMS } from '../evaluation.config';
|
|
|
+ import type { SafetyEvaluationEntity, SafetyItem } from '../evaluation.config';
|
|
|
+
|
|
|
+ const props = defineProps<{
|
|
|
+ manageSystemId: string;
|
|
|
+ sceneName?: string;
|
|
|
+ }>();
|
|
|
const { createMessage } = useMessage();
|
|
|
|
|
|
const levels = EVAL_RISK_LEVELS;
|
|
|
const items = ref<SafetyItem[]>([]);
|
|
|
- const scenes = ref<SafetyScene[]>([]);
|
|
|
- const manageSystemId = ref('');
|
|
|
const evalType = ref(1);
|
|
|
const formValues = reactive<Record<string, string>>({});
|
|
|
const collapsed = reactive<Record<string, boolean>>({});
|
|
|
const evaluation = ref<SafetyEvaluationEntity | null>(null);
|
|
|
const loadingOptions = ref(false);
|
|
|
- const loadingScenes = ref(false);
|
|
|
const previewing = ref(false);
|
|
|
const submitting = ref(false);
|
|
|
- const showReport = ref(false);
|
|
|
|
|
|
const busy = computed(() => loadingOptions.value || previewing.value || submitting.value);
|
|
|
|
|
|
- const sceneSelectOptions = computed(() =>
|
|
|
- scenes.value.map((scene) => ({
|
|
|
- label: scene.systemname,
|
|
|
- value: scene.id,
|
|
|
- score: 0,
|
|
|
- }))
|
|
|
- );
|
|
|
-
|
|
|
- const selectedScene = computed(() => scenes.value.find((scene) => scene.id === manageSystemId.value));
|
|
|
-
|
|
|
const targetName = computed(() => {
|
|
|
- const scene = selectedScene.value;
|
|
|
- if (!scene) return '未选择评价对象';
|
|
|
- const name = scene.systemname;
|
|
|
+ const name = props.sceneName || '';
|
|
|
+ if (!name) return '未选择评价对象';
|
|
|
return name.endsWith('工作面') || name.endsWith('采空区') ? name : `${name}工作面`;
|
|
|
});
|
|
|
|
|
|
@@ -230,15 +169,12 @@
|
|
|
return groups.filter((group) => group.fields.length);
|
|
|
});
|
|
|
|
|
|
- const hasEvaluation = computed(() => !!evaluation.value);
|
|
|
const resultLevel = computed(() => evaluation.value?.riskLevel || '');
|
|
|
const resultLevelMeta = computed(() => EVAL_RISK_MAP[resultLevel.value] || null);
|
|
|
const resultRiskColor = computed(() => resultLevelMeta.value?.color || '#3df6ff');
|
|
|
const resultTagText = computed(() => resultLevel.value || '未评价');
|
|
|
const resultTarget = computed(() => evaluation.value?.workfaceName || targetName.value);
|
|
|
const resultTime = computed(() => evaluation.value?.createTime || '--');
|
|
|
- const resultSuggestion = computed(() => resultLevelMeta.value?.suggestion || '请完成左侧指标选择并提交评价。');
|
|
|
- const evalTypeText = computed(() => (evalType.value === 1 ? '采前评价' : '采中评价'));
|
|
|
|
|
|
const resultScore = computed(() => {
|
|
|
const value = evaluation.value?.totalScore;
|
|
|
@@ -306,28 +242,6 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- async function loadScenes() {
|
|
|
- loadingScenes.value = true;
|
|
|
- try {
|
|
|
- const res: any = await getSafetySceneList();
|
|
|
- const records = res?.records || res?.result?.records || [];
|
|
|
- const list: SafetyScene[] = records.map((record: any) => ({
|
|
|
- id: String(record.id ?? record.deviceID ?? ''),
|
|
|
- systemname: record.systemname || record.name || record.sysname || '未命名场景',
|
|
|
- }));
|
|
|
- scenes.value = list.length ? list : [{ ...FALLBACK_SCENE }];
|
|
|
- } catch {
|
|
|
- scenes.value = [{ ...FALLBACK_SCENE }];
|
|
|
- } finally {
|
|
|
- loadingScenes.value = false;
|
|
|
- const queryScene = (route.query.systemID || route.query.manageSystemId || route.query.sceneId) as string;
|
|
|
- if (queryScene && !scenes.value.some((scene) => scene.id === queryScene)) {
|
|
|
- scenes.value.unshift({ id: queryScene, systemname: '当前场景' });
|
|
|
- }
|
|
|
- manageSystemId.value = queryScene || scenes.value[0]?.id || '';
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
function applyEvaluation(entity: SafetyEvaluationEntity) {
|
|
|
if (!entity) return;
|
|
|
evaluation.value = {
|
|
|
@@ -345,11 +259,11 @@
|
|
|
|
|
|
async function loadLatest() {
|
|
|
evaluation.value = null;
|
|
|
- if (!manageSystemId.value) {
|
|
|
+ if (!props.manageSystemId) {
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
- const res: any = await getSafetyEvaluationByScene(manageSystemId.value);
|
|
|
+ const res: any = await getSafetyEvaluationByScene(props.manageSystemId);
|
|
|
const data = res?.result ?? res;
|
|
|
const entity = evalType.value === 2 ? data?.miningEval : data?.beforeEval;
|
|
|
if (entity) {
|
|
|
@@ -362,6 +276,14 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ watch(
|
|
|
+ () => props.manageSystemId,
|
|
|
+ () => {
|
|
|
+ evaluation.value = null;
|
|
|
+ loadLatest();
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
function changeEvalType(type: number) {
|
|
|
if (evalType.value === type) return;
|
|
|
evalType.value = type;
|
|
|
@@ -374,8 +296,8 @@
|
|
|
evalType: evalType.value,
|
|
|
workfaceName: targetName.value,
|
|
|
};
|
|
|
- if (manageSystemId.value) {
|
|
|
- payload.manageSystemId = manageSystemId.value;
|
|
|
+ if (props.manageSystemId) {
|
|
|
+ payload.manageSystemId = props.manageSystemId;
|
|
|
}
|
|
|
visibleItems.value.forEach((item) => {
|
|
|
const field = FIELD_BY_CODE[item.code];
|
|
|
@@ -435,7 +357,6 @@
|
|
|
|
|
|
onMounted(async () => {
|
|
|
await loadItems();
|
|
|
- await loadScenes();
|
|
|
await loadLatest();
|
|
|
});
|
|
|
</script>
|
|
|
@@ -689,16 +610,18 @@
|
|
|
.result-panel {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- gap: 10px;
|
|
|
+ justify-content: space-evenly;
|
|
|
height: 100%;
|
|
|
- padding: 8px 12px 12px;
|
|
|
+ padding: 10px 12px 14px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
.result-top {
|
|
|
+ display: flex;
|
|
|
flex: none;
|
|
|
- height: 165px;
|
|
|
- padding-top: 10px;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ height: 180px;
|
|
|
box-sizing: border-box;
|
|
|
background: url('@/assets/images/vent/home/selfIgnition/result-top-bg.png') no-repeat center / 100% 100%;
|
|
|
}
|
|
|
@@ -737,7 +660,7 @@
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
- margin-top: 16px;
|
|
|
+ margin-top: 26px;
|
|
|
padding: 0 18px;
|
|
|
}
|
|
|
|
|
|
@@ -784,8 +707,8 @@
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
- gap: 2px;
|
|
|
- padding: 10px 14px;
|
|
|
+ gap: 4px;
|
|
|
+ padding: 12px 16px;
|
|
|
border-left: 1px solid rgba(61, 246, 255, 0.16);
|
|
|
border-right: 1px solid rgba(61, 246, 255, 0.16);
|
|
|
background: rgba(7, 42, 70, 0.62);
|
|
|
@@ -795,7 +718,7 @@
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
- height: 38px;
|
|
|
+ height: 46px;
|
|
|
color: #fff;
|
|
|
font-size: 15px;
|
|
|
letter-spacing: 0.5px;
|
|
|
@@ -810,7 +733,6 @@
|
|
|
|
|
|
.level-table {
|
|
|
flex: none;
|
|
|
- padding-top: 2px;
|
|
|
}
|
|
|
|
|
|
.level-head,
|
|
|
@@ -821,7 +743,7 @@
|
|
|
}
|
|
|
|
|
|
.level-head {
|
|
|
- height: 34px;
|
|
|
+ height: 40px;
|
|
|
border: 1px solid rgba(61, 246, 255, 0.4);
|
|
|
border-radius: 4px;
|
|
|
color: #3df6ff;
|
|
|
@@ -843,7 +765,7 @@
|
|
|
|
|
|
.level-row {
|
|
|
position: relative;
|
|
|
- height: 38px;
|
|
|
+ height: 50px;
|
|
|
color: #e8f8ff;
|
|
|
font-size: 14px;
|
|
|
background: url('@/assets/images/vent/home/selfIgnition/result-row-glow.png') no-repeat center bottom / 100% 10px;
|
|
|
@@ -881,45 +803,6 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .suggestion-box {
|
|
|
- position: relative;
|
|
|
- flex: 1;
|
|
|
- min-height: 0;
|
|
|
- padding: 14px 16px 14px 34px;
|
|
|
- box-sizing: border-box;
|
|
|
- overflow-y: auto;
|
|
|
- border: 1px solid rgba(61, 246, 255, 0.4);
|
|
|
- background: url('@/assets/images/vent/home/selfIgnition/result-block-bg.png') no-repeat center / 100% 100%;
|
|
|
-
|
|
|
- &::-webkit-scrollbar {
|
|
|
- width: 4px;
|
|
|
- }
|
|
|
-
|
|
|
- &::-webkit-scrollbar-thumb {
|
|
|
- background: rgba(61, 246, 255, 0.35);
|
|
|
- border-radius: 2px;
|
|
|
- }
|
|
|
-
|
|
|
- p {
|
|
|
- margin: 0;
|
|
|
- color: #fff;
|
|
|
- font-size: 15px;
|
|
|
- line-height: 30px;
|
|
|
- letter-spacing: 0.5px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .suggestion-icon {
|
|
|
- position: absolute;
|
|
|
- left: 16px;
|
|
|
- top: 20px;
|
|
|
- width: 9px;
|
|
|
- height: 9px;
|
|
|
- background: #f5222d;
|
|
|
- box-shadow: 0 0 9px rgba(245, 34, 45, 0.85);
|
|
|
- transform: rotate(45deg);
|
|
|
- }
|
|
|
-
|
|
|
.action-button {
|
|
|
position: relative;
|
|
|
flex: none;
|
|
|
@@ -963,82 +846,4 @@
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .report-dialog {
|
|
|
- width: 540px;
|
|
|
- padding: 22px 26px 24px;
|
|
|
- box-sizing: border-box;
|
|
|
- border: 1px solid rgba(61, 246, 255, 0.75);
|
|
|
- background: linear-gradient(180deg, #0b3a5e 0%, #071d33 100%);
|
|
|
- box-shadow: 0 0 40px rgba(61, 246, 255, 0.35);
|
|
|
- }
|
|
|
-
|
|
|
- .report-title {
|
|
|
- padding-bottom: 14px;
|
|
|
- border-bottom: 1px solid rgba(61, 246, 255, 0.3);
|
|
|
- color: #3df6ff;
|
|
|
- font-family: 'douyuFont', sans-serif;
|
|
|
- font-size: 20px;
|
|
|
- letter-spacing: 2px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
-
|
|
|
- .report-body {
|
|
|
- padding: 16px 0;
|
|
|
- }
|
|
|
-
|
|
|
- .report-row {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- height: 36px;
|
|
|
- color: #cfefff;
|
|
|
- font-size: 14px;
|
|
|
-
|
|
|
- em {
|
|
|
- color: #fff;
|
|
|
- font-style: normal;
|
|
|
- font-size: 15px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .report-suggestion {
|
|
|
- position: relative;
|
|
|
- margin-top: 12px;
|
|
|
- padding: 14px 16px 14px 34px;
|
|
|
- border: 1px solid rgba(61, 246, 255, 0.3);
|
|
|
- background: rgba(7, 42, 70, 0.7);
|
|
|
-
|
|
|
- p {
|
|
|
- margin: 0;
|
|
|
- color: #fff;
|
|
|
- font-size: 14px;
|
|
|
- line-height: 26px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .report-close {
|
|
|
- margin-top: 4px;
|
|
|
- }
|
|
|
-
|
|
|
- .report-mask {
|
|
|
- position: absolute;
|
|
|
- inset: 0;
|
|
|
- z-index: 100;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- background: rgba(2, 10, 20, 0.72);
|
|
|
- backdrop-filter: blur(3px);
|
|
|
- }
|
|
|
-
|
|
|
- .ignition-fade-enter-active,
|
|
|
- .ignition-fade-leave-active {
|
|
|
- transition: opacity 0.2s ease;
|
|
|
- }
|
|
|
-
|
|
|
- .ignition-fade-enter-from,
|
|
|
- .ignition-fade-leave-to {
|
|
|
- opacity: 0;
|
|
|
- }
|
|
|
</style>
|