diff --git a/src/api/module/svc.ts b/src/api/module/svc.ts index b561cac..354ebdf 100644 --- a/src/api/module/svc.ts +++ b/src/api/module/svc.ts @@ -29,6 +29,26 @@ const APPLY = "/api/apply"; const FILE = "/api/file"; +/** 办件流程状态(文案与 Tag 色和用户面 hall 同口径) */ +export const APPLY_STATUS: Record = { + 0: "待提交", + 10: "审批中", + 20: "已完成", + 30: "已拒绝", + 40: "已撤回", +}; +export const APPLY_STATUS_COLOR: Record = { + 0: "default", + 10: "primary", + 20: "success", + 30: "error", + 40: "warning", +}; + +/** 事项发布状态(0 草稿 / 1 已发布 / 2 已下架) */ +export const ITEM_STATUS: Record = { 0: "草稿", 1: "已发布", 2: "已下架" }; +export const ITEM_STATUS_COLOR: Record = { 0: "default", 1: "success", 2: "warning" }; + /** GET 请求 */ function get(url: string, params?: Record): Method { return new Method("GET", alovaInstance, url, { params }); diff --git a/src/components/TablePageAlovaNew.vue b/src/components/TablePageAlovaNew.vue index 410ebdc..b02ffca 100644 --- a/src/components/TablePageAlovaNew.vue +++ b/src/components/TablePageAlovaNew.vue @@ -21,7 +21,7 @@ \ No newline at end of file + diff --git a/src/views/svc/ServiceItemEdit.vue b/src/views/svc/ServiceItemEdit.vue index 0de2878..2f09d86 100644 --- a/src/views/svc/ServiceItemEdit.vue +++ b/src/views/svc/ServiceItemEdit.vue @@ -17,6 +17,13 @@ import RichTextEditor from "@/components/RichTextEditor.vue"; const route = useRoute(); const router = useRouter(); const { currentSiteCode, loadSites } = useSite(); +const formRef = ref(null); + +// 必填校验(bsch应用页规范 §1:校验失败提示统一"请填写红色星号内容!") +const saveRules = { + itemCode: [{ required: true, message: "请填写红色星号内容!", trigger: "blur" }], + title: [{ required: true, message: "请填写红色星号内容!", trigger: "blur" }], +}; const form = ref>({ siteCode: "", @@ -109,6 +116,11 @@ async function uploadGuide(file: File) { } async function save(publishAfter: boolean) { + const valid = await new Promise(resolve => formRef.value?.validate(resolve)); + if (!valid) { + Message.warning("请填写红色星号内容!"); + return; + } const payload: SvcItemSaveRequest = { ...form.value, id: route.query.id ? Number(route.query.id) : undefined, @@ -139,195 +151,197 @@ onMounted(loadAll); diff --git a/src/views/svc/ServiceItemList.vue b/src/views/svc/ServiceItemList.vue index 4fdb2ac..34d0486 100644 --- a/src/views/svc/ServiceItemList.vue +++ b/src/views/svc/ServiceItemList.vue @@ -1,92 +1,101 @@ - -