Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
text2video-frontend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周成波
text2video-frontend
Commits
37d1c2c4
Commit
37d1c2c4
authored
Mar 06, 2024
by
朱国瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理上传图片问题
parent
72ce5042
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
index.vue
src/views/home/index.vue
+8
-13
No files found.
src/views/home/index.vue
View file @
37d1c2c4
...
...
@@ -650,21 +650,16 @@ const actionUrl = ref(
// 第一次上传没问题,但重复进行上传,会更新到最后一行上去。
// 奇怪,没找到原因。暂时先通过迂回的方法来处理。
let
first_has_uploaded
=
false
;
let
uploadItemId
=
0
const
onClickUpload
=
(
val
:
any
)
=>
{
uploadItemId
=
val
.
编号
-
1
console
.
log
(
uploadItemId
);
}
const
handleUploadSuccess
=
(
val
:
Wm
.
UploadResult
)
=>
{
if
(
val
.
code
==
0
)
{
console
.
log
(
val
)
let
id
=
parseInt
(
val
.
message
)
-
1
;
///// 迂回解决上述bug /////
// if (id == 0) { first_has_uploaded = true; }
// if (first_has_uploaded && id == form.adapt_result_json.length - 1) {
// console.log(first_has_uploaded);
// console.log(id);
// console.log(form.adapt_result_json.length);
// id = 0;}
/////////////////////////
form
.
adapt_result_json
[
id
].
本镜配图
=
val
.
data
[
0
].
url
+
"?v="
+
utils
.
genDateTimeStr
();
form
.
adapt_result_json
[
id
].
local_image_path
=
val
.
data
[
0
].
path
;
form
.
adapt_result_json
[
uploadItemId
].
本镜配图
=
val
.
data
[
0
].
url
+
"?v="
+
utils
.
genDateTimeStr
();
form
.
adapt_result_json
[
uploadItemId
].
local_image_path
=
val
.
data
[
0
].
path
;
ElMessage
({
message
:
'上传成功'
,
type
:
'success'
...
...
@@ -852,7 +847,7 @@ const onDeleteOne = (item: any) => {
accept=
".png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.gif,.GIF,.bmp,.BMP"
:action=
"actionUrl"
:on-success=
"handleUploadSuccess"
:on-exceed=
"handleUploadExceed"
:on-error=
"handleUploadError"
:data=
"
{ item_id: scope.row.编号, width: form.img_size.width, height: form.img_size.height }">
<el-button
type=
"primary"
size=
"small"
@
click=
"
console.log(scope.row.编号
)"
>
上传图片
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"
onClickUpload(scope.row
)"
>
上传图片
</el-button>
</el-upload>
<!--
<div
style=
"margin: 5px 0"
><el-button
plain
size=
"small"
@
click=
"onClearOnePic(scope.row)"
>
清除图片
</el-button></div>
-->
<div
style=
"margin: 5px 0"
><el-button
plain
size=
"small"
@
click=
"showsdprompt(scope.row)"
>
debug
</el-button></div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment