素材库

This commit is contained in:
yanran200730
2023-03-07 17:09:08 +08:00
parent 87a038b0ed
commit 8aa991ae07
7 changed files with 488 additions and 16 deletions

View File

@@ -176,6 +176,10 @@
</div>
</div>
</el-popover>
<div class="add-material add-item" @click="$refs.ChooseMaterial.open()">
<img src="https://cdn.cunwuyun.cn/dvcp/announce/add.png"/>
<span style="color: #2266FF; font-size: 12px;">从素材库选择</span>
</div>
</div>
<div class="tips">
<em>从本地上传图片最大支持10MB支持JPG,PNG格式视频最大支持10MB支持MP4格式文件最大支持20MB</em>
@@ -364,6 +368,7 @@
</div>
</div>
</ai-dialog>
<ChooseMaterial ref="ChooseMaterial" :instance="instance" @change="onChooseChange"></ChooseMaterial>
</div>
</template>
<template #footer>
@@ -376,6 +381,7 @@
<script>
import Phone from './Phone'
import ChooseMaterial from './ChooseMaterial.vue'
import {mapActions, mapState} from 'vuex'
export default {
@@ -388,7 +394,8 @@ export default {
},
components: {
Phone
Phone,
ChooseMaterial
},
data() {
@@ -482,6 +489,12 @@ export default {
methods: {
...mapActions(['initOpenData', 'transCanvas']),
onChooseChange (e) {
this.form.content = e.filter(v => v.msgType === '0').map(v => v.content).join(' ') || this.form.content
this.fileList = this.fileList.concat(e.filter(v => v.msgType !== '0'))
},
choose(id) {
const index = this.chooseTags.indexOf(id)
if (index === -1) {
@@ -942,6 +955,7 @@ export default {
.add {
display: flex;
position: relative;
flex-direction: column;
padding: 14px 16px;
background: #F9F9F9;
@@ -949,6 +963,13 @@ export default {
border: 1px solid #D0D4DC;
border-top: none;
.add-material {
position: absolute;
bottom: 14px;
left: 16px;
transform: translateX(120%);
}
.add-item {
display: flex;
align-items: center;