header.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div class="header">
  3. <div class="nav">
  4. <el-button type="primary" plain>返回</el-button>
  5. </div>
  6. <div class="draw-operate">
  7. <div v-for="group in groups">
  8. <el-icon class="operate" v-for="fn in group" @click="fn()">
  9. {{ funds.describes.get(fn)?.name }}
  10. </el-icon>
  11. </div>
  12. </div>
  13. <div class="saves">
  14. <el-button type="primary" plain>保存</el-button>
  15. <el-button type="primary" plain>导出</el-button>
  16. <el-button>图纸</el-button>
  17. </div>
  18. </div>
  19. </template>
  20. <script lang="ts" setup>
  21. import { ElButton, ElIcon } from "element-plus";
  22. import { useHeaderFunds } from "./funds.ts";
  23. const funds = useHeaderFunds();
  24. const groups = [
  25. [funds.revoke, funds.recover],
  26. [funds.clear, funds.rotate, funds.full],
  27. [funds.aiImport, funds.setBGImage, funds.gotoVR],
  28. ];
  29. if (import.meta.env.DEV) {
  30. groups.push([funds.toggleHit]);
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. @use 'element-plus/theme-chalk/src/common/var';
  35. .header {
  36. background-color: var.$color-primary;
  37. display: flex;
  38. align-items: center;
  39. padding: 10px;
  40. justify-content: space-between;
  41. }
  42. .draw-operate {
  43. text-align: center;
  44. color: #fff;
  45. display: flex;
  46. align-items: center;
  47. > div:not(:last-child) {
  48. padding-right: 10px;
  49. margin-right: 10px;
  50. border-right: 1px solid #fff;
  51. }
  52. i {
  53. width: auto;
  54. margin: 0 5px;
  55. }
  56. }
  57. </style>
  58. /