¶Ô±ÈÐÂÎļþ |
| | |
| | | .informationDrawerPosition { |
| | | position: relative; |
| | | } |
| | | .informationDrawer { |
| | | background: linear-gradient(180deg, #dee4ff 0%, #ffffff 40%, #ffffff 100%); |
| | | box-shadow: 0px -4px 30px 1px rgba(0, 0, 0, 0.16); |
| | | |
| | | border-radius: 6px 6px 0px 0px; |
| | | opacity: 1; |
| | | border: 1px solid #f0f3fd; |
| | | |
| | | @keyframes iconFrames { |
| | | 0% { |
| | | opacity: 1; |
| | | } |
| | | 25% { |
| | | opacity: 0.66; |
| | | } |
| | | 50% { |
| | | opacity: 0.33; |
| | | } |
| | | 75% { |
| | | opacity: 0.66; |
| | | } |
| | | |
| | | 100% { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | .iconPosition { |
| | | position: absolute; |
| | | top: 38px; |
| | | right: 111px; |
| | | user-select: none; |
| | | -webkit-user-drag: none; |
| | | animation: iconFrames 2s infinite linear; |
| | | } |
| | | :global(.cs-drawer__header) { |
| | | padding-top: 36px; |
| | | .cs-drawer__close-btn { |
| | | margin-top: -16px; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | > span { |
| | | font-size: 18px; |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: bold; |
| | | color: #464e54; |
| | | line-height: 0px; |
| | | } |
| | | } |
| | | :global(.cs-drawer__close-btn) { |
| | | margin-top: -16px; |
| | | font-size: 16px; |
| | | } |
| | | :global(.cs-drawer__body) { |
| | | padding: 30px; |
| | | padding-top: 13px; |
| | | } |
| | | } |
| | | |
| | | .modal { |
| | | width: var(--drawer-width); |
| | | left: calc(100% - var(--drawer-width)) !important; |
| | | } |
| | | |
| | | .csDialogFooter { |
| | | padding: 0 18px; |
| | | .csBaseBtn { |
| | | width: 98px; |
| | | height: 26px; |
| | | } |
| | | .dialogBtn { |
| | | background: #efeded; |
| | | color: #666666; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { computed, defineComponent, onMounted, ref } from 'vue' |
| | | import styles from './BaseQueryDrawer.module.scss' |
| | | import Icon from '../Icon/Icon' |
| | | //@ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | // @ts-ignore |
| | | name: 'BaseDrawer', |
| | | props: { |
| | | // é®ç½©æ¯å¦å¯ç¹å» |
| | | clickable: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | width: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | // modelValue: { |
| | | // type: Boolean, |
| | | // default: false, |
| | | // }, |
| | | }, |
| | | emits: ['close','reset', 'confirmQueryForBase', 'update:modelValue', 'open', 'beforeClose'], |
| | | setup(props: any, { emit, slots, attrs }: any) { |
| | | // const size = computed(() => { |
| | | // if (attrs.size.includes('px')) { |
| | | // return attrs.size |
| | | // } |
| | | // }) |
| | | |
| | | // const model = computed(() => { |
| | | // if (attrs.model.includes('')) { |
| | | // return attrs.model |
| | | // } |
| | | // }) |
| | | |
| | | return () => { |
| | | return ( |
| | | <div |
| | | class={styles.drawContent} |
| | | //@ts-ignore |
| | | // style={props.clickable ? { '--drawer-width': size.value } : {}} |
| | | > |
| | | <el-drawer |
| | | // modal-class={props.clickable ? styles.modal : ''} |
| | | class={{ |
| | | [styles.informationDrawer]: true, |
| | | // [styles.informationDrawerPosition]: props.clickable, |
| | | }} |
| | | onOpen={() => emit('open')} |
| | | onClose={() => emit('close')} |
| | | v-slots={{ |
| | | footer() { |
| | | return ( |
| | | <div class={styles.csDialogFooter}> |
| | | <el-button |
| | | onClick={() => emit('close')} |
| | | type="info" |
| | | plain |
| | | class={{ |
| | | [styles.dialogBtn]: true, |
| | | [styles.csBaseBtn]: true, |
| | | }} |
| | | > |
| | | å
³é |
| | | </el-button> |
| | | <el-button |
| | | onClick={() => emit('reset')} |
| | | type="info" |
| | | plain |
| | | class={{ |
| | | [styles.dialogBtn]: true, |
| | | [styles.csBaseBtn]: true, |
| | | }} |
| | | > |
| | | éç½® |
| | | </el-button> |
| | | <el-button |
| | | onClick={() => emit('confirmQueryForBase')} |
| | | type="primary" |
| | | class={{ |
| | | [styles.csBaseBtn]: true, |
| | | }} |
| | | > |
| | | æ¥è¯¢ |
| | | </el-button> |
| | | </div> |
| | | ) |
| | | }, |
| | | }} |
| | | {...attrs} |
| | | title={props.title} |
| | | size={props.width || attrs.size} |
| | | > |
| | | <Icon |
| | | width={167} |
| | | height={54} |
| | | class={styles.iconPosition} |
| | | icon="drawer_bg" |
| | | /> |
| | | {slots.default?.()} |
| | | </el-drawer> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |