資產管理 : 修正 小類 圖片檔案上傳邏輯,增加對 file 和 device_image 的檢查 | draggable 修正
This commit is contained in:
parent
a0b5085a7c
commit
b89057b3bd
@ -4,13 +4,14 @@ const moveModal = (elmnt) => {
|
||||
pos2 = 0,
|
||||
pos3 = 0,
|
||||
pos4 = 0;
|
||||
document.body.addEventListener("mousedown", dragMouseDown, {
|
||||
elmnt.addEventListener("mousedown", dragMouseDown, {
|
||||
passive: false,
|
||||
});
|
||||
|
||||
function dragMouseDown(e) {
|
||||
console.log("dragMouseDown", e);
|
||||
e = e || window.event;
|
||||
if (e.button !== 0) return;
|
||||
e.preventDefault();
|
||||
// get the mouse cursor position at startup:
|
||||
pos3 = e.clientX;
|
||||
|
||||
@ -69,11 +69,11 @@ const onOk = async () => {
|
||||
formData.delete("file");
|
||||
formData.append("id", props.formState.id);
|
||||
|
||||
if (props.formState.file[0]) {
|
||||
if (Array.isArray(props.formState.file) && props.formState.file[0]) {
|
||||
formData.append("file", props.formState.file[0]);
|
||||
}
|
||||
if (props.formState.Device_image) {
|
||||
formData.append("Device_image", props.formState.Device_image);
|
||||
if (props.formState.device_image && props.formState.file.length !== 0) {
|
||||
formData.append("device_image", props.formState.device_image);
|
||||
}
|
||||
|
||||
const res = await postAssetSubList(formData);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user