Przeglądaj źródła

refactor(components): 移除废弃的Button和Drawer组件

这些组件已被新实现替代,不再需要维护旧版本代码
zhanghaijun 11 miesięcy temu
rodzic
commit
77f318f9ba

+ 0 - 76
src/components/business/Button/Button.vue

@@ -1,76 +0,0 @@
-<template>
-  <div :class="['button', props.type]">
-    <slot></slot>
-  </div>
-</template>
-
-<script setup name="Button">
-  const props = defineProps({
-    type: {
-      type: String,
-      default: 'default'
-    }
-  })
-</script>
-
-<style lang="scss" scoped>
-  .button {
-    display: inline-flex;
-    justify-content: center;
-    align-items: center;
-    line-height: 1;
-    height: 32px;
-    white-space: nowrap;
-    cursor: pointer;
-    color: #606266;
-    box-sizing: border-box;
-    outline: 0;
-    vertical-align: middle;
-    background-color: #ffffff;
-    border: 1px solid #dcdfe6;
-    padding: 8px 15px;
-    font-size: 14px;
-    border-radius: 4px;
-    user-select: none;
-  }
-
-  .button + .button {
-    margin-left: 12px;
-  }
-
-  // 默认样式
-  .default {
-    color: #606266;
-    background-color: #ffffff;
-    border: 1px solid #dcdfe6;
-
-    &:hover {
-      color: #79bbff;
-      background-color: #ecf5ff;
-      border: 1px solid #79bbff;
-    }
-    &:active {
-      color: #337ecc;
-      background-color: #ecf5ff;
-      border: 1px solid #337ecc;
-    }
-  }
-
-  // 主样式
-  .primary {
-    color: #ffffff;
-    background-color: #409eff;
-    border: 1px solid #409eff;
-
-    &:hover {
-      color: #ffffff;
-      background-color: #79bbff;
-      border: 1px solid #79bbff;
-    }
-    &:active {
-      color: #ffffff;
-      background-color: #337ecc;
-      border: 1px solid #337ecc;
-    }
-  }
-</style>

+ 0 - 156
src/components/business/Drawer/Drawer.vue

@@ -1,156 +0,0 @@
-<template>
-  <Teleport to="body" v-if="props.modelValue">
-    <div class="drawer">
-      <!-- header -->
-      <div class="drawer-header" v-if="!props.hideHeader">
-        <el-icon class="drawer-header-icon" color="#5a5e66" v-if="props.icon">
-          <props.icon />
-        </el-icon>
-        <div class="drawer-header-title">{{ props.title }}</div>
-        <el-icon class="drawer-header-close" color="#5a5e66" @click="close" v-if="!props.hideCloseBtn">
-          <Close />
-        </el-icon>
-      </div>
-      <!-- body -->
-      <div class="drawer-body">
-        <slot></slot>
-      </div>
-      <!-- footer -->
-      <div class="drawer-footer">
-        <slot name="footer"></slot>
-      </div>
-    </div>
-    <!-- 遮罩 -->
-    <div class="drawer-overlay"></div>
-  </Teleport>
-</template>
-
-<script setup lang="ts" name="Drawer">
-  import { onMounted, onUnmounted } from 'vue'
-  import { Close } from '@element-plus/icons-vue'
-
-  const props = defineProps({
-    modelValue: {
-      type: Boolean,
-      default: false
-    },
-    title: {
-      type: String,
-      default: null
-    },
-    icon: {
-      type: String,
-      default: null
-    },
-    'z-index': {
-      type: Number,
-      default: 2000
-    },
-    'hide-header': {
-      // 控制是否显示 header 栏, 默认为 false
-      type: Boolean,
-      default: false
-    },
-    'hide-close-btn': {
-      // 控制是否显示 关闭按钮, 默认为 false
-      type: Boolean,
-      default: false
-    },
-    width: {
-      type: String,
-      default: '500px'
-    }
-  })
-
-  onMounted(() => {
-    window.addEventListener('keydown', escListener)
-  })
-
-  onUnmounted(() => {
-    window.removeEventListener('keydown', escListener)
-  })
-
-  // 监听ESC事件
-  const escListener = (event) => {
-    if (event.keyCode === 27) {
-      close()
-    }
-  }
-
-  const emit = defineEmits(['update:modelValue', 'close'])
-  const close = () => {
-    emit('update:modelValue', false)
-    emit('close')
-  }
-</script>
-
-<style lang="scss" scoped>
-  .drawer {
-    position: fixed;
-    width: v-bind('props.width');
-    height: 100%;
-    background: var(--art-main-bg-color);
-    box-shadow: -5px -5px 10px 2px rgba(0, 0, 0, 0.2);
-    top: 0;
-    right: 0;
-    z-index: v-bind('props.zIndex + 1');
-    display: flex;
-    flex-direction: column;
-  }
-
-  .drawer-header {
-    padding: 16px;
-    border-bottom: 1px solid #cacaca;
-    min-height: 30px;
-    display: flex;
-    flex-direction: row;
-    width: 100%;
-    align-items: center;
-    box-sizing: border-box;
-
-    .drawer-header-icon {
-      width: 20px;
-      height: 20px;
-      font-size: 16px;
-      padding-right: 10px;
-    }
-    .drawer-header-title {
-      flex: 1;
-      font-size: 16px;
-      font-weight: bold;
-    }
-    .drawer-header-close {
-      width: 20px;
-      height: 20px;
-      font-size: 16px;
-      cursor: pointer;
-    }
-  }
-
-  .drawer-body {
-    flex: 1;
-    padding: 16px;
-    overflow-y: auto;
-  }
-
-  .drawer-footer {
-    padding: 16px;
-    display: flex;
-    flex-direction: row;
-    width: 100%;
-    align-items: center;
-    box-sizing: border-box;
-    justify-content: right;
-  }
-  .drawer-overlay {
-    position: fixed;
-    top: 0;
-    right: 0;
-    bottom: 0;
-    left: 0;
-    z-index: v-bind('props.zIndex');
-    height: 100%;
-    background-color: rgba(0, 0, 0, 0.5);
-    overflow: auto;
-  }
-</style>