|
|
@@ -21,7 +21,7 @@
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
<div class="remark-box" @click="showRemark(index)"><SvgIcon icon-class="edit-line" />添加备注</div>
|
|
|
- <!-- <el-upload
|
|
|
+ <el-upload
|
|
|
action="no"
|
|
|
accept="image/*,video/*"
|
|
|
:http-request="handleImage"
|
|
|
@@ -29,9 +29,11 @@
|
|
|
:on-exceed="handleExceed"
|
|
|
:limit="1"
|
|
|
:key="index"
|
|
|
+ @click.native="handleItem(index)"
|
|
|
+ class="upload-resource"
|
|
|
>
|
|
|
- <span>上传图片/视频</span>
|
|
|
- </el-upload> -->
|
|
|
+ <div class="remark-box"><i class="el-icon-upload"></i>上传图片/视频</div>
|
|
|
+ </el-upload>
|
|
|
</template>
|
|
|
<div v-for="(items, indexs) in item.sentenceStr" :key="indexs + 'words'" class="sentence-box">
|
|
|
<div class="sentence">
|
|
|
@@ -188,6 +190,7 @@ export default {
|
|
|
showStyleFlag: false,
|
|
|
remarkVisible: false,
|
|
|
remark: null,
|
|
|
+ activeItem: null,
|
|
|
};
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
@@ -256,9 +259,12 @@ export default {
|
|
|
`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`,
|
|
|
);
|
|
|
},
|
|
|
+ // 记录段落
|
|
|
+ handleItem(index) {
|
|
|
+ this.activeItem = this.data.detail[index];
|
|
|
+ },
|
|
|
// 图片上传前处理
|
|
|
- handleBeforeImage(file, index) {
|
|
|
- console.log(index);
|
|
|
+ handleBeforeImage(file) {
|
|
|
// 判断文件是否为图片
|
|
|
if (!file.type.includes('image') && !file.type.includes('video')) {
|
|
|
this.$message.error('请选择图片或视频文件');
|
|
|
@@ -266,11 +272,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 图片上传
|
|
|
- handleImage(file, index) {
|
|
|
+ handleImage(file) {
|
|
|
fileUpload('Mid', file, { isGlobalprogress: true }).then(({ file_info_list }) => {
|
|
|
if (file_info_list.length > 0) {
|
|
|
const { file_id, file_url_open, type } = file_info_list[0];
|
|
|
- console.log(index);
|
|
|
+ this.activeItem.sourceList = [
|
|
|
+ {
|
|
|
+ file_id,
|
|
|
+ file_url_open,
|
|
|
+ type,
|
|
|
+ },
|
|
|
+ ];
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -415,4 +427,8 @@ export default {
|
|
|
border: 1px solid #165dff;
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
+
|
|
|
+.upload-resource {
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
</style>
|