import http from '../request/index.js'; import { Base64 } from 'js-base64'; /** * api/calendar/Create?login=xx&userName=xx&sessionId=SESSION_ID * 创建日历 * @param {*} param0 */ export const create = (param = {}) => { const { type = "0", order = "1", isDefault = "", shopCalendarID = "", prjID = "", name = "" } = param const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/Create` return http.requestGungho({ method: "POST", header: {}, url, data: { type, order, isDefault, shopCalendarID, prjID, name }, }) } /** * api/calendar/Update?login=xx&userName=xx&sessionId=SESSION_ID * 修改日历 * @param {*} param0 */ export const update = (param = {}) => { const { id = "", type = "0", order = "1", isDefault = "", shopCalendarID = "", prjID = "", name = "" } = param const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/Update` return http.requestGungho({ method: "POST", header: {}, url, data: { id, type, order, isDefault, shopCalendarID, prjID, name }, }) } /** * api/calendar/Delete?login=xx&userName=xx&sessionId=SESSION_ID * 删除日历 * @param {*} id:日历ID */ export const del = (id) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/Delete?id=${encodeURI(id)}` // console.log(url) return http.requestGungho({ method: "POST", header: {}, url, data: { }, }) } /** * api/calendar/GetList?login=xx&userName=xx&sessionId=SESSION_ID * 获取我的日历列表 * @param {*} */ export const list = () => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/GetList` return http.requestGungho({ method: "GET", header: {}, url, }) } /** * api/calendar/GetOtherList?login=xx&userName=xx&sessionId=SESSION_ID * 得到其它人的日历列表, * @param {*} type 要得到的日历类型0 – 全部,0x01 – 关注,0x02 – 共享 */ /** */ export const otherList = (type = 0) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/GetOtherList?type=${type}` return http.requestGungho({ method: "GET", header: {}, url, }) } /** * api/calendar/GetSubordinateList?login=xx&userName=xx&sessionId=SESSION_ID * 得到直接下属的常规日历 */ /** */ export const subordinateList = () => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/GetSubordinateList` return http.requestGungho({ method: "GET", header: {}, url, }) } /** * api/calendar/GetPublishList?login=xx&userName=xx&sessionId=SESSION_ID * 得到其他人的公开日历列表 */ /** */ export const publishList = (userLogin = "") => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/GetPublishList?userLogin=${encodeURI(userLogin)}` return http.requestGungho({ method: "GET", header: {}, url, }) } /** * api/calendar/QueryPublish?login=xx&userName=xx&sessionId=SESSION_ID * 查询公开日历列表 * */ /** */ export const queryPublish = (param = {}) => { // sessionID; /*查询ID*/ // page; /*得到哪一页数据*/ // userLogin;/* 日历所属用户登录名,可选*/ // userName; /*日历所属用户名称,可选,只在未指定 UserLogin 有效*/ // name; /*日历名称部分内容,可选*/ // orderBy; /*排序*/ // numPerPage; /*返回条数*/ let { sessionID = "", page = "1", userLogin = "", userName = "", name = "", orderBy = "", numPerPage = 100 } = param const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/QueryPublish` return http.requestGungho({ method: "POST", header: {}, url, data: { sessionID, page, userLogin, userName, name, orderBy, numPerPage }, }) } /** * api/calendar/attend/Add?login=xx&userName=xx&sessionId=SESSION_ID * 说明新增日历共享者 * @param {*} id 日历ID * @param {*} userLogin 日历所属用户 * @returns */ export const attenAdd = (userLogin, id) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/attend/Add?id=${encodeURI(id)}&userLogin=${encodeURI(userLogin)}` return http.requestGungho({ method: "POST", header: {}, url, data: { }, }) } /** * api/calendar/attend/Remove?login=xx&userName=xx&sessionId=SESSION_ID * 移除关注日历 * @param {*} id 日历ID,多个以英文分号(;)分隔 */ /** */ export const attenRemove = (ids) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/attend/Remove?id=${encodeURI(ids)}` return http.requestGungho({ method: "POST", header: {}, url, data: { }, }) } /** * api/calendar/event/GetTagList?login=xx&userName=xx&sessionId=SESSION_ID * 说明:得到日历事件标签列表信息 * @param {*} param includeSysTag 是否包含系统标签 */ /** */ export const tagList = (includeSysTag = 1) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/event/GetTagList?includeSysTag=${includeSysTag}` return http.requestGungho({ method: "POST", header: {}, url, data: { }, }) } /** * api/calendar/event/Create?login=xx&userName=xx&sessionId=SESSION_ID * 说明:新增事件 * @param {*} param */ /** */ export const eventCreate = (param = {}) => { const { calendarId = "", calendarUser = "", startTime = "", endTime = "", isPrivate = "0", allDay = "0", repeat = "0", importance = "", place = "", tagName = "", bkColor = "", txtColor = "", remindID = "", taskID = "", rootID = "", name = "", note = "", group = "", remindDef = "", repeatInfo = {}, remindInfo = {}, } = param; const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/event/Create` return http.requestGungho({ method: "POST", header: {}, url, data: { calendarId, calendarUser, startTime, endTime, isPrivate, allDay, repeat, importance, place, tagName, bkColor, txtColor, remindID, taskID, rootID, name, note, group, remindDef, repeatInfo, }, }) } /** * api/calendar/event/Update?login=xx&userName=xx&sessionId=SESSION_ID * 说明:修改事件 * @param {*} param */ /** */ export const eventUpdate = (param = {}) => { const { eventId = "", calendarId = "", calendarUser = "", startTime = "", endTime = "", isPrivate = "0", allDay = "0", repeat = "0", importance = "", place = "", tagName = "", bkColor = "", txtColor = "", remindID = "", taskID = "", rootID = "", name = "", note = "", group = "", remindDef = "", repeatInfo = {}, remindInfo = {}, } = param; const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/event/Update` return http.requestGungho({ method: "POST", header: {}, url, data: { eventId, calendarId, calendarUser, startTime, endTime, isPrivate, allDay, repeat, importance, place, tagName, bkColor, txtColor, remindID, taskID, rootID, name, note, group, remindDef, repeatInfo, remindInfo, }, }) } /** * api/calendar/event/Delete?login=xx&userName=xx&sessionId=SESSION_ID * 说明:得到日历事件列表 * @id {*} 日历ID * @eventId {*} 事件ID */ /** */ export const eventDelete = (id, eventId) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/event/Delete?id=${encodeURI(id)}&eventId=${encodeURI(eventId)}` return http.requestGungho({ method: "POST", header: {}, url, data: { }, }) } /** * api/calendar/event/GetList?login=xx&userName=xx&sessionId=SESSION_ID * 说明:得到日历事件列表 * @param {*} param month 或 startDate,endDate */ /** */ export const eventList = (id, param = {}) => { const { month = "", startDate = "", endDate = "" } = param const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/event/GetList?id=${encodeURI(id)}` return http.requestGungho({ method: "POST", header: {}, url, data: { month, startDate, endDate }, }) } /** * api/calendar/event/GetInfo?login=xx&userName=xx&sessionId=SESSION_ID * 说明:得到日历事件列表 * @param {*} id 日历ID * @param {*} eventId 事件ID * @returns */ export const eventInfo = (id, eventId) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/event/GetInfo?id=${encodeURI(id)}&eventId=${encodeURI(eventId)}` return http.requestGungho({ method: "GET", header: {}, url, }) } /** * api/calendar/share/add?login=xx&userName=xx&sessionId=SESSION_ID * 添加共享人员 * @param {*} param */ /** */ export const shareAdd = (param = {}) => { let { id, users = [] } = param const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/share/Add` return http.requestGungho({ method: "POST", header: {}, url, data: { id, users }, }) } /** * api/calendar/share/Get?login=xx&userName=xx&sessionId=SESSION_ID * 说明:得到日历的共享者信息 * @param {*} id 日历ID * @returns */ export const shareGet = (id) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/share/Get?id=${encodeURI(id)}` return http.requestGungho({ method: "GET", header: {}, url, }) } /** * api/calendar/share/Remove?login=xx&userName=xx&sessionId=SESSION_ID * 说明:删除日历共享者 * @param {*} id 日历ID * @returns */ export const shareRemove = (id, userLogins) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/share/Remove?id=${encodeURI(id)}&userLogins=${encodeURI(userLogins)}` return http.requestGungho({ method: "POST", header: {}, url, data: { }, }) } /** * api/calendar/attend/GetList?login=xx&userName=xx&sessionId=SESSION_ID * 说明:我关注列表 * @param {*} id 日历ID * @returns */ export const attenList = () => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/calendar/attend/GetList` return http.requestGungho({ method: "GET", header: {}, url, }) }