fix: bug#16263

This commit is contained in:
leiqiaochu 2023-07-13 16:05:27 +08:00
parent 1ce92713c1
commit 6fee10c352
3 changed files with 64 additions and 10 deletions

View File

@ -38,8 +38,8 @@
<template #action="slotProps"> <template #action="slotProps">
<AIcon <AIcon
type="ExclamationCircleOutlined" type="ExclamationCircleOutlined"
style="color: #1d39c4; cursor: pointer" :class="Object.keys(slotProps.context).length == 0 ? 'disableIcon' : 'Icon'"
@click="handleDetail(slotProps.context)" @click="handleDetail(slotProps)"
/> />
</template> </template>
</JProTable> </JProTable>
@ -51,6 +51,7 @@ import configApi from '@/api/notice/config';
import { PropType } from 'vue'; import { PropType } from 'vue';
import moment from 'moment'; import moment from 'moment';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import Record from '../../Template/Log/components/Record.vue'
type Emits = { type Emits = {
(e: 'update:visible', data: boolean): void; (e: 'update:visible', data: boolean): void;
@ -152,19 +153,46 @@ const handleError = (e: any) => {
/** /**
* 查看详情 * 查看详情
*/ */
const handleDetail = (e: any) => { const handleDetail = (data: any) => {
Modal.info({ if(Object.keys(data.context).length == 0){
Modal.info({
title: '详情信息', title: '详情信息',
content: h( content: h(
'p', "p",
{ {
style: { style: {
maxHeight: '300px', maxHeight: '300px',
overflowY: 'auto', overflowY: 'auto',
}, },
}, },
JSON.stringify(e), '模板中不存在变量'
), ),
}); });
}else{
Modal.info({
title: '详情信息',
content: h(
Record,
{
data:data,
style: {
maxHeight: '300px',
overflowY: 'auto',
},
},
),
});
}
}; };
</script> </script>
<style lang="less" scoped>
.disableIcon{
color:darkgrey ;
cursor:pointer;
}
.Icon{
color:#1d39c4;
cursor:pointer;
}
</style>

View File

@ -27,7 +27,6 @@ const replaceData = async (data: any) => {
context.value = data.context context.value = data.context
if (context.value.detailJson) { if (context.value.detailJson) {
context.value.detailJson = context.value.detailJson.replace(/\\\"/g, '\"') context.value.detailJson = context.value.detailJson.replace(/\\\"/g, '\"')
} }
if (context.value.hasOwnProperty('userIdList') || context.value.hasOwnProperty('toUser')) { if (context.value.hasOwnProperty('userIdList') || context.value.hasOwnProperty('toUser')) {
templateApi.getUser( templateApi.getUser(

View File

@ -34,7 +34,7 @@
<template #action="slotProps"> <template #action="slotProps">
<AIcon <AIcon
type="ExclamationCircleOutlined" type="ExclamationCircleOutlined"
style="color: #1d39c4; cursor: pointer" :class="Object.keys(slotProps.context).length == 0 ? 'disableIcon' : 'Icon'"
@click="handleDetail(slotProps)" @click="handleDetail(slotProps)"
/> />
</template> </template>
@ -148,8 +148,24 @@ const handleError = (e: any) => {
/** /**
* 查看详情 * 查看详情
*/ */
const handleDetail = (data:any) => { const handleDetail = (data: any) => {
Modal.info({ if(Object.keys(data.context).length == 0){
Modal.info({
title: '详情信息',
content: h(
"p",
{
style: {
maxHeight: '300px',
overflowY: 'auto',
},
},
'模板中不存在变量'
),
});
}else{
Modal.info({
title: '详情信息', title: '详情信息',
content: h( content: h(
Record, Record,
@ -162,5 +178,16 @@ const handleDetail = (data:any) => {
}, },
), ),
}); });
}
}; };
</script> </script>
<style lang="less" scoped>
.disableIcon{
color:darkgrey ;
cursor:pointer;
}
.Icon{
color:#1d39c4;
cursor:pointer;
}
</style>