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
a92458b0
Commit
a92458b0
authored
Oct 17, 2024
by
shirlyn.guo
🤡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 规范命名
parent
b2c2040a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
36 deletions
+38
-36
digital-image-customization.ts
src/apis/digital-image-customization.ts
+1
-2
gift-redemption.ts
src/apis/gift-redemption.ts
+0
-1
digital-image-customization.vue
src/views/index/components/digital-image-customization.vue
+30
-26
side-bar.vue
src/views/index/layout/side-bar.vue
+7
-7
No files found.
src/apis/
custom
.ts
→
src/apis/
digital-image-customization
.ts
View file @
a92458b0
import
{
request
}
from
'@/utils/request'
// 声音与数字人形象定制资料填写
export
function
uploadVoiceCharacterCustomize
<
T
>
(
payload
:
{
export
function
fetchDigitalImageCustomizationInfo
<
T
>
(
payload
:
{
customServiceType
:
'VOICE_FIGURE'
companyName
:
string
contactName
:
string
...
...
src/apis/gift-redemption.ts
View file @
a92458b0
import
{
request
}
from
'@/utils/request'
// 根据ID获取推荐模板信息
export
function
fetchGiftCodeRedemption
<
T
>
(
redemptionCode
:
string
)
{
return
request
.
post
<
T
>
(
`/bizRedemptionRest/equityRedeem.json?redemptionCode=
${
redemptionCode
}
`
)
}
src/views/index/components/
voice-character-customize
.vue
→
src/views/index/components/
digital-image-customization
.vue
View file @
a92458b0
...
...
@@ -3,28 +3,28 @@ 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
'
import
{
fetchDigitalImageCustomizationInfo
}
from
'@/apis/digital-image-customization
'
interface
Customiz
e
InfoPayload
{
interface
Customiz
ation
InfoPayload
{
customServiceType
:
'VOICE_FIGURE'
companyName
:
string
contactName
:
string
contactInformation
:
string
}
const
isShow
VoiceCharacterCustomizeModal
=
defineModel
<
boolean
>
(
'isShowVoiceCharacterCustomize
Modal'
,
{
const
isShow
DigitalImageCustomizationModal
=
defineModel
<
boolean
>
(
'isShowDigitalImageCustomization
Modal'
,
{
default
:
false
,
})
const
customiz
eInfoFormRef
=
useTemplateRef
<
FormInst
>
(
'customize
InfoFormRef'
)
const
customiz
ationInfoFormRef
=
useTemplateRef
<
FormInst
>
(
'customization
InfoFormRef'
)
const
customiz
e
InfoForm
=
ref
({
const
customiz
ation
InfoForm
=
ref
({
companyName
:
''
,
contactName
:
''
,
contactInformation
:
''
,
})
const
customiz
e
InfoFormRules
=
shallowReadonly
<
FormRules
>
({
const
customiz
ation
InfoFormRules
=
shallowReadonly
<
FormRules
>
({
companyName
:
{
required
:
true
,
trigger
:
'blur'
,
...
...
@@ -77,37 +77,37 @@ const customizeInfoFormRules = shallowReadonly<FormRules>({
},
})
const
customiz
e
SubmitBtnLoading
=
ref
(
false
)
const
customiz
ation
SubmitBtnLoading
=
ref
(
false
)
function
handleCustomizeInfoSubmit
()
{
customiz
e
InfoFormRef
.
value
?.
validate
((
errors
)
=>
{
customiz
ation
InfoFormRef
.
value
?.
validate
((
errors
)
=>
{
if
(
errors
)
return
''
customiz
e
SubmitBtnLoading
.
value
=
true
customiz
ation
SubmitBtnLoading
.
value
=
true
let
payload
:
Customiz
e
InfoPayload
=
{
let
payload
:
Customiz
ation
InfoPayload
=
{
customServiceType
:
'VOICE_FIGURE'
,
...
customiz
e
InfoForm
.
value
,
...
customiz
ation
InfoForm
.
value
,
}
uploadVoiceCharacterCustomize
(
payload
)
fetchDigitalImageCustomizationInfo
(
payload
)
.
then
(()
=>
{
window
.
$message
.
success
(
'提交成功'
)
isShow
VoiceCharacterCustomize
Modal
.
value
=
false
isShow
DigitalImageCustomization
Modal
.
value
=
false
})
.
catch
(()
=>
{
window
.
$message
.
error
(
'提交失敗,請重新提交'
)
})
.
finally
(()
=>
{
customiz
e
SubmitBtnLoading
.
value
=
false
customiz
ation
SubmitBtnLoading
.
value
=
false
})
})
}
function
onModalAfterLeave
()
{
customiz
e
InfoFormRef
.
value
?.
restoreValidation
()
customiz
ation
InfoFormRef
.
value
?.
restoreValidation
()
customiz
e
InfoForm
.
value
=
{
customiz
ation
InfoForm
.
value
=
{
companyName
:
''
,
contactName
:
''
,
contactInformation
:
''
,
...
...
@@ -116,31 +116,35 @@ function onModalAfterLeave() {
</
script
>
<
template
>
<n-modal
v-model:show=
"isShowVoiceCharacterCustomizeModal"
:mask-closable=
"false"
:on-after-leave=
"onModalAfterLeave"
>
<n-modal
v-model:show=
"isShowDigitalImageCustomizationModal"
:mask-closable=
"false"
:on-after-leave=
"onModalAfterLeave"
>
<n-card
class=
"!w-[600px]"
title=
"聲音與數字人形象定制"
:bordered=
"false"
size=
"medium"
closable
@
close=
"() => (isShow
VoiceCharacterCustomize
Modal = false)"
@
close=
"() => (isShow
DigitalImageCustomization
Modal = false)"
>
<n-form
ref=
"customiz
e
InfoFormRef"
ref=
"customiz
ation
InfoFormRef"
label-placement=
"left"
label-width=
"auto"
:model=
"customiz
e
InfoForm"
:rules=
"customiz
e
InfoFormRules"
:model=
"customiz
ation
InfoForm"
:rules=
"customiz
ation
InfoFormRules"
>
<n-form-item
label=
"公司名稱"
path=
"companyName"
>
<n-input
v-model:value=
"customiz
e
InfoForm.companyName"
placeholder=
"請輸入公司名稱"
/>
<n-input
v-model:value=
"customiz
ation
InfoForm.companyName"
placeholder=
"請輸入公司名稱"
/>
</n-form-item>
<n-form-item
label=
"聯系人姓名"
path=
"contactName"
>
<n-input
v-model:value=
"customiz
e
InfoForm.contactName"
placeholder=
"請輸入聯系人姓名"
/>
<n-input
v-model:value=
"customiz
ation
InfoForm.contactName"
placeholder=
"請輸入聯系人姓名"
/>
</n-form-item>
<n-form-item
label=
"聯系方式"
path=
"contactInformation"
>
<n-input
v-model:value=
"customiz
e
InfoForm.contactInformation"
v-model:value=
"customiz
ation
InfoForm.contactInformation"
placeholder=
"请输入手机号码(加区号)或电子邮箱"
/>
</n-form-item>
...
...
@@ -149,8 +153,8 @@ function onModalAfterLeave() {
<template
#
footer
>
<div
class=
"text-end"
>
<n-space
justify=
"end"
>
<n-button
@
click=
"() => (isShow
VoiceCharacterCustomize
Modal = false)"
>
取消
</n-button>
<n-button
type=
"info"
:loading=
"customiz
e
SubmitBtnLoading"
@
click=
"handleCustomizeInfoSubmit"
<n-button
@
click=
"() => (isShow
DigitalImageCustomization
Modal = false)"
>
取消
</n-button>
<n-button
type=
"info"
:loading=
"customiz
ation
SubmitBtnLoading"
@
click=
"handleCustomizeInfoSubmit"
>
提交
</n-button
>
</n-space>
...
...
src/views/index/layout/side-bar.vue
View file @
a92458b0
...
...
@@ -3,7 +3,7 @@ import { h, ref, shallowReadonly, watchEffect } from 'vue'
import
type
{
MenuOption
}
from
'naive-ui'
import
{
useRoute
,
useRouter
}
from
'vue-router'
import
{
Workbench
,
DocumentFolder
,
Inbox
,
CommentOne
,
PeopleSpeak
}
from
'@icon-park/vue-next'
import
VoiceCharacterCustomize
from
'../components/voice-character-customize
.vue'
import
DigitalImageCustomization
from
'../components/digital-image-customization
.vue'
const
router
=
useRouter
()
const
route
=
useRoute
()
...
...
@@ -50,11 +50,11 @@ const menuOptions = shallowReadonly<MenuOption[]>([
{
type
:
'group'
,
label
:
'定制'
,
key
:
'Customiz
e
'
,
key
:
'Customiz
ation
'
,
children
:
[
{
label
:
'聲音與數字人形象定制'
,
key
:
'
VoiceDigitalCharacterCustomize
'
,
key
:
'
DigitalImageCustomization
'
,
icon
:
()
=>
h
(
PeopleSpeak
,
{
...
iconConfigFactory
()
}),
},
],
...
...
@@ -62,15 +62,15 @@ const menuOptions = shallowReadonly<MenuOption[]>([
])
const
currentMenuValue
=
ref
(
''
)
const
isShow
ViceCharacterCustomize
Modal
=
ref
(
false
)
const
isShow
DigitalImageCustomization
Modal
=
ref
(
false
)
watchEffect
(()
=>
{
currentMenuValue
.
value
=
route
.
name
as
string
})
function
onMenuValueChange
(
key
:
string
)
{
if
(
key
===
'
VoiceDigitalCharacterCustomize
'
)
{
isShow
ViceCharacterCustomize
Modal
.
value
=
true
if
(
key
===
'
DigitalImageCustomization
'
)
{
isShow
DigitalImageCustomization
Modal
.
value
=
true
return
}
router
.
push
({
name
:
key
})
...
...
@@ -88,5 +88,5 @@ function onMenuValueChange(key: string) {
</div>
</section>
<
VoiceCharacterCustomize
v-model:is-show-voice-character-customize-modal=
"isShowViceCharacterCustomize
Modal"
/>
<
DigitalImageCustomization
v-model:is-show-digital-image-customization-modal=
"isShowDigitalImageCustomization
Modal"
/>
</
template
>
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