Merge remote-tracking branch 'origin/feature/0915_素材中心新增手动上传' into test
This commit is contained in:
@ -259,6 +259,8 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onConfirm = async () => {
|
const onConfirm = async () => {
|
||||||
|
try {
|
||||||
|
submitLoading.value = true;
|
||||||
const hasUploading = uploadData.value.some((item) => item.uploadStatus === EnumUploadStatus.uploading);
|
const hasUploading = uploadData.value.some((item) => item.uploadStatus === EnumUploadStatus.uploading);
|
||||||
if (hasUploading) {
|
if (hasUploading) {
|
||||||
modalRef.value = Modal.warning({
|
modalRef.value = Modal.warning({
|
||||||
@ -277,6 +279,9 @@ export default defineComponent({
|
|||||||
emit('update');
|
emit('update');
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
submitLoading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const openDeleteModal = (file) => {
|
const openDeleteModal = (file) => {
|
||||||
modalRef.value = Modal.warning({
|
modalRef.value = Modal.warning({
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<Button size="medium" @click="onClose">取消</Button>
|
<Button size="medium" @click="onClose">取消</Button>
|
||||||
<Button type="primary" class="ml-16px" danger size="medium" @click="onDelete">确认删除</Button>
|
<Button :loading="loading" class="ml-16px" danger size="medium" type="primary" @click="onDelete">确认删除</Button>
|
||||||
</template>
|
</template>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
@ -24,12 +24,14 @@ const emits = defineEmits(['update', 'batchUpdate']);
|
|||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const fileId = ref(null);
|
const fileId = ref(null);
|
||||||
const fileName = ref('');
|
const fileName = ref('');
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
const isBatch = computed(() => Array.isArray(fileId.value));
|
const isBatch = computed(() => Array.isArray(fileId.value));
|
||||||
|
|
||||||
function onClose() {
|
function onClose() {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
fileId.value = null;
|
fileId.value = null;
|
||||||
|
loading.value = false;
|
||||||
fileName.value = '';
|
fileName.value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,6 +44,8 @@ const open = (record) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function onDelete() {
|
async function onDelete() {
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
const _fn = isBatch.value ? batchDeleteRawMaterials : deleteRawMaterial;
|
const _fn = isBatch.value ? batchDeleteRawMaterials : deleteRawMaterial;
|
||||||
const _params = isBatch.value ? { ids: fileId.value } : fileId.value;
|
const _params = isBatch.value ? { ids: fileId.value } : fileId.value;
|
||||||
const { code } = await _fn(_params);
|
const { code } = await _fn(_params);
|
||||||
@ -51,6 +55,9 @@ async function onDelete() {
|
|||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ open });
|
defineExpose({ open });
|
||||||
|
|||||||
Reference in New Issue
Block a user