Commit 2c8fb3b6 authored by 张冬's avatar 张冬

创建项目第四步上传时间问题

parent 3a5d6529
......@@ -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>
......
......@@ -110,7 +110,7 @@ export default {
{
label: '上传时间',
prop: 'createTime'
prop: 'time'
},
{
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.createTime = getTime();
res.time = getTime();
res.free = true;
res.price = '';
// /* res.fileName = res.name */
......
......@@ -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: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment