From 0ee8dc2d1846f3bf12c180b8830b603231e82780 Mon Sep 17 00:00:00 2001 From: ywyonui Date: Tue, 8 Jul 2025 20:33:47 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=B0=83=E6=95=B4=E5=BE=85=E5=8A=9E?= =?UTF-8?q?=EF=BC=8C=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=85=B7=E4=BD=93=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=A1=B5=E9=9D=A2=202=E3=80=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AD=A6=E7=94=9F=E8=AF=B7=E5=81=87=E7=9A=84=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/server.ts | 21 +++ src/api/system/login/index.ts | 12 +- src/config.ts | 2 +- src/pages.json | 7 + src/pages/base/message/index.vue | 151 ++++++++------------ src/pages/base/xs/qj/sp.vue | 238 +++++++++++++++++++++++++++++++ src/store/modules/data.ts | 7 + src/utils/dateUtils.ts | 27 ++++ 8 files changed, 369 insertions(+), 96 deletions(-) create mode 100644 src/pages/base/xs/qj/sp.vue create mode 100644 src/utils/dateUtils.ts diff --git a/src/api/base/server.ts b/src/api/base/server.ts index dc618aa..d2a148a 100644 --- a/src/api/base/server.ts +++ b/src/api/base/server.ts @@ -80,3 +80,24 @@ export const jsdXkXsListApi = async (params: any) => { export const jsdXkdmListApi = async (params: any) => { return await post("/mobile/js/xkdm/add", params); }; + +// 获取待办列表 +export const dbListApi = async (params: any) => { + return await get("/api/db/findPage", params); +}; + +// 处理待办 +export const dbBlApi = async (params: any) => { + return await post("/api/db/bl", params); +}; + +// 查询学生请假信息 +export const xsQjFindByIdApi = async (params: any) => { + return await get("/api/xsQj/findById", params); +}; + +// 学生请假审批 +export const xsQjSpApi = async (params: any) => { + return await post("/api/xsQj/sp", params); +}; + diff --git a/src/api/system/login/index.ts b/src/api/system/login/index.ts index 7a0ed69..49ee218 100644 --- a/src/api/system/login/index.ts +++ b/src/api/system/login/index.ts @@ -3,9 +3,9 @@ import { get, post } from "@/utils/request"; //密码登录接口 export const loginPass = async (param: { - username: string; - password: string; - openId: number | string; + username?: string; + password?: string; + openId?: number | string; }) => { return await post( "/userlogin/check?username=" + @@ -19,9 +19,9 @@ export const loginPass = async (param: { }; //验证码登录接口 export const loginCode = async (param: { - phone: string | number; - code: string | number; - openId: number | string; + phone?: string | number; + code?: string | number; + openId?: number | string; }) => { return await post("/open/sms/checkCode", param); }; diff --git a/src/config.ts b/src/config.ts index 7b4929d..f919987 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,4 +1,4 @@ -const ip: string = "192.168.239.1:8897"; +const ip: string = "127.0.0.1:8897"; // const ip: string = "yufangzc.com"; const fwqip: string = "yufangzc.com"; //打包服务器接口代理标识 diff --git a/src/pages.json b/src/pages.json index 6711c53..640bd24 100644 --- a/src/pages.json +++ b/src/pages.json @@ -423,6 +423,13 @@ "navigationBarTitleText": "学生点名", "enablePullDownRefresh": false } + }, + { + "path": "pages/base/xs/qj/sp", + "style": { + "navigationBarTitleText": "学生请假审批", + "enablePullDownRefresh": false + } } ], "globalStyle": { diff --git a/src/pages/base/message/index.vue b/src/pages/base/message/index.vue index f031862..743299d 100644 --- a/src/pages/base/message/index.vue +++ b/src/pages/base/message/index.vue @@ -5,15 +5,15 @@ 待办 已办 @@ -22,20 +22,15 @@ @@ -44,101 +39,77 @@ @@ -258,6 +229,7 @@ const goToDetail = (data: any) => { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; + line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } @@ -265,10 +237,8 @@ const goToDetail = (data: any) => { .card-meta { font-size: 12px; color: #999; - - text { - margin-right: 10px; - } + display: flex; + justify-content: space-between; } } @@ -278,26 +248,29 @@ const goToDetail = (data: any) => { align-items: center; justify-content: space-between; flex-shrink: 0; // 防止被压缩 + flex: 0 0 75px; .tag { - padding: 5px 10px; border-radius: 4px; font-size: 13px; font-weight: bold; color: #ffffff; - margin-bottom: 10px; white-space: nowrap; + display: flex; + align-items: center; + justify-content: center; + flex: 1 0 1px; + width: 100%; - &.notice { + &.db-xs-qj { background-color: #447ade; } - &.task { + &.db-js-qj { background-color: #19be6b; } - // 添加新的标签样式示例 - &.approval { + &.db-task { background-color: #ff9f0a; // 橙色 } diff --git a/src/pages/base/xs/qj/sp.vue b/src/pages/base/xs/qj/sp.vue new file mode 100644 index 0000000..da94295 --- /dev/null +++ b/src/pages/base/xs/qj/sp.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/src/store/modules/data.ts b/src/store/modules/data.ts index 3425a3a..056fc40 100644 --- a/src/store/modules/data.ts +++ b/src/store/modules/data.ts @@ -4,6 +4,7 @@ export const useDataStore = defineStore({ id: "data", state: () => ({ data: {}, + db: {}, global: {}, file: {}, }), @@ -11,6 +12,9 @@ export const useDataStore = defineStore({ getData(): any { return this.data; }, + getDb(): any { + return this.db; + }, getGlobal(): any { return this.global; }, @@ -22,6 +26,9 @@ export const useDataStore = defineStore({ setData(data: any) { this.data = data; }, + setDb(data: any) { + this.db = data; + }, setGlobal(data: any) { this.global = data; }, diff --git a/src/utils/dateUtils.ts b/src/utils/dateUtils.ts new file mode 100644 index 0000000..9ad2f84 --- /dev/null +++ b/src/utils/dateUtils.ts @@ -0,0 +1,27 @@ +import dayjs from "dayjs"; +const getTimeAgo = (time: string) => { + const now = dayjs(); + const inputTime = dayjs(time); + const diffInSeconds = now.diff(inputTime, 'second'); + + if (diffInSeconds < 60) { + return `${diffInSeconds}秒前`; + } + + const diffInMinutes = Math.floor(diffInSeconds / 60); + if (diffInMinutes < 60) { + return `${diffInMinutes}分钟前`; + } + + const diffInHours = Math.floor(diffInMinutes / 60); + if (diffInHours < 24) { + return `${diffInHours}小时前`; + } + + const diffInDays = Math.floor(diffInHours / 24); + return `${diffInDays}天前`; +}; + +export { + getTimeAgo +};