From fe0f251c714c88cc1eaf20f5d158f1b6c93555e9 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Wed, 19 Nov 2025 15:09:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/dashboard.js | 21 ++ pages.json | 6 + pages/notice/list/index.vue | 372 ++++++++++++++++++++++++++++++------ 3 files changed, 338 insertions(+), 61 deletions(-) diff --git a/api/dashboard.js b/api/dashboard.js index cd80fed..6d1624a 100644 --- a/api/dashboard.js +++ b/api/dashboard.js @@ -112,3 +112,24 @@ export const getNoticeDetail = (id) => { }); }; +/** + * 新增公告 + * @param {Object} payload 公告数据 + * @param {string} payload.title 标题 + * @param {string} payload.content 内容 + * @param {string} payload.level 重要程度:1-一般 2-重要 3-紧急 + * @param {boolean} payload.top 是否置顶 + * @param {string} payload.type 类型:1-通知 2-公告 + * @param {Array} payload.receiveUserIds 接收用户ID集合 + * @param {Array} payload.receiveDeptIds 接收部门ID集合 + * @param {string|Array} payload.attaches 附件,可为字符串或数组 + * @returns {Promise} + */ +export const createNotice = (payload) => { + return uni.$uv.http.post('bst/notice', payload, { + custom: { + auth: true + } + }); +}; + diff --git a/pages.json b/pages.json index d42dd4e..09a8c98 100644 --- a/pages.json +++ b/pages.json @@ -157,6 +157,12 @@ "navigationBarTitleText": "公告列表" } }, + { + "path": "pages/notice/create/index", + "style": { + "navigationBarTitleText": "新增公告" + } + }, { "path": "pages/notice/detail/index", "style": { diff --git a/pages/notice/list/index.vue b/pages/notice/list/index.vue index 429b1c6..5bba973 100644 --- a/pages/notice/list/index.vue +++ b/pages/notice/list/index.vue @@ -99,17 +99,37 @@ @scrolltolower="handleScrollToLower" > - - - - - - + + + @@ -198,11 +251,12 @@ @@ -445,6 +595,106 @@ onMounted(() => { gap: 12px; } +.admin-action-row { + display: flex; + gap: 12px; + margin-bottom: 12px; +} + +.notice-table { + background: #fff; + border-radius: 12px; + overflow: hidden; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); +} + +.table-header, +.table-row { + display: grid; + grid-template-columns: 0.6fr 1fr 1fr 2fr; + gap: 12px; + padding: 14px 16px; + align-items: center; +} + +.table-header { + background: #f8fafc; + font-weight: 600; + color: #333; +} + +.table-row { + border-top: 1px solid #f0f0f0; + background: #fff; + transition: background 0.2s; +} + +.table-row:active { + background: #f5f5f5; +} + +.table-row.selected { + background: #f0f6ff; +} + +.table-cell { + font-size: 14px; + color: #555; +} + +.table-cell.select { + display: flex; + align-items: center; + justify-content: center; +} + +.checkbox-indicator { + width: 18px; + height: 18px; + border-radius: 4px; + border: 2px solid #c0c4cc; + background: #fff; + transition: all 0.2s; +} + +.checkbox-indicator.checked { + border-color: #2885ff; + background: #2885ff; + position: relative; +} + +.checkbox-indicator.checked::after { + content: ''; + position: absolute; + top: 2px; + left: 4px; + width: 5px; + height: 9px; + border: 2px solid #fff; + border-top: 0; + border-left: 0; + transform: rotate(45deg); +} + +.table-cell.title { + font-weight: 500; + color: #333; +} + +.table-cell.title.pinned { + color: #f56c6c; +} + +.table-cell.level { + color: #ff9800; +} + +.table-cell.time, +.table-cell.creator { + font-size: 13px; + color: #888; +} + .notice-card { background: #fff; border-radius: 12px;