整个路由布局修改

This commit is contained in:
2026-08-26 09:29:46 +08:00
parent 250cf6b22e
commit c78f0660f7
30 changed files with 230 additions and 261 deletions
-18
View File
@@ -1,18 +0,0 @@
<script setup lang="ts">
// 单元格点击编辑器(风险记录表/插件表格通用)
import { ref } from "vue";
const props = defineProps<{ v: string }>();
const emit = defineEmits<{ update: [x: string] }>();
const ed = ref(false);
const val = ref(props.v);
const start = () => { val.value = props.v; ed.value = true; };
const done = () => { ed.value = false; if (val.value !== props.v) emit("update", val.value); };
</script>
<template>
<NInput v-if="ed" class="text-xs" v-model:value="val" type="textarea" autofocus rows="3" @blur="done" />
<p v-else @click="start" title="点击修改"
class="cursor-pointer w-full rounded px-1 py-0.5 text-left text-xs leading-relaxed text-slate-700 transition hover:bg-[#EAF0F9]">
<template v-if="v">{{ v }}</template>
<span v-else class="text-slate-300">请输入</span>
</p>
</template>
-19
View File
@@ -1,19 +0,0 @@
<script setup lang="ts">
const props = defineProps<{ status: any }>();
const BIG_STAGES = ["申请审批", "实施与关闭", "变更关闭"];
const bigStageOf = (s: any) => (s === "审批中" ? 0 : s === "已关闭" ? 2 : 1);
const cur = bigStageOf(props.status);
const pct = ((cur + 1) / BIG_STAGES.length) * 100;
const size = 34, stroke = 4, r = (size - stroke) / 2, c = 2 * Math.PI * r;
const title = `阶段进度 ${cur + 1}/${BIG_STAGES.length}:${BIG_STAGES.slice(0, cur + 1).join(" → ")}${cur < BIG_STAGES.length - 1 ? " → …" : ""}`;
</script>
<template>
<span class="relative inline-flex shrink-0 items-center justify-center" :style="{ width: size + 'px', height: size + 'px' }" :title="title">
<svg :width="size" :height="size" class="-rotate-90">
<circle :cx="size / 2" :cy="size / 2" :r="r" stroke="#E2E8F0" :stroke-width="stroke" fill="none" />
<circle :cx="size / 2" :cy="size / 2" :r="r" stroke="#2080f0" :stroke-width="stroke" fill="none"
:stroke-dasharray="c" :stroke-dashoffset="c * (1 - pct / 100)" stroke-linecap="round" />
</svg>
<span class="absolute inset-0 flex items-center justify-center text-[9px] font-bold text-[#2080f0] dark:text-white">{{ cur + 1 }}/3</span>
</span>
</template>
-36
View File
@@ -1,36 +0,0 @@
<script setup lang="ts">
// 变更后单元格蓝色高亮
import { computed } from "vue";
import { useThemeStore } from '@/store/modules/theme';
const themeStore = useThemeStore();
const props = defineProps<{ text: string; hl?: string[] }>();
interface Seg { t: string; hit: boolean }
const segs = computed<Seg[]>(() => {
const text = props.text;
if (!props.hl || props.hl.length === 0) return [{ t: text, hit: false }];
const out: Seg[] = [];
let rest = text;
const hls = [...props.hl].sort((a, b) => b.length - a.length);
while (rest.length) {
let idx = -1, kw = "";
for (const h of hls) {
const i = rest.indexOf(h);
if (i >= 0 && (idx < 0 || i < idx)) { idx = i; kw = h; }
}
if (idx < 0) { out.push({ t: rest, hit: false }); break; }
if (idx > 0) out.push({ t: rest.slice(0, idx), hit: false });
out.push({ t: kw, hit: true });
rest = rest.slice(idx + kw.length);
}
return out;
});
</script>
<template>
<span class="whitespace-pre-line"><template v-for="(s, i) in segs" :key="i">
<mark
v-if="s.hit" class="rounded bg-blue-100 px-0.5"
:style="{color: themeStore.themeColor}"
>{{ s.t }}</mark>
<template v-else>{{ s.t }}</template></template></span>
</template>