|
|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import type { Recordable } from '@vben/types';
|
|
|
|
|
|
|
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
|
|
import { nextTick, onMounted, ref } from 'vue';
|
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
|
|
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
|
|
|
|
@ -188,8 +188,24 @@ function handleMultiDelete() {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const init = ref(true);
|
|
|
|
|
const [TableImportModal, tableImportModalApi] = useVbenModal({
|
|
|
|
|
connectedComponent: tableImportModal,
|
|
|
|
|
/**
|
|
|
|
|
* TODO: 等待官方修复
|
|
|
|
|
* 临时解决方案 for https://github.com/vbenjs/vue-vben-admin/issues/4752
|
|
|
|
|
* 通过在关闭时使用v-if切换来造成Modal的重新渲染
|
|
|
|
|
* 目前Modal逻辑为每次打开 内部的元素会重新mount 但是Modal本身不会重新渲染
|
|
|
|
|
* 该方案会造成关闭动画丢失(应该放在afterClose中)
|
|
|
|
|
* @param isOpen 是否打开
|
|
|
|
|
*/
|
|
|
|
|
onOpenChange: async (isOpen) => {
|
|
|
|
|
if (!isOpen) {
|
|
|
|
|
init.value = false;
|
|
|
|
|
await nextTick();
|
|
|
|
|
init.value = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function handleImport() {
|
|
|
|
|
@ -290,6 +306,6 @@ function handleImport() {
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
<CodePreviewModal />
|
|
|
|
|
<TableImportModal @reload="tableApi.query()" />
|
|
|
|
|
<TableImportModal v-if="init" @reload="tableApi.query()" />
|
|
|
|
|
</Page>
|
|
|
|
|
</template>
|
|
|
|
|
|