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

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

parent 3a5d6529
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
props: { props: {
accept: { accept: {
type: String, type: String,
default: '.pdf,.jpg,.jpeg,.zip,.rar,.doc,.docx' default: '.pdf,.jpg,.jpeg,.zip,.rar,.doc,.docx,.JPEG'
}, },
tip: { tip: {
type: String, type: String,
...@@ -86,20 +86,24 @@ export default { ...@@ -86,20 +86,24 @@ export default {
message.uid = fileList[i].uid; message.uid = fileList[i].uid;
value.push(message); value.push(message);
} }
console.log(value) console.log(value);
this.$emit('input', value); this.$emit('input', value);
}, },
beforeUpload(file) { beforeUpload(file) {
// 生成的文件名称 // 生成的文件名称
this.loading=false
let objName = getFileNameUUID(); let objName = getFileNameUUID();
// 调用 ali-oss 中的方法 // 调用 ali-oss 中的方法
put(`${objName}${file.name}`, file).then((res) => { put(`${objName}${file.name}`, file).then((res) => {
console.log(res); console.log(file);
this.fileList.push(res); 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); this.emitInput(this.fileList);
}); });
}, },
handleRemove(file, fileList, index) { handleRemove(file, fileList, index) {
...@@ -122,7 +126,9 @@ export default { ...@@ -122,7 +126,9 @@ export default {
/** /**
* 自定义上传方法 * 自定义上传方法
*/ */
handleUpload(option) {} handleUpload(option) {
console.log(option.file);
}
} }
}; };
</script> </script>
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
{ {
label: '上传时间', label: '上传时间',
prop: 'createTime' prop: 'time'
}, },
{ {
slot: 'operate' slot: 'operate'
...@@ -137,6 +137,7 @@ export default { ...@@ -137,6 +137,7 @@ export default {
message.url = fileList[0].url; message.url = fileList[0].url;
value.push(message); value.push(message);
} }
console.log(value)
this.$emit('input', value); this.$emit('input', value);
}, },
beforeUpload(file) { beforeUpload(file) {
...@@ -151,7 +152,7 @@ export default { ...@@ -151,7 +152,7 @@ export default {
put(`${objName}${file.name}`, file).then((res) => { put(`${objName}${file.name}`, file).then((res) => {
res.size = file.size; res.size = file.size;
res.uploadTime = getcurrentTime(); res.uploadTime = getcurrentTime();
res.createTime = getTime(); res.time = getTime();
res.free = true; res.free = true;
res.price = ''; res.price = '';
// /* res.fileName = res.name */ // /* res.fileName = res.name */
......
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="附件:" prop="file"> <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-item>
</el-form> </el-form>
</div> </div>
...@@ -277,7 +277,7 @@ export default { ...@@ -277,7 +277,7 @@ export default {
}], }],
nav: ['供应商'], nav: ['供应商'],
dialogFormVisible: false, dialogFormVisible: false,
tip: '请上传于招标项目相关的文件,如委托单,技术附件,招标方案,项目真是材料等(文件格式PDF,JPG,JPEG,ZIP,RAR,数量不超过20个,单个文件大小不超过25M)', tip: '请上传于招标项目相关的文件,如委托单,技术附件,招标方案,项目真是材料等(文件格式PDF,JPG,JPEG,ZIP,RAR,DOCX,数量不超过20个,单个文件大小不超过25M)',
managers: [], managers: [],
belongTypes: [], belongTypes: [],
projectTypes: [], 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