getProblemPhoto(this.problemResData.id).then((res) => {
console.log(res);
this.fileList = res.map((v) => ({
uid: `${v.id}`,
status: "done",
name: v.fileName,
url: v.imagePath,
resData: v,
}));
});
export function tcalUploadFile (parameter) {
const {fileList}=parameter;
const fd = new FormData();
fileList.forEach((file,i) => {
fd.append(`files[${i}]`, file.originFileObj);
});
return axios({
url: `${url}`,
method: 'post',
params,
data: fd,
headers: {
'Content-Type': 'application/json;charset=UTF-8',
'Authorization':`${type} ${token}`
}
});
}
dom:<el-input v-model='sampleNo'></el-input>
addScode() {
const { count, tableSource } = this;
const newData = {
key: count,
sampleNo: this.sampleNo,
};
this.tableSource[4].unshift(newData);
this.count = count + 1;
this.sampleNo='';
},
mounted() {
document.onkeydown = (e) => {
if (this.thisTable === 4 && e.keyCode === 13) {
this.addScode();
}
};
},
};