Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
ee889536
提交
ee889536
authored
11月 05, 2021
作者:
huaxinzhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品添加和编辑时,连续同一张图片时,后续上传失效问题
上级
54b11697
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
16 行删除
+5
-16
goodsimg.vue
src/views/system/goods/add/components/goodsimg.vue
+5
-16
没有找到文件。
src/views/system/goods/add/components/goodsimg.vue
浏览文件 @
ee889536
...
...
@@ -44,12 +44,10 @@
loading
:
false
,
goodsDeForm
:
{
description
:
''
,
},
// goodsDeRules: {
// description:[{required: true, message: '请上传商品详情图片', validator: checkImg}]
// },
goodsDetailsImgFileList
:
[],
editorOption
:
{
placeholder
:
''
,
...
...
@@ -61,6 +59,7 @@
'image'
:
function
(
value
)
{
if
(
value
)
{
// 触发input框选择图片文件
document
.
querySelector
(
'#file'
).
value
=
''
// 清空是为了解决,联系上传同一张图片时,后续上传失效问题
document
.
querySelector
(
'#file'
).
click
()
}
else
{
this
.
quill
.
format
(
'image'
,
false
);
...
...
@@ -68,7 +67,7 @@
}
}
},
//
//
禁止粘贴图片
// 禁止粘贴图片
clipboard
:
{
matchers
:
[[
Node
.
ELEMENT_NODE
,
this
.
handleCustomMatcher
]]
}
...
...
@@ -107,11 +106,9 @@
insert
:
''
})
Delta
.
ops
=
ops
;
// console.log('我是粘贴的');
}
})
//
//console.log(113,Delta);
return
Delta
},
...
...
@@ -125,7 +122,6 @@
const
list
=
this
.
$refs
.
file
.
files
;
this
.
indexall
=
list
.
length
this
.
uploadImgs
()
//debugger
},
// 向后台 传输 base64的图片数据
uploadImgs
()
{
...
...
@@ -133,8 +129,6 @@
let
result
=
res
.
split
(
","
);
this
.
Base64img
=
result
[
1
];
let
data
=
{
"img_data"
:
this
.
Base64img
}
//debugger
// this.loading = true;
UploadImg
(
data
).
then
(
res
=>
{
//debugger
if
(
res
&&
res
.
code
===
1
)
{
...
...
@@ -149,6 +143,7 @@
// 调整光标到最后
quill
.
setSelection
(
length
+
1
)
if
(
this
.
index
<
this
.
indexall
){
debugger
this
.
uploadImgs
()
}
else
{
this
.
index
=
0
...
...
@@ -163,18 +158,12 @@
//
onEditorChange
({
editor
,
html
,
text
})
{
this
.
goodsDeForm
.
description
=
html
;
// console.log( 100,this.$refs.file.files );
// console.log( 200,this.goodsDeForm.description );
// console.log( 300,this.goodsDetailsImgFileList );
// if( this.goodsDeForm.description.indexOf('img')
<
-
1
)
{
// this.goodsDetailsImgFileList = [];
// }
},
onEditorBlur
(){
//失去焦点事件
},
//失去焦点事件
onEditorBlur
(){},
// 商品详情 子组件 form表单校验, 在父组件中被调用
// validateGoodsDeImgForm() {
// let flag = null
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论