Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
XieYongHong 2023-07-12 15:51:09 +08:00
commit af6f78ebb2
3 changed files with 44 additions and 7 deletions

View File

@ -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 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}`); export const delDepartment_api = (id: string) => server.remove(`/organization/${id}`);

View File

@ -46,7 +46,7 @@
/> />
</j-form-item> </j-form-item>
<j-form-item <j-form-item
name='configId' :name="formData.provider === 'dingTalkRobotWebHook'? '':'configId'"
v-if="formData.type !== 'email'" v-if="formData.type !== 'email'"
> >
<template #label> <template #label>

View File

@ -35,7 +35,7 @@
<AIcon <AIcon
type="ExclamationCircleOutlined" type="ExclamationCircleOutlined"
style="color: #1d39c4; cursor: pointer" style="color: #1d39c4; cursor: pointer"
@click="handleDetail(slotProps.context)" @click="handleDetail(slotProps.context,slotProps)"
/> />
</template> </template>
</JProTable> </JProTable>
@ -47,7 +47,7 @@ import templateApi from '@/api/notice/template';
import { PropType } from 'vue'; import { PropType } from 'vue';
import moment from 'moment'; import moment from 'moment';
import { Modal } from 'jetlinks-ui-components'; import { Modal } from 'jetlinks-ui-components';
import JsonViewer from 'vue-json-viewer';
type Emits = { type Emits = {
(e: 'update:visible', data: boolean): void; (e: 'update:visible', data: boolean): void;
}; };
@ -127,6 +127,31 @@ const handleSearch = (e: any) => {
params.value = e; 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
}
})
}
/** /**
* 查看错误信息 * 查看错误信息
*/ */
@ -148,18 +173,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({ Modal.info({
title: '详情信息', title: '详情信息',
content: h( content: h(
'p', JsonViewer,
{ {
value:JSON.stringify(e,null,1),
expanded:"true",
expandDepth:"4",
style: { style: {
maxHeight: '300px', maxHeight: '300px',
overflowY: 'auto', overflowY: 'auto',
}, },
}, },
JSON.stringify(e),
), ),
}); });
}; };