path.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <Tabs activeKey="t" width="100%">
  3. <TabPane key="t" tab="设置路径">
  4. <ui-group>
  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="data.name"
  14. :maxlength="100"
  15. />
  16. </SignItem>
  17. </ui-group-option>
  18. <ui-group-option>
  19. <SignItem label="路径" not-apply>
  20. <ui-input
  21. width="100%"
  22. type="select"
  23. :options="options"
  24. placeholder="请选择路径"
  25. v-model="data.pathId"
  26. />
  27. </SignItem>
  28. </ui-group-option>
  29. <ui-group-option class="item">
  30. <span class="label">终点反向</span>
  31. <span class="oper"> <Switch v-model:checked="data.reverse" /> </span>
  32. </ui-group-option>
  33. <ui-group-option class="item">
  34. <span class="label">持续时间</span>
  35. <span class="oper">
  36. <ui-input
  37. width="75px"
  38. type="number"
  39. placeholder="请输入"
  40. :modelValue="data.duration"
  41. @update:modelValue="(dur: number) => $emit('updateDuration', dur)"
  42. />
  43. S
  44. </span>
  45. </ui-group-option>
  46. </ui-group>
  47. </TabPane>
  48. </Tabs>
  49. </template>
  50. <script lang="ts" setup>
  51. import { TabPane, Tabs, Switch } from "ant-design-vue";
  52. import { AnimationModelPath } from "@/api";
  53. import { paths } from "@/store";
  54. import { computed } from "vue";
  55. import SignItem from "@/views/tagging-position/sign-item.vue";
  56. const options = computed(() =>
  57. paths.value.map((item) => ({ label: item.name, value: item.id }))
  58. );
  59. defineProps<{ data: AnimationModelPath }>();
  60. defineEmits<{ (e: "updateDuration", dur: number): void }>();
  61. </script>
  62. <style scoped lang="scss">
  63. .item {
  64. display: flex;
  65. align-items: center;
  66. justify-content: space-between;
  67. }
  68. </style>