am.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <Tabs v-model:activeKey="activeKey" width="100%">
  3. <TabPane key="setting" tab="设置">
  4. <ui-group borderBottom>
  5. <ui-group-option>
  6. <SignItem label="名称" not-apply>
  7. <ui-input
  8. width="100%"
  9. type="text"
  10. ref="nameInput"
  11. class="nameInput"
  12. placeholder="请输入名称"
  13. v-model="am.title"
  14. :maxlength="100"
  15. />
  16. </SignItem>
  17. </ui-group-option>
  18. <ui-group-option class="item">
  19. <span class="label">显示名称</span>
  20. <span class="oper"> <Switch v-model:checked="am.showTitle" /> </span>
  21. </ui-group-option>
  22. </ui-group>
  23. <ui-group borderBottom>
  24. <ui-group-option>
  25. <SignItem label="文字大小" @apply-global="$emit('applyGlobal', 'fontSize')">
  26. <Slider v-model:value="am.fontSize" :min="12" :max="60" :step="0.1" />
  27. </SignItem>
  28. </ui-group-option>
  29. </ui-group>
  30. <ui-group borderBottom>
  31. <ui-group-option>
  32. <SignItem
  33. label="可见范围"
  34. v-if="!am.globalVisibility"
  35. @apply-global="$emit('applyGlobal', 'globalVisibility')"
  36. >
  37. <Slider v-model:value="am.visibilityRange" :min="1" :max="1000" :step="0.1" />
  38. </SignItem>
  39. </ui-group-option>
  40. <ui-group-option>
  41. <ui-input
  42. type="checkbox"
  43. label="全部范围可视"
  44. :modelValue="!!am.globalVisibility"
  45. @update:modelValue="(v: boolean) => am.globalVisibility = v"
  46. />
  47. </ui-group-option>
  48. </ui-group>
  49. </TabPane>
  50. <TabPane key="animation" tab="动画">
  51. <ui-group borderBottom>
  52. <ui-group-option class="item">
  53. <span class="label">加帧</span>
  54. <span class="oper" @click="$emit('addFrame')">
  55. <ui-icon type="add" ctrl />
  56. </span>
  57. </ui-group-option>
  58. <ui-group-option class="item">
  59. <span class="label">路径</span>
  60. <span class="oper">
  61. <ui-icon @click="$emit('addPath')" type="add" ctrl />
  62. </span>
  63. </ui-group-option>
  64. <ui-group-option class="item">
  65. <span class="label">字幕</span>
  66. <span class="oper">
  67. <ui-icon @click="$emit('addSubtitle')" type="add" ctrl />
  68. </span>
  69. </ui-group-option>
  70. </ui-group>
  71. <ui-group borderBottom>
  72. <ui-group-option class="item">
  73. <span class="label">动作库</span>
  74. </ui-group-option>
  75. <ui-group-option class="actions">
  76. <span v-for="action in amActions">
  77. <img :src="action.url" />
  78. </span>
  79. </ui-group-option>
  80. </ui-group>
  81. </TabPane>
  82. </Tabs>
  83. </template>
  84. <script lang="ts" setup>
  85. import { Switch, Slider, TabPane, Tabs } from "ant-design-vue";
  86. import { AnimationModel } from "@/api";
  87. import SignItem from "@/views/tagging-position/sign-item.vue";
  88. import { ref } from "vue";
  89. import { amActions } from "@/store/animation";
  90. defineProps<{ am: AnimationModel }>();
  91. defineEmits<{
  92. (e: "addFrame" | "addPath" | "addSubtitle"): void;
  93. (e: "applyGlobal", d: keyof AnimationModel): void;
  94. }>();
  95. const activeKey = ref("setting");
  96. </script>
  97. <style scoped lang="scss">
  98. .item {
  99. display: flex;
  100. align-items: center;
  101. justify-content: space-between;
  102. }
  103. .pin-position {
  104. position: absolute;
  105. left: 50%;
  106. transform: translate(-50%);
  107. width: 64px;
  108. height: 64px;
  109. background: rgba(27, 27, 28, 0.8);
  110. border-radius: 50%;
  111. bottom: 20px;
  112. z-index: 9;
  113. display: flex;
  114. align-items: center;
  115. justify-content: center;
  116. }
  117. .actions {
  118. display: flex;
  119. flex-wrap: wrap;
  120. span {
  121. width: calc((100% - 28px) / 3);
  122. background: #fff;
  123. margin-top: 7px;
  124. margin-bottom: 7px;
  125. height: 80px;
  126. cursor: pointer;
  127. &:nth-child(3n - 1) {
  128. margin-left: 14px;
  129. margin-right: 14px;
  130. }
  131. img {
  132. width: 100%;
  133. height: 100%;
  134. object-fit: cover;
  135. }
  136. }
  137. }
  138. </style>
  139. <style lang="scss">
  140. .animation-right .ui-editor-toolbox {
  141. padding-top: 0;
  142. .ant-tabs-tab {
  143. font-size: 16px;
  144. padding: 16px 10px;
  145. }
  146. }
  147. </style>