Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
e877c464
提交
e877c464
authored
4月 12, 2024
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
a5a9819a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
75 行增加
和
62 行删除
+75
-62
AIChat.vue
src/modules/material/all/components/AIChat.vue
+11
-7
StepThree.vue
src/modules/material/all/components/StepThree.vue
+63
-54
Update.vue
src/modules/material/all/views/Update.vue
+1
-1
没有找到文件。
src/modules/material/all/components/AIChat.vue
浏览文件 @
e877c464
...
...
@@ -44,12 +44,12 @@ watch(welcomeMessage, () => {
})
// 设置为最后一条ai回复的内容
watchEffect
(()
=>
{
const
botLastMessage
=
messages
.
value
.
findLast
(
item
=>
item
.
role
===
'bot'
)
if
(
botLastMessage
)
{
form
.
value
.
content
=
botLastMessage
.
content
}
})
//
watchEffect(() => {
//
const botLastMessage = messages.value.findLast(item => item.role === 'bot')
//
if (botLastMessage) {
//
form.value.content = botLastMessage.content
//
}
//
})
async
function
postMessage
()
{
if
(
!
content
.
value
)
return
...
...
@@ -152,9 +152,13 @@ function parseHtml(content) {
</
template
>
<
style
lang=
"scss"
>
.chat
{
height
:
calc
(
100vh
-
90px
-
280px
);
overflow-y
:
auto
;
}
.chat-footer
{
position
:
relative
;
margin
:
40px
0
;
margin
-top
:
40px
;
.el-textarea__inner
{
padding
:
16px
;
resize
:
none
;
...
...
src/modules/material/all/components/StepThree.vue
浏览文件 @
e877c464
...
...
@@ -37,61 +37,63 @@ async function handleSubmit() {
</
script
>
<
template
>
<el-card
shadow=
"never"
>
<template
#
header
>
内容创作
</
template
>
<el-form
label-suffix=
":"
inline
class=
"info-form"
>
<el-form-item
label=
"内容名称"
>
{{ form.name }}
</el-form-item>
<el-form-item
label=
"内容类型"
>
{{ typeName }}
</el-form-item>
<el-form-item
label=
"创作方式"
>
{{ getNameByValue(form.way, materialMethodList) }}
</el-form-item>
</el-form>
<el-divider></el-divider>
<el-form
label-suffix=
":"
label-width=
"130"
:model=
"form"
:rules=
"rules"
ref=
"formRef"
:disabled=
"action === 'view'"
>
<el-form-item
:label=
"`${typeName}资源`"
prop=
"content"
v-if=
"form.way == 2"
>
<
template
v-if=
"form.type == 1"
>
<!-- 文本 -->
<el-input
type=
"textarea"
rows=
"6"
v-model=
"form.content"
></el-input>
</
template
>
<
template
v-if=
"['2', '6', '7', '8'].includes(form.type)"
>
<!-- 图片|二维码|小程序|卡券 -->
<AppUpload
v-model=
"form.content"
accept=
"image/*"
></AppUpload>
</
template
>
<
template
v-if=
"form.type == 3"
>
<!-- 语音 -->
<div>
<AppUpload
v-model=
"form.content"
accept=
".mp3"
>
<el-button
type=
"primary"
>
上传语音
</el-button>
</AppUpload>
<audio
:src=
"form.content"
controls
v-if=
"form.content"
></audio>
</div>
</
template
>
<
template
v-if=
"form.type == 4"
>
<!-- 视频 -->
<div>
<AppUpload
v-model=
"form.content"
accept=
".mp4"
>
<el-button
type=
"primary"
>
上传视频
</el-button>
</AppUpload>
<video
controls
:src=
"form.content"
style=
"max-width: 600px; width: 100%"
v-if=
"form.content"
></video>
</div>
</
template
>
<
template
v-if=
"form.type == 5"
>
<el-input
v-model=
"form.content"
placeholder=
"请输入"
>
<template
#
prepend
>
https://
</
template
>
<
template
#
append
v-if=
"form.content"
>
<a
:href=
"form.content"
target=
"_blank"
>
查看
</a>
</
template
>
</el-input>
</template>
</el-form-item>
<
template
v-else
>
<AIChat
v-model=
"form"
v-if=
"form.id"
></AIChat>
</
template
>
</el-form>
<div
class=
"three"
>
<el-card
shadow=
"never"
v-if=
"form.way == 1"
>
<AIChat
v-model=
"form"
v-if=
"form.id"
></AIChat>
</el-card>
<el-card
shadow=
"never"
>
<template
#
header
>
内容创作
</
template
>
<el-form
label-suffix=
":"
inline
class=
"info-form"
>
<el-form-item
label=
"内容名称"
>
{{ form.name }}
</el-form-item>
<el-form-item
label=
"内容类型"
>
{{ typeName }}
</el-form-item>
<el-form-item
label=
"创作方式"
>
{{ getNameByValue(form.way, materialMethodList) }}
</el-form-item>
</el-form>
<el-divider></el-divider>
<el-form
label-suffix=
":"
label-width=
"110"
:model=
"form"
:rules=
"rules"
ref=
"formRef"
:disabled=
"action === 'view'"
>
<el-form-item
:label=
"`${typeName}资源`"
prop=
"content"
>
<
template
v-if=
"form.type == 1"
>
<!-- 文本 -->
<el-input
type=
"textarea"
rows=
"14"
v-model=
"form.content"
></el-input>
</
template
>
<
template
v-if=
"['2', '6', '7', '8'].includes(form.type)"
>
<!-- 图片|二维码|小程序|卡券 -->
<AppUpload
v-model=
"form.content"
accept=
"image/*"
></AppUpload>
</
template
>
<
template
v-if=
"form.type == 3"
>
<!-- 语音 -->
<div>
<AppUpload
v-model=
"form.content"
accept=
".mp3"
>
<el-button
type=
"primary"
>
上传语音
</el-button>
</AppUpload>
<audio
:src=
"form.content"
controls
v-if=
"form.content"
></audio>
</div>
</
template
>
<
template
v-if=
"form.type == 4"
>
<!-- 视频 -->
<div>
<AppUpload
v-model=
"form.content"
accept=
".mp4"
>
<el-button
type=
"primary"
>
上传视频
</el-button>
</AppUpload>
<video
controls
:src=
"form.content"
style=
"max-width: 600px; width: 100%"
v-if=
"form.content"
></video>
</div>
</
template
>
<
template
v-if=
"form.type == 5"
>
<el-input
v-model=
"form.content"
placeholder=
"请输入"
>
<template
#
prepend
>
https://
</
template
>
<
template
#
append
v-if=
"form.content"
>
<a
:href=
"form.content"
target=
"_blank"
>
查看
</a>
</
template
>
</el-input>
</template>
</el-form-item>
</el-form>
<el-row
justify=
"center"
>
<el-button
type=
"primary"
@
click=
"handlePrev"
>
上一步
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
v-if=
"action !== 'view'"
>
提交
</el-button>
</el-row>
</el-card>
<el-row
justify=
"center"
>
<el-button
type=
"primary"
@
click=
"handlePrev"
>
上一步
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
v-if=
"action !== 'view'"
>
提交
</el-button>
</el-row>
</el-card>
</div>
</template>
<
style
lang=
"scss"
>
...
...
@@ -102,4 +104,11 @@ async function handleSubmit() {
margin-bottom
:
0
;
}
}
.three
{
display
:
flex
;
gap
:
20px
;
.el-card
{
flex
:
1
;
}
}
</
style
>
src/modules/material/all/views/Update.vue
浏览文件 @
e877c464
...
...
@@ -81,7 +81,7 @@ async function handleUpdate() {
<el-tab-pane
lazy
label=
"第2步"
:name=
"2"
disabled
>
<StepTwo
v-model=
"form"
:action=
"action"
style=
"max-width: 1000px; margin: 0 auto"
@
prev=
"handlePrev"
@
next=
"handleNextAndSubmit"
></StepTwo>
</el-tab-pane>
<el-tab-pane
lazy
label=
"第3步"
style=
"max-width: 1000px; margin: 0 auto"
:name=
"3"
disabled
>
<el-tab-pane
lazy
label=
"第3步"
:name=
"3"
disabled
>
<StepThree
v-model=
"form"
:action=
"action"
@
prev=
"handlePrev"
@
submit=
"handleSubmit"
></StepThree>
</el-tab-pane>
</el-tabs>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论