From efc0c3a697969503634138d7881543f4099b81ca Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 20 五月 2026 13:32:09 +0800
Subject: [PATCH] 审批模板导入只能从已有模板导入
---
src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js | 179 +++--------------------------------------------------------
1 files changed, 10 insertions(+), 169 deletions(-)
diff --git a/src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js b/src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js
index edc7f7e..462740e 100644
--- a/src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js
+++ b/src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js
@@ -42,17 +42,8 @@
export const STORAGE_KEY = "oa_enterprise_news_v1";
-/** 婕旂ず鐢ㄧ洰鏍囧彈浼楋紙鍚庢湡瀵规帴缁勭粐鏋舵瀯锛� */
-export const MOCK_AUDIENCE = [
- { userId: "u1", employeeNo: "zhangsan", name: "寮犱笁", deptName: "鐮斿彂閮�", isManagement: false },
- { userId: "u2", employeeNo: "lisi", name: "鏉庡洓", deptName: "鐮斿彂閮�", isManagement: false },
- { userId: "u3", employeeNo: "wangwu", name: "鐜嬩簲", deptName: "琛屾斂閮�", isManagement: false },
- { userId: "u4", employeeNo: "zhaoliu", name: "璧靛叚", deptName: "閿�鍞儴", isManagement: false },
- { userId: "u5", employeeNo: "sunqi", name: "瀛欎竷", deptName: "璐㈠姟閮�", isManagement: false },
- { userId: "u6", employeeNo: "zhouba", name: "鍛ㄥ叓", deptName: "鎬荤粡鍔�", isManagement: true },
- { userId: "u7", employeeNo: "wujiu", name: "鍚翠節", deptName: "鎬荤粡鍔�", isManagement: true },
- { userId: "u8", employeeNo: "zhengshi", name: "閮戝崄", deptName: "浜哄姏璧勬簮閮�", isManagement: false },
-];
+/** 鐩爣鍙椾紬锛堝鎺ョ粍缁囨灦鏋� API 鍓嶄负绌猴級 */
+export const MOCK_AUDIENCE = [];
const DEPT_OPTIONS = [
{ value: "101", label: "鐮斿彂閮�" },
@@ -124,13 +115,12 @@
}
function buildReadRecords(readUserIds = []) {
- const set = new Set(readUserIds);
- return MOCK_AUDIENCE.map((u) => ({
- userId: u.userId,
- employeeNo: u.employeeNo,
- name: u.name,
- deptName: u.deptName,
- readAt: set.has(u.userId) ? dayjs().subtract(2, "day").format("YYYY-MM-DD HH:mm:ss") : "",
+ return (readUserIds || []).map((userId) => ({
+ userId,
+ employeeNo: "",
+ name: "",
+ deptName: "",
+ readAt: "",
lastRemindAt: "",
}));
}
@@ -149,158 +139,9 @@
};
}
+/** @deprecated 涓嶅啀娉ㄥ叆婕旂ず鏁版嵁锛屽垵濮嬪垪琛ㄤ负绌� */
export function createInitialMockNews() {
- const policyContent =
- "<p><strong>2026 骞磋�冨嫟绠$悊鍒跺害锛堣瘯琛岋級</strong></p><p>涓�銆佷笂鐝椂闂� 9:00锛屽脊鎬ф墦鍗$獥鍙� 8:30鈥�9:30銆�</p><p>浜屻�佽鍋囬』鎻愬墠鍦� OA 鎻愪氦瀹℃壒銆�</p><p>涓夈�佹湰鍒跺害鑷� 2026-06-01 璧锋墽琛屻��</p>";
- const cultureContent =
- "<p>2026 浼佷笟骞翠細鍦嗘弧钀藉箷锛佹劅璋㈡瘡涓�浣嶅悓浜嬬殑鍙備笌锛屼互涓嬩负绮惧僵鐬棿鍥鹃泦銆�</p>";
- const strategyContent =
- "<p><strong>2026 涓嬪崐骞存垬鐣ユ柟鍚戯紙鍐呴儴锛�</strong></p><p>鑱氱劍鏍稿績浜у搧绾垮崌绾т笌娴峰甯傚満鎷撳睍锛屽叿浣撴寚鏍囪闄勪欢銆�</p>";
-
- const policyRow = {
- id: "news_1",
- newsNo: "EN202605150001",
- title: "鍏充簬鍙戝竷鏂拌�冨嫟鍒跺害鐨勯�氱煡",
- summary: "璇峰叏浣撳憳宸ヨ鐪熼槄璇诲苟纭鐭ユ倝锛岃嚜 2026-06-01 璧锋墽琛屻��",
- newsType: "policy",
- layoutTemplate: "policy",
- contentHtml: policyContent,
- coverImage: "",
- mediaList: [],
- attachmentList: [{ name: "鑰冨嫟鍒跺害2026.pdf", url: "/mock/attendance-policy.pdf" }],
- editorRole: "hr",
- reviewerRole: "admin",
- readScope: "all",
- targetDeptIds: [],
- targetUserIds: [],
- publishStatus: "published",
- publisherName: "浜哄姏璧勬簮閮�",
- publishTime: "2026-05-15 10:00:00",
- readRecords: buildReadRecords(["u6", "u7", "u8"]),
- remindLogs: [],
- likes: [],
- comments: [],
- versions: [
- {
- versionNo: 1,
- title: "鍏充簬鍙戝竷鏂拌�冨嫟鍒跺害鐨勯�氱煡锛堝緛姹傛剰瑙佺锛�",
- summary: "寰佹眰鎰忚绋�",
- contentHtml: "<p>寰佹眰鎰忚绋匡細涓婄彮鏃堕棿 9:00鈥︹��</p>",
- newsType: "policy",
- publishTime: "2026-05-10 09:00:00",
- archivedAt: "2026-05-15 09:55:00",
- changeNote: "瀹氱鍙戝竷",
- publisherName: "浜哄姏璧勬簮閮�",
- },
- ],
- versionNo: 2,
- requireReadConfirm: true,
- createTime: "2026-05-10 09:00:00",
- updateTime: "2026-05-15 10:00:00",
- };
-
- const cultureRow = {
- id: "news_2",
- newsNo: "EN202605200002",
- title: "2026 浼佷笟骞翠細绮惧僵鐬棿",
- summary: "骞翠細鍥鹃泦涓婄嚎锛屾杩庣偣璧炵暀瑷�锛屽叡寤轰紒涓氭枃鍖栥��",
- newsType: "culture",
- layoutTemplate: "gallery",
- contentHtml: cultureContent,
- coverImage: "/mock/annual-cover.jpg",
- mediaList: [
- { type: "image", name: "寮�鍦�.jpg", url: "/mock/annual-1.jpg" },
- { type: "image", name: "棰佸.jpg", url: "/mock/annual-2.jpg" },
- { type: "video", name: "骞翠細鑺辩诞.mp4", url: "/mock/annual.mp4" },
- ],
- attachmentList: [],
- editorRole: "dept_manager",
- reviewerRole: "admin",
- readScope: "all",
- targetDeptIds: [],
- targetUserIds: [],
- publishStatus: "published",
- publisherName: "琛屾斂閮�",
- publishTime: "2026-05-20 14:30:00",
- readRecords: buildReadRecords(["u1", "u2", "u3", "u4", "u5", "u6", "u7"]),
- remindLogs: [],
- likes: [
- { userId: "u1", name: "寮犱笁", time: "2026-05-20 15:01:00" },
- { userId: "u2", name: "鏉庡洓", time: "2026-05-20 15:05:00" },
- { userId: "u4", name: "璧靛叚", time: "2026-05-20 16:20:00" },
- ],
- comments: [
- { id: "c1", userId: "u1", name: "寮犱笁", content: "鑺傜洰澶簿褰╀簡锛�", time: "2026-05-20 15:10:00" },
- { id: "c2", userId: "u3", name: "鐜嬩簲", content: "鏈熷緟鏄庡勾鍐嶈仛锛�", time: "2026-05-20 17:00:00" },
- ],
- versions: [],
- versionNo: 1,
- requireReadConfirm: false,
- createTime: "2026-05-20 14:00:00",
- updateTime: "2026-05-20 14:30:00",
- };
-
- const strategyRow = {
- id: "news_3",
- newsNo: "EN202605220003",
- title: "2026 涓嬪崐骞存垬鐣ヨ鍒掕鐐�",
- summary: "浠呴檺绠$悊灞傞槄璇伙紝璇峰嬁瀵瑰浼犳挱銆�",
- newsType: "announcement",
- layoutTemplate: "briefing",
- contentHtml: strategyContent,
- coverImage: "",
- mediaList: [],
- attachmentList: [{ name: "鎴樼暐鎸囨爣.pdf", url: "/mock/strategy.pdf" }],
- editorRole: "admin",
- reviewerRole: "admin",
- readScope: "management",
- targetDeptIds: [],
- targetUserIds: [],
- publishStatus: "published",
- publisherName: "鎬荤粡鍔�",
- publishTime: "2026-05-22 09:00:00",
- readRecords: buildReadRecords(["u6", "u7"]),
- remindLogs: [],
- likes: [],
- comments: [],
- versions: [],
- versionNo: 1,
- requireReadConfirm: false,
- createTime: "2026-05-22 08:30:00",
- updateTime: "2026-05-22 09:00:00",
- };
-
- const industryDraft = {
- id: "news_4",
- newsNo: "EN202605250004",
- title: "鍒堕�犱笟鏁板瓧鍖栬浆鍨嬭秼鍔跨畝鎶�",
- summary: "琛屼笟鍔ㄦ�佽崏绋匡紝寰呯鐞嗗憳瀹℃牳鍚庡彂甯冦��",
- newsType: "industry",
- layoutTemplate: "standard",
- contentHtml: "<p>鏈湡绠�鎶ユ⒊鐞嗗伐涓氫簰鑱旂綉涓� AI 璐ㄦ搴旂敤妗堜緥鈥︹��</p>",
- coverImage: "",
- mediaList: [],
- attachmentList: [],
- editorRole: "editor",
- reviewerRole: "admin",
- readScope: "all",
- targetDeptIds: [],
- targetUserIds: [],
- publishStatus: "pending_review",
- publisherName: "甯傚満閮�",
- publishTime: "",
- readRecords: [],
- remindLogs: [],
- likes: [],
- comments: [],
- versions: [],
- versionNo: 1,
- requireReadConfirm: false,
- createTime: "2026-05-25 11:00:00",
- updateTime: "2026-05-25 11:00:00",
- };
-
- return [policyRow, cultureRow, strategyRow, industryDraft];
+ return [];
}
export function loadStoredNews() {
--
Gitblit v1.9.3