diff --git a/src/api/system/department.ts b/src/api/system/department.ts index c7f4103a..96df6c01 100644 --- a/src/api/system/department.ts +++ b/src/api/system/department.ts @@ -5,7 +5,7 @@ export const getTreeData_api = (data: object) => server.post(`/organization/_all // 新增部门 export const addDepartment_api = (data: object) => server.post(`/organization`, data); // 更新部门 -export const updateDepartment_api = (data: object) => server.patch(`/organization`, data); +export const updateDepartment_api = (data: any) => server.put(`/organization/${data.id}`, data); // 删除部门 export const delDepartment_api = (id: string) => server.remove(`/organization/${id}`); diff --git a/src/views/notice/Template/Detail/index.vue b/src/views/notice/Template/Detail/index.vue index c73a78f4..421f3b3a 100644 --- a/src/views/notice/Template/Detail/index.vue +++ b/src/views/notice/Template/Detail/index.vue @@ -46,7 +46,7 @@ /> @@ -51,7 +51,7 @@ import templateApi from '@/api/notice/template'; import { PropType } from 'vue'; import moment from 'moment'; import { Modal } from 'jetlinks-ui-components'; - +import JsonViewer from 'vue-json-viewer'; type Emits = { (e: 'update:visible', data: boolean): void; }; @@ -131,6 +131,31 @@ const handleSearch = (e: any) => { params.value = e; }; +const typeObj = { + weixin: 'wechat', + dingTalk: 'dingtalk', +}; +/** + * 查看用户名 + */ +const userList = ref([]) +const departmentList = ref([]) +const queryUser = (id:any,notifyType:any,goal:any) =>{ + goal ==='user' ? templateApi.getUser( + typeObj[notifyType], + id, + ).then((res:any)=>{ + if(res.status === 200){ + userList.value = res.result + } + }) : templateApi.getDept(typeObj[notifyType], + id,).then((res:any)=>{ + if(res.status === 200){ + departmentList.value = res.result + } + }) +} + /** * 查看错误信息 */ @@ -152,18 +177,30 @@ const handleError = (e: any) => { /** * 查看详情 */ -const handleDetail = (e: any) => { +const handleDetail =async (e: any,data:any) => { + if(e.hasOwnProperty('userIdList')){ + await queryUser(data.notifierId,data.notifyType,'user') + userList.value.forEach((item:any)=>{ + item.id === e.userIdList ? e.userIdList = item.name : '' + }) + } + if(e.hasOwnProperty('departmentIdList')){ + + } + Modal.info({ title: '详情信息', content: h( - 'p', + JsonViewer, { + value:JSON.stringify(e,null,1), + expanded:"true", + expandDepth:"4", style: { maxHeight: '300px', overflowY: 'auto', }, }, - JSON.stringify(e), ), }); };