Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
digitalPerson-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
digitalPerson
digitalPerson-fe
Commits
ddaeee86
Commit
ddaeee86
authored
Oct 16, 2024
by
shirlyn.guo
🤡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 定制数据提交
parent
1731e7c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
10 deletions
+39
-10
custom.ts
src/apis/custom.ts
+11
-0
voice-character-customize.vue
src/views/index/components/voice-character-customize.vue
+28
-10
No files found.
src/apis/custom.ts
0 → 100644
View file @
ddaeee86
import
{
request
}
from
'@/utils/request'
// 声音与数字人形象定制资料填写
export
function
uploadVoiceCharacterCustomize
<
T
>
(
payload
:
{
customServiceType
:
'VOICE_FIGURE'
companyName
:
string
contactName
:
string
contactInformation
:
string
})
{
return
request
.
post
<
T
>
(
'/bizCustomServiceRetentionRest/submitInfo.json'
,
payload
)
}
src/views/index/components/voice-character-customize.vue
View file @
ddaeee86
...
...
@@ -3,6 +3,14 @@ import type { FormInst, FormItemRule, FormRules } from 'naive-ui'
import
{
ref
,
shallowReadonly
,
useTemplateRef
}
from
'vue'
import
isMobilePhone
from
'validator/es/lib/isMobilePhone'
import
isEmail
from
'validator/es/lib/isEmail'
import
{
uploadVoiceCharacterCustomize
}
from
'@/apis/custom'
interface
CustomizeInfoPayload
{
customServiceType
:
'VOICE_FIGURE'
companyName
:
string
contactName
:
string
contactInformation
:
string
}
const
isShowVoiceCharacterCustomizeModal
=
defineModel
<
boolean
>
(
'isShowVoiceCharacterCustomizeModal'
,
{
default
:
false
,
...
...
@@ -12,7 +20,7 @@ const customizeInfoFormRef = useTemplateRef<FormInst>('customizeInfoFormRef')
const
customizeInfoForm
=
ref
({
companyName
:
''
,
contact
s
Name
:
''
,
contactName
:
''
,
contactInformation
:
''
,
})
...
...
@@ -30,7 +38,7 @@ const customizeInfoFormRules = shallowReadonly<FormRules>({
return
},
},
contact
s
Name
:
{
contactName
:
{
required
:
true
,
trigger
:
'blur'
,
validator
:
(
_rule
:
FormItemRule
,
value
:
string
)
=>
{
...
...
@@ -77,11 +85,21 @@ function handleCustomizeInfoSubmit() {
customizeSubmitBtnLoading
.
value
=
true
console
.
log
(
customizeInfoForm
.
value
)
customizeSubmitBtnLoading
.
value
=
false
isShowVoiceCharacterCustomizeModal
.
value
=
false
window
.
$message
.
success
(
'提交成功'
)
let
payload
:
CustomizeInfoPayload
=
{
customServiceType
:
'VOICE_FIGURE'
,
...
customizeInfoForm
.
value
,
}
uploadVoiceCharacterCustomize
(
payload
)
.
then
(()
=>
{
window
.
$message
.
success
(
'提交成功'
)
})
.
catch
(()
=>
{
window
.
$message
.
error
(
'提交失敗,請重新提交'
)
})
.
finally
(()
=>
{
customizeSubmitBtnLoading
.
value
=
false
isShowVoiceCharacterCustomizeModal
.
value
=
false
})
})
}
...
...
@@ -90,7 +108,7 @@ function onModalAfterLeave() {
customizeInfoForm
.
value
=
{
companyName
:
''
,
contact
s
Name
:
''
,
contactName
:
''
,
contactInformation
:
''
,
}
}
...
...
@@ -116,8 +134,8 @@ function onModalAfterLeave() {
<n-form-item
label=
"公司名稱"
path=
"companyName"
>
<n-input
v-model:value=
"customizeInfoForm.companyName"
placeholder=
"請輸入公司名稱"
/>
</n-form-item>
<n-form-item
label=
"聯系人姓名"
path=
"contact
s
Name"
>
<n-input
v-model:value=
"customizeInfoForm.contact
s
Name"
placeholder=
"請輸入聯系人姓名"
/>
<n-form-item
label=
"聯系人姓名"
path=
"contactName"
>
<n-input
v-model:value=
"customizeInfoForm.contactName"
placeholder=
"請輸入聯系人姓名"
/>
</n-form-item>
<n-form-item
label=
"聯系方式"
path=
"contactInformation"
>
<n-input
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment