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

This commit is contained in:
XieYongHong 2023-07-12 17:01:38 +08:00
commit 8aeed477a9
6 changed files with 71 additions and 48 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<j-modal :width="'900px'" visible @cancel="emit('close')"> <j-modal :width="'900px'" visible @cancel="emit('close')" :zIndex="1100">
<template v-if="getType === 'notifier-dingTalk'"> <template v-if="getType === 'notifier-dingTalk'">
<j-spin :spinning="loading"> <j-spin :spinning="loading">
<div class="code" style="height: 600px;"> <div class="code" style="height: 600px;">
@ -44,6 +44,7 @@ import {
} from '@/api/account/notificationSubscription'; } from '@/api/account/notificationSubscription';
const emit = defineEmits(['close', 'save']); const emit = defineEmits(['close', 'save']);
const props = defineProps({ const props = defineProps({
data: { data: {
// //
@ -103,6 +104,7 @@ const updateIframeStyle = () => {
'#notifier_iframe', '#notifier_iframe',
) as HTMLIFrameElement; ) as HTMLIFrameElement;
iframe.onload = () => { iframe.onload = () => {
console.log(iframe?.contentWindow)
const currentUrl = iframe?.contentWindow?.location?.search || ''; const currentUrl = iframe?.contentWindow?.location?.search || '';
let authCode = ''; let authCode = '';
if (currentUrl.startsWith('?')) { if (currentUrl.startsWith('?')) {

View File

@ -75,17 +75,20 @@ const onBind = () => {
} else { } else {
visible.value = true visible.value = true
} }
emit('close')
}; };
const onSave = () => { const onSave = () => {
editInfoVisible.value = false; editInfoVisible.value = false;
user.getUserInfo(); user.getUserInfo();
emit('save', props.current); emit('save', props.current);
emit('close')
}; };
const onBindSave = () => { const onBindSave = () => {
visible.value = false
emit('save', props.current); emit('save', props.current);
emit('close')
} }
const handleSearch = async () => { const handleSearch = async () => {

View File

@ -36,7 +36,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useUserInfo } from '@/store/userInfo'; import { useUserInfo } from '@/store/userInfo';
import { onlyMessage } from '@/utils/comm';
import EditInfo from '../../EditInfo/index.vue'; import EditInfo from '../../EditInfo/index.vue';
import Bind from './Bind.vue'; import Bind from './Bind.vue';

View File

@ -47,7 +47,7 @@
total: dataSource.length, total: dataSource.length,
current: current, current: current,
pageSize: pageSize, pageSize: pageSize,
pageSizeOptions: ['10', '20', '50', '100'], pageSizeOptions: ['12', '24', '48', '96'],
showSizeChanger: true, showSizeChanger: true,
hideOnSinglePage: false, hideOnSinglePage: false,
showTotal: (total: number, range: number) => `${range[0]} - ${range[1]} 条/总共 ${total}`, showTotal: (total: number, range: number) => `${range[0]} - ${range[1]} 条/总共 ${total}`,
@ -209,7 +209,7 @@ watch(
const onTreeSelect = (keys: any) => { const onTreeSelect = (keys: any) => {
if (keys.length) { if (keys.length) {
deptId.value = keys[0]; deptId.value = keys[0];
pageSize.value = 10; pageSize.value = 12;
current.value = 1; current.value = 1;
} }
}; };
@ -401,7 +401,7 @@ const getTableData = (terms?: any) => {
* 前端分页 * 前端分页
*/ */
const current = ref(1); const current = ref(1);
const pageSize = ref(10); const pageSize = ref(12);
const handleTableChange = (pagination: any) => { const handleTableChange = (pagination: any) => {
current.value = pagination.current; current.value = pagination.current;
pageSize.value = pagination.pageSize; pageSize.value = pagination.pageSize;

View File

@ -0,0 +1,56 @@
<template>
<JsonViewer :value=context :expanded="true" :expandDepth="4"></JsonViewer>
</template>
<script lang="ts" setup>
import JsonViewer from 'vue-json-viewer';
import templateApi from '@/api/notice/template';
const props = defineProps({
data: Object
})
const typeObj = {
weixin: 'wechat',
dingTalk: 'dingtalk',
};
/**
* 查看用户名
*/
const userList = ref([])
const departmentList = ref([])
const detailData = ref();
const context = ref()
/**
* 改变部门和用户
*/
const replaceData = async (data: any) => {
detailData.value = data
context.value = data.context
if (context.value.hasOwnProperty('userIdList') || context.value.hasOwnProperty('toUser')) {
templateApi.getUser(
typeObj[detailData.value.notifyType],
detailData.value.notifierId,
).then((res: any) => {
if (res.status === 200) {
userList.value = res.result
userList.value.forEach((item: any) => {
item.id === context.value?.userIdList ? context.value.userIdList = item.name : ''
item.id === context.value?.toUser ? context.value.toUser = item.name : ''
})
}
})
}
if (context.value.hasOwnProperty('departmentIdList')) {
templateApi.getDept(typeObj[detailData.value.notifyType],
detailData.value.notifierId).then((res: any) => {
if (res.status === 200) {
departmentList.value = res.result
departmentList.value.forEach((item: any) => {
item.id === context.value.departmentIdList ? context.value.departmentIdList = item.name : ''
})
}
})
}
}
replaceData(props.data)
</script>
<style lang="less" scoped></style>

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,slotProps)" @click="handleDetail(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'; import Record from './components/Record.vue'
type Emits = { type Emits = {
(e: 'update:visible', data: boolean): void; (e: 'update:visible', data: boolean): void;
}; };
@ -127,31 +127,6 @@ 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
}
})
}
/** /**
* 查看错误信息 * 查看错误信息
*/ */
@ -173,25 +148,13 @@ const handleError = (e: any) => {
/** /**
* 查看详情 * 查看详情
*/ */
const handleDetail =async (e: any,data:any) => { const handleDetail = (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(
JsonViewer, Record,
{ {
value:JSON.stringify(e,null,1), data:data,
expanded:"true",
expandDepth:"4",
style: { style: {
maxHeight: '300px', maxHeight: '300px',
overflowY: 'auto', overflowY: 'auto',