update: 组件更换测试

This commit is contained in:
JiangQiming 2023-03-14 14:32:48 +08:00
parent 351e4f35ab
commit b66d48e626
3 changed files with 38 additions and 7 deletions

View File

@ -147,6 +147,19 @@
</template>
</CardBox>
</template>
<template #type="slotProps">
<span> {{ getMethodTxt(slotProps.type) }}</span>
</template>
<template #provider="slotProps">
<span>
{{ getProviderTxt(slotProps.type, slotProps.provider) }}
</span>
</template>
<template #description="slotProps">
<Ellipsis>
{{ slotProps.description }}
</Ellipsis>
</template>
<template #action="slotProps">
<j-space :size="16">
<template
@ -205,6 +218,7 @@ const columns = [
title: '配置名称',
dataIndex: 'name',
key: 'name',
width: 100,
search: {
type: 'string',
},
@ -214,6 +228,7 @@ const columns = [
dataIndex: 'type',
key: 'type',
scopedSlots: true,
width: 100,
search: {
type: 'select',
options: NOTICE_METHOD,
@ -227,6 +242,7 @@ const columns = [
dataIndex: 'provider',
key: 'provider',
scopedSlots: true,
width: 200,
search: {
type: 'select',
options: providerList,
@ -239,6 +255,7 @@ const columns = [
title: '说明',
dataIndex: 'description',
key: 'description',
scopedSlots: true,
search: {
type: 'string',
},
@ -272,6 +289,14 @@ const getLogo = (type: string, provider: string) => {
const getMethodTxt = (type: string) => {
return NOTICE_METHOD.find((f) => f.value === type)?.label;
};
/**
* 根据类型展示对应文案
* @param type
* @param provider
*/
const getProviderTxt = (type: string, provider: string) => {
return MSG_TYPE[type].find((f: any) => f.value === provider)?.label;
};
/**
* 新增

View File

@ -110,14 +110,19 @@
</template>
</CardBox>
</template>
<template #bodyCell="{ column, text, record }">
<span v-if="column.dataIndex === 'type'">
{{ getMethodTxt(record.type) }}
</span>
<span v-if="column.dataIndex === 'provider'">
{{ getProviderTxt(record.type, record.provider) }}
<template #type="slotProps">
<span> {{ getMethodTxt(slotProps.type) }}</span>
</template>
<template #provider="slotProps">
<span>
{{ getProviderTxt(slotProps.type, slotProps.provider) }}
</span>
</template>
<template #description="slotProps">
<Ellipsis>
{{ slotProps.description }}
</Ellipsis>
</template>
<template #action="slotProps">
<j-space :size="16">
<template
@ -210,6 +215,7 @@ const columns = [
title: '说明',
dataIndex: 'description',
key: 'description',
scopedSlots: true,
search: {
type: 'string',
},

View File

@ -82,7 +82,7 @@ export const MSG_TYPE = {
],
email: [
{
label: 'email',
label: '邮件',
value: 'embedded',
logo: getImage('/notice/email.png'),
},