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