diff --git a/src/api/base/server.ts b/src/api/base/server.ts index 3bc5938..a7a2a5a 100644 --- a/src/api/base/server.ts +++ b/src/api/base/server.ts @@ -103,3 +103,24 @@ export const jlzxFindByJlParamsApi = async (params: { jlId: string }) => { export const xxtsSaveByJlzxParamsApi = async (params: { jlId: string }) => { return await post("/api/xxts/saveByJlzxParams", 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/pages.json b/src/pages.json index 60dcde9..d3c7bb7 100644 --- a/src/pages.json +++ b/src/pages.json @@ -430,6 +430,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 +};