123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <template>
- <ui-group-option class="sign-guide">
- <div class="info">
- <div class="guide-cover">
- <img :src="getResource(getFileUrl(guide.cover))" />
- <ui-icon
- type="preview"
- class="icon"
- ctrl
- @click="emit('play')"
- v-if="guide.paths.length"
- />
- </div>
- <div>
- <p>{{ guide.title }}</p>
- </div>
- </div>
- <div class="actions">
- <ui-more
- :options="menus"
- style="margin-left: 20px"
- @click="(action: keyof typeof actions) => actions[action]()"
- />
- </div>
- </ui-group-option>
- </template>
- <script setup lang="ts">
- import { Guide } from "@/store";
- import { getFileUrl } from "@/utils";
- import { getResource } from "@/env";
- import { ui18n } from "@/lang";
- defineProps<{ guide: Guide }>();
- const emit = defineEmits<{
- (e: "delete"): void;
- (e: "play"): void;
- (e: "edit"): void;
- }>();
- const menus = [
- { label: ui18n.t("sys.edit"), value: "edit" },
- { label: ui18n.t("sys.del"), value: "delete" },
- ];
- const actions = {
- edit: () => emit("edit"),
- delete: () => emit("delete"),
- };
- </script>
- <style lang="scss" scoped>
- .sign-guide {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20px 0;
- border-bottom: 1px solid var(--colors-border-color);
- &:first-child {
- border-top: 1px solid var(--colors-border-color);
- }
- .info {
- flex: 1;
- display: flex;
- align-items: center;
- .guide-cover {
- position: relative;
- &::after {
- content: "";
- position: absolute;
- inset: 0;
- background: rgba(0, 0, 0, 0.2);
- }
- .icon {
- position: absolute;
- z-index: 1;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- font-size: 16px;
- }
- img {
- width: 48px;
- height: 48px;
- object-fit: cover;
- border-radius: 4px;
- overflow: hidden;
- background-color: rgba(255, 255, 255, 0.6);
- display: block;
- }
- }
- div {
- margin-left: 10px;
- p {
- color: #fff;
- font-size: 14px;
- margin-bottom: 6px;
- }
- }
- }
- .actions {
- flex: none;
- }
- }
- </style>
|