Browse Source

多次提交

master
zhang_li 8 months ago
parent
commit
cc75d8db80
  1. 1
      src/components/BasicForm/src/BasicForm.vue
  2. 23
      src/components/Dialog/src/Dialog.vue

1
src/components/BasicForm/src/BasicForm.vue

@ -4,6 +4,7 @@
v-model="dialogVisible" v-model="dialogVisible"
:width="isBusiness ? '60%' : '40%'" :width="isBusiness ? '60%' : '40%'"
:close-on-click-modal="false" :close-on-click-modal="false"
:vLoading="formLoading"
> >
<div <div
style="max-height: 60vh;overflow-y: auto;"> style="max-height: 60vh;overflow-y: auto;">

23
src/components/Dialog/src/Dialog.vue

@ -11,7 +11,8 @@ const props = defineProps({
fullscreen: propTypes.bool.def(true), fullscreen: propTypes.bool.def(true),
width: propTypes.oneOfType([String, Number]).def('40%'), width: propTypes.oneOfType([String, Number]).def('40%'),
scroll: propTypes.bool.def(false), // maxHeight scroll: propTypes.bool.def(false), // maxHeight
maxHeight: propTypes.oneOfType([String, Number]).def('400px') maxHeight: propTypes.oneOfType([String, Number]).def('400px'),
vLoading:propTypes.bool.def(false)
}) })
const getBindValue = computed(() => { const getBindValue = computed(() => {
@ -34,6 +35,22 @@ const toggleFull = () => {
const dialogHeight = ref(isNumber(props.maxHeight) ? `${props.maxHeight}px` : props.maxHeight) const dialogHeight = ref(isNumber(props.maxHeight) ? `${props.maxHeight}px` : props.maxHeight)
let demo = null
watch(
() => props.vLoading,
async (val: boolean) => {
await nextTick()
if (val) {
initDialog()
} else {
if (demo !== null) demo.close()
}
},
{
immediate: true
}
)
watch( watch(
() => isFullscreen.value, () => isFullscreen.value,
async (val: boolean) => { async (val: boolean) => {
@ -55,6 +72,10 @@ const dialogStyle = computed(() => {
height: unref(dialogHeight) height: unref(dialogHeight)
} }
}) })
const initDialog = () => {
// el-loadingsvg使
demo = ElLoading.service({ target: '.loading', text: '加载中...', background: 'rgba(246, 246, 246, 0.8)' })
}
</script> </script>
<template> <template>

Loading…
Cancel
Save