Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-purchase
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
张冬
web-purchase
Commits
2c8fb3b6
Commit
2c8fb3b6
authored
Nov 06, 2020
by
张冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建项目第四步上传时间问题
parent
3a5d6529
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
Upload.vue
src/components/Upload/Upload.vue
+15
-9
specialUpload.vue
src/components/Upload/specialUpload.vue
+3
-2
message.vue
src/pages/purchaser/bid/releaseProject/message.vue
+2
-2
No files found.
src/components/Upload/Upload.vue
View file @
2c8fb3b6
...
...
@@ -12,12 +12,12 @@
:before-upload=
"beforeUpload"
class=
"upload-demo"
action=
"Fake Action"
:http-request=
"handleUpload"
:http-request=
"handleUpload"
multiple
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
{{
tip
}}
{{
tip
}}
</div>
</el-upload>
</div>
...
...
@@ -31,7 +31,7 @@ export default {
props
:
{
accept
:
{
type
:
String
,
default
:
'.pdf,.jpg,.jpeg,.zip,.rar,.doc,.docx'
default
:
'.pdf,.jpg,.jpeg,.zip,.rar,.doc,.docx
,.JPEG
'
},
tip
:
{
type
:
String
,
...
...
@@ -86,20 +86,24 @@ export default {
message
.
uid
=
fileList
[
i
].
uid
;
value
.
push
(
message
);
}
console
.
log
(
value
)
console
.
log
(
value
)
;
this
.
$emit
(
'input'
,
value
);
},
beforeUpload
(
file
)
{
// 生成的文件名称
this
.
loading
=
false
let
objName
=
getFileNameUUID
();
// 调用 ali-oss 中的方法
put
(
`
${
objName
}${
file
.
name
}
`
,
file
).
then
((
res
)
=>
{
console
.
log
(
res
);
console
.
log
(
file
);
this
.
fileList
.
push
(
res
);
this
.
loading
=
true
const
max
=
this
.
max
;
const
isLt2M
=
file
.
size
/
1024
/
1024
<
max
;
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
`上传附件大小不能超过
${
max
}
MB!`
);
}
return
isLt2M
;
this
.
emitInput
(
this
.
fileList
);
});
},
handleRemove
(
file
,
fileList
,
index
)
{
...
...
@@ -122,7 +126,9 @@ export default {
/**
* 自定义上传方法
*/
handleUpload
(
option
)
{}
handleUpload
(
option
)
{
console
.
log
(
option
.
file
);
}
}
};
</
script
>
...
...
src/components/Upload/specialUpload.vue
View file @
2c8fb3b6
...
...
@@ -110,7 +110,7 @@ export default {
{
label
:
'上传时间'
,
prop
:
'
createT
ime'
prop
:
'
t
ime'
},
{
slot
:
'operate'
...
...
@@ -137,6 +137,7 @@ export default {
message
.
url
=
fileList
[
0
].
url
;
value
.
push
(
message
);
}
console
.
log
(
value
)
this
.
$emit
(
'input'
,
value
);
},
beforeUpload
(
file
)
{
...
...
@@ -151,7 +152,7 @@ export default {
put
(
`
${
objName
}${
file
.
name
}
`
,
file
).
then
((
res
)
=>
{
res
.
size
=
file
.
size
;
res
.
uploadTime
=
getcurrentTime
();
res
.
createT
ime
=
getTime
();
res
.
t
ime
=
getTime
();
res
.
free
=
true
;
res
.
price
=
''
;
// /* res.fileName = res.name */
...
...
src/pages/purchaser/bid/releaseProject/message.vue
View file @
2c8fb3b6
...
...
@@ -169,7 +169,7 @@
</el-input>
</el-form-item>
<el-form-item
label=
"附件:"
prop=
"file"
>
<upload
:tip=
"tip"
:limit=
"20"
:max=
"
25"
accept=
".PDF,.JPG,.JPEG,.ZIP,.RAR
"
@
input=
"getfile"
></upload>
<upload
:tip=
"tip"
:limit=
"20"
:max=
"
10"
accept=
".PDF,.JPG,.JPEG,.ZIP,.RAR,.docx,.doc,.docx
"
@
input=
"getfile"
></upload>
</el-form-item>
</el-form>
</div>
...
...
@@ -277,7 +277,7 @@ export default {
}],
nav
:
[
'供应商'
],
dialogFormVisible
:
false
,
tip
:
'请上传于招标项目相关的文件,如委托单,技术附件,招标方案,项目真是材料等(文件格式PDF,JPG,JPEG,ZIP,RAR,数量不超过20个,单个文件大小不超过25M)'
,
tip
:
'请上传于招标项目相关的文件,如委托单,技术附件,招标方案,项目真是材料等(文件格式PDF,JPG,JPEG,ZIP,RAR,
DOCX,
数量不超过20个,单个文件大小不超过25M)'
,
managers
:
[],
belongTypes
:
[],
projectTypes
:
[],
...
...
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