| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- import request from '@/utils/request';
- import { AxiosPromise } from 'axios';
- // 查询公司接口
- export function getCompanyList() {
- return request({
- url: '/lingcun/subCompany/list',
- method: 'get'
- })
- }
- // 根据公司id查询部门接口
- export function getDepartmentList(subCompanyId: string) {
- return request({
- url: '/sys/dept/getListBySub',
- method: 'post',
- data: { subCompanyId }
- })
- }
- // 根据部门id查询员工接口
- export function getPersonList(deptId: string) {
- return request({
- url: '/sys/user/listByDeptId',
- method: 'post',
- data: { deptId }
- })
- }
- // 评论通用接口
- interface addTypes {
- type: string;
- content: string;
- recordId?: string
- }
- export interface listTypes {
- id: string;
- staffPhoto: string;
- staffName: string;
- createTime: string;
- content: string;
- recordId: string;
- }
- /**
- * 添加
- * @param query
- * @returns {*}
- */
- export const addComment = (query: addTypes) => {
- return request({
- url: '/record-comment/add',
- method: 'post',
- data: query
- });
- };
- /**
- * 查询
- * @param query
- * @returns {*}
- */
- export const listComment = (query): AxiosPromise<{ records: listTypes[] }> => {
- return request({
- url: '/record-comment/list',
- method: 'post',
- data: query
- });
- };
- /**
- * 删除
- * @param id
- * @returns {*}
- */
- export const deleteComment = (commentId: string) => {
- return request({
- url: '/record-comment/delete',
- method: 'post',
- data: { commentId }
- });
- };
- /**
- * 查询动态接口
- * @param data
- * @returns {*}
- */
- export const listDynamic = (data: { recordId?: string, type: number } & PageQuery) => {
- return request({
- url: '/dynamic-log/list',
- method: 'post',
- data
- });
- };
- // 表格导入导出通用接口
- /**
- * 获取导入模板
- * @param templateCode
- * @returns {*}
- */
- export const downloadTemplate = (templateCode: string, importType?: string) => {
- return request({
- url: '/excel/download_import_template',
- method: 'post',
- data: { templateCode, importType },
- responseType: "blob",
- responseEncoding: "utf8"
- });
- };
- /**
- * 下载异常文件
- * @param templateCode
- * @returns {*}
- */
- export const downloadFailTemplate = (tempCode: string, importType?: string) => {
- return request({
- url: '/excel/export_temp',
- method: 'post',
- data: { tempCode, importType },
- responseType: "blob",
- responseEncoding: "utf8"
- });
- };
- /**
- * 导入
- * @param query
- * @returns {*}
- */
- export const listImport = (tempCode: string, importType?: string, resourceType?: number) => {
- return request({
- url: '/excel/save_import_data',
- method: 'post',
- data: { tempCode, importType, resourceType },
- timeout: 0
- });
- };
- /**
- * 导出
- * @param query
- * @returns {*}
- */
- export const listExport = (query: any) => {
- return request({
- url: '/excel/export',
- method: 'post',
- data: query,
- responseType: "blob",
- responseEncoding: "utf8"
- });
- };
- // 消息模块接口
- /**
- * 消息列表
- * @param data
- * @returns {*}
- */
- export const listMessage = (data: any) => {
- return request({
- url: '/sys/inside/message/pageList',
- method: 'post',
- data
- });
- };
- /**
- * 获取类型以及未读数量
- * @param data
- * @returns {*}
- */
- export const getMessageType = () => {
- return request({
- url: '/sys/inside/message/getNoReadCount',
- method: 'post',
- data: {}
- });
- };
- /**
- * 获取公告未读数量
- * @param data
- * @returns {*}
- */
- export const getBulletinUnreadCount = () => {
- return request({
- url: '/bulletin/unread-count',
- method: 'get',
- params: {}
- });
- };
- /**
- * 更新为已读
- * @param data
- * @returns {*}
- */
- export const updateRead = (ids: string[]) => {
- return request({
- url: '/sys/inside/message/read',
- method: 'post',
- data: {
- messageLogIds: ids
- }
- });
- }
- /**
- * 全部已读
- * @returns {*}
- */
- export const updateReadAll = () => {
- return request({
- url: '/sys/inside/message/readAll',
- method: 'post',
- data: {}
- });
- }
- /**
- * 清空已读
- * @returns {*}
- */
- export const clearRead = () => {
- return request({
- url: '/sys/inside/message/cleanAll',
- method: 'post',
- data: {
- isRead: 1
- }
- });
- }
- /**
- * 查询附件接口
- * @param resourceType
- * @returns {*}
- */
- export interface resourceQuery {
- resourceType?: string;
- resourceTypeId?: string;
- customerId?: string | number;
- }
- export interface resourceVO {
- id: string | number;
- createTime: string;
- resourceName: string;
- resourceSize: string;
- createBy: string;
- resourceExt: string;
- resourceUrl: string;
- }
- export const listResource = (params: resourceQuery): AxiosPromise<{ records: resourceVO[] }> => {
- return request({
- url: '/sys-resource/list',
- method: 'get',
- params
- });
- };
- /**
- * 附件绑定资源接口
- * @param ids
- * @returns {*}
- */
- export const bindResource = (data: { idList: number[], remark: string } & resourceQuery) => {
- return request({
- url: '/sys-resource/add-resource',
- method: 'post',
- data
- });
- };
- /**
- * 删除附件接口
- * @param ids
- * @returns {*}
- */
- export const delResource = (id: string | number) => {
- return request({
- url: '/sys-resource/delete-by-id',
- method: 'delete',
- data: {
- id
- }
- });
- };
- /**
- * 批量删除附件接口
- * @param ids
- * @returns {*}
- */
- export const batchDelResource = (ids: (string | number)[]) => {
- return request({
- url: '/sys-resource/delete',
- method: 'delete',
- data: {
- ids
- }
- });
- };
- // 操作日志接口
- export interface OperationLogQuery {
- resourceType?: string;
- resourceTypeId?: string;
- beginTime?: string;
- endTime?: string;
- }
- export interface OperationLogVO {
- operationTime: string;
- ownerByName: string;
- operationType: number;
- fieldName: string;
- oldValue: string;
- newValue: string;
- dataType: string;
- }
- export const listOperationLog = (data: OperationLogQuery & PageQuery): AxiosPromise<{ records: OperationLogVO[] }> => {
- return request({
- url: '/operation-log/list',
- method: 'post',
- data
- });
- }
|