Merge branch 'master' of https://git.djxinxi.net/bestlee/MOC
# Conflicts: # src/service/api/role.ts # src/views/my/initiateChange/index.vue # src/views/systemManage/role/index.vue # src/views/systemManage/user/index.vue
This commit is contained in:
+688
-688
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,246 +1,246 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { CHANGES, TEMP_WATCH, countOpenStatus } from "@/typings/model";
|
||||
import { formatTimestamp } from "@/utils/common";
|
||||
import RingChart from './modules/ringChart.vue';
|
||||
import PieChart from './modules/pieChart.vue';
|
||||
import PieChart2 from './modules/pieChart2.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const P_PERIODS = ["近一年", "近半年", "近三个月", "近一个月", "自定义"] as const;
|
||||
const period = ref<(typeof P_PERIODS)[number]>("近一年");
|
||||
const from = ref<any>(null);
|
||||
const to = ref<any>(null);
|
||||
const rangeText = computed(() => period.value === "自定义"
|
||||
? (from.value || to.value ? `${formatTimestamp(from.value,'yyyy-MM-dd') || "开始"} ~ ${formatTimestamp(to.value,'yyyy-MM-dd') || "至今"}` : "自定义(未选日期)")
|
||||
: period.value);
|
||||
|
||||
const deptOpenStatus = countOpenStatus(CHANGES);
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "完全达到", value: 13 },
|
||||
{ name: "基本达到", value: 4 },
|
||||
{ name: "未达到", value: 2 },
|
||||
{ name: "处置关闭(未实施 / 未投用)", value: 3 },
|
||||
];
|
||||
const acceptTotal = DEPT_ACCEPT.reduce((a, b) => a + b.value, 0);
|
||||
const ACCEPT_COLORS = ["#7CC242", "#F5A623", "#E15555", "#94A3B8", "#64748B"];
|
||||
const DEPT_TYPE = [
|
||||
{ name: "工艺", value: 11 }, { name: "设备", value: 12 }, { name: "管理", value: 5 },
|
||||
];
|
||||
const DEPT_DUR = [
|
||||
{ name: "永久", value: 21 }, { name: "临时", value: 7 },
|
||||
];
|
||||
const DUR_COLORS = ["#1D4E9C", "#FAAD14"];
|
||||
const PIE_COLORS = ["#1D4E9C", "#7CC242", "#F5A623"];
|
||||
const APPROVER_TIME = [
|
||||
{ name: "李主任(部门审核)", days: 1.2 },
|
||||
{ name: "王仪表(仪表会签)", days: 0.8 },
|
||||
{ name: "周设备(设备会签)", days: 1.5 },
|
||||
{ name: "王海燕(安全审查)", days: 2.1 },
|
||||
{ name: "刘副总(公司终批)", days: 1.9 },
|
||||
];
|
||||
const openTotal = deptOpenStatus.reduce((a, b) => a + b.n, 0);
|
||||
const tempTotal = TEMP_WATCH.reduce((a, b) => a + b.n, 0);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 本部门变更统计 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center justify-between">
|
||||
<div class="flex-y-center">
|
||||
<span class="flex items-center gap-1.5 text-sm font-semibold text-slate-700">
|
||||
<Icon icon="akar-icons:calendar" class="size-14px" :style="{color: themeStore.themeColor}" />
|
||||
<span>本部门变更统计</span>
|
||||
<span class="text-xs font-normal text-slate-400">一车间 · 本部门口径</span>
|
||||
</span>
|
||||
<div class="flex flex-wrap items-center gap-1.5 min-h-28px">
|
||||
<span class="text-xs text-slate-400">时间段</span>
|
||||
<NButton size="tiny" round v-for="p in P_PERIODS" :key="p" @click="period = p"
|
||||
:ghost="period === p ? false : true"
|
||||
:type="period === p ? 'primary' : 'default'"
|
||||
>{{ p }}</NButton>
|
||||
<span v-if="period === '自定义'" class="flex items-center gap-1">
|
||||
<NDatePicker v-model:value="from" type="date" size="small" class="w-32" />
|
||||
<span class="text-xs text-slate-400">至</span>
|
||||
<NDatePicker v-model:value="to" type="date" size="small" class="w-32" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-[11px] text-slate-400">统计口径:{{ rangeText }}</span>
|
||||
</div>
|
||||
</NCard>
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid cols="s:1 m:5 l:5" responsive="screen" :x-gap="gap" :y-gap="16">
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">申请变更数量</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="28"
|
||||
class="text-26px font-600 text-[#333]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<p class="text-12px">永久 21 · 临时 7</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">重要变更数量</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="7"
|
||||
class="text-26px font-600 text-[#333]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<p class="text-12px">占比 25% · 均含公司终批</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">未关闭变更数量</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="6"
|
||||
class="text-26px font-600 text-[#E15555]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<p class="text-12px">其中超期 1 项 · 临期 1 项</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">平均审批通过时长</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="7.4"
|
||||
:decimals="1"
|
||||
class="text-26px font-600 text-[#333]"
|
||||
/>
|
||||
<p class="mt-10px ml-5px">天</p>
|
||||
</div>
|
||||
<p class="text-12px">优于全厂均值 8.2 天</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">申请驳回率</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="6.1"
|
||||
:decimals="1"
|
||||
class="text-26px font-600 text-[#333]"
|
||||
/><p class="mt-10px ml-5px">%</p>
|
||||
</div>
|
||||
<p class="text-12px">2 项被驳回 · 均已重新提交</p>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:6">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 pb-3 mb-4">尚未关闭的变更所处的状态数量(共 {{openTotal}} 项)</p>
|
||||
<div class="space-y-3">
|
||||
<div v-for="s in deptOpenStatus" :key="s.name">
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
<span class="min-w-0 flex-1 text-slate-700">{{ s.name }}</span>
|
||||
<span class="shrink-0 font-semibold text-slate-600">{{ s.n }} 项</span>
|
||||
</div>
|
||||
<div class="mt-1 h-1.5 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full" :style="{ width: `${openTotal ? (s.n / openTotal) * 100 : 0}%`, background: s.c }" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">阶段口径:审批中(含会签)→ 已批准待投用 → 待验收 → 待关闭 · 培训 / PSSR 线下签字后拍照上传,并入资料归档 · 明细见变更台账</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:18">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 pb-3 mb-4">验收达标 · 变更类型 · 变更时限分布</p>
|
||||
<div class="grid gap-4 grid-cols-3">
|
||||
<div>
|
||||
<div class="mb-1 text-center text-xs font-semibold text-slate-600">验收达标分布(共 {{ acceptTotal }} 项 · 处置关闭单列)</div>
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-1 text-center text-xs font-semibold text-slate-600">变更类型分布</div>
|
||||
<PieChart :data="DEPT_TYPE" :colors="PIE_COLORS" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-1 text-center text-xs font-semibold text-slate-600">变更时限分布</div>
|
||||
<PieChart2 :data="DEPT_DUR" :colors="DUR_COLORS" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 rounded-lg bg-slate-50 px-3 py-2 text-[11px] leading-5 text-slate-500">
|
||||
未达到 2 项:P-204 伴热改造温控未达预期(已退回整改)、加药泵冲程调整流量偏差(重新约定 30 天验证期);处置关闭 3 项:未实施 2 项(检修窗口调整、方案合并实施)、未投用 1 项(投用条件不具备),均经情况说明后关闭,验收结论不再含未实施 / 未投用。
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 pb-3 mb-4">各人员审批时间对比(平均处理时长)</p>
|
||||
<div class="space-y-3">
|
||||
<div v-for="a in APPROVER_TIME" :key="a.name">
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
<span class="min-w-0 flex-1 text-slate-700">{{ a.name }}</span>
|
||||
<span class="shrink-0 font-semibold text-slate-600">{{ a.days }} 天</span>
|
||||
</div>
|
||||
<div class="mt-1 h-1.5 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full" :style="{ width: `${(a.days / 2.5) * 100}%`, background: a.days > 2 ? '#E15555' : '#1D4E9C' }" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">超过 2 天红色标识 · 用于会签催办与流程优化参考</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 pb-3 mb-4">临时变更到期提醒情况(共 {{tempTotal}} 项)</p>
|
||||
<div class="space-y-3">
|
||||
<div v-for="t in TEMP_WATCH" :key="t.label" class="rounded-lg border px-3 py-2">
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
<span class="h-2 w-2 rounded-full" :style="{ background: t.c }" />
|
||||
<span class="font-medium text-slate-700">{{ t.label }}</span>
|
||||
<span class="ml-auto font-semibold text-slate-600">{{ t.n }} 项</span>
|
||||
</div>
|
||||
<div class="mt-1 pl-4 text-[11px] text-slate-400">{{ t.note }}</div>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">提醒规则:到期前 7 天触发(可在「待我处理 · 我的申请」中调整)· 临期 / 超期项请按期办理延期、恢复或转永久</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { CHANGES, TEMP_WATCH, countOpenStatus } from "@/typings/model";
|
||||
import { formatTimestamp } from "@/utils/common";
|
||||
import RingChart from './modules/ringChart.vue';
|
||||
import PieChart from './modules/pieChart.vue';
|
||||
import PieChart2 from './modules/pieChart2.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const P_PERIODS = ["近一年", "近半年", "近三个月", "近一个月", "自定义"] as const;
|
||||
const period = ref<(typeof P_PERIODS)[number]>("近一年");
|
||||
const from = ref<any>(null);
|
||||
const to = ref<any>(null);
|
||||
const rangeText = computed(() => period.value === "自定义"
|
||||
? (from.value || to.value ? `${formatTimestamp(from.value,'yyyy-MM-dd') || "开始"} ~ ${formatTimestamp(to.value,'yyyy-MM-dd') || "至今"}` : "自定义(未选日期)")
|
||||
: period.value);
|
||||
|
||||
const deptOpenStatus = countOpenStatus(CHANGES);
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "完全达到", value: 13 },
|
||||
{ name: "基本达到", value: 4 },
|
||||
{ name: "未达到", value: 2 },
|
||||
{ name: "处置关闭(未实施 / 未投用)", value: 3 },
|
||||
];
|
||||
const acceptTotal = DEPT_ACCEPT.reduce((a, b) => a + b.value, 0);
|
||||
const ACCEPT_COLORS = ["#7CC242", "#F5A623", "#E15555", "#94A3B8", "#64748B"];
|
||||
const DEPT_TYPE = [
|
||||
{ name: "工艺", value: 11 }, { name: "设备", value: 12 }, { name: "管理", value: 5 },
|
||||
];
|
||||
const DEPT_DUR = [
|
||||
{ name: "永久", value: 21 }, { name: "临时", value: 7 },
|
||||
];
|
||||
const DUR_COLORS = ["#1D4E9C", "#FAAD14"];
|
||||
const PIE_COLORS = ["#1D4E9C", "#7CC242", "#F5A623"];
|
||||
const APPROVER_TIME = [
|
||||
{ name: "李主任(部门审核)", days: 1.2 },
|
||||
{ name: "王仪表(仪表会签)", days: 0.8 },
|
||||
{ name: "周设备(设备会签)", days: 1.5 },
|
||||
{ name: "王海燕(安全审查)", days: 2.1 },
|
||||
{ name: "刘副总(公司终批)", days: 1.9 },
|
||||
];
|
||||
const openTotal = deptOpenStatus.reduce((a, b) => a + b.n, 0);
|
||||
const tempTotal = TEMP_WATCH.reduce((a, b) => a + b.n, 0);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 本部门变更统计 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center justify-between">
|
||||
<div class="flex-y-center">
|
||||
<span class="flex items-center gap-1.5 text-sm font-semibold text-slate-700">
|
||||
<Icon icon="akar-icons:calendar" class="size-14px" :style="{color: themeStore.themeColor}" />
|
||||
<span>本部门变更统计</span>
|
||||
<span class="text-xs font-normal text-slate-400">一车间 · 本部门口径</span>
|
||||
</span>
|
||||
<div class="flex flex-wrap items-center gap-1.5 min-h-28px">
|
||||
<span class="text-xs text-slate-400">时间段</span>
|
||||
<NButton size="tiny" round v-for="p in P_PERIODS" :key="p" @click="period = p"
|
||||
:ghost="period === p ? false : true"
|
||||
:type="period === p ? 'primary' : 'default'"
|
||||
>{{ p }}</NButton>
|
||||
<span v-if="period === '自定义'" class="flex items-center gap-1">
|
||||
<NDatePicker v-model:value="from" type="date" size="small" class="w-32" />
|
||||
<span class="text-xs text-slate-400">至</span>
|
||||
<NDatePicker v-model:value="to" type="date" size="small" class="w-32" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-[11px] text-slate-400">统计口径:{{ rangeText }}</span>
|
||||
</div>
|
||||
</NCard>
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid cols="s:1 m:5 l:5" responsive="screen" :x-gap="gap" :y-gap="16">
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">申请变更数量</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="28"
|
||||
class="text-26px font-600 text-[#333]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<p class="text-12px">永久 21 · 临时 7</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">重要变更数量</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="7"
|
||||
class="text-26px font-600 text-[#333]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<p class="text-12px">占比 25% · 均含公司终批</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">未关闭变更数量</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="6"
|
||||
class="text-26px font-600 text-[#E15555]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<p class="text-12px">其中超期 1 项 · 临期 1 项</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">平均审批通过时长</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="7.4"
|
||||
:decimals="1"
|
||||
class="text-26px font-600 text-[#333]"
|
||||
/>
|
||||
<p class="mt-10px ml-5px">天</p>
|
||||
</div>
|
||||
<p class="text-12px">优于全厂均值 8.2 天</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<p class="text-12px font-600">申请驳回率</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="6.1"
|
||||
:decimals="1"
|
||||
class="text-26px font-600 text-[#333]"
|
||||
/><p class="mt-10px ml-5px">%</p>
|
||||
</div>
|
||||
<p class="text-12px">2 项被驳回 · 均已重新提交</p>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:6">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 pb-3 mb-4">尚未关闭的变更所处的状态数量(共 {{openTotal}} 项)</p>
|
||||
<div class="space-y-3">
|
||||
<div v-for="s in deptOpenStatus" :key="s.name">
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
<span class="min-w-0 flex-1 text-slate-700">{{ s.name }}</span>
|
||||
<span class="shrink-0 font-semibold text-slate-600">{{ s.n }} 项</span>
|
||||
</div>
|
||||
<div class="mt-1 h-1.5 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full" :style="{ width: `${openTotal ? (s.n / openTotal) * 100 : 0}%`, background: s.c }" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">阶段口径:审批中(含会签)→ 已批准待投用 → 待验收 → 待关闭 · 培训 / PSSR 线下签字后拍照上传,并入资料归档 · 明细见变更台账</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:18">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 pb-3 mb-4">验收达标 · 变更类型 · 变更时限分布</p>
|
||||
<div class="grid gap-4 grid-cols-3">
|
||||
<div>
|
||||
<div class="mb-1 text-center text-xs font-semibold text-slate-600">验收达标分布(共 {{ acceptTotal }} 项 · 处置关闭单列)</div>
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-1 text-center text-xs font-semibold text-slate-600">变更类型分布</div>
|
||||
<PieChart :data="DEPT_TYPE" :colors="PIE_COLORS" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-1 text-center text-xs font-semibold text-slate-600">变更时限分布</div>
|
||||
<PieChart2 :data="DEPT_DUR" :colors="DUR_COLORS" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 rounded-lg bg-slate-50 px-3 py-2 text-[11px] leading-5 text-slate-500">
|
||||
未达到 2 项:P-204 伴热改造温控未达预期(已退回整改)、加药泵冲程调整流量偏差(重新约定 30 天验证期);处置关闭 3 项:未实施 2 项(检修窗口调整、方案合并实施)、未投用 1 项(投用条件不具备),均经情况说明后关闭,验收结论不再含未实施 / 未投用。
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 pb-3 mb-4">各人员审批时间对比(平均处理时长)</p>
|
||||
<div class="space-y-3">
|
||||
<div v-for="a in APPROVER_TIME" :key="a.name">
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
<span class="min-w-0 flex-1 text-slate-700">{{ a.name }}</span>
|
||||
<span class="shrink-0 font-semibold text-slate-600">{{ a.days }} 天</span>
|
||||
</div>
|
||||
<div class="mt-1 h-1.5 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full" :style="{ width: `${(a.days / 2.5) * 100}%`, background: a.days > 2 ? '#E15555' : '#1D4E9C' }" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">超过 2 天红色标识 · 用于会签催办与流程优化参考</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 pb-3 mb-4">临时变更到期提醒情况(共 {{tempTotal}} 项)</p>
|
||||
<div class="space-y-3">
|
||||
<div v-for="t in TEMP_WATCH" :key="t.label" class="rounded-lg border px-3 py-2">
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
<span class="h-2 w-2 rounded-full" :style="{ background: t.c }" />
|
||||
<span class="font-medium text-slate-700">{{ t.label }}</span>
|
||||
<span class="ml-auto font-semibold text-slate-600">{{ t.n }} 项</span>
|
||||
</div>
|
||||
<div class="mt-1 pl-4 text-[11px] text-slate-400">{{ t.note }}</div>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">提醒规则:到期前 7 天触发(可在「待我处理 · 我的申请」中调整)· 临期 / 超期项请按期办理延期、恢复或转永久</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'PieChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data?: { name: string; value: number }[]; colors?: string[] }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
bottom: 3,
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
color: ['#5da8ff', '#8e9dff', '#fedc69', '#26deca'],
|
||||
radius: '65%',
|
||||
center: ['50%', '43%'],
|
||||
label: {
|
||||
show: false,
|
||||
position: 'outside',
|
||||
formatter: '{b}\n{c} ({d}%)',
|
||||
fontSize: 12,
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 10,
|
||||
length2: 10
|
||||
},
|
||||
data: [] as { name: string; value: number }[]
|
||||
}
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
opts.series[0].data = props.data || [];
|
||||
opts.series[0].color = props.colors || [];
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'PieChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data?: { name: string; value: number }[]; colors?: string[] }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
bottom: 3,
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
color: ['#5da8ff', '#8e9dff', '#fedc69', '#26deca'],
|
||||
radius: '65%',
|
||||
center: ['50%', '43%'],
|
||||
label: {
|
||||
show: false,
|
||||
position: 'outside',
|
||||
formatter: '{b}\n{c} ({d}%)',
|
||||
fontSize: 12,
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 10,
|
||||
length2: 10
|
||||
},
|
||||
data: [] as { name: string; value: number }[]
|
||||
}
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
opts.series[0].data = props.data || [];
|
||||
opts.series[0].color = props.colors || [];
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'PieChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data?: { name: string; value: number }[]; colors?: string[] }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
bottom: 3,
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
color: ['#5da8ff', '#8e9dff', '#fedc69', '#26deca'],
|
||||
radius: '65%',
|
||||
center: ['50%', '43%'],
|
||||
label: {
|
||||
show: false,
|
||||
position: 'outside',
|
||||
formatter: '{b}\n{c} ({d}%)',
|
||||
fontSize: 12,
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 10,
|
||||
length2: 10
|
||||
},
|
||||
data: [] as { name: string; value: number }[]
|
||||
}
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
opts.series[0].data = props.data || [];
|
||||
opts.series[0].color = props.colors || [];
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'PieChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data?: { name: string; value: number }[]; colors?: string[] }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
bottom: 3,
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
color: ['#5da8ff', '#8e9dff', '#fedc69', '#26deca'],
|
||||
radius: '65%',
|
||||
center: ['50%', '43%'],
|
||||
label: {
|
||||
show: false,
|
||||
position: 'outside',
|
||||
formatter: '{b}\n{c} ({d}%)',
|
||||
fontSize: 12,
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 10,
|
||||
length2: 10
|
||||
},
|
||||
data: [] as { name: string; value: number }[]
|
||||
}
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
opts.series[0].data = props.data || [];
|
||||
opts.series[0].color = props.colors || [];
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
+236
-236
@@ -1,236 +1,236 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const keyword = ref<string>('');
|
||||
const uploadFiles = () => {
|
||||
window.$message?.success('演示:上传资料(限资料管理员 / 各专业专责维护;上传后进入受控评审,发布生效并生成新版本号,全程留痕)')
|
||||
}
|
||||
const KNOWLEDGE_DOCS = [
|
||||
{ name: "PID-R201-03 反应釜工艺流程图(Rev C)", cat: "工艺技术资料", device: "一车间", ver: "Rev C", date: "2026-07-29" },
|
||||
{ name: "聚合岗位操作规程(2026 版)", cat: "工艺技术资料", device: "一车间", ver: "V2026", date: "2026-07-26" },
|
||||
{ name: "M-201A 搅拌电机设备台账", cat: "设备资料", device: "一车间", ver: "V3.2", date: "2026-07-28" },
|
||||
{ name: "环己烷 MSDS(供应商 B)", cat: "化学品资料", device: "原料罐区", ver: "V1.0", date: "2026-07-18" },
|
||||
{ name: "AQ/T 3034 化工企业工艺安全管理实施导则", cat: "法规标准库", device: "全厂", ver: "2013 版", date: "2025-12-01" },
|
||||
{ name: "PSSR 检查表模板(设备类)", cat: "检查表模板库", device: "全厂", ver: "V2.1", date: "2026-05-10" },
|
||||
{ name: "2025 年度典型变更案例汇编", cat: "历史变更案例库", device: "全厂", ver: "2025 版", date: "2026-01-15" },
|
||||
{ name: "HAZOP 分析报告(R-101 温度变更)", cat: "历史变更案例库", device: "一车间", ver: "V1.0", date: "2026-07-26" },
|
||||
];
|
||||
const libHits = computed(() => (keyword.value ? KNOWLEDGE_DOCS.filter((d:any) => d.name.includes(keyword.value) || d.cat.includes(keyword.value)) : []));
|
||||
const preview = (d:any) => {
|
||||
window.$message?.info(`演示:在线预览 ${d.name}`)
|
||||
}
|
||||
const download = (d:any) => {
|
||||
window.$message?.success(`演示:下载 ${d.name}`)
|
||||
}
|
||||
const call = (d:any) => {
|
||||
window.$message?.success(`演示:已将「${d.name}」调用为当前变更的 AI 知识来源(调用记录留痕)`)
|
||||
}
|
||||
interface LibDoc { name: string; ver: string; date: string }
|
||||
interface LibFolder { label: string; docs: LibDoc[] }
|
||||
interface LibGroup { cat: string; folders: LibFolder[] }
|
||||
const LIB_ORGS: { org: string; groups: LibGroup[] }[] = [
|
||||
{ org: "一车间", groups: [
|
||||
{ cat: "工艺", folders: [
|
||||
{ label: "操作规程", docs: [
|
||||
{ name: "聚合岗位操作规程(2026 版)", ver: "V2026", date: "2026-07-26" },
|
||||
{ name: "干燥岗位操作规程(2026 版)", ver: "V2026", date: "2026-06-30" } ]},
|
||||
{ label: "PID 图纸", docs: [
|
||||
{ name: "PID-R201-03 反应釜工艺流程图(Rev C)", ver: "Rev C", date: "2026-07-29" },
|
||||
{ name: "PID-V102-01 罐区工艺流程图(Rev B)", ver: "Rev B", date: "2026-05-12" } ]},
|
||||
{ label: "工艺卡片", docs: [
|
||||
{ name: "R-201 反应釜工艺卡片(夏季工况)", ver: "V2.0", date: "2026-07-01" } ]},
|
||||
]},
|
||||
{ cat: "设备", folders: [
|
||||
{ label: "设备台账", docs: [
|
||||
{ name: "M-201A 搅拌电机设备台账", ver: "V3.2", date: "2026-07-28" },
|
||||
{ name: "P-204 输送泵设备台账", ver: "V2.8", date: "2026-06-15" } ]},
|
||||
{ label: "安全阀台账", docs: [
|
||||
{ name: "一车间安全阀台账(PSV-101 ~ PSV-118)", ver: "V5.1", date: "2026-07-10" } ]},
|
||||
]},
|
||||
{ cat: "仪表", folders: [
|
||||
{ label: "报警台账", docs: [
|
||||
{ name: "一车间 DCS 报警台账(2026H1)", ver: "V4.0", date: "2026-07-20" } ]},
|
||||
{ label: "联锁台账", docs: [
|
||||
{ name: "一车间联锁逻辑台账(SIS-01 ~ SIS-09)", ver: "V3.6", date: "2026-07-22" } ]},
|
||||
]},
|
||||
{ cat: "安全", folders: [
|
||||
{ label: "总图", docs: [{ name: "一车间装置总平面布置图", ver: "Rev D", date: "2026-04-18" } ]},
|
||||
{ label: "现场气体报警仪布置图", docs: [{ name: "一车间可燃 / 有毒气体报警仪布置图", ver: "Rev B", date: "2026-05-28" } ]},
|
||||
{ label: "防爆分区图", docs: [{ name: "一车间爆炸危险区域划分图", ver: "Rev C", date: "2026-03-15" } ]},
|
||||
]},
|
||||
]},
|
||||
{ org: "二车间", groups: [
|
||||
{ cat: "工艺", folders: [
|
||||
{ label: "操作规程", docs: [{ name: "二车间精馏岗位操作规程(2026 版)", ver: "V2026", date: "2026-06-20" } ]},
|
||||
{ label: "PID 图纸", docs: [{ name: "PID-T301-02 精馏塔工艺流程图(Rev A)", ver: "Rev A", date: "2026-03-08" } ]},
|
||||
]},
|
||||
{ cat: "设备", folders: [
|
||||
{ label: "设备台账", docs: [{ name: "P-103 冷冻盐水泵设备台账", ver: "V2.2", date: "2026-05-30" } ]},
|
||||
{ label: "安全阀台账", docs: [{ name: "二车间安全阀台账(PSV-201 ~ PSV-212)", ver: "V4.3", date: "2026-06-11" } ]},
|
||||
]},
|
||||
{ cat: "仪表", folders: [
|
||||
{ label: "报警台账", docs: [{ name: "二车间 DCS 报警台账(2026H1)", ver: "V3.5", date: "2026-07-02" } ]},
|
||||
{ label: "联锁台账", docs: [{ name: "二车间联锁逻辑台账(SIS-11 ~ SIS-16)", ver: "V2.9", date: "2026-06-25" } ]},
|
||||
]},
|
||||
{ cat: "安全", folders: [
|
||||
{ label: "总图", docs: [{ name: "二车间装置总平面布置图", ver: "Rev B", date: "2026-02-14" } ]},
|
||||
{ label: "现场气体报警仪布置图", docs: [{ name: "二车间可燃 / 有毒气体报警仪布置图", ver: "Rev A", date: "2026-04-02" } ]},
|
||||
{ label: "防爆分区图", docs: [{ name: "二车间爆炸危险区域划分图", ver: "Rev B", date: "2026-01-20" } ]},
|
||||
]},
|
||||
]},
|
||||
{ org: "全厂共用", groups: [
|
||||
{ cat: "法规", folders: [
|
||||
{ label: "法规标准库", docs: [{ name: "AQ/T 3034 化工企业工艺安全管理实施导则", ver: "2013 版", date: "2025-12-01" } ]},
|
||||
]},
|
||||
{ cat: "化学品", folders: [
|
||||
{ label: "MSDS", docs: [{ name: "环己烷 MSDS(供应商 B)", ver: "V1.0", date: "2026-07-18" } ]},
|
||||
]},
|
||||
{ cat: "模板", folders: [
|
||||
{ label: "检查表模板", docs: [{ name: "PSSR 检查表模板(设备类)", ver: "V2.1", date: "2026-05-10" } ]},
|
||||
]},
|
||||
{ cat: "案例", folders: [
|
||||
{ label: "历史变更案例", docs: [
|
||||
{ name: "2025 年度典型变更案例汇编", ver: "2025 版", date: "2026-01-15" },
|
||||
{ name: "HAZOP 分析报告(R-101 温度变更)", ver: "V1.0", date: "2026-07-26" } ]},
|
||||
]},
|
||||
]},
|
||||
];
|
||||
const openOrgs = ref<Record<string, boolean>>({ 一车间: true });
|
||||
const libSel = ref({ org: "一车间", cat: "工艺", label: "操作规程" });
|
||||
const libCur = computed(() => LIB_ORGS.find((o) => o.org === libSel.value.org)?.groups.find((g) => g.cat === libSel.value.cat)?.folders.find((f) => f.label === libSel.value.label));
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 我的草稿箱 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive class="pb-[12px] border-b">
|
||||
<NGi span="24 s:24 m:16">
|
||||
<div class="h-100% flex items-center gap-2">
|
||||
<Icon icon="mage:book" class="size-20px" :style="{ color: themeStore.themeColor }" />
|
||||
<p class="text-base font-semibold">资料档案库(按组织 / 专业类别建立文件夹 · AI 判定的知识来源)</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:8" class="flex items-center justify-end gap-12px">
|
||||
<div class="flex items-center gap-2">
|
||||
<NInput v-model:value="keyword" size="small" type="text" class="w-40 text-xs" placeholder="全文检索…">
|
||||
<template #suffix>
|
||||
<Icon icon="akar-icons:search" class="size-14px text-slate-400 cursor-pointer" />
|
||||
</template>
|
||||
</NInput>
|
||||
<NButton size="small" type="primary" class="text-xs" @click="uploadFiles">
|
||||
<Icon icon="material-symbols:upload" class="size-16px" /> 上传资料
|
||||
</NButton>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<div class="mt-4 mb-2 rounded-lg bg-slate-50 px-3 py-1.5 text-[11px] text-slate-400">
|
||||
按「组织 → 专业类别 → 资料文件夹」归档具体资料(操作规程 / PID 图纸 / 工艺卡片 / 设备台账 / 安全阀台账 / 报警台账 / 联锁台账 / 总图 / 现场气体报警仪布置图 / 防爆分区图等);资料由指定维护人(资料管理员 / 各专业专责)上传维护,版本受控;「调用」可将资料引用为当前变更的 AI 知识来源,调用记录留痕。
|
||||
</div>
|
||||
<!-- 全文检索:跨文件夹平铺结果 -->
|
||||
<div v-if="keyword">
|
||||
<div class="mb-1.5 text-xs text-slate-400">全文检索「{{ keyword }}」:跨全部文件夹命中 {{ libHits.length }} 份</div>
|
||||
<div class="divide-y rounded-lg border bg-white">
|
||||
<div v-for="d in libHits" :key="d.name" class="flex flex-wrap items-center gap-3 px-2 py-2.5">
|
||||
<FileText class="h-4 w-4 shrink-0 text-slate-400" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="truncate text-sm">{{ d.name }}</div>
|
||||
<div class="mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-slate-500">
|
||||
<span>{{ d.cat }} · {{ d.device }}</span>
|
||||
<span>更新 {{ d.date }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex shrink-0 gap-3 text-xs">
|
||||
<button class="text-[#1D4E9C] hover:underline" @click="preview(d)">查看</button>
|
||||
<button class="text-[#1D4E9C] hover:underline" @click="download(d)">下载</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="libHits.length === 0" class="py-6 text-center text-xs text-slate-400">未找到匹配「{{ keyword }}」的资料</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件夹树 + 当前文件夹资料 -->
|
||||
<div v-else class="flex gap-3">
|
||||
<div class="shrink-0 space-y-2 w-56 scroll-left">
|
||||
<div v-for="o in LIB_ORGS" :key="o.org" class="overflow-hidden rounded-lg border bg-white">
|
||||
<button class="flex w-full items-center gap-1.5 px-2.5 py-2 text-xs font-semibold text-slate-700 hover:bg-slate-50 bg-transparent"
|
||||
@click="openOrgs[o.org] = !openOrgs[o.org]">
|
||||
<Icon icon="formkit:right" class="size-14px transition-transform" :class="openOrgs[o.org] ? 'rotate-90' : ''" />
|
||||
<Icon v-if="openOrgs[o.org]" icon="quill:folder-open" class="size-14px" :style="{ color: themeStore.themeColor }" />
|
||||
<Icon v-else icon="material-symbols:folder-outline" class="size-14px text-slate-400" />
|
||||
{{ o.org }}
|
||||
</button>
|
||||
<template v-if="openOrgs[o.org]">
|
||||
<div v-for="g in o.groups" :key="g.cat" class="border-t px-2 py-1.5">
|
||||
<div class="px-1 pb-0.5 text-[10px] font-medium tracking-wide text-slate-400">{{ g.cat }}专业</div>
|
||||
<button v-for="f in g.folders" :key="f.label"
|
||||
@click="libSel = { org: o.org, cat: g.cat, label: f.label }"
|
||||
class="flex w-full items-center gap-1.5 rounded px-2 py-1 text-left text-xs transition"
|
||||
:class="libSel.org === o.org && libSel.cat === g.cat && libSel.label === f.label ? 'bg-[var(--theme-color)] font-medium text-white' : 'text-slate-600 hover:bg-slate-100 bg-transparent'"
|
||||
:style="{ '--theme-color': themeStore.themeColor }"
|
||||
>
|
||||
<Icon icon="material-symbols:folder-outline" class="size-14px text-slate-400" />
|
||||
<span class="min-w-0 flex-1 truncate">{{ f.label }}</span>
|
||||
<span class="text-[10px]" :class="libSel.label === f.label && libSel.cat === g.cat && libSel.org === o.org ? 'text-white/70' : 'text-slate-300'">{{ f.docs.length }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="mb-1.5 flex flex-wrap items-center gap-1 text-xs text-slate-400">
|
||||
当前位置:{{ libSel.org }}
|
||||
<Icon icon="formkit:right" class="size-12px" />
|
||||
{{ libSel.cat }}专业
|
||||
<Icon icon="formkit:right" class="size-12px" />
|
||||
<span class="font-medium text-slate-600">{{ libSel.label }}</span>
|
||||
<span class="ml-auto">共 {{ libCur?.docs.length ?? 0 }} 份 · 版本受控</span>
|
||||
</div>
|
||||
<div class="scroll-right">
|
||||
<div class="divide-y rounded-lg border bg-white">
|
||||
<div v-for="d in libCur?.docs ?? []" :key="d.name" class="flex flex-wrap items-center gap-3 px-2 py-2.5">
|
||||
<Icon icon="akar-icons:file" class="size-16px" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="truncate text-sm">{{ d.name }}</div>
|
||||
<div class="mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-slate-500">
|
||||
<NTag size="small" type="info" class="text-[10px]">版本 {{ d.ver }}</NTag>
|
||||
<span>更新 {{ d.date }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex shrink-0 gap-3 text-xs">
|
||||
<NButton type="primary" text class="hover:underline text-xs" @click="preview(d)">查看</NButton>
|
||||
<NButton type="primary" text class="hover:underline text-xs" @click="download(d)">下载</NButton>
|
||||
<NButton type="primary" text class="hover:underline text-xs" @click="call(d)">调用</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll-left {
|
||||
height: calc(100vh - 260px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.scroll-right {
|
||||
height: calc(100vh - 280px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const keyword = ref<string>('');
|
||||
const uploadFiles = () => {
|
||||
window.$message?.success('演示:上传资料(限资料管理员 / 各专业专责维护;上传后进入受控评审,发布生效并生成新版本号,全程留痕)')
|
||||
}
|
||||
const KNOWLEDGE_DOCS = [
|
||||
{ name: "PID-R201-03 反应釜工艺流程图(Rev C)", cat: "工艺技术资料", device: "一车间", ver: "Rev C", date: "2026-07-29" },
|
||||
{ name: "聚合岗位操作规程(2026 版)", cat: "工艺技术资料", device: "一车间", ver: "V2026", date: "2026-07-26" },
|
||||
{ name: "M-201A 搅拌电机设备台账", cat: "设备资料", device: "一车间", ver: "V3.2", date: "2026-07-28" },
|
||||
{ name: "环己烷 MSDS(供应商 B)", cat: "化学品资料", device: "原料罐区", ver: "V1.0", date: "2026-07-18" },
|
||||
{ name: "AQ/T 3034 化工企业工艺安全管理实施导则", cat: "法规标准库", device: "全厂", ver: "2013 版", date: "2025-12-01" },
|
||||
{ name: "PSSR 检查表模板(设备类)", cat: "检查表模板库", device: "全厂", ver: "V2.1", date: "2026-05-10" },
|
||||
{ name: "2025 年度典型变更案例汇编", cat: "历史变更案例库", device: "全厂", ver: "2025 版", date: "2026-01-15" },
|
||||
{ name: "HAZOP 分析报告(R-101 温度变更)", cat: "历史变更案例库", device: "一车间", ver: "V1.0", date: "2026-07-26" },
|
||||
];
|
||||
const libHits = computed(() => (keyword.value ? KNOWLEDGE_DOCS.filter((d:any) => d.name.includes(keyword.value) || d.cat.includes(keyword.value)) : []));
|
||||
const preview = (d:any) => {
|
||||
window.$message?.info(`演示:在线预览 ${d.name}`)
|
||||
}
|
||||
const download = (d:any) => {
|
||||
window.$message?.success(`演示:下载 ${d.name}`)
|
||||
}
|
||||
const call = (d:any) => {
|
||||
window.$message?.success(`演示:已将「${d.name}」调用为当前变更的 AI 知识来源(调用记录留痕)`)
|
||||
}
|
||||
interface LibDoc { name: string; ver: string; date: string }
|
||||
interface LibFolder { label: string; docs: LibDoc[] }
|
||||
interface LibGroup { cat: string; folders: LibFolder[] }
|
||||
const LIB_ORGS: { org: string; groups: LibGroup[] }[] = [
|
||||
{ org: "一车间", groups: [
|
||||
{ cat: "工艺", folders: [
|
||||
{ label: "操作规程", docs: [
|
||||
{ name: "聚合岗位操作规程(2026 版)", ver: "V2026", date: "2026-07-26" },
|
||||
{ name: "干燥岗位操作规程(2026 版)", ver: "V2026", date: "2026-06-30" } ]},
|
||||
{ label: "PID 图纸", docs: [
|
||||
{ name: "PID-R201-03 反应釜工艺流程图(Rev C)", ver: "Rev C", date: "2026-07-29" },
|
||||
{ name: "PID-V102-01 罐区工艺流程图(Rev B)", ver: "Rev B", date: "2026-05-12" } ]},
|
||||
{ label: "工艺卡片", docs: [
|
||||
{ name: "R-201 反应釜工艺卡片(夏季工况)", ver: "V2.0", date: "2026-07-01" } ]},
|
||||
]},
|
||||
{ cat: "设备", folders: [
|
||||
{ label: "设备台账", docs: [
|
||||
{ name: "M-201A 搅拌电机设备台账", ver: "V3.2", date: "2026-07-28" },
|
||||
{ name: "P-204 输送泵设备台账", ver: "V2.8", date: "2026-06-15" } ]},
|
||||
{ label: "安全阀台账", docs: [
|
||||
{ name: "一车间安全阀台账(PSV-101 ~ PSV-118)", ver: "V5.1", date: "2026-07-10" } ]},
|
||||
]},
|
||||
{ cat: "仪表", folders: [
|
||||
{ label: "报警台账", docs: [
|
||||
{ name: "一车间 DCS 报警台账(2026H1)", ver: "V4.0", date: "2026-07-20" } ]},
|
||||
{ label: "联锁台账", docs: [
|
||||
{ name: "一车间联锁逻辑台账(SIS-01 ~ SIS-09)", ver: "V3.6", date: "2026-07-22" } ]},
|
||||
]},
|
||||
{ cat: "安全", folders: [
|
||||
{ label: "总图", docs: [{ name: "一车间装置总平面布置图", ver: "Rev D", date: "2026-04-18" } ]},
|
||||
{ label: "现场气体报警仪布置图", docs: [{ name: "一车间可燃 / 有毒气体报警仪布置图", ver: "Rev B", date: "2026-05-28" } ]},
|
||||
{ label: "防爆分区图", docs: [{ name: "一车间爆炸危险区域划分图", ver: "Rev C", date: "2026-03-15" } ]},
|
||||
]},
|
||||
]},
|
||||
{ org: "二车间", groups: [
|
||||
{ cat: "工艺", folders: [
|
||||
{ label: "操作规程", docs: [{ name: "二车间精馏岗位操作规程(2026 版)", ver: "V2026", date: "2026-06-20" } ]},
|
||||
{ label: "PID 图纸", docs: [{ name: "PID-T301-02 精馏塔工艺流程图(Rev A)", ver: "Rev A", date: "2026-03-08" } ]},
|
||||
]},
|
||||
{ cat: "设备", folders: [
|
||||
{ label: "设备台账", docs: [{ name: "P-103 冷冻盐水泵设备台账", ver: "V2.2", date: "2026-05-30" } ]},
|
||||
{ label: "安全阀台账", docs: [{ name: "二车间安全阀台账(PSV-201 ~ PSV-212)", ver: "V4.3", date: "2026-06-11" } ]},
|
||||
]},
|
||||
{ cat: "仪表", folders: [
|
||||
{ label: "报警台账", docs: [{ name: "二车间 DCS 报警台账(2026H1)", ver: "V3.5", date: "2026-07-02" } ]},
|
||||
{ label: "联锁台账", docs: [{ name: "二车间联锁逻辑台账(SIS-11 ~ SIS-16)", ver: "V2.9", date: "2026-06-25" } ]},
|
||||
]},
|
||||
{ cat: "安全", folders: [
|
||||
{ label: "总图", docs: [{ name: "二车间装置总平面布置图", ver: "Rev B", date: "2026-02-14" } ]},
|
||||
{ label: "现场气体报警仪布置图", docs: [{ name: "二车间可燃 / 有毒气体报警仪布置图", ver: "Rev A", date: "2026-04-02" } ]},
|
||||
{ label: "防爆分区图", docs: [{ name: "二车间爆炸危险区域划分图", ver: "Rev B", date: "2026-01-20" } ]},
|
||||
]},
|
||||
]},
|
||||
{ org: "全厂共用", groups: [
|
||||
{ cat: "法规", folders: [
|
||||
{ label: "法规标准库", docs: [{ name: "AQ/T 3034 化工企业工艺安全管理实施导则", ver: "2013 版", date: "2025-12-01" } ]},
|
||||
]},
|
||||
{ cat: "化学品", folders: [
|
||||
{ label: "MSDS", docs: [{ name: "环己烷 MSDS(供应商 B)", ver: "V1.0", date: "2026-07-18" } ]},
|
||||
]},
|
||||
{ cat: "模板", folders: [
|
||||
{ label: "检查表模板", docs: [{ name: "PSSR 检查表模板(设备类)", ver: "V2.1", date: "2026-05-10" } ]},
|
||||
]},
|
||||
{ cat: "案例", folders: [
|
||||
{ label: "历史变更案例", docs: [
|
||||
{ name: "2025 年度典型变更案例汇编", ver: "2025 版", date: "2026-01-15" },
|
||||
{ name: "HAZOP 分析报告(R-101 温度变更)", ver: "V1.0", date: "2026-07-26" } ]},
|
||||
]},
|
||||
]},
|
||||
];
|
||||
const openOrgs = ref<Record<string, boolean>>({ 一车间: true });
|
||||
const libSel = ref({ org: "一车间", cat: "工艺", label: "操作规程" });
|
||||
const libCur = computed(() => LIB_ORGS.find((o) => o.org === libSel.value.org)?.groups.find((g) => g.cat === libSel.value.cat)?.folders.find((f) => f.label === libSel.value.label));
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 我的草稿箱 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive class="pb-[12px] border-b">
|
||||
<NGi span="24 s:24 m:16">
|
||||
<div class="h-100% flex items-center gap-2">
|
||||
<Icon icon="mage:book" class="size-20px" :style="{ color: themeStore.themeColor }" />
|
||||
<p class="text-base font-semibold">资料档案库(按组织 / 专业类别建立文件夹 · AI 判定的知识来源)</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:8" class="flex items-center justify-end gap-12px">
|
||||
<div class="flex items-center gap-2">
|
||||
<NInput v-model:value="keyword" size="small" type="text" class="w-40 text-xs" placeholder="全文检索…">
|
||||
<template #suffix>
|
||||
<Icon icon="akar-icons:search" class="size-14px text-slate-400 cursor-pointer" />
|
||||
</template>
|
||||
</NInput>
|
||||
<NButton size="small" type="primary" class="text-xs" @click="uploadFiles">
|
||||
<Icon icon="material-symbols:upload" class="size-16px" /> 上传资料
|
||||
</NButton>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<div class="mt-4 mb-2 rounded-lg bg-slate-50 px-3 py-1.5 text-[11px] text-slate-400">
|
||||
按「组织 → 专业类别 → 资料文件夹」归档具体资料(操作规程 / PID 图纸 / 工艺卡片 / 设备台账 / 安全阀台账 / 报警台账 / 联锁台账 / 总图 / 现场气体报警仪布置图 / 防爆分区图等);资料由指定维护人(资料管理员 / 各专业专责)上传维护,版本受控;「调用」可将资料引用为当前变更的 AI 知识来源,调用记录留痕。
|
||||
</div>
|
||||
<!-- 全文检索:跨文件夹平铺结果 -->
|
||||
<div v-if="keyword">
|
||||
<div class="mb-1.5 text-xs text-slate-400">全文检索「{{ keyword }}」:跨全部文件夹命中 {{ libHits.length }} 份</div>
|
||||
<div class="divide-y rounded-lg border bg-white">
|
||||
<div v-for="d in libHits" :key="d.name" class="flex flex-wrap items-center gap-3 px-2 py-2.5">
|
||||
<FileText class="h-4 w-4 shrink-0 text-slate-400" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="truncate text-sm">{{ d.name }}</div>
|
||||
<div class="mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-slate-500">
|
||||
<span>{{ d.cat }} · {{ d.device }}</span>
|
||||
<span>更新 {{ d.date }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex shrink-0 gap-3 text-xs">
|
||||
<button class="text-[#1D4E9C] hover:underline" @click="preview(d)">查看</button>
|
||||
<button class="text-[#1D4E9C] hover:underline" @click="download(d)">下载</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="libHits.length === 0" class="py-6 text-center text-xs text-slate-400">未找到匹配「{{ keyword }}」的资料</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件夹树 + 当前文件夹资料 -->
|
||||
<div v-else class="flex gap-3">
|
||||
<div class="shrink-0 space-y-2 w-56 scroll-left">
|
||||
<div v-for="o in LIB_ORGS" :key="o.org" class="overflow-hidden rounded-lg border bg-white">
|
||||
<button class="flex w-full items-center gap-1.5 px-2.5 py-2 text-xs font-semibold text-slate-700 hover:bg-slate-50 bg-transparent"
|
||||
@click="openOrgs[o.org] = !openOrgs[o.org]">
|
||||
<Icon icon="formkit:right" class="size-14px transition-transform" :class="openOrgs[o.org] ? 'rotate-90' : ''" />
|
||||
<Icon v-if="openOrgs[o.org]" icon="quill:folder-open" class="size-14px" :style="{ color: themeStore.themeColor }" />
|
||||
<Icon v-else icon="material-symbols:folder-outline" class="size-14px text-slate-400" />
|
||||
{{ o.org }}
|
||||
</button>
|
||||
<template v-if="openOrgs[o.org]">
|
||||
<div v-for="g in o.groups" :key="g.cat" class="border-t px-2 py-1.5">
|
||||
<div class="px-1 pb-0.5 text-[10px] font-medium tracking-wide text-slate-400">{{ g.cat }}专业</div>
|
||||
<button v-for="f in g.folders" :key="f.label"
|
||||
@click="libSel = { org: o.org, cat: g.cat, label: f.label }"
|
||||
class="flex w-full items-center gap-1.5 rounded px-2 py-1 text-left text-xs transition"
|
||||
:class="libSel.org === o.org && libSel.cat === g.cat && libSel.label === f.label ? 'bg-[var(--theme-color)] font-medium text-white' : 'text-slate-600 hover:bg-slate-100 bg-transparent'"
|
||||
:style="{ '--theme-color': themeStore.themeColor }"
|
||||
>
|
||||
<Icon icon="material-symbols:folder-outline" class="size-14px text-slate-400" />
|
||||
<span class="min-w-0 flex-1 truncate">{{ f.label }}</span>
|
||||
<span class="text-[10px]" :class="libSel.label === f.label && libSel.cat === g.cat && libSel.org === o.org ? 'text-white/70' : 'text-slate-300'">{{ f.docs.length }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="mb-1.5 flex flex-wrap items-center gap-1 text-xs text-slate-400">
|
||||
当前位置:{{ libSel.org }}
|
||||
<Icon icon="formkit:right" class="size-12px" />
|
||||
{{ libSel.cat }}专业
|
||||
<Icon icon="formkit:right" class="size-12px" />
|
||||
<span class="font-medium text-slate-600">{{ libSel.label }}</span>
|
||||
<span class="ml-auto">共 {{ libCur?.docs.length ?? 0 }} 份 · 版本受控</span>
|
||||
</div>
|
||||
<div class="scroll-right">
|
||||
<div class="divide-y rounded-lg border bg-white">
|
||||
<div v-for="d in libCur?.docs ?? []" :key="d.name" class="flex flex-wrap items-center gap-3 px-2 py-2.5">
|
||||
<Icon icon="akar-icons:file" class="size-16px" />
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="truncate text-sm">{{ d.name }}</div>
|
||||
<div class="mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-slate-500">
|
||||
<NTag size="small" type="info" class="text-[10px]">版本 {{ d.ver }}</NTag>
|
||||
<span>更新 {{ d.date }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex shrink-0 gap-3 text-xs">
|
||||
<NButton type="primary" text class="hover:underline text-xs" @click="preview(d)">查看</NButton>
|
||||
<NButton type="primary" text class="hover:underline text-xs" @click="download(d)">下载</NButton>
|
||||
<NButton type="primary" text class="hover:underline text-xs" @click="call(d)">调用</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll-left {
|
||||
height: calc(100vh - 260px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.scroll-right {
|
||||
height: calc(100vh - 280px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
+332
-332
@@ -1,332 +1,332 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from "@/utils/common";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const aq = ref<string>('');
|
||||
const uploadFiles = () => {
|
||||
window.$message?.success('演示:上传归档补充材料(限变更主管部门专责;材料单独存入「7-补充材料」,不改动原归档包,哈希留痕)')
|
||||
}
|
||||
interface ArchivePkg {
|
||||
id: string; name: string; closedAt: string; size: string; files: number;
|
||||
hash: string; revoked?: boolean; supplement?: boolean;
|
||||
}
|
||||
interface ArchiveUnit { unit: string; years: { year: string; pkgs: ArchivePkg[] }[] }
|
||||
|
||||
const ARCHIVE_TREE: ArchiveUnit[] = [
|
||||
{
|
||||
unit: "01-常减压装置",
|
||||
years: [
|
||||
{ year: "2024", pkgs: [
|
||||
{ id: "MOC-2024-R01-0003", name: "减一线换热器 E-108 芯子更换", closedAt: "2024-04-18", size: "12.6MB", files: 19, hash: "3a91d7c4f0e2…5b17" },
|
||||
{ id: "MOC-2024-R01-0007", name: "常压塔顶回流泵 P-105B 叶轮更换", closedAt: "2024-09-02", size: "9.8MB", files: 16, hash: "8e02b1a6d3c9…42fa" },
|
||||
] },
|
||||
{ year: "2025", pkgs: [
|
||||
{ id: "MOC-2025-R01-0011", name: "初馏塔进料温度联锁值调整(已撤销)", closedAt: "2025-03-11", size: "7.4MB", files: 14, hash: "c5d8f2a1b7e4…9c03", revoked: true },
|
||||
{ id: "MOC-2025-R01-0019", name: "电脱盐系统注水泵型号替换", closedAt: "2025-07-25", size: "15.2MB", files: 22, hash: "1f4a9c7e2b6d…d831", supplement: true },
|
||||
{ id: "MOC-2025-R01-0023", name: "常压炉燃料气切断阀改造", closedAt: "2025-11-14", size: "21.0MB", files: 27, hash: "6b3e0d8a5f1c…77e2" },
|
||||
] },
|
||||
{ year: "2026", pkgs: [
|
||||
{ id: "MOC-2026-R01-0028", name: "减顶真空泵 P-107A 电机更换", closedAt: "2026-06-30", size: "18.4MB", files: 24, hash: "b8e3a1c5d2f7…4c60" },
|
||||
{ id: "MOC-2026-R01-0031", name: "常顶油气冷却器管束更新", closedAt: "2026-07-12", size: "16.9MB", files: 21, hash: "d2a7c4f88b1e…5a96" },
|
||||
{ id: "MOC-2026-R01-0039", name: "进料泵 P-101A 更换为高效节能泵", closedAt: "2026-08-01", size: "18.4MB", files: 24, hash: "7c4f9be2a1d3…e804" },
|
||||
] },
|
||||
],
|
||||
},
|
||||
{
|
||||
unit: "02-催化裂化装置",
|
||||
years: [
|
||||
{ year: "2025", pkgs: [
|
||||
{ id: "MOC-2025-R02-0014", name: "再生器旋风分离器更换", closedAt: "2025-05-20", size: "26.3MB", files: 31, hash: "9c1e5b3d7a2f…b450" },
|
||||
{ id: "MOC-2025-R02-0021", name: "气压机出口压力联锁逻辑修改", closedAt: "2025-10-08", size: "11.7MB", files: 18, hash: "4d8f0a2c6e9b…31cd" },
|
||||
] },
|
||||
{ year: "2026", pkgs: [
|
||||
{ id: "MOC-2026-R02-0025", name: "分馏塔顶循回流管线扩径", closedAt: "2026-06-30", size: "14.5MB", files: 20, hash: "a7b2d9e4c1f8…6e05" },
|
||||
] },
|
||||
],
|
||||
},
|
||||
{
|
||||
unit: "03-聚合装置",
|
||||
years: [
|
||||
{ year: "2026", pkgs: [
|
||||
{ id: "MOC-2026-R03-0008", name: "聚合釜搅拌器密封形式变更", closedAt: "2026-05-19", size: "13.2MB", files: 17, hash: "e6f1a8c3b5d0…92d7" },
|
||||
] },
|
||||
],
|
||||
},
|
||||
];
|
||||
const ARCHIVE_FOLDERS: { dir: string; files: { name: string; size: string }[] }[] = [
|
||||
{ dir: "1-申请与审批", files: [
|
||||
{ name: "变更申请表(终版).pdf", size: "486KB" },
|
||||
{ name: "审批记录(含会签意见与留痕).pdf", size: "312KB" },
|
||||
{ name: "等级判定表.pdf", size: "154KB" },
|
||||
{ name: "原始附件(方案/会议纪要/数据表).zip", size: "2.8MB" },
|
||||
] },
|
||||
{ dir: "2-风险分析", files: [
|
||||
{ name: "AI 风险预分析报告.pdf", size: "268KB" },
|
||||
{ name: "JSA 作业安全分析表.pdf", size: "196KB" },
|
||||
{ name: "HAZOP 分析记录.pdf", size: "742KB" },
|
||||
{ name: "安全检查表(SCL).pdf", size: "188KB" },
|
||||
] },
|
||||
{ dir: "3-培训与考核", files: [
|
||||
{ name: "变更培训材料(终版).pdf", size: "1.1MB" },
|
||||
{ name: "培训签到表(照片).jpg", size: "2.4MB" },
|
||||
{ name: "考核成绩单.xlsx", size: "32KB" },
|
||||
] },
|
||||
{ dir: "4-PSSR检查", files: [
|
||||
{ name: "PSSR 检查清单(终版).pdf", size: "356KB" },
|
||||
{ name: "现场确认照片.zip", size: "6.7MB" },
|
||||
{ name: "电子签名确认记录.pdf", size: "142KB" },
|
||||
] },
|
||||
{ dir: "5-验收记录", files: [
|
||||
{ name: "变更验收单.pdf", size: "204KB" },
|
||||
{ name: "整改记录与复验结论.pdf", size: "168KB" },
|
||||
] },
|
||||
{ dir: "6-受控文件副本", files: [
|
||||
{ name: "受控文件更新清单(新旧对照).pdf", size: "96KB" },
|
||||
{ name: "PID-101_Rev.4_20260805.pdf", size: "3.2MB" },
|
||||
{ name: "PID-101_Rev.3_20250101.pdf", size: "3.1MB" },
|
||||
] },
|
||||
];
|
||||
const SUPPLEMENT_FOLDER = { dir: "7-补充材料(归档后补充)", files: [
|
||||
{ name: "补充说明(泵轴振动复测数据).pdf", size: "214KB" },
|
||||
{ name: "补充审批记录.pdf", size: "88KB" },
|
||||
] };
|
||||
const ROLE_SCOPE: Record<any, { text: string; filter: (u: any, p: any) => boolean }> = {
|
||||
applicant: { text: "本人发起或参与的变更", filter: (u, p) => u.unit.startsWith("01") && ["MOC-2026-R01-0039", "MOC-2026-R01-0028", "MOC-2025-R01-0019"].includes(p.id) },
|
||||
dept: { text: "本车间(装置)的全部变更", filter: (u) => u.unit.startsWith("01") },
|
||||
process: { text: "本人参与审批或检查的变更", filter: (u, p) => u.unit.startsWith("01") && p.id >= "MOC-2025" },
|
||||
process2: { text: "本人参与审批或检查的变更", filter: (u, p) => u.unit.startsWith("01") && p.id >= "MOC-2025" },
|
||||
safety: { text: "全厂变更(安全监管需要)", filter: () => true },
|
||||
vp: { text: "全厂变更", filter: () => true },
|
||||
admin: { text: "全厂变更(系统管理:归档内容只读锁定,不可修改删除)", filter: () => true },
|
||||
quality: { text: "本人参与会签或检验确认的变更", filter: (u, p) => u.unit.startsWith("01") && p.id >= "MOC-2025" },
|
||||
viewer: { text: "全厂变更(信息查看角色:只读查阅)", filter: () => true },
|
||||
};
|
||||
const tF = ref("全部时间");
|
||||
const oF = ref("全部组织");
|
||||
const pF = ref("全部专业");
|
||||
const FILTER_GROUPS = computed(() => [
|
||||
{ label: "时间", opts: ["全部时间", "近一年", "近半年", "近三个月"], val: tF.value, set: (v: string) => { tF.value = v; } },
|
||||
{ label: "组织", opts: ["全部组织", "一车间", "二车间", "三车间"], val: oF.value, set: (v: string) => { oF.value = v; } },
|
||||
{ label: "专业", opts: ["全部专业", "工艺", "设备", "仪表", "管理"], val: pF.value, set: (v: string) => { pF.value = v; } },
|
||||
]);
|
||||
const scope = computed(() => ROLE_SCOPE['applicant'] ?? ROLE_SCOPE.vp);
|
||||
const searching = computed(() => aq.value.trim().length > 0);
|
||||
const filtering = computed(() => tF.value !== "全部时间" || oF.value !== "全部组织" || pF.value !== "全部专业");
|
||||
const UNIT_ORG: Record<string, string> = { "01-常减压装置": "一车间", "02-催化裂化装置": "二车间", "03-聚合装置": "三车间" };
|
||||
const profOf = (name: string) => /联锁|报警/.test(name) ? "仪表" : /规程|制度|管理/.test(name) ? "管理" : /泵|阀|电机|换热器|搅拌|密封|分离器|管束|冷却器|气压机|叶轮|芯子/.test(name) ? "设备" : "工艺";
|
||||
const REF = new Date("2026-08-03");
|
||||
const selId = ref("MOC-2026-R01-0039");
|
||||
const passF = (p: (typeof allPkgs.value)[number]) => {
|
||||
const daysOf = tF.value === "近一年" ? 365 : tF.value === "近半年" ? 183 : tF.value === "近三个月" ? 92 : 0;
|
||||
return (daysOf === 0 || (REF.getTime() - new Date(p.closedAt).getTime()) / 86400000 <= daysOf) &&
|
||||
(oF.value === "全部组织" || UNIT_ORG[p.unit] === oF.value) &&
|
||||
(pF.value === "全部专业" || profOf(p.name) === pF.value);
|
||||
};
|
||||
const tree = computed(() => ARCHIVE_TREE
|
||||
.map((u:any) => ({ unit: u.unit, years: u.years.map((y) => ({ year: y.year, pkgs: y.pkgs.filter((p:any) => scope.value.filter(u, p)) })).filter((y:any) => y.pkgs.length > 0) }))
|
||||
.filter((u:any) => u.years.length > 0));
|
||||
const allPkgs = computed(() => tree.value.flatMap((u:any) => u.years.flatMap((y:any) => y.pkgs.map((p:any) => ({ ...p, unit: u.unit, year: y.year })))));
|
||||
const results = computed(() => (searching.value || filtering.value)
|
||||
? allPkgs.value.filter((p:any) => passF(p) && (!searching.value || p.id.toLowerCase().includes(aq.value.trim().toLowerCase()) || p.name.includes(aq.value.trim())))
|
||||
: []);
|
||||
const sel = computed(() => allPkgs.value.find((p:any) => p.id === selId.value) ?? allPkgs.value[0]);
|
||||
const selFolders = computed(() => (sel.value?.supplement ? [...ARCHIVE_FOLDERS, SUPPLEMENT_FOLDER] : ARCHIVE_FOLDERS));
|
||||
const openUnits = ref<Record<string, boolean>>({ "01-常减压装置": true });
|
||||
const openFolders = ref<Record<string, boolean>>({ "1-申请与审批": true });
|
||||
const downloadZip = (sel:any) => {
|
||||
window.$message?.success(`演示:下载 ${sel.id} 归档包 ZIP(含归档索引.txt)`)
|
||||
}
|
||||
const exportEvidenceChain = () => {
|
||||
window.$message?.success('演示:导出证据链(哈希清单 + 操作日志)')
|
||||
}
|
||||
const applySupplement = () => {
|
||||
window.$message?.info('演示:发起归档补充申请(补充材料单独存入 7-补充材料,不改动原归档)')
|
||||
}
|
||||
const viewIndex = () => {
|
||||
window.$message?.info('演示:查看归档索引(文件清单 + 逐项 SHA-256)')
|
||||
}
|
||||
const previewFile = (file:any) => {
|
||||
window.$message?.info(`演示:在线预览 ${file.name}`)
|
||||
}
|
||||
const downloadFile = (file:any) => {
|
||||
window.$message?.success(`演示:下载 ${file.name}`)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 我的草稿箱 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive class="pb-[12px] border-b">
|
||||
<NGi span="24 s:24 m:16">
|
||||
<div class="h-100% flex items-center gap-2">
|
||||
<Icon icon="mage:book" class="size-20px" :style="{ color: themeStore.themeColor }" />
|
||||
<p class="text-base font-semibold">变更归档(一次变更一个归档包 · 关闭即自动归档 · 只读锁定)</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:8" class="flex items-center justify-end gap-12px">
|
||||
<div class="flex items-center gap-2">
|
||||
<NButton size="small" type="primary" class="text-xs" @click="uploadFiles">
|
||||
<Icon icon="material-symbols:upload" class="size-16px" /> 上传归档补充
|
||||
</NButton>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<div
|
||||
class="mt-4 flex items-center gap-2 rounded-lg bg-[var(--bg-color)] px-3 py-2 text-xs text-[var(--theme-color)]"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--bg-color': getColorWithOpacity(themeStore.themeColor, 0.1)
|
||||
}"
|
||||
>
|
||||
<Icon icon="uil:lock" class="size-16px" />
|
||||
当前角色调阅范围:{{ scope.text }} · 归档包关闭时自动生成,内容只读锁定并记录 SHA-256 哈希,任何修改留痕可追责
|
||||
</div>
|
||||
<NInput v-model:value="aq" type="text" class="w-40 text-xs mt-3" placeholder="按变更单号精确查找,或按名称关键词检索(如 MOC-2026-R01-0039)">
|
||||
<template #suffix>
|
||||
<Icon icon="akar-icons:search" class="size-14px text-slate-400 cursor-pointer" />
|
||||
</template>
|
||||
</NInput>
|
||||
<!-- 筛选:时间 / 组织 / 专业 -->
|
||||
<div class="flex flex-wrap items-center gap-x-4 gap-y-1.5 mt-3">
|
||||
<div v-for="g in FILTER_GROUPS" :key="g.label" class="flex flex-wrap items-center gap-1">
|
||||
<span class="text-[11px] text-slate-400">{{ g.label }}</span>
|
||||
<NButton size="tiny" round v-for="o in g.opts" :key="o" @click="g.set(o)" class="text-[11px]" :type="g.val === o ? 'primary' : 'default'">{{ o }}</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid gap-3 grid-cols-3 mt-3">
|
||||
<!-- 左:三层目录树 / 筛选检索结果 -->
|
||||
<div class="rounded-lg border p-2">
|
||||
<div class="px-2 pb-1 text-xs font-medium text-slate-500">{{ (searching || filtering) ? `筛选 / 检索结果(${results.length})` : '归档区目录(装置 / 年份 / 变更单号)' }}</div>
|
||||
<template v-if="searching || filtering">
|
||||
<div v-if="results.length === 0" class="px-2 py-4 text-center text-xs text-slate-400">未找到匹配的归档包</div>
|
||||
<button v-for="p in results" :key="p.id" @click="selId = p.id"
|
||||
class="flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs hover:bg-[#DFE9F6]/60"
|
||||
:class="sel?.id === p.id ? 'bg-[#DFE9F6] font-medium text-[#1D4E9C]' : ''">
|
||||
<FolderArchive class="h-3.5 w-3.5 shrink-0 text-[#6E93C6]" />
|
||||
<span class="truncate">{{ p.id }}</span>
|
||||
<Tag v-if="p.revoked" class="border-red-200 bg-red-100 px-1 py-0 text-[10px] text-red-600">已撤销</Tag>
|
||||
<Tag v-if="p.supplement" class="border-amber-200 bg-amber-100 px-1 py-0 text-[10px] text-amber-700">补充</Tag>
|
||||
</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-for="u in tree" :key="u.unit">
|
||||
<button @click="openUnits[u.unit] = !openUnits[u.unit]"
|
||||
class="flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs font-medium hover:bg-slate-50 bg-transparent">
|
||||
<Icon icon="formkit:right" class="size-14px transition-transform" :class="openUnits[u.unit] ? 'rotate-90' : ''" />
|
||||
<Icon v-if="openUnits[u.unit]" icon="quill:folder-open" class="size-16px" :style="{ color: themeStore.themeColor }" />
|
||||
<Icon v-else icon="material-symbols:folder-outline" class="size-16px text-slate-400" />
|
||||
{{ u.unit }}
|
||||
</button>
|
||||
<template v-if="openUnits[u.unit]">
|
||||
<div v-for="y in u.years" :key="y.year">
|
||||
<div class="pl-7 pt-1 text-[11px] font-medium text-slate-400">{{ y.year }} 年({{ y.pkgs.length }})</div>
|
||||
<button v-for="p in y.pkgs" :key="p.id" @click="selId = p.id"
|
||||
class="flex w-full items-center gap-2 rounded-lg py-1.5 pl-8 pr-2 text-left text-xs hover:bg-[#DFE9F6]/60"
|
||||
:class="sel?.id === p.id ? 'bg-[var(--bg-color)] font-medium text-[var(--theme-color)]' : 'bg-transparent'"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--bg-color': getColorWithOpacity(themeStore.themeColor, 0.1)
|
||||
}"
|
||||
>
|
||||
<Icon icon="lucide:folder-archive" class="size-14px" :style="{ color: themeStore.themeColor }" />
|
||||
|
||||
<span class="truncate">{{ p.id }}</span>
|
||||
<NTag v-if="p.revoked" size="small" type="error" class="text-[10px]">已撤销</NTag>
|
||||
<NTag v-if="p.supplement" size="small" type="warning" class="text-[10px]">补充</NTag>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</div>
|
||||
<!-- 右:归档包详情 -->
|
||||
<div v-if="sel" class="rounded-lg border col-span-2">
|
||||
<div class="border-b p-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="text-sm font-semibold">{{ sel.id }}</span>
|
||||
<NTag v-if="sel.revoked" size="small" type="error">已撤销(保留归档备查)</NTag>
|
||||
<NTag v-else size="small" type="info">
|
||||
<template #icon>
|
||||
<Icon icon="uil:lock" class="size-14px" />
|
||||
</template>
|
||||
只读锁定
|
||||
</NTag>
|
||||
<NTag v-if="sel.supplement" size="small" type="warning">含归档补充</NTag>
|
||||
</div>
|
||||
<div class="mt-1 text-xs text-slate-600">{{ sel.name }}</div>
|
||||
<div class="mt-2 flex flex-wrap justify-between gap-x-4 gap-y-1 text-[11px] text-slate-500">
|
||||
<span>归档路径:归档区/{{ sel.unit }}/{{ sel.year }}/{{ sel.id }}/</span>
|
||||
<span>关闭时间:{{ sel.closedAt }}</span>
|
||||
<span>共 {{ sel.files }} 个文件 · {{ sel.size }}</span>
|
||||
<span class="flex items-center gap-1 font-mono">
|
||||
<Icon icon="lucide:hash" class="size-12px" />
|
||||
{{ sel.hash }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap gap-2">
|
||||
<NButton size="small" class="text-xs" @click="downloadZip(sel)">
|
||||
<Icon icon="material-symbols:download" class="size-14px" />
|
||||
下载归档包 ZIP
|
||||
</NButton>
|
||||
<NButton size="small" class="text-xs" @click="exportEvidenceChain">导出证据链</NButton>
|
||||
<NButton v-if="!sel.revoked" size="small" class="text-xs" @click="applySupplement">发起归档补充申请</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divide-y scroll-right">
|
||||
<div v-for="f in selFolders" :key="f.dir">
|
||||
<button @click="openFolders[f.dir] = !openFolders[f.dir]"
|
||||
class="flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-medium hover:bg-slate-50 bg-transparent">
|
||||
<Icon icon="formkit:right" class="size-14px text-slate-400 transition-transform" :class="openFolders[f.dir] ? 'rotate-90' : ''" />
|
||||
<Icon icon="quill:folder-open" v-if="openFolders[f.dir]" class="size-16px text-[#6E93C6]" />
|
||||
<Icon v-else icon="material-symbols:folder-outline" class="size-16px text-slate-400" />
|
||||
{{ f.dir }}
|
||||
<span class="ml-auto text-[11px] font-normal text-slate-400">{{ f.files.length }} 个文件</span>
|
||||
</button>
|
||||
<template v-if="openFolders[f.dir]">
|
||||
<div v-for="file in f.files" :key="file.name" class="flex items-center gap-2 py-1.5 pl-10 pr-3 text-xs hover:bg-slate-50">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-slate-400" />
|
||||
<span class="min-w-0 flex-1 truncate">{{ file.name }}</span>
|
||||
<span class="text-[11px] text-slate-400">{{ file.size }}</span>
|
||||
<NButton text type="primary" @click="previewFile(file)">
|
||||
<Icon icon="lucide:eye" class="size-14px" />
|
||||
</NButton>
|
||||
<NButton text type="primary" @click="downloadFile(file)">
|
||||
<Icon icon="material-symbols:download" class="size-16px" />
|
||||
</NButton>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 px-3 py-2 text-xs hover:bg-slate-50">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-slate-400" />
|
||||
<span class="flex-1 font-mono">归档索引.txt</span>
|
||||
<span class="text-[11px] text-slate-400">清单与哈希</span>
|
||||
<NButton text type="primary" @click="viewIndex">
|
||||
<Icon icon="lucide:eye" class="size-14px" />
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll-right {
|
||||
height: calc(100vh - 460px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from "@/utils/common";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const aq = ref<string>('');
|
||||
const uploadFiles = () => {
|
||||
window.$message?.success('演示:上传归档补充材料(限变更主管部门专责;材料单独存入「7-补充材料」,不改动原归档包,哈希留痕)')
|
||||
}
|
||||
interface ArchivePkg {
|
||||
id: string; name: string; closedAt: string; size: string; files: number;
|
||||
hash: string; revoked?: boolean; supplement?: boolean;
|
||||
}
|
||||
interface ArchiveUnit { unit: string; years: { year: string; pkgs: ArchivePkg[] }[] }
|
||||
|
||||
const ARCHIVE_TREE: ArchiveUnit[] = [
|
||||
{
|
||||
unit: "01-常减压装置",
|
||||
years: [
|
||||
{ year: "2024", pkgs: [
|
||||
{ id: "MOC-2024-R01-0003", name: "减一线换热器 E-108 芯子更换", closedAt: "2024-04-18", size: "12.6MB", files: 19, hash: "3a91d7c4f0e2…5b17" },
|
||||
{ id: "MOC-2024-R01-0007", name: "常压塔顶回流泵 P-105B 叶轮更换", closedAt: "2024-09-02", size: "9.8MB", files: 16, hash: "8e02b1a6d3c9…42fa" },
|
||||
] },
|
||||
{ year: "2025", pkgs: [
|
||||
{ id: "MOC-2025-R01-0011", name: "初馏塔进料温度联锁值调整(已撤销)", closedAt: "2025-03-11", size: "7.4MB", files: 14, hash: "c5d8f2a1b7e4…9c03", revoked: true },
|
||||
{ id: "MOC-2025-R01-0019", name: "电脱盐系统注水泵型号替换", closedAt: "2025-07-25", size: "15.2MB", files: 22, hash: "1f4a9c7e2b6d…d831", supplement: true },
|
||||
{ id: "MOC-2025-R01-0023", name: "常压炉燃料气切断阀改造", closedAt: "2025-11-14", size: "21.0MB", files: 27, hash: "6b3e0d8a5f1c…77e2" },
|
||||
] },
|
||||
{ year: "2026", pkgs: [
|
||||
{ id: "MOC-2026-R01-0028", name: "减顶真空泵 P-107A 电机更换", closedAt: "2026-06-30", size: "18.4MB", files: 24, hash: "b8e3a1c5d2f7…4c60" },
|
||||
{ id: "MOC-2026-R01-0031", name: "常顶油气冷却器管束更新", closedAt: "2026-07-12", size: "16.9MB", files: 21, hash: "d2a7c4f88b1e…5a96" },
|
||||
{ id: "MOC-2026-R01-0039", name: "进料泵 P-101A 更换为高效节能泵", closedAt: "2026-08-01", size: "18.4MB", files: 24, hash: "7c4f9be2a1d3…e804" },
|
||||
] },
|
||||
],
|
||||
},
|
||||
{
|
||||
unit: "02-催化裂化装置",
|
||||
years: [
|
||||
{ year: "2025", pkgs: [
|
||||
{ id: "MOC-2025-R02-0014", name: "再生器旋风分离器更换", closedAt: "2025-05-20", size: "26.3MB", files: 31, hash: "9c1e5b3d7a2f…b450" },
|
||||
{ id: "MOC-2025-R02-0021", name: "气压机出口压力联锁逻辑修改", closedAt: "2025-10-08", size: "11.7MB", files: 18, hash: "4d8f0a2c6e9b…31cd" },
|
||||
] },
|
||||
{ year: "2026", pkgs: [
|
||||
{ id: "MOC-2026-R02-0025", name: "分馏塔顶循回流管线扩径", closedAt: "2026-06-30", size: "14.5MB", files: 20, hash: "a7b2d9e4c1f8…6e05" },
|
||||
] },
|
||||
],
|
||||
},
|
||||
{
|
||||
unit: "03-聚合装置",
|
||||
years: [
|
||||
{ year: "2026", pkgs: [
|
||||
{ id: "MOC-2026-R03-0008", name: "聚合釜搅拌器密封形式变更", closedAt: "2026-05-19", size: "13.2MB", files: 17, hash: "e6f1a8c3b5d0…92d7" },
|
||||
] },
|
||||
],
|
||||
},
|
||||
];
|
||||
const ARCHIVE_FOLDERS: { dir: string; files: { name: string; size: string }[] }[] = [
|
||||
{ dir: "1-申请与审批", files: [
|
||||
{ name: "变更申请表(终版).pdf", size: "486KB" },
|
||||
{ name: "审批记录(含会签意见与留痕).pdf", size: "312KB" },
|
||||
{ name: "等级判定表.pdf", size: "154KB" },
|
||||
{ name: "原始附件(方案/会议纪要/数据表).zip", size: "2.8MB" },
|
||||
] },
|
||||
{ dir: "2-风险分析", files: [
|
||||
{ name: "AI 风险预分析报告.pdf", size: "268KB" },
|
||||
{ name: "JSA 作业安全分析表.pdf", size: "196KB" },
|
||||
{ name: "HAZOP 分析记录.pdf", size: "742KB" },
|
||||
{ name: "安全检查表(SCL).pdf", size: "188KB" },
|
||||
] },
|
||||
{ dir: "3-培训与考核", files: [
|
||||
{ name: "变更培训材料(终版).pdf", size: "1.1MB" },
|
||||
{ name: "培训签到表(照片).jpg", size: "2.4MB" },
|
||||
{ name: "考核成绩单.xlsx", size: "32KB" },
|
||||
] },
|
||||
{ dir: "4-PSSR检查", files: [
|
||||
{ name: "PSSR 检查清单(终版).pdf", size: "356KB" },
|
||||
{ name: "现场确认照片.zip", size: "6.7MB" },
|
||||
{ name: "电子签名确认记录.pdf", size: "142KB" },
|
||||
] },
|
||||
{ dir: "5-验收记录", files: [
|
||||
{ name: "变更验收单.pdf", size: "204KB" },
|
||||
{ name: "整改记录与复验结论.pdf", size: "168KB" },
|
||||
] },
|
||||
{ dir: "6-受控文件副本", files: [
|
||||
{ name: "受控文件更新清单(新旧对照).pdf", size: "96KB" },
|
||||
{ name: "PID-101_Rev.4_20260805.pdf", size: "3.2MB" },
|
||||
{ name: "PID-101_Rev.3_20250101.pdf", size: "3.1MB" },
|
||||
] },
|
||||
];
|
||||
const SUPPLEMENT_FOLDER = { dir: "7-补充材料(归档后补充)", files: [
|
||||
{ name: "补充说明(泵轴振动复测数据).pdf", size: "214KB" },
|
||||
{ name: "补充审批记录.pdf", size: "88KB" },
|
||||
] };
|
||||
const ROLE_SCOPE: Record<any, { text: string; filter: (u: any, p: any) => boolean }> = {
|
||||
applicant: { text: "本人发起或参与的变更", filter: (u, p) => u.unit.startsWith("01") && ["MOC-2026-R01-0039", "MOC-2026-R01-0028", "MOC-2025-R01-0019"].includes(p.id) },
|
||||
dept: { text: "本车间(装置)的全部变更", filter: (u) => u.unit.startsWith("01") },
|
||||
process: { text: "本人参与审批或检查的变更", filter: (u, p) => u.unit.startsWith("01") && p.id >= "MOC-2025" },
|
||||
process2: { text: "本人参与审批或检查的变更", filter: (u, p) => u.unit.startsWith("01") && p.id >= "MOC-2025" },
|
||||
safety: { text: "全厂变更(安全监管需要)", filter: () => true },
|
||||
vp: { text: "全厂变更", filter: () => true },
|
||||
admin: { text: "全厂变更(系统管理:归档内容只读锁定,不可修改删除)", filter: () => true },
|
||||
quality: { text: "本人参与会签或检验确认的变更", filter: (u, p) => u.unit.startsWith("01") && p.id >= "MOC-2025" },
|
||||
viewer: { text: "全厂变更(信息查看角色:只读查阅)", filter: () => true },
|
||||
};
|
||||
const tF = ref("全部时间");
|
||||
const oF = ref("全部组织");
|
||||
const pF = ref("全部专业");
|
||||
const FILTER_GROUPS = computed(() => [
|
||||
{ label: "时间", opts: ["全部时间", "近一年", "近半年", "近三个月"], val: tF.value, set: (v: string) => { tF.value = v; } },
|
||||
{ label: "组织", opts: ["全部组织", "一车间", "二车间", "三车间"], val: oF.value, set: (v: string) => { oF.value = v; } },
|
||||
{ label: "专业", opts: ["全部专业", "工艺", "设备", "仪表", "管理"], val: pF.value, set: (v: string) => { pF.value = v; } },
|
||||
]);
|
||||
const scope = computed(() => ROLE_SCOPE['applicant'] ?? ROLE_SCOPE.vp);
|
||||
const searching = computed(() => aq.value.trim().length > 0);
|
||||
const filtering = computed(() => tF.value !== "全部时间" || oF.value !== "全部组织" || pF.value !== "全部专业");
|
||||
const UNIT_ORG: Record<string, string> = { "01-常减压装置": "一车间", "02-催化裂化装置": "二车间", "03-聚合装置": "三车间" };
|
||||
const profOf = (name: string) => /联锁|报警/.test(name) ? "仪表" : /规程|制度|管理/.test(name) ? "管理" : /泵|阀|电机|换热器|搅拌|密封|分离器|管束|冷却器|气压机|叶轮|芯子/.test(name) ? "设备" : "工艺";
|
||||
const REF = new Date("2026-08-03");
|
||||
const selId = ref("MOC-2026-R01-0039");
|
||||
const passF = (p: (typeof allPkgs.value)[number]) => {
|
||||
const daysOf = tF.value === "近一年" ? 365 : tF.value === "近半年" ? 183 : tF.value === "近三个月" ? 92 : 0;
|
||||
return (daysOf === 0 || (REF.getTime() - new Date(p.closedAt).getTime()) / 86400000 <= daysOf) &&
|
||||
(oF.value === "全部组织" || UNIT_ORG[p.unit] === oF.value) &&
|
||||
(pF.value === "全部专业" || profOf(p.name) === pF.value);
|
||||
};
|
||||
const tree = computed(() => ARCHIVE_TREE
|
||||
.map((u:any) => ({ unit: u.unit, years: u.years.map((y) => ({ year: y.year, pkgs: y.pkgs.filter((p:any) => scope.value.filter(u, p)) })).filter((y:any) => y.pkgs.length > 0) }))
|
||||
.filter((u:any) => u.years.length > 0));
|
||||
const allPkgs = computed(() => tree.value.flatMap((u:any) => u.years.flatMap((y:any) => y.pkgs.map((p:any) => ({ ...p, unit: u.unit, year: y.year })))));
|
||||
const results = computed(() => (searching.value || filtering.value)
|
||||
? allPkgs.value.filter((p:any) => passF(p) && (!searching.value || p.id.toLowerCase().includes(aq.value.trim().toLowerCase()) || p.name.includes(aq.value.trim())))
|
||||
: []);
|
||||
const sel = computed(() => allPkgs.value.find((p:any) => p.id === selId.value) ?? allPkgs.value[0]);
|
||||
const selFolders = computed(() => (sel.value?.supplement ? [...ARCHIVE_FOLDERS, SUPPLEMENT_FOLDER] : ARCHIVE_FOLDERS));
|
||||
const openUnits = ref<Record<string, boolean>>({ "01-常减压装置": true });
|
||||
const openFolders = ref<Record<string, boolean>>({ "1-申请与审批": true });
|
||||
const downloadZip = (sel:any) => {
|
||||
window.$message?.success(`演示:下载 ${sel.id} 归档包 ZIP(含归档索引.txt)`)
|
||||
}
|
||||
const exportEvidenceChain = () => {
|
||||
window.$message?.success('演示:导出证据链(哈希清单 + 操作日志)')
|
||||
}
|
||||
const applySupplement = () => {
|
||||
window.$message?.info('演示:发起归档补充申请(补充材料单独存入 7-补充材料,不改动原归档)')
|
||||
}
|
||||
const viewIndex = () => {
|
||||
window.$message?.info('演示:查看归档索引(文件清单 + 逐项 SHA-256)')
|
||||
}
|
||||
const previewFile = (file:any) => {
|
||||
window.$message?.info(`演示:在线预览 ${file.name}`)
|
||||
}
|
||||
const downloadFile = (file:any) => {
|
||||
window.$message?.success(`演示:下载 ${file.name}`)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 我的草稿箱 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive class="pb-[12px] border-b">
|
||||
<NGi span="24 s:24 m:16">
|
||||
<div class="h-100% flex items-center gap-2">
|
||||
<Icon icon="mage:book" class="size-20px" :style="{ color: themeStore.themeColor }" />
|
||||
<p class="text-base font-semibold">变更归档(一次变更一个归档包 · 关闭即自动归档 · 只读锁定)</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:8" class="flex items-center justify-end gap-12px">
|
||||
<div class="flex items-center gap-2">
|
||||
<NButton size="small" type="primary" class="text-xs" @click="uploadFiles">
|
||||
<Icon icon="material-symbols:upload" class="size-16px" /> 上传归档补充
|
||||
</NButton>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<div
|
||||
class="mt-4 flex items-center gap-2 rounded-lg bg-[var(--bg-color)] px-3 py-2 text-xs text-[var(--theme-color)]"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--bg-color': getColorWithOpacity(themeStore.themeColor, 0.1)
|
||||
}"
|
||||
>
|
||||
<Icon icon="uil:lock" class="size-16px" />
|
||||
当前角色调阅范围:{{ scope.text }} · 归档包关闭时自动生成,内容只读锁定并记录 SHA-256 哈希,任何修改留痕可追责
|
||||
</div>
|
||||
<NInput v-model:value="aq" type="text" class="w-40 text-xs mt-3" placeholder="按变更单号精确查找,或按名称关键词检索(如 MOC-2026-R01-0039)">
|
||||
<template #suffix>
|
||||
<Icon icon="akar-icons:search" class="size-14px text-slate-400 cursor-pointer" />
|
||||
</template>
|
||||
</NInput>
|
||||
<!-- 筛选:时间 / 组织 / 专业 -->
|
||||
<div class="flex flex-wrap items-center gap-x-4 gap-y-1.5 mt-3">
|
||||
<div v-for="g in FILTER_GROUPS" :key="g.label" class="flex flex-wrap items-center gap-1">
|
||||
<span class="text-[11px] text-slate-400">{{ g.label }}</span>
|
||||
<NButton size="tiny" round v-for="o in g.opts" :key="o" @click="g.set(o)" class="text-[11px]" :type="g.val === o ? 'primary' : 'default'">{{ o }}</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid gap-3 grid-cols-3 mt-3">
|
||||
<!-- 左:三层目录树 / 筛选检索结果 -->
|
||||
<div class="rounded-lg border p-2">
|
||||
<div class="px-2 pb-1 text-xs font-medium text-slate-500">{{ (searching || filtering) ? `筛选 / 检索结果(${results.length})` : '归档区目录(装置 / 年份 / 变更单号)' }}</div>
|
||||
<template v-if="searching || filtering">
|
||||
<div v-if="results.length === 0" class="px-2 py-4 text-center text-xs text-slate-400">未找到匹配的归档包</div>
|
||||
<button v-for="p in results" :key="p.id" @click="selId = p.id"
|
||||
class="flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-xs hover:bg-[#DFE9F6]/60"
|
||||
:class="sel?.id === p.id ? 'bg-[#DFE9F6] font-medium text-[#1D4E9C]' : ''">
|
||||
<FolderArchive class="h-3.5 w-3.5 shrink-0 text-[#6E93C6]" />
|
||||
<span class="truncate">{{ p.id }}</span>
|
||||
<Tag v-if="p.revoked" class="border-red-200 bg-red-100 px-1 py-0 text-[10px] text-red-600">已撤销</Tag>
|
||||
<Tag v-if="p.supplement" class="border-amber-200 bg-amber-100 px-1 py-0 text-[10px] text-amber-700">补充</Tag>
|
||||
</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-for="u in tree" :key="u.unit">
|
||||
<button @click="openUnits[u.unit] = !openUnits[u.unit]"
|
||||
class="flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs font-medium hover:bg-slate-50 bg-transparent">
|
||||
<Icon icon="formkit:right" class="size-14px transition-transform" :class="openUnits[u.unit] ? 'rotate-90' : ''" />
|
||||
<Icon v-if="openUnits[u.unit]" icon="quill:folder-open" class="size-16px" :style="{ color: themeStore.themeColor }" />
|
||||
<Icon v-else icon="material-symbols:folder-outline" class="size-16px text-slate-400" />
|
||||
{{ u.unit }}
|
||||
</button>
|
||||
<template v-if="openUnits[u.unit]">
|
||||
<div v-for="y in u.years" :key="y.year">
|
||||
<div class="pl-7 pt-1 text-[11px] font-medium text-slate-400">{{ y.year }} 年({{ y.pkgs.length }})</div>
|
||||
<button v-for="p in y.pkgs" :key="p.id" @click="selId = p.id"
|
||||
class="flex w-full items-center gap-2 rounded-lg py-1.5 pl-8 pr-2 text-left text-xs hover:bg-[#DFE9F6]/60"
|
||||
:class="sel?.id === p.id ? 'bg-[var(--bg-color)] font-medium text-[var(--theme-color)]' : 'bg-transparent'"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--bg-color': getColorWithOpacity(themeStore.themeColor, 0.1)
|
||||
}"
|
||||
>
|
||||
<Icon icon="lucide:folder-archive" class="size-14px" :style="{ color: themeStore.themeColor }" />
|
||||
|
||||
<span class="truncate">{{ p.id }}</span>
|
||||
<NTag v-if="p.revoked" size="small" type="error" class="text-[10px]">已撤销</NTag>
|
||||
<NTag v-if="p.supplement" size="small" type="warning" class="text-[10px]">补充</NTag>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</div>
|
||||
<!-- 右:归档包详情 -->
|
||||
<div v-if="sel" class="rounded-lg border col-span-2">
|
||||
<div class="border-b p-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="text-sm font-semibold">{{ sel.id }}</span>
|
||||
<NTag v-if="sel.revoked" size="small" type="error">已撤销(保留归档备查)</NTag>
|
||||
<NTag v-else size="small" type="info">
|
||||
<template #icon>
|
||||
<Icon icon="uil:lock" class="size-14px" />
|
||||
</template>
|
||||
只读锁定
|
||||
</NTag>
|
||||
<NTag v-if="sel.supplement" size="small" type="warning">含归档补充</NTag>
|
||||
</div>
|
||||
<div class="mt-1 text-xs text-slate-600">{{ sel.name }}</div>
|
||||
<div class="mt-2 flex flex-wrap justify-between gap-x-4 gap-y-1 text-[11px] text-slate-500">
|
||||
<span>归档路径:归档区/{{ sel.unit }}/{{ sel.year }}/{{ sel.id }}/</span>
|
||||
<span>关闭时间:{{ sel.closedAt }}</span>
|
||||
<span>共 {{ sel.files }} 个文件 · {{ sel.size }}</span>
|
||||
<span class="flex items-center gap-1 font-mono">
|
||||
<Icon icon="lucide:hash" class="size-12px" />
|
||||
{{ sel.hash }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap gap-2">
|
||||
<NButton size="small" class="text-xs" @click="downloadZip(sel)">
|
||||
<Icon icon="material-symbols:download" class="size-14px" />
|
||||
下载归档包 ZIP
|
||||
</NButton>
|
||||
<NButton size="small" class="text-xs" @click="exportEvidenceChain">导出证据链</NButton>
|
||||
<NButton v-if="!sel.revoked" size="small" class="text-xs" @click="applySupplement">发起归档补充申请</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divide-y scroll-right">
|
||||
<div v-for="f in selFolders" :key="f.dir">
|
||||
<button @click="openFolders[f.dir] = !openFolders[f.dir]"
|
||||
class="flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-medium hover:bg-slate-50 bg-transparent">
|
||||
<Icon icon="formkit:right" class="size-14px text-slate-400 transition-transform" :class="openFolders[f.dir] ? 'rotate-90' : ''" />
|
||||
<Icon icon="quill:folder-open" v-if="openFolders[f.dir]" class="size-16px text-[#6E93C6]" />
|
||||
<Icon v-else icon="material-symbols:folder-outline" class="size-16px text-slate-400" />
|
||||
{{ f.dir }}
|
||||
<span class="ml-auto text-[11px] font-normal text-slate-400">{{ f.files.length }} 个文件</span>
|
||||
</button>
|
||||
<template v-if="openFolders[f.dir]">
|
||||
<div v-for="file in f.files" :key="file.name" class="flex items-center gap-2 py-1.5 pl-10 pr-3 text-xs hover:bg-slate-50">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-slate-400" />
|
||||
<span class="min-w-0 flex-1 truncate">{{ file.name }}</span>
|
||||
<span class="text-[11px] text-slate-400">{{ file.size }}</span>
|
||||
<NButton text type="primary" @click="previewFile(file)">
|
||||
<Icon icon="lucide:eye" class="size-14px" />
|
||||
</NButton>
|
||||
<NButton text type="primary" @click="downloadFile(file)">
|
||||
<Icon icon="material-symbols:download" class="size-16px" />
|
||||
</NButton>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 px-3 py-2 text-xs hover:bg-slate-50">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-slate-400" />
|
||||
<span class="flex-1 font-mono">归档索引.txt</span>
|
||||
<span class="text-[11px] text-slate-400">清单与哈希</span>
|
||||
<NButton text type="primary" @click="viewIndex">
|
||||
<Icon icon="lucide:eye" class="size-14px" />
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll-right {
|
||||
height: calc(100vh - 460px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
+213
-213
@@ -1,213 +1,213 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
import RingChart from './modules/ringChart.vue';
|
||||
import ColumnChart from './modules/columnChart.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "工艺", value: 52 },
|
||||
{ name: "设备", value: 49 },
|
||||
{ name: "管理", value: 25 },
|
||||
];
|
||||
const ACCEPT_COLORS = ["#2080f0", "#7CC242", "#F5A623"];
|
||||
|
||||
const changeData = ref([
|
||||
{
|
||||
name: '2月',
|
||||
value: 42,
|
||||
},
|
||||
{
|
||||
name: '3月',
|
||||
value: 35,
|
||||
},
|
||||
{
|
||||
name: '4月',
|
||||
value: 28,
|
||||
},
|
||||
{
|
||||
name: '5月',
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
name: '6月',
|
||||
value: 9,
|
||||
},
|
||||
{
|
||||
name: '7月',
|
||||
value: 33,
|
||||
},
|
||||
]);
|
||||
|
||||
const DEFAULT_EFF = [
|
||||
{ pct: 85, label: "按期投用率", c: "#1D4E9C" },
|
||||
{ pct: 64, label: "培训按期完成率", c: "#F5A623" },
|
||||
{ pct: 25, label: "超期变更占比", c: "#E15555" },
|
||||
];
|
||||
const DEFAULT_EXPORTS = ["变更数量统计", "变更周期分析", "超期预警报表", "风险分析执行", "PSSR 与验收", "关闭及时率"];
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid cols="s:1 m:4 l:4" responsive="screen" :x-gap="gap" :y-gap="16" :style="{'--theme-color': themeStore.themeColor,'--theme-bg': getColorWithOpacity(themeStore.themeColor, 0.1)}">
|
||||
<NGi>
|
||||
<div
|
||||
class="bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600 text-center">按期关闭率</p>
|
||||
<div class="flex justify-center py-2.5">
|
||||
<NProgress type="circle" :percentage="93.8" :offset-degree="180">
|
||||
<div class="flex flex-col items-center mt-2">
|
||||
<p class="flex items-end text-2xl font-bold leading-none text-[#1D2129]">
|
||||
93.8<span class="text-sm font-semibold">%</span>
|
||||
</p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Good</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
</div>
|
||||
<p class="text-12px text-center">近一年 · 全厂</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600 text-center">PSSR 完成率</p>
|
||||
<div class="flex justify-center py-2.5">
|
||||
<NProgress type="circle" :percentage="96" :offset-degree="180" status="success">
|
||||
<div class="flex flex-col items-center mt-2">
|
||||
<p class="flex items-end text-2xl font-bold leading-none text-[#1D2129]">
|
||||
96<span class="text-sm font-semibold">%</span>
|
||||
</p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Excellent</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
</div>
|
||||
<p class="text-12px text-center">近一年 · 全厂</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600 text-center">验收一次通过率</p>
|
||||
<div class="flex justify-center py-2.5">
|
||||
<NProgress type="circle" :percentage="88" :offset-degree="180" status="warning">
|
||||
<div class="flex flex-col items-center mt-2">
|
||||
<p class="flex items-end text-2xl font-bold leading-none text-[#1D2129]">
|
||||
88<span class="text-sm font-semibold">%</span>
|
||||
</p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Fair</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
</div>
|
||||
<p class="text-12px text-center">近一年 · 全厂</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="bg-white px-16px py-12px text-[#94a3b8] flex flex-col justify-center items-center"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600 text-center">平均关闭时长</p>
|
||||
<p class="mt-2 text-[40px] font-bold leading-none text-[#1D2129] text-center">8.2</p>
|
||||
<p class="text-12px text-center mt-1">天 · 优于行业均值</p>
|
||||
<span class="mt-2 rounded-full bg-[var(--theme-bg)] px-2 py-0.5 text-[11px] font-medium text-[var(--theme-color)]">环比 ↓ 0.6 天</span>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">月度变更数量</p>
|
||||
<div class="py-3 px-4">
|
||||
<ColumnChart :data="changeData" style="height: 220px" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">变更类型分布</p>
|
||||
<div class="py-3 px-4">
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">变更效率指标</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="space-y-5">
|
||||
<div v-for="r in DEFAULT_EFF" :key="r.label">
|
||||
<div class="flex items-baseline gap-2">
|
||||
<span class="text-2xl font-bold text-[#1D2129]">{{ r.pct }}<span class="text-sm font-semibold">%</span></span>
|
||||
<span class="text-xs text-slate-400">{{ r.label }}</span>
|
||||
</div>
|
||||
<div class="mt-1.5 h-1 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div v-if="r.label==='按期投用率'" class="h-full rounded-full bg-[var(--theme-color)]" :style="{ width: `${r.pct}%` }"></div>
|
||||
<div v-if="r.label==='培训按期完成率'" class="h-full rounded-full bg-[var(--warning-color)]" :style="{ width: `${r.pct}%` }"></div>
|
||||
<div v-if="r.label==='超期变更占比'" class="h-full rounded-full bg-[var(--error-color)]" :style="{ width: `${r.pct}%` }"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">近一年 · 全厂口径 · 超期占比越低越好</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:16">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">平均审批周期趋势(天)</p>
|
||||
<div class="py-3 px-4">
|
||||
<ColumnChart :data="changeData" style="height: 220px" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--theme-bg': getColorWithOpacity(themeStore.themeColor, 0.1),
|
||||
}"
|
||||
>
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">报表导出</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<div v-for="r in DEFAULT_EXPORTS" :key="r" @click="message.success(`演示:${r}已导出 Excel`)"
|
||||
class="cursor-pointer flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm hover:border-[var(--theme-color)] hover:bg-[var(--theme-bg)]">
|
||||
<Icon icon="akar-icons:file" class="size-16px text-slate-400" />
|
||||
{{ r }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
import RingChart from './modules/ringChart.vue';
|
||||
import ColumnChart from './modules/columnChart.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "工艺", value: 52 },
|
||||
{ name: "设备", value: 49 },
|
||||
{ name: "管理", value: 25 },
|
||||
];
|
||||
const ACCEPT_COLORS = ["#2080f0", "#7CC242", "#F5A623"];
|
||||
|
||||
const changeData = ref([
|
||||
{
|
||||
name: '2月',
|
||||
value: 42,
|
||||
},
|
||||
{
|
||||
name: '3月',
|
||||
value: 35,
|
||||
},
|
||||
{
|
||||
name: '4月',
|
||||
value: 28,
|
||||
},
|
||||
{
|
||||
name: '5月',
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
name: '6月',
|
||||
value: 9,
|
||||
},
|
||||
{
|
||||
name: '7月',
|
||||
value: 33,
|
||||
},
|
||||
]);
|
||||
|
||||
const DEFAULT_EFF = [
|
||||
{ pct: 85, label: "按期投用率", c: "#1D4E9C" },
|
||||
{ pct: 64, label: "培训按期完成率", c: "#F5A623" },
|
||||
{ pct: 25, label: "超期变更占比", c: "#E15555" },
|
||||
];
|
||||
const DEFAULT_EXPORTS = ["变更数量统计", "变更周期分析", "超期预警报表", "风险分析执行", "PSSR 与验收", "关闭及时率"];
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid cols="s:1 m:4 l:4" responsive="screen" :x-gap="gap" :y-gap="16" :style="{'--theme-color': themeStore.themeColor,'--theme-bg': getColorWithOpacity(themeStore.themeColor, 0.1)}">
|
||||
<NGi>
|
||||
<div
|
||||
class="bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600 text-center">按期关闭率</p>
|
||||
<div class="flex justify-center py-2.5">
|
||||
<NProgress type="circle" :percentage="93.8" :offset-degree="180">
|
||||
<div class="flex flex-col items-center mt-2">
|
||||
<p class="flex items-end text-2xl font-bold leading-none text-[#1D2129]">
|
||||
93.8<span class="text-sm font-semibold">%</span>
|
||||
</p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Good</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
</div>
|
||||
<p class="text-12px text-center">近一年 · 全厂</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600 text-center">PSSR 完成率</p>
|
||||
<div class="flex justify-center py-2.5">
|
||||
<NProgress type="circle" :percentage="96" :offset-degree="180" status="success">
|
||||
<div class="flex flex-col items-center mt-2">
|
||||
<p class="flex items-end text-2xl font-bold leading-none text-[#1D2129]">
|
||||
96<span class="text-sm font-semibold">%</span>
|
||||
</p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Excellent</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
</div>
|
||||
<p class="text-12px text-center">近一年 · 全厂</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600 text-center">验收一次通过率</p>
|
||||
<div class="flex justify-center py-2.5">
|
||||
<NProgress type="circle" :percentage="88" :offset-degree="180" status="warning">
|
||||
<div class="flex flex-col items-center mt-2">
|
||||
<p class="flex items-end text-2xl font-bold leading-none text-[#1D2129]">
|
||||
88<span class="text-sm font-semibold">%</span>
|
||||
</p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Fair</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
</div>
|
||||
<p class="text-12px text-center">近一年 · 全厂</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="bg-white px-16px py-12px text-[#94a3b8] flex flex-col justify-center items-center"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600 text-center">平均关闭时长</p>
|
||||
<p class="mt-2 text-[40px] font-bold leading-none text-[#1D2129] text-center">8.2</p>
|
||||
<p class="text-12px text-center mt-1">天 · 优于行业均值</p>
|
||||
<span class="mt-2 rounded-full bg-[var(--theme-bg)] px-2 py-0.5 text-[11px] font-medium text-[var(--theme-color)]">环比 ↓ 0.6 天</span>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">月度变更数量</p>
|
||||
<div class="py-3 px-4">
|
||||
<ColumnChart :data="changeData" style="height: 220px" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">变更类型分布</p>
|
||||
<div class="py-3 px-4">
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">变更效率指标</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="space-y-5">
|
||||
<div v-for="r in DEFAULT_EFF" :key="r.label">
|
||||
<div class="flex items-baseline gap-2">
|
||||
<span class="text-2xl font-bold text-[#1D2129]">{{ r.pct }}<span class="text-sm font-semibold">%</span></span>
|
||||
<span class="text-xs text-slate-400">{{ r.label }}</span>
|
||||
</div>
|
||||
<div class="mt-1.5 h-1 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div v-if="r.label==='按期投用率'" class="h-full rounded-full bg-[var(--theme-color)]" :style="{ width: `${r.pct}%` }"></div>
|
||||
<div v-if="r.label==='培训按期完成率'" class="h-full rounded-full bg-[var(--warning-color)]" :style="{ width: `${r.pct}%` }"></div>
|
||||
<div v-if="r.label==='超期变更占比'" class="h-full rounded-full bg-[var(--error-color)]" :style="{ width: `${r.pct}%` }"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-[11px] text-slate-400">近一年 · 全厂口径 · 超期占比越低越好</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:16">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">平均审批周期趋势(天)</p>
|
||||
<div class="py-3 px-4">
|
||||
<ColumnChart :data="changeData" style="height: 220px" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--theme-bg': getColorWithOpacity(themeStore.themeColor, 0.1),
|
||||
}"
|
||||
>
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">报表导出</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<div v-for="r in DEFAULT_EXPORTS" :key="r" @click="message.success(`演示:${r}已导出 Excel`)"
|
||||
class="cursor-pointer flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm hover:border-[var(--theme-color)] hover:bg-[var(--theme-bg)]">
|
||||
<Icon icon="akar-icons:file" class="size-16px text-slate-400" />
|
||||
{{ r }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -1,90 +1,90 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RingChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data: { name: string; value: number; }[]; }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
bottom: '20%',
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "5%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "11%",
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: true, // 新增,固定柱子位置
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitArea: { show: false },
|
||||
data: [] as string[],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
show: false,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
barWidth: 45,
|
||||
barGap: "10%",
|
||||
color: "#2080f0",
|
||||
label: { show: true, position: 'top',color: '#333',fontWeight: 'bold' },
|
||||
data: [] as number[],
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
let allMonth = props.data.map((item:any) => item.name);
|
||||
let values = props.data.map((item:any) => item.value);
|
||||
opts.xAxis[0].data = allMonth;
|
||||
opts.series[0].data = values;
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RingChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data: { name: string; value: number; }[]; }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
bottom: '20%',
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "5%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "11%",
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: true, // 新增,固定柱子位置
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitArea: { show: false },
|
||||
data: [] as string[],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
show: false,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
barWidth: 45,
|
||||
barGap: "10%",
|
||||
color: "#2080f0",
|
||||
label: { show: true, position: 'top',color: '#333',fontWeight: 'bold' },
|
||||
data: [] as number[],
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
let allMonth = props.data.map((item:any) => item.name);
|
||||
let values = props.data.map((item:any) => item.value);
|
||||
opts.xAxis[0].data = allMonth;
|
||||
opts.series[0].data = values;
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
+212
-212
@@ -1,213 +1,213 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const emit = defineEmits<{ go: [v: string, preset?: string];}>();
|
||||
|
||||
const restoresDone = ref<boolean>(false);
|
||||
const restores = ref<{ item: string, done: boolean }[]>([
|
||||
{ item: "安全阀起跳压力已恢复至原设定 0.8MPa(恢复操作票 CAO-2026-0812)", done: true },
|
||||
{ item: "恢复后运行参数核对:连续 24h 无起跳、阀体无泄漏", done: false },
|
||||
{ item: "恢复性检查记录与现场照片已上传", done: false },
|
||||
]);
|
||||
const canRestore = ref<boolean>(false);
|
||||
const readyToClose = ref<boolean>(false);
|
||||
|
||||
const checks = ref<{ item: string, done: boolean, note?: string }[]>([
|
||||
{ item: "变更验收完成(结论:基本达到 · 遗留项 2 项已登记跟踪)", done: true },
|
||||
{ item: "资料上传齐全(验收报告、运行记录、恢复确认记录)", done: false, note: "缺:更新后的安全阀台账" },
|
||||
{ item: "行动项全部关闭(4/4,含「关闭前完成」标记项)", done: true },
|
||||
{ item: "受控文件已更新至生效版(P&ID Rev.4、操作规程)", done: false, note: "安全阀台账待更新发布" },
|
||||
{ item: "培训考核完成(12/12 人),签到与成绩已归档", done: true },
|
||||
]);
|
||||
|
||||
const archiving = ref<boolean>(false);
|
||||
const step = ref<number>(0);
|
||||
const archivedHash = ref<string | null>(null);
|
||||
const allDone = computed(() => checks.value.every((c: { done: boolean }) => c.done));
|
||||
const isCloser = ref<boolean>(true);
|
||||
const startArchive = () => { step.value = 0; archiving.value = true; };
|
||||
|
||||
// 关闭即归档:自动归档八步流程
|
||||
const ARCHIVE_STEPS = [
|
||||
"关闭触发:接收「同意关闭」归档指令(不可逆)",
|
||||
"文件收集:申请表 / 审批记录 / 风险分析 / 培训 / PSSR / 验收单生成 PDF",
|
||||
"附件归集:原始附件、培训签到照片、PSSR 现场照片、验收签字文件",
|
||||
"受控文件复制:生效版与被替代旧版物理复制,与工作区脱离",
|
||||
"清单生成:自动生成归档索引与文件更新清单(新旧版本对照)",
|
||||
"打包锁定:写入归档区(装置 / 年份 / 变更单号),设为只读",
|
||||
"哈希存证:计算归档包 SHA-256 哈希值入库,防篡改校验",
|
||||
"状态更新:变更为「已关闭-已归档」,首页数据同步",
|
||||
];
|
||||
const closedAt = ref<string | null>(null);
|
||||
|
||||
const OVERDUE_LIST = [
|
||||
{ id: "MOC-2026-R01-0039", title: "V-102 安全阀起跳压力临时调整", stage: "待关闭", days: 4 },
|
||||
{ id: "MOC-2026-R02-0031", title: "冷冻盐水泵 P-103 叶轮材质变更", stage: "待验收", days: 7 },
|
||||
{ id: "MOC-2026-R01-0029", title: "操作规程修订(夏季工况)", stage: "审批中", days: 3 },
|
||||
];
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 关闭确认 -->
|
||||
<NCard
|
||||
:bordered="false"
|
||||
size="small"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--success-bg': getColorWithOpacity(themeStore.otherColor.success, 0.1),
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning, 0.1),
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--theme-bg': getColorWithOpacity(themeStore.themeColor, 0.1),
|
||||
}"
|
||||
>
|
||||
<div class="space-y-4">
|
||||
<NCard :bordered="true" :content-style="{ padding: '0' }" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="py-3 px-4 border-b flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 text-base font-semibold">
|
||||
<Icon icon="system-uicons:reset" class="size-16px text-[var(--error-color)]" />临时变更恢复确认 · 期限 30 天
|
||||
</div>
|
||||
<NTag v-if="restoresDone" size="small" type="success">恢复确认完成</NTag>
|
||||
<NTag v-else size="small" type="error">已超期 4 天 · 已升级上报刘副总</NTag>
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<div class="flex flex-wrap gap-x-6 gap-y-1 text-xs text-slate-500">
|
||||
<span>计划恢复时间:2026-08-14(临时调整起跳压力 0.88MPa → 恢复原设定 0.8MPa)</span>
|
||||
<span class="text-[var(--error-color)]">超期未恢复:每日 08:00 提醒申请人与属地负责人,已自动升级上报分管领导</span>
|
||||
</div>
|
||||
<div class="space-y-2 pt-3">
|
||||
<div v-for="(r, i) in restores" :key="r.item" class="flex items-center gap-3 rounded-lg border p-3"
|
||||
:class="r.done ? 'border-emerald-200 bg-emerald-50/40' : 'border-amber-200 bg-amber-50/40'">
|
||||
<Icon v-if="r.done" icon="material-symbols:check-circle-outline" class="size-20px text-[var(--success-color)]" />
|
||||
<Icon v-else icon="system-uicons:reset" class="size-18px text-[var(--warning-color)]" />
|
||||
<div class="flex-1 text-sm">{{ r.item }}</div>
|
||||
<NButton v-if="!r.done && canRestore" size="small" ghost class="text-xs"
|
||||
@click="restores = restores.map((x, xi) => (xi === i ? { ...x, done: true } : x)); toast.success('演示:恢复确认完成(移动端可拍照上传凭证)');">
|
||||
<Icon icon="ant-design:camera-outlined" class="size-16px mr-1" />
|
||||
确认恢复
|
||||
</NButton>
|
||||
<span v-if="!r.done && !canRestore" class="text-xs text-slate-400">待申请人 / 属地负责人确认</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="restoresDone" class="mt-3 rounded-lg bg-emerald-50 px-3 py-2 text-xs text-emerald-700">
|
||||
临时变更恢复确认完成,恢复操作票、参数核对记录与照片将自动纳入归档包「5-验收记录」
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
<NCard :bordered="true" :content-style="{ padding: '0' }" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="py-3 px-4 border-b flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 text-base font-semibold">
|
||||
<Icon icon="material-symbols:check-circle-outline" class="size-18px text-slate-500" />关闭校验 · MOC-2026-R01-0039(紧急变更补办)
|
||||
</div>
|
||||
<NTag v-if="readyToClose" size="small" type="success">校验全绿 · 已推送专责</NTag>
|
||||
<NTag v-else size="small" type="warning">超期 4 天</NTag>
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<div class="flex items-center gap-2 rounded-lg bg-[var(--theme-bg)] px-3 py-2 text-xs text-[var(--theme-color)]">
|
||||
<Icon icon="lucide:bell" class="size-14px" />
|
||||
前置条件(验收完成 / 资料齐全 / 行动项关闭 / 恢复确认 / 受控文件更新)全部满足后,系统自动推送变更主管部门专责(王海燕 · 安全环保部),并抄送申请人与属地负责人
|
||||
</div>
|
||||
<div class="space-y-2 pt-3">
|
||||
<div v-for="(c, i) in checks" :key="c.item" class="flex items-center gap-3 rounded-lg border p-3"
|
||||
:class="c.done ? 'border-emerald-200 bg-emerald-50/40' : 'border-red-200 bg-[#FFF2F0]'">
|
||||
<Icon v-if="c.done" icon="material-symbols:check-circle-outline" class="size-20px text-[var(--success-color)]" />
|
||||
<Icon v-else icon="ant-design:close-circle-outlined" class="size-18px text-[var(--error-color)]" />
|
||||
<div class="flex-1 text-sm">{{ c.item }}<span v-if="c.note" class="ml-2 text-xs text-[var(--error-color)]">{{ c.note }}</span></div>
|
||||
<NButton v-if="!c.done" text type="primary"
|
||||
@click="checks = checks.map((x, xi) => (xi === i ? { ...x, done: true } : x)); toast.success('演示:资料已补充上传,关闭校验清单已同步更新并重新推送专责');">去补充</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 关闭按钮区 -->
|
||||
<div v-if="!archivedHash && !archiving" class="mt-4 space-y-2">
|
||||
<div v-if="readyToClose" class="flex items-center gap-2 rounded-lg bg-[var(--theme-bg)] px-3 py-2 text-xs text-[var(--theme-color)]">
|
||||
<Icon icon="lucide:bell" class="size-14px" />
|
||||
系统已于今日 09:12 自动推送关闭待办至变更主管部门专责(王海燕)· 系统消息 + 企业微信
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 rounded-lg bg-slate-50 p-3">
|
||||
<span class="text-sm text-slate-500">
|
||||
{{ !restoresDone
|
||||
? '临时变更尚未完成恢复确认,禁止关闭(恢复确认是临时变更关闭的前置条件)'
|
||||
: allDone
|
||||
? isCloser
|
||||
? '全部条件满足。确认关闭后系统记录关闭时间与关闭人,并自动生成归档包(副本归档 · 只读锁定 · 哈希存证)'
|
||||
: '全部条件满足,待变更主管部门专责(王海燕 · 安全环保部)确认关闭'
|
||||
: '存在未满足条件,禁止关闭;确需例外须填写说明并经分管领导确认' }}
|
||||
</span>
|
||||
<NButton v-if="isCloser" size="small" type="primary" :disabled="!readyToClose" class="text-xs" @click="startArchive">
|
||||
<Icon icon="uil:lock" class="size-14px mr-1" /> 确认关闭并归档
|
||||
</NButton>
|
||||
<span v-else class="text-xs text-[var(--warning-color)]">仅变更主管部门专责可确认关闭 · 切换至「王海燕 · 安全工程师」体验</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 自动归档流程 -->
|
||||
<div v-if="archiving" class="mt-4 space-y-1.5 rounded-lg border border-[var(--theme-color)] bg-[var(--theme-bg)] p-4">
|
||||
<div class="mb-2 flex items-center gap-2 text-sm font-semibold text-[var(--theme-color)]">
|
||||
<Icon icon="ri:loader-4-fill" class="size-18px animate-spin" />
|
||||
系统自动归档中,无需人工整理…
|
||||
</div>
|
||||
<div v-for="(s, i) in ARCHIVE_STEPS" :key="s" class="flex items-center gap-2 text-xs"
|
||||
:class="i < step ? 'text-[var(--success-color)]' : i === step ? 'font-medium text-[var(--theme-color)]' : 'text-slate-400'">
|
||||
<Icon v-if="i < step" icon="material-symbols:check-circle-outline" class="size-16px" />
|
||||
<Icon v-else-if="i === step" icon="ri:loader-4-fill" class="size-16px animate-spin" />
|
||||
<span v-else class="h-3.5 w-3.5 shrink-0 rounded-full border border-slate-300"></span>
|
||||
{{ i + 1 }}. {{ s }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 归档完成 -->
|
||||
<div v-if="archivedHash" class="mt-4 space-y-3 rounded-lg border border-emerald-300 bg-emerald-50/60 p-4">
|
||||
<div class="flex flex-wrap items-center gap-2 text-sm font-semibold text-emerald-800">
|
||||
<Icon icon="uil:lock" class="size-18px" /> 已关闭-已归档 · 归档包只读锁定,任何角色不可修改或删除
|
||||
</div>
|
||||
<div class="grid gap-1.5 text-xs text-emerald-800/90 sm:grid-cols-2">
|
||||
<span>关闭时间:{{ closedAt }} · 关闭人:王海燕(变更管理专责 · 安全环保部)</span>
|
||||
<span>归档路径:归档区 / 01-常减压装置 / 2026 / MOC-2026-R01-0039/</span>
|
||||
<span class="flex items-center gap-1"><Hash class="h-3 w-3" /> SHA-256:{{ archivedHash }}</span>
|
||||
<span>归档内容:6 类文件夹 + 归档索引.txt(共 24 个文件,18.4MB)</span>
|
||||
<span>防篡改:系统定期校验哈希值,异常自动告警并从备份恢复</span>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<NButton size="small" type="success" class="text-xs" @click="emit('go', 'knowledge')">
|
||||
<Icon icon="lucide:folder-archive" class="size-14px mr-1" /> 查看归档包
|
||||
</NButton>
|
||||
<NButton size="small" type="primary" class="text-xs" @click="toast.success('演示:下载完整归档包(ZIP,用于外部审计)')">
|
||||
<Icon icon="material-symbols:download" class="size-18px" /> 下载 ZIP
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
<NCard :bordered="true" :content-style="{ padding: '0' }" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="py-3 px-4 border-b flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 text-base font-semibold">
|
||||
<Icon icon="proicons:alert-triangle" class="size-18px text-slate-500" />关闭提醒
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-y-2 p-4">
|
||||
<div v-for="o in OVERDUE_LIST" :key="o.id" class="flex items-center justify-between rounded-lg border border-amber-200 bg-amber-50 px-3 py-2">
|
||||
<div class="min-w-0">
|
||||
<div class="truncate text-sm">{{ o.title }}</div>
|
||||
<div class="text-xs text-slate-500">{{ o.id }} · {{ o.stage }}</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<NTag size="small" type="error">超期 {{ o.days }} 天</NTag>
|
||||
<NButton size="small" class="text-xs" @click="toast.info('演示:已催办(系统消息 + 企业微信)')">催办</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const emit = defineEmits<{ go: [v: string, preset?: string];}>();
|
||||
|
||||
const restoresDone = ref<boolean>(false);
|
||||
const restores = ref<{ item: string, done: boolean }[]>([
|
||||
{ item: "安全阀起跳压力已恢复至原设定 0.8MPa(恢复操作票 CAO-2026-0812)", done: true },
|
||||
{ item: "恢复后运行参数核对:连续 24h 无起跳、阀体无泄漏", done: false },
|
||||
{ item: "恢复性检查记录与现场照片已上传", done: false },
|
||||
]);
|
||||
const canRestore = ref<boolean>(false);
|
||||
const readyToClose = ref<boolean>(false);
|
||||
|
||||
const checks = ref<{ item: string, done: boolean, note?: string }[]>([
|
||||
{ item: "变更验收完成(结论:基本达到 · 遗留项 2 项已登记跟踪)", done: true },
|
||||
{ item: "资料上传齐全(验收报告、运行记录、恢复确认记录)", done: false, note: "缺:更新后的安全阀台账" },
|
||||
{ item: "行动项全部关闭(4/4,含「关闭前完成」标记项)", done: true },
|
||||
{ item: "受控文件已更新至生效版(P&ID Rev.4、操作规程)", done: false, note: "安全阀台账待更新发布" },
|
||||
{ item: "培训考核完成(12/12 人),签到与成绩已归档", done: true },
|
||||
]);
|
||||
|
||||
const archiving = ref<boolean>(false);
|
||||
const step = ref<number>(0);
|
||||
const archivedHash = ref<string | null>(null);
|
||||
const allDone = computed(() => checks.value.every((c: { done: boolean }) => c.done));
|
||||
const isCloser = ref<boolean>(true);
|
||||
const startArchive = () => { step.value = 0; archiving.value = true; };
|
||||
|
||||
// 关闭即归档:自动归档八步流程
|
||||
const ARCHIVE_STEPS = [
|
||||
"关闭触发:接收「同意关闭」归档指令(不可逆)",
|
||||
"文件收集:申请表 / 审批记录 / 风险分析 / 培训 / PSSR / 验收单生成 PDF",
|
||||
"附件归集:原始附件、培训签到照片、PSSR 现场照片、验收签字文件",
|
||||
"受控文件复制:生效版与被替代旧版物理复制,与工作区脱离",
|
||||
"清单生成:自动生成归档索引与文件更新清单(新旧版本对照)",
|
||||
"打包锁定:写入归档区(装置 / 年份 / 变更单号),设为只读",
|
||||
"哈希存证:计算归档包 SHA-256 哈希值入库,防篡改校验",
|
||||
"状态更新:变更为「已关闭-已归档」,首页数据同步",
|
||||
];
|
||||
const closedAt = ref<string | null>(null);
|
||||
|
||||
const OVERDUE_LIST = [
|
||||
{ id: "MOC-2026-R01-0039", title: "V-102 安全阀起跳压力临时调整", stage: "待关闭", days: 4 },
|
||||
{ id: "MOC-2026-R02-0031", title: "冷冻盐水泵 P-103 叶轮材质变更", stage: "待验收", days: 7 },
|
||||
{ id: "MOC-2026-R01-0029", title: "操作规程修订(夏季工况)", stage: "审批中", days: 3 },
|
||||
];
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 关闭确认 -->
|
||||
<NCard
|
||||
:bordered="false"
|
||||
size="small"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--success-bg': getColorWithOpacity(themeStore.otherColor.success, 0.1),
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning, 0.1),
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--theme-bg': getColorWithOpacity(themeStore.themeColor, 0.1),
|
||||
}"
|
||||
>
|
||||
<div class="space-y-4">
|
||||
<NCard :bordered="true" :content-style="{ padding: '0' }" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="py-3 px-4 border-b flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 text-base font-semibold">
|
||||
<Icon icon="system-uicons:reset" class="size-16px text-[var(--error-color)]" />临时变更恢复确认 · 期限 30 天
|
||||
</div>
|
||||
<NTag v-if="restoresDone" size="small" type="success">恢复确认完成</NTag>
|
||||
<NTag v-else size="small" type="error">已超期 4 天 · 已升级上报刘副总</NTag>
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<div class="flex flex-wrap gap-x-6 gap-y-1 text-xs text-slate-500">
|
||||
<span>计划恢复时间:2026-08-14(临时调整起跳压力 0.88MPa → 恢复原设定 0.8MPa)</span>
|
||||
<span class="text-[var(--error-color)]">超期未恢复:每日 08:00 提醒申请人与属地负责人,已自动升级上报分管领导</span>
|
||||
</div>
|
||||
<div class="space-y-2 pt-3">
|
||||
<div v-for="(r, i) in restores" :key="r.item" class="flex items-center gap-3 rounded-lg border p-3"
|
||||
:class="r.done ? 'border-emerald-200 bg-emerald-50/40' : 'border-amber-200 bg-amber-50/40'">
|
||||
<Icon v-if="r.done" icon="material-symbols:check-circle-outline" class="size-20px text-[var(--success-color)]" />
|
||||
<Icon v-else icon="system-uicons:reset" class="size-18px text-[var(--warning-color)]" />
|
||||
<div class="flex-1 text-sm">{{ r.item }}</div>
|
||||
<NButton v-if="!r.done && canRestore" size="small" ghost class="text-xs"
|
||||
@click="restores = restores.map((x, xi) => (xi === i ? { ...x, done: true } : x)); toast.success('演示:恢复确认完成(移动端可拍照上传凭证)');">
|
||||
<Icon icon="ant-design:camera-outlined" class="size-16px mr-1" />
|
||||
确认恢复
|
||||
</NButton>
|
||||
<span v-if="!r.done && !canRestore" class="text-xs text-slate-400">待申请人 / 属地负责人确认</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="restoresDone" class="mt-3 rounded-lg bg-emerald-50 px-3 py-2 text-xs text-emerald-700">
|
||||
临时变更恢复确认完成,恢复操作票、参数核对记录与照片将自动纳入归档包「5-验收记录」
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
<NCard :bordered="true" :content-style="{ padding: '0' }" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="py-3 px-4 border-b flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 text-base font-semibold">
|
||||
<Icon icon="material-symbols:check-circle-outline" class="size-18px text-slate-500" />关闭校验 · MOC-2026-R01-0039(紧急变更补办)
|
||||
</div>
|
||||
<NTag v-if="readyToClose" size="small" type="success">校验全绿 · 已推送专责</NTag>
|
||||
<NTag v-else size="small" type="warning">超期 4 天</NTag>
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<div class="flex items-center gap-2 rounded-lg bg-[var(--theme-bg)] px-3 py-2 text-xs text-[var(--theme-color)]">
|
||||
<Icon icon="lucide:bell" class="size-14px" />
|
||||
前置条件(验收完成 / 资料齐全 / 行动项关闭 / 恢复确认 / 受控文件更新)全部满足后,系统自动推送变更主管部门专责(王海燕 · 安全环保部),并抄送申请人与属地负责人
|
||||
</div>
|
||||
<div class="space-y-2 pt-3">
|
||||
<div v-for="(c, i) in checks" :key="c.item" class="flex items-center gap-3 rounded-lg border p-3"
|
||||
:class="c.done ? 'border-emerald-200 bg-emerald-50/40' : 'border-red-200 bg-[#FFF2F0]'">
|
||||
<Icon v-if="c.done" icon="material-symbols:check-circle-outline" class="size-20px text-[var(--success-color)]" />
|
||||
<Icon v-else icon="ant-design:close-circle-outlined" class="size-18px text-[var(--error-color)]" />
|
||||
<div class="flex-1 text-sm">{{ c.item }}<span v-if="c.note" class="ml-2 text-xs text-[var(--error-color)]">{{ c.note }}</span></div>
|
||||
<NButton v-if="!c.done" text type="primary"
|
||||
@click="checks = checks.map((x, xi) => (xi === i ? { ...x, done: true } : x)); toast.success('演示:资料已补充上传,关闭校验清单已同步更新并重新推送专责');">去补充</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 关闭按钮区 -->
|
||||
<div v-if="!archivedHash && !archiving" class="mt-4 space-y-2">
|
||||
<div v-if="readyToClose" class="flex items-center gap-2 rounded-lg bg-[var(--theme-bg)] px-3 py-2 text-xs text-[var(--theme-color)]">
|
||||
<Icon icon="lucide:bell" class="size-14px" />
|
||||
系统已于今日 09:12 自动推送关闭待办至变更主管部门专责(王海燕)· 系统消息 + 企业微信
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 rounded-lg bg-slate-50 p-3">
|
||||
<span class="text-sm text-slate-500">
|
||||
{{ !restoresDone
|
||||
? '临时变更尚未完成恢复确认,禁止关闭(恢复确认是临时变更关闭的前置条件)'
|
||||
: allDone
|
||||
? isCloser
|
||||
? '全部条件满足。确认关闭后系统记录关闭时间与关闭人,并自动生成归档包(副本归档 · 只读锁定 · 哈希存证)'
|
||||
: '全部条件满足,待变更主管部门专责(王海燕 · 安全环保部)确认关闭'
|
||||
: '存在未满足条件,禁止关闭;确需例外须填写说明并经分管领导确认' }}
|
||||
</span>
|
||||
<NButton v-if="isCloser" size="small" type="primary" :disabled="!readyToClose" class="text-xs" @click="startArchive">
|
||||
<Icon icon="uil:lock" class="size-14px mr-1" /> 确认关闭并归档
|
||||
</NButton>
|
||||
<span v-else class="text-xs text-[var(--warning-color)]">仅变更主管部门专责可确认关闭 · 切换至「王海燕 · 安全工程师」体验</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 自动归档流程 -->
|
||||
<div v-if="archiving" class="mt-4 space-y-1.5 rounded-lg border border-[var(--theme-color)] bg-[var(--theme-bg)] p-4">
|
||||
<div class="mb-2 flex items-center gap-2 text-sm font-semibold text-[var(--theme-color)]">
|
||||
<Icon icon="ri:loader-4-fill" class="size-18px animate-spin" />
|
||||
系统自动归档中,无需人工整理…
|
||||
</div>
|
||||
<div v-for="(s, i) in ARCHIVE_STEPS" :key="s" class="flex items-center gap-2 text-xs"
|
||||
:class="i < step ? 'text-[var(--success-color)]' : i === step ? 'font-medium text-[var(--theme-color)]' : 'text-slate-400'">
|
||||
<Icon v-if="i < step" icon="material-symbols:check-circle-outline" class="size-16px" />
|
||||
<Icon v-else-if="i === step" icon="ri:loader-4-fill" class="size-16px animate-spin" />
|
||||
<span v-else class="h-3.5 w-3.5 shrink-0 rounded-full border border-slate-300"></span>
|
||||
{{ i + 1 }}. {{ s }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 归档完成 -->
|
||||
<div v-if="archivedHash" class="mt-4 space-y-3 rounded-lg border border-emerald-300 bg-emerald-50/60 p-4">
|
||||
<div class="flex flex-wrap items-center gap-2 text-sm font-semibold text-emerald-800">
|
||||
<Icon icon="uil:lock" class="size-18px" /> 已关闭-已归档 · 归档包只读锁定,任何角色不可修改或删除
|
||||
</div>
|
||||
<div class="grid gap-1.5 text-xs text-emerald-800/90 sm:grid-cols-2">
|
||||
<span>关闭时间:{{ closedAt }} · 关闭人:王海燕(变更管理专责 · 安全环保部)</span>
|
||||
<span>归档路径:归档区 / 01-常减压装置 / 2026 / MOC-2026-R01-0039/</span>
|
||||
<span class="flex items-center gap-1"><Hash class="h-3 w-3" /> SHA-256:{{ archivedHash }}</span>
|
||||
<span>归档内容:6 类文件夹 + 归档索引.txt(共 24 个文件,18.4MB)</span>
|
||||
<span>防篡改:系统定期校验哈希值,异常自动告警并从备份恢复</span>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<NButton size="small" type="success" class="text-xs" @click="emit('go', 'knowledge')">
|
||||
<Icon icon="lucide:folder-archive" class="size-14px mr-1" /> 查看归档包
|
||||
</NButton>
|
||||
<NButton size="small" type="primary" class="text-xs" @click="toast.success('演示:下载完整归档包(ZIP,用于外部审计)')">
|
||||
<Icon icon="material-symbols:download" class="size-18px" /> 下载 ZIP
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
<NCard :bordered="true" :content-style="{ padding: '0' }" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="py-3 px-4 border-b flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 text-base font-semibold">
|
||||
<Icon icon="proicons:alert-triangle" class="size-18px text-slate-500" />关闭提醒
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-y-2 p-4">
|
||||
<div v-for="o in OVERDUE_LIST" :key="o.id" class="flex items-center justify-between rounded-lg border border-amber-200 bg-amber-50 px-3 py-2">
|
||||
<div class="min-w-0">
|
||||
<div class="truncate text-sm">{{ o.title }}</div>
|
||||
<div class="text-xs text-slate-500">{{ o.id }} · {{ o.stage }}</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<NTag size="small" type="error">超期 {{ o.days }} 天</NTag>
|
||||
<NButton size="small" class="text-xs" @click="toast.info('演示:已催办(系统消息 + 企业微信)')">催办</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
@@ -1,280 +1,280 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from "@/utils/common";
|
||||
import ColumnChart from './modules/columnChart.vue';
|
||||
import RingChart from "./modules/ringChart.vue";
|
||||
import RingChart2 from "./modules/ringChart2.vue";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const emit = defineEmits<{ go: [v: string, preset?: string]; openChange: [c: any] }>();
|
||||
|
||||
const range = ref("近一年");
|
||||
const rangeOptions = [
|
||||
{label: "近一年", value: "近一年"},
|
||||
{label: "近半年", value: "近半年"},
|
||||
{label: "近三个月", value: "近三个月"},
|
||||
{label: "近一个月", value: "近一个月"},
|
||||
];
|
||||
|
||||
const changeData = ref([
|
||||
{
|
||||
name: '一车间',
|
||||
value: 42,
|
||||
},
|
||||
{
|
||||
name: '二车间',
|
||||
value: 35,
|
||||
},
|
||||
{
|
||||
name: '三车间',
|
||||
value: 28,
|
||||
},
|
||||
{
|
||||
name: '供应部',
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
name: '质量部',
|
||||
value: 9,
|
||||
},
|
||||
]);
|
||||
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "工艺", value: 58 },
|
||||
{ name: "设备", value: 41 },
|
||||
{ name: "管理", value: 27 },
|
||||
];
|
||||
const ACCEPT_COLORS = ["#2080f0", "#faad14", "#52c41a"];
|
||||
|
||||
const DEPT_ACCEPT2 = [
|
||||
{ name: "完全达到", value: 13, money: 61.2, rate: 68 },
|
||||
{ name: "基本达到", value: 4, money: 19.8, rate: 21 },
|
||||
{ name: "未达到", value: 2, money: 5.4, rate: 11 },
|
||||
];
|
||||
const ACCEPT_COLORS2 = ["#52c41a", "#faad14", "#ff4d4f"];
|
||||
|
||||
const residualHigh = ref<{id: string, title: string}>({id:'MOC-2026-R01-0035',title:'R-201 反应釜搅拌器电机更换(55kW→75kW 防爆电机)'});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 我的工作台 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<p class="text-sm font-bold text-slate-800">全厂变更数据中心</p>
|
||||
<p class="text-[11px] text-slate-400 mt-[1px]">时间相关数据统一在此查询 · 统计时段</p>
|
||||
<NSelect v-model:value="range" :options="rangeOptions" size="tiny" class="w-28" />
|
||||
<NButton ghost size="small" class="ml-auto text-xs">导出</NButton>
|
||||
</div>
|
||||
</NCard>
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid cols="s:1 m:2 l:4" responsive="screen" :x-gap="gap" :y-gap="16"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--theme-bg': getColorWithOpacity(themeStore.themeColor, 0.2),
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning, 0.2),
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--success-bg': getColorWithOpacity(themeStore.otherColor.success, 0.2),
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
'--error-bg': getColorWithOpacity(themeStore.otherColor.error, 0.2),
|
||||
}"
|
||||
>
|
||||
<NGi>
|
||||
<div
|
||||
class="h-100% flex-1 flex items-center gap-3 bg-white px-16px py-12px cursor-pointer transition hover:-translate-y-1"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@click="emit('go', 'tasks')"
|
||||
>
|
||||
<span class="shrink-0 rounded-lg p-2.5 bg-[var(--theme-bg)]">
|
||||
<Icon icon="akar-icons:file" class="size-24px text-[--theme-color]" />
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="126"
|
||||
class="text-26px font-600"
|
||||
/>
|
||||
<p class="text-[11px] font-semibold text-slate-400">变更总数 · {{ range }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="h-100% flex-1 flex items-center gap-3 bg-white px-16px py-12px cursor-pointer transition hover:-translate-y-1"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@click="emit('go', 'tasks')"
|
||||
>
|
||||
<span class="shrink-0 rounded-lg p-2.5 bg-[var(--warning-bg)]">
|
||||
<Icon icon="lucide:shield-check" class="size-24px text-[--warning-color]" />
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="18"
|
||||
class="text-26px font-600"
|
||||
/>
|
||||
<p class="text-[11px] font-semibold text-slate-400">重要变更数量 · {{ range }} · 占比 14%</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="h-100% flex-1 flex items-center gap-3 bg-white px-16px py-12px cursor-pointer transition hover:-translate-y-1"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@click="emit('go', 'tasks')"
|
||||
>
|
||||
<span class="shrink-0 rounded-lg p-2.5 bg-[var(--warning-bg)]">
|
||||
<Icon icon="lucide:shield-check" class="size-24px text-[--warning-color]" />
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="4"
|
||||
class="text-26px font-600 text-[var(--error-color)]"
|
||||
/>
|
||||
<p class="text-26px font-600 text-[var(--error-color)]"> 高 /</p>
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="11"
|
||||
class="text-26px font-600 text-[var(--error-color)]"
|
||||
/><p class="text-26px font-600 text-[var(--error-color)]"> 中</p>
|
||||
</div>
|
||||
<p class="text-[11px] font-semibold text-slate-400">变更新增风险 · 剩余高风险 1 · 剩余中风险 6</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="h-100% flex-1 flex items-center gap-3 bg-white px-16px py-12px cursor-pointer transition hover:-translate-y-1"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@click="emit('go', 'tasks')"
|
||||
>
|
||||
<span class="shrink-0 rounded-lg p-2.5 bg-[var(--success-bg)]">
|
||||
<Icon icon="material-symbols:check-circle-outline" class="size-24px text-[--success-color]" />
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="86.4"
|
||||
class="text-26px font-600"
|
||||
/>
|
||||
<p class="text-[11px] font-semibold text-slate-400">验收投入合计 · 已验收 19 起 · 完全达标率 68%</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid
|
||||
:x-gap="gap" :y-gap="16" responsive="screen" item-responsive
|
||||
:style="{
|
||||
'--theme-color':themeStore.themeColor
|
||||
}"
|
||||
>
|
||||
<NGi span="24 s:24 m:24 l:14">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center mb-3 gap-2">
|
||||
<Icon icon="akar-icons:file" class="size-16px text-[--theme-color]" />
|
||||
<p class="text-13px font-700 text-#64749a">各车间变更数量</p>
|
||||
<p class="text-11px text-#94a3b8 mt-2px">{{range}} · 按申请部门</p>
|
||||
</div>
|
||||
<ColumnChart :data="changeData" style="height: 100%;" />
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:10">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center mb-3 gap-2">
|
||||
<Icon icon="akar-icons:file" class="size-16px text-[--theme-color]" />
|
||||
<p class="text-13px font-700 text-#64749a">变更类型分布</p>
|
||||
<p class="text-11px text-#94a3b8 mt-2px">{{range}} · 工艺 / 设备 / 管理</p>
|
||||
</div>
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" :range="range" />
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid
|
||||
:x-gap="gap" :y-gap="16" responsive="screen" item-responsive
|
||||
:style="{
|
||||
'--error-color':themeStore.otherColor.error,
|
||||
'--warning-color':themeStore.otherColor.warning,
|
||||
'--success-color':themeStore.otherColor.success,
|
||||
'--theme-color':themeStore.themeColor
|
||||
}"
|
||||
>
|
||||
<NGi span="24 s:24 m:24 l:10">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center mb-3 gap-2">
|
||||
<Icon icon="lucide:shield-alert" class="size-16px text-[--theme-color]" />
|
||||
<p class="text-13px font-700 text-#64749a">风险增量与管控</p>
|
||||
<p class="text-11px text-#94a3b8 mt-2px">{{range}} · 变更新增风险与管控落实</p>
|
||||
</div>
|
||||
<div class="space-y-2.5">
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<div class="rounded-lg bg-red-50 px-3 py-2">
|
||||
<div class="text-[11px] text-[var(--error-color)]">新增固有高风险项</div>
|
||||
<div class="text-xl font-bold text-[var(--error-color)]">4</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-amber-50 px-3 py-2">
|
||||
<div class="text-[11px] text-[var(--warning-color)]">新增中风险项</div>
|
||||
<div class="text-xl font-bold text-[var(--warning-color)]">11</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-slate-50 px-3 py-2">
|
||||
<div class="text-[11px] text-slate-500">剩余高风险项</div>
|
||||
<div class="text-xl font-bold text-slate-800">1</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-slate-50 px-3 py-2">
|
||||
<div class="text-[11px] text-slate-500">剩余中风险项</div>
|
||||
<div class="text-xl font-bold text-slate-800">6</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex justify-between text-[11px] text-slate-500">
|
||||
<span>管控措施落实率</span>
|
||||
<span class="font-semibold text-[var(--success-color)]">96%</span>
|
||||
</div>
|
||||
<div class="mt-1 h-2 w-full rounded-full bg-slate-100">
|
||||
<div class="h-2 rounded-full bg-[var(--success-color)]" style="width: 96%" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="residualHigh.id" @click="emit('openChange', residualHigh)"
|
||||
class="cursor-pointer w-full rounded-lg border border-red-100 bg-[#FFF2F0] px-3 py-2 text-left transition hover:border-red-300">
|
||||
<span class="block text-[11px] font-medium text-[var(--error-color)]">剩余高风险 · 措施落实中</span>
|
||||
<span class="mt-0.5 block truncate text-xs font-medium text-slate-800">{{ residualHigh.title }}</span>
|
||||
<span class="mt-0.5 block text-[11px] text-slate-400">{{ residualHigh.id }} · 电机吊装作业管控措施执行跟踪</span>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:14">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center mb-3 gap-2">
|
||||
<Icon icon="material-symbols:check-circle-outline" class="size-16px text-[--theme-color]" />
|
||||
<p class="text-13px font-700 text-#64749a">变更投入和效果</p>
|
||||
<p class="text-11px text-#94a3b8 mt-2px">{{range}} · 支持查询验收明细</p>
|
||||
</div>
|
||||
<RingChart2 :data="DEPT_ACCEPT2" :colors="ACCEPT_COLORS2" style="height: 210px;" />
|
||||
<div class="flex items-center justify-between border-slate-200 pt-1.5">
|
||||
<span class="text-[11px] text-slate-400">投入合计(变更材料和实施费) · 完全达到率 68%</span>
|
||||
<span class="text-xs font-bold text-[var(--theme-color)]">86.4 万元</span>
|
||||
</div>
|
||||
<div @click="emit('go', 'invest')"
|
||||
class="cursor-pointer mt-3 flex w-full items-center justify-center gap-1 rounded-lg border border-dashed py-2 text-[11px] text-slate-400 transition hover:border-[#6E93C6] hover:text-[#1D4E9C]">
|
||||
验收明细(名称 / 日期链 / 费用 / 结论)见左边栏「变更效果跟踪」<ChevronRight class="h-3 w-3" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from "@/utils/common";
|
||||
import ColumnChart from './modules/columnChart.vue';
|
||||
import RingChart from "./modules/ringChart.vue";
|
||||
import RingChart2 from "./modules/ringChart2.vue";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const emit = defineEmits<{ go: [v: string, preset?: string]; openChange: [c: any] }>();
|
||||
|
||||
const range = ref("近一年");
|
||||
const rangeOptions = [
|
||||
{label: "近一年", value: "近一年"},
|
||||
{label: "近半年", value: "近半年"},
|
||||
{label: "近三个月", value: "近三个月"},
|
||||
{label: "近一个月", value: "近一个月"},
|
||||
];
|
||||
|
||||
const changeData = ref([
|
||||
{
|
||||
name: '一车间',
|
||||
value: 42,
|
||||
},
|
||||
{
|
||||
name: '二车间',
|
||||
value: 35,
|
||||
},
|
||||
{
|
||||
name: '三车间',
|
||||
value: 28,
|
||||
},
|
||||
{
|
||||
name: '供应部',
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
name: '质量部',
|
||||
value: 9,
|
||||
},
|
||||
]);
|
||||
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "工艺", value: 58 },
|
||||
{ name: "设备", value: 41 },
|
||||
{ name: "管理", value: 27 },
|
||||
];
|
||||
const ACCEPT_COLORS = ["#2080f0", "#faad14", "#52c41a"];
|
||||
|
||||
const DEPT_ACCEPT2 = [
|
||||
{ name: "完全达到", value: 13, money: 61.2, rate: 68 },
|
||||
{ name: "基本达到", value: 4, money: 19.8, rate: 21 },
|
||||
{ name: "未达到", value: 2, money: 5.4, rate: 11 },
|
||||
];
|
||||
const ACCEPT_COLORS2 = ["#52c41a", "#faad14", "#ff4d4f"];
|
||||
|
||||
const residualHigh = ref<{id: string, title: string}>({id:'MOC-2026-R01-0035',title:'R-201 反应釜搅拌器电机更换(55kW→75kW 防爆电机)'});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 我的工作台 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<p class="text-sm font-bold text-slate-800">全厂变更数据中心</p>
|
||||
<p class="text-[11px] text-slate-400 mt-[1px]">时间相关数据统一在此查询 · 统计时段</p>
|
||||
<NSelect v-model:value="range" :options="rangeOptions" size="tiny" class="w-28" />
|
||||
<NButton ghost size="small" class="ml-auto text-xs">导出</NButton>
|
||||
</div>
|
||||
</NCard>
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid cols="s:1 m:2 l:4" responsive="screen" :x-gap="gap" :y-gap="16"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--theme-bg': getColorWithOpacity(themeStore.themeColor, 0.2),
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning, 0.2),
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--success-bg': getColorWithOpacity(themeStore.otherColor.success, 0.2),
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
'--error-bg': getColorWithOpacity(themeStore.otherColor.error, 0.2),
|
||||
}"
|
||||
>
|
||||
<NGi>
|
||||
<div
|
||||
class="h-100% flex-1 flex items-center gap-3 bg-white px-16px py-12px cursor-pointer transition hover:-translate-y-1"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@click="emit('go', 'tasks')"
|
||||
>
|
||||
<span class="shrink-0 rounded-lg p-2.5 bg-[var(--theme-bg)]">
|
||||
<Icon icon="akar-icons:file" class="size-24px text-[--theme-color]" />
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="126"
|
||||
class="text-26px font-600"
|
||||
/>
|
||||
<p class="text-[11px] font-semibold text-slate-400">变更总数 · {{ range }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="h-100% flex-1 flex items-center gap-3 bg-white px-16px py-12px cursor-pointer transition hover:-translate-y-1"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@click="emit('go', 'tasks')"
|
||||
>
|
||||
<span class="shrink-0 rounded-lg p-2.5 bg-[var(--warning-bg)]">
|
||||
<Icon icon="lucide:shield-check" class="size-24px text-[--warning-color]" />
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="18"
|
||||
class="text-26px font-600"
|
||||
/>
|
||||
<p class="text-[11px] font-semibold text-slate-400">重要变更数量 · {{ range }} · 占比 14%</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="h-100% flex-1 flex items-center gap-3 bg-white px-16px py-12px cursor-pointer transition hover:-translate-y-1"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@click="emit('go', 'tasks')"
|
||||
>
|
||||
<span class="shrink-0 rounded-lg p-2.5 bg-[var(--warning-bg)]">
|
||||
<Icon icon="lucide:shield-check" class="size-24px text-[--warning-color]" />
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="4"
|
||||
class="text-26px font-600 text-[var(--error-color)]"
|
||||
/>
|
||||
<p class="text-26px font-600 text-[var(--error-color)]"> 高 /</p>
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="11"
|
||||
class="text-26px font-600 text-[var(--error-color)]"
|
||||
/><p class="text-26px font-600 text-[var(--error-color)]"> 中</p>
|
||||
</div>
|
||||
<p class="text-[11px] font-semibold text-slate-400">变更新增风险 · 剩余高风险 1 · 剩余中风险 6</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="h-100% flex-1 flex items-center gap-3 bg-white px-16px py-12px cursor-pointer transition hover:-translate-y-1"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
@click="emit('go', 'tasks')"
|
||||
>
|
||||
<span class="shrink-0 rounded-lg p-2.5 bg-[var(--success-bg)]">
|
||||
<Icon icon="material-symbols:check-circle-outline" class="size-24px text-[--success-color]" />
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="86.4"
|
||||
class="text-26px font-600"
|
||||
/>
|
||||
<p class="text-[11px] font-semibold text-slate-400">验收投入合计 · 已验收 19 起 · 完全达标率 68%</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid
|
||||
:x-gap="gap" :y-gap="16" responsive="screen" item-responsive
|
||||
:style="{
|
||||
'--theme-color':themeStore.themeColor
|
||||
}"
|
||||
>
|
||||
<NGi span="24 s:24 m:24 l:14">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center mb-3 gap-2">
|
||||
<Icon icon="akar-icons:file" class="size-16px text-[--theme-color]" />
|
||||
<p class="text-13px font-700 text-#64749a">各车间变更数量</p>
|
||||
<p class="text-11px text-#94a3b8 mt-2px">{{range}} · 按申请部门</p>
|
||||
</div>
|
||||
<ColumnChart :data="changeData" style="height: 100%;" />
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:10">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center mb-3 gap-2">
|
||||
<Icon icon="akar-icons:file" class="size-16px text-[--theme-color]" />
|
||||
<p class="text-13px font-700 text-#64749a">变更类型分布</p>
|
||||
<p class="text-11px text-#94a3b8 mt-2px">{{range}} · 工艺 / 设备 / 管理</p>
|
||||
</div>
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" :range="range" />
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid
|
||||
:x-gap="gap" :y-gap="16" responsive="screen" item-responsive
|
||||
:style="{
|
||||
'--error-color':themeStore.otherColor.error,
|
||||
'--warning-color':themeStore.otherColor.warning,
|
||||
'--success-color':themeStore.otherColor.success,
|
||||
'--theme-color':themeStore.themeColor
|
||||
}"
|
||||
>
|
||||
<NGi span="24 s:24 m:24 l:10">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center mb-3 gap-2">
|
||||
<Icon icon="lucide:shield-alert" class="size-16px text-[--theme-color]" />
|
||||
<p class="text-13px font-700 text-#64749a">风险增量与管控</p>
|
||||
<p class="text-11px text-#94a3b8 mt-2px">{{range}} · 变更新增风险与管控落实</p>
|
||||
</div>
|
||||
<div class="space-y-2.5">
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<div class="rounded-lg bg-red-50 px-3 py-2">
|
||||
<div class="text-[11px] text-[var(--error-color)]">新增固有高风险项</div>
|
||||
<div class="text-xl font-bold text-[var(--error-color)]">4</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-amber-50 px-3 py-2">
|
||||
<div class="text-[11px] text-[var(--warning-color)]">新增中风险项</div>
|
||||
<div class="text-xl font-bold text-[var(--warning-color)]">11</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-slate-50 px-3 py-2">
|
||||
<div class="text-[11px] text-slate-500">剩余高风险项</div>
|
||||
<div class="text-xl font-bold text-slate-800">1</div>
|
||||
</div>
|
||||
<div class="rounded-lg bg-slate-50 px-3 py-2">
|
||||
<div class="text-[11px] text-slate-500">剩余中风险项</div>
|
||||
<div class="text-xl font-bold text-slate-800">6</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex justify-between text-[11px] text-slate-500">
|
||||
<span>管控措施落实率</span>
|
||||
<span class="font-semibold text-[var(--success-color)]">96%</span>
|
||||
</div>
|
||||
<div class="mt-1 h-2 w-full rounded-full bg-slate-100">
|
||||
<div class="h-2 rounded-full bg-[var(--success-color)]" style="width: 96%" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="residualHigh.id" @click="emit('openChange', residualHigh)"
|
||||
class="cursor-pointer w-full rounded-lg border border-red-100 bg-[#FFF2F0] px-3 py-2 text-left transition hover:border-red-300">
|
||||
<span class="block text-[11px] font-medium text-[var(--error-color)]">剩余高风险 · 措施落实中</span>
|
||||
<span class="mt-0.5 block truncate text-xs font-medium text-slate-800">{{ residualHigh.title }}</span>
|
||||
<span class="mt-0.5 block text-[11px] text-slate-400">{{ residualHigh.id }} · 电机吊装作业管控措施执行跟踪</span>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:14">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center mb-3 gap-2">
|
||||
<Icon icon="material-symbols:check-circle-outline" class="size-16px text-[--theme-color]" />
|
||||
<p class="text-13px font-700 text-#64749a">变更投入和效果</p>
|
||||
<p class="text-11px text-#94a3b8 mt-2px">{{range}} · 支持查询验收明细</p>
|
||||
</div>
|
||||
<RingChart2 :data="DEPT_ACCEPT2" :colors="ACCEPT_COLORS2" style="height: 210px;" />
|
||||
<div class="flex items-center justify-between border-slate-200 pt-1.5">
|
||||
<span class="text-[11px] text-slate-400">投入合计(变更材料和实施费) · 完全达到率 68%</span>
|
||||
<span class="text-xs font-bold text-[var(--theme-color)]">86.4 万元</span>
|
||||
</div>
|
||||
<div @click="emit('go', 'invest')"
|
||||
class="cursor-pointer mt-3 flex w-full items-center justify-center gap-1 rounded-lg border border-dashed py-2 text-[11px] text-slate-400 transition hover:border-[#6E93C6] hover:text-[#1D4E9C]">
|
||||
验收明细(名称 / 日期链 / 费用 / 结论)见左边栏「变更效果跟踪」<ChevronRight class="h-3 w-3" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -1,90 +1,90 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RingChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data: { name: string; value: number; }[]; }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
bottom: '20%',
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "5%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "5%",
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: true, // 新增,固定柱子位置
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitArea: { show: false },
|
||||
data: [] as string[],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
show: false,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
barWidth: 45,
|
||||
barGap: "10%",
|
||||
color: "#2080f0",
|
||||
label: { show: true, position: 'top',color: '#333',fontWeight: 'bold' },
|
||||
data: [] as number[],
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
let allMonth = props.data.map((item:any) => item.name);
|
||||
let values = props.data.map((item:any) => item.value);
|
||||
opts.xAxis[0].data = allMonth;
|
||||
opts.series[0].data = values;
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RingChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data: { name: string; value: number; }[]; }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
bottom: '20%',
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "5%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "5%",
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: true, // 新增,固定柱子位置
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitArea: { show: false },
|
||||
data: [] as string[],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
show: false,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
barWidth: 45,
|
||||
barGap: "10%",
|
||||
color: "#2080f0",
|
||||
label: { show: true, position: 'top',color: '#333',fontWeight: 'bold' },
|
||||
data: [] as number[],
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
let allMonth = props.data.map((item:any) => item.name);
|
||||
let values = props.data.map((item:any) => item.value);
|
||||
opts.xAxis[0].data = allMonth;
|
||||
opts.series[0].data = values;
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
+126
-126
@@ -1,126 +1,126 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const list = ref<any[]>([]);
|
||||
const lists = [
|
||||
{ title: "氮气管网压力分级调整", id: "MOC-2026-R01-0024", applicant: "张工艺", type: "工艺", level: "重要", duration: "永久", applyDate: "2026-05-28", useTime: "2026-06-20", acceptDate: "2026-07-08", cost: 3.2, result: "完全达到" },
|
||||
{ title: "R-201 搅拌密封改造", id: "MOC-2026-R01-0019", applicant: "张工艺", type: "设备", level: "一般", duration: "永久", applyDate: "2026-03-18", useTime: "2026-04-12", acceptDate: "2026-05-20", cost: 6.8, result: "完全达到" },
|
||||
{ title: "循环水加药泵冲程临时调整", id: "MOC-2026-R01-0022", applicant: "张工艺", type: "设备", level: "一般", duration: "临时", applyDate: "2026-04-25", useTime: "2026-05-18", acceptDate: "2026-06-30", cost: 1.5, result: "基本达到" },
|
||||
];
|
||||
// 获取列表数据
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
list.value = lists;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 导出文件
|
||||
const exportFile = () => {
|
||||
window.$message?.success(`导出本车间已验收变更投入和效果表(Excel)`)
|
||||
}
|
||||
// 查看
|
||||
const openRow = (r: any) => {
|
||||
window.$message?.info(`打开变更详情页 ${r.id}(含验收报告与费用明细)`);
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- PSSR监督 -->
|
||||
<NSpin :show="loading" size="small">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div
|
||||
class="h-100% flex flex-wrap items-center gap-x-5 gap-y-2 border border-slate-200 px-3 py-2 mb-3"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
'--success-bg': themeStore.otherColor.success,
|
||||
'--warning-bg': themeStore.otherColor.warning,
|
||||
'--error-bg': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<span class="text-sm font-bold text-slate-800">本车间已验收变更</span>
|
||||
<span class="text-xs text-slate-500">共 <b class="text-[#1D4E9C]">{{ list.length }}</b> 起</span>
|
||||
<span class="text-xs text-slate-500">投入合计 <b class="text-[#1D4E9C]">11.5</b> 万元</span>
|
||||
<span class="text-xs text-slate-500">完全达到率 <b class="text-[var(--success-bg)]">67%</b></span>
|
||||
<span class="hidden h-4 w-px bg-slate-200 sm:block"></span>
|
||||
<span class="text-xs text-slate-500">
|
||||
<span class="mr-1 inline-block h-2 w-2 rounded-full align-middle bg-[var(--success-bg)]"></span>
|
||||
完全达到<b class="text-slate-800">2</b> 起 · <b class="text-slate-800">10.0</b> 万元
|
||||
</span>
|
||||
<span class="text-xs text-slate-500">
|
||||
<span class="mr-1 inline-block h-2 w-2 rounded-full align-middle bg-[var(--warning-bg)]"></span>
|
||||
基本达到<b class="text-slate-800">1</b> 起 · <b class="text-slate-800">1.5</b> 万元
|
||||
</span>
|
||||
<span class="text-xs text-slate-500">
|
||||
<span class="mr-1 inline-block h-2 w-2 rounded-full align-middle bg-[var(--error-bg)]"></span>
|
||||
未达到<b class="text-slate-800">0</b> 起 · <b class="text-slate-800">0.0</b> 万元
|
||||
</span>
|
||||
<NButton size="small" ghost class="ml-auto text-xs" @click="exportFile">
|
||||
<Icon icon="material-symbols:download" class="size-16px" />导出
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white shadow-[0_2px_8px_rgba(0,0,0,0.06)]">
|
||||
<div class="flex items-center gap-3 border-b bg-slate-50 px-4 py-2 text-[11px] font-semibold text-slate-500">
|
||||
<span class="min-w-0 flex-1">变更名称 / 编号</span>
|
||||
<span class="w-[92px] shrink-0">申请日期</span>
|
||||
<span class="w-[92px] shrink-0">投用日期</span>
|
||||
<span class="w-[92px] shrink-0">验收日期</span>
|
||||
<span class="w-[80px] shrink-0 text-right">费用(万元)</span>
|
||||
<span class="w-[100px] shrink-0 text-center">是否达到预期效果</span>
|
||||
<span class="w-[64px] shrink-0 text-right">操作</span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="divide-y">
|
||||
<div v-for="r in list" :key="r.id" class="flex flex-wrap items-center gap-x-3 gap-y-1.5 px-4 py-3 transition hover:bg-[#EAF0F9]/40">
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="flex flex-wrap items-center gap-1.5">
|
||||
<span class="truncate text-sm font-medium text-slate-800">{{ r.title }}</span>
|
||||
<NTag v-if="r.level==='一般'" size="small">{{ r.level }}</NTag>
|
||||
<NTag v-if="r.level==='重要'" size="small" type="error">{{ r.level }}</NTag>
|
||||
<NTag size="small" type="info">{{ r.type }}</NTag>
|
||||
<NTag v-if="r.duration==='永久'" size="small">{{ r.duration }}</NTag>
|
||||
<NTag v-if="r.duration==='临时'" size="small" type="warning">{{ r.duration }}</NTag>
|
||||
</span>
|
||||
<span class="mt-0.5 block font-mono text-[11px] text-slate-400">{{ r.id }} · {{ r.applicant }} · 费用取验收时填报的「变更材料和实施费」</span>
|
||||
</span>
|
||||
<span class="w-[92px] shrink-0 text-xs text-slate-600">{{ r.applyDate }}</span>
|
||||
<span class="w-[92px] shrink-0 text-xs text-slate-600">{{ r.useTime }}</span>
|
||||
<span class="w-[92px] shrink-0 text-xs text-slate-600">{{ r.acceptDate }}</span>
|
||||
<span class="w-[80px] shrink-0 text-right text-sm font-bold text-slate-800">{{ r.cost.toFixed(1) }}</span>
|
||||
<span class="w-[100px] shrink-0 text-center">
|
||||
<NTag v-if="r.result==='完全达到'" size="small" type="success">{{ r.result }}</NTag>
|
||||
<NTag v-if="r.result==='基本达到'" size="small" type="warning">{{ r.result }}</NTag>
|
||||
<NTag v-if="r.result==='未达到'" size="small" type="error">{{ r.result }}</NTag>
|
||||
</span>
|
||||
<span class="w-[64px] shrink-0 text-right">
|
||||
<NButton size="small" ghost class="text-xs" @click="openRow(r)">查看</NButton>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpin>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 240px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const list = ref<any[]>([]);
|
||||
const lists = [
|
||||
{ title: "氮气管网压力分级调整", id: "MOC-2026-R01-0024", applicant: "张工艺", type: "工艺", level: "重要", duration: "永久", applyDate: "2026-05-28", useTime: "2026-06-20", acceptDate: "2026-07-08", cost: 3.2, result: "完全达到" },
|
||||
{ title: "R-201 搅拌密封改造", id: "MOC-2026-R01-0019", applicant: "张工艺", type: "设备", level: "一般", duration: "永久", applyDate: "2026-03-18", useTime: "2026-04-12", acceptDate: "2026-05-20", cost: 6.8, result: "完全达到" },
|
||||
{ title: "循环水加药泵冲程临时调整", id: "MOC-2026-R01-0022", applicant: "张工艺", type: "设备", level: "一般", duration: "临时", applyDate: "2026-04-25", useTime: "2026-05-18", acceptDate: "2026-06-30", cost: 1.5, result: "基本达到" },
|
||||
];
|
||||
// 获取列表数据
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
list.value = lists;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 导出文件
|
||||
const exportFile = () => {
|
||||
window.$message?.success(`导出本车间已验收变更投入和效果表(Excel)`)
|
||||
}
|
||||
// 查看
|
||||
const openRow = (r: any) => {
|
||||
window.$message?.info(`打开变更详情页 ${r.id}(含验收报告与费用明细)`);
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- PSSR监督 -->
|
||||
<NSpin :show="loading" size="small">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div
|
||||
class="h-100% flex flex-wrap items-center gap-x-5 gap-y-2 border border-slate-200 px-3 py-2 mb-3"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
'--success-bg': themeStore.otherColor.success,
|
||||
'--warning-bg': themeStore.otherColor.warning,
|
||||
'--error-bg': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<span class="text-sm font-bold text-slate-800">本车间已验收变更</span>
|
||||
<span class="text-xs text-slate-500">共 <b class="text-[#1D4E9C]">{{ list.length }}</b> 起</span>
|
||||
<span class="text-xs text-slate-500">投入合计 <b class="text-[#1D4E9C]">11.5</b> 万元</span>
|
||||
<span class="text-xs text-slate-500">完全达到率 <b class="text-[var(--success-bg)]">67%</b></span>
|
||||
<span class="hidden h-4 w-px bg-slate-200 sm:block"></span>
|
||||
<span class="text-xs text-slate-500">
|
||||
<span class="mr-1 inline-block h-2 w-2 rounded-full align-middle bg-[var(--success-bg)]"></span>
|
||||
完全达到<b class="text-slate-800">2</b> 起 · <b class="text-slate-800">10.0</b> 万元
|
||||
</span>
|
||||
<span class="text-xs text-slate-500">
|
||||
<span class="mr-1 inline-block h-2 w-2 rounded-full align-middle bg-[var(--warning-bg)]"></span>
|
||||
基本达到<b class="text-slate-800">1</b> 起 · <b class="text-slate-800">1.5</b> 万元
|
||||
</span>
|
||||
<span class="text-xs text-slate-500">
|
||||
<span class="mr-1 inline-block h-2 w-2 rounded-full align-middle bg-[var(--error-bg)]"></span>
|
||||
未达到<b class="text-slate-800">0</b> 起 · <b class="text-slate-800">0.0</b> 万元
|
||||
</span>
|
||||
<NButton size="small" ghost class="ml-auto text-xs" @click="exportFile">
|
||||
<Icon icon="material-symbols:download" class="size-16px" />导出
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="rounded-lg bg-white shadow-[0_2px_8px_rgba(0,0,0,0.06)]">
|
||||
<div class="flex items-center gap-3 border-b bg-slate-50 px-4 py-2 text-[11px] font-semibold text-slate-500">
|
||||
<span class="min-w-0 flex-1">变更名称 / 编号</span>
|
||||
<span class="w-[92px] shrink-0">申请日期</span>
|
||||
<span class="w-[92px] shrink-0">投用日期</span>
|
||||
<span class="w-[92px] shrink-0">验收日期</span>
|
||||
<span class="w-[80px] shrink-0 text-right">费用(万元)</span>
|
||||
<span class="w-[100px] shrink-0 text-center">是否达到预期效果</span>
|
||||
<span class="w-[64px] shrink-0 text-right">操作</span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="divide-y">
|
||||
<div v-for="r in list" :key="r.id" class="flex flex-wrap items-center gap-x-3 gap-y-1.5 px-4 py-3 transition hover:bg-[#EAF0F9]/40">
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="flex flex-wrap items-center gap-1.5">
|
||||
<span class="truncate text-sm font-medium text-slate-800">{{ r.title }}</span>
|
||||
<NTag v-if="r.level==='一般'" size="small">{{ r.level }}</NTag>
|
||||
<NTag v-if="r.level==='重要'" size="small" type="error">{{ r.level }}</NTag>
|
||||
<NTag size="small" type="info">{{ r.type }}</NTag>
|
||||
<NTag v-if="r.duration==='永久'" size="small">{{ r.duration }}</NTag>
|
||||
<NTag v-if="r.duration==='临时'" size="small" type="warning">{{ r.duration }}</NTag>
|
||||
</span>
|
||||
<span class="mt-0.5 block font-mono text-[11px] text-slate-400">{{ r.id }} · {{ r.applicant }} · 费用取验收时填报的「变更材料和实施费」</span>
|
||||
</span>
|
||||
<span class="w-[92px] shrink-0 text-xs text-slate-600">{{ r.applyDate }}</span>
|
||||
<span class="w-[92px] shrink-0 text-xs text-slate-600">{{ r.useTime }}</span>
|
||||
<span class="w-[92px] shrink-0 text-xs text-slate-600">{{ r.acceptDate }}</span>
|
||||
<span class="w-[80px] shrink-0 text-right text-sm font-bold text-slate-800">{{ r.cost.toFixed(1) }}</span>
|
||||
<span class="w-[100px] shrink-0 text-center">
|
||||
<NTag v-if="r.result==='完全达到'" size="small" type="success">{{ r.result }}</NTag>
|
||||
<NTag v-if="r.result==='基本达到'" size="small" type="warning">{{ r.result }}</NTag>
|
||||
<NTag v-if="r.result==='未达到'" size="small" type="error">{{ r.result }}</NTag>
|
||||
</span>
|
||||
<span class="w-[64px] shrink-0 text-right">
|
||||
<NButton size="small" ghost class="text-xs" @click="openRow(r)">查看</NButton>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpin>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 240px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
+476
-476
@@ -1,476 +1,476 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const keyword = ref<string>("");
|
||||
const progressDrawer = ref<boolean>(false);
|
||||
const currentTab = ref<string>("highRisk");
|
||||
const range = ref<string>("近一个月");
|
||||
const dept = ref<string>("全部部门");
|
||||
const method = ref<string>("全部");
|
||||
// 当前记录
|
||||
const currentRecord = ref<any>(null);
|
||||
const TABS = [
|
||||
{ k: "highRisk", name: "高风险场景" },
|
||||
{ k: "history", name: "历史分析检索" },
|
||||
{ k: "tpl", name: "方法模板库" },
|
||||
];
|
||||
const RISK_RANGES = ["近一个月", "近三个月", "近半年", "全部"];
|
||||
const departments = ref<any[]>([
|
||||
{ id: 1, name: "全部部门" },
|
||||
{ id: 2, name: "一车间" },
|
||||
{ id: 3, name: "公用工程车间" },
|
||||
{ id: 4, name: "供应部" },
|
||||
{ id: 5, name: "三车间" },
|
||||
]);
|
||||
const list = ref<any[]>([]);
|
||||
const highRiskList = [
|
||||
{
|
||||
cid: "MOC-2026-R01-0036", item: "反应飞温", scene: "温度上限提高至 82℃ 后飞温反应加速,联锁动作前安全裕量收窄",
|
||||
method: "HAZOP", residual: "中", dept: "一车间", adate: "2026-08-02", owner: "王海燕",
|
||||
title: '聚合反应温度控制上限调整(78℃→82℃)', status: '审批中',
|
||||
info: 'MOC-2026-R01-0036 聚合反应温度控制上限调整(78℃→82℃)', count: 3,
|
||||
hazopRows: [
|
||||
{ node: "节点1 · 聚合釜 R-101", dev: "温度过高", cause: "温控回路失效或冷却水中断;82℃ 新上限更接近溶剂回流温度,超温溜温概率上升", cons: "反应溜温冲料,釜压骤升,物料喷溅造成灼烫与环境污染", L: 3, S: 4, safety: "DCS 温度高报 82℃、高高报及联锁 85℃(维持安全边界不变);紧急冷却有效", suggest: "投用前完成联锁测试并留存记录;投用首周每班复核温度趋势" },
|
||||
{ node: "节点1 · 聚合釜 R-101", dev: "温度过高", cause: "未知杂质含量升高(0.05%→0.12%),热稳定性尚未定性,长期累积加速釜壁结垢", cons: "副反应加剧,可能引发二次分解放热,搅拌负荷异常", L: 2, S: 4, safety: "小试热稳定性筛查;安全阀泄放能力不受本次调整影响,仍然有效", suggest: "将杂质含量纳入日常分析计划(每周 1 次,连续 8 周)" },
|
||||
{ node: "节点2 · DCS 温控与联锁", dev: "报警/联锁值设置不当", cause: "上限调整后报警值与联锁值未同步复核整定", cons: "报警提前量不足,操作响应时间被压缩", L: 2, S: 4, safety: "修改执行申请-复核双人确认;修改清单与变更单逐项核对", suggest: "联锁测试全覆盖并留存记录;修改期间工艺加强监控" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R01-0035", item: "动火与临时用电燃爆", scene: "电机更换动火与临时用电作业引发可燃气体燃爆",
|
||||
method: "JSA", residual: "中", dept: "一车间", adate: "2026-07-30", owner: "王仪表",
|
||||
title: '反应釜搅拌器电机更换(55kW→75kW 防爆电机)', status: '审批中',
|
||||
info: 'MOC-2026-R01-0035 R-201 反应釜搅拌器电机更换(55kW→75kW 防爆电机)', count: 3,
|
||||
jsaRows: [
|
||||
{ item: "动火作业燃爆", scene: "步骤2:旧电机拆除与新电机安装动火,可燃蒸气聚集遇火源燃爆", inherent: "高", existing: "作业票证办理;动火点可燃气体检测合格;消防器材到位", suggest: "动火点下方设接火盘与防火毯,专人监护并每 30 分钟复测", residual: "中" },
|
||||
{ item: "临时用电触电", scene: "步骤1:临时电缆敷设与配电箱接线,绝缘破损导致触电", inherent: "中", existing: "临时用电票证;漏保校验合格", suggest: "电缆架空敷设并挂牌,每日开工前绝缘检查", residual: "低" },
|
||||
{ item: "起重吊装伤害", scene: "步骤3:75kW 电机吊装就位,吊具失效或指挥失误导致起重伤害", inherent: "中", existing: "吊具检验合格;起重指挥持证", suggest: "吊装区设警戒线,禁止交叉作业", residual: "低" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: null, changeTitle: "MOC-2026-R01-0048 R-101 温度联锁修改", item: "VOCs 直排超标", scene: "活性炭吸附饱和穿透,VOCs 直排大气超标",
|
||||
method: "JSA", residual: "高", dept: "一车间", adate: "2026-07-31", owner: "王仪表",
|
||||
title: '温度联锁修改', status: '审批中',
|
||||
info: 'MOC-2026-R01-0048 R-101 温度联锁修改', count: 2,
|
||||
jsaRows: [
|
||||
{ item: "吸附饱和穿透", scene: "步骤3:活性炭吸附床运行后期,吸附饱和穿透导致 VOCs 直排大气", inherent: "高", existing: "出口 VOCs 在线监测报警;按周期更换活性炭", suggest: "增设穿透点压差监测与双床切换程序;更换周期由 6 个月缩短至 4 个月", residual: "中" },
|
||||
{ item: "联锁参数误改", scene: "步骤3:DCS 参数修改与联锁测试,参数误改导致报警/联锁失效", inherent: "高", existing: "参数修改执行申请-复核双人确认;修改清单与变更单逐项核对", suggest: "联锁测试全覆盖并留存记录;修改期间工艺加强监控", residual: "中" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R02-0041", item: "超压与窒息", scene: "氮气减压阀组失效导致下游设备超压、作业人员窒息",
|
||||
method: "检查表", residual: "低", dept: "公用工程车间", adate: "2026-07-29", owner: "周设备",
|
||||
title: '公用工程氮气减压阀组改造', status: '审批中',
|
||||
info: 'MOC-2026-R02-0041 公用工程氮气减压阀组改造', count: 2,
|
||||
jsaRows: [
|
||||
{ item: "下游设备超压", scene: "减压阀失效全开,高压氮气直入低压管网导致下游设备超压", inherent: "高", existing: "下游设安全阀;管网压力高报", suggest: "减压阀双阀串联并定期校验;安全阀起跳压力复核", residual: "低" },
|
||||
{ item: "人员窒息", scene: "阀组间通风不良,氮气泄漏积聚导致氧含量不足", inherent: "中", existing: "阀组间强制通风;进入前测氧", suggest: "增设固定式氧含量报警仪并联动风机", residual: "低" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R01-0039", item: "超压保护裕量降低", scene: "安全阀起跳压力临时上调期间,V-102 超压保护裕量降低",
|
||||
method: "AI 预分析", residual: "中", dept: "一车间", adate: "2026-07-15", owner: "王海燕",
|
||||
title: '紧急变更:V-102 安全阀起跳压力临时调整(补办手续)', status: '审批中',
|
||||
info: 'MOC-2026-R01-0039 紧急变更:V-102 安全阀起跳压力临时调整(补办手续)', count: 2,
|
||||
jsaRows: [
|
||||
{ item: "超压保护裕量降低", scene: "起跳压力由 1.0MPa 临时上调至 1.15MPa,V-102 超压工况下保护动作延迟", inherent: "高", existing: "临时期限 30 天;操作压力监控加强至每 2 小时记录", suggest: "恢复前完成新安全阀校验更换;临时期间压力联锁值同步下调验证", residual: "中" },
|
||||
{ item: "紧急变更手续补办遗漏", scene: "紧急变更先行实施,后补手续存在资料缺项风险", inherent: "中", existing: "紧急变更 48 小时内补办审批", suggest: "资料归档清单逐项核对,安全部门复核", residual: "低" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R03-0040", item: "原料杂质副反应", scene: "新供应商环己烷杂质谱变化引发副反应,影响产品色相与收率",
|
||||
method: "HAZOP", residual: "中", dept: "供应部", adate: "2026-07-18", owner: "陈质量",
|
||||
title: '原料环己烷供应商变更(新增 B 供应商)', status: '审批中',
|
||||
info: 'MOC-2026-R03-0040 原料环己烷供应商变更(新增 B 供应商)', count: 2,
|
||||
hazopRows: [
|
||||
{ node: "节点1 · 原料接收与储存", dev: "杂质含量高", cause: "B 供应商环己烷杂质谱(苯/硫)高于原供应商,进厂检验项目未覆盖", cons: "副反应加剧,产品色相超标、收率下降,结垢加速", L: 3, S: 3, safety: "进厂检验按原指标执行;供应商 COA 随货同行", suggest: "检验项目增加杂质谱分析;首批三批加严检验" },
|
||||
{ node: "节点2 · 聚合反应", dev: "副反应加剧", cause: "微量苯参与链转移,分子量分布变宽", cons: "产品性能波动,下游加工投诉", L: 2, S: 3, safety: "聚合配方留有调节余量", suggest: "建立 B 供应商原料的配方微调作业指导" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R03-0042", item: "回路切换失误", scene: "自动化改造调试期间控制回路切换失误,造成装置非计划停车",
|
||||
method: "JSA", residual: "中", dept: "三车间", adate: "2026-07-31", owner: "王仪表",
|
||||
title: '三车间自动化和安全隐患整改项目变更', status: '审批中',
|
||||
info: 'MOC-2026-R03-0042 三车间自动化和安全隐患整改项目变更', count: 2,
|
||||
jsaRows: [
|
||||
{ item: "回路切换失误", scene: "步骤4:新旧控制系统切换,回路误切导致装置非计划停车", inherent: "高", existing: "切换方案审批;切换前模拟演练", suggest: "切换双人复核逐项签字;保留一键回切手段 72 小时", residual: "中" },
|
||||
{ item: "静电损伤卡件", scene: "步骤2:卡件插拔作业静电防护不到位,DCS 卡件损坏", inherent: "中", existing: "佩戴防静电手环", suggest: "卡件备件现场备妥,作业区铺设防静电垫", residual: "低" },
|
||||
],
|
||||
},
|
||||
];
|
||||
const historyList = [
|
||||
{ id: "HAZOP-2025-018", change: "MOC-2025-R01-0023 常压炉燃料气切断阀改造", method: "HAZOP", unit: "01-常减压装置", scope: "燃料气系统节点", rows: 12, date: "2025-10-20" },
|
||||
{ id: "HAZOP-2024-006", change: "MOC-2024-R01-0003 减一线换热器 E-108 芯子更换", method: "HAZOP", unit: "01-常减压装置", scope: "换热系统节点", rows: 8, date: "2024-03-15" },
|
||||
{ id: "JSA-2025-041", change: "MOC-2025-R02-0014 再生器旋风分离器更换", method: "JSA", unit: "02-催化裂化装置", scope: "受限空间作业", rows: 6, date: "2025-05-08" },
|
||||
{ id: "JSA-2026-012", change: "MOC-2026-R01-0035 搅拌电机更换", method: "JSA", unit: "01-常减压装置", scope: "检维修作业", rows: 5, date: "2026-07-29" },
|
||||
{ id: "SCL-2025-033", change: "MOC-2025-R02-0021 气压机出口压力联锁逻辑修改", method: "检查表", unit: "02-催化裂化装置", scope: "联锁系统", rows: 14, date: "2025-09-18" },
|
||||
{ id: "AI-2026-008", change: "MOC-2026-R03-0008 聚合釜搅拌器密封形式变更", method: "AI 预分析", unit: "03-聚合装置", scope: "—", rows: 4, date: "2026-05-06" },
|
||||
];
|
||||
const templateList = [
|
||||
{ name: "HAZOP 节点划分模板", desc: "含偏差引导词库(过高/过低/无/反向等 18 个)与节点划分示例", tag: "HAZOP" },
|
||||
{ name: "JSA 作业步骤分析模板", desc: "作业步骤分解 → 危害识别 → 控制措施三段式,含检维修示例", tag: "JSA" },
|
||||
{ name: "安全检查表(SCL)模板库", desc: "按设备类型 28 套(机泵 / 换热器 / 塔器 / 储罐 / 电气 / 仪表)", tag: "检查表" },
|
||||
{ name: "风险矩阵 5×5 分级定义", desc: "可能性 × 严重性分级标准(公司 Q/SH 0600),AI 评级引用此定义", tag: "通用" },
|
||||
];
|
||||
const isHazop = computed(() => !!currentRecord.value?.hazopRows);
|
||||
const th = "border-b bg-slate-50 px-3 py-2 text-left text-[11px] font-semibold text-slate-500";
|
||||
const td = "border-b px-3 py-2 align-top text-xs leading-relaxed text-slate-700";
|
||||
|
||||
const hazopNodes = computed(() => {
|
||||
const scene = currentRecord.value;
|
||||
if (!scene?.hazopRows) return [] as { node: string; dev: string; n: number }[];
|
||||
const nodes = Array.from(new Map(scene.hazopRows.map((r:any) => [`${r.node}|${r.dev}`, { node: r.node, dev: r.dev, n: 0 }])).values());
|
||||
scene.hazopRows.forEach((r:any) => { const k:any = nodes.find((n:any) => n.node === r.node && n.dev === r.dev); if (k) k.n += 1; });
|
||||
return nodes;
|
||||
});
|
||||
const sel = ref(0);
|
||||
const selRows = computed(() => {
|
||||
const scene = currentRecord.value;
|
||||
if (!scene?.hazopRows) return [] as any;
|
||||
const n:any = hazopNodes.value[sel.value];
|
||||
return scene.hazopRows.filter((r:any) => r.node === n?.node && r.dev === n?.dev);
|
||||
});
|
||||
// HAZOP 风险矩阵:RR = L × S
|
||||
const rrTag = (L: number, S: number) => {
|
||||
const v = L * S;
|
||||
return v >= 12 ? { label: `较大 (${v})`, cls: "error" }
|
||||
: v >= 8 ? { label: `一般 (${v})`, cls: "warning" }
|
||||
: { label: `低 (${v})`, cls: "success" };
|
||||
};
|
||||
|
||||
// 切换tab
|
||||
const tabChange = (k: string) => {
|
||||
list.value = []
|
||||
currentTab.value = k;
|
||||
loading.value = true;
|
||||
if(k === 'highRisk'){
|
||||
setTimeout(() => {
|
||||
list.value = highRiskList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
if(k === 'history'){
|
||||
setTimeout(() => {
|
||||
list.value = historyList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
if(k === 'tpl'){
|
||||
setTimeout(() => {
|
||||
list.value = templateList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
// 高风险场景查看变更
|
||||
const openSceneChange = (record: any) => {
|
||||
routerPushByKey('home_highriskdetail', { query: { params: JSON.stringify(record) } })
|
||||
};
|
||||
// 查看分析记录
|
||||
const viewAnalysis = (record: any) => {
|
||||
currentRecord.value = record;
|
||||
progressDrawer.value = true;
|
||||
};
|
||||
// 查看历史分析检索
|
||||
const viewHistory = (id: string) => {
|
||||
window.$message?.info(`演示:在线查看 ${id} 完整分析记录`)
|
||||
};
|
||||
// 复用到新变更
|
||||
const copyHistory = (id: string) => {
|
||||
window.$message?.success(`演示:${id} 已复用到新变更草稿,分析行已带入待确认`)
|
||||
}
|
||||
// 预览模板
|
||||
const previewTemplate = (name: string) => {
|
||||
window.$message?.info(`演示:在线预览「${name}」`)
|
||||
}
|
||||
// 下载模板
|
||||
const downloadTemplate = (name: string) => {
|
||||
window.$message?.success(`演示:下载「${name}」(Word)`)
|
||||
}
|
||||
// 导出
|
||||
const exportFile = () => {
|
||||
window.$message?.success('分析记录表已导出(Excel)');
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tabChange('highRisk');
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 本专业高风险 -->
|
||||
<NSpin :show="loading" size="small">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div
|
||||
class="flex flex-wrap items-center gap-2 border border-slate-200 px-3 py-2 mb-3"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div v-for="t in TABS" :key="t.k" @click="tabChange(t.k)"
|
||||
class="flex items-center gap-1.5 px-3 py-1 text-xs cursor-pointer select-none rounded-[20px] border"
|
||||
:style="{ '--theme-color': themeStore.themeColor}"
|
||||
:class="currentTab === t.k ? 'bg-[var(--theme-color)] font-medium text-white border-[var(--theme-color)]' : 'text-slate-600 hover:bg-slate-100'"
|
||||
>
|
||||
{{ t.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 高风险场景 -->
|
||||
<div v-if="currentTab === 'highRisk'" class="border border-slate-200" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex items-center justify-between px-4 py-3 border-b mb-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Icon icon="lucide:shield-check" class="size-16px" :style="{color:themeStore.themeColor}" />
|
||||
<p class="text-base font-semibold">变更新增高风险场景</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 min-h-28px">
|
||||
<NTag size="small" type="primary" class="text-11px font-medium">单笔变更的分析编制在变更上下文内完成</NTag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="px-4 mb-3 flex flex-wrap items-center gap-1.5">
|
||||
<span class="mr-1 text-xs text-slate-400">时间</span>
|
||||
<NButton
|
||||
size="tiny"
|
||||
round
|
||||
:type="range === r ? 'primary' : 'default'"
|
||||
v-for="r in RISK_RANGES"
|
||||
:key="r"
|
||||
@click="range = r"
|
||||
>
|
||||
{{ r }}
|
||||
</NButton>
|
||||
<span class="ml-3 mr-1 text-xs text-slate-400">部门</span>
|
||||
<NButton
|
||||
size="tiny"
|
||||
round
|
||||
v-for="d in departments"
|
||||
:key="d.id"
|
||||
:type="dept === d.name ? 'primary' : 'default'"
|
||||
@click="dept = d.name"
|
||||
>
|
||||
{{ d.name }}
|
||||
</NButton>
|
||||
<span class="ml-auto self-center text-[11px] text-slate-400">{{ list.length }} 个高风险场景</span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="space-y-3 px-4 pb-3">
|
||||
<div v-for="(s, i) in list" :key="`${s.cid ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-3 rounded-lg border px-4 py-3">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<NTag type="info" size="small">{{ s.method }}</NTag>
|
||||
<span class="text-sm font-medium text-slate-800">{{ s.item }}</span>
|
||||
<NTag type="error" size="small">固有风险 · 高</NTag>
|
||||
<NTag v-if="s.residual==='高'" type="error" size="small">剩余风险 · {{ s.residual }}</NTag>
|
||||
<NTag v-if="s.residual==='中'" type="warning" size="small">剩余风险 · {{ s.residual }}</NTag>
|
||||
<NTag v-if="s.residual==='低'" type="info" size="small">剩余风险 · {{ s.residual }}</NTag>
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs text-slate-600">{{ s.scene }}</div>
|
||||
<div class="mt-0.5 text-xs text-slate-400">
|
||||
变更:{{ s.info }} · {{ s.dept }} · 分析日期 {{ s.adate }} · 责任:{{ s.owner }} · 分析记录 {{ s.count }} 行
|
||||
</div>
|
||||
</div>
|
||||
<NButton ghost size="small" class="text-xs" @click="openSceneChange(s)">查看变更</NButton>
|
||||
<NButton size="small" type="primary" class="text-xs" @click="viewAnalysis(s)">查看分析记录</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="py-6 text-center text-xs text-slate-400">当前筛选条件下无新增高风险场景</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 历史分析检索 -->
|
||||
<div v-if="currentTab === 'history'" class="border border-slate-200" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex items-center justify-between px-4 py-3 border-b mb-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Icon icon="mage:book" class="size-18px" :style="{color:themeStore.themeColor}" />
|
||||
<p class="text-base font-semibold">历史分析记录检索(企业风险知识资产)</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 min-h-28px">
|
||||
<NInput v-model:value="keyword" size="small" class="text-xs !w-200px" placeholder="按单号 / 装置 / 关键词检索…">
|
||||
<template #suffix>
|
||||
<Icon icon="akar-icons:search" class="size-14px text-slate-400 cursor-pointer" />
|
||||
</template>
|
||||
</NInput>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-4 mb-3 flex flex-wrap items-center gap-1.5">
|
||||
<NButton
|
||||
size="tiny"
|
||||
round
|
||||
v-for="m in ['全部', 'HAZOP', 'JSA', '检查表', 'AI 预分析']"
|
||||
:key="m"
|
||||
:type="method === m ? 'primary' : 'default'"
|
||||
@click="method = m"
|
||||
>
|
||||
{{ m }}
|
||||
</NButton>
|
||||
<span class="ml-auto self-center text-[11px] text-slate-400">{{ list.length }} 条记录</span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="space-y-3 px-4 pb-3">
|
||||
<div v-for="h in list" :key="h.id" class="flex flex-wrap items-center gap-3 rounded-lg border px-4 py-2.5">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="font-mono text-[11px] text-slate-400">{{ h.id }}</span>
|
||||
<NTag type="info" size="small">{{ h.method }}</NTag>
|
||||
<span class="text-sm text-slate-800">{{ h.change }}</span>
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs text-slate-500">{{ h.unit }} · 范围:{{ h.scope }} · {{ h.rows }} 行分析记录 · {{ h.date }}</div>
|
||||
</div>
|
||||
<NButton text type="primary" @click="viewHistory(h.id)">
|
||||
<Icon icon="lucide:eye" class="size-16px" />
|
||||
</NButton>
|
||||
<NButton ghost size="small" class="text-xs" @click="copyHistory(h.id)">复用到新变更</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="py-6 text-center text-xs text-slate-400">未找到匹配的分析记录</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 方法模板库 -->
|
||||
<div v-if="currentTab === 'tpl'" class="border border-slate-200" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex items-center justify-between px-4 py-3 border-b mb-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Icon icon="akar-icons:file" class="size-16px" :style="{color:themeStore.themeColor}" />
|
||||
<p class="text-base font-semibold">方法模板库(AI 风险预分析的知识来源之一)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="space-y-3 px-4 pb-3">
|
||||
<div class="grid gap-3 grid-cols-2">
|
||||
<div v-for="t in list" :key="t.name" class="rounded-lg border p-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-sm font-medium text-slate-800">{{ t.name }}</span>
|
||||
<NTag size="small" type="info">{{ t.tag }}</NTag>
|
||||
</div>
|
||||
<p class="mt-1.5 text-xs leading-relaxed text-slate-500">{{ t.desc }}</p>
|
||||
<div class="mt-3 flex gap-2">
|
||||
<NButton ghost size="small" class="text-xs" @click="previewTemplate(t.name)">查看</NButton>
|
||||
<NButton ghost size="small" class="text-xs" @click="downloadTemplate(t.name)">
|
||||
<Icon icon="material-symbols:download" class="size-14px" />下载
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="py-6 text-center text-xs text-slate-400">未找到匹配的方法模板库</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 进度弹框 -->
|
||||
<NDrawer v-model:show="progressDrawer" width="85%" placement="right">
|
||||
<NDrawerContent closable>
|
||||
<template #header>
|
||||
<span class="flex flex-wrap items-center gap-2 text-base">
|
||||
风险分析记录表
|
||||
<NTag size="small" type="info">{{ currentRecord.method }}</NTag>
|
||||
<NTag size="small" type="error">含固有风险 · 高 场景</NTag>
|
||||
</span>
|
||||
</template>
|
||||
<div>
|
||||
<div class="mb-3 flex flex-wrap gap-x-5 gap-y-1 text-xs text-slate-500">
|
||||
<span>变更:<span class="font-medium text-slate-700">{{ currentRecord.info }}</span></span>
|
||||
<span>分析日期:{{ currentRecord.adate }}</span>
|
||||
<span>责任:{{ currentRecord.owner }}</span>
|
||||
<span class="ml-auto text-slate-400">分析编制与修改在变更上下文内完成,此处只读</span>
|
||||
</div>
|
||||
<div v-if="!isHazop" class="overflow-x-auto rounded-lg border border-b-0">
|
||||
<table class="w-full min-w-[860px] border-collapse">
|
||||
<thead>
|
||||
<tr>
|
||||
<th :class="th" class="w-[130px]">风险项</th>
|
||||
<th :class="th">场景描述</th>
|
||||
<th :class="th" class="w-[76px] text-center">固有风险</th>
|
||||
<th :class="th">现有措施</th>
|
||||
<th :class="th">建议措施</th>
|
||||
<th :class="th" class="w-[76px] text-center">剩余风险</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(r, i) in currentRecord.jsaRows" :key="i" :class="r.item === currentRecord.item && r.inherent === '高' ? 'bg-red-50/40' : ''">
|
||||
<td :class="td" class="font-medium text-slate-800">{{ r.item }}</td>
|
||||
<td :class="td">{{ r.scene }}</td>
|
||||
<td :class="td" class="text-center">
|
||||
<NTag size="small" type="error" v-if="r.inherent==='高'">{{ r.inherent }}</NTag>
|
||||
<NTag size="small" type="warning" v-if="r.inherent==='中'">{{ r.inherent }}</NTag>
|
||||
<NTag size="small" type="info" v-if="r.inherent==='低'">{{ r.inherent }}</NTag>
|
||||
</td>
|
||||
<td :class="td">{{ r.existing }}</td>
|
||||
<td :class="td">{{ r.suggest }}</td>
|
||||
<td :class="td" class="text-center">
|
||||
<NTag size="small" type="error" v-if="r.residual==='高'">{{ r.residual }}</NTag>
|
||||
<NTag size="small" type="warning" v-if="r.residual==='中'">{{ r.residual }}</NTag>
|
||||
<NTag size="small" type="info" v-if="r.residual==='低'">{{ r.residual }}</NTag>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="flex gap-3">
|
||||
<!-- 节点 · 偏离导航 -->
|
||||
<div class="w-48 shrink-0 space-y-1.5">
|
||||
<div v-for="(n, i) in hazopNodes" :key="i" @click="sel = i"
|
||||
class="w-full rounded-lg border px-3 py-2 text-left text-xs cursor-pointer"
|
||||
:class="sel === i ? 'border-[var(--theme-color)] bg-[var(--theme-color)] text-white' : 'hover:border-[var(--theme-color)]'"
|
||||
:style="{'--theme-color': themeStore.themeColor}"
|
||||
>
|
||||
<span class="block truncate font-medium">{{ n.dev }}</span>
|
||||
<span class="mt-0.5 flex items-center justify-between text-[11px]" :class="sel === i ? 'text-white/80' : 'text-slate-400'">
|
||||
<span class="truncate">{{ n.node.replace(/^节点\d+ · /, '') }}</span>
|
||||
<NTag size="tiny" round class="ml-1" :type="sel === i ? 'default' : 'success'">{{ n.n }} 条</NTag>
|
||||
</span>
|
||||
</div>
|
||||
<p class="px-1 pt-1 text-[11px] leading-relaxed text-slate-400">L / S 取值 1–5,RR 按 5×5 风险矩阵实时重算</p>
|
||||
</div>
|
||||
<!-- 偏差分析表 -->
|
||||
<div class="min-w-0 flex-1 overflow-x-auto rounded-lg border border-b-0">
|
||||
<table class="w-full min-w-[760px] border-collapse">
|
||||
<thead>
|
||||
<tr>
|
||||
<th :class="th">原因</th>
|
||||
<th :class="th">后果</th>
|
||||
<th :class="th" class="w-10 !text-center">L</th>
|
||||
<th :class="th" class="w-10 !text-center">S</th>
|
||||
<th :class="th" class="w-[92px] !text-center">RR</th>
|
||||
<th :class="th">安全措施</th>
|
||||
<th :class="th">建议措施</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(r, i) in selRows" :key="i">
|
||||
<td :class="td">{{ r.cause }}</td>
|
||||
<td :class="td">{{ r.cons }}</td>
|
||||
<td :class="td" class="text-center">{{ r.L }}</td>
|
||||
<td :class="td" class="text-center">{{ r.S }}</td>
|
||||
<td :class="td" class="text-center">
|
||||
<NTag size="small" :type="rrTag(r.L, r.S).cls">{{ rrTag(r.L, r.S).label }}</NTag>
|
||||
</td>
|
||||
<td :class="td">{{ r.safety }}</td>
|
||||
<td :class="td">{{ r.suggest }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="flex justify-end gap-2">
|
||||
<NButton ghost @click="exportFile"><Icon icon="material-symbols:download" class="size-16px" />导出</NButton>
|
||||
<NButton type="primary" @click="progressDrawer = false">关闭</NButton>
|
||||
</div>
|
||||
</template>
|
||||
</NDrawerContent>
|
||||
</NDrawer>
|
||||
</NCard>
|
||||
</NSpin>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 303px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const keyword = ref<string>("");
|
||||
const progressDrawer = ref<boolean>(false);
|
||||
const currentTab = ref<string>("highRisk");
|
||||
const range = ref<string>("近一个月");
|
||||
const dept = ref<string>("全部部门");
|
||||
const method = ref<string>("全部");
|
||||
// 当前记录
|
||||
const currentRecord = ref<any>(null);
|
||||
const TABS = [
|
||||
{ k: "highRisk", name: "高风险场景" },
|
||||
{ k: "history", name: "历史分析检索" },
|
||||
{ k: "tpl", name: "方法模板库" },
|
||||
];
|
||||
const RISK_RANGES = ["近一个月", "近三个月", "近半年", "全部"];
|
||||
const departments = ref<any[]>([
|
||||
{ id: 1, name: "全部部门" },
|
||||
{ id: 2, name: "一车间" },
|
||||
{ id: 3, name: "公用工程车间" },
|
||||
{ id: 4, name: "供应部" },
|
||||
{ id: 5, name: "三车间" },
|
||||
]);
|
||||
const list = ref<any[]>([]);
|
||||
const highRiskList = [
|
||||
{
|
||||
cid: "MOC-2026-R01-0036", item: "反应飞温", scene: "温度上限提高至 82℃ 后飞温反应加速,联锁动作前安全裕量收窄",
|
||||
method: "HAZOP", residual: "中", dept: "一车间", adate: "2026-08-02", owner: "王海燕",
|
||||
title: '聚合反应温度控制上限调整(78℃→82℃)', status: '审批中',
|
||||
info: 'MOC-2026-R01-0036 聚合反应温度控制上限调整(78℃→82℃)', count: 3,
|
||||
hazopRows: [
|
||||
{ node: "节点1 · 聚合釜 R-101", dev: "温度过高", cause: "温控回路失效或冷却水中断;82℃ 新上限更接近溶剂回流温度,超温溜温概率上升", cons: "反应溜温冲料,釜压骤升,物料喷溅造成灼烫与环境污染", L: 3, S: 4, safety: "DCS 温度高报 82℃、高高报及联锁 85℃(维持安全边界不变);紧急冷却有效", suggest: "投用前完成联锁测试并留存记录;投用首周每班复核温度趋势" },
|
||||
{ node: "节点1 · 聚合釜 R-101", dev: "温度过高", cause: "未知杂质含量升高(0.05%→0.12%),热稳定性尚未定性,长期累积加速釜壁结垢", cons: "副反应加剧,可能引发二次分解放热,搅拌负荷异常", L: 2, S: 4, safety: "小试热稳定性筛查;安全阀泄放能力不受本次调整影响,仍然有效", suggest: "将杂质含量纳入日常分析计划(每周 1 次,连续 8 周)" },
|
||||
{ node: "节点2 · DCS 温控与联锁", dev: "报警/联锁值设置不当", cause: "上限调整后报警值与联锁值未同步复核整定", cons: "报警提前量不足,操作响应时间被压缩", L: 2, S: 4, safety: "修改执行申请-复核双人确认;修改清单与变更单逐项核对", suggest: "联锁测试全覆盖并留存记录;修改期间工艺加强监控" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R01-0035", item: "动火与临时用电燃爆", scene: "电机更换动火与临时用电作业引发可燃气体燃爆",
|
||||
method: "JSA", residual: "中", dept: "一车间", adate: "2026-07-30", owner: "王仪表",
|
||||
title: '反应釜搅拌器电机更换(55kW→75kW 防爆电机)', status: '审批中',
|
||||
info: 'MOC-2026-R01-0035 R-201 反应釜搅拌器电机更换(55kW→75kW 防爆电机)', count: 3,
|
||||
jsaRows: [
|
||||
{ item: "动火作业燃爆", scene: "步骤2:旧电机拆除与新电机安装动火,可燃蒸气聚集遇火源燃爆", inherent: "高", existing: "作业票证办理;动火点可燃气体检测合格;消防器材到位", suggest: "动火点下方设接火盘与防火毯,专人监护并每 30 分钟复测", residual: "中" },
|
||||
{ item: "临时用电触电", scene: "步骤1:临时电缆敷设与配电箱接线,绝缘破损导致触电", inherent: "中", existing: "临时用电票证;漏保校验合格", suggest: "电缆架空敷设并挂牌,每日开工前绝缘检查", residual: "低" },
|
||||
{ item: "起重吊装伤害", scene: "步骤3:75kW 电机吊装就位,吊具失效或指挥失误导致起重伤害", inherent: "中", existing: "吊具检验合格;起重指挥持证", suggest: "吊装区设警戒线,禁止交叉作业", residual: "低" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: null, changeTitle: "MOC-2026-R01-0048 R-101 温度联锁修改", item: "VOCs 直排超标", scene: "活性炭吸附饱和穿透,VOCs 直排大气超标",
|
||||
method: "JSA", residual: "高", dept: "一车间", adate: "2026-07-31", owner: "王仪表",
|
||||
title: '温度联锁修改', status: '审批中',
|
||||
info: 'MOC-2026-R01-0048 R-101 温度联锁修改', count: 2,
|
||||
jsaRows: [
|
||||
{ item: "吸附饱和穿透", scene: "步骤3:活性炭吸附床运行后期,吸附饱和穿透导致 VOCs 直排大气", inherent: "高", existing: "出口 VOCs 在线监测报警;按周期更换活性炭", suggest: "增设穿透点压差监测与双床切换程序;更换周期由 6 个月缩短至 4 个月", residual: "中" },
|
||||
{ item: "联锁参数误改", scene: "步骤3:DCS 参数修改与联锁测试,参数误改导致报警/联锁失效", inherent: "高", existing: "参数修改执行申请-复核双人确认;修改清单与变更单逐项核对", suggest: "联锁测试全覆盖并留存记录;修改期间工艺加强监控", residual: "中" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R02-0041", item: "超压与窒息", scene: "氮气减压阀组失效导致下游设备超压、作业人员窒息",
|
||||
method: "检查表", residual: "低", dept: "公用工程车间", adate: "2026-07-29", owner: "周设备",
|
||||
title: '公用工程氮气减压阀组改造', status: '审批中',
|
||||
info: 'MOC-2026-R02-0041 公用工程氮气减压阀组改造', count: 2,
|
||||
jsaRows: [
|
||||
{ item: "下游设备超压", scene: "减压阀失效全开,高压氮气直入低压管网导致下游设备超压", inherent: "高", existing: "下游设安全阀;管网压力高报", suggest: "减压阀双阀串联并定期校验;安全阀起跳压力复核", residual: "低" },
|
||||
{ item: "人员窒息", scene: "阀组间通风不良,氮气泄漏积聚导致氧含量不足", inherent: "中", existing: "阀组间强制通风;进入前测氧", suggest: "增设固定式氧含量报警仪并联动风机", residual: "低" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R01-0039", item: "超压保护裕量降低", scene: "安全阀起跳压力临时上调期间,V-102 超压保护裕量降低",
|
||||
method: "AI 预分析", residual: "中", dept: "一车间", adate: "2026-07-15", owner: "王海燕",
|
||||
title: '紧急变更:V-102 安全阀起跳压力临时调整(补办手续)', status: '审批中',
|
||||
info: 'MOC-2026-R01-0039 紧急变更:V-102 安全阀起跳压力临时调整(补办手续)', count: 2,
|
||||
jsaRows: [
|
||||
{ item: "超压保护裕量降低", scene: "起跳压力由 1.0MPa 临时上调至 1.15MPa,V-102 超压工况下保护动作延迟", inherent: "高", existing: "临时期限 30 天;操作压力监控加强至每 2 小时记录", suggest: "恢复前完成新安全阀校验更换;临时期间压力联锁值同步下调验证", residual: "中" },
|
||||
{ item: "紧急变更手续补办遗漏", scene: "紧急变更先行实施,后补手续存在资料缺项风险", inherent: "中", existing: "紧急变更 48 小时内补办审批", suggest: "资料归档清单逐项核对,安全部门复核", residual: "低" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R03-0040", item: "原料杂质副反应", scene: "新供应商环己烷杂质谱变化引发副反应,影响产品色相与收率",
|
||||
method: "HAZOP", residual: "中", dept: "供应部", adate: "2026-07-18", owner: "陈质量",
|
||||
title: '原料环己烷供应商变更(新增 B 供应商)', status: '审批中',
|
||||
info: 'MOC-2026-R03-0040 原料环己烷供应商变更(新增 B 供应商)', count: 2,
|
||||
hazopRows: [
|
||||
{ node: "节点1 · 原料接收与储存", dev: "杂质含量高", cause: "B 供应商环己烷杂质谱(苯/硫)高于原供应商,进厂检验项目未覆盖", cons: "副反应加剧,产品色相超标、收率下降,结垢加速", L: 3, S: 3, safety: "进厂检验按原指标执行;供应商 COA 随货同行", suggest: "检验项目增加杂质谱分析;首批三批加严检验" },
|
||||
{ node: "节点2 · 聚合反应", dev: "副反应加剧", cause: "微量苯参与链转移,分子量分布变宽", cons: "产品性能波动,下游加工投诉", L: 2, S: 3, safety: "聚合配方留有调节余量", suggest: "建立 B 供应商原料的配方微调作业指导" },
|
||||
],
|
||||
},
|
||||
{
|
||||
cid: "MOC-2026-R03-0042", item: "回路切换失误", scene: "自动化改造调试期间控制回路切换失误,造成装置非计划停车",
|
||||
method: "JSA", residual: "中", dept: "三车间", adate: "2026-07-31", owner: "王仪表",
|
||||
title: '三车间自动化和安全隐患整改项目变更', status: '审批中',
|
||||
info: 'MOC-2026-R03-0042 三车间自动化和安全隐患整改项目变更', count: 2,
|
||||
jsaRows: [
|
||||
{ item: "回路切换失误", scene: "步骤4:新旧控制系统切换,回路误切导致装置非计划停车", inherent: "高", existing: "切换方案审批;切换前模拟演练", suggest: "切换双人复核逐项签字;保留一键回切手段 72 小时", residual: "中" },
|
||||
{ item: "静电损伤卡件", scene: "步骤2:卡件插拔作业静电防护不到位,DCS 卡件损坏", inherent: "中", existing: "佩戴防静电手环", suggest: "卡件备件现场备妥,作业区铺设防静电垫", residual: "低" },
|
||||
],
|
||||
},
|
||||
];
|
||||
const historyList = [
|
||||
{ id: "HAZOP-2025-018", change: "MOC-2025-R01-0023 常压炉燃料气切断阀改造", method: "HAZOP", unit: "01-常减压装置", scope: "燃料气系统节点", rows: 12, date: "2025-10-20" },
|
||||
{ id: "HAZOP-2024-006", change: "MOC-2024-R01-0003 减一线换热器 E-108 芯子更换", method: "HAZOP", unit: "01-常减压装置", scope: "换热系统节点", rows: 8, date: "2024-03-15" },
|
||||
{ id: "JSA-2025-041", change: "MOC-2025-R02-0014 再生器旋风分离器更换", method: "JSA", unit: "02-催化裂化装置", scope: "受限空间作业", rows: 6, date: "2025-05-08" },
|
||||
{ id: "JSA-2026-012", change: "MOC-2026-R01-0035 搅拌电机更换", method: "JSA", unit: "01-常减压装置", scope: "检维修作业", rows: 5, date: "2026-07-29" },
|
||||
{ id: "SCL-2025-033", change: "MOC-2025-R02-0021 气压机出口压力联锁逻辑修改", method: "检查表", unit: "02-催化裂化装置", scope: "联锁系统", rows: 14, date: "2025-09-18" },
|
||||
{ id: "AI-2026-008", change: "MOC-2026-R03-0008 聚合釜搅拌器密封形式变更", method: "AI 预分析", unit: "03-聚合装置", scope: "—", rows: 4, date: "2026-05-06" },
|
||||
];
|
||||
const templateList = [
|
||||
{ name: "HAZOP 节点划分模板", desc: "含偏差引导词库(过高/过低/无/反向等 18 个)与节点划分示例", tag: "HAZOP" },
|
||||
{ name: "JSA 作业步骤分析模板", desc: "作业步骤分解 → 危害识别 → 控制措施三段式,含检维修示例", tag: "JSA" },
|
||||
{ name: "安全检查表(SCL)模板库", desc: "按设备类型 28 套(机泵 / 换热器 / 塔器 / 储罐 / 电气 / 仪表)", tag: "检查表" },
|
||||
{ name: "风险矩阵 5×5 分级定义", desc: "可能性 × 严重性分级标准(公司 Q/SH 0600),AI 评级引用此定义", tag: "通用" },
|
||||
];
|
||||
const isHazop = computed(() => !!currentRecord.value?.hazopRows);
|
||||
const th = "border-b bg-slate-50 px-3 py-2 text-left text-[11px] font-semibold text-slate-500";
|
||||
const td = "border-b px-3 py-2 align-top text-xs leading-relaxed text-slate-700";
|
||||
|
||||
const hazopNodes = computed(() => {
|
||||
const scene = currentRecord.value;
|
||||
if (!scene?.hazopRows) return [] as { node: string; dev: string; n: number }[];
|
||||
const nodes = Array.from(new Map(scene.hazopRows.map((r:any) => [`${r.node}|${r.dev}`, { node: r.node, dev: r.dev, n: 0 }])).values());
|
||||
scene.hazopRows.forEach((r:any) => { const k:any = nodes.find((n:any) => n.node === r.node && n.dev === r.dev); if (k) k.n += 1; });
|
||||
return nodes;
|
||||
});
|
||||
const sel = ref(0);
|
||||
const selRows = computed(() => {
|
||||
const scene = currentRecord.value;
|
||||
if (!scene?.hazopRows) return [] as any;
|
||||
const n:any = hazopNodes.value[sel.value];
|
||||
return scene.hazopRows.filter((r:any) => r.node === n?.node && r.dev === n?.dev);
|
||||
});
|
||||
// HAZOP 风险矩阵:RR = L × S
|
||||
const rrTag = (L: number, S: number) => {
|
||||
const v = L * S;
|
||||
return v >= 12 ? { label: `较大 (${v})`, cls: "error" }
|
||||
: v >= 8 ? { label: `一般 (${v})`, cls: "warning" }
|
||||
: { label: `低 (${v})`, cls: "success" };
|
||||
};
|
||||
|
||||
// 切换tab
|
||||
const tabChange = (k: string) => {
|
||||
list.value = []
|
||||
currentTab.value = k;
|
||||
loading.value = true;
|
||||
if(k === 'highRisk'){
|
||||
setTimeout(() => {
|
||||
list.value = highRiskList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
if(k === 'history'){
|
||||
setTimeout(() => {
|
||||
list.value = historyList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
if(k === 'tpl'){
|
||||
setTimeout(() => {
|
||||
list.value = templateList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
// 高风险场景查看变更
|
||||
const openSceneChange = (record: any) => {
|
||||
routerPushByKey('home_highriskdetail', { query: { params: JSON.stringify(record) } })
|
||||
};
|
||||
// 查看分析记录
|
||||
const viewAnalysis = (record: any) => {
|
||||
currentRecord.value = record;
|
||||
progressDrawer.value = true;
|
||||
};
|
||||
// 查看历史分析检索
|
||||
const viewHistory = (id: string) => {
|
||||
window.$message?.info(`演示:在线查看 ${id} 完整分析记录`)
|
||||
};
|
||||
// 复用到新变更
|
||||
const copyHistory = (id: string) => {
|
||||
window.$message?.success(`演示:${id} 已复用到新变更草稿,分析行已带入待确认`)
|
||||
}
|
||||
// 预览模板
|
||||
const previewTemplate = (name: string) => {
|
||||
window.$message?.info(`演示:在线预览「${name}」`)
|
||||
}
|
||||
// 下载模板
|
||||
const downloadTemplate = (name: string) => {
|
||||
window.$message?.success(`演示:下载「${name}」(Word)`)
|
||||
}
|
||||
// 导出
|
||||
const exportFile = () => {
|
||||
window.$message?.success('分析记录表已导出(Excel)');
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tabChange('highRisk');
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 本专业高风险 -->
|
||||
<NSpin :show="loading" size="small">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div
|
||||
class="flex flex-wrap items-center gap-2 border border-slate-200 px-3 py-2 mb-3"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div v-for="t in TABS" :key="t.k" @click="tabChange(t.k)"
|
||||
class="flex items-center gap-1.5 px-3 py-1 text-xs cursor-pointer select-none rounded-[20px] border"
|
||||
:style="{ '--theme-color': themeStore.themeColor}"
|
||||
:class="currentTab === t.k ? 'bg-[var(--theme-color)] font-medium text-white border-[var(--theme-color)]' : 'text-slate-600 hover:bg-slate-100'"
|
||||
>
|
||||
{{ t.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 高风险场景 -->
|
||||
<div v-if="currentTab === 'highRisk'" class="border border-slate-200" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex items-center justify-between px-4 py-3 border-b mb-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Icon icon="lucide:shield-check" class="size-16px" :style="{color:themeStore.themeColor}" />
|
||||
<p class="text-base font-semibold">变更新增高风险场景</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 min-h-28px">
|
||||
<NTag size="small" type="primary" class="text-11px font-medium">单笔变更的分析编制在变更上下文内完成</NTag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="px-4 mb-3 flex flex-wrap items-center gap-1.5">
|
||||
<span class="mr-1 text-xs text-slate-400">时间</span>
|
||||
<NButton
|
||||
size="tiny"
|
||||
round
|
||||
:type="range === r ? 'primary' : 'default'"
|
||||
v-for="r in RISK_RANGES"
|
||||
:key="r"
|
||||
@click="range = r"
|
||||
>
|
||||
{{ r }}
|
||||
</NButton>
|
||||
<span class="ml-3 mr-1 text-xs text-slate-400">部门</span>
|
||||
<NButton
|
||||
size="tiny"
|
||||
round
|
||||
v-for="d in departments"
|
||||
:key="d.id"
|
||||
:type="dept === d.name ? 'primary' : 'default'"
|
||||
@click="dept = d.name"
|
||||
>
|
||||
{{ d.name }}
|
||||
</NButton>
|
||||
<span class="ml-auto self-center text-[11px] text-slate-400">{{ list.length }} 个高风险场景</span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="space-y-3 px-4 pb-3">
|
||||
<div v-for="(s, i) in list" :key="`${s.cid ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-3 rounded-lg border px-4 py-3">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<NTag type="info" size="small">{{ s.method }}</NTag>
|
||||
<span class="text-sm font-medium text-slate-800">{{ s.item }}</span>
|
||||
<NTag type="error" size="small">固有风险 · 高</NTag>
|
||||
<NTag v-if="s.residual==='高'" type="error" size="small">剩余风险 · {{ s.residual }}</NTag>
|
||||
<NTag v-if="s.residual==='中'" type="warning" size="small">剩余风险 · {{ s.residual }}</NTag>
|
||||
<NTag v-if="s.residual==='低'" type="info" size="small">剩余风险 · {{ s.residual }}</NTag>
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs text-slate-600">{{ s.scene }}</div>
|
||||
<div class="mt-0.5 text-xs text-slate-400">
|
||||
变更:{{ s.info }} · {{ s.dept }} · 分析日期 {{ s.adate }} · 责任:{{ s.owner }} · 分析记录 {{ s.count }} 行
|
||||
</div>
|
||||
</div>
|
||||
<NButton ghost size="small" class="text-xs" @click="openSceneChange(s)">查看变更</NButton>
|
||||
<NButton size="small" type="primary" class="text-xs" @click="viewAnalysis(s)">查看分析记录</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="py-6 text-center text-xs text-slate-400">当前筛选条件下无新增高风险场景</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 历史分析检索 -->
|
||||
<div v-if="currentTab === 'history'" class="border border-slate-200" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex items-center justify-between px-4 py-3 border-b mb-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Icon icon="mage:book" class="size-18px" :style="{color:themeStore.themeColor}" />
|
||||
<p class="text-base font-semibold">历史分析记录检索(企业风险知识资产)</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 min-h-28px">
|
||||
<NInput v-model:value="keyword" size="small" class="text-xs !w-200px" placeholder="按单号 / 装置 / 关键词检索…">
|
||||
<template #suffix>
|
||||
<Icon icon="akar-icons:search" class="size-14px text-slate-400 cursor-pointer" />
|
||||
</template>
|
||||
</NInput>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-4 mb-3 flex flex-wrap items-center gap-1.5">
|
||||
<NButton
|
||||
size="tiny"
|
||||
round
|
||||
v-for="m in ['全部', 'HAZOP', 'JSA', '检查表', 'AI 预分析']"
|
||||
:key="m"
|
||||
:type="method === m ? 'primary' : 'default'"
|
||||
@click="method = m"
|
||||
>
|
||||
{{ m }}
|
||||
</NButton>
|
||||
<span class="ml-auto self-center text-[11px] text-slate-400">{{ list.length }} 条记录</span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="space-y-3 px-4 pb-3">
|
||||
<div v-for="h in list" :key="h.id" class="flex flex-wrap items-center gap-3 rounded-lg border px-4 py-2.5">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="font-mono text-[11px] text-slate-400">{{ h.id }}</span>
|
||||
<NTag type="info" size="small">{{ h.method }}</NTag>
|
||||
<span class="text-sm text-slate-800">{{ h.change }}</span>
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs text-slate-500">{{ h.unit }} · 范围:{{ h.scope }} · {{ h.rows }} 行分析记录 · {{ h.date }}</div>
|
||||
</div>
|
||||
<NButton text type="primary" @click="viewHistory(h.id)">
|
||||
<Icon icon="lucide:eye" class="size-16px" />
|
||||
</NButton>
|
||||
<NButton ghost size="small" class="text-xs" @click="copyHistory(h.id)">复用到新变更</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="py-6 text-center text-xs text-slate-400">未找到匹配的分析记录</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 方法模板库 -->
|
||||
<div v-if="currentTab === 'tpl'" class="border border-slate-200" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex items-center justify-between px-4 py-3 border-b mb-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Icon icon="akar-icons:file" class="size-16px" :style="{color:themeStore.themeColor}" />
|
||||
<p class="text-base font-semibold">方法模板库(AI 风险预分析的知识来源之一)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div class="space-y-3 px-4 pb-3">
|
||||
<div class="grid gap-3 grid-cols-2">
|
||||
<div v-for="t in list" :key="t.name" class="rounded-lg border p-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-sm font-medium text-slate-800">{{ t.name }}</span>
|
||||
<NTag size="small" type="info">{{ t.tag }}</NTag>
|
||||
</div>
|
||||
<p class="mt-1.5 text-xs leading-relaxed text-slate-500">{{ t.desc }}</p>
|
||||
<div class="mt-3 flex gap-2">
|
||||
<NButton ghost size="small" class="text-xs" @click="previewTemplate(t.name)">查看</NButton>
|
||||
<NButton ghost size="small" class="text-xs" @click="downloadTemplate(t.name)">
|
||||
<Icon icon="material-symbols:download" class="size-14px" />下载
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="py-6 text-center text-xs text-slate-400">未找到匹配的方法模板库</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 进度弹框 -->
|
||||
<NDrawer v-model:show="progressDrawer" width="85%" placement="right">
|
||||
<NDrawerContent closable>
|
||||
<template #header>
|
||||
<span class="flex flex-wrap items-center gap-2 text-base">
|
||||
风险分析记录表
|
||||
<NTag size="small" type="info">{{ currentRecord.method }}</NTag>
|
||||
<NTag size="small" type="error">含固有风险 · 高 场景</NTag>
|
||||
</span>
|
||||
</template>
|
||||
<div>
|
||||
<div class="mb-3 flex flex-wrap gap-x-5 gap-y-1 text-xs text-slate-500">
|
||||
<span>变更:<span class="font-medium text-slate-700">{{ currentRecord.info }}</span></span>
|
||||
<span>分析日期:{{ currentRecord.adate }}</span>
|
||||
<span>责任:{{ currentRecord.owner }}</span>
|
||||
<span class="ml-auto text-slate-400">分析编制与修改在变更上下文内完成,此处只读</span>
|
||||
</div>
|
||||
<div v-if="!isHazop" class="overflow-x-auto rounded-lg border border-b-0">
|
||||
<table class="w-full min-w-[860px] border-collapse">
|
||||
<thead>
|
||||
<tr>
|
||||
<th :class="th" class="w-[130px]">风险项</th>
|
||||
<th :class="th">场景描述</th>
|
||||
<th :class="th" class="w-[76px] text-center">固有风险</th>
|
||||
<th :class="th">现有措施</th>
|
||||
<th :class="th">建议措施</th>
|
||||
<th :class="th" class="w-[76px] text-center">剩余风险</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(r, i) in currentRecord.jsaRows" :key="i" :class="r.item === currentRecord.item && r.inherent === '高' ? 'bg-red-50/40' : ''">
|
||||
<td :class="td" class="font-medium text-slate-800">{{ r.item }}</td>
|
||||
<td :class="td">{{ r.scene }}</td>
|
||||
<td :class="td" class="text-center">
|
||||
<NTag size="small" type="error" v-if="r.inherent==='高'">{{ r.inherent }}</NTag>
|
||||
<NTag size="small" type="warning" v-if="r.inherent==='中'">{{ r.inherent }}</NTag>
|
||||
<NTag size="small" type="info" v-if="r.inherent==='低'">{{ r.inherent }}</NTag>
|
||||
</td>
|
||||
<td :class="td">{{ r.existing }}</td>
|
||||
<td :class="td">{{ r.suggest }}</td>
|
||||
<td :class="td" class="text-center">
|
||||
<NTag size="small" type="error" v-if="r.residual==='高'">{{ r.residual }}</NTag>
|
||||
<NTag size="small" type="warning" v-if="r.residual==='中'">{{ r.residual }}</NTag>
|
||||
<NTag size="small" type="info" v-if="r.residual==='低'">{{ r.residual }}</NTag>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="flex gap-3">
|
||||
<!-- 节点 · 偏离导航 -->
|
||||
<div class="w-48 shrink-0 space-y-1.5">
|
||||
<div v-for="(n, i) in hazopNodes" :key="i" @click="sel = i"
|
||||
class="w-full rounded-lg border px-3 py-2 text-left text-xs cursor-pointer"
|
||||
:class="sel === i ? 'border-[var(--theme-color)] bg-[var(--theme-color)] text-white' : 'hover:border-[var(--theme-color)]'"
|
||||
:style="{'--theme-color': themeStore.themeColor}"
|
||||
>
|
||||
<span class="block truncate font-medium">{{ n.dev }}</span>
|
||||
<span class="mt-0.5 flex items-center justify-between text-[11px]" :class="sel === i ? 'text-white/80' : 'text-slate-400'">
|
||||
<span class="truncate">{{ n.node.replace(/^节点\d+ · /, '') }}</span>
|
||||
<NTag size="tiny" round class="ml-1" :type="sel === i ? 'default' : 'success'">{{ n.n }} 条</NTag>
|
||||
</span>
|
||||
</div>
|
||||
<p class="px-1 pt-1 text-[11px] leading-relaxed text-slate-400">L / S 取值 1–5,RR 按 5×5 风险矩阵实时重算</p>
|
||||
</div>
|
||||
<!-- 偏差分析表 -->
|
||||
<div class="min-w-0 flex-1 overflow-x-auto rounded-lg border border-b-0">
|
||||
<table class="w-full min-w-[760px] border-collapse">
|
||||
<thead>
|
||||
<tr>
|
||||
<th :class="th">原因</th>
|
||||
<th :class="th">后果</th>
|
||||
<th :class="th" class="w-10 !text-center">L</th>
|
||||
<th :class="th" class="w-10 !text-center">S</th>
|
||||
<th :class="th" class="w-[92px] !text-center">RR</th>
|
||||
<th :class="th">安全措施</th>
|
||||
<th :class="th">建议措施</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(r, i) in selRows" :key="i">
|
||||
<td :class="td">{{ r.cause }}</td>
|
||||
<td :class="td">{{ r.cons }}</td>
|
||||
<td :class="td" class="text-center">{{ r.L }}</td>
|
||||
<td :class="td" class="text-center">{{ r.S }}</td>
|
||||
<td :class="td" class="text-center">
|
||||
<NTag size="small" :type="rrTag(r.L, r.S).cls">{{ rrTag(r.L, r.S).label }}</NTag>
|
||||
</td>
|
||||
<td :class="td">{{ r.safety }}</td>
|
||||
<td :class="td">{{ r.suggest }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="flex justify-end gap-2">
|
||||
<NButton ghost @click="exportFile"><Icon icon="material-symbols:download" class="size-16px" />导出</NButton>
|
||||
<NButton type="primary" @click="progressDrawer = false">关闭</NButton>
|
||||
</div>
|
||||
</template>
|
||||
</NDrawerContent>
|
||||
</NDrawer>
|
||||
</NCard>
|
||||
</NSpin>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 303px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
+1220
-1220
File diff suppressed because it is too large
Load Diff
+103
-103
@@ -1,103 +1,103 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const emit = defineEmits<{ go: [v: string, preset?: string];}>();
|
||||
|
||||
interface Draft {
|
||||
id: string;
|
||||
name: string;
|
||||
time: string;
|
||||
step: string;
|
||||
progress: string;
|
||||
}
|
||||
const drafts = ref<Draft[]>([
|
||||
{ id: "D-2026-011", name: "R-101 搅拌提速至 180rpm(80℃→95℃)", time: "2026-08-02 09:41", step: "已生成申请表 · 待提交", progress: "4/6 页" },
|
||||
{ id: "D-2026-009", name: "P-301 机封冲洗方案调整(驳回重报)", time: "2026-07-30 16:22", step: "变更预识别完成", progress: "2/6 页" },
|
||||
{ id: "D-2026-007", name: "化验室新增 COD 在线分析仪", time: "2026-07-28 11:05", step: "仅填写变更描述", progress: "1/6 页" },
|
||||
]);
|
||||
|
||||
const continueEdit = (d: Draft) => {
|
||||
window.$message?.success(`已载入草稿 ${d.id},从「${d.step}」断点继续编辑`);
|
||||
emit("go", "apply");
|
||||
};
|
||||
const remove = (d: Draft) => {
|
||||
drafts.value = drafts.value.filter((x: Draft) => x.id !== d.id);
|
||||
window.$message?.success(`草稿 ${d.id} 已删除`);
|
||||
};
|
||||
const progressPct = (p: string) => {
|
||||
const m = p.match(/(\d+)\s*\/\s*(\d+)/);
|
||||
return m ? Math.round((Number(m[1]) / Number(m[2])) * 100) : 0;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 我的草稿箱 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="border mb-3 py-3 px-4" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:16">
|
||||
<div class="h-100% flex items-center gap-2">
|
||||
<Icon icon="akar-icons:file" class="size-16px" :style="{ color: themeStore.themeColor }" />
|
||||
<p class="text-sm font-600">我的草稿箱</p>
|
||||
<span class="rounded bg-slate-100 px-1.5 text-xs font-semibold text-slate-700">{{ drafts.length }}</span>
|
||||
<p class="text-xs text-#94a3b8">草稿仅本人可见,提交后自动从草稿箱移除</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:8" class="flex items-center justify-end gap-12px">
|
||||
<NButton type="primary" size="small" @click="emit('go', 'apply')">
|
||||
<Icon icon="ic:round-plus" class="size-16px" />
|
||||
新建空白变更
|
||||
</NButton>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</div>
|
||||
<div class="space-y-2 scroll">
|
||||
<div v-for="d in drafts" :key="d.id" class="rounded-lg border px-4 py-3">
|
||||
<div class="flex flex-wrap items-start gap-3">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="text-sm font-semibold text-slate-800 dark:text-white">{{ d.name }}</div>
|
||||
<div class="mt-1 flex flex-wrap items-center gap-2 text-[11px] text-slate-400">
|
||||
<span class="font-mono">{{ d.id }}</span>
|
||||
<span>保存于 {{ d.time }}</span>
|
||||
<NTag type="primary" size="small" class="text-11px">{{ d.step }}</NTag>
|
||||
</div>
|
||||
<div class="mt-2 flex items-center gap-2">
|
||||
<div class="h-1.5 w-40 overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full bg-[#6E93C6]" :style="{ width: progressPct(d.progress) + '%' }" />
|
||||
</div>
|
||||
<span class="text-[11px] text-slate-400">编辑进度 {{ d.progress }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex shrink-0 items-center gap-2 pt-2px">
|
||||
<NButton class="text-xs" text type="error" @click="remove(d)">删除</NButton>
|
||||
<NButton class="text-xs" text type="primary" @click="continueEdit(d)">继续编辑</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="drafts.length === 0" class="rounded-lg border border-dashed bg-white py-12 text-center">
|
||||
<div class="text-sm text-slate-400">暂无草稿</div>
|
||||
<div class="mt-1 text-xs text-slate-300">在变更申请页点击右上角「保存」,即可将当前内容存为草稿</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 212px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const emit = defineEmits<{ go: [v: string, preset?: string];}>();
|
||||
|
||||
interface Draft {
|
||||
id: string;
|
||||
name: string;
|
||||
time: string;
|
||||
step: string;
|
||||
progress: string;
|
||||
}
|
||||
const drafts = ref<Draft[]>([
|
||||
{ id: "D-2026-011", name: "R-101 搅拌提速至 180rpm(80℃→95℃)", time: "2026-08-02 09:41", step: "已生成申请表 · 待提交", progress: "4/6 页" },
|
||||
{ id: "D-2026-009", name: "P-301 机封冲洗方案调整(驳回重报)", time: "2026-07-30 16:22", step: "变更预识别完成", progress: "2/6 页" },
|
||||
{ id: "D-2026-007", name: "化验室新增 COD 在线分析仪", time: "2026-07-28 11:05", step: "仅填写变更描述", progress: "1/6 页" },
|
||||
]);
|
||||
|
||||
const continueEdit = (d: Draft) => {
|
||||
window.$message?.success(`已载入草稿 ${d.id},从「${d.step}」断点继续编辑`);
|
||||
emit("go", "apply");
|
||||
};
|
||||
const remove = (d: Draft) => {
|
||||
drafts.value = drafts.value.filter((x: Draft) => x.id !== d.id);
|
||||
window.$message?.success(`草稿 ${d.id} 已删除`);
|
||||
};
|
||||
const progressPct = (p: string) => {
|
||||
const m = p.match(/(\d+)\s*\/\s*(\d+)/);
|
||||
return m ? Math.round((Number(m[1]) / Number(m[2])) * 100) : 0;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 我的草稿箱 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="border mb-3 py-3 px-4" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:16">
|
||||
<div class="h-100% flex items-center gap-2">
|
||||
<Icon icon="akar-icons:file" class="size-16px" :style="{ color: themeStore.themeColor }" />
|
||||
<p class="text-sm font-600">我的草稿箱</p>
|
||||
<span class="rounded bg-slate-100 px-1.5 text-xs font-semibold text-slate-700">{{ drafts.length }}</span>
|
||||
<p class="text-xs text-#94a3b8">草稿仅本人可见,提交后自动从草稿箱移除</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:8" class="flex items-center justify-end gap-12px">
|
||||
<NButton type="primary" size="small" @click="emit('go', 'apply')">
|
||||
<Icon icon="ic:round-plus" class="size-16px" />
|
||||
新建空白变更
|
||||
</NButton>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</div>
|
||||
<div class="space-y-2 scroll">
|
||||
<div v-for="d in drafts" :key="d.id" class="rounded-lg border px-4 py-3">
|
||||
<div class="flex flex-wrap items-start gap-3">
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="text-sm font-semibold text-slate-800 dark:text-white">{{ d.name }}</div>
|
||||
<div class="mt-1 flex flex-wrap items-center gap-2 text-[11px] text-slate-400">
|
||||
<span class="font-mono">{{ d.id }}</span>
|
||||
<span>保存于 {{ d.time }}</span>
|
||||
<NTag type="primary" size="small" class="text-11px">{{ d.step }}</NTag>
|
||||
</div>
|
||||
<div class="mt-2 flex items-center gap-2">
|
||||
<div class="h-1.5 w-40 overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full bg-[#6E93C6]" :style="{ width: progressPct(d.progress) + '%' }" />
|
||||
</div>
|
||||
<span class="text-[11px] text-slate-400">编辑进度 {{ d.progress }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex shrink-0 items-center gap-2 pt-2px">
|
||||
<NButton class="text-xs" text type="error" @click="remove(d)">删除</NButton>
|
||||
<NButton class="text-xs" text type="primary" @click="continueEdit(d)">继续编辑</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="drafts.length === 0" class="rounded-lg border border-dashed bg-white py-12 text-center">
|
||||
<div class="text-sm text-slate-400">暂无草稿</div>
|
||||
<div class="mt-1 text-xs text-slate-300">在变更申请页点击右上角「保存」,即可将当前内容存为草稿</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 212px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
+631
-631
File diff suppressed because it is too large
Load Diff
+666
-666
File diff suppressed because it is too large
Load Diff
@@ -1,195 +1,195 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const btnLoading = ref<boolean>(false);
|
||||
const useTime = ref<any>(null);
|
||||
const useTimeModal = ref<boolean>(false);
|
||||
const currentRow = ref<any>(null);
|
||||
const list = ref<any[]>([]);
|
||||
const lists = [
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
approveTime: "2026-07-31", applicant: "吴强", level: "一般", type: "工艺",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR', duration: "永久",
|
||||
useTime: "", planUse: "2026-08-01", pssr: "PSSR 检查确认表-签字版.pdf",
|
||||
hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
approveTime: "2026-07-31", applicant: "吴强", level: "重要", type: "工艺",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR', duration: "临时",
|
||||
useTime: "2026-07-16 06:30", planUse: "2026-08-01", pssr: "",
|
||||
hasChange: true,
|
||||
},
|
||||
];
|
||||
|
||||
const timePickerProps = {
|
||||
format: 'HH:mm', // 时间选择器面板上显示的格式
|
||||
seconds: false // 隐藏秒选择器[reference:3][reference:4]
|
||||
}
|
||||
|
||||
// 禁用今天之前的日期(今天可选)
|
||||
const disabledDate = (ts: number) => {
|
||||
const today = new Date()
|
||||
today.setHours(0, 0, 0, 0) // 今天的 00:00:00
|
||||
return ts < today.getTime() // 时间戳小于今天 0 点则禁用
|
||||
}
|
||||
// 获取列表数据
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
list.value = lists;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 查看
|
||||
const viewFile = (record: any) => {
|
||||
window.$message?.info(`预览「${record.pssr}」(上传件不做内容识别,原件已随单归档)`)
|
||||
};
|
||||
// 下载
|
||||
const downloadFile = (record: any) => {
|
||||
window.$message?.success(`下载「${record.pssr}」`)
|
||||
};
|
||||
// 打开变更单
|
||||
const openChange = (record: any) => {
|
||||
routerPushByKey('home_highriskdetail', { query: { params: JSON.stringify(record) } })
|
||||
};
|
||||
// 填写投用日期
|
||||
const fillUseTime = (record: any) => {
|
||||
useTime.value = null;
|
||||
currentRow.value = record;
|
||||
useTimeModal.value = true;
|
||||
};
|
||||
// 保存投用日期
|
||||
const saveUseTime = () => {
|
||||
if (!useTime.value) {
|
||||
return window.$message?.warning("请选择投用时间");
|
||||
}
|
||||
btnLoading.value = true;
|
||||
setTimeout(() => {
|
||||
btnLoading.value = false;
|
||||
useTimeModal.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- PSSR监督 -->
|
||||
<NSpin :show="loading" size="small">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center gap-2 mb-3">
|
||||
<span class="text-sm font-semibold text-slate-700">待投用变更(本车间 · 一车间)</span>
|
||||
<NTag size="small" type="primary">{{ list.length }} 起</NTag>
|
||||
<span class="ml-auto text-[11px] text-slate-400">按审批通过时间排序 · 投用时间由发起人在资料关闭页填报 · 支持属地负责人在此代录投用日期</span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div
|
||||
class="space-y-3 h-100%"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<div v-for="(s, i) in list" :key="`${s.id ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-x-3 gap-y-2 border p-4" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NTag v-if="s.status==='待PSSR'" type="warning" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='待关闭'" type="error" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='实施中'" type="primary" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='待验收'" type="success" size="small">{{ s.status }}</NTag>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex flex-wrap items-center gap-1.5">
|
||||
<p class="truncate text-sm font-medium text-slate-800">{{ s.title }}</p>
|
||||
<NTag v-if="s.level==='一般'" size="small">{{s.level}}</NTag>
|
||||
<NTag v-if="s.level==='重要'" size="small" type="error">{{s.level}}</NTag>
|
||||
<NTag size="small" type="primary">{{s.type}}</NTag>
|
||||
<NTag v-if="s.duration==='永久'" size="small">{{s.duration}}</NTag>
|
||||
<NTag v-if="s.duration==='临时'" size="small" type="warning">{{s.duration}}</NTag>
|
||||
</div>
|
||||
<p class="mt-0.5 text-[11px] text-slate-400">{{ s.id }} · {{ s.applicant }}</p>
|
||||
<p class="text-slate-400 text-[11px]">审批通过时间:<span class="font-medium text-slate-600">{{ s.approveTime ?? '—' }}</span></p>
|
||||
<p class="text-slate-400 text-[11px]">变更投用时间:<span class="font-medium text-[var(--warning-color)]">{{ s.useTime ? s.useTime : `待投用(计划 ${s.planUse})` }}</span></p>
|
||||
<p class="mt-0.5 text-[11px] text-slate-400">{{ s.statusDetail }}</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5 rounded-md border bg-slate-50/60 px-2 py-1">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-[var(--theme-color)]" />
|
||||
<span class="text-[11px] font-medium text-slate-600">PSSR 确认表</span>
|
||||
<template v-if="s.pssr">
|
||||
<NButton ghost size="tiny" class="text-11px" @click="viewFile(s)">查看</NButton>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="downloadFile(s)">下载</NButton>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="text-[11px] text-[var(--warning-color)]">待传</span>
|
||||
</template>
|
||||
</div>
|
||||
<NButton v-if="!s.useTime" size="small" type="primary" class="text-xs" @click="fillUseTime(s)">填写投用日期</NButton>
|
||||
<NButton v-if="s.hasChange" size="small" ghost class="text-xs" @click="openChange(s)">打开变更单</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
<!-- 填写投用日期弹窗 -->
|
||||
<NModal
|
||||
v-model:show="useTimeModal"
|
||||
preset="card"
|
||||
title="填写投用日期"
|
||||
:auto-focus="false"
|
||||
:style="{ width: '450px', height: 'auto' }"
|
||||
:segmented="{ content: true, footer: true }"
|
||||
>
|
||||
<template #default>
|
||||
<div
|
||||
class="space-y-3 text-sm"
|
||||
:style="{
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning, 0.1),
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<p class="text-xs text-slate-500">{{ currentRow?.id }} · {{ currentRow?.title }}</p>
|
||||
<div class="rounded-lg border border-[var(--warning-color)] bg-[var(--warning-bg)] px-3 py-2 text-xs leading-relaxed text-[var(--warning-color)]">
|
||||
提示:投用前应完成变更培训与 PSSR 确认(资料已上传)。投用后变更进入待验收阶段,临时变更自投用日起计算时限。
|
||||
</div>
|
||||
<NDatePicker
|
||||
v-model:value="useTime"
|
||||
type="datetime"
|
||||
:is-date-disabled="disabledDate"
|
||||
format="yyyy-MM-dd HH:mm"
|
||||
placeholder="请选择投用时间"
|
||||
:time-picker-props="timePickerProps"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div class="flex justify-end gap-[10px]">
|
||||
<NButton size="small" @click="useTimeModal = false">取消</NButton>
|
||||
<NButton size="small" type="primary" :loading="btnLoading" @click="saveUseTime">确认投用</NButton>
|
||||
</div>
|
||||
</template>
|
||||
</NModal>
|
||||
</NSpin>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 180px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const btnLoading = ref<boolean>(false);
|
||||
const useTime = ref<any>(null);
|
||||
const useTimeModal = ref<boolean>(false);
|
||||
const currentRow = ref<any>(null);
|
||||
const list = ref<any[]>([]);
|
||||
const lists = [
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
approveTime: "2026-07-31", applicant: "吴强", level: "一般", type: "工艺",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR', duration: "永久",
|
||||
useTime: "", planUse: "2026-08-01", pssr: "PSSR 检查确认表-签字版.pdf",
|
||||
hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
approveTime: "2026-07-31", applicant: "吴强", level: "重要", type: "工艺",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR', duration: "临时",
|
||||
useTime: "2026-07-16 06:30", planUse: "2026-08-01", pssr: "",
|
||||
hasChange: true,
|
||||
},
|
||||
];
|
||||
|
||||
const timePickerProps = {
|
||||
format: 'HH:mm', // 时间选择器面板上显示的格式
|
||||
seconds: false // 隐藏秒选择器[reference:3][reference:4]
|
||||
}
|
||||
|
||||
// 禁用今天之前的日期(今天可选)
|
||||
const disabledDate = (ts: number) => {
|
||||
const today = new Date()
|
||||
today.setHours(0, 0, 0, 0) // 今天的 00:00:00
|
||||
return ts < today.getTime() // 时间戳小于今天 0 点则禁用
|
||||
}
|
||||
// 获取列表数据
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
list.value = lists;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 查看
|
||||
const viewFile = (record: any) => {
|
||||
window.$message?.info(`预览「${record.pssr}」(上传件不做内容识别,原件已随单归档)`)
|
||||
};
|
||||
// 下载
|
||||
const downloadFile = (record: any) => {
|
||||
window.$message?.success(`下载「${record.pssr}」`)
|
||||
};
|
||||
// 打开变更单
|
||||
const openChange = (record: any) => {
|
||||
routerPushByKey('home_highriskdetail', { query: { params: JSON.stringify(record) } })
|
||||
};
|
||||
// 填写投用日期
|
||||
const fillUseTime = (record: any) => {
|
||||
useTime.value = null;
|
||||
currentRow.value = record;
|
||||
useTimeModal.value = true;
|
||||
};
|
||||
// 保存投用日期
|
||||
const saveUseTime = () => {
|
||||
if (!useTime.value) {
|
||||
return window.$message?.warning("请选择投用时间");
|
||||
}
|
||||
btnLoading.value = true;
|
||||
setTimeout(() => {
|
||||
btnLoading.value = false;
|
||||
useTimeModal.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- PSSR监督 -->
|
||||
<NSpin :show="loading" size="small">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center gap-2 mb-3">
|
||||
<span class="text-sm font-semibold text-slate-700">待投用变更(本车间 · 一车间)</span>
|
||||
<NTag size="small" type="primary">{{ list.length }} 起</NTag>
|
||||
<span class="ml-auto text-[11px] text-slate-400">按审批通过时间排序 · 投用时间由发起人在资料关闭页填报 · 支持属地负责人在此代录投用日期</span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<div
|
||||
class="space-y-3 h-100%"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<div v-for="(s, i) in list" :key="`${s.id ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-x-3 gap-y-2 border p-4" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NTag v-if="s.status==='待PSSR'" type="warning" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='待关闭'" type="error" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='实施中'" type="primary" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='待验收'" type="success" size="small">{{ s.status }}</NTag>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="flex flex-wrap items-center gap-1.5">
|
||||
<p class="truncate text-sm font-medium text-slate-800">{{ s.title }}</p>
|
||||
<NTag v-if="s.level==='一般'" size="small">{{s.level}}</NTag>
|
||||
<NTag v-if="s.level==='重要'" size="small" type="error">{{s.level}}</NTag>
|
||||
<NTag size="small" type="primary">{{s.type}}</NTag>
|
||||
<NTag v-if="s.duration==='永久'" size="small">{{s.duration}}</NTag>
|
||||
<NTag v-if="s.duration==='临时'" size="small" type="warning">{{s.duration}}</NTag>
|
||||
</div>
|
||||
<p class="mt-0.5 text-[11px] text-slate-400">{{ s.id }} · {{ s.applicant }}</p>
|
||||
<p class="text-slate-400 text-[11px]">审批通过时间:<span class="font-medium text-slate-600">{{ s.approveTime ?? '—' }}</span></p>
|
||||
<p class="text-slate-400 text-[11px]">变更投用时间:<span class="font-medium text-[var(--warning-color)]">{{ s.useTime ? s.useTime : `待投用(计划 ${s.planUse})` }}</span></p>
|
||||
<p class="mt-0.5 text-[11px] text-slate-400">{{ s.statusDetail }}</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5 rounded-md border bg-slate-50/60 px-2 py-1">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-[var(--theme-color)]" />
|
||||
<span class="text-[11px] font-medium text-slate-600">PSSR 确认表</span>
|
||||
<template v-if="s.pssr">
|
||||
<NButton ghost size="tiny" class="text-11px" @click="viewFile(s)">查看</NButton>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="downloadFile(s)">下载</NButton>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="text-[11px] text-[var(--warning-color)]">待传</span>
|
||||
</template>
|
||||
</div>
|
||||
<NButton v-if="!s.useTime" size="small" type="primary" class="text-xs" @click="fillUseTime(s)">填写投用日期</NButton>
|
||||
<NButton v-if="s.hasChange" size="small" ghost class="text-xs" @click="openChange(s)">打开变更单</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
<!-- 填写投用日期弹窗 -->
|
||||
<NModal
|
||||
v-model:show="useTimeModal"
|
||||
preset="card"
|
||||
title="填写投用日期"
|
||||
:auto-focus="false"
|
||||
:style="{ width: '450px', height: 'auto' }"
|
||||
:segmented="{ content: true, footer: true }"
|
||||
>
|
||||
<template #default>
|
||||
<div
|
||||
class="space-y-3 text-sm"
|
||||
:style="{
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning, 0.1),
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<p class="text-xs text-slate-500">{{ currentRow?.id }} · {{ currentRow?.title }}</p>
|
||||
<div class="rounded-lg border border-[var(--warning-color)] bg-[var(--warning-bg)] px-3 py-2 text-xs leading-relaxed text-[var(--warning-color)]">
|
||||
提示:投用前应完成变更培训与 PSSR 确认(资料已上传)。投用后变更进入待验收阶段,临时变更自投用日起计算时限。
|
||||
</div>
|
||||
<NDatePicker
|
||||
v-model:value="useTime"
|
||||
type="datetime"
|
||||
:is-date-disabled="disabledDate"
|
||||
format="yyyy-MM-dd HH:mm"
|
||||
placeholder="请选择投用时间"
|
||||
:time-picker-props="timePickerProps"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div class="flex justify-end gap-[10px]">
|
||||
<NButton size="small" @click="useTimeModal = false">取消</NButton>
|
||||
<NButton size="small" type="primary" :loading="btnLoading" @click="saveUseTime">确认投用</NButton>
|
||||
</div>
|
||||
</template>
|
||||
</NModal>
|
||||
</NSpin>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 180px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
+218
-218
@@ -1,218 +1,218 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
interface FlowStep {
|
||||
stage: string;
|
||||
actor: string;
|
||||
role?: string;
|
||||
title: string;
|
||||
detail?: string;
|
||||
system?: string;
|
||||
time: string;
|
||||
branch?: string;
|
||||
}
|
||||
interface Scenario {
|
||||
id: string; no: string; title: string; changeName: string;
|
||||
tags: { text: string; cls: string }[];
|
||||
desc: string; stages: string[]; steps: FlowStep[];
|
||||
}
|
||||
const T = {
|
||||
perm: "border-[#ACC6E5] bg-[#DFE9F6] text-[#1D4E9C]",
|
||||
temp: "border-amber-200 bg-amber-50 text-amber-700",
|
||||
general: "bg-slate-100 text-slate-600",
|
||||
major: "border-red-200 bg-red-50 text-red-600",
|
||||
urgent: "border-red-600 bg-red-600 text-white",
|
||||
branch: "border-violet-200 bg-violet-50 text-violet-600",
|
||||
};
|
||||
const STAGE_MAIN = ["变更申请", "会签与审批", "投用前确认", "投用", "验收", "关闭"];
|
||||
const STAGE_TEMP = ["变更申请", "会签与审批", "投用前确认", "投用", "临时运行与恢复", "验收", "关闭"];
|
||||
const SCENARIOS: Scenario[] = [
|
||||
{
|
||||
id: "s1", no: "示例 1", title: "永久 · 一般变更 全流程",
|
||||
changeName: "MOC-2026-R01-0041「缩合反应温度及时间优化」",
|
||||
tags: [{ text: "永久", cls: T.perm }, { text: "一般", cls: T.general }],
|
||||
desc: "覆盖:AI 识别 → 申请表 → 风险分析 → 培训/PSSR/验收/关闭表生成 → 部门审核 → 专业会签 → 最终批准 → 培训签到 → PSSR → 确认投用 → 验收 → 关闭归档。",
|
||||
stages: STAGE_MAIN,
|
||||
steps: [
|
||||
{ stage: "变更申请", actor: "张工艺", role: "车间工程师", title: "录入变更描述,AI 完成变更识别", detail: "判定为「变更」(非同类替换):反应温度 80℃→90℃、保温 8h→4h、DCS 报警/联锁值上调等 4 项前后对比,输出所需材料清单;识别结果人工确认,可直接修改", system: "AI 识别完成,自动预填变更前后对比表", time: "08-01 09:12" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成变更申请表", detail: "AI 自动总结名称「缩合反应温度及时间优化」(28 字内);类型判定:工艺;等级评分 12 分 → 一般变更;时限:永久;上传小试报告、杂质分析等附件", system: "附件版本受控,变更编号 MOC-2026-R01-0041 生成", time: "08-01 09:40" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "AI 风险预分析,形成风险分析记录表", detail: "输出危害严重性 / 事件概率 / 保护层影响预分析;系统按规则推荐 HAZOP + 检查表法(支持手动重选),形成风险分析记录与管控措施", system: "预分析报告经人工确认后生效", time: "08-01 10:05" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成培训 / PSSR / 验收评价 / 关闭确认表,提交审批", detail: "验收评价按预期效果量化:转化率 ≥98%、保温 4h±0.5h、杂质 ≤0.15% 等 5 项;选择审批人后提交", system: "进入一般变更审批流,企业微信 + 短信通知李主任", time: "08-01 10:20" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "车间主任", title: "部门审核:同意", detail: "AI 审批辅助:强制合规提示(联锁测试投用前完成)、冲突提示(无冲突)、关键参数对比;意见:变更方案可行,同意", system: "审批留痕,流转专业会签", time: "08-01 14:32" },
|
||||
{ stage: "会签与审批", actor: "王仪表", role: "专业会签 · 仪表", title: "专业会签:同意", detail: "核对 DCS 高报 85→95℃、联锁 90→100℃ 整定方案;采纳 AI 建议「联锁测试记录投用前完成」为行动项", system: "行动项自动写入 PSSR 清单,会签进度 1/2", time: "08-02 09:15" },
|
||||
{ stage: "会签与审批", actor: "周设备", role: "专业会签 · 设备", title: "专业会签:同意(会签完成 2/2)", detail: "确认保温更换与紧固件方案满足要求", system: "全体会签通过,流转最终批准", time: "08-02 10:40" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "部门负责人", title: "最终批准,变更下达实施", system: "自动生成培训任务与 PSSR 行动项并推送相关人员;状态 → 投用前确认;发布「审批通过」公告", time: "08-02 11:05" },
|
||||
{ stage: "投用前确认", actor: "岗位人员(4 人)+ 维修班(2 人)", title: "培训签到与考核", detail: "扫码签到 + 现场提问考核合格;维修班拍照上传纸质签到表", system: "签到与考核记录自动归档至变更档案", time: "08-03 15:00" },
|
||||
{ stage: "投用前确认", actor: "周设备 / 王仪表", title: "PSSR 逐项确认", detail: "联锁校核记录上传、送电前容量校核、保温验收;移动端现场拍照上传", system: "全部完成,自动推送属地负责人「具备投用条件」", time: "08-04 10:30" },
|
||||
{ stage: "投用", actor: "李主任", role: "属地负责人", title: "确认投用", detail: "投用时间默认当前日期时间,手动确认为 08-05 08:30", system: "状态 → 实施中;发布「确定投用」公告", time: "08-05 08:30" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "投用后验收评估", detail: "72h 运行验证 + 连续 3 批化验:转化率 98.6%(完全达到)、保温 4h(完全达到)、杂质 0.11%(完全达到)、温控联锁动作正确(完全达到)", system: "验收结论留痕:完全达到", time: "08-08 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "变更关闭确认", detail: "8 项资料全部归档、行动项全部关闭,系统推送专人;关闭确认表 AI 辅助判定逐项核对", system: "记录关闭时间,台账 → 已关闭;发布「变更关闭」公告", time: "08-09 09:20" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s2", no: "示例 2", title: "永久 · 重要变更 全流程",
|
||||
changeName: "MOC-2026-R01-0035「R-201 反应釜搅拌器电机更换(55kW→75kW 防爆电机)」",
|
||||
tags: [{ text: "永久", cls: T.perm }, { text: "重要", cls: T.major }],
|
||||
desc: "重要变更差异:等级评分 ≥20 分,审批流增加安全审查与公司领导终批,PSSR 需安全部门审核,投用由公司领导确认。",
|
||||
stages: STAGE_MAIN,
|
||||
steps: [
|
||||
{ stage: "变更申请", actor: "张工艺", role: "车间工程师", title: "AI 变更识别:判定为变更(排除同类替换)", detail: "功率 55→75kW、防爆等级 ExdⅡBT4→ExdⅡCT4、额定电流 102A→138A,超出同类替换范围;输出前后对比与所需材料清单", system: "AI 类型预判:设备类", time: "07-28 09:12" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成变更申请表", detail: "类型:设备;等级评分 21 分 → 重要变更;时限:永久;上传变更方案、设备数据表、防爆合格证、电气负荷校核计算书", system: "编号 MOC-2026-R01-0035;按「重要变更」自动匹配审批流:部门审核 → 专业会签 → 安全审查 → 公司领导终批", time: "07-28 09:45" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "风险分析:HAZOP + JSA + 检查表法", detail: "风险辨识会议(张工艺、王仪表、周设备、王海燕、李主任);4 项安全措施:联锁校核、送电前容量校核、培训考核、P&ID 与台账更新", system: "风险分析记录表随申请单一并提交", time: "07-29 13:32" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "车间主任", title: "部门审核:同意", detail: "经综合评审,变更方案与风险管控措施可行", system: "审批留痕,流转专业会签", time: "07-29 08:31" },
|
||||
{ stage: "会签与审批", actor: "王仪表 / 周设备 / 工艺专业", title: "专业会签:3/3 全部同意", detail: "王仪表核对联锁设定;周设备确认安装与校核方案;工艺专业确认运行窗口无变化", system: "会签全体通过,流转安全审查", time: "07-30 09:00" },
|
||||
{ stage: "会签与审批", actor: "安全部", role: "安全审查", title: "安全审查:同意", detail: "强制合规项确认:联锁测试记录投用前完成并归档;防爆接合面检查纳入 PSSR", system: "审查留痕,流转公司领导终批", time: "07-30 15:20" },
|
||||
{ stage: "会签与审批", actor: "刘副总", role: "公司领导", title: "最终批准", system: "变更下达实施;发布「审批通过」公告;培训与 PSSR 任务自动推送", time: "07-31 10:00" },
|
||||
{ stage: "投用前确认", actor: "岗位人员", title: "培训签到与考核合格", system: "培训记录自动归档", time: "08-01 14:00" },
|
||||
{ stage: "投用前确认", actor: "安全部", title: "PSSR 清单审核通过(重要变更)", detail: "审核现场检查项目与保护措施确认项", time: "08-02 09:00" },
|
||||
{ stage: "投用前确认", actor: "周设备 / 王仪表", title: "现场 PSSR 逐项确认", detail: "联锁跳车试验记录、防爆接合面与格兰头检查、送电前校核;移动端拍照上传", system: "全部完成,推送属地负责人与公司领导", time: "08-03 11:00" },
|
||||
{ stage: "投用", actor: "刘副总", role: "公司领导", title: "确认投用(重要变更由公司领导确认)", detail: "属地负责人确认条件具备后,公司领导确认投用 08-05 08:00", system: "状态 → 实施中;发布「确定投用」公告", time: "08-05 08:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "验收评估", detail: "投用首周每班测温与振动记录:无过载跳闸(完全达到)、电流裕量 27%(完全达到)、批次合格率 +1.6%(完全达到)", system: "验收结论留痕", time: "08-12 17:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "关闭确认", detail: "资料归档齐全(含联锁测试记录、PSSR 现场照片、验收报告)", system: "记录关闭时间;发布「变更关闭」公告", time: "08-13 10:00" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s3", no: "示例 3", title: "临时 · 一般变更 全流程(3.1 到期恢复)",
|
||||
changeName: "MOC-2026-R02-0052「夏季工况循环水旁路临时调整」",
|
||||
tags: [{ text: "临时", cls: T.temp }, { text: "一般", cls: T.general }, { text: "3.1 到期恢复", cls: T.branch }],
|
||||
desc: "临时变更差异:强制填写计划恢复时间,到期前 7 天系统提醒;本示例按「3.1 到期恢复原状」走通全流程。",
|
||||
stages: STAGE_TEMP,
|
||||
steps: [
|
||||
{ stage: "变更申请", actor: "张工艺", role: "车间工程师", title: "AI 变更识别", detail: "循环水旁路阀开度由 30% 调整为 60%,应对夏季高温工况;判定为变更", time: "06-10 09:00" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成变更申请表", detail: "类型:工艺;等级评分 10 分 → 一般;时限:临时(计划恢复时间 2026-09-15),非紧急", system: "临时变更强制填写计划恢复时间", time: "06-10 09:30" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "风险分析并提交", detail: "AI 预分析 + 检查表法;验收评价:换热器出口温度 ≤42℃、无超温报警", system: "进入一般变更审批流", time: "06-10 10:00" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "车间主任", title: "部门审核:同意", time: "06-10 14:00" },
|
||||
{ stage: "会签与审批", actor: "王仪表 / 周设备", title: "专业会签:2/2 同意", time: "06-11 09:30" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "部门负责人", title: "最终批准", system: "变更下达;发布「审批通过」公告", time: "06-11 10:20" },
|
||||
{ stage: "投用前确认", actor: "岗位人员", title: "培训签到完成", system: "记录自动归档", time: "06-12 09:00" },
|
||||
{ stage: "投用前确认", actor: "周设备", title: "PSSR 确认完成", detail: "旁路阀行程确认、温度仪表校验", system: "全部完成,推送属地负责人", time: "06-12 15:00" },
|
||||
{ stage: "投用", actor: "李主任", role: "属地负责人", title: "确认投用 06-13 08:00", system: "台账标记「临时变更 · 计划恢复 09-15」;发布「确定投用」公告", time: "06-13 08:00" },
|
||||
{ stage: "临时运行与恢复", actor: "系统", title: "到期前 7 天自动提醒", detail: "向申请人、属地负责人推送「临时变更将于 09-15 到期,请安排恢复原状」(企业微信 + 短信),每日复提", branch: "分支:到期恢复", time: "09-08 09:00" },
|
||||
{ stage: "临时运行与恢复", actor: "张工艺", title: "现场恢复原状", detail: "旁路阀开度恢复至 30%,移动端拍照上传恢复确认", system: "恢复记录归档,推送属地确认", time: "09-10 10:00" },
|
||||
{ stage: "临时运行与恢复", actor: "李主任", role: "属地负责人", title: "属地确认恢复完成", time: "09-10 15:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "验收评估", detail: "临时运行期间换热器出口温度均值 39.8℃(完全达到)、无超温报警(完全达到)", time: "09-12 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "确认关闭(含恢复记录归档)", system: "记录关闭时间;发布「变更关闭」公告", time: "09-13 09:00" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s32", no: "示例 3.2", title: "临时 · 一般变更(延期一次,到期再恢复)",
|
||||
changeName: "MOC-2026-R02-0052「夏季工况循环水旁路临时调整」(延续示例 3)",
|
||||
tags: [{ text: "临时", cls: T.temp }, { text: "一般", cls: T.general }, { text: "3.2 延期后恢复", cls: T.branch }],
|
||||
desc: "从到期提醒开始:延期申请 → 部门审批 → 到期时间更新(已延期 1 次)→ 新到期恢复 → 验收 → 关闭。",
|
||||
stages: ["到期提醒", "延期申请与审批", "恢复", "验收", "关闭"],
|
||||
steps: [
|
||||
{ stage: "到期提醒", actor: "系统", title: "前置流程与示例 3 相同", detail: "申请 → 审批 → 培训 → PSSR → 投用(共 9 步)已于 06-13 完成,变更处于临时运行中", time: "06-13" },
|
||||
{ stage: "到期提醒", actor: "系统", title: "到期前 7 天提醒", detail: "推送「将于 09-15 到期」;因高温天气持续,申请人决定办理延期", time: "09-08 09:00" },
|
||||
{ stage: "延期申请与审批", actor: "张工艺", title: "发起延期申请", detail: "延期事项:计划恢复时间 09-15 → 10-15;理由:高温天气持续,装置仍需旁路运行;系统自动校验剩余延期次数(≤1 次)", branch: "分支:延期一次", time: "09-08 10:00" },
|
||||
{ stage: "延期申请与审批", actor: "李主任", role: "部门负责人", title: "延期审批:同意", detail: "一般临时变更延期由部门负责人批准", system: "留痕并更新到期时间;台账标记「已延期 1 次」", time: "09-09 09:00" },
|
||||
{ stage: "恢复", actor: "系统", title: "新到期日前 7 天再次提醒", time: "10-08 09:00" },
|
||||
{ stage: "恢复", actor: "张工艺", title: "恢复原状 + 拍照上传", detail: "旁路阀开度恢复至 30%,移动端拍照上传", system: "恢复记录归档,推送属地确认", time: "10-10 10:00" },
|
||||
{ stage: "恢复", actor: "李主任", role: "属地负责人", title: "属地确认恢复完成", time: "10-10 15:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "验收评估:延期期间运行数据达标", detail: "出口温度均值 40.2℃(完全达到)、无超温报警(完全达到)", time: "10-12 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "确认关闭", system: "延期与恢复全程留痕可追溯;发布「变更关闭」公告", time: "10-13 09:00" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s33", no: "示例 3.3", title: "临时 · 一般变更(到期转化为永久)",
|
||||
changeName: "MOC-2026-R02-0052「夏季工况循环水旁路临时调整」(延续示例 3)",
|
||||
tags: [{ text: "临时", cls: T.temp }, { text: "一般", cls: T.general }, { text: "3.3 转为永久", cls: T.branch }],
|
||||
desc: "从到期提醒开始:转永久申请 → AI 补充长期风险分析 → 按原等级审批 → 时限改判留痕、取消恢复期限 → 验收 → 关闭。",
|
||||
stages: ["到期提醒", "转永久申请", "补充风险分析", "转永久审批", "验收", "关闭"],
|
||||
steps: [
|
||||
{ stage: "到期提醒", actor: "系统", title: "前置流程与示例 3 相同", detail: "已投用,变更处于临时运行中(计划恢复 09-15)", time: "06-13" },
|
||||
{ stage: "到期提醒", actor: "系统", title: "到期前 7 天提醒", time: "09-08 09:00" },
|
||||
{ stage: "转永久申请", actor: "张工艺", title: "发起「临时转永久」申请", detail: "理由:临时运行 3 个月效果稳定,夏季工况每年重现,建议转为永久;转永久后不再恢复原状", branch: "分支:转为永久", time: "09-08 10:30" },
|
||||
{ stage: "补充风险分析", actor: "张工艺", title: "AI 重新分析长期运行风险", detail: "补充长期运行场景:旁路长期 60% 开度对换热器结垢的影响、冬季低负荷工况影响;更新管控措施", system: "风险分析记录版本 V2 留痕", time: "09-09 09:00" },
|
||||
{ stage: "转永久审批", actor: "李主任", role: "车间主任", title: "部门审核:同意", time: "09-09 14:00" },
|
||||
{ stage: "转永久审批", actor: "王仪表 / 周设备", title: "专业会签:同意", time: "09-10 09:00" },
|
||||
{ stage: "转永久审批", actor: "李主任", role: "部门负责人", title: "批准转为永久变更", system: "变更时限「临时 → 永久」改判留痕;取消恢复期限与到期提醒", time: "09-10 10:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "按永久变更标准验收", detail: "连续 30 天运行数据评估:温度、能耗指标全部达标(完全达到)", time: "10-10 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "确认关闭", system: "转永久审批记录并入变更档案;发布「变更关闭」公告", time: "10-12 09:00" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s4", no: "示例 4", title: "临时 · 重要变更 全流程",
|
||||
changeName: "MOC-2026-R01-0039「V-102 安全阀起跳压力临时调整」",
|
||||
tags: [{ text: "临时", cls: T.temp }, { text: "重要", cls: T.major }, { text: "紧急", cls: T.urgent }],
|
||||
desc: "重要 + 临时 + 紧急:紧急标记各节点加急提醒当日办结,安全审查强制合规项,到期恢复起跳压力并重新校验。",
|
||||
stages: STAGE_TEMP,
|
||||
steps: [
|
||||
{ stage: "变更申请", actor: "张工艺", role: "车间工程师", title: "AI 变更识别", detail: "V-102 安全阀起跳压力由 1.6MPa 临时调整为 1.45MPa(上游管网改造期间)", system: "紧急标记:安全生产需要,各节点加急提醒", time: "07-16 08:00" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成变更申请表", detail: "类型:设备;等级评分 22 分 → 重要;时限:临时(计划恢复 08-30);紧急标记", system: "按「重要 + 紧急」匹配审批流并加急推送", time: "07-16 08:20" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "风险分析:JSA + 检查表法 + AI 预分析", detail: "起跳压力下调后泄放能力复核、工艺波动场景评估", time: "07-16 09:00" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "车间主任", title: "部门审核:同意(加急)", time: "07-16 10:00" },
|
||||
{ stage: "会签与审批", actor: "王仪表 / 周设备 / 安全员", title: "专业会签:3/3 同意", detail: "安全阀校验报告复核、泄放量核算", time: "07-16 11:30" },
|
||||
{ stage: "会签与审批", actor: "安全部", role: "安全审查", title: "安全审查:同意", detail: "强制合规:调整期间每班巡查记录、恢复后重新校验", time: "07-16 14:00" },
|
||||
{ stage: "会签与审批", actor: "刘副总", role: "公司领导", title: "最终批准(加急)", system: "当日完成全部审批;发布「审批通过」公告", time: "07-16 15:30" },
|
||||
{ stage: "投用前确认", actor: "岗位人员", title: "培训签到(新起跳压力与应急处置)", system: "记录自动归档", time: "07-17 09:00" },
|
||||
{ stage: "投用前确认", actor: "安全部 / 周设备", title: "PSSR 确认", detail: "安全阀重新铅封、校验标签更新、巡查记录表就位", system: "全部完成,推送属地负责人与公司领导", time: "07-17 14:00" },
|
||||
{ stage: "投用", actor: "刘副总", role: "公司领导", title: "确认投用(重要变更)", system: "状态 → 实施中;发布「确定投用」公告", time: "07-18 08:00" },
|
||||
{ stage: "临时运行与恢复", actor: "系统", title: "到期前 7 天提醒(临时变更 08-30 到期)", branch: "分支:到期恢复", time: "08-23 09:00" },
|
||||
{ stage: "临时运行与恢复", actor: "张工艺 / 周设备", title: "恢复起跳压力至 1.6MPa", detail: "安全阀重新校验、铅封,校验报告与现场照片上传", system: "恢复记录归档,推送属地确认", time: "08-25 10:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业 + 安全部", title: "验收评估", detail: "调整期间无超压、无泄放事件;恢复后校验合格(完全达到)", time: "08-27 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "确认关闭", system: "记录关闭时间;发布「变更关闭」公告", time: "08-28 09:00" },
|
||||
],
|
||||
},
|
||||
];
|
||||
function open(item:any) {
|
||||
routerPushByKey('home_processdetail', { query: { params: JSON.stringify(item) } })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 流程演示 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center gap-3 mb-3.5">
|
||||
<span class="flex items-center gap-1.5 text-base font-bold text-slate-800">
|
||||
<Icon icon="fluent:flow-dot-24-filled" class="size-22px" :style="{ color: themeStore.themeColor }" />全流程走通演示
|
||||
</span>
|
||||
<span class="text-xs text-slate-400">
|
||||
6 个完整示例:永久 / 临时 × 一般 / 重要,含临时到期恢复、延期、转永久分支;逐步推进查看每个环节的操作人与系统行为
|
||||
</span>
|
||||
</div>
|
||||
<div class="space-y-2 scroll">
|
||||
<div class="grid gap-3 grid-cols-2">
|
||||
<div
|
||||
v-for="s in SCENARIOS" :key="s.id"
|
||||
class="flex flex-col border bg-white p-4 transition hover:border-[var(--hover-border-color)] hover:shadow-sm"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
'--hover-border-color': themeStore.themeColor,
|
||||
}"
|
||||
>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="text-sm font-bold" :style="{ color: themeStore.themeColor }">{{ s.no }}</span>
|
||||
<span class="text-sm font-semibold text-slate-800">{{ s.title }}</span>
|
||||
<NTag v-for="t in s.tags" :key="t.text" :class="t.cls" size="small">{{ t.text }}</NTag>
|
||||
</div>
|
||||
<div class="mt-1.5 text-xs text-slate-500">示例变更:{{ s.changeName }}</div>
|
||||
<p class="mt-2 flex-1 text-xs leading-relaxed text-slate-400">{{ s.desc }}</p>
|
||||
<div class="mt-3 flex items-center justify-between">
|
||||
<span class="text-[11px] text-slate-400">{{ s.stages.length }} 个阶段 · {{ s.steps.length }} 个步骤</span>
|
||||
<NButton type="primary" size="small" class="text-xs" @click="open(s)">
|
||||
<Icon icon="griddy-icons:play" class="size-16px" /> 开始演示
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 185px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
interface FlowStep {
|
||||
stage: string;
|
||||
actor: string;
|
||||
role?: string;
|
||||
title: string;
|
||||
detail?: string;
|
||||
system?: string;
|
||||
time: string;
|
||||
branch?: string;
|
||||
}
|
||||
interface Scenario {
|
||||
id: string; no: string; title: string; changeName: string;
|
||||
tags: { text: string; cls: string }[];
|
||||
desc: string; stages: string[]; steps: FlowStep[];
|
||||
}
|
||||
const T = {
|
||||
perm: "border-[#ACC6E5] bg-[#DFE9F6] text-[#1D4E9C]",
|
||||
temp: "border-amber-200 bg-amber-50 text-amber-700",
|
||||
general: "bg-slate-100 text-slate-600",
|
||||
major: "border-red-200 bg-red-50 text-red-600",
|
||||
urgent: "border-red-600 bg-red-600 text-white",
|
||||
branch: "border-violet-200 bg-violet-50 text-violet-600",
|
||||
};
|
||||
const STAGE_MAIN = ["变更申请", "会签与审批", "投用前确认", "投用", "验收", "关闭"];
|
||||
const STAGE_TEMP = ["变更申请", "会签与审批", "投用前确认", "投用", "临时运行与恢复", "验收", "关闭"];
|
||||
const SCENARIOS: Scenario[] = [
|
||||
{
|
||||
id: "s1", no: "示例 1", title: "永久 · 一般变更 全流程",
|
||||
changeName: "MOC-2026-R01-0041「缩合反应温度及时间优化」",
|
||||
tags: [{ text: "永久", cls: T.perm }, { text: "一般", cls: T.general }],
|
||||
desc: "覆盖:AI 识别 → 申请表 → 风险分析 → 培训/PSSR/验收/关闭表生成 → 部门审核 → 专业会签 → 最终批准 → 培训签到 → PSSR → 确认投用 → 验收 → 关闭归档。",
|
||||
stages: STAGE_MAIN,
|
||||
steps: [
|
||||
{ stage: "变更申请", actor: "张工艺", role: "车间工程师", title: "录入变更描述,AI 完成变更识别", detail: "判定为「变更」(非同类替换):反应温度 80℃→90℃、保温 8h→4h、DCS 报警/联锁值上调等 4 项前后对比,输出所需材料清单;识别结果人工确认,可直接修改", system: "AI 识别完成,自动预填变更前后对比表", time: "08-01 09:12" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成变更申请表", detail: "AI 自动总结名称「缩合反应温度及时间优化」(28 字内);类型判定:工艺;等级评分 12 分 → 一般变更;时限:永久;上传小试报告、杂质分析等附件", system: "附件版本受控,变更编号 MOC-2026-R01-0041 生成", time: "08-01 09:40" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "AI 风险预分析,形成风险分析记录表", detail: "输出危害严重性 / 事件概率 / 保护层影响预分析;系统按规则推荐 HAZOP + 检查表法(支持手动重选),形成风险分析记录与管控措施", system: "预分析报告经人工确认后生效", time: "08-01 10:05" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成培训 / PSSR / 验收评价 / 关闭确认表,提交审批", detail: "验收评价按预期效果量化:转化率 ≥98%、保温 4h±0.5h、杂质 ≤0.15% 等 5 项;选择审批人后提交", system: "进入一般变更审批流,企业微信 + 短信通知李主任", time: "08-01 10:20" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "车间主任", title: "部门审核:同意", detail: "AI 审批辅助:强制合规提示(联锁测试投用前完成)、冲突提示(无冲突)、关键参数对比;意见:变更方案可行,同意", system: "审批留痕,流转专业会签", time: "08-01 14:32" },
|
||||
{ stage: "会签与审批", actor: "王仪表", role: "专业会签 · 仪表", title: "专业会签:同意", detail: "核对 DCS 高报 85→95℃、联锁 90→100℃ 整定方案;采纳 AI 建议「联锁测试记录投用前完成」为行动项", system: "行动项自动写入 PSSR 清单,会签进度 1/2", time: "08-02 09:15" },
|
||||
{ stage: "会签与审批", actor: "周设备", role: "专业会签 · 设备", title: "专业会签:同意(会签完成 2/2)", detail: "确认保温更换与紧固件方案满足要求", system: "全体会签通过,流转最终批准", time: "08-02 10:40" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "部门负责人", title: "最终批准,变更下达实施", system: "自动生成培训任务与 PSSR 行动项并推送相关人员;状态 → 投用前确认;发布「审批通过」公告", time: "08-02 11:05" },
|
||||
{ stage: "投用前确认", actor: "岗位人员(4 人)+ 维修班(2 人)", title: "培训签到与考核", detail: "扫码签到 + 现场提问考核合格;维修班拍照上传纸质签到表", system: "签到与考核记录自动归档至变更档案", time: "08-03 15:00" },
|
||||
{ stage: "投用前确认", actor: "周设备 / 王仪表", title: "PSSR 逐项确认", detail: "联锁校核记录上传、送电前容量校核、保温验收;移动端现场拍照上传", system: "全部完成,自动推送属地负责人「具备投用条件」", time: "08-04 10:30" },
|
||||
{ stage: "投用", actor: "李主任", role: "属地负责人", title: "确认投用", detail: "投用时间默认当前日期时间,手动确认为 08-05 08:30", system: "状态 → 实施中;发布「确定投用」公告", time: "08-05 08:30" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "投用后验收评估", detail: "72h 运行验证 + 连续 3 批化验:转化率 98.6%(完全达到)、保温 4h(完全达到)、杂质 0.11%(完全达到)、温控联锁动作正确(完全达到)", system: "验收结论留痕:完全达到", time: "08-08 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "变更关闭确认", detail: "8 项资料全部归档、行动项全部关闭,系统推送专人;关闭确认表 AI 辅助判定逐项核对", system: "记录关闭时间,台账 → 已关闭;发布「变更关闭」公告", time: "08-09 09:20" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s2", no: "示例 2", title: "永久 · 重要变更 全流程",
|
||||
changeName: "MOC-2026-R01-0035「R-201 反应釜搅拌器电机更换(55kW→75kW 防爆电机)」",
|
||||
tags: [{ text: "永久", cls: T.perm }, { text: "重要", cls: T.major }],
|
||||
desc: "重要变更差异:等级评分 ≥20 分,审批流增加安全审查与公司领导终批,PSSR 需安全部门审核,投用由公司领导确认。",
|
||||
stages: STAGE_MAIN,
|
||||
steps: [
|
||||
{ stage: "变更申请", actor: "张工艺", role: "车间工程师", title: "AI 变更识别:判定为变更(排除同类替换)", detail: "功率 55→75kW、防爆等级 ExdⅡBT4→ExdⅡCT4、额定电流 102A→138A,超出同类替换范围;输出前后对比与所需材料清单", system: "AI 类型预判:设备类", time: "07-28 09:12" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成变更申请表", detail: "类型:设备;等级评分 21 分 → 重要变更;时限:永久;上传变更方案、设备数据表、防爆合格证、电气负荷校核计算书", system: "编号 MOC-2026-R01-0035;按「重要变更」自动匹配审批流:部门审核 → 专业会签 → 安全审查 → 公司领导终批", time: "07-28 09:45" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "风险分析:HAZOP + JSA + 检查表法", detail: "风险辨识会议(张工艺、王仪表、周设备、王海燕、李主任);4 项安全措施:联锁校核、送电前容量校核、培训考核、P&ID 与台账更新", system: "风险分析记录表随申请单一并提交", time: "07-29 13:32" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "车间主任", title: "部门审核:同意", detail: "经综合评审,变更方案与风险管控措施可行", system: "审批留痕,流转专业会签", time: "07-29 08:31" },
|
||||
{ stage: "会签与审批", actor: "王仪表 / 周设备 / 工艺专业", title: "专业会签:3/3 全部同意", detail: "王仪表核对联锁设定;周设备确认安装与校核方案;工艺专业确认运行窗口无变化", system: "会签全体通过,流转安全审查", time: "07-30 09:00" },
|
||||
{ stage: "会签与审批", actor: "安全部", role: "安全审查", title: "安全审查:同意", detail: "强制合规项确认:联锁测试记录投用前完成并归档;防爆接合面检查纳入 PSSR", system: "审查留痕,流转公司领导终批", time: "07-30 15:20" },
|
||||
{ stage: "会签与审批", actor: "刘副总", role: "公司领导", title: "最终批准", system: "变更下达实施;发布「审批通过」公告;培训与 PSSR 任务自动推送", time: "07-31 10:00" },
|
||||
{ stage: "投用前确认", actor: "岗位人员", title: "培训签到与考核合格", system: "培训记录自动归档", time: "08-01 14:00" },
|
||||
{ stage: "投用前确认", actor: "安全部", title: "PSSR 清单审核通过(重要变更)", detail: "审核现场检查项目与保护措施确认项", time: "08-02 09:00" },
|
||||
{ stage: "投用前确认", actor: "周设备 / 王仪表", title: "现场 PSSR 逐项确认", detail: "联锁跳车试验记录、防爆接合面与格兰头检查、送电前校核;移动端拍照上传", system: "全部完成,推送属地负责人与公司领导", time: "08-03 11:00" },
|
||||
{ stage: "投用", actor: "刘副总", role: "公司领导", title: "确认投用(重要变更由公司领导确认)", detail: "属地负责人确认条件具备后,公司领导确认投用 08-05 08:00", system: "状态 → 实施中;发布「确定投用」公告", time: "08-05 08:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "验收评估", detail: "投用首周每班测温与振动记录:无过载跳闸(完全达到)、电流裕量 27%(完全达到)、批次合格率 +1.6%(完全达到)", system: "验收结论留痕", time: "08-12 17:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "关闭确认", detail: "资料归档齐全(含联锁测试记录、PSSR 现场照片、验收报告)", system: "记录关闭时间;发布「变更关闭」公告", time: "08-13 10:00" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s3", no: "示例 3", title: "临时 · 一般变更 全流程(3.1 到期恢复)",
|
||||
changeName: "MOC-2026-R02-0052「夏季工况循环水旁路临时调整」",
|
||||
tags: [{ text: "临时", cls: T.temp }, { text: "一般", cls: T.general }, { text: "3.1 到期恢复", cls: T.branch }],
|
||||
desc: "临时变更差异:强制填写计划恢复时间,到期前 7 天系统提醒;本示例按「3.1 到期恢复原状」走通全流程。",
|
||||
stages: STAGE_TEMP,
|
||||
steps: [
|
||||
{ stage: "变更申请", actor: "张工艺", role: "车间工程师", title: "AI 变更识别", detail: "循环水旁路阀开度由 30% 调整为 60%,应对夏季高温工况;判定为变更", time: "06-10 09:00" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成变更申请表", detail: "类型:工艺;等级评分 10 分 → 一般;时限:临时(计划恢复时间 2026-09-15),非紧急", system: "临时变更强制填写计划恢复时间", time: "06-10 09:30" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "风险分析并提交", detail: "AI 预分析 + 检查表法;验收评价:换热器出口温度 ≤42℃、无超温报警", system: "进入一般变更审批流", time: "06-10 10:00" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "车间主任", title: "部门审核:同意", time: "06-10 14:00" },
|
||||
{ stage: "会签与审批", actor: "王仪表 / 周设备", title: "专业会签:2/2 同意", time: "06-11 09:30" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "部门负责人", title: "最终批准", system: "变更下达;发布「审批通过」公告", time: "06-11 10:20" },
|
||||
{ stage: "投用前确认", actor: "岗位人员", title: "培训签到完成", system: "记录自动归档", time: "06-12 09:00" },
|
||||
{ stage: "投用前确认", actor: "周设备", title: "PSSR 确认完成", detail: "旁路阀行程确认、温度仪表校验", system: "全部完成,推送属地负责人", time: "06-12 15:00" },
|
||||
{ stage: "投用", actor: "李主任", role: "属地负责人", title: "确认投用 06-13 08:00", system: "台账标记「临时变更 · 计划恢复 09-15」;发布「确定投用」公告", time: "06-13 08:00" },
|
||||
{ stage: "临时运行与恢复", actor: "系统", title: "到期前 7 天自动提醒", detail: "向申请人、属地负责人推送「临时变更将于 09-15 到期,请安排恢复原状」(企业微信 + 短信),每日复提", branch: "分支:到期恢复", time: "09-08 09:00" },
|
||||
{ stage: "临时运行与恢复", actor: "张工艺", title: "现场恢复原状", detail: "旁路阀开度恢复至 30%,移动端拍照上传恢复确认", system: "恢复记录归档,推送属地确认", time: "09-10 10:00" },
|
||||
{ stage: "临时运行与恢复", actor: "李主任", role: "属地负责人", title: "属地确认恢复完成", time: "09-10 15:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "验收评估", detail: "临时运行期间换热器出口温度均值 39.8℃(完全达到)、无超温报警(完全达到)", time: "09-12 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "确认关闭(含恢复记录归档)", system: "记录关闭时间;发布「变更关闭」公告", time: "09-13 09:00" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s32", no: "示例 3.2", title: "临时 · 一般变更(延期一次,到期再恢复)",
|
||||
changeName: "MOC-2026-R02-0052「夏季工况循环水旁路临时调整」(延续示例 3)",
|
||||
tags: [{ text: "临时", cls: T.temp }, { text: "一般", cls: T.general }, { text: "3.2 延期后恢复", cls: T.branch }],
|
||||
desc: "从到期提醒开始:延期申请 → 部门审批 → 到期时间更新(已延期 1 次)→ 新到期恢复 → 验收 → 关闭。",
|
||||
stages: ["到期提醒", "延期申请与审批", "恢复", "验收", "关闭"],
|
||||
steps: [
|
||||
{ stage: "到期提醒", actor: "系统", title: "前置流程与示例 3 相同", detail: "申请 → 审批 → 培训 → PSSR → 投用(共 9 步)已于 06-13 完成,变更处于临时运行中", time: "06-13" },
|
||||
{ stage: "到期提醒", actor: "系统", title: "到期前 7 天提醒", detail: "推送「将于 09-15 到期」;因高温天气持续,申请人决定办理延期", time: "09-08 09:00" },
|
||||
{ stage: "延期申请与审批", actor: "张工艺", title: "发起延期申请", detail: "延期事项:计划恢复时间 09-15 → 10-15;理由:高温天气持续,装置仍需旁路运行;系统自动校验剩余延期次数(≤1 次)", branch: "分支:延期一次", time: "09-08 10:00" },
|
||||
{ stage: "延期申请与审批", actor: "李主任", role: "部门负责人", title: "延期审批:同意", detail: "一般临时变更延期由部门负责人批准", system: "留痕并更新到期时间;台账标记「已延期 1 次」", time: "09-09 09:00" },
|
||||
{ stage: "恢复", actor: "系统", title: "新到期日前 7 天再次提醒", time: "10-08 09:00" },
|
||||
{ stage: "恢复", actor: "张工艺", title: "恢复原状 + 拍照上传", detail: "旁路阀开度恢复至 30%,移动端拍照上传", system: "恢复记录归档,推送属地确认", time: "10-10 10:00" },
|
||||
{ stage: "恢复", actor: "李主任", role: "属地负责人", title: "属地确认恢复完成", time: "10-10 15:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "验收评估:延期期间运行数据达标", detail: "出口温度均值 40.2℃(完全达到)、无超温报警(完全达到)", time: "10-12 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "确认关闭", system: "延期与恢复全程留痕可追溯;发布「变更关闭」公告", time: "10-13 09:00" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s33", no: "示例 3.3", title: "临时 · 一般变更(到期转化为永久)",
|
||||
changeName: "MOC-2026-R02-0052「夏季工况循环水旁路临时调整」(延续示例 3)",
|
||||
tags: [{ text: "临时", cls: T.temp }, { text: "一般", cls: T.general }, { text: "3.3 转为永久", cls: T.branch }],
|
||||
desc: "从到期提醒开始:转永久申请 → AI 补充长期风险分析 → 按原等级审批 → 时限改判留痕、取消恢复期限 → 验收 → 关闭。",
|
||||
stages: ["到期提醒", "转永久申请", "补充风险分析", "转永久审批", "验收", "关闭"],
|
||||
steps: [
|
||||
{ stage: "到期提醒", actor: "系统", title: "前置流程与示例 3 相同", detail: "已投用,变更处于临时运行中(计划恢复 09-15)", time: "06-13" },
|
||||
{ stage: "到期提醒", actor: "系统", title: "到期前 7 天提醒", time: "09-08 09:00" },
|
||||
{ stage: "转永久申请", actor: "张工艺", title: "发起「临时转永久」申请", detail: "理由:临时运行 3 个月效果稳定,夏季工况每年重现,建议转为永久;转永久后不再恢复原状", branch: "分支:转为永久", time: "09-08 10:30" },
|
||||
{ stage: "补充风险分析", actor: "张工艺", title: "AI 重新分析长期运行风险", detail: "补充长期运行场景:旁路长期 60% 开度对换热器结垢的影响、冬季低负荷工况影响;更新管控措施", system: "风险分析记录版本 V2 留痕", time: "09-09 09:00" },
|
||||
{ stage: "转永久审批", actor: "李主任", role: "车间主任", title: "部门审核:同意", time: "09-09 14:00" },
|
||||
{ stage: "转永久审批", actor: "王仪表 / 周设备", title: "专业会签:同意", time: "09-10 09:00" },
|
||||
{ stage: "转永久审批", actor: "李主任", role: "部门负责人", title: "批准转为永久变更", system: "变更时限「临时 → 永久」改判留痕;取消恢复期限与到期提醒", time: "09-10 10:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业", title: "按永久变更标准验收", detail: "连续 30 天运行数据评估:温度、能耗指标全部达标(完全达到)", time: "10-10 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "确认关闭", system: "转永久审批记录并入变更档案;发布「变更关闭」公告", time: "10-12 09:00" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "s4", no: "示例 4", title: "临时 · 重要变更 全流程",
|
||||
changeName: "MOC-2026-R01-0039「V-102 安全阀起跳压力临时调整」",
|
||||
tags: [{ text: "临时", cls: T.temp }, { text: "重要", cls: T.major }, { text: "紧急", cls: T.urgent }],
|
||||
desc: "重要 + 临时 + 紧急:紧急标记各节点加急提醒当日办结,安全审查强制合规项,到期恢复起跳压力并重新校验。",
|
||||
stages: STAGE_TEMP,
|
||||
steps: [
|
||||
{ stage: "变更申请", actor: "张工艺", role: "车间工程师", title: "AI 变更识别", detail: "V-102 安全阀起跳压力由 1.6MPa 临时调整为 1.45MPa(上游管网改造期间)", system: "紧急标记:安全生产需要,各节点加急提醒", time: "07-16 08:00" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "生成变更申请表", detail: "类型:设备;等级评分 22 分 → 重要;时限:临时(计划恢复 08-30);紧急标记", system: "按「重要 + 紧急」匹配审批流并加急推送", time: "07-16 08:20" },
|
||||
{ stage: "变更申请", actor: "张工艺", title: "风险分析:JSA + 检查表法 + AI 预分析", detail: "起跳压力下调后泄放能力复核、工艺波动场景评估", time: "07-16 09:00" },
|
||||
{ stage: "会签与审批", actor: "李主任", role: "车间主任", title: "部门审核:同意(加急)", time: "07-16 10:00" },
|
||||
{ stage: "会签与审批", actor: "王仪表 / 周设备 / 安全员", title: "专业会签:3/3 同意", detail: "安全阀校验报告复核、泄放量核算", time: "07-16 11:30" },
|
||||
{ stage: "会签与审批", actor: "安全部", role: "安全审查", title: "安全审查:同意", detail: "强制合规:调整期间每班巡查记录、恢复后重新校验", time: "07-16 14:00" },
|
||||
{ stage: "会签与审批", actor: "刘副总", role: "公司领导", title: "最终批准(加急)", system: "当日完成全部审批;发布「审批通过」公告", time: "07-16 15:30" },
|
||||
{ stage: "投用前确认", actor: "岗位人员", title: "培训签到(新起跳压力与应急处置)", system: "记录自动归档", time: "07-17 09:00" },
|
||||
{ stage: "投用前确认", actor: "安全部 / 周设备", title: "PSSR 确认", detail: "安全阀重新铅封、校验标签更新、巡查记录表就位", system: "全部完成,推送属地负责人与公司领导", time: "07-17 14:00" },
|
||||
{ stage: "投用", actor: "刘副总", role: "公司领导", title: "确认投用(重要变更)", system: "状态 → 实施中;发布「确定投用」公告", time: "07-18 08:00" },
|
||||
{ stage: "临时运行与恢复", actor: "系统", title: "到期前 7 天提醒(临时变更 08-30 到期)", branch: "分支:到期恢复", time: "08-23 09:00" },
|
||||
{ stage: "临时运行与恢复", actor: "张工艺 / 周设备", title: "恢复起跳压力至 1.6MPa", detail: "安全阀重新校验、铅封,校验报告与现场照片上传", system: "恢复记录归档,推送属地确认", time: "08-25 10:00" },
|
||||
{ stage: "验收", actor: "车间 + 各专业 + 安全部", title: "验收评估", detail: "调整期间无超压、无泄放事件;恢复后校验合格(完全达到)", time: "08-27 16:00" },
|
||||
{ stage: "关闭", actor: "变更主管部门专人", title: "确认关闭", system: "记录关闭时间;发布「变更关闭」公告", time: "08-28 09:00" },
|
||||
],
|
||||
},
|
||||
];
|
||||
function open(item:any) {
|
||||
routerPushByKey('home_processdetail', { query: { params: JSON.stringify(item) } })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 流程演示 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center gap-3 mb-3.5">
|
||||
<span class="flex items-center gap-1.5 text-base font-bold text-slate-800">
|
||||
<Icon icon="fluent:flow-dot-24-filled" class="size-22px" :style="{ color: themeStore.themeColor }" />全流程走通演示
|
||||
</span>
|
||||
<span class="text-xs text-slate-400">
|
||||
6 个完整示例:永久 / 临时 × 一般 / 重要,含临时到期恢复、延期、转永久分支;逐步推进查看每个环节的操作人与系统行为
|
||||
</span>
|
||||
</div>
|
||||
<div class="space-y-2 scroll">
|
||||
<div class="grid gap-3 grid-cols-2">
|
||||
<div
|
||||
v-for="s in SCENARIOS" :key="s.id"
|
||||
class="flex flex-col border bg-white p-4 transition hover:border-[var(--hover-border-color)] hover:shadow-sm"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
'--hover-border-color': themeStore.themeColor,
|
||||
}"
|
||||
>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="text-sm font-bold" :style="{ color: themeStore.themeColor }">{{ s.no }}</span>
|
||||
<span class="text-sm font-semibold text-slate-800">{{ s.title }}</span>
|
||||
<NTag v-for="t in s.tags" :key="t.text" :class="t.cls" size="small">{{ t.text }}</NTag>
|
||||
</div>
|
||||
<div class="mt-1.5 text-xs text-slate-500">示例变更:{{ s.changeName }}</div>
|
||||
<p class="mt-2 flex-1 text-xs leading-relaxed text-slate-400">{{ s.desc }}</p>
|
||||
<div class="mt-3 flex items-center justify-between">
|
||||
<span class="text-[11px] text-slate-400">{{ s.stages.length }} 个阶段 · {{ s.steps.length }} 个步骤</span>
|
||||
<NButton type="primary" size="small" class="text-xs" @click="open(s)">
|
||||
<Icon icon="griddy-icons:play" class="size-16px" /> 开始演示
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 185px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,184 +1,184 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, computed, watch } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const route = useRoute();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
const sc = ref<any>(null);
|
||||
const cur = ref<number>(0);
|
||||
const playing = ref(false);
|
||||
const curStageIdx = computed(() => (sc.value ? sc.value.stages.indexOf(sc.value.steps[cur.value].stage) : 0));
|
||||
const finished = computed(() => (sc.value ? cur.value >= sc.value?.steps?.length - 1 : false));
|
||||
const ROLES_NAME: Record<string, string> = {
|
||||
applicant: "申请人(张工艺)", process: "专业会签(王仪表)", process2: "专业会签(周设备)",
|
||||
safety: "安全工程师(王海燕)", dept: "车间主任(李主任)", vp: "分管领导(刘副总)", admin: "系统管理员",
|
||||
quality: "质量工程师(陈质量)", viewer: "非审批人员(吴新)",
|
||||
};
|
||||
const VIEW_NAME: Record<string, string> = {
|
||||
apply: "变更申请", tasks: "我的任务", approvals: "审批中心", execution: "PSSR / 验收", closure: "关闭管理",
|
||||
};
|
||||
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
watch([playing, cur, sc], ([p, c, s]) => {
|
||||
if (timer) { clearTimeout(timer); timer = undefined; }
|
||||
if (!p || !s) return;
|
||||
if (c >= s.steps.length - 1) { playing.value = false; return; }
|
||||
timer = setTimeout(() => { cur.value = Math.min(cur.value + 1, (sc.value?.steps.length ?? 1) - 1); }, 2000);
|
||||
});
|
||||
|
||||
function jumpFor(s: any): { role: string; view: string } | null {
|
||||
const a = s.actor;
|
||||
if (a === "系统") return null;
|
||||
let role: string;
|
||||
if (a.includes("张工艺")) role = "applicant";
|
||||
else if (a.includes("李主任")) role = "dept";
|
||||
else if (a.includes("王仪表")) role = "process";
|
||||
else if (a.includes("周设备")) role = "process2";
|
||||
else if (a.includes("刘副总")) role = "vp";
|
||||
else if (a.includes("专人") || a.includes("安全")) role = "safety";
|
||||
else if (a.includes("岗位") || a.includes("维修班")) role = "applicant";
|
||||
else if (a.includes("车间")) role = "dept";
|
||||
else return null;
|
||||
let view: string;
|
||||
if (role === "applicant") view = s.stage === "变更申请" ? "apply" : "tasks";
|
||||
else if (s.stage.includes("审批")) view = "approvals";
|
||||
else if (s.stage === "关闭") view = "closure";
|
||||
else view = "execution";
|
||||
return { role, view };
|
||||
}
|
||||
function prev() { playing.value = false; cur.value = Math.max(0, cur.value - 1); }
|
||||
function next() { playing.value = false; if (sc.value) cur.value = Math.min(sc.value.steps.length - 1, cur.value + 1); }
|
||||
function reset() { playing.value = false; cur.value = 0; }
|
||||
function back() {
|
||||
routerPushByKey("home_process");
|
||||
}
|
||||
function jumpTo() {
|
||||
routerPushByKey("home_initiatechange");
|
||||
}
|
||||
onMounted(() => {
|
||||
if(route.query && route.query.params){
|
||||
sc.value = JSON.parse(route.query.params as string);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 流程演示详情 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="space-y-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<NButton ghost type="primary" class="text-sm font-medium" @click="back">
|
||||
<Icon icon="ep:back" class="size-16px mr-1" /> 返回示例列表
|
||||
</NButton>
|
||||
<span class="text-base font-bold text-slate-800">{{ sc?.no }} {{ sc?.title }}</span>
|
||||
<NTag size="small" v-for="t in sc?.tags" :key="t.text" :class="t.cls">{{ t.text }}</NTag>
|
||||
<span class="text-xs text-slate-400">示例变更:{{ sc?.changeName }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 阶段进度条 -->
|
||||
<div class="flex items-center gap-1 overflow-x-auto rounded-lg border bg-white p-3">
|
||||
<div v-for="(st, i) in sc?.stages" :key="st" class="flex shrink-0 items-center gap-1">
|
||||
<span
|
||||
class="flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium"
|
||||
:class="i < curStageIdx ? 'bg-emerald-50 text-emerald-600' : i === curStageIdx ? 'bg-[var(--theme-color)] text-white' : 'bg-slate-100 text-slate-400'"
|
||||
:style="{ '--theme-color': themeStore.themeColor }"
|
||||
>
|
||||
<Icon v-if="i < curStageIdx" icon="ix:success" class="size-14px" />
|
||||
<span v-else class="flex h-3.5 w-3.5 items-center justify-center rounded-full border text-[10px]" :class="i === curStageIdx ? 'border-white' : 'border-slate-300'">{{ Number(i) + 1 }}</span>
|
||||
{{ st }}
|
||||
</span>
|
||||
<Icon v-if="Number(i) < sc?.stages?.length - 1" icon="formkit:right" class="size-12px text-slate-300" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 控制条 -->
|
||||
<div class="flex flex-wrap items-center gap-2 rounded-lg border bg-white px-3 py-2">
|
||||
<NButton ghost size="small" class="text-xs" :disabled="cur === 0" @click="prev">
|
||||
<Icon icon="formkit:left" class="size-12px" /> 上一步
|
||||
</NButton>
|
||||
<NButton type="primary" size="small" class="text-xs text-white" :disabled="finished" @click="next">
|
||||
下一步 <Icon icon="formkit:right" class="size-12px" />
|
||||
</NButton>
|
||||
<NButton ghost size="small" class="text-xs" :disabled="finished && !playing" @click="playing = !playing">
|
||||
<template v-if="playing"><Icon icon="material-symbols:pause-outline-rounded" class="size-14px" /> 暂停</template>
|
||||
<template v-else><Icon icon="griddy-icons:play" class="size-14px" /> 自动播放</template>
|
||||
</NButton>
|
||||
<NButton ghost size="small" class="text-xs" @click="reset">
|
||||
<Icon icon="system-uicons:reset" class="size-12px" /> 重置
|
||||
</NButton>
|
||||
<span class="ml-auto text-xs text-slate-400">第 {{ cur + 1 }} / {{ sc?.steps?.length }} 步{{ finished ? " · 流程已走通 ✓" : "" }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 完成横幅 -->
|
||||
<div v-if="finished" class="flex flex-wrap items-center gap-2 rounded-lg border border-emerald-200 bg-emerald-50 px-4 py-2.5 text-sm text-emerald-700">
|
||||
<Icon icon="ix:success" class="size-16px" />
|
||||
<b>流程已走通:</b>共 {{ sc.steps.length }} 步,{{ sc.stages.length }} 个阶段全部闭环;全程操作留痕、资料归档、公告发布完整可追溯。
|
||||
</div>
|
||||
|
||||
<!-- 步骤时间线 -->
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
v-for="(s, i) in sc?.steps" :key="i" @click="playing = false; cur = Number(i)"
|
||||
class="flex w-full cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-left transition"
|
||||
:class="i === cur ? 'border-[var(--theme-color)] bg-[#EAF0F9]/50 shadow-sm' : Number(i) < cur ? 'border-emerald-100 bg-emerald-50/30' : 'bg-white hover:border-slate-300'"
|
||||
:style="{ '--theme-color': themeStore.themeColor }"
|
||||
>
|
||||
<span
|
||||
class="mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-[11px] font-bold"
|
||||
:class="Number(i) < cur ? 'bg-emerald-500 text-white' : i === cur ? 'bg-[var(--theme-color)] text-white' : 'bg-slate-100 text-slate-400'"
|
||||
:style="{ '--theme-color': themeStore.themeColor }"
|
||||
>
|
||||
<Icon v-if="Number(i) < cur" icon="ix:success" class="size-16px" />
|
||||
<template v-else>{{ Number(i) + 1 }}</template>
|
||||
</span>
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="flex flex-wrap items-center gap-x-2 gap-y-1">
|
||||
<span class="flex items-center gap-1 text-xs text-slate-500">
|
||||
<Icon icon="lucide:user-round" class="size-14px" />
|
||||
{{ s.actor }}{{ s.role ? `(${s.role})` : "" }}
|
||||
</span>
|
||||
<span class="rounded bg-slate-100 px-1.5 text-[10px] text-slate-400">{{ s.stage }}</span>
|
||||
<span class="text-sm font-medium" :class="i === cur ? 'text-[#17407F]' : 'text-slate-700'">{{ s.title }}</span>
|
||||
<NTag v-if="s.branch" class="border-violet-200 bg-violet-50 text-violet-600">{{ s.branch }}</NTag>
|
||||
<span class="ml-auto shrink-0 font-mono text-[11px] text-slate-400">{{ s.time }}</span>
|
||||
<NButton ghost type="primary" size="tiny" v-if="jumpFor(s) && s.actor !== '系统'"
|
||||
class="text-[10px] font-medium"
|
||||
:title="`切换到${ROLES_NAME[jumpFor(s)!.role]}的「${VIEW_NAME[jumpFor(s)!.view] ?? jumpFor(s)!.view}」界面`"
|
||||
@click.stop="jumpTo"
|
||||
>
|
||||
进入界面 →
|
||||
</NButton>
|
||||
</span>
|
||||
<span v-if="i === cur && (s.detail || s.system)" class="mt-2 block space-y-1.5 border-t border-[#ACC6E5]/40 pt-2">
|
||||
<span v-if="s.detail" class="block text-xs leading-relaxed text-slate-600"><b class="text-slate-500">内容:</b>{{ s.detail }}</span>
|
||||
<span
|
||||
v-if="s.system"
|
||||
class="flex items-start gap-1.5 text-xs leading-relaxed"
|
||||
:style="{ color: themeStore.themeColor }"
|
||||
>
|
||||
<Icon icon="lucide:sparkles" class="mt-0.8 size-12px" />{{ s.system }}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 185px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, computed, watch } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const route = useRoute();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
const sc = ref<any>(null);
|
||||
const cur = ref<number>(0);
|
||||
const playing = ref(false);
|
||||
const curStageIdx = computed(() => (sc.value ? sc.value.stages.indexOf(sc.value.steps[cur.value].stage) : 0));
|
||||
const finished = computed(() => (sc.value ? cur.value >= sc.value?.steps?.length - 1 : false));
|
||||
const ROLES_NAME: Record<string, string> = {
|
||||
applicant: "申请人(张工艺)", process: "专业会签(王仪表)", process2: "专业会签(周设备)",
|
||||
safety: "安全工程师(王海燕)", dept: "车间主任(李主任)", vp: "分管领导(刘副总)", admin: "系统管理员",
|
||||
quality: "质量工程师(陈质量)", viewer: "非审批人员(吴新)",
|
||||
};
|
||||
const VIEW_NAME: Record<string, string> = {
|
||||
apply: "变更申请", tasks: "我的任务", approvals: "审批中心", execution: "PSSR / 验收", closure: "关闭管理",
|
||||
};
|
||||
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
watch([playing, cur, sc], ([p, c, s]) => {
|
||||
if (timer) { clearTimeout(timer); timer = undefined; }
|
||||
if (!p || !s) return;
|
||||
if (c >= s.steps.length - 1) { playing.value = false; return; }
|
||||
timer = setTimeout(() => { cur.value = Math.min(cur.value + 1, (sc.value?.steps.length ?? 1) - 1); }, 2000);
|
||||
});
|
||||
|
||||
function jumpFor(s: any): { role: string; view: string } | null {
|
||||
const a = s.actor;
|
||||
if (a === "系统") return null;
|
||||
let role: string;
|
||||
if (a.includes("张工艺")) role = "applicant";
|
||||
else if (a.includes("李主任")) role = "dept";
|
||||
else if (a.includes("王仪表")) role = "process";
|
||||
else if (a.includes("周设备")) role = "process2";
|
||||
else if (a.includes("刘副总")) role = "vp";
|
||||
else if (a.includes("专人") || a.includes("安全")) role = "safety";
|
||||
else if (a.includes("岗位") || a.includes("维修班")) role = "applicant";
|
||||
else if (a.includes("车间")) role = "dept";
|
||||
else return null;
|
||||
let view: string;
|
||||
if (role === "applicant") view = s.stage === "变更申请" ? "apply" : "tasks";
|
||||
else if (s.stage.includes("审批")) view = "approvals";
|
||||
else if (s.stage === "关闭") view = "closure";
|
||||
else view = "execution";
|
||||
return { role, view };
|
||||
}
|
||||
function prev() { playing.value = false; cur.value = Math.max(0, cur.value - 1); }
|
||||
function next() { playing.value = false; if (sc.value) cur.value = Math.min(sc.value.steps.length - 1, cur.value + 1); }
|
||||
function reset() { playing.value = false; cur.value = 0; }
|
||||
function back() {
|
||||
routerPushByKey("home_process");
|
||||
}
|
||||
function jumpTo() {
|
||||
routerPushByKey("home_initiatechange");
|
||||
}
|
||||
onMounted(() => {
|
||||
if(route.query && route.query.params){
|
||||
sc.value = JSON.parse(route.query.params as string);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 流程演示详情 -->
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="space-y-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<NButton ghost type="primary" class="text-sm font-medium" @click="back">
|
||||
<Icon icon="ep:back" class="size-16px mr-1" /> 返回示例列表
|
||||
</NButton>
|
||||
<span class="text-base font-bold text-slate-800">{{ sc?.no }} {{ sc?.title }}</span>
|
||||
<NTag size="small" v-for="t in sc?.tags" :key="t.text" :class="t.cls">{{ t.text }}</NTag>
|
||||
<span class="text-xs text-slate-400">示例变更:{{ sc?.changeName }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 阶段进度条 -->
|
||||
<div class="flex items-center gap-1 overflow-x-auto rounded-lg border bg-white p-3">
|
||||
<div v-for="(st, i) in sc?.stages" :key="st" class="flex shrink-0 items-center gap-1">
|
||||
<span
|
||||
class="flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium"
|
||||
:class="i < curStageIdx ? 'bg-emerald-50 text-emerald-600' : i === curStageIdx ? 'bg-[var(--theme-color)] text-white' : 'bg-slate-100 text-slate-400'"
|
||||
:style="{ '--theme-color': themeStore.themeColor }"
|
||||
>
|
||||
<Icon v-if="i < curStageIdx" icon="ix:success" class="size-14px" />
|
||||
<span v-else class="flex h-3.5 w-3.5 items-center justify-center rounded-full border text-[10px]" :class="i === curStageIdx ? 'border-white' : 'border-slate-300'">{{ Number(i) + 1 }}</span>
|
||||
{{ st }}
|
||||
</span>
|
||||
<Icon v-if="Number(i) < sc?.stages?.length - 1" icon="formkit:right" class="size-12px text-slate-300" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 控制条 -->
|
||||
<div class="flex flex-wrap items-center gap-2 rounded-lg border bg-white px-3 py-2">
|
||||
<NButton ghost size="small" class="text-xs" :disabled="cur === 0" @click="prev">
|
||||
<Icon icon="formkit:left" class="size-12px" /> 上一步
|
||||
</NButton>
|
||||
<NButton type="primary" size="small" class="text-xs text-white" :disabled="finished" @click="next">
|
||||
下一步 <Icon icon="formkit:right" class="size-12px" />
|
||||
</NButton>
|
||||
<NButton ghost size="small" class="text-xs" :disabled="finished && !playing" @click="playing = !playing">
|
||||
<template v-if="playing"><Icon icon="material-symbols:pause-outline-rounded" class="size-14px" /> 暂停</template>
|
||||
<template v-else><Icon icon="griddy-icons:play" class="size-14px" /> 自动播放</template>
|
||||
</NButton>
|
||||
<NButton ghost size="small" class="text-xs" @click="reset">
|
||||
<Icon icon="system-uicons:reset" class="size-12px" /> 重置
|
||||
</NButton>
|
||||
<span class="ml-auto text-xs text-slate-400">第 {{ cur + 1 }} / {{ sc?.steps?.length }} 步{{ finished ? " · 流程已走通 ✓" : "" }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 完成横幅 -->
|
||||
<div v-if="finished" class="flex flex-wrap items-center gap-2 rounded-lg border border-emerald-200 bg-emerald-50 px-4 py-2.5 text-sm text-emerald-700">
|
||||
<Icon icon="ix:success" class="size-16px" />
|
||||
<b>流程已走通:</b>共 {{ sc.steps.length }} 步,{{ sc.stages.length }} 个阶段全部闭环;全程操作留痕、资料归档、公告发布完整可追溯。
|
||||
</div>
|
||||
|
||||
<!-- 步骤时间线 -->
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
v-for="(s, i) in sc?.steps" :key="i" @click="playing = false; cur = Number(i)"
|
||||
class="flex w-full cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-left transition"
|
||||
:class="i === cur ? 'border-[var(--theme-color)] bg-[#EAF0F9]/50 shadow-sm' : Number(i) < cur ? 'border-emerald-100 bg-emerald-50/30' : 'bg-white hover:border-slate-300'"
|
||||
:style="{ '--theme-color': themeStore.themeColor }"
|
||||
>
|
||||
<span
|
||||
class="mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-[11px] font-bold"
|
||||
:class="Number(i) < cur ? 'bg-emerald-500 text-white' : i === cur ? 'bg-[var(--theme-color)] text-white' : 'bg-slate-100 text-slate-400'"
|
||||
:style="{ '--theme-color': themeStore.themeColor }"
|
||||
>
|
||||
<Icon v-if="Number(i) < cur" icon="ix:success" class="size-16px" />
|
||||
<template v-else>{{ Number(i) + 1 }}</template>
|
||||
</span>
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="flex flex-wrap items-center gap-x-2 gap-y-1">
|
||||
<span class="flex items-center gap-1 text-xs text-slate-500">
|
||||
<Icon icon="lucide:user-round" class="size-14px" />
|
||||
{{ s.actor }}{{ s.role ? `(${s.role})` : "" }}
|
||||
</span>
|
||||
<span class="rounded bg-slate-100 px-1.5 text-[10px] text-slate-400">{{ s.stage }}</span>
|
||||
<span class="text-sm font-medium" :class="i === cur ? 'text-[#17407F]' : 'text-slate-700'">{{ s.title }}</span>
|
||||
<NTag v-if="s.branch" class="border-violet-200 bg-violet-50 text-violet-600">{{ s.branch }}</NTag>
|
||||
<span class="ml-auto shrink-0 font-mono text-[11px] text-slate-400">{{ s.time }}</span>
|
||||
<NButton ghost type="primary" size="tiny" v-if="jumpFor(s) && s.actor !== '系统'"
|
||||
class="text-[10px] font-medium"
|
||||
:title="`切换到${ROLES_NAME[jumpFor(s)!.role]}的「${VIEW_NAME[jumpFor(s)!.view] ?? jumpFor(s)!.view}」界面`"
|
||||
@click.stop="jumpTo"
|
||||
>
|
||||
进入界面 →
|
||||
</NButton>
|
||||
</span>
|
||||
<span v-if="i === cur && (s.detail || s.system)" class="mt-2 block space-y-1.5 border-t border-[#ACC6E5]/40 pt-2">
|
||||
<span v-if="s.detail" class="block text-xs leading-relaxed text-slate-600"><b class="text-slate-500">内容:</b>{{ s.detail }}</span>
|
||||
<span
|
||||
v-if="s.system"
|
||||
class="flex items-start gap-1.5 text-xs leading-relaxed"
|
||||
:style="{ color: themeStore.themeColor }"
|
||||
>
|
||||
<Icon icon="lucide:sparkles" class="mt-0.8 size-12px" />{{ s.system }}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 185px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
+265
-265
@@ -1,265 +1,265 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const keyword = ref<string>("");
|
||||
const openCount = ref<number>(4);
|
||||
const closedCount = ref<number>(2);
|
||||
const currentTab = ref<string>("open");
|
||||
const range = ref<string>("全部时间");
|
||||
const list = ref<any[]>([]);
|
||||
const openList = [
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
dept: "一车间", planUse: "2026-07-31", applicant: "吴强",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R01-0039",statusDetail: "待关闭确认(资料更新核查中)",
|
||||
dept: "一车间", planUse: "2026-07-16(已投用)", applicant: "张工艺",
|
||||
title: 'V-102 安全阀起跳压力临时调整(紧急补办)', status: '待关闭',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R03-0040",statusDetail: "实施准备中 · 培训 / PSSR 资料待上传",
|
||||
dept: "供应部", planUse: "2026-08-01", applicant: "刘芳",
|
||||
title: '原料环己烷供应商变更(新增 B 供应商)', status: '实施中',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0031",statusDetail: "变更验收(72h 运行验证)",
|
||||
dept: "二车间", planUse: "2026-07-15", applicant: "周涛",
|
||||
title: '冷冻盐水泵 P-103 叶轮材质变更', status: '待验收',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: false,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
dept: "一车间", planUse: "2026-07-31", applicant: "吴强",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R01-0039",statusDetail: "待关闭确认(资料更新核查中)",
|
||||
dept: "一车间", planUse: "2026-07-16(已投用)", applicant: "张工艺",
|
||||
title: 'V-102 安全阀起跳压力临时调整(紧急补办)', status: '待关闭',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R03-0040",statusDetail: "实施准备中 · 培训 / PSSR 资料待上传",
|
||||
dept: "供应部", planUse: "2026-08-01", applicant: "刘芳",
|
||||
title: '原料环己烷供应商变更(新增 B 供应商)', status: '实施中',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0031",statusDetail: "变更验收(72h 运行验证)",
|
||||
dept: "二车间", planUse: "2026-07-15", applicant: "周涛",
|
||||
title: '冷冻盐水泵 P-103 叶轮材质变更', status: '待验收',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: false,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
dept: "一车间", planUse: "2026-07-31", applicant: "吴强",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R01-0039",statusDetail: "待关闭确认(资料更新核查中)",
|
||||
dept: "一车间", planUse: "2026-07-16(已投用)", applicant: "张工艺",
|
||||
title: 'V-102 安全阀起跳压力临时调整(紧急补办)', status: '待关闭',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R03-0040",statusDetail: "实施准备中 · 培训 / PSSR 资料待上传",
|
||||
dept: "供应部", planUse: "2026-08-01", applicant: "刘芳",
|
||||
title: '原料环己烷供应商变更(新增 B 供应商)', status: '实施中',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0031",statusDetail: "变更验收(72h 运行验证)",
|
||||
dept: "二车间", planUse: "2026-07-15", applicant: "周涛",
|
||||
title: '冷冻盐水泵 P-103 叶轮材质变更', status: '待验收',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: false,
|
||||
},
|
||||
];
|
||||
const closedList = [
|
||||
{
|
||||
id: "MOC-2026-R03-0027",statusDetail: "关闭确认完成,已归档",
|
||||
dept: "质量部", planUse: "2026-06-25", applicant: "陈静",
|
||||
title: '化验室通风橱整体更换', status: '已关闭',
|
||||
pssr: "PSSR 检查确认表-归档版.pdf"
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R01-0024",statusDetail: "关闭确认完成,已归档",
|
||||
dept: "一车间", planUse: "2026-06-20", applicant: "孙丽",
|
||||
title: '氮气管网压力分级调整', status: '已关闭',
|
||||
pssr: "PSSR 检查确认表-归档版.pdf"
|
||||
},
|
||||
];
|
||||
|
||||
// 切换tab
|
||||
const tabChange = (k: string) => {
|
||||
list.value = []
|
||||
currentTab.value = k;
|
||||
loading.value = true;
|
||||
if(k === 'open'){
|
||||
setTimeout(() => {
|
||||
list.value = openList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
if(k === 'closed'){
|
||||
setTimeout(() => {
|
||||
list.value = closedList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
// 查看
|
||||
const viewFile = (record: any) => {
|
||||
window.$message?.info(`预览「${record.pssr}」(上传件不做内容识别,原件已随单归档)`)
|
||||
};
|
||||
// 下载
|
||||
const downloadFile = (record: any) => {
|
||||
window.$message?.success(`下载「${record.pssr}」`)
|
||||
};
|
||||
// 下载模板
|
||||
const downloadTemplate = (record: any) => {
|
||||
window.$message?.success(`下载 PSSR 确认表空白模板(打印后线下签署)`)
|
||||
};
|
||||
// 打开变更单
|
||||
const openChange = (record: any) => {
|
||||
routerPushByKey('home_highriskdetail', { query: { params: JSON.stringify(record) } })
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
tabChange('open');
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- PSSR监督 -->
|
||||
<NSpin :show="loading" size="small">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div
|
||||
class="flex flex-wrap items-center gap-2 mb-3"
|
||||
:style="{ '--theme-color': themeStore.themeColor}"
|
||||
>
|
||||
<div class="flex overflow-hidden rounded-full border">
|
||||
<div @click="tabChange('open')" class="px-3.5 py-1.5 text-xs cursor-pointer select-none"
|
||||
:class="currentTab === 'open' ? 'bg-[var(--theme-color)] font-medium text-white' : 'bg-white text-slate-600 hover:bg-slate-50'">
|
||||
未关闭的变更 <b>{{ openCount }}</b>
|
||||
</div>
|
||||
<div @click="tabChange('closed')" class="border-l px-3.5 py-1.5 text-xs cursor-pointer select-none"
|
||||
:class="currentTab === 'closed' ? 'bg-[var(--theme-color)] font-medium text-white' : 'bg-white text-slate-600 hover:bg-slate-50'">
|
||||
已关闭的变更 <b>{{ closedCount }}</b>
|
||||
</div>
|
||||
</div>
|
||||
<NInput v-model:value="keyword" size="small" class="text-xs !w-160px" placeholder="搜索变更名称 / 编号">
|
||||
<template #suffix>
|
||||
<Icon icon="akar-icons:search" class="size-14px text-slate-400 cursor-pointer" />
|
||||
</template>
|
||||
</NInput>
|
||||
<div class="flex items-center gap-1.5">
|
||||
<NButton
|
||||
size="tiny"
|
||||
round
|
||||
v-for="t in ['全部时间', '近 7 天', '近 30 天', '近 90 天']"
|
||||
:key="t"
|
||||
class="text-[11px]"
|
||||
:type="range === t ? 'primary' : 'default'"
|
||||
@click="range = t"
|
||||
>
|
||||
{{ t }}
|
||||
</NButton>
|
||||
</div>
|
||||
<span class="ml-auto text-[11px] text-slate-400">培训 / PSSR 为线下确认 + 资料上传制 · PSSR 检查表同行查看 / 下载</span>
|
||||
</div>
|
||||
<div class="text-[11px] leading-4 text-slate-400 pb-2">
|
||||
培训 / PSSR 为线下组织并签字,拍照或扫描上传即视为完成确认并随单归档;系统不做内容识别,本页为 PSSR 检查表的查看 / 下载入口。
|
||||
</div>
|
||||
<!-- 未关闭的变更 -->
|
||||
<div v-if="currentTab === 'open'" class="scroll">
|
||||
<div
|
||||
class="space-y-3 h-100%"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<div v-for="(s, i) in list" :key="`${s.id ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-x-3 gap-y-2 border p-4" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NTag v-if="s.status==='待PSSR'" type="warning" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='待关闭'" type="error" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='实施中'" type="primary" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='待验收'" type="success" size="small">{{ s.status }}</NTag>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="block truncate text-sm font-medium text-slate-800">{{ s.title }}</p>
|
||||
<span class="mt-0.5 block text-[11px] text-slate-400">{{ s.id }} · {{ s.dept }} · {{ s.applicant }} · {{ s.statusDetail }} · 计划投用 {{ s.planUse }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5 rounded-md border bg-slate-50/60 px-2 py-1">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-[var(--theme-color)]" />
|
||||
<span class="text-[11px] font-medium text-slate-600">PSSR 检查确认表</span>
|
||||
<template v-if="s.pssr">
|
||||
<span class="max-w-[150px] truncate text-[11px] text-slate-400">{{ s.pssr }}</span>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="viewFile(s)">查看</NButton>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="downloadFile(s)">下载</NButton>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="text-[11px] text-[var(--warning-color)]">待传</span>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="downloadTemplate(s)">下载模板</NButton>
|
||||
</template>
|
||||
</div>
|
||||
<NButton v-if="s.hasChange" size="small" type="primary" class="text-xs" @click="openChange(s)">打开变更单</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 已关闭的变更 -->
|
||||
<div v-if="currentTab === 'closed'" class="scroll">
|
||||
<div
|
||||
class="space-y-3 h-100%"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<div v-for="(s, i) in list" :key="`${s.id ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-x-3 gap-y-2 border p-4" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NTag v-if="s.status==='已关闭'" type="success" size="small">{{ s.status }}</NTag>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="block truncate text-sm font-medium text-slate-800">{{ s.title }}</p>
|
||||
<span class="mt-0.5 block text-[11px] text-slate-400">{{ s.id }} · {{ s.dept }} · {{ s.applicant }} · {{ s.statusDetail }} · 计划投用 {{ s.planUse }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5 rounded-md border bg-slate-50/60 px-2 py-1">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-[var(--theme-color)]" />
|
||||
<span class="text-[11px] font-medium text-slate-600">PSSR 检查确认表</span>
|
||||
<span class="max-w-[150px] truncate text-[11px] text-slate-400">{{ s.pssr }}</span>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="viewFile(s)">查看</NButton>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="downloadFile(s)">下载</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpin>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 212px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
|
||||
const themeStore = useThemeStore();
|
||||
const { routerPushByKey } = useRouterPush();
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const keyword = ref<string>("");
|
||||
const openCount = ref<number>(4);
|
||||
const closedCount = ref<number>(2);
|
||||
const currentTab = ref<string>("open");
|
||||
const range = ref<string>("全部时间");
|
||||
const list = ref<any[]>([]);
|
||||
const openList = [
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
dept: "一车间", planUse: "2026-07-31", applicant: "吴强",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R01-0039",statusDetail: "待关闭确认(资料更新核查中)",
|
||||
dept: "一车间", planUse: "2026-07-16(已投用)", applicant: "张工艺",
|
||||
title: 'V-102 安全阀起跳压力临时调整(紧急补办)', status: '待关闭',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R03-0040",statusDetail: "实施准备中 · 培训 / PSSR 资料待上传",
|
||||
dept: "供应部", planUse: "2026-08-01", applicant: "刘芳",
|
||||
title: '原料环己烷供应商变更(新增 B 供应商)', status: '实施中',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0031",statusDetail: "变更验收(72h 运行验证)",
|
||||
dept: "二车间", planUse: "2026-07-15", applicant: "周涛",
|
||||
title: '冷冻盐水泵 P-103 叶轮材质变更', status: '待验收',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: false,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
dept: "一车间", planUse: "2026-07-31", applicant: "吴强",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R01-0039",statusDetail: "待关闭确认(资料更新核查中)",
|
||||
dept: "一车间", planUse: "2026-07-16(已投用)", applicant: "张工艺",
|
||||
title: 'V-102 安全阀起跳压力临时调整(紧急补办)', status: '待关闭',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R03-0040",statusDetail: "实施准备中 · 培训 / PSSR 资料待上传",
|
||||
dept: "供应部", planUse: "2026-08-01", applicant: "刘芳",
|
||||
title: '原料环己烷供应商变更(新增 B 供应商)', status: '实施中',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0031",statusDetail: "变更验收(72h 运行验证)",
|
||||
dept: "二车间", planUse: "2026-07-15", applicant: "周涛",
|
||||
title: '冷冻盐水泵 P-103 叶轮材质变更', status: '待验收',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: false,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0038",statusDetail: "培训 / PSSR 资料已传 · 待确认投用",
|
||||
dept: "一车间", planUse: "2026-07-31", applicant: "吴强",
|
||||
title: 'DCS 罐区液位报警值 LIA-301 调整', status: '待PSSR',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R01-0039",statusDetail: "待关闭确认(资料更新核查中)",
|
||||
dept: "一车间", planUse: "2026-07-16(已投用)", applicant: "张工艺",
|
||||
title: 'V-102 安全阀起跳压力临时调整(紧急补办)', status: '待关闭',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R03-0040",statusDetail: "实施准备中 · 培训 / PSSR 资料待上传",
|
||||
dept: "供应部", planUse: "2026-08-01", applicant: "刘芳",
|
||||
title: '原料环己烷供应商变更(新增 B 供应商)', status: '实施中',
|
||||
pssr: "",hasChange: true,
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R02-0031",statusDetail: "变更验收(72h 运行验证)",
|
||||
dept: "二车间", planUse: "2026-07-15", applicant: "周涛",
|
||||
title: '冷冻盐水泵 P-103 叶轮材质变更', status: '待验收',
|
||||
pssr: "PSSR 检查确认表-签字版.pdf",hasChange: false,
|
||||
},
|
||||
];
|
||||
const closedList = [
|
||||
{
|
||||
id: "MOC-2026-R03-0027",statusDetail: "关闭确认完成,已归档",
|
||||
dept: "质量部", planUse: "2026-06-25", applicant: "陈静",
|
||||
title: '化验室通风橱整体更换', status: '已关闭',
|
||||
pssr: "PSSR 检查确认表-归档版.pdf"
|
||||
},
|
||||
{
|
||||
id: "MOC-2026-R01-0024",statusDetail: "关闭确认完成,已归档",
|
||||
dept: "一车间", planUse: "2026-06-20", applicant: "孙丽",
|
||||
title: '氮气管网压力分级调整', status: '已关闭',
|
||||
pssr: "PSSR 检查确认表-归档版.pdf"
|
||||
},
|
||||
];
|
||||
|
||||
// 切换tab
|
||||
const tabChange = (k: string) => {
|
||||
list.value = []
|
||||
currentTab.value = k;
|
||||
loading.value = true;
|
||||
if(k === 'open'){
|
||||
setTimeout(() => {
|
||||
list.value = openList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
if(k === 'closed'){
|
||||
setTimeout(() => {
|
||||
list.value = closedList;
|
||||
loading.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
// 查看
|
||||
const viewFile = (record: any) => {
|
||||
window.$message?.info(`预览「${record.pssr}」(上传件不做内容识别,原件已随单归档)`)
|
||||
};
|
||||
// 下载
|
||||
const downloadFile = (record: any) => {
|
||||
window.$message?.success(`下载「${record.pssr}」`)
|
||||
};
|
||||
// 下载模板
|
||||
const downloadTemplate = (record: any) => {
|
||||
window.$message?.success(`下载 PSSR 确认表空白模板(打印后线下签署)`)
|
||||
};
|
||||
// 打开变更单
|
||||
const openChange = (record: any) => {
|
||||
routerPushByKey('home_highriskdetail', { query: { params: JSON.stringify(record) } })
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
tabChange('open');
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- PSSR监督 -->
|
||||
<NSpin :show="loading" size="small">
|
||||
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div
|
||||
class="flex flex-wrap items-center gap-2 mb-3"
|
||||
:style="{ '--theme-color': themeStore.themeColor}"
|
||||
>
|
||||
<div class="flex overflow-hidden rounded-full border">
|
||||
<div @click="tabChange('open')" class="px-3.5 py-1.5 text-xs cursor-pointer select-none"
|
||||
:class="currentTab === 'open' ? 'bg-[var(--theme-color)] font-medium text-white' : 'bg-white text-slate-600 hover:bg-slate-50'">
|
||||
未关闭的变更 <b>{{ openCount }}</b>
|
||||
</div>
|
||||
<div @click="tabChange('closed')" class="border-l px-3.5 py-1.5 text-xs cursor-pointer select-none"
|
||||
:class="currentTab === 'closed' ? 'bg-[var(--theme-color)] font-medium text-white' : 'bg-white text-slate-600 hover:bg-slate-50'">
|
||||
已关闭的变更 <b>{{ closedCount }}</b>
|
||||
</div>
|
||||
</div>
|
||||
<NInput v-model:value="keyword" size="small" class="text-xs !w-160px" placeholder="搜索变更名称 / 编号">
|
||||
<template #suffix>
|
||||
<Icon icon="akar-icons:search" class="size-14px text-slate-400 cursor-pointer" />
|
||||
</template>
|
||||
</NInput>
|
||||
<div class="flex items-center gap-1.5">
|
||||
<NButton
|
||||
size="tiny"
|
||||
round
|
||||
v-for="t in ['全部时间', '近 7 天', '近 30 天', '近 90 天']"
|
||||
:key="t"
|
||||
class="text-[11px]"
|
||||
:type="range === t ? 'primary' : 'default'"
|
||||
@click="range = t"
|
||||
>
|
||||
{{ t }}
|
||||
</NButton>
|
||||
</div>
|
||||
<span class="ml-auto text-[11px] text-slate-400">培训 / PSSR 为线下确认 + 资料上传制 · PSSR 检查表同行查看 / 下载</span>
|
||||
</div>
|
||||
<div class="text-[11px] leading-4 text-slate-400 pb-2">
|
||||
培训 / PSSR 为线下组织并签字,拍照或扫描上传即视为完成确认并随单归档;系统不做内容识别,本页为 PSSR 检查表的查看 / 下载入口。
|
||||
</div>
|
||||
<!-- 未关闭的变更 -->
|
||||
<div v-if="currentTab === 'open'" class="scroll">
|
||||
<div
|
||||
class="space-y-3 h-100%"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<div v-for="(s, i) in list" :key="`${s.id ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-x-3 gap-y-2 border p-4" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NTag v-if="s.status==='待PSSR'" type="warning" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='待关闭'" type="error" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='实施中'" type="primary" size="small">{{ s.status }}</NTag>
|
||||
<NTag v-if="s.status==='待验收'" type="success" size="small">{{ s.status }}</NTag>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="block truncate text-sm font-medium text-slate-800">{{ s.title }}</p>
|
||||
<span class="mt-0.5 block text-[11px] text-slate-400">{{ s.id }} · {{ s.dept }} · {{ s.applicant }} · {{ s.statusDetail }} · 计划投用 {{ s.planUse }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5 rounded-md border bg-slate-50/60 px-2 py-1">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-[var(--theme-color)]" />
|
||||
<span class="text-[11px] font-medium text-slate-600">PSSR 检查确认表</span>
|
||||
<template v-if="s.pssr">
|
||||
<span class="max-w-[150px] truncate text-[11px] text-slate-400">{{ s.pssr }}</span>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="viewFile(s)">查看</NButton>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="downloadFile(s)">下载</NButton>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="text-[11px] text-[var(--warning-color)]">待传</span>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="downloadTemplate(s)">下载模板</NButton>
|
||||
</template>
|
||||
</div>
|
||||
<NButton v-if="s.hasChange" size="small" type="primary" class="text-xs" @click="openChange(s)">打开变更单</NButton>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 已关闭的变更 -->
|
||||
<div v-if="currentTab === 'closed'" class="scroll">
|
||||
<div
|
||||
class="space-y-3 h-100%"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<div v-for="(s, i) in list" :key="`${s.id ?? 'x'}-${i}`" class="flex flex-wrap items-center gap-x-3 gap-y-2 border p-4" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<NTag v-if="s.status==='已关闭'" type="success" size="small">{{ s.status }}</NTag>
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="block truncate text-sm font-medium text-slate-800">{{ s.title }}</p>
|
||||
<span class="mt-0.5 block text-[11px] text-slate-400">{{ s.id }} · {{ s.dept }} · {{ s.applicant }} · {{ s.statusDetail }} · 计划投用 {{ s.planUse }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5 rounded-md border bg-slate-50/60 px-2 py-1">
|
||||
<Icon icon="akar-icons:file" class="size-14px text-[var(--theme-color)]" />
|
||||
<span class="text-[11px] font-medium text-slate-600">PSSR 检查确认表</span>
|
||||
<span class="max-w-[150px] truncate text-[11px] text-slate-400">{{ s.pssr }}</span>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="viewFile(s)">查看</NButton>
|
||||
<NButton ghost size="tiny" class="text-11px" @click="downloadFile(s)">下载</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="list.length === 0" class="h-100% flex items-center justify-center">
|
||||
<NEmpty description="暂无数据"></NEmpty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpin>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll {
|
||||
height: calc(100vh - 212px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
+599
-599
File diff suppressed because it is too large
Load Diff
@@ -1,90 +1,90 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RingChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data: { name: string; value: number; }[]; }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
bottom: '20%',
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "5%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "11%",
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: true, // 新增,固定柱子位置
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitArea: { show: false },
|
||||
data: [] as string[],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
show: false,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
barWidth: 45,
|
||||
barGap: "10%",
|
||||
color: "#2080f0",
|
||||
label: { show: true, position: 'top',color: '#333',fontWeight: 'bold' },
|
||||
data: [] as number[],
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
let allMonth = props.data.map((item:any) => item.name);
|
||||
let values = props.data.map((item:any) => item.value);
|
||||
opts.xAxis[0].data = allMonth;
|
||||
opts.series[0].data = values;
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RingChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data: { name: string; value: number; }[]; }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
bottom: '20%',
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "5%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "11%",
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: true, // 新增,固定柱子位置
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitArea: { show: false },
|
||||
data: [] as string[],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
show: false,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: "bar",
|
||||
barWidth: 45,
|
||||
barGap: "10%",
|
||||
color: "#2080f0",
|
||||
label: { show: true, position: 'top',color: '#333',fontWeight: 'bold' },
|
||||
data: [] as number[],
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
let allMonth = props.data.map((item:any) => item.name);
|
||||
let values = props.data.map((item:any) => item.value);
|
||||
opts.xAxis[0].data = allMonth;
|
||||
opts.series[0].data = values;
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
+271
-271
@@ -1,271 +1,271 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { TEMP_WATCH } from "@/typings/model";
|
||||
import RingChart from './modules/ringChart.vue';
|
||||
import ColumnChart from './modules/columnChart.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const addRisk = ref([
|
||||
{
|
||||
name: '2月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '3月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '4月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '5月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '6月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '7月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
]);
|
||||
const RISK_COLORS = ["#f5222d", "#faad14"];
|
||||
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "高风险项", value: 1 },
|
||||
{ name: "中风险项", value: 6 },
|
||||
{ name: "低风险项", value: 12 },
|
||||
];
|
||||
const ACCEPT_COLORS = ["#f5222d", "#faad14", "#b2bcca"];
|
||||
const PSSR_EXEC = [
|
||||
{ pct: 94, label: "投用前完成率", detail: "29/31 变更 · 投用时培训 / PSSR 资料已齐", status: "finish" },
|
||||
{ pct: 88, label: "行动项按期关闭率", detail: "15/17 项 · 2 项跟进中(风险分析建议措施转入)", status: "close" },
|
||||
{ pct: 100, label: "投用后补传率", detail: "0 起 · 投用前未完成而先行投用", status: "fix" },
|
||||
];
|
||||
const OVERDUE_LIST = [
|
||||
{ id: "MOC-2026-R01-0039", title: "V-102 安全阀起跳压力临时调整", stage: "待关闭", days: 4 },
|
||||
{ id: "MOC-2026-R02-0031", title: "冷冻盐水泵 P-103 叶轮材质变更", stage: "待验收", days: 7 },
|
||||
{ id: "MOC-2026-R01-0029", title: "操作规程修订(夏季工况)", stage: "审批中", days: 3 },
|
||||
];
|
||||
const SAFETY_EXPORTS = ["高风险变更清单", "新增固有风险项月度表", "剩余风险与措施落实表", "PSSR 执行统计", "超期未关闭清单", "验收一次通过率分析"];
|
||||
// 催办
|
||||
const handleReminder = (id: string) => {
|
||||
window.$message?.success(`已催办 ${id} 当前节点负责人(系统消息 + 企业微信)`)
|
||||
}
|
||||
// 导出报表
|
||||
const handleExport = (name: string) => {
|
||||
window.$message?.success(`${name}已导出 Excel`)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid
|
||||
cols="s:1 m:4 l:4" responsive="screen" :x-gap="gap" :y-gap="16"
|
||||
:style="{
|
||||
'--error-color':themeStore.otherColor.error,
|
||||
'--warning-color':themeStore.otherColor.warning
|
||||
}"
|
||||
>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 flex items-center gap-3 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="4"
|
||||
class="text-28px font-600 text-[var(--error-color)]"
|
||||
/><p class="mt-10px ml-5px">起</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-slate-600">高风险变更在办</p>
|
||||
<p class="text-[11px] text-slate-400">重要等级 · 未关闭 · 实时推导</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 flex items-center gap-3 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="1"
|
||||
class="text-28px font-600 text-[var(--error-color)]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-slate-600">剩余高风险项</p>
|
||||
<p class="text-[11px] text-slate-400">目标 0 · 管控措施须 100% 落实</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 flex items-center gap-3 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="6"
|
||||
class="text-28px font-600 text-[var(--warning-color)]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-slate-600">剩余中风险项</p>
|
||||
<p class="text-[11px] text-slate-400">措施落实率 86% · 逐项跟踪</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 flex items-center gap-3 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="3"
|
||||
class="text-28px font-600 text-[var(--error-color)]"
|
||||
/><p class="mt-10px ml-5px">起</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-slate-600">超期未关闭</p>
|
||||
<p class="text-[11px] text-slate-400">含临时变更到期 1 起</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid
|
||||
:x-gap="gap" :y-gap="16" responsive="screen" item-responsive
|
||||
:style="{
|
||||
'--error-color':themeStore.otherColor.error,
|
||||
'--warning-color':themeStore.otherColor.warning,
|
||||
'--success-color':themeStore.otherColor.success,
|
||||
'--theme-color':themeStore.themeColor
|
||||
}"
|
||||
>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">月度新增固有风险项(管控前)</p>
|
||||
<ColumnChart :data="addRisk" :colors="RISK_COLORS" style="height: 100%;" />
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">验收达标 · 变更类型 · 变更时限分布</p>
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" />
|
||||
<div class="px-3 pt-2 pb-3">
|
||||
<div class="border-t pt-2.5">
|
||||
<div class="flex items-baseline justify-between">
|
||||
<span class="text-xs text-slate-500">管控措施落实率</span>
|
||||
<span class="text-sm font-bold text-[#1D2129]">86%<span class="ml-1 text-[11px] font-normal text-slate-400">19/22 项</span></span>
|
||||
</div>
|
||||
<div class="mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full bg-[var(--theme-color)]" style="width: 86%"></div>
|
||||
</div>
|
||||
<div class="mt-1 text-[11px] text-slate-400">剩余高风险项 1 项:措施已落实 · 复核中(聚合反应温度上限调整 · 联锁传动试验)</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">PSSR 执行情况</p>
|
||||
<div class="space-y-5 px-3 pt-5 pb-3">
|
||||
<div v-for="r in PSSR_EXEC" :key="r.label">
|
||||
<div class="flex items-baseline gap-2">
|
||||
<span class="text-2xl font-bold text-[#1D2129]">{{ r.pct }}<span class="text-sm font-semibold">%</span></span>
|
||||
<span class="text-xs font-semibold text-slate-500">{{ r.label }}</span>
|
||||
</div>
|
||||
<div class="mt-1.5 h-1 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div v-if="r.status==='finish'" class="h-full rounded-full bg-[var(--theme-color)]" :style="{ width: `${r.pct}%`}"></div>
|
||||
<div v-if="r.status==='close'" class="h-full rounded-full bg-[var(--success-color)]" :style="{ width: `${r.pct}%`}"></div>
|
||||
<div v-if="r.status==='fix'" class="h-full rounded-full bg-[#b2bcca]" :style="{ width: `${r.pct}%`}"></div>
|
||||
</div>
|
||||
<div class="mt-1 text-[11px] text-slate-400">{{ r.detail }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive :style="{'--theme-color':themeStore.themeColor}">
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">验收与投用质量</p>
|
||||
<div class="flex pt-5 pb-3">
|
||||
<div class="w-50% flex flex-col items-center gap-1.5">
|
||||
<NProgress type="circle" :percentage="88" :color="themeStore.otherColor.warning" :offset-degree="180">
|
||||
<div class="flex flex-col items-center">
|
||||
<p class="text-2xl font-bold leading-none text-[#1D2129]">88<span class="text-sm font-semibold">%</span></p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Fair</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
<span class="text-xs font-semibold text-slate-600">验收一次通过率</span>
|
||||
<span class="text-[11px] text-slate-400">近一年 · 全厂</span>
|
||||
</div>
|
||||
<div class="w-50% flex flex-col items-center gap-1.5">
|
||||
<NProgress type="circle" :percentage="85" :offset-degree="180">
|
||||
<div class="flex flex-col items-center">
|
||||
<p class="text-2xl font-bold leading-none text-[#1D2129]">85<span class="text-sm font-semibold">%</span></p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Good</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
<span class="text-xs font-semibold text-slate-600">按期投用率</span>
|
||||
<span class="text-[11px] text-slate-400">计划投用 vs 实际投用</span>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">超期未关闭清单</p>
|
||||
<div class="space-y-2 p-3">
|
||||
<div v-for="o in OVERDUE_LIST" :key="o.id" class="flex items-center gap-2 rounded-lg border border-red-200 bg-red-50/40 px-3 py-2">
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block truncate text-xs font-medium text-slate-800">{{ o.title }}</span>
|
||||
<span class="text-[11px] text-slate-400">{{ o.id }} · 卡在 {{ o.stage }}</span>
|
||||
</span>
|
||||
<NTag size="small" type="error">超期 {{ o.days }} 天</NTag>
|
||||
<NButton size="small" ghost class="text-xs" @click="handleReminder(o.id)">催办</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">报表导出</p>
|
||||
<div class="grid grid-cols-2 gap-3 p-3">
|
||||
<div v-for="r in SAFETY_EXPORTS" :key="r" @click="handleExport(r)"
|
||||
class="cursor-pointer flex items-center gap-2 rounded-lg border px-3 py-2.5 text-left text-xs hover:border-[var(--theme-color)] hover:text-[var(--theme-color)]">
|
||||
<Icon icon="akar-icons:file" class="size-14px" /> {{ r }}
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { TEMP_WATCH } from "@/typings/model";
|
||||
import RingChart from './modules/ringChart.vue';
|
||||
import ColumnChart from './modules/columnChart.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const addRisk = ref([
|
||||
{
|
||||
name: '2月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '3月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '4月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '5月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '6月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
{
|
||||
name: '7月',
|
||||
highRisk: 28,
|
||||
middleRisk: 27,
|
||||
},
|
||||
]);
|
||||
const RISK_COLORS = ["#f5222d", "#faad14"];
|
||||
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "高风险项", value: 1 },
|
||||
{ name: "中风险项", value: 6 },
|
||||
{ name: "低风险项", value: 12 },
|
||||
];
|
||||
const ACCEPT_COLORS = ["#f5222d", "#faad14", "#b2bcca"];
|
||||
const PSSR_EXEC = [
|
||||
{ pct: 94, label: "投用前完成率", detail: "29/31 变更 · 投用时培训 / PSSR 资料已齐", status: "finish" },
|
||||
{ pct: 88, label: "行动项按期关闭率", detail: "15/17 项 · 2 项跟进中(风险分析建议措施转入)", status: "close" },
|
||||
{ pct: 100, label: "投用后补传率", detail: "0 起 · 投用前未完成而先行投用", status: "fix" },
|
||||
];
|
||||
const OVERDUE_LIST = [
|
||||
{ id: "MOC-2026-R01-0039", title: "V-102 安全阀起跳压力临时调整", stage: "待关闭", days: 4 },
|
||||
{ id: "MOC-2026-R02-0031", title: "冷冻盐水泵 P-103 叶轮材质变更", stage: "待验收", days: 7 },
|
||||
{ id: "MOC-2026-R01-0029", title: "操作规程修订(夏季工况)", stage: "审批中", days: 3 },
|
||||
];
|
||||
const SAFETY_EXPORTS = ["高风险变更清单", "新增固有风险项月度表", "剩余风险与措施落实表", "PSSR 执行统计", "超期未关闭清单", "验收一次通过率分析"];
|
||||
// 催办
|
||||
const handleReminder = (id: string) => {
|
||||
window.$message?.success(`已催办 ${id} 当前节点负责人(系统消息 + 企业微信)`)
|
||||
}
|
||||
// 导出报表
|
||||
const handleExport = (name: string) => {
|
||||
window.$message?.success(`${name}已导出 Excel`)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid
|
||||
cols="s:1 m:4 l:4" responsive="screen" :x-gap="gap" :y-gap="16"
|
||||
:style="{
|
||||
'--error-color':themeStore.otherColor.error,
|
||||
'--warning-color':themeStore.otherColor.warning
|
||||
}"
|
||||
>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 flex items-center gap-3 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="4"
|
||||
class="text-28px font-600 text-[var(--error-color)]"
|
||||
/><p class="mt-10px ml-5px">起</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-slate-600">高风险变更在办</p>
|
||||
<p class="text-[11px] text-slate-400">重要等级 · 未关闭 · 实时推导</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 flex items-center gap-3 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="1"
|
||||
class="text-28px font-600 text-[var(--error-color)]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-slate-600">剩余高风险项</p>
|
||||
<p class="text-[11px] text-slate-400">目标 0 · 管控措施须 100% 落实</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 flex items-center gap-3 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="6"
|
||||
class="text-28px font-600 text-[var(--warning-color)]"
|
||||
/><p class="mt-10px ml-5px">项</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-slate-600">剩余中风险项</p>
|
||||
<p class="text-[11px] text-slate-400">措施落实率 86% · 逐项跟踪</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 flex items-center gap-3 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px' }"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="3"
|
||||
class="text-28px font-600 text-[var(--error-color)]"
|
||||
/><p class="mt-10px ml-5px">起</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-slate-600">超期未关闭</p>
|
||||
<p class="text-[11px] text-slate-400">含临时变更到期 1 起</p>
|
||||
</div>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid
|
||||
:x-gap="gap" :y-gap="16" responsive="screen" item-responsive
|
||||
:style="{
|
||||
'--error-color':themeStore.otherColor.error,
|
||||
'--warning-color':themeStore.otherColor.warning,
|
||||
'--success-color':themeStore.otherColor.success,
|
||||
'--theme-color':themeStore.themeColor
|
||||
}"
|
||||
>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">月度新增固有风险项(管控前)</p>
|
||||
<ColumnChart :data="addRisk" :colors="RISK_COLORS" style="height: 100%;" />
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">验收达标 · 变更类型 · 变更时限分布</p>
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" />
|
||||
<div class="px-3 pt-2 pb-3">
|
||||
<div class="border-t pt-2.5">
|
||||
<div class="flex items-baseline justify-between">
|
||||
<span class="text-xs text-slate-500">管控措施落实率</span>
|
||||
<span class="text-sm font-bold text-[#1D2129]">86%<span class="ml-1 text-[11px] font-normal text-slate-400">19/22 项</span></span>
|
||||
</div>
|
||||
<div class="mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full bg-[var(--theme-color)]" style="width: 86%"></div>
|
||||
</div>
|
||||
<div class="mt-1 text-[11px] text-slate-400">剩余高风险项 1 项:措施已落实 · 复核中(聚合反应温度上限调整 · 联锁传动试验)</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">PSSR 执行情况</p>
|
||||
<div class="space-y-5 px-3 pt-5 pb-3">
|
||||
<div v-for="r in PSSR_EXEC" :key="r.label">
|
||||
<div class="flex items-baseline gap-2">
|
||||
<span class="text-2xl font-bold text-[#1D2129]">{{ r.pct }}<span class="text-sm font-semibold">%</span></span>
|
||||
<span class="text-xs font-semibold text-slate-500">{{ r.label }}</span>
|
||||
</div>
|
||||
<div class="mt-1.5 h-1 w-full overflow-hidden rounded-full bg-slate-100">
|
||||
<div v-if="r.status==='finish'" class="h-full rounded-full bg-[var(--theme-color)]" :style="{ width: `${r.pct}%`}"></div>
|
||||
<div v-if="r.status==='close'" class="h-full rounded-full bg-[var(--success-color)]" :style="{ width: `${r.pct}%`}"></div>
|
||||
<div v-if="r.status==='fix'" class="h-full rounded-full bg-[#b2bcca]" :style="{ width: `${r.pct}%`}"></div>
|
||||
</div>
|
||||
<div class="mt-1 text-[11px] text-slate-400">{{ r.detail }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive :style="{'--theme-color':themeStore.themeColor}">
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">验收与投用质量</p>
|
||||
<div class="flex pt-5 pb-3">
|
||||
<div class="w-50% flex flex-col items-center gap-1.5">
|
||||
<NProgress type="circle" :percentage="88" :color="themeStore.otherColor.warning" :offset-degree="180">
|
||||
<div class="flex flex-col items-center">
|
||||
<p class="text-2xl font-bold leading-none text-[#1D2129]">88<span class="text-sm font-semibold">%</span></p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Fair</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
<span class="text-xs font-semibold text-slate-600">验收一次通过率</span>
|
||||
<span class="text-[11px] text-slate-400">近一年 · 全厂</span>
|
||||
</div>
|
||||
<div class="w-50% flex flex-col items-center gap-1.5">
|
||||
<NProgress type="circle" :percentage="85" :offset-degree="180">
|
||||
<div class="flex flex-col items-center">
|
||||
<p class="text-2xl font-bold leading-none text-[#1D2129]">85<span class="text-sm font-semibold">%</span></p>
|
||||
<p class="mt-1 text-[11px] text-slate-400">Good</p>
|
||||
</div>
|
||||
</NProgress>
|
||||
<span class="text-xs font-semibold text-slate-600">按期投用率</span>
|
||||
<span class="text-[11px] text-slate-400">计划投用 vs 实际投用</span>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">超期未关闭清单</p>
|
||||
<div class="space-y-2 p-3">
|
||||
<div v-for="o in OVERDUE_LIST" :key="o.id" class="flex items-center gap-2 rounded-lg border border-red-200 bg-red-50/40 px-3 py-2">
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block truncate text-xs font-medium text-slate-800">{{ o.title }}</span>
|
||||
<span class="text-[11px] text-slate-400">{{ o.id }} · 卡在 {{ o.stage }}</span>
|
||||
</span>
|
||||
<NTag size="small" type="error">超期 {{ o.days }} 天</NTag>
|
||||
<NButton size="small" ghost class="text-xs" @click="handleReminder(o.id)">催办</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{ padding: '0' }" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">报表导出</p>
|
||||
<div class="grid grid-cols-2 gap-3 p-3">
|
||||
<div v-for="r in SAFETY_EXPORTS" :key="r" @click="handleExport(r)"
|
||||
class="cursor-pointer flex items-center gap-2 rounded-lg border px-3 py-2.5 text-left text-xs hover:border-[var(--theme-color)] hover:text-[var(--theme-color)]">
|
||||
<Icon icon="akar-icons:file" class="size-14px" /> {{ r }}
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -1,103 +1,103 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RingChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data: { name: string; highRisk: number; middleRisk: number }[]; colors: string[] }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
bottom: '20%',
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "10%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "35%",
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: true, // 新增,固定柱子位置
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitArea: { show: false },
|
||||
data: [] as string[],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
show: false,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "高风险项",
|
||||
stack: "总数",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
barGap: "10%",
|
||||
color: "#00B42A",
|
||||
data: [] as number[],
|
||||
},
|
||||
// 中风险项 - 橙色
|
||||
{
|
||||
name: "中风险项",
|
||||
stack: "总数",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
color: "#FF7D00",
|
||||
data: [] as number[],
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
let allMonth = props.data.map((item:any) => item.name);
|
||||
let highRis = props.data.map((item:any) => item.highRisk);
|
||||
let middleRisk = props.data.map((item:any) => item.middleRisk);
|
||||
opts.xAxis[0].data = allMonth;
|
||||
opts.series[0].data = highRis;
|
||||
opts.series[1].data = middleRisk;
|
||||
opts.series[0].color = props.colors[0];
|
||||
opts.series[1].color = props.colors[1];
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useEcharts } from '@/hooks/common/echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'RingChart'
|
||||
});
|
||||
|
||||
const props = defineProps<{ data: { name: string; highRisk: number; middleRisk: number }[]; colors: string[] }>();
|
||||
|
||||
const { domRef, updateOptions } = useEcharts(() => ({
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "shadow",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
},
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
bottom: '20%',
|
||||
left: 'center',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "10%",
|
||||
left: "5%",
|
||||
right: "5%",
|
||||
bottom: "35%",
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: true, // 新增,固定柱子位置
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
},
|
||||
splitLine: { show: false },
|
||||
axisTick: { show: false },
|
||||
splitArea: { show: false },
|
||||
data: [] as string[],
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
show: false,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "高风险项",
|
||||
stack: "总数",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
barGap: "10%",
|
||||
color: "#00B42A",
|
||||
data: [] as number[],
|
||||
},
|
||||
// 中风险项 - 橙色
|
||||
{
|
||||
name: "中风险项",
|
||||
stack: "总数",
|
||||
type: "bar",
|
||||
barWidth: 30,
|
||||
color: "#FF7D00",
|
||||
data: [] as number[],
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
function init() {
|
||||
updateOptions(opts => {
|
||||
let allMonth = props.data.map((item:any) => item.name);
|
||||
let highRis = props.data.map((item:any) => item.highRisk);
|
||||
let middleRisk = props.data.map((item:any) => item.middleRisk);
|
||||
opts.xAxis[0].data = allMonth;
|
||||
opts.series[0].data = highRis;
|
||||
opts.series[1].data = middleRisk;
|
||||
opts.series[0].color = props.colors[0];
|
||||
opts.series[1].color = props.colors[1];
|
||||
return opts;
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="domRef" class="w-full h-220px overflow-hidden"></div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
+189
-189
@@ -1,189 +1,189 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
import RingChart from './modules/ringChart.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const profEff = ref<{d: string, days: number, me?: boolean, target?: boolean}[]>([
|
||||
{ d: `陈质量(本人)`, days: 1.8, me: true },
|
||||
{ d: "仪表专业均值", days: 2.1, me: false },
|
||||
{ d: "设备专业均值", days: 2.2, me: false },
|
||||
{ d: "工艺专业均值", days: 2.6, me: false },
|
||||
{ d: "考核目标", days: 2.5, me: false, target: true },
|
||||
]);
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "工艺", value: 52 },
|
||||
{ name: "设备", value: 49 },
|
||||
{ name: "管理", value: 25 },
|
||||
];
|
||||
const ACCEPT_COLORS = ["#2080f0", "#7CC242", "#F5A623"];
|
||||
|
||||
const profHighRisk = [
|
||||
{ id: "MOC-2026-R01-0035", status: '审批中', title: 'R-201 反应釜搅拌器电机更换(55kW→75kW 防爆电机)' },
|
||||
{ id: "MOC-2026-R01-0036", status: '审批中', title: '聚合反应温度控制上限调整(78℃→82℃)' },
|
||||
{ id: "MOC-2026-R01-0037", status: '实施中', title: '原料环己烷供应商变更(新增 B 供应商)' },
|
||||
];
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid cols="s:1 m:5 l:5" responsive="screen" :x-gap="gap" :y-gap="16"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">本月会签 / 审批</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="6"
|
||||
class="text-24px font-600 text-[#333]"
|
||||
/>
|
||||
</div>
|
||||
<p class="text-12px">口径:节点签出记录</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">我的会签平均耗时</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="1.8"
|
||||
:decimals="1"
|
||||
class="text-26px font-600 text-[var(--success-color)]"
|
||||
/><p class="text-26px font-600 text-[var(--success-color)]">天</p>
|
||||
</div>
|
||||
<p class="text-12px">口径:签收→签出时长 · 目标 ≤2.5 天</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">按时完成率</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="95"
|
||||
class="text-26px font-600 text-[var(--success-color)]"
|
||||
/><p class="text-26px font-600 text-[var(--success-color)]">%</p>
|
||||
</div>
|
||||
<p class="text-12px">考核:目标 ≥90%</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">参与风险分析</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="2"
|
||||
class="text-26px font-600 text-[var(--theme-color)]"
|
||||
/><p class="text-26px font-600 text-[var(--theme-color)]">次</p>
|
||||
</div>
|
||||
<p class="text-12px">口径:HAZOP / JSA 分析组成员(选择式)记录</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">当前待我审批</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="1"
|
||||
class="text-26px font-600 text-[var(--warning-color)]"
|
||||
/>
|
||||
</div>
|
||||
<p class="text-12px">实时 · 与工作台同源</p>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--error-bg': getColorWithOpacity(themeStore.otherColor.error,0.1),
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning,0.1),
|
||||
'--theme-bg': getColorWithOpacity(themeStore.themeColor,0.1),
|
||||
}"
|
||||
>
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">会签效率对比(考核 · 汇报)</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="space-y-3">
|
||||
<div v-for="e in profEff" :key="e.d">
|
||||
<div class="mb-1 flex items-center justify-between text-xs">
|
||||
<span :class="e.me ? 'font-semibold text-[var(--theme-color)]' : 'text-slate-600'">{{ e.d }}</span>
|
||||
<span :class="e.target ? 'text-slate-400' : e.days > 2.5 ? 'font-medium text-[var(--error-color)]' : 'text-slate-500'">{{ e.days }} 天{{ e.target ? "(标线)" : "" }}</span>
|
||||
</div>
|
||||
<div class="h-2 overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full" :class="e.target ? 'bg-slate-300' : e.me ? 'bg-[var(--theme-color)]' : e.days > 2.5 ? 'bg-[var(--error-color)]' : 'bg-[#6E93C6]'" :style="{ width: `${Math.min(100, (e.days / 4) * 100)}%` }" />
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-[11px] text-slate-400">考核数据来源:节点签收 → 签出时长自动统计;连续两月超标将纳入绩效面谈</p>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">本专业变更类型分布(近一年)</p>
|
||||
<div class="py-3 px-4">
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">本专业高风险在办(直达风险分析)</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="space-y-2 pt-1">
|
||||
<div v-for="c in profHighRisk" :key="c.id" @click="emit('go', 'risk')" class="cursor-pointer flex w-full items-center gap-2 rounded-lg border px-3 py-2 text-left hover:border-red-300 hover:bg-red-50/30">
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block truncate text-sm font-medium text-slate-800">{{ c.title }}</span>
|
||||
<span class="text-[11px] text-slate-400">{{ c.id }} · {{ c.status }}</span>
|
||||
</span>
|
||||
<ChevronRight class="h-3.5 w-3.5 shrink-0 text-slate-300" />
|
||||
</div>
|
||||
<p class="text-[11px] text-slate-400">更多高风险场景与分析记录见「本专业高风险」页</p>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
import RingChart from './modules/ringChart.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const profEff = ref<{d: string, days: number, me?: boolean, target?: boolean}[]>([
|
||||
{ d: `陈质量(本人)`, days: 1.8, me: true },
|
||||
{ d: "仪表专业均值", days: 2.1, me: false },
|
||||
{ d: "设备专业均值", days: 2.2, me: false },
|
||||
{ d: "工艺专业均值", days: 2.6, me: false },
|
||||
{ d: "考核目标", days: 2.5, me: false, target: true },
|
||||
]);
|
||||
const DEPT_ACCEPT = [
|
||||
{ name: "工艺", value: 52 },
|
||||
{ name: "设备", value: 49 },
|
||||
{ name: "管理", value: 25 },
|
||||
];
|
||||
const ACCEPT_COLORS = ["#2080f0", "#7CC242", "#F5A623"];
|
||||
|
||||
const profHighRisk = [
|
||||
{ id: "MOC-2026-R01-0035", status: '审批中', title: 'R-201 反应釜搅拌器电机更换(55kW→75kW 防爆电机)' },
|
||||
{ id: "MOC-2026-R01-0036", status: '审批中', title: '聚合反应温度控制上限调整(78℃→82℃)' },
|
||||
{ id: "MOC-2026-R01-0037", status: '实施中', title: '原料环己烷供应商变更(新增 B 供应商)' },
|
||||
];
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<!-- 卡片数据 -->
|
||||
<NGrid cols="s:1 m:5 l:5" responsive="screen" :x-gap="gap" :y-gap="16"
|
||||
:style="{
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
}"
|
||||
>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">本月会签 / 审批</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="6"
|
||||
class="text-24px font-600 text-[#333]"
|
||||
/>
|
||||
</div>
|
||||
<p class="text-12px">口径:节点签出记录</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">我的会签平均耗时</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="1.8"
|
||||
:decimals="1"
|
||||
class="text-26px font-600 text-[var(--success-color)]"
|
||||
/><p class="text-26px font-600 text-[var(--success-color)]">天</p>
|
||||
</div>
|
||||
<p class="text-12px">口径:签收→签出时长 · 目标 ≤2.5 天</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">按时完成率</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="95"
|
||||
class="text-26px font-600 text-[var(--success-color)]"
|
||||
/><p class="text-26px font-600 text-[var(--success-color)]">%</p>
|
||||
</div>
|
||||
<p class="text-12px">考核:目标 ≥90%</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">参与风险分析</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="2"
|
||||
class="text-26px font-600 text-[var(--theme-color)]"
|
||||
/><p class="text-26px font-600 text-[var(--theme-color)]">次</p>
|
||||
</div>
|
||||
<p class="text-12px">口径:HAZOP / JSA 分析组成员(选择式)记录</p>
|
||||
</div>
|
||||
</NGi>
|
||||
<NGi>
|
||||
<div
|
||||
class="flex-1 bg-white px-16px py-12px text-[#94a3b8]"
|
||||
:style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }"
|
||||
>
|
||||
<p class="text-12px font-600">当前待我审批</p>
|
||||
<div class="flex items-center">
|
||||
<CountTo
|
||||
:start-value="0"
|
||||
:end-value="1"
|
||||
class="text-26px font-600 text-[var(--warning-color)]"
|
||||
/>
|
||||
</div>
|
||||
<p class="text-12px">实时 · 与工作台同源</p>
|
||||
</div>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--error-bg': getColorWithOpacity(themeStore.otherColor.error,0.1),
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning,0.1),
|
||||
'--theme-bg': getColorWithOpacity(themeStore.themeColor,0.1),
|
||||
}"
|
||||
>
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">会签效率对比(考核 · 汇报)</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="space-y-3">
|
||||
<div v-for="e in profEff" :key="e.d">
|
||||
<div class="mb-1 flex items-center justify-between text-xs">
|
||||
<span :class="e.me ? 'font-semibold text-[var(--theme-color)]' : 'text-slate-600'">{{ e.d }}</span>
|
||||
<span :class="e.target ? 'text-slate-400' : e.days > 2.5 ? 'font-medium text-[var(--error-color)]' : 'text-slate-500'">{{ e.days }} 天{{ e.target ? "(标线)" : "" }}</span>
|
||||
</div>
|
||||
<div class="h-2 overflow-hidden rounded-full bg-slate-100">
|
||||
<div class="h-full rounded-full" :class="e.target ? 'bg-slate-300' : e.me ? 'bg-[var(--theme-color)]' : e.days > 2.5 ? 'bg-[var(--error-color)]' : 'bg-[#6E93C6]'" :style="{ width: `${Math.min(100, (e.days / 4) * 100)}%` }" />
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-[11px] text-slate-400">考核数据来源:节点签收 → 签出时长自动统计;连续两月超标将纳入绩效面谈</p>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">本专业变更类型分布(近一年)</p>
|
||||
<div class="py-3 px-4">
|
||||
<RingChart :data="DEPT_ACCEPT" :colors="ACCEPT_COLORS" />
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<NGi span="24 s:24 m:24 l:8">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3">本专业高风险在办(直达风险分析)</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="space-y-2 pt-1">
|
||||
<div v-for="c in profHighRisk" :key="c.id" @click="emit('go', 'risk')" class="cursor-pointer flex w-full items-center gap-2 rounded-lg border px-3 py-2 text-left hover:border-red-300 hover:bg-red-50/30">
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block truncate text-sm font-medium text-slate-800">{{ c.title }}</span>
|
||||
<span class="text-[11px] text-slate-400">{{ c.id }} · {{ c.status }}</span>
|
||||
</span>
|
||||
<ChevronRight class="h-3.5 w-3.5 shrink-0 text-slate-300" />
|
||||
</div>
|
||||
<p class="text-[11px] text-slate-400">更多高风险场景与分析记录见「本专业高风险」页</p>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -1,332 +1,332 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const aiEnabled = ref<boolean>(true);
|
||||
// AI 辅助功能配置
|
||||
const aiConfig = ref<{address:string, mode:number|null, key:string,timeout:null|number}>({
|
||||
address:'',
|
||||
mode:null,
|
||||
key:'',
|
||||
timeout:null,
|
||||
})
|
||||
const modeOptions = ref<{label:string, value:number}[]>([
|
||||
{label:'kimi-k2(企业私有化部署)',value:1}
|
||||
])
|
||||
|
||||
// 变更类型
|
||||
const typeList = ref<{id:number, name:string, desc?:string}[]>([
|
||||
{id:1,name:'工艺', desc:'工艺参数、配方、操作条件、操作规程等工艺技术类变更'},
|
||||
{id:2,name:'设备', desc:'设备本体、附件、材质、规格、备件等硬件类变更'},
|
||||
{id:3,name:'管理', desc:'制度、职责、程序、组织与人员等管理类变更'},
|
||||
])
|
||||
// 变更等级
|
||||
const levelList = ref<{id:number, name:string, way:string,tools:{id:number, name:string}[]}[]>([
|
||||
{id:1,name:'一般', way:'等级评分< 20 分',tools:[{id:1,name:'AI预分析'},{id:2,name:'检查表法'}]},
|
||||
{id:2,name:'重要', way:'等级评分 > 20 分',tools:[{id:1,name:'AI预分析'},{id:2,name:'HAZOP'},{id:3,name:'JSA'},{id:4,name:'SCL'}]},
|
||||
])
|
||||
// 变更编号规则
|
||||
const ruleInfo = ref<{prefix:string, year:null|string, code:number|null, digit:number|null, rule:number|null}>({
|
||||
prefix:'MOC',
|
||||
year:null,
|
||||
code: null,
|
||||
digit: null,
|
||||
rule: null,
|
||||
})
|
||||
const yearOptions = ref<{label:string, value:string}[]>([
|
||||
{label:'四位年份(yyyy)',value:'yyyy'}
|
||||
])
|
||||
const codeOptions = ref<{label:string, value:number}[]>([
|
||||
{label:'申请部门装置代码',value:1}
|
||||
])
|
||||
const ruleOptions = ref<{label:string, value:number}[]>([
|
||||
{label:'按年度+装置代码重置',value:1}
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const toggle = (v: boolean) => {
|
||||
window.$message?.success(v ? "AI 辅助功能已启用" : "AI 辅助功能已关闭");
|
||||
aiEnabled.value = v;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<!-- AI 辅助功能 -->
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--success-bg': getColorWithOpacity(themeStore.otherColor.success, 0.1),
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning, 0.1),
|
||||
}"
|
||||
>
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3 flex items-center">
|
||||
<Icon icon="lucide:sparkles" class="size-14px text-violet-500 mr-1" />AI 辅助功能
|
||||
</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="rounded-lg border p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="text-sm font-medium">启用 AI 辅助</div>
|
||||
<NSwitch size="small" :value="aiEnabled" @update:value="toggle" />
|
||||
</div>
|
||||
<div class="mt-1 text-xs text-slate-500">
|
||||
开启后,变更申请界面显示「变更识别」按钮:AI 自动完成变更前后比较、生成变更申请表(均支持手动修改);关闭后全部内容手动填写。
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 flex items-center gap-2 rounded-lg px-3 py-2 text-xs"
|
||||
:class="aiEnabled ? 'bg-[var(--success-bg)] text-[var(--success-color)]' : 'bg-[var(--warning-bg)] text-[var(--warning-color)]'">
|
||||
<Icon v-if="aiEnabled" icon="material-symbols:check-circle-outline" class="size-16px" />
|
||||
<Icon v-else icon="proicons:alert-triangle" class="size-16px" />
|
||||
当前状态:{{ aiEnabled ? "已启用 —— 变更申请界面提供 AI 变更识别与申请表生成" : "已关闭 —— 变更申请界面为纯手动模式" }}
|
||||
</div>
|
||||
<div class="space-y-2 border rounded-md p-3 mt-3">
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">接口地址</p>
|
||||
<div class="flex-1">
|
||||
<NInput v-model:value="aiConfig.address" placeholder="请输入接口地址" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">模型</p>
|
||||
<div class="flex-1">
|
||||
<NSelect v-model:value="aiConfig.mode" :options="modeOptions" placeholder="请选择模型" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">API Key</p>
|
||||
<div class="flex-1">
|
||||
<NInput v-model:value="aiConfig.key" placeholder="请输入API Key" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">超时(秒)</p>
|
||||
<div class="flex-1">
|
||||
<NInputNumber v-model:value="aiConfig.timeout" :min="1" :show-button="false" :precision="0" placeholder="请输入超时时间" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<NButton size="small" type="primary" class="text-xs">测试连接</NButton>
|
||||
<NButton size="small" class="text-xs">保存配置</NButton>
|
||||
<NButton size="small" class="text-xs">
|
||||
<Icon icon="akar-icons:file" class="size-14px mr-1" />
|
||||
调用记录查询
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<!-- 变更类型设置(支持自定义) -->
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center justify-between text-base font-semibold border-b border-slate-100 p-3">
|
||||
<div class="flex items-center">
|
||||
<Icon icon="ep:setting" class="size-16px mr-1" />
|
||||
变更类型设置(支持自定义)
|
||||
</div>
|
||||
<NButton size="small" type="primary" class="text-xs">
|
||||
<Icon icon="ic:round-plus" class="size-16px" />新增类型
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="py-3 px-4">
|
||||
<div v-if="typeList.length" class="border rounded-md">
|
||||
<template v-for="(item,index) in typeList" :key="item.id">
|
||||
<div class="p-3 flex items-center gap-2" :class="{'border-t':index !== 0}">
|
||||
<div class="flex-1 flex gap-2">
|
||||
<NTag size="small" type="success">{{item.name}}</NTag>
|
||||
<p class="flex-1">{{item.desc}}</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<NButton text type="primary" class="text-xs">
|
||||
<Icon icon="akar-icons:edit" class="size-14px" />编辑
|
||||
</NButton>
|
||||
<NButton text type="error" class="text-xs">
|
||||
<Icon icon="ep:delete" class="size-12px" />删除
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else>
|
||||
<NEmpty description="暂无变更类型"></NEmpty>
|
||||
</div>
|
||||
<p class="mt-3 text-xs text-slate-400">每个类型可关联默认审批流程模板、材料清单模板和 PSSR 检查模板;历史变更单保留原类型快照,不受修改/删除影响。</p>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<!-- 变更等级设定(支持自定义) -->
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<div class="flex items-center justify-between text-base font-semibold border-b border-slate-100 p-3">
|
||||
<div class="flex items-center">
|
||||
<Icon icon="ep:setting" class="size-16px mr-1" />
|
||||
变更等级设定(支持自定义)
|
||||
</div>
|
||||
<NButton size="small" type="primary" class="text-xs">
|
||||
<Icon icon="ic:round-plus" class="size-16px" />新增等级
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="py-3 px-4">
|
||||
<div v-if="levelList.length" class="space-y-2">
|
||||
<div v-for="item in levelList" :key="item.id" class="border rounded-md p-3">
|
||||
<div class="flex items-center">
|
||||
<div class="flex-1 flex items-center gap-2">
|
||||
<NTag v-if="item.name==='一般'" size="small">{{item.name}}</NTag>
|
||||
<NTag v-else-if="item.name==='重要'" size="small" type="error">{{item.name}}</NTag>
|
||||
<p class="flex-1">判定方式:<b>{{item.way}}</b></p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<NButton text type="primary" class="text-xs">
|
||||
<Icon icon="akar-icons:edit" class="size-14px" />编辑
|
||||
</NButton>
|
||||
<NButton text type="error" class="text-xs">
|
||||
<Icon icon="ep:delete" class="size-12px" />删除
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap mt-2">
|
||||
<p>对应分析工具:</p>
|
||||
<div class="flex items-center flex-wrap gap-2">
|
||||
<NTag v-for="tool in item.tools" :key="tool.id" size="small" type="info">{{tool.name}}</NTag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<NEmpty description="暂无变更等级"></NEmpty>
|
||||
</div>
|
||||
<p class="mt-3 text-xs text-slate-400">等级决定审批流程、风险分析深度与会签范围;申请时系统按判定方式自动定级并推荐对应分析工具,支持人工改判留痕。勾选 HAZOP/JSA/SCL的风险定级规则见下方「风险矩阵设置」。</p>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<!-- 变更编号规则 -->
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<div class="flex items-center justify-between text-base font-semibold border-b border-slate-100 p-3">
|
||||
<div class="flex items-center">
|
||||
<Icon icon="ep:setting" class="size-16px mr-1" />
|
||||
变更编号规则
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-3 px-4">
|
||||
<div class="space-y-2">
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">编号前缀</p>
|
||||
<div class="flex-1">
|
||||
<NInput v-model:value="ruleInfo.prefix" placeholder="请输入编号前缀" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">年份格式</p>
|
||||
<div class="flex-1">
|
||||
<NSelect v-model:value="ruleInfo.year" :options="yearOptions" placeholder="请选择年份格式" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">装置代码段</p>
|
||||
<div class="flex-1">
|
||||
<NSelect v-model:value="ruleInfo.code" :options="codeOptions" placeholder="请选择装置代码段" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">流水号位数</p>
|
||||
<div class="flex-1">
|
||||
<NInputNumber v-model:value="ruleInfo.digit" :min="1" :show-button="false" :precision="0" placeholder="请输入流水号位数" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">流水重置规则</p>
|
||||
<div class="flex-1">
|
||||
<NSelect v-model:value="ruleInfo.rule" :options="ruleOptions" placeholder="请选择流水重置规则" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center p-3 bg-[#f8fafc] rounded-md">
|
||||
<span>编号示例预览:</span>
|
||||
<span class="text-[var(--theme-color)]">MOC-2026-R01-0001</span>
|
||||
<NButton size="small" type="primary" class="text-xs ml-auto">保存规则</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-3 text-xs text-slate-400">保存草稿即预占编号,提交后正式生效;规则修改不影响历史单据编号。</p>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<!-- 风险矩阵设置(按分析方法) -->
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:24">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<div class="flex items-center justify-between text-base font-semibold border-b border-slate-100 p-3">
|
||||
<div class="flex items-center">
|
||||
<Icon icon="icon-park-outline:all-application" class="size-16px mr-1" />
|
||||
风险矩阵设置(按分析方法)
|
||||
</div>
|
||||
<NButton size="small" class="text-xs">
|
||||
<Icon icon="akar-icons:edit" class="size-14px mr-1" />
|
||||
维度分级定义
|
||||
</NButton>
|
||||
<NButton size="small" type="primary" class="text-xs">
|
||||
保存矩阵
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="py-3 px-4">
|
||||
<NTabs type="segment" animated>
|
||||
<NTabPane name="chap1" tab="HAZOP分析矩阵">
|
||||
HAZOP分析矩阵
|
||||
</NTabPane>
|
||||
<NTabPane name="chap2" tab="JSA分析矩阵">
|
||||
JSA分析矩阵
|
||||
</NTabPane>
|
||||
<NTabPane name="chap3" tab="SCL分析矩阵">
|
||||
SCL分析矩阵
|
||||
</NTabPane>
|
||||
</NTabs>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { getColorWithOpacity } from '@/utils/common';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
|
||||
const aiEnabled = ref<boolean>(true);
|
||||
// AI 辅助功能配置
|
||||
const aiConfig = ref<{address:string, mode:number|null, key:string,timeout:null|number}>({
|
||||
address:'',
|
||||
mode:null,
|
||||
key:'',
|
||||
timeout:null,
|
||||
})
|
||||
const modeOptions = ref<{label:string, value:number}[]>([
|
||||
{label:'kimi-k2(企业私有化部署)',value:1}
|
||||
])
|
||||
|
||||
// 变更类型
|
||||
const typeList = ref<{id:number, name:string, desc?:string}[]>([
|
||||
{id:1,name:'工艺', desc:'工艺参数、配方、操作条件、操作规程等工艺技术类变更'},
|
||||
{id:2,name:'设备', desc:'设备本体、附件、材质、规格、备件等硬件类变更'},
|
||||
{id:3,name:'管理', desc:'制度、职责、程序、组织与人员等管理类变更'},
|
||||
])
|
||||
// 变更等级
|
||||
const levelList = ref<{id:number, name:string, way:string,tools:{id:number, name:string}[]}[]>([
|
||||
{id:1,name:'一般', way:'等级评分< 20 分',tools:[{id:1,name:'AI预分析'},{id:2,name:'检查表法'}]},
|
||||
{id:2,name:'重要', way:'等级评分 > 20 分',tools:[{id:1,name:'AI预分析'},{id:2,name:'HAZOP'},{id:3,name:'JSA'},{id:4,name:'SCL'}]},
|
||||
])
|
||||
// 变更编号规则
|
||||
const ruleInfo = ref<{prefix:string, year:null|string, code:number|null, digit:number|null, rule:number|null}>({
|
||||
prefix:'MOC',
|
||||
year:null,
|
||||
code: null,
|
||||
digit: null,
|
||||
rule: null,
|
||||
})
|
||||
const yearOptions = ref<{label:string, value:string}[]>([
|
||||
{label:'四位年份(yyyy)',value:'yyyy'}
|
||||
])
|
||||
const codeOptions = ref<{label:string, value:number}[]>([
|
||||
{label:'申请部门装置代码',value:1}
|
||||
])
|
||||
const ruleOptions = ref<{label:string, value:number}[]>([
|
||||
{label:'按年度+装置代码重置',value:1}
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const toggle = (v: boolean) => {
|
||||
window.$message?.success(v ? "AI 辅助功能已启用" : "AI 辅助功能已关闭");
|
||||
aiEnabled.value = v;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NSpace vertical :size="16">
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<!-- AI 辅助功能 -->
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--success-color': themeStore.otherColor.success,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--success-bg': getColorWithOpacity(themeStore.otherColor.success, 0.1),
|
||||
'--warning-bg': getColorWithOpacity(themeStore.otherColor.warning, 0.1),
|
||||
}"
|
||||
>
|
||||
<p class=" text-base font-semibold border-b border-slate-100 p-3 flex items-center">
|
||||
<Icon icon="lucide:sparkles" class="size-14px text-violet-500 mr-1" />AI 辅助功能
|
||||
</p>
|
||||
<div class="py-3 px-4">
|
||||
<div class="rounded-lg border p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="text-sm font-medium">启用 AI 辅助</div>
|
||||
<NSwitch size="small" :value="aiEnabled" @update:value="toggle" />
|
||||
</div>
|
||||
<div class="mt-1 text-xs text-slate-500">
|
||||
开启后,变更申请界面显示「变更识别」按钮:AI 自动完成变更前后比较、生成变更申请表(均支持手动修改);关闭后全部内容手动填写。
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 flex items-center gap-2 rounded-lg px-3 py-2 text-xs"
|
||||
:class="aiEnabled ? 'bg-[var(--success-bg)] text-[var(--success-color)]' : 'bg-[var(--warning-bg)] text-[var(--warning-color)]'">
|
||||
<Icon v-if="aiEnabled" icon="material-symbols:check-circle-outline" class="size-16px" />
|
||||
<Icon v-else icon="proicons:alert-triangle" class="size-16px" />
|
||||
当前状态:{{ aiEnabled ? "已启用 —— 变更申请界面提供 AI 变更识别与申请表生成" : "已关闭 —— 变更申请界面为纯手动模式" }}
|
||||
</div>
|
||||
<div class="space-y-2 border rounded-md p-3 mt-3">
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">接口地址</p>
|
||||
<div class="flex-1">
|
||||
<NInput v-model:value="aiConfig.address" placeholder="请输入接口地址" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">模型</p>
|
||||
<div class="flex-1">
|
||||
<NSelect v-model:value="aiConfig.mode" :options="modeOptions" placeholder="请选择模型" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">API Key</p>
|
||||
<div class="flex-1">
|
||||
<NInput v-model:value="aiConfig.key" placeholder="请输入API Key" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">超时(秒)</p>
|
||||
<div class="flex-1">
|
||||
<NInputNumber v-model:value="aiConfig.timeout" :min="1" :show-button="false" :precision="0" placeholder="请输入超时时间" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<NButton size="small" type="primary" class="text-xs">测试连接</NButton>
|
||||
<NButton size="small" class="text-xs">保存配置</NButton>
|
||||
<NButton size="small" class="text-xs">
|
||||
<Icon icon="akar-icons:file" class="size-14px mr-1" />
|
||||
调用记录查询
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<!-- 变更类型设置(支持自定义) -->
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
|
||||
<div class="flex items-center justify-between text-base font-semibold border-b border-slate-100 p-3">
|
||||
<div class="flex items-center">
|
||||
<Icon icon="ep:setting" class="size-16px mr-1" />
|
||||
变更类型设置(支持自定义)
|
||||
</div>
|
||||
<NButton size="small" type="primary" class="text-xs">
|
||||
<Icon icon="ic:round-plus" class="size-16px" />新增类型
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="py-3 px-4">
|
||||
<div v-if="typeList.length" class="border rounded-md">
|
||||
<template v-for="(item,index) in typeList" :key="item.id">
|
||||
<div class="p-3 flex items-center gap-2" :class="{'border-t':index !== 0}">
|
||||
<div class="flex-1 flex gap-2">
|
||||
<NTag size="small" type="success">{{item.name}}</NTag>
|
||||
<p class="flex-1">{{item.desc}}</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<NButton text type="primary" class="text-xs">
|
||||
<Icon icon="akar-icons:edit" class="size-14px" />编辑
|
||||
</NButton>
|
||||
<NButton text type="error" class="text-xs">
|
||||
<Icon icon="ep:delete" class="size-12px" />删除
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else>
|
||||
<NEmpty description="暂无变更类型"></NEmpty>
|
||||
</div>
|
||||
<p class="mt-3 text-xs text-slate-400">每个类型可关联默认审批流程模板、材料清单模板和 PSSR 检查模板;历史变更单保留原类型快照,不受修改/删除影响。</p>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<!-- 变更等级设定(支持自定义) -->
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<div class="flex items-center justify-between text-base font-semibold border-b border-slate-100 p-3">
|
||||
<div class="flex items-center">
|
||||
<Icon icon="ep:setting" class="size-16px mr-1" />
|
||||
变更等级设定(支持自定义)
|
||||
</div>
|
||||
<NButton size="small" type="primary" class="text-xs">
|
||||
<Icon icon="ic:round-plus" class="size-16px" />新增等级
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="py-3 px-4">
|
||||
<div v-if="levelList.length" class="space-y-2">
|
||||
<div v-for="item in levelList" :key="item.id" class="border rounded-md p-3">
|
||||
<div class="flex items-center">
|
||||
<div class="flex-1 flex items-center gap-2">
|
||||
<NTag v-if="item.name==='一般'" size="small">{{item.name}}</NTag>
|
||||
<NTag v-else-if="item.name==='重要'" size="small" type="error">{{item.name}}</NTag>
|
||||
<p class="flex-1">判定方式:<b>{{item.way}}</b></p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<NButton text type="primary" class="text-xs">
|
||||
<Icon icon="akar-icons:edit" class="size-14px" />编辑
|
||||
</NButton>
|
||||
<NButton text type="error" class="text-xs">
|
||||
<Icon icon="ep:delete" class="size-12px" />删除
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap mt-2">
|
||||
<p>对应分析工具:</p>
|
||||
<div class="flex items-center flex-wrap gap-2">
|
||||
<NTag v-for="tool in item.tools" :key="tool.id" size="small" type="info">{{tool.name}}</NTag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<NEmpty description="暂无变更等级"></NEmpty>
|
||||
</div>
|
||||
<p class="mt-3 text-xs text-slate-400">等级决定审批流程、风险分析深度与会签范围;申请时系统按判定方式自动定级并推荐对应分析工具,支持人工改判留痕。勾选 HAZOP/JSA/SCL的风险定级规则见下方「风险矩阵设置」。</p>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
<!-- 变更编号规则 -->
|
||||
<NGi span="24 s:24 m:24 l:12">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<div class="flex items-center justify-between text-base font-semibold border-b border-slate-100 p-3">
|
||||
<div class="flex items-center">
|
||||
<Icon icon="ep:setting" class="size-16px mr-1" />
|
||||
变更编号规则
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-3 px-4">
|
||||
<div class="space-y-2">
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">编号前缀</p>
|
||||
<div class="flex-1">
|
||||
<NInput v-model:value="ruleInfo.prefix" placeholder="请输入编号前缀" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">年份格式</p>
|
||||
<div class="flex-1">
|
||||
<NSelect v-model:value="ruleInfo.year" :options="yearOptions" placeholder="请选择年份格式" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">装置代码段</p>
|
||||
<div class="flex-1">
|
||||
<NSelect v-model:value="ruleInfo.code" :options="codeOptions" placeholder="请选择装置代码段" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">流水号位数</p>
|
||||
<div class="flex-1">
|
||||
<NInputNumber v-model:value="ruleInfo.digit" :min="1" :show-button="false" :precision="0" placeholder="请输入流水号位数" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<p class="w-100px text-left">流水重置规则</p>
|
||||
<div class="flex-1">
|
||||
<NSelect v-model:value="ruleInfo.rule" :options="ruleOptions" placeholder="请选择流水重置规则" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center p-3 bg-[#f8fafc] rounded-md">
|
||||
<span>编号示例预览:</span>
|
||||
<span class="text-[var(--theme-color)]">MOC-2026-R01-0001</span>
|
||||
<NButton size="small" type="primary" class="text-xs ml-auto">保存规则</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-3 text-xs text-slate-400">保存草稿即预占编号,提交后正式生效;规则修改不影响历史单据编号。</p>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
<!-- 风险矩阵设置(按分析方法) -->
|
||||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive>
|
||||
<NGi span="24 s:24 m:24 l:24">
|
||||
<NCard :bordered="true" size="small" :content-style="{padding: 0}"
|
||||
:style="{
|
||||
borderRadius: themeStore.themeRadius + 'px',
|
||||
height: '100%',
|
||||
'--theme-color': themeStore.themeColor,
|
||||
'--warning-color': themeStore.otherColor.warning,
|
||||
'--error-color': themeStore.otherColor.error,
|
||||
}"
|
||||
>
|
||||
<div class="flex items-center justify-between text-base font-semibold border-b border-slate-100 p-3">
|
||||
<div class="flex items-center">
|
||||
<Icon icon="icon-park-outline:all-application" class="size-16px mr-1" />
|
||||
风险矩阵设置(按分析方法)
|
||||
</div>
|
||||
<NButton size="small" class="text-xs">
|
||||
<Icon icon="akar-icons:edit" class="size-14px mr-1" />
|
||||
维度分级定义
|
||||
</NButton>
|
||||
<NButton size="small" type="primary" class="text-xs">
|
||||
保存矩阵
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="py-3 px-4">
|
||||
<NTabs type="segment" animated>
|
||||
<NTabPane name="chap1" tab="HAZOP分析矩阵">
|
||||
HAZOP分析矩阵
|
||||
</NTabPane>
|
||||
<NTabPane name="chap2" tab="JSA分析矩阵">
|
||||
JSA分析矩阵
|
||||
</NTabPane>
|
||||
<NTabPane name="chap3" tab="SCL分析矩阵">
|
||||
SCL分析矩阵
|
||||
</NTabPane>
|
||||
</NTabs>
|
||||
</div>
|
||||
</NCard>
|
||||
</NGi>
|
||||
</NGrid>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user