云
9 小时以前 91bfcf61f44f353dfebc54a57b5b774721de3e9a
src/packages/effects/layouts/src/widgets/global-search/global-search.vue
@@ -24,10 +24,11 @@
});
const props = withDefaults(
  defineProps<{ enableShortcutKey?: boolean; menus?: MenuRecordRaw[] }>(),
  defineProps<{ enableShortcutKey?: boolean; menus?: MenuRecordRaw[]; presentation?: 'compact' | 'portal' }>(),
  {
    enableShortcutKey: true,
    menus: () => [],
    presentation: 'compact',
  },
);
@@ -134,7 +135,11 @@
        </div>
      </template>
    </Modal>
    <button v-if="presentation === 'portal'" type="button" class="portal-search-trigger" aria-label="搜索菜单与业务功能" aria-haspopup="dialog" :aria-expanded="open" @click="toggleOpen">
      <span>搜索菜单与业务功能…</span><span class="portal-search-submit"><Search class="size-4" /></span>
    </button>
    <div
      v-else
      class="group flex h-8 cursor-pointer items-center gap-3 rounded-2xl border-none bg-none px-2 py-0.5 outline-hidden md:bg-accent"
      @click="toggleOpen()"
    >
@@ -157,3 +162,11 @@
    </div>
  </div>
</template>
<style scoped>
.portal-search-trigger { display: flex; width: 100%; height: 32px; align-items: center; justify-content: space-between; padding: 0 0 0 12px; border: 1px solid #d4e2ee; border-radius: 5px; color: #5c7187; background: #fff; font-size: 12px; text-align: left; cursor: pointer; }
.portal-search-submit { display: grid; width: 42px; height: 32px; place-items: center; border-radius: 0 5px 5px 0; color: #fff; background: #b7242d; }
.portal-search-trigger:hover { border-color: #95b3cf; }
.portal-search-trigger:focus-visible { outline: 2px solid #2c70b2; outline-offset: 3px; }
@media (max-width: 767px) { .portal-search-trigger { width: 30px; height: 28px; padding: 0; border: 0; background: transparent; } .portal-search-trigger > span:first-child { display: none; } .portal-search-submit { width: 28px; height: 28px; border-radius: 4px; } }
</style>