提交 e877c464 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 a5a9819a
...@@ -44,12 +44,12 @@ watch(welcomeMessage, () => { ...@@ -44,12 +44,12 @@ watch(welcomeMessage, () => {
}) })
// 设置为最后一条ai回复的内容 // 设置为最后一条ai回复的内容
watchEffect(() => { // watchEffect(() => {
const botLastMessage = messages.value.findLast(item => item.role === 'bot') // const botLastMessage = messages.value.findLast(item => item.role === 'bot')
if (botLastMessage) { // if (botLastMessage) {
form.value.content = botLastMessage.content // form.value.content = botLastMessage.content
} // }
}) // })
async function postMessage() { async function postMessage() {
if (!content.value) return if (!content.value) return
...@@ -152,9 +152,13 @@ function parseHtml(content) { ...@@ -152,9 +152,13 @@ function parseHtml(content) {
</template> </template>
<style lang="scss"> <style lang="scss">
.chat {
height: calc(100vh - 90px - 280px);
overflow-y: auto;
}
.chat-footer { .chat-footer {
position: relative; position: relative;
margin: 40px 0; margin-top: 40px;
.el-textarea__inner { .el-textarea__inner {
padding: 16px; padding: 16px;
resize: none; resize: none;
......
...@@ -37,6 +37,10 @@ async function handleSubmit() { ...@@ -37,6 +37,10 @@ async function handleSubmit() {
</script> </script>
<template> <template>
<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"> <el-card shadow="never">
<template #header>内容创作</template> <template #header>内容创作</template>
<el-form label-suffix=":" inline class="info-form"> <el-form label-suffix=":" inline class="info-form">
...@@ -45,11 +49,11 @@ async function handleSubmit() { ...@@ -45,11 +49,11 @@ async function handleSubmit() {
<el-form-item label="创作方式">{{ getNameByValue(form.way, materialMethodList) }}</el-form-item> <el-form-item label="创作方式">{{ getNameByValue(form.way, materialMethodList) }}</el-form-item>
</el-form> </el-form>
<el-divider></el-divider> <el-divider></el-divider>
<el-form label-suffix=":" label-width="130" :model="form" :rules="rules" ref="formRef" :disabled="action === 'view'"> <el-form label-suffix=":" label-width="110" :model="form" :rules="rules" ref="formRef" :disabled="action === 'view'">
<el-form-item :label="`${typeName}资源`" prop="content" v-if="form.way == 2"> <el-form-item :label="`${typeName}资源`" prop="content">
<template v-if="form.type == 1"> <template v-if="form.type == 1">
<!-- 文本 --> <!-- 文本 -->
<el-input type="textarea" rows="6" v-model="form.content"></el-input> <el-input type="textarea" rows="14" v-model="form.content"></el-input>
</template> </template>
<template v-if="['2', '6', '7', '8'].includes(form.type)"> <template v-if="['2', '6', '7', '8'].includes(form.type)">
<!-- 图片|二维码|小程序|卡券 --> <!-- 图片|二维码|小程序|卡券 -->
...@@ -82,9 +86,6 @@ async function handleSubmit() { ...@@ -82,9 +86,6 @@ async function handleSubmit() {
</el-input> </el-input>
</template> </template>
</el-form-item> </el-form-item>
<template v-else>
<AIChat v-model="form" v-if="form.id"></AIChat>
</template>
</el-form> </el-form>
<el-row justify="center"> <el-row justify="center">
...@@ -92,6 +93,7 @@ async function handleSubmit() { ...@@ -92,6 +93,7 @@ async function handleSubmit() {
<el-button type="primary" @click="handleSubmit" v-if="action !== 'view'">提交</el-button> <el-button type="primary" @click="handleSubmit" v-if="action !== 'view'">提交</el-button>
</el-row> </el-row>
</el-card> </el-card>
</div>
</template> </template>
<style lang="scss"> <style lang="scss">
...@@ -102,4 +104,11 @@ async function handleSubmit() { ...@@ -102,4 +104,11 @@ async function handleSubmit() {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.three {
display: flex;
gap: 20px;
.el-card {
flex: 1;
}
}
</style> </style>
...@@ -81,7 +81,7 @@ async function handleUpdate() { ...@@ -81,7 +81,7 @@ async function handleUpdate() {
<el-tab-pane lazy label="第2步" :name="2" disabled> <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> <StepTwo v-model="form" :action="action" style="max-width: 1000px; margin: 0 auto" @prev="handlePrev" @next="handleNextAndSubmit"></StepTwo>
</el-tab-pane> </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> <StepThree v-model="form" :action="action" @prev="handlePrev" @submit="handleSubmit"></StepThree>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论