| | |
| | | // 然后将数组转为对象数组
|
| | | fileList.value = list.map((item) => {
|
| | | if (typeof item === "string") {
|
| | | item = { name: item, url: item };
|
| | | item = { name: getFileName(item), url: item };
|
| | | } else {
|
| | | item = { ...item };
|
| | | if (!item.name) {
|
| | | item.name = getFileName(item.url || item.name || "");
|
| | | }
|
| | | }
|
| | | item.uid = item.uid || new Date().getTime() + temp++;
|
| | | return item;
|
| | |
| | | .concat(uploadList.value);
|
| | | uploadList.value = [];
|
| | | number.value = 0;
|
| | | emit("update:modelValue", listToString(fileList.value));
|
| | | emit("update:modelValue", fileList.value);
|
| | | proxy.$modal.closeLoading();
|
| | | }
|
| | | }
|
| | |
| | | onEnd: (evt) => {
|
| | | const movedItem = fileList.value.splice(evt.oldIndex, 1)[0];
|
| | | fileList.value.splice(evt.newIndex, 0, movedItem);
|
| | | emit("update:modelValue", listToString(fileList.value));
|
| | | emit("update:modelValue", fileList.value);
|
| | | },
|
| | | });
|
| | | });
|