import http from '../request/index.js'; import { Base64 } from 'js-base64'; /** * api/PrjEvent/QueryList * 查询项目事件列表 * @param {*} */ export const queryList = (param = {}) => { const { page, size, sql, attrs, order, } = param const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/QueryList` return http.requestGungho({ method: "POST", header: {}, url, data: { page, size, sql: Base64.encode(sql), attrs, order, }, }) } /** * api/PrjEvent/Create?login=xx&userName=xx&sessionId=SESSION_ID * 创建项目事件 * @param {*} */ export const create = (param = {}) => { const app = getApp() var header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/Create` const { prjid, type, verid = "", version = "", classify = "", quadrant = "", planclose = "", takeon = "", takeonname = "", respdepid = "", respdepname = "", content = "", title, tag = "", user = [], attach = [], attr = [], } = param return http.requestGungho({ method: "POST", header: {}, url, data: { prjid, type, verid, version, classify, quadrant, planclose, takeon, takeonname, respdepid, respdepname, content, title, tag, attr, user, attach, } }) } /** * api/PrjEvent/GetInfo?login=xx&userName=xx&sessionId=SESSION_ID * 设得到项目事件信息 * @param {*} * id:项目事件ID */ export const getInfo = (id) => { const app = getApp() var header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/GetInfo?eventid=${encodeURI(id)}` return http.requestGungho({ method: "GET", header: {}, url, }) } /** * api/PrjEvent/CheckIsAtten?login=xx&userName=xx&sessionId=SESSION_ID * 检查事件是否被我关注 * * @param {*} id */ export const checkIsAtten = (id) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/CheckIsAtten?id=${encodeURI(id)}` return http.requestGungho({ method: "GET", header: {}, url, }) } /** * api/PrjEvent/SetAttention?login=xx&userName=xx&sessionId=SESSION_ID * 设置事件关注 * id –任务ID * prjid –输出文件定义,为空表示删除原输出定义 * isatten 0,取消 ,1加入 * * @param {*} id */ export const setAttention = (param = {}) => { const app = getApp() const { id, prjId = "", isAtten = "0" } = param; let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetAttention?id=${encodeURI(id)}&prjid=${encodeURI(prjId)}&isatten=${encodeURI(isAtten)}` return http.requestGungho({ method: "POST", header: {}, url, data: { }, }) } /** * api/PrjEvent/Delete?login=xx&userName=xx&sessionId=SESSION_ID * 删除项目事件 * @param {*} id */ export const del = (id) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/Delete` return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, }, }) } /** * api/PrjEvent/SetState?login=xx&userName=xx&sessionId=SESSION_ID * 设置事件状态 提出,处理中,不处理,暂不处理,关闭(就是完成),确定,检查, * @param {*} */ export const setState = (id, state = "") => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetState` return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, state }, }) } /** * api/PrjEvent/SetTaskId?login=xx&userName=xx&sessionId=SESSION_ID * 设置事件关联任务ID,事件设置为处理中会生成任务,进行关联 * @param {*} */ export const setTaskId = (id, taskId = "") => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetTaskId` return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, taskId, }, }) } /** * api/PrjEvent/SetTitle?login=xx&userName=xx&sessionId=SESSION_ID * 设置项目事件标题 * @param {*} id */ export const setTitle = (param = {}) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetTitle` const { id, title } = param; return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, title }, }) } /** * api/PrjEvent/SetContent?login=xx&userName=xx&sessionId=SESSION_ID * 设置项目事件内容 * @param {*} id */ export const setContent = (param = {}) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetContent` const { id, content } = param; return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, content }, }) } /** * api/PrjEvent/SetTakeon?login=xx&userName=xx&sessionId=SESSION_ID * 设置项目事件执行人信息 * @param {*} */ export const setTakeon = (param = {}) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetTakeon` const { id = "", takeon = "", takeonname = "" } = param; return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, takeon, takeonname, }, }) } /** * api/PrjEvent/SetRelPerson?login=xx&userName=xx&sessionId=SESSION_ID * 设置项目事件相关人信息 * @param {*} id */ export const setRelPerson = (param = {}) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetRelPerson` const { id, user = [], //[{login,name}] } = param; return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, user, }, }) } /** * api/PrjEvent/SetUrgentImportance?login=xx&userName=xx&sessionId=SESSION_ID * 设置重要度信息信息 * 0:"不重要不紧急",1:重要不紧急,2:紧急不重要,3:重要紧急 * @param {*} id */ export const setUrgentImportance = (param = {}) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetUrgentImportance` const { id, quadrant = "0" } = param; return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, quadrant }, }) } /** * api/PrjEvent/SetDue?login=xx&userName=xx&sessionId=SESSION_ID * 设置项目事件的截止日期 * @param {*} id */ export const setDue = (param = {}) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEvent/SetDue` const { id, duedate = "", } = param; return http.requestGungho({ method: "POST", header: {}, url, data: { eventid: id, duedate } }) } /** * api/PrjEventAttach/GetList?login=xx&userName=xx&sessionId=SESSION_ID * 得到项目事件附件列表 * @param {*} param0 */ export const attachGetList = (id) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEventAttach/GetList?eventId=${encodeURI(id)}` return http.requestGungho({ method: "POST", header, url, data: {} }) } /** * api/PrjEventAttach/Add?login=xx&userName=xx&sessionId=SESSION_ID * 新增项目事件附件 * @param {*} param0 */ export const attachAdd = (param = {}) => { const app = getApp() let url = `${app.globalData.apiurl.gungho}/api/PrjEventAttach/Add` return http.requestGungho({ method: "POST", header:{}, url, data:param }) } /** * api/PrjEventAttach/Remove?login=xx&userName=xx&sessionId=SESSION_ID * 删除项目事件附件 * @param {*} param0 * cleanFile 是否同时清理掉此文件,默认:0 – 不清理 */ export const attachRemove = (param = {}) => { const { id, fileId, cleanFile = "1" } = param; const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEventAttach/Remove` return http.requestGungho({ method: "POST", header, url, data: { eventId: id, fileId, cleanFile } }) } /** * api/PrjEventLog/GetAnalysisList * 得到项目事件 分析、措施、总结 列表 * @param {*} id 项目事件ID * @param {*} type 类型:分析、措施、总结 * @param {*} isasc 是否按日期顺序,默认是 日期倒序 */ export const logGetAnalysisList = (param = {}) => { const app = getApp() const { id, type = "", isasc = 1, } = param; let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEventLog/GetAnalysisList` return http.requestGungho({ method: "POST", header, url, data: { eventid: id, type, isasc, } }) } /** * api/PrjEventLog/GetAnalysisSum * 说明:得到项目事件日志类型(分析、措施、总结)的日志数量 * @param {*} id 项目事件ID */ export const getAnalysisSum = (id) => { const app = getApp() let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEventLog/GetAnalysisSum?eventid=${encodeURI(id)}` return http.requestGungho({ method: "GET", header, url, }) } /** * api/PrjEventLog/GetOtherList *说明:得到项目事件其它日志类型(除回复、分析、措施、总结以外)的日志列表 * @param {*} id 项目事件ID * @param {*} type 类型,为空表示不限制,多个以英文分号分隔。 * @param {*} exceptType 排除的类型,如果指定了 Type则此设置无效,多个以英文分号分隔。 * @param {*} isasc 是否按日期顺序,默认是 日期倒序 */ export const getOtherList = (param = {}) => { const app = getApp() const { id, type = "", excepttype = "", isasc = 1, } = param; let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEventLog/GetOtherList` return http.requestGungho({ method: "POST", header, url, data: { eventid: id, type, excepttype, isasc, } }) } /** * api/PrjEventLog/GetDiscList * 得到项目事件讨论列表 * @param {*} session 查询ID * @param {*} page 得到哪一页数据 * @param {*} id 项目事件ID * @param {*} type 类型:分析、措施、总结 * @param {*} isasc 是否按日期顺序,默认是 日期倒序 * @param {*} numperpage 每页数据条目数,默认为 10 */ export const logGetDiscList = (param = {}) => { const app = getApp() const { session = "", page = 1, id, type = "", isasc = 0, numperpage = 10 } = param; let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEventLog/GetDiscList` return http.requestGungho({ method: "POST", header, url, data: { session, page, eventid: id, type, isasc, numperpage } }) } /** * api/PrjEventLog/Add * 增加交流 或动态 * opType;//操作类型:创建/确认/已读/担当变化/退回/提交/搁置/版本/回复 * 交流:回复 * @param {*} */ export const logAdd = (param) => { const app = getApp() const { id, optype, content = "" } = param let header = {} let url = `${app.globalData.apiurl.gungho}/api/PrjEventLog/Add` return http.requestGungho({ method: "POST", header, url, data: { eventid: `{${id.replace(/^\{|\}$/g, "")}}`, optype, content } }) }