index.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!--
  2. * @Author: liuJie
  3. * @Date: 2026-01-24 21:25:04
  4. * @LastEditors: liuJie
  5. * @LastEditTime: 2026-01-24 22:01:08
  6. * @Describe: 运行工作流
  7. -->
  8. <script lang="ts" setup>
  9. import { ElButton } from 'element-plus';
  10. import { Icon } from '@iconify/vue';
  11. const props = withDefaults(
  12. defineProps<{
  13. visible: boolean,
  14. }>(),
  15. {
  16. visible: false,
  17. }
  18. );
  19. const emit = defineEmits<{
  20. 'update:visible': [value: boolean]
  21. }>()
  22. </script>
  23. <template>
  24. <div class='runWorkflow'>
  25. <div class="drawer shadow-2xl" :class="{ 'drawer--open': props.visible }">
  26. <header>
  27. <h4>运行工作流</h4>
  28. <Icon icon="lucide:x" height="24" width="24" @click="emit('update:visible', false)" class="cursor-pointer"></Icon>
  29. </header>
  30. <!-- Drawer content -->
  31. This is drawer content.
  32. <footer>
  33. <ElButton type="success" size="large" class="w-full" @click="emit('update:visible', false)">
  34. 运行
  35. </ElButton>
  36. </footer>
  37. </div>
  38. </div>
  39. </template>
  40. <style lang="less" scoped>
  41. .runWorkflow {
  42. /* Drawer 主体 */
  43. .drawer {
  44. position: fixed;
  45. top: 100px;
  46. right: 5px;
  47. bottom: 10px;
  48. width: 420px;
  49. background: #fff;
  50. z-index: 1000;
  51. border-radius: 8px;
  52. display: flex;
  53. flex-direction: column;
  54. border: 1px solid #e4e4e4;
  55. /* 初始隐藏状态 */
  56. transform: translateX(110%);
  57. transition: transform 0.25s ease;
  58. }
  59. /* 显示状态 */
  60. .drawer--open {
  61. transform: translateX(0);
  62. }
  63. /* Header */
  64. .drawer header {
  65. height: 56px;
  66. padding: 0 16px;
  67. border-bottom: 1px solid #eee;
  68. display: flex;
  69. align-items: center;
  70. justify-content: space-between;
  71. }
  72. /* 内容区 */
  73. .drawer .content {
  74. flex: 1;
  75. padding: 16px;
  76. overflow-y: auto;
  77. }
  78. }
  79. </style>