Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
text2video-frontend
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
周成波
text2video-frontend
Commits
f69ff7a9
Commit
f69ff7a9
authored
Mar 28, 2024
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SD接口增加模型名称,可更换模型
parent
e42888b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
522 additions
and
158 deletions
+522
-158
text2videoService.ts
src/api/service/text2videoService.ts
+11
-9
useManyValues.ts
src/views/home/compositions/useManyValues.ts
+2
-0
index.vue
src/views/home/index.vue
+509
-149
No files found.
src/api/service/text2videoService.ts
View file @
f69ff7a9
...
...
@@ -2,7 +2,7 @@
* 相关接口
*/
import
request
from
'@/api/request'
import
{
enc
}
from
'crypto-js'
;
export
default
{
submitLLM
(
prompt
:
string
,
llm
:
string
=
"gpt"
,
history
:
Wm
.
PromptHistory
[]
=
[],
task_id
:
string
=
"-"
,
encrypt
:
string
=
"false"
):
Promise
<
string
>
{
...
...
@@ -22,7 +22,7 @@ export default {
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`与LLM通讯失败
:
${
JSON
.
stringify
(
err
.
message
)}
`
);
return
Promise
.
reject
(
`与LLM通讯失败`
);
});
},
...
...
@@ -37,7 +37,8 @@ export default {
seed
:
string
=
"-1"
,
steps
:
string
=
"25"
,
cfg_scale
:
string
=
"9"
,
encrypt
:
string
=
"false"
encrypt
:
string
=
"false"
,
model
:
string
=
""
):
Promise
<
{
"domain_image_path"
:
string
,
"local_image_path"
:
string
}
>
{
if
(
!
prompt
)
{
return
Promise
.
reject
(
"SD提示词不能为空"
);
...
...
@@ -54,6 +55,7 @@ export default {
height
:
height
,
cfg_scale
:
cfg_scale
,
encrypt
:
encrypt
,
model
:
model
,
}
return
request
.
post
(
'/text2video/text2img'
,
post_data
)
.
then
((
res
:
any
)
=>
{
...
...
@@ -67,7 +69,7 @@ export default {
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`与 stable-diffusion-webui Api 通讯失败
:
${
JSON
.
stringify
(
err
.
message
)}
`
);
return
Promise
.
reject
(
`与 stable-diffusion-webui Api 通讯失败`
);
});
},
...
...
@@ -88,7 +90,7 @@ export default {
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`gen_video接口通讯失败
:
${
JSON
.
stringify
(
err
.
message
)}
`
);
return
Promise
.
reject
(
`gen_video接口通讯失败`
);
});
},
...
...
@@ -109,7 +111,7 @@ export default {
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`与pwd_check接口通讯失败
:
${
JSON
.
stringify
(
err
.
message
)}
`
);
return
Promise
.
reject
(
`与pwd_check接口通讯失败`
);
});
},
...
...
@@ -130,7 +132,7 @@ export default {
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`与翻译接口通讯失败
:
${
JSON
.
stringify
(
err
.
message
)}
`
);
return
Promise
.
reject
(
`与翻译接口通讯失败`
);
});
},
...
...
@@ -148,7 +150,7 @@ export default {
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`add_text_to_img接口通讯失败
:
${
JSON
.
stringify
(
err
.
message
)}
`
);
return
Promise
.
reject
(
`add_text_to_img接口通讯失败`
);
});
},
...
...
@@ -166,7 +168,7 @@ export default {
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`与Test Api通讯失败
:
${
JSON
.
stringify
(
err
.
message
)}
`
);
return
Promise
.
reject
(
`与Test Api通讯失败`
);
});
},
}
src/views/home/compositions/useManyValues.ts
View file @
f69ff7a9
...
...
@@ -314,6 +314,7 @@ export const useManyValues = () => {
const
sd_paras
=
{
dreamshaperXL_v21TurboDPMSDE
:
{
model
:
"dreamshaperXL_v21TurboDPMSDE.safetensors"
,
sampler_index
:
"DPM++ SDE Karras"
,
seed
:
"-1"
,
steps
:
"6"
,
...
...
@@ -321,6 +322,7 @@ export const useManyValues = () => {
sd_prompt_prefix
:
sd_prompt_prefix
},
juggernautXL_v9Rdphoto2Lightning
:
{
model
:
"juggernautXL_v9Rdphoto2Lightning.safetensors"
,
sampler_index
:
"Euler"
,
seed
:
"-1"
,
steps
:
"8"
,
...
...
src/views/home/index.vue
View file @
f69ff7a9
...
...
@@ -448,7 +448,7 @@ const onAdaptOneSceneRoles = async (item: any) => {
}
if
(
filter_result
)
{
item
.
角色
=
filter_result
;}
console
.
log
(
'过滤后 item.角色 = '
,
item
.
角色
)
////// 加一段逻辑,本镜角色有且只能有一个,且尽量不与之前相同。【begin】
const
temp_arr
=
item
.
角色
.
split
(
/
[
,,、
]
/
);
const
temp_arr_length
=
temp_arr
.
length
;
...
...
@@ -612,18 +612,20 @@ const onDrawOne = async (item: any) => {
const
seed
=
sd_model
.
seed
;
const
steps
=
sd_model
.
steps
;
const
cfg_scale
=
sd_model
.
cfg_scale
;
const
model
=
sd_model
.
model
;
const
sd_img
=
await
text2videoService
.
submitSD
(
form
.
task_id
,
item
.
编号
,
utils
.
aesEncrypt
(
sd_prompt
),
utils
.
aesEncrypt
(
sd_negative_prompt_prefix
),
utils
.
aesEncrypt
(
form
.
img_size
.
width
),
utils
.
aesEncrypt
(
form
.
img_size
.
height
),
utils
.
aesEncrypt
(
sampler_index
),
utils
.
aesEncrypt
(
seed
),
utils
.
aesEncrypt
(
steps
),
form
.
task_id
,
item
.
编号
,
utils
.
aesEncrypt
(
sd_prompt
),
utils
.
aesEncrypt
(
sd_negative_prompt_prefix
),
utils
.
aesEncrypt
(
form
.
img_size
.
width
),
utils
.
aesEncrypt
(
form
.
img_size
.
height
),
utils
.
aesEncrypt
(
sampler_index
),
utils
.
aesEncrypt
(
seed
),
utils
.
aesEncrypt
(
steps
),
utils
.
aesEncrypt
(
cfg_scale
),
"true"
"true"
,
utils
.
aesEncrypt
(
model
),
);
item
.
本镜配图
=
sd_img
.
domain_image_path
+
"?v="
+
utils
.
genDateTimeStr
();
item
.
local_image_path
=
sd_img
.
local_image_path
;
...
...
@@ -668,7 +670,7 @@ const onGenVideo = async () => {
let
res
=
await
onMarketingTemplateAddTextToPic
(
'product'
);
if
(
!
res
)
{
return
;}
}
console
.
log
(
form
.
adapt_result_json
);
let
video_param_detail
=
[];
// 封面
...
...
@@ -720,7 +722,7 @@ const onGenVideo = async () => {
if
(
sub_bg_color
.
value
)
{
video_param
.
sub_bg_color
=
sub_bg_color
.
value
;
}
const
result
=
await
text2videoService
.
submitGenVideo
(
video_param
);
console
.
log
(
result
);
form
.
final_video
=
""
;
...
...
@@ -814,7 +816,7 @@ const onChangeScreen = (val: string) => {
// cover_backcover.product_pic_local = default_data.cover_backcover.product_pic_local;
// cover_backcover.product_pic_with_text = default_data.cover_backcover.product_pic_with_text;
// cover_backcover.product_pic_with_text_local = default_data.cover_backcover.product_pic_with_text_local;
// cover_backcover.cover_pic = default_data.cover_backcover.cover_pic;
// cover_backcover.cover_pic_local = default_data.cover_backcover.cover_pic_local;
// cover_backcover.cover_pic_with_text = default_data.cover_backcover.cover_pic_with_text;
...
...
@@ -1233,13 +1235,13 @@ const onMarketingTemplateSubmitGpt = async () => {
console
.
log
(
"第二次带历史提问"
)
const
history
=
[
{
'role'
:
utils
.
aesEncrypt
(
'user'
),
'content'
:
utils
.
aesEncrypt
(
marketing_template
.
prompt1
)},
{
'role'
:
utils
.
aesEncrypt
(
'user'
),
'content'
:
utils
.
aesEncrypt
(
marketing_template
.
prompt1
)},
{
'role'
:
utils
.
aesEncrypt
(
'assistant'
),
'content'
:
utils
.
aesEncrypt
(
result1
)}]
let
result2
=
await
text2videoService
.
submitLLM
(
utils
.
aesEncrypt
(
marketing_template
.
prompt2
),
utils
.
aesEncrypt
(
wen_an_llm
.
api
),
history
,
form
.
task_id
,
"true"
);
marketing_template
.
result2
=
result2
;
// console.log(JSON.stringify(history), marketing_template.prompt2);
// console.log(marketing_template.result2);
form
.
chatgpt_answer
=
result2
;
marketingTemplateVisible
.
value
=
false
;
}
...
...
@@ -1301,8 +1303,12 @@ const onSelectCoverChange = (value: any) => {
<el-input
v-model=
"form.chatgpt_prompt"
:autosize=
"true"
type=
"textarea"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmitGpt"
>
生成文案(
{{
wen_an_llm
.
name
}}
)
</el-button>
<el-button
type=
"danger"
@
click=
"marketingTemplateVisible = true"
>
通过营销模板生成文案
</el-button>
<el-button
type=
"primary"
@
click=
"onSubmitGpt"
>
生成文案(
{{
wen_an_llm
.
name
}}
)
</el-button
>
<el-button
type=
"danger"
@
click=
"marketingTemplateVisible = true"
>
通过营销模板生成文案
</el-button
>
</el-form-item>
<el-form-item
label=
"文案"
>
<template
v-if=
"marketing_template.result2"
>
...
...
@@ -1317,33 +1323,62 @@ const onSelectCoverChange = (value: any) => {
</el-form-item>
<!-- 角色 -->
<el-form-item>
<el-button
type=
"primary"
@
click=
"onAdaptRoles"
>
推理角色({{ role_llm.name }})
</el-button>
<el-button
type=
"primary"
@
click=
"onAdaptRolesKeywords"
>
推理角色关键词({{ role_keywords_llm.name }})
</el-button>
<el-button
type=
"primary"
@
click=
"onAdaptRoles"
>
推理角色({{ role_llm.name }})
</el-button
>
<el-button
type=
"primary"
@
click=
"onAdaptRolesKeywords"
>
推理角色关键词({{ role_keywords_llm.name }})
</el-button
>
<el-button
plain
@
click=
"clean_roles"
>
清空总角色列表
</el-button>
</el-form-item>
<el-form-item
label=
"角色"
>
<el-table
:data=
"form.chatgpt_answer_roles"
border
style=
"width: 100%; z-index: calc(var(--el-table-index) -1)"
>
<el-table
:data=
"form.chatgpt_answer_roles"
border
style=
"width: 100%; z-index: calc(var(--el-table-index) -1)"
>
<el-table-column
prop=
"角色"
label=
"角色"
width=
"300"
>
<
template
v-slot=
"scope"
>
<el-input
v-model=
"scope.row.角色"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"scope.row.角色"
:autosize=
"true"
type=
"textarea"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"属性"
label=
"属性"
width=
"300"
>
<
template
v-slot=
"scope"
>
<el-select
v-model=
"scope.row.属性"
filterable
allow-create
:reserve-keyword=
"false"
>
<el-option
v-for=
"item in default_data.role_attribute_options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
<el-select
v-model=
"scope.row.属性"
filterable
allow-create
:reserve-keyword=
"false"
>
<el-option
v-for=
"item in default_data.role_attribute_options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</
template
>
</el-table-column>
<el-table-column
prop=
"角色关键词"
label=
"角色关键词"
>
<
template
v-slot=
"scope"
>
<el-input
v-model=
"scope.row.角色关键词"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"scope.row.角色关键词"
:autosize=
"true"
type=
"textarea"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"角色关键词英文"
label=
"角色关键词英文"
>
<
template
v-slot=
"scope"
>
<el-input
v-model=
"scope.row.角色关键词英文"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"scope.row.角色关键词英文"
:autosize=
"true"
type=
"textarea"
></el-input>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -1351,32 +1386,57 @@ const onSelectCoverChange = (value: any) => {
<!-- 分镜 -->
<el-form-item>
<el-button
type=
"primary"
@
click=
"onAdapt"
>
分镜
</el-button>
<el-button
type=
"primary"
@
click=
"onAdaptScene"
>
推理场景({{ tuili_llm.name }})
</el-button>
<el-button
type=
"primary"
@
click=
"onAdaptSceneRoles"
>
推理场景中的角色({{ tuili_keyword_llm.name }})
</el-button>
<el-button
type=
"primary"
@
click=
"onAdaptScene"
>
推理场景({{ tuili_llm.name }})
</el-button
>
<el-button
type=
"primary"
@
click=
"onAdaptSceneRoles"
>
推理场景中的角色({{ tuili_keyword_llm.name }})
</el-button
>
<el-button
type=
"primary"
@
click=
"onDraw"
>
绘图
</el-button>
<el-button
plain
@
click=
"clean_scenes"
>
清空分镜列表
</el-button>
</el-form-item>
<el-form-item
label=
"分镜"
>
<el-table
:data=
"form.adapt_result_json"
border
style=
"width: 100%; z-index: calc(var(--el-table-index) -1)"
>
<el-table
:data=
"form.adapt_result_json"
border
style=
"width: 100%; z-index: calc(var(--el-table-index) -1)"
>
<el-table-column
prop=
"编号"
label=
"编号"
width=
"55"
/>
<el-table-column
prop=
"场景描述"
label=
"场景描述"
>
<
template
v-slot=
"scope"
>
<el-input
v-model=
"scope.row.场景描述"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"scope.row.场景描述"
:autosize=
"true"
type=
"textarea"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"场景关键词"
label=
"场景关键词"
>
<
template
v-slot=
"scope"
>
<el-text
class=
"mx-1"
size=
"small"
>
{{
scope
.
row
.
场景关键词
}}
</el-text>
<hr
style=
"border: none; border-top: 1px dashed #999; margin: 5px 0;"
>
<el-input
v-model=
"scope.row.场景关键词英文"
:autosize=
"true"
type=
"textarea"
></el-input>
<hr
style=
"border: none; border-top: 1px dashed #999; margin: 5px 0"
/>
<el-input
v-model=
"scope.row.场景关键词英文"
:autosize=
"true"
type=
"textarea"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"角色"
label=
"角色"
>
<
template
v-slot=
"scope"
>
<el-text
class=
"mx-1"
size=
"small"
>
{{
scope
.
row
.
info
}}
</el-text>
<hr
style=
"border: none; border-top: 1px dashed #999; margin: 5px 0;"
>
<el-select
v-model=
"scope.row.角色"
placeholder=
""
@
change=
"onItemRolesChange(scope.row)"
>
<el-option
v-for=
"item in scope.row.roles"
:key=
"item"
:label=
"item"
:value=
"item"
>
<hr
style=
"border: none; border-top: 1px dashed #999; margin: 5px 0"
/>
<el-select
v-model=
"scope.row.角色"
placeholder=
""
@
change=
"onItemRolesChange(scope.row)"
>
<el-option
v-for=
"item in scope.row.roles"
:key=
"item"
:label=
"item"
:value=
"item"
>
<span
style=
"float: left"
>
{{
item
}}
</span>
</el-option>
</el-select>
...
...
@@ -1386,15 +1446,26 @@ const onSelectCoverChange = (value: any) => {
<el-table-column
prop=
"角色关键词"
label=
"角色关键词"
>
<
template
v-slot=
"scope"
>
<el-text
class=
"mx-1"
size=
"small"
>
{{
scope
.
row
.
角色关键词
}}
</el-text>
<hr
style=
"border: none; border-top: 1px dashed #999; margin: 5px 0;"
>
<el-input
v-model=
"scope.row.角色关键词英文"
:autosize=
"true"
type=
"textarea"
></el-input>
<hr
style=
"border: none; border-top: 1px dashed #999; margin: 5px 0"
/>
<el-input
v-model=
"scope.row.角色关键词英文"
:autosize=
"true"
type=
"textarea"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"本镜配图"
label=
"本镜配图"
width=
"300"
>
<
template
v-slot=
"scope"
>
<div>
<el-image
:src=
"scope.row.本镜配图"
:zoom-rate=
"1.2"
:max-scale=
"1.5"
:min-scale=
"0.5"
:preview-src-list=
"[scope.row.本镜配图]"
fit=
"cover"
:hide-on-click-modal=
"true"
/>
<el-image
:src=
"scope.row.本镜配图"
:zoom-rate=
"1.2"
:max-scale=
"1.5"
:min-scale=
"0.5"
:preview-src-list=
"[scope.row.本镜配图]"
fit=
"cover"
:hide-on-click-modal=
"true"
/>
</div>
</
template
>
</el-table-column>
...
...
@@ -1405,184 +1476,420 @@ const onSelectCoverChange = (value: any) => {
</template>
-->
<
template
v-slot=
"scope"
>
<div
style=
"margin: 5px 0"
><el-button
type=
"primary"
size=
"small"
@
click=
"onAdaptOneScene(scope.row)"
>
推理场景
</el-button></div>
<div
style=
"margin: 5px 0"
><el-button
type=
"primary"
size=
"small"
@
click=
"onAdaptOneSceneRoles(scope.row)"
>
推理角色
</el-button></div>
<div
style=
"margin: 5px 0"
><el-button
type=
"primary"
size=
"small"
@
click=
"onDrawOne(scope.row)"
>
绘图
</el-button></div>
<el-upload
ref=
"upload"
:show-file-list=
"false"
:limit=
"1"
accept=
".png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.gif,.GIF,.bmp,.BMP"
:action=
"actionUrl"
:on-success=
"handleUploadSuccess"
:on-exceed=
"handleUploadExceed"
:on-error=
"handleUploadError"
:data=
"
{ width: form.img_size.width, height: form.img_size.height }"
:before-upload="handleBeforeUpload">
<el-button
type=
"primary"
size=
"small"
@
click=
"onClickUpload(scope.row)"
>
上传图片
</el-button>
<div
style=
"margin: 5px 0"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"onAdaptOneScene(scope.row)"
>
推理场景
</el-button
>
</div>
<div
style=
"margin: 5px 0"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"onAdaptOneSceneRoles(scope.row)"
>
推理角色
</el-button
>
</div>
<div
style=
"margin: 5px 0"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"onDrawOne(scope.row)"
>
绘图
</el-button
>
</div>
<el-upload
ref=
"upload"
:show-file-list=
"false"
:limit=
"1"
accept=
".png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.gif,.GIF,.bmp,.BMP"
:action=
"actionUrl"
:on-success=
"handleUploadSuccess"
:on-exceed=
"handleUploadExceed"
:on-error=
"handleUploadError"
:data=
"
{ width: form.img_size.width, height: form.img_size.height }"
:before-upload="handleBeforeUpload"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"onClickUpload(scope.row)"
>
上传图片
</el-button
>
</el-upload>
<!--
<div
style=
"margin: 5px 0"
><el-button
plain
size=
"small"
@
click=
"onClearOnePic(scope.row)"
>
清除图片
</el-button></div>
-->
<div
style=
"margin: 5px 0"
><el-button
plain
size=
"small"
@
click=
"showsdprompt(scope.row)"
>
debug
</el-button></div>
<el-dialog
v-model=
dialogVisible
width=
"80%"
>
<div
style=
"margin: 5px 0"
>
<el-button
plain
size=
"small"
@
click=
"showsdprompt(scope.row)"
>
debug
</el-button
>
</div>
<el-dialog
v-model=
"dialogVisible"
width=
"80%"
>
<p>
{{
dialogData
}}
</p>
<template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"dialogVisible = false"
>
ok
</el-button>
<el-button
type=
"primary"
@
click=
"dialogVisible = false"
>
ok
</el-button
>
</div>
</
template
>
</el-dialog>
<div
style=
"margin: 10px 0"
><el-button
type=
"danger"
size=
"small"
@
click=
"onDeleteOne(scope.row)"
>
删除本镜
</el-button></div>
<div
style=
"margin: 10px 0"
>
<el-button
type=
"danger"
size=
"small"
@
click=
"onDeleteOne(scope.row)"
>
删除本镜
</el-button
>
</div>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item
label=
"封面图片"
>
<el-switch
v-model=
"cover_backcover.if_need_cover_pic"
active-value=
"true"
inactive-value=
"false"
/>
<el-switch
v-model=
"cover_backcover.if_need_cover_pic"
active-value=
"true"
inactive-value=
"false"
/>
</el-form-item>
<div
v-if=
"JSON.parse(cover_backcover.if_need_cover_pic.toLowerCase())"
>
<el-form-item>
<!-- :style="{ width: String(parseInt(form.img_size.width) / 3)+'px', height: String(parseInt(form.img_size.height) / 3)+'px' }" -->
<div
:style=
"{ width: String(parseInt(form.img_size.width) / 3)+'px' }"
class=
"dashed-div"
>
<div
:style=
"{ width: String(parseInt(form.img_size.width) / 3) + 'px' }"
class=
"dashed-div"
>
<el-image
:src=
"cover_backcover.cover_pic"
/>
</div>
<div
:style=
"{ width: String(parseInt(form.img_size.width) / 3)+'px' }"
class=
"dashed-div"
style=
"margin-left: 20px;"
>
<div
:style=
"{ width: String(parseInt(form.img_size.width) / 3) + 'px' }"
class=
"dashed-div"
style=
"margin-left: 20px"
>
<el-image
:src=
"cover_backcover.cover_pic_with_text"
/>
</div>
</el-form-item>
<el-form-item>
<el-upload
ref=
"upload_cover"
:show-file-list=
"false"
:limit=
"1"
accept=
".png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.gif,.GIF,.bmp,.BMP"
:action=
"actionUrl"
:on-success=
"MarketingTemplateUploadCoverPicSuccess"
:on-exceed=
"handleMarketingTemplateUploadCoverPicExceed"
:on-error=
"handleUploadError"
:data=
"{ width: form.img_size.width, height: form.img_size.height }"
:before-upload=
"handleBeforeUpload"
>
<el-upload
ref=
"upload_cover"
:show-file-list=
"false"
:limit=
"1"
accept=
".png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.gif,.GIF,.bmp,.BMP"
:action=
"actionUrl"
:on-success=
"MarketingTemplateUploadCoverPicSuccess"
:on-exceed=
"handleMarketingTemplateUploadCoverPicExceed"
:on-error=
"handleUploadError"
:data=
"{ width: form.img_size.width, height: form.img_size.height }"
:before-upload=
"handleBeforeUpload"
>
<el-button
type=
"primary"
size=
"small"
>
上传图片
</el-button>
</el-upload>
<span
style=
"margin-left:12px;"
>
或使用第
</span>
<el-select
size=
"small"
v-model=
"cover_backcover.cover_pic_use_scene"
placeholder=
"选择"
style=
"width: 60px;"
@
change=
"onSelectCoverChange"
>
<el-option
v-for=
"item in form.adapt_result_json"
:key=
"item.编号"
:label=
"item.编号"
:value=
"item.编号"
>
<span
style=
"margin-left: 12px"
>
或使用第
</span>
<el-select
size=
"small"
v-model=
"cover_backcover.cover_pic_use_scene"
placeholder=
"选择"
style=
"width: 60px"
@
change=
"onSelectCoverChange"
>
<el-option
v-for=
"item in form.adapt_result_json"
:key=
"item.编号"
:label=
"item.编号"
:value=
"item.编号"
>
<span
style=
"float: left"
>
{{ item.编号 }}
</span>
</el-option>
</el-select>
<span>
帧做封面
</span>
<el-button
type=
"danger"
size=
"small"
@
click=
"onClearMarketingTemplatePic('cover')"
style=
"margin-left: 12px;"
>
清除图片
</el-button>
<el-button
type=
"danger"
size=
"small"
@
click=
"onClearMarketingTemplatePic('cover')"
style=
"margin-left: 12px"
>
清除图片
</el-button
>
</el-form-item>
<el-form-item>
<div
style=
"width: 100%;"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"onAddMarketingTemplatePicText('cover', 'add', 0)"
>
增加文字
</el-button>
<div
style=
"width: 100%"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"onAddMarketingTemplatePicText('cover', 'add', 0)"
>
增加文字
</el-button
>
<!-- <el-button type="success" size="small" @click="onMarketingTemplateAddTextToPic('cover')">预览</el-button> -->
</div>
<div
v-for=
"(pic_title, index) in cover_backcover.cover_pic_titles"
:key=
"index"
class=
"dashed-div"
style=
"width: 100%;"
>
<el-input
v-model=
"pic_title.text"
:autosize=
"true"
type=
"textarea"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
></el-input>
<span
style=
"margin-left:10px;"
>
字体颜色:
</span>
<el-color-picker
v-model=
"pic_title.color"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
/>
<span
style=
"margin-left:30px;"
>
字体背景:
</span>
<el-color-picker
v-model=
"pic_title.bg_color"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
/>
<span
style=
"margin-left:30px;"
>
字体大小:
</span>
<el-input-number
v-model=
"pic_title.font_size"
:min=
"1"
:max=
"100"
controls-position=
"right"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
/>
<span
style=
"margin-left:30px;"
>
在图片上的位置:
</span>
<el-slider
v-model=
"pic_title.position"
:step=
"0.01"
:min=
"0"
:max=
"1"
show-input
vertical
height=
"100px"
style=
"margin-top: 10px;"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
/>
<el-button
type=
"danger"
size=
"small"
@
click=
"onAddMarketingTemplatePicText('cover', 'del', index)"
style=
"margin-left: 80px;"
>
删除文字
</el-button>
<div
v-for=
"(pic_title, index) in cover_backcover.cover_pic_titles"
:key=
"index"
class=
"dashed-div"
style=
"width: 100%"
>
<el-input
v-model=
"pic_title.text"
:autosize=
"true"
type=
"textarea"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
></el-input>
<span
style=
"margin-left: 10px"
>
字体颜色:
</span>
<el-color-picker
v-model=
"pic_title.color"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
/>
<span
style=
"margin-left: 30px"
>
字体背景:
</span>
<el-color-picker
v-model=
"pic_title.bg_color"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
/>
<span
style=
"margin-left: 30px"
>
字体大小:
</span>
<el-input-number
v-model=
"pic_title.font_size"
:min=
"1"
:max=
"100"
controls-position=
"right"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
/>
<span
style=
"margin-left: 30px"
>
在图片上的位置:
</span>
<el-slider
v-model=
"pic_title.position"
:step=
"0.01"
:min=
"0"
:max=
"1"
show-input
vertical
height=
"100px"
style=
"margin-top: 10px"
@
change=
"onMarketingTemplateAddTextToPic('cover')"
/>
<el-button
type=
"danger"
size=
"small"
@
click=
"onAddMarketingTemplatePicText('cover', 'del', index)"
style=
"margin-left: 80px"
>
删除文字
</el-button
>
</div>
</el-form-item>
</div>
<el-form-item
label=
"封底图片"
>
<el-switch
v-model=
"cover_backcover.if_need_product_pic"
active-value=
"true"
inactive-value=
"false"
/>
<el-switch
v-model=
"cover_backcover.if_need_product_pic"
active-value=
"true"
inactive-value=
"false"
/>
</el-form-item>
<div
v-if=
"JSON.parse(cover_backcover.if_need_product_pic.toLowerCase())"
>
<el-form-item>
<!-- :style="{ width: String(parseInt(form.img_size.width) / 3)+'px', height: String(parseInt(form.img_size.height) / 3)+'px' }" -->
<div
:style=
"{ width: String(parseInt(form.img_size.width) / 3)+'px' }"
class=
"dashed-div"
>
<div
:style=
"{ width: String(parseInt(form.img_size.width) / 3) + 'px' }"
class=
"dashed-div"
>
<el-image
:src=
"cover_backcover.product_pic"
/>
</div>
<div
:style=
"{ width: String(parseInt(form.img_size.width) / 3)+'px' }"
class=
"dashed-div"
style=
"margin-left: 20px;"
>
<div
:style=
"{ width: String(parseInt(form.img_size.width) / 3) + 'px' }"
class=
"dashed-div"
style=
"margin-left: 20px"
>
<el-image
:src=
"cover_backcover.product_pic_with_text"
/>
</div>
</el-form-item>
<el-form-item>
<el-upload
ref=
"upload_product"
:show-file-list=
"false"
:limit=
"1"
accept=
".png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.gif,.GIF,.bmp,.BMP"
:action=
"actionUrl"
:on-success=
"MarketingTemplateUploadProductPicSuccess"
:on-exceed=
"handleMarketingTemplateUploadProductPicExceed"
:on-error=
"handleUploadError"
:data=
"{ width: form.img_size.width, height: form.img_size.height }"
:before-upload=
"handleBeforeUpload"
>
<el-upload
ref=
"upload_product"
:show-file-list=
"false"
:limit=
"1"
accept=
".png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.gif,.GIF,.bmp,.BMP"
:action=
"actionUrl"
:on-success=
"MarketingTemplateUploadProductPicSuccess"
:on-exceed=
"handleMarketingTemplateUploadProductPicExceed"
:on-error=
"handleUploadError"
:data=
"{ width: form.img_size.width, height: form.img_size.height }"
:before-upload=
"handleBeforeUpload"
>
<el-button
type=
"primary"
size=
"small"
>
上传图片
</el-button>
</el-upload>
<el-button
type=
"danger"
size=
"small"
@
click=
"onClearMarketingTemplatePic('product')"
style=
"margin-left: 12px;"
>
清除图片
</el-button>
<el-button
type=
"danger"
size=
"small"
@
click=
"onClearMarketingTemplatePic('product')"
style=
"margin-left: 12px"
>
清除图片
</el-button
>
</el-form-item>
<el-form-item>
<div
style=
"width: 100%;"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"onAddMarketingTemplatePicText('product', 'add', 0)"
>
增加文字
</el-button>
<div
style=
"width: 100%"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"onAddMarketingTemplatePicText('product', 'add', 0)"
>
增加文字
</el-button
>
<!-- <el-button type="success" size="small" @click="onMarketingTemplateAddTextToPic('product')">预览</el-button> -->
</div>
<div
v-for=
"(pic_title, index) in cover_backcover.product_pic_titles"
:key=
"index"
class=
"dashed-div"
style=
"width: 100%;"
>
<el-input
v-model=
"pic_title.text"
:autosize=
"true"
type=
"textarea"
@
change=
"onMarketingTemplateAddTextToPic('product')"
></el-input>
<span
style=
"margin-left:10px;"
>
字体颜色:
</span>
<el-color-picker
v-model=
"pic_title.color"
@
change=
"onMarketingTemplateAddTextToPic('product')"
/>
<span
style=
"margin-left:30px;"
>
字体背景:
</span>
<el-color-picker
v-model=
"pic_title.bg_color"
@
change=
"onMarketingTemplateAddTextToPic('product')"
/>
<span
style=
"margin-left:30px;"
>
字体大小:
</span>
<el-input-number
v-model=
"pic_title.font_size"
:min=
"1"
:max=
"100"
controls-position=
"right"
@
change=
"onMarketingTemplateAddTextToPic('product')"
/>
<span
style=
"margin-left:30px;"
>
在图片上的位置:
</span>
<el-slider
v-model=
"pic_title.position"
:step=
"0.01"
:min=
"0"
:max=
"1"
show-input
vertical
height=
"100px"
style=
"margin-top: 10px;"
@
change=
"onMarketingTemplateAddTextToPic('product')"
/>
<el-button
type=
"danger"
size=
"small"
@
click=
"onAddMarketingTemplatePicText('product', 'del', index)"
style=
"margin-left: 80px;"
>
删除文字
</el-button>
<div
v-for=
"(pic_title, index) in cover_backcover.product_pic_titles"
:key=
"index"
class=
"dashed-div"
style=
"width: 100%"
>
<el-input
v-model=
"pic_title.text"
:autosize=
"true"
type=
"textarea"
@
change=
"onMarketingTemplateAddTextToPic('product')"
></el-input>
<span
style=
"margin-left: 10px"
>
字体颜色:
</span>
<el-color-picker
v-model=
"pic_title.color"
@
change=
"onMarketingTemplateAddTextToPic('product')"
/>
<span
style=
"margin-left: 30px"
>
字体背景:
</span>
<el-color-picker
v-model=
"pic_title.bg_color"
@
change=
"onMarketingTemplateAddTextToPic('product')"
/>
<span
style=
"margin-left: 30px"
>
字体大小:
</span>
<el-input-number
v-model=
"pic_title.font_size"
:min=
"1"
:max=
"100"
controls-position=
"right"
@
change=
"onMarketingTemplateAddTextToPic('product')"
/>
<span
style=
"margin-left: 30px"
>
在图片上的位置:
</span>
<el-slider
v-model=
"pic_title.position"
:step=
"0.01"
:min=
"0"
:max=
"1"
show-input
vertical
height=
"100px"
style=
"margin-top: 10px"
@
change=
"onMarketingTemplateAddTextToPic('product')"
/>
<el-button
type=
"danger"
size=
"small"
@
click=
"onAddMarketingTemplatePicText('product', 'del', index)"
style=
"margin-left: 80px"
>
删除文字
</el-button
>
</div>
</el-form-item>
<el-form-item
label=
"封底旁白"
>
<el-input
v-model=
"cover_backcover.product_pic_speech"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"cover_backcover.product_pic_speech"
:autosize=
"true"
type=
"textarea"
></el-input>
</el-form-item>
</div>
<!-- 生成视频 -->
<el-form-item
label=
"视频设置"
>
<span
style=
"margin: 0 20px 0 0"
>
TTS语速:
</span>
<el-slider
v-model=
"voice_rate"
show-input
:min=
"-50"
:max=
"50"
:marks=
"default_data.marks"
style=
"width: 900px"
/>
<el-slider
v-model=
"voice_rate"
show-input
:min=
"-50"
:max=
"50"
:marks=
"default_data.marks"
style=
"width: 900px"
/>
</el-form-item>
<el-form-item>
<span
style=
"margin: 0 20px 0 0"
>
TTS音量:
</span>
<el-slider
v-model=
"voice_volume"
show-input
:min=
"-80"
:max=
"80"
:marks=
"default_data.marks"
style=
"width: 900px"
/>
<el-slider
v-model=
"voice_volume"
show-input
:min=
"-80"
:max=
"80"
:marks=
"default_data.marks"
style=
"width: 900px"
/>
</el-form-item>
<el-form-item>
<span
style=
"margin: 20px 20px 0 0"
>
TTS语音:
</span>
<el-select
v-model=
"voice"
placeholder=
"Select"
style=
"width: 400px; margin-top: 20px;"
>
<el-option
v-for=
"item in default_data.voices"
:key=
"item.value"
:label=
"item.value"
:value=
"item.value"
>
<el-select
v-model=
"voice"
placeholder=
"Select"
style=
"width: 400px; margin-top: 20px"
>
<el-option
v-for=
"item in default_data.voices"
:key=
"item.value"
:label=
"item.value"
:value=
"item.value"
>
<span
style=
"float: left"
>
{{ item.value }}
</span>
<span
style=
"
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>
{{ item.label }}
</span>
<span
style=
"float: right; color: var(--el-text-color-secondary); font-size: 13px"
>
{{ item.label }}
</span
>
</el-option>
</el-select>
<audio
:src=
"'src/assets/edge-tts-voices/' + voice + '.mp3'"
controls
style=
"height: 30px; margin: 20px 0 0 10px;"
></audio>
<audio
:src=
"'src/assets/edge-tts-voices/' + voice + '.mp3'"
controls
style=
"height: 30px; margin: 20px 0 0 10px"
></audio>
</el-form-item>
<el-form-item>
<span
style=
"margin: 0 20px 0 0"
>
背景音乐:
</span>
<el-select
v-model=
"bgm"
placeholder=
"无"
style=
"width: 400px;"
>
<el-option
v-for=
"item in default_data.bgm"
:key=
"item.value"
:label=
"item.value"
:value=
"item.value"
>
<el-select
v-model=
"bgm"
placeholder=
"无"
style=
"width: 400px"
>
<el-option
v-for=
"item in default_data.bgm"
:key=
"item.value"
:label=
"item.value"
:value=
"item.value"
>
<span
style=
"float: left"
>
{{ item.label }}
</span>
<span
style=
"
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>
{{ item.value }}
</span>
<span
style=
"float: right; color: var(--el-text-color-secondary); font-size: 13px"
>
{{ item.value }}
</span
>
</el-option>
</el-select>
<audio
:src=
"'src/assets/bgm/' + bgm + '.mp3'"
controls
style=
"height: 30px; margin-left:10px;"
></audio>
<audio
:src=
"'src/assets/bgm/' + bgm + '.mp3'"
controls
style=
"height: 30px; margin-left: 10px"
></audio>
</el-form-item>
<el-form-item>
<span
style=
"margin: 0 20px 0 0"
>
背景音量:
</span>
<el-slider
v-model=
"bgm_volume"
show-input
:step=
"0.1"
:min=
"0"
:max=
"2"
:marks=
"default_data.bgm_volume_marks"
style=
"width: 600px"
/>
<el-slider
v-model=
"bgm_volume"
show-input
:step=
"0.1"
:min=
"0"
:max=
"2"
:marks=
"default_data.bgm_volume_marks"
style=
"width: 600px"
/>
</el-form-item>
<el-form-item>
<span
style=
"margin: 20px 20px 20px 0"
>
字幕合成:
</span>
<el-switch
v-model=
"form.if_need_subtitle"
active-value=
"true"
inactive-value=
"false"
/>
<el-switch
v-model=
"form.if_need_subtitle"
active-value=
"true"
inactive-value=
"false"
/>
<div
v-if=
"JSON.parse(form.if_need_subtitle.toLowerCase())"
>
<span
style=
"margin-left:
30px;
"
>
字体颜色:
</span>
<span
style=
"margin-left:
30px
"
>
字体颜色:
</span>
<el-color-picker
v-model=
"sub_font_color"
/>
<span
style=
"margin-left:
30px;
"
>
字体背景:
</span>
<span
style=
"margin-left:
30px
"
>
字体背景:
</span>
<el-color-picker
v-model=
"sub_bg_color"
/>
<span
style=
"margin-left:30px;"
>
字体大小:
</span>
<el-input-number
v-model=
"sub_font_size"
:min=
"1"
:max=
"50"
controls-position=
"right"
/>
<span
style=
"margin-left:30px;"
>
在屏幕上的位置:
</span>
<el-slider
v-model=
"sub_position"
:step=
"0.1"
:min=
"0"
:max=
"1"
show-input
vertical
height=
"100px"
/>
<span
style=
"margin-left: 30px"
>
字体大小:
</span>
<el-input-number
v-model=
"sub_font_size"
:min=
"1"
:max=
"50"
controls-position=
"right"
/>
<span
style=
"margin-left: 30px"
>
在屏幕上的位置:
</span>
<el-slider
v-model=
"sub_position"
:step=
"0.1"
:min=
"0"
:max=
"1"
show-input
vertical
height=
"100px"
/>
</div>
</el-form-item>
<el-form-item>
...
...
@@ -1593,12 +1900,23 @@ const onSelectCoverChange = (value: any) => {
</el-form-item>
</el-form>
<!-- 授权密码框 -->
<el-dialog
v-model=
pwdCheckDialogVisible
title=
"请输入密码"
width=
"20%"
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
:show-close=
"false"
>
<el-dialog
v-model=
"pwdCheckDialogVisible"
title=
"请输入密码"
width=
"20%"
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
:show-close=
"false"
>
<el-form
:model=
"form"
>
<el-form-item
label=
"密码"
>
<el-input
v-model=
"pwdCheckValue"
autocomplete=
"off"
type=
"password"
show-password
@
keyup
.
enter=
"onPwdCheckDialog()"
/>
<el-input
v-model=
"pwdCheckValue"
autocomplete=
"off"
type=
"password"
show-password
@
keyup
.
enter=
"onPwdCheckDialog()"
/>
</el-form-item>
</el-form>
...
...
@@ -1610,8 +1928,16 @@ const onSelectCoverChange = (value: any) => {
</el-dialog>
<!-- 营销模板 -->
<el-dialog
v-model=
marketingTemplateVisible
title=
"营销模板"
width=
"60%"
height=
"500"
:close-on-click-modal=
"false"
:close-on-press-escape=
"true"
:show-close=
"true"
:lock-scroll=
"true"
>
<el-dialog
v-model=
"marketingTemplateVisible"
title=
"营销模板"
width=
"60%"
height=
"500"
:close-on-click-modal=
"false"
:close-on-press-escape=
"true"
:show-close=
"true"
:lock-scroll=
"true"
>
<!--
<el-tabs v-model="activeTab">
<el-tab-pane label="商品" name="first">User</el-tab-pane>
...
...
@@ -1623,38 +1949,72 @@ const onSelectCoverChange = (value: any) => {
-->
<el-form
:model=
"marketing_template"
>
<el-form-item
label=
"商品名称"
>
<el-input
v-model=
"marketing_template.product_name"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"marketing_template.product_name"
:autosize=
"true"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"商品描述"
>
<el-input
v-model=
"marketing_template.product_description"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"marketing_template.product_description"
:autosize=
"true"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"目标群体"
>
<el-input
v-model=
"marketing_template.target_people"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"marketing_template.target_people"
:autosize=
"true"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"文案主角"
>
<el-input
v-model=
"marketing_template.text_role"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"marketing_template.text_role"
:autosize=
"true"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"文案风格"
>
<el-input
v-model=
"marketing_template.text_style"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"marketing_template.text_style"
:autosize=
"true"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"故事类型"
>
<el-input
v-model=
"marketing_template.story_type"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"marketing_template.story_type"
:autosize=
"true"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"参考信息"
>
<el-input
v-model=
"marketing_template.reference"
:autosize=
"true"
type=
"textarea"
></el-input>
<el-input
v-model=
"marketing_template.reference"
:autosize=
"true"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"文案字数"
>
<el-input-number
v-model=
"marketing_template.words_num"
:min=
"100"
:max=
"500"
controls-position=
"right"
/>
<el-input-number
v-model=
"marketing_template.words_num"
:min=
"100"
:max=
"500"
controls-position=
"right"
/>
</el-form-item>
</el-form>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"marketingTemplateVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"onMarketingTemplateSubmitGpt()"
>
提交
</el-button>
<el-button
type=
"primary"
@
click=
"onMarketingTemplateSubmitGpt()"
>
提交
</el-button
>
</div>
</
template
>
</el-dialog>
</main>
</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