update: 组件更换测试

This commit is contained in:
JiangQiming 2023-03-10 11:29:18 +08:00
parent 7f3978fe17
commit f5aae8528f
3 changed files with 40 additions and 14 deletions

View File

@ -52,11 +52,30 @@
<j-form-item
:name="['templateDetailTable', index, 'value']"
:rules="{
required: true,
required: record.required,
message: '该字段为必填字段',
}"
>
<ToUser
v-if="record.type === 'user'"
v-model:toUser="record.value"
:type="data.type"
:config-id="data.id"
/>
<ToOrg
v-else-if="record.type === 'org'"
:type="data.type"
:config-id="data.id"
v-model:toParty="record.value"
/>
<ToTag
v-else-if="record.type === 'tag'"
:type="data.type"
:config-id="data.id"
v-model:toTag="record.value"
/>
<ValueItem
v-else
v-model:modelValue="record.value"
:itemType="record.type"
/>
@ -78,6 +97,10 @@ import type {
} from '@/views/notice/Template/types';
import { message } from 'ant-design-vue';
import ToUser from '@/views/notice/Template/Detail/components/ToUser.vue';
import ToOrg from '@/views/notice/Template/Detail/components/ToOrg.vue';
import ToTag from '@/views/notice/Template/Detail/components/ToTag.vue';
type Emits = {
(e: 'update:visible', data: boolean): void;
};
@ -128,6 +151,7 @@ const getTemplateDetail = async () => {
formData.value.templateDetailTable = result.variableDefinitions.map(
(m: any) => ({
...m,
type: m.expands ? m.expands.businessType : m.type,
value: undefined,
}),
);

View File

@ -393,11 +393,11 @@ const formRules = ref({
// webhook
'configuration.url': [
{ required: true, message: '请输入Webhook' },
{
pattern:
/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[j-z]{2,6}\/?/,
message: 'Webhook需要是一个合法的URL',
},
// {
// pattern:
// /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[j-z]{2,6}\/?/,
// message: 'WebhookURL',
// },
],
description: [{ max: 200, message: '最多可输入200个字符' }],
});

View File

@ -156,6 +156,8 @@ watch(
(val) => {
if (val) {
getDepartment();
} else {
dataSource.value = [];
}
},
);
@ -357,19 +359,19 @@ const getTableData = () => {
const bindUser = bindUsers.find(
(f: any) => f.thirdPartyUserId === deptUser.id,
);
if (bindUser) {
unBindUser = unBindUsers.find(
(f: any) => f.id === bindUser.userId,
);
}
// if (bindUser) {
// unBindUser = unBindUsers.find(
// (f: any) => f.id === bindUser.userId,
// );
// }
dataSource.value.push({
thirdPartyUserId: deptUser.id,
thirdPartyUserName: deptUser.name,
bindId: bindUser?.userId,
userId: unBindUser?.id,
bindId: bindUser?.id,
userId: bindUser?.userId,
userName: unBindUser
? `${unBindUser.name}(${unBindUser.username})`
: '',
: bindUser?.providerName,
status: {
text: bindUser?.providerName ? '已绑定' : '未绑定',
value: bindUser?.providerName ? 'success' : 'error',