update: 组件更换测试
This commit is contained in:
parent
f584141950
commit
351e4f35ab
|
|
@ -50,34 +50,50 @@
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<j-form-item
|
<j-form-item
|
||||||
:name="['templateDetailTable', index, 'value']"
|
:name="['templateDetailTable', index, 'value']"
|
||||||
:rules="{
|
:rules="[
|
||||||
required: record.required,
|
{
|
||||||
message: '该字段为必填字段',
|
required: record.required,
|
||||||
}"
|
message: '该字段为必填字段',
|
||||||
|
},
|
||||||
|
...record.otherRules,
|
||||||
|
]"
|
||||||
>
|
>
|
||||||
<ToUser
|
<template
|
||||||
v-if="record.type === 'user'"
|
v-if="
|
||||||
v-model:toUser="record.value"
|
data.type === 'dingTalk' ||
|
||||||
:type="data.type"
|
data.type === 'weixin'
|
||||||
:config-id="formData.configId"
|
"
|
||||||
/>
|
>
|
||||||
<ToOrg
|
<ToUser
|
||||||
v-else-if="record.type === 'org'"
|
v-if="record.type === 'user'"
|
||||||
:type="data.type"
|
v-model:toUser="record.value"
|
||||||
:config-id="formData.configId"
|
:type="data.type"
|
||||||
v-model:toParty="record.value"
|
:config-id="formData.configId"
|
||||||
/>
|
/>
|
||||||
<ToTag
|
<ToOrg
|
||||||
v-else-if="record.type === 'tag'"
|
v-else-if="record.type === 'org'"
|
||||||
:type="data.type"
|
:type="data.type"
|
||||||
:config-id="formData.configId"
|
:config-id="formData.configId"
|
||||||
v-model:toTag="record.value"
|
v-model:toParty="record.value"
|
||||||
/>
|
/>
|
||||||
<ValueItem
|
<ToTag
|
||||||
v-else
|
v-else-if="record.type === 'tag'"
|
||||||
v-model:modelValue="record.value"
|
:type="data.type"
|
||||||
:itemType="record.type"
|
:config-id="formData.configId"
|
||||||
/>
|
v-model:toTag="record.value"
|
||||||
|
/>
|
||||||
|
<ValueItem
|
||||||
|
v-else
|
||||||
|
v-model:modelValue="record.value"
|
||||||
|
:itemType="record.type"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<ValueItem
|
||||||
|
v-model:modelValue="record.value"
|
||||||
|
:itemType="record.type"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -100,6 +116,8 @@ import { message } from 'ant-design-vue';
|
||||||
import ToUser from '../Detail/components/ToUser.vue';
|
import ToUser from '../Detail/components/ToUser.vue';
|
||||||
import ToOrg from '../Detail/components/ToOrg.vue';
|
import ToOrg from '../Detail/components/ToOrg.vue';
|
||||||
import ToTag from '../Detail/components/ToTag.vue';
|
import ToTag from '../Detail/components/ToTag.vue';
|
||||||
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
|
import { phoneRegEx } from '@/utils/validate';
|
||||||
|
|
||||||
type Emits = {
|
type Emits = {
|
||||||
(e: 'update:visible', data: boolean): void;
|
(e: 'update:visible', data: boolean): void;
|
||||||
|
|
@ -156,6 +174,26 @@ const getTemplateDetail = async () => {
|
||||||
...m,
|
...m,
|
||||||
type: m.expands ? m.expands.businessType : m.type,
|
type: m.expands ? m.expands.businessType : m.type,
|
||||||
value: undefined,
|
value: undefined,
|
||||||
|
// 电话字段校验
|
||||||
|
otherRules:
|
||||||
|
m.id === 'calledNumber'
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
max: 64,
|
||||||
|
message: '最多可输入64个字符',
|
||||||
|
trigger: 'change',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
trigger: 'change',
|
||||||
|
validator(_rule: Rule, value: string) {
|
||||||
|
if (!value) return Promise.resolve();
|
||||||
|
if (!phoneRegEx(value))
|
||||||
|
return Promise.reject('请输入有效号码');
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: '',
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<span>
|
<span>
|
||||||
AgentID
|
AgentId
|
||||||
<j-tooltip title="应用唯一标识">
|
<j-tooltip title="应用唯一标识">
|
||||||
<AIcon
|
<AIcon
|
||||||
type="QuestionCircleOutlined"
|
type="QuestionCircleOutlined"
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
v-model:value="
|
v-model:value="
|
||||||
formData.template.agentId
|
formData.template.agentId
|
||||||
"
|
"
|
||||||
placeholder="请输入AppSecret"
|
placeholder="请输入AgentId"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<j-row :gutter="10">
|
<j-row :gutter="10">
|
||||||
|
|
@ -271,7 +271,7 @@
|
||||||
</template>
|
</template>
|
||||||
<j-input
|
<j-input
|
||||||
v-model:value="formData.template.agentId"
|
v-model:value="formData.template.agentId"
|
||||||
placeholder="请输入agentId"
|
placeholder="请输入AgentId"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<j-row :gutter="10">
|
<j-row :gutter="10">
|
||||||
|
|
@ -664,7 +664,6 @@
|
||||||
<j-radio :value="false">自定义</j-radio>
|
<j-radio :value="false">自定义</j-radio>
|
||||||
</j-radio-group>
|
</j-radio-group>
|
||||||
<j-textarea
|
<j-textarea
|
||||||
v-model:value="formData.template.body"
|
|
||||||
placeholder="请求体中的数据来自于发送通知时指定的所有变量"
|
placeholder="请求体中的数据来自于发送通知时指定的所有变量"
|
||||||
v-if="formData.template.contextAsBody"
|
v-if="formData.template.contextAsBody"
|
||||||
disabled
|
disabled
|
||||||
|
|
@ -902,7 +901,10 @@ const formRules = ref({
|
||||||
provider: [{ required: true, message: '请选择类型' }],
|
provider: [{ required: true, message: '请选择类型' }],
|
||||||
configId: [{ required: true, message: '请选择绑定配置' }],
|
configId: [{ required: true, message: '请选择绑定配置' }],
|
||||||
// 钉钉
|
// 钉钉
|
||||||
'template.agentId': [{ required: true, message: '请输入agentId' }],
|
'template.agentId': [
|
||||||
|
{ required: true, message: '请输入AgentId' },
|
||||||
|
{ max: 64, message: '最多可输入64个字符', trigger: 'change' },
|
||||||
|
],
|
||||||
'template.messageType': [{ required: true, message: '请选择消息类型' }],
|
'template.messageType': [{ required: true, message: '请选择消息类型' }],
|
||||||
'template.markdown.title': [
|
'template.markdown.title': [
|
||||||
{ required: true, message: '请输入标题', trigger: 'change' },
|
{ required: true, message: '请输入标题', trigger: 'change' },
|
||||||
|
|
@ -914,7 +916,7 @@ const formRules = ref({
|
||||||
],
|
],
|
||||||
// 'template.url': [{ required: true, message: '请输入WebHook' }],
|
// 'template.url': [{ required: true, message: '请输入WebHook' }],
|
||||||
// 微信
|
// 微信
|
||||||
// 'template.agentId': [{ required: true, message: '请输入agentId' }],
|
// 'template.agentId': [{ required: true, message: '请输入AgentId' }],
|
||||||
// 邮件
|
// 邮件
|
||||||
'template.subject': [
|
'template.subject': [
|
||||||
{ required: true, message: '请输入标题' },
|
{ required: true, message: '请输入标题' },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue