api.ts 2.41 KB
/*
 * @Date: 2021-12-29 15:35:12
 * @LastEditors: wangqiang@feewee.cn
 * @LastEditTime: 2022-01-05 17:53:12
 */
import request from "@/utils/request";
import { common } from "@/typing/common";
import { BACKLOG } from "@/utils/host";
import { http } from "@/typing/http";

interface ListParams extends common.PaginationParam {
  keywords?: string;
}

export interface ListVO {
  id?: number;
  /** 代办编码 */
  itemCode?: string;
  /** 待办名称 */
  itemName?: string;
  /** 待办列表页路径 */
  listPage?: string;
  /** 待办详情路径 */
  detailPage?: string;
  /** 跳转页面参数 */
  pageParam?: string;
  /** 通知类型 1app消息 2短信 9不通知 */
  notifyType?: number;
  /** 使用角色 */
  applyRoleCode?: string;
  /** 状态 1启用 0禁用 */
  status?: number;
  /** 创建日期 */
  createTime?: number;
  /** 代办类型 1业务性代办 2提示性待办 */
  itemType?: number;
  /** 备注提示 */
  remark?: string;
  applySysId?: number;
  /** 是否对接新待办 */
  dock?: boolean;
  /** 动态模版 */
  dynamicTemp?: string;
  /** 待办时效考核 */
  assess?: boolean;
  /** 待办功能页面路径 */
  funcPage?: string;
  /**是否显示切换入口 */
  exShow?: boolean;
  customTemp?: boolean; // 是否使用自定义模板
  customTempPath?: string; // 自定义模板路径
  closeStand?: boolean; // 是否关单站岗
  /** 工作类型 */
  workType?:number;
}

export function getConfigListApi(params: ListParams): http.PromisePageResp<ListVO> {
  return request.get(`${BACKLOG}/config/list`, { params });
}

// 待办 启用
export function taskEnableApi(id: number) {
  return request.post(`${BACKLOG}/config/enable`, { id }, { contentType: "form-urlencoded" });
}

// 待办 禁用
export function taskDisableApi(id: number) {
  return request.post(`${BACKLOG}/config/disable`, { id }, { contentType: "form-urlencoded" });
}

// 待办 删除
export function taskDeleteApi(id: number) {
  return request.post(`${BACKLOG}/config/remove`, { id }, { contentType: "form-urlencoded" });
}

export interface SaveParams {
  id: number;
  /** 待办名称 */
  itemName: string;
  /** 通知类型 */
  notifyType: number;
  /** 通知对象 */
  applyRoleCode: string;
  /** app页面路径 */
  listPage: string;
  /** 跳转页面参数 */
  pageParam: string;
}

// 保存待办
export function saveTaskApi(params: SaveParams) {
  return request.post(`${BACKLOG}/config/save`, { ...params });
}