提交格式验证修改

This commit is contained in:
2026-08-13 13:34:14 +08:00
parent 3e5157909c
commit 181b8902e1
27 changed files with 220 additions and 579 deletions
+2 -3
View File
@@ -33,14 +33,13 @@ const ROLES = [
{ id: "viewer", name: "非审批人员", person: "吴新", org: "相关部门", desc: "以信息查看为主,不参与变更流程" },
];
const mine = computed(() => CHANGES.filter((c) => c.applicant === ROLES[0].person));
interface MyRow { c: ChangeOrder | null; id: string; title: string; type: ChangeType; level: ChangeLevel; status: ChangeStatus; date: string; urgent: boolean; duration: "永久" | "临时" }
const myRows = computed(() => [
...mine.value.map((c:ChangeOrder) => ({ c, id: c.id, title: c.title, type: c.type, level: c.level, status: c.status, date: c.date, urgent: c.urgent, duration: c.duration })),
...MY_CLOSED.map((m) => ({ c: null, ...m, urgent: false })),
]);
const BIG_STAGES = ["申请审批", "实施与关闭", "变更关闭"];
const bigStageOf = (s: ChangeStatus) => (s === "审批中" ? 0 : s === "已关闭" ? 2 : 1);
const openRow = (row: MyRow) => {
const bigStageOf = (s: any) => (s === "审批中" ? 0 : s === "已关闭" ? 2 : 1);
const openRow = (row: any) => {
if (row.c){
emit("openChange", row.c);
} else {
+17 -7
View File
@@ -6,6 +6,7 @@ import {
CHANGES, DOC_TODO, LEVEL_COLOR, STATUS_COLOR, TEMP_WATCH, URGE_RECORDS,
countOpenStatus, type ChangeLevel, type ChangeOrder, type ChangeStatus, type ChangeType,
} from "@/typings/model";
import { getColorWithOpacity } from "@/utils/common";
const themeStore = useThemeStore();
@@ -27,6 +28,7 @@ const form = ref<ApplyForm>({
name: "", dept: "", mainChanges: [""], related: "", purposes: [], effect: "",
type: "", level: "", duration: "", urgent: false, date: "", restoreDate: "",
});
const tab = ref<string>("pre");
const TABS = [
{ id: "pre", name: "变更预识别", icon: 'lucide:sparkles' },
{ id: "form", name: "变更申请表", icon: 'akar-icons:file' },
@@ -36,8 +38,7 @@ const TABS = [
{ id: "accept", name: "验收评价", icon: 'material-symbols:check-circle-outline' },
{ id: "close", name: "变更关闭确认表", icon: 'quill:folder-open' },
];
const tab = ref<"pre" | "form" | "risk" | "train" | "pssr" | "accept" | "close">("pre");
const formGen = ref<"idle" | "generating" | "done">("idle");
const formGen = ref<string>("idle");
const confirmed = ref<Record<string, boolean>>({});
const blockedTabs = ref<string[]>([]);
@@ -47,10 +48,16 @@ const blockedTabs = ref<string[]>([]);
<NSpace vertical :size="16">
<!-- 发起变更 -->
<NCard :bordered="false" size="small" :style="{ borderRadius: themeStore.themeRadius + 'px', height: '100%' }">
<div class="sticky top-0 z-20 rounded-t-xl border-b bg-[#e8f2fd]">
<div
class="sticky top-0 z-20 border-b bg-[var(--bg-color)]"
:style="{
borderRadius: themeStore.themeRadius + 'px',
'--bg-color': getColorWithOpacity(themeStore.themeColor, 0.1)
}"
>
<div
class="flex flex-wrap items-center gap-x-3 gap-y-2 border-b px-4 py-2"
:style="{borderColor: themeStore.themeColor}"
class="flex flex-wrap items-center gap-x-3 gap-y-2 border-b px-4 py-2 border-[var(--border-color)]"
:style="{'--border-color': getColorWithOpacity(themeStore.themeColor, 0.2)}"
>
<span class="whitespace-nowrap text-sm font-medium text-slate-600">变更名称 <span class="text-red-500">*</span></span>
<NInput v-model:value="form.name" maxlength="28" show-count placeholder="AI 自动总结(28 字以内),可手动修改" class="!w-420px" />
@@ -60,8 +67,11 @@ const blockedTabs = ref<string[]>([]);
<div class="flex items-center gap-1 overflow-x-auto px-3 pt-2">
<div v-for="t in TABS" :key="t.id" @click="tab = t.id"
class="flex items-center gap-1.5 whitespace-nowrap px-3 py-2 text-sm transition cursor-pointer border hover:bg-white/60 rounded-t-lg"
:class="tab === t.id ? 'border-b-transparent border-[#ACC6E5] bg-white text-[var(--active-color)]':'border-transparent text-slate-500'"
:style="{'--active-color': themeStore.themeColor}"
:class="tab === t.id ? 'border-b-transparent border-[var(--border-color)] bg-white text-[var(--active-color)]':'border-transparent text-slate-500'"
:style="{
'--border-color': getColorWithOpacity(themeStore.themeColor, 0.3),
'--active-color': themeStore.themeColor
}"
>
<Icon :icon="t.icon" class="size-14px" />
{{ t.name }}
+2 -3
View File
@@ -1,8 +1,7 @@
<script setup lang="ts">
import type { ChangeStatus } from "../demo/model";
const props = defineProps<{ status: ChangeStatus }>();
const props = defineProps<{ status: any }>();
const BIG_STAGES = ["申请审批", "实施与关闭", "变更关闭"];
const bigStageOf = (s: ChangeStatus) => (s === "审批中" ? 0 : s === "已关闭" ? 2 : 1);
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;
+1 -19
View File
@@ -2,32 +2,14 @@
import { computed } from 'vue';
import type { Component } from 'vue';
import { getPaletteColorByNumber, mixColor } from '@sa/color';
import { loginModuleRecord } from '@/constants/app';
import { useAppStore } from '@/store/modules/app';
import { useThemeStore } from '@/store/modules/theme';
import PwdLogin from './modules/pwd-login.vue';
interface Props {
/** The login module */
module?: UnionKey.LoginModule;
}
const props = defineProps<Props>();
const appStore = useAppStore();
const themeStore = useThemeStore();
interface LoginModule {
label: App.I18n.I18nKey;
component: Component;
}
const moduleMap: Record<UnionKey.LoginModule, LoginModule> = {
'pwd-login': { label: loginModuleRecord['pwd-login'], component: PwdLogin },
};
const activeModule = computed(() => moduleMap[props.module || 'pwd-login']);
const activeModule = computed(() => ({ label: '密码登录', component: PwdLogin }));
const bgThemeColor = computed(() =>
themeStore.darkMode ? getPaletteColorByNumber(themeStore.themeColor, 600) : themeStore.themeColor
-7
View File
@@ -1,7 +0,0 @@
<script setup lang="ts"></script>
<template>
<LookForward />
</template>
<style scoped></style>