Add File
This commit is contained in:
621
main/ui/ground.aps
Normal file
621
main/ui/ground.aps
Normal file
@@ -0,0 +1,621 @@
|
||||
<div x-data="ground">
|
||||
<!-- 知识广场-->
|
||||
<div x-show="$store.nav.is_ground" class="overflow-y-auto h-[92vh]">
|
||||
|
||||
<!-- 标签
|
||||
<div class="mx-auto flex flex-col w-full max-w-6xl rounded-lg bg-white shadow-lg mt-2 pt-1">
|
||||
<div @keydown.right.prevent="$focus.wrap().next()" @keydown.left.prevent="$focus.wrap().previous()" class="flex gap-2 overflow-x-auto border-zinc-300 dark:border-zinc-700" role="tablist" aria-label="tab options">
|
||||
|
||||
<button @click="gdSelectedTab = 'all'" :aria-selected="gdSelectedTab === 'all'" :tabindex="gdSelectedTab === 'all' ? '0' : '-1'" :class="gdSelectedTab === 'all' ? 'font-bold rounded text-white bg-sky-700 border-b-2 border-sky-700 dark:border-sky-600 dark:text-sky-600' : 'border-r text-neutral-600 font-medium dark:text-zinc-200 dark:hover:border-b-zinc-500 dark:hover:text-zinc-50 hover:border-b-2 hover:border-b-zinc-500 hover:text-neutral-900'" class="flex h-min items-center gap-2 px-4 py-2 text-sm" type="button" role="tab" aria-controls="tabpanelComments" >
|
||||
|
||||
全部
|
||||
|
||||
<span x-text="view_count" :class="gdSelectedTab === 'all' ? 'border-green-700 bg-green-700 dark:bg-sky-600 dark:border-sky-600 dark:text-white' : 'border-zinc-300 dark:border-zinc-700 bg-zinc-100 dark:bg-zinc-800'" class="text-xs border font-medium px-1 rounded-full">3124</span>
|
||||
|
||||
</button>
|
||||
|
||||
<button @click="gdSelectedTab = 'my'" :aria-selected="gdSelectedTab === 'my'" :tabindex="gdSelectedTab === 'my' ? '0' : '-1'" :class="gdSelectedTab === 'my' ? 'font-bold rounded text-white bg-sky-700 border-b-2 border-sky-700 dark:border-sky-600 dark:text-sky-600' : 'border-r text-neutral-600 font-medium dark:text-zinc-200 dark:hover:border-b-zinc-500 dark:hover:text-zinc-50 hover:border-b-2 hover:border-b-zinc-500 hover:text-neutral-900'" class="flex h-min items-center gap-2 px-4 py-2 text-sm" type="button" role="tab" aria-controls="tabpanelGroups" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="size-5">
|
||||
<path d="m9.653 16.915-.005-.003-.019-.01a20.759 20.759 0 0 1-1.162-.682 22.045 22.045 0 0 1-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 0 1 8-2.828A4.5 4.5 0 0 1 18 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 0 1-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 0 1-.69.001l-.002-.001Z" />
|
||||
</svg>
|
||||
我的智能体
|
||||
<span x-text="my_count" :class="gdSelectedTab === 'my' ? 'border-green-700 bg-green-700 dark:bg-sky-600 dark:border-sky-600 dark:text-white' : 'border-zinc-300 dark:border-zinc-700 bg-zinc-100 dark:bg-zinc-800'" class="text-xs border font-medium px-1 rounded-full">3124</span>
|
||||
|
||||
</button>
|
||||
<button @click="gdSelectedTab = 'mgr'" :aria-selected="gdSelectedTab === 'mgr'" :tabindex="gdSelectedTab === 'mgr' ? '0' : '-1'" :class="gdSelectedTab === 'mgr' ? 'font-bold rounded text-white bg-sky-700 border-b-2 border-sky-700 dark:border-sky-600 dark:text-sky-600' : 'border-r text-neutral-600 font-medium dark:text-zinc-200 dark:hover:border-b-zinc-500 dark:hover:text-zinc-50 hover:border-b-2 hover:border-b-zinc-500 hover:text-neutral-900'" class="flex h-min items-center gap-2 px-4 py-2 text-sm" type="button" role="tab" aria-controls="tabpanelComments" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5 shrink-0" aria-hidden="true">
|
||||
<path d="M15.5 2A1.5 1.5 0 0 0 14 3.5v13a1.5 1.5 0 0 0 1.5 1.5h1a1.5 1.5 0 0 0 1.5-1.5v-13A1.5 1.5 0 0 0 16.5 2h-1ZM9.5 6A1.5 1.5 0 0 0 8 7.5v9A1.5 1.5 0 0 0 9.5 18h1a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 10.5 6h-1ZM3.5 10A1.5 1.5 0 0 0 2 11.5v5A1.5 1.5 0 0 0 3.5 18h1A1.5 1.5 0 0 0 6 16.5v-5A1.5 1.5 0 0 0 4.5 10h-1Z"/>
|
||||
</svg>
|
||||
管理智能体
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<!-- 结果页面-->
|
||||
<div class="p-2">
|
||||
<!-- Tab1 -->
|
||||
<div x-show="gdSelectedTab === 'all'" id="tabpanelGroups" role="tabpanel" aria-label="groups">
|
||||
<!-- 搜索框-->
|
||||
<div class="mx-auto flex flex-col w-full max-w-6xl rounded-lg bg-white shadow-lg p-4">
|
||||
<div class="flex justify-center">
|
||||
<img :src="$store.nav.logo" id="logo2" @click="fetchSomething()" class="cursor-pointer ml-10">
|
||||
<div class="relative my-4 flex w-full max-w-xl mx-4 flex-col gap-1 text-neutral-600 dark:text-zinc-200">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="currentColor" fill="none" stroke-width="2" class="absolute left-2 top-1/2 size-5 -translate-y-1/2 text-neutral-600/50 dark:text-zinc-200/50" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/>
|
||||
</svg>
|
||||
<input x-model="search" x-on:input.debounce.900ms="fetchSomething()" placeholder="智能体检索:检索所有智能体" type="search" class="w-full border border-zinc-300 rounded bg-zinc-50 px-2 py-1.5 pl-9 text-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-700 disabled:cursor-not-allowed disabled:opacity-75 dark:border-zinc-700 dark:bg-zinc-900/50 dark:focus-visible:outline-sky-600" name="search" aria-label="Search" placeholder="Search"/>
|
||||
</div>
|
||||
<div class="ml-6">
|
||||
<button type="button" @click="gdSelectedTab = 'my'" class=" text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded-full inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-1 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="size-5">
|
||||
<path d="m9.653 16.915-.005-.003-.019-.01a20.759 20.759 0 0 1-1.162-.682 22.045 22.045 0 0 1-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 0 1 8-2.828A4.5 4.5 0 0 1 18 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 0 1-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 0 1-.69.001l-.002-.001Z" />
|
||||
</svg>
|
||||
我的智能体
|
||||
</button>
|
||||
<button type="button" @click="gdSelectedTab = 'mgr'" class="text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded-full inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-1 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5 shrink-0" aria-hidden="true">
|
||||
<path d="M15.5 2A1.5 1.5 0 0 0 14 3.5v13a1.5 1.5 0 0 0 1.5 1.5h1a1.5 1.5 0 0 0 1.5-1.5v-13A1.5 1.5 0 0 0 16.5 2h-1ZM9.5 6A1.5 1.5 0 0 0 8 7.5v9A1.5 1.5 0 0 0 9.5 18h1a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 10.5 6h-1ZM3.5 10A1.5 1.5 0 0 0 2 11.5v5A1.5 1.5 0 0 0 3.5 18h1A1.5 1.5 0 0 0 6 16.5v-5A1.5 1.5 0 0 0 4.5 10h-1Z"/>
|
||||
</svg>
|
||||
管理智能体
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 知识助手的列表,每行4个 -->
|
||||
<div class="flex flex-wrap w-full mx-auto mt-2">
|
||||
|
||||
<template x-for="(group,index) in aItems" :key="index">
|
||||
<div class="flex flex-wrap w-full mx-auto max-w-6xl">
|
||||
<h3 :style="{color:group.color}" class="mt-2 border-l-2 pl-2 mx-auto w-full text-md text-sky-700 lg:text-xl font-bold text-on-surface-strong dark:text-on-surface-dark-strong" aria-describedby="productDescription">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5 shrink-0" aria-hidden="true">
|
||||
<path d="M10.362 1.093a.75.75 0 0 0-.724 0L2.523 5.018 10 9.143l7.477-4.125-7.115-3.925ZM18 6.443l-7.25 4v8.25l6.862-3.786A.75.75 0 0 0 18 14.25V6.443ZM9.25 18.693v-8.25l-7.25-4v7.807a.75.75 0 0 0 .388.657l6.862 3.786Z"/>
|
||||
</svg>
|
||||
<span x-text="group.title"></span>(<span x-text="group.count"></span>)</h3>
|
||||
|
||||
<template x-for="(item,index) in group.data" :key="item.id">
|
||||
<div class="item rounded-lg shadow-lg">
|
||||
<!-- Header -->
|
||||
<h3 x-text="item.title" class="text-md text-sky-700 lg:text-xl font-bold text-on-surface-strong dark:text-on-surface-dark-strong" aria-describedby="productDescription">企业文化</h3>
|
||||
<!-- Content -->
|
||||
<p x-text="item.demo.length<=25 ? item.demo :item.demo.slice(0,25)+'...'" class="mb-2 text-pretty text-sm h-10">
|
||||
公司的各种规章制度,包括福利政策,考勤制度,差旅报销等
|
||||
</p>
|
||||
<div class="flex justify-center mt-4 gap-4">
|
||||
<!-- Indigo-Blue -->
|
||||
<button type="button" @click="enter_chat_agent(item.kasn)" class="text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path d="M3.505 2.365A41.369 41.369 0 0 1 9 2c1.863 0 3.697.124 5.495.365 1.247.167 2.18 1.108 2.435 2.268a4.45 4.45 0 0 0-.577-.069 43.141 43.141 0 0 0-4.706 0C9.229 4.696 7.5 6.727 7.5 8.998v2.24c0 1.413.67 2.735 1.76 3.562l-2.98 2.98A.75.75 0 0 1 5 17.25v-3.443c-.501-.048-1-.106-1.495-.172C2.033 13.438 1 12.162 1 10.72V5.28c0-1.441 1.033-2.717 2.505-2.914Z" />
|
||||
<path d="M14 6c-.762 0-1.52.02-2.271.062C10.157 6.148 9 7.472 9 8.998v2.24c0 1.519 1.147 2.839 2.71 2.935.214.013.428.024.642.034.2.009.385.09.518.224l2.35 2.35a.75.75 0 0 0 1.28-.531v-2.07c1.453-.195 2.5-1.463 2.5-2.915V8.998c0-1.526-1.157-2.85-2.729-2.936A41.645 41.645 0 0 0 14 6Z" />
|
||||
</svg>
|
||||
对话
|
||||
</button>
|
||||
<button type="button" @click="do_share(item.title,item.kasn,item)" class="text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-blue-600 dark:focus-visible:outline-blue-600 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs font-medium tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path fill-rule="evenodd" d="M5 4a.75.75 0 0 1 .738.616l.252 1.388A1.25 1.25 0 0 0 6.996 7.01l1.388.252a.75.75 0 0 1 0 1.476l-1.388.252A1.25 1.25 0 0 0 5.99 9.996l-.252 1.388a.75.75 0 0 1-1.476 0L4.01 9.996A1.25 1.25 0 0 0 3.004 8.99l-1.388-.252a.75.75 0 0 1 0-1.476l1.388-.252A1.25 1.25 0 0 0 4.01 6.004l.252-1.388A.75.75 0 0 1 5 4ZM12 1a.75.75 0 0 1 .721.544l.195.682c.118.415.443.74.858.858l.682.195a.75.75 0 0 1 0 1.442l-.682.195a1.25 1.25 0 0 0-.858.858l-.195.682a.75.75 0 0 1-1.442 0l-.195-.682a1.25 1.25 0 0 0-.858-.858l-.682-.195a.75.75 0 0 1 0-1.442l.682-.195a1.25 1.25 0 0 0 .858-.858l.195-.682A.75.75 0 0 1 12 1ZM10 11a.75.75 0 0 1 .728.568.968.968 0 0 0 .704.704.75.75 0 0 1 0 1.456.968.968 0 0 0-.704.704.75.75 0 0 1-1.456 0 .968.968 0 0 0-.704-.704.75.75 0 0 1 0-1.456.968.968 0 0 0 .704-.704A.75.75 0 0 1 10 11Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
订阅
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Tab2 自己的智能体 -->
|
||||
<div x-show="gdSelectedTab === 'my'" id="tabpanelGroups" role="tabpanel" aria-label="groups">
|
||||
<!-- 超级个人助理面板-->
|
||||
<div class="mx-auto my-2 flex w-full max-w-6xl justify-center">
|
||||
|
||||
<h3 class="text-sky-700 text-2xl my-2 mx-2">你好,我是你的超级个人助理!</h3>
|
||||
|
||||
</div>
|
||||
<div x-ref="foo" class="mx-auto flex w-full max-w-6xl rounded-lg bg-white shadow-lg p-4 border-sky-700 border">
|
||||
|
||||
<div class="flex flex-col justify-center w-full">
|
||||
<div>
|
||||
<textarea x-ref="aiPromt" id="aiPromt" rows="2" x-model="super_query" @focus="$refs.foo.classList.add('border-outline-1')" @blur="$refs.foo.classList.remove('border-outline-1')" @keydown.enter="enter_chat_agent('superman')" type="text"
|
||||
class="w-full rounded px-2 py-2 pl-10 pr-24 text-sm text-neutral-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-75 dark:border-zinc-700 dark:bg-zinc-800/50 dark:text-zinc-200 dark:focus-visible:outline-sky-600" value="" name="prompt"
|
||||
placeholder='我会联网搜索、数据分析和深度思考,也会调用在"我的发布"和"我的订阅"中的智能体来帮你完成任务规划和执行,有事不决请问我!'>
|
||||
</textarea>
|
||||
</div>
|
||||
<div class="flex justify-between w-full">
|
||||
<div class="flex gap-2 h-8">
|
||||
<!-- Indigo-Blue -->
|
||||
<button type="button" @click="gdSelectedTab = 'all'" class="text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded-full inline-flex cursor-pointer items-center justify-center whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5 shrink-0" aria-hidden="true">
|
||||
<path d="M10.362 1.093a.75.75 0 0 0-.724 0L2.523 5.018 10 9.143l7.477-4.125-7.115-3.925ZM18 6.443l-7.25 4v8.25l6.862-3.786A.75.75 0 0 0 18 14.25V6.443ZM9.25 18.693v-8.25l-7.25-4v7.807a.75.75 0 0 0 .388.657l6.862 3.786Z"/>
|
||||
</svg>
|
||||
全部智能体(<span x-text="view_count" class="p-0"></span>)
|
||||
</button>
|
||||
<button type="button" @click="(PeopleOpen = FileSelecterOpen=true , SpaceOpen = HistoryOpen = false )" class="text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded-full inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-4 shrink-0" aria-hidden="true">
|
||||
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>
|
||||
<path d="M12 11v6"/>
|
||||
<path d="M8 11v6"/>
|
||||
<path d="M16 11v6"/>
|
||||
</svg>
|
||||
个人文件夹
|
||||
</button>
|
||||
<button type="button" @click="(PeopleOpen = SpaceOpen=true , FileSelecterOpen= HistoryOpen = false)" class="text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded-full inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path d="M9.5 2.672a.5.5 0 1 0 1 0V.843a.5.5 0 0 0-1 0zm4.5.035A.5.5 0 0 0 13.293 2L12 3.293a.5.5 0 1 0 .707.707zM7.293 4A.5.5 0 1 0 8 3.293L6.707 2A.5.5 0 0 0 6 2.707zm-.621 2.5a.5.5 0 1 0 0-1H4.843a.5.5 0 1 0 0 1zm8.485 0a.5.5 0 1 0 0-1h-1.829a.5.5 0 0 0 0 1zM13.293 10A.5.5 0 1 0 14 9.293L12.707 8a.5.5 0 1 0-.707.707zM9.5 11.157a.5.5 0 0 0 1 0V9.328a.5.5 0 0 0-1 0zm1.854-5.097a.5.5 0 0 0 0-.706l-.708-.708a.5.5 0 0 0-.707 0L8.646 5.94a.5.5 0 0 0 0 .707l.708.708a.5.5 0 0 0 .707 0l1.293-1.293Zm-3 3a.5.5 0 0 0 0-.706l-.708-.708a.5.5 0 0 0-.707 0L.646 13.94a.5.5 0 0 0 0 .707l.708.708a.5.5 0 0 0 .707 0z"/>
|
||||
</svg>
|
||||
个人空间
|
||||
</button>
|
||||
<button type="button" @click="(PeopleOpen = HistoryOpen=true , FileSelecterOpen= SpaceOpen=false)" class="text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded-full inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 2c-1.716 0-3.408.106-5.07.31C3.806 2.45 3 3.414 3 4.517V17.25a.75.75 0 0 0 1.075.676L10 15.082l5.925 2.844A.75.75 0 0 0 17 17.25V4.517c0-1.103-.806-2.068-1.93-2.207A41.403 41.403 0 0 0 10 2Z" />
|
||||
</svg>
|
||||
对话历史
|
||||
</button>
|
||||
<!--
|
||||
<button type="button" @click="ds_active ? ds_active=false: ds_active=true" :style="ds_active ? 'color: rgb(255 255 255)':'color: black;'" class="bg-gradient-to-br from-blue-600 to-purple-600 focus-visible:outline-blue-600 dark:focus-visible:outline-blue-600 rounded-full inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs font-medium tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75" title="白色启用,黑色关闭,点击切换">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path fill-rule="evenodd" d="M5 4a.75.75 0 0 1 .738.616l.252 1.388A1.25 1.25 0 0 0 6.996 7.01l1.388.252a.75.75 0 0 1 0 1.476l-1.388.252A1.25 1.25 0 0 0 5.99 9.996l-.252 1.388a.75.75 0 0 1-1.476 0L4.01 9.996A1.25 1.25 0 0 0 3.004 8.99l-1.388-.252a.75.75 0 0 1 0-1.476l1.388-.252A1.25 1.25 0 0 0 4.01 6.004l.252-1.388A.75.75 0 0 1 5 4ZM12 1a.75.75 0 0 1 .721.544l.195.682c.118.415.443.74.858.858l.682.195a.75.75 0 0 1 0 1.442l-.682.195a1.25 1.25 0 0 0-.858.858l-.195.682a.75.75 0 0 1-1.442 0l-.195-.682a1.25 1.25 0 0 0-.858-.858l-.682-.195a.75.75 0 0 1 0-1.442l.682-.195a1.25 1.25 0 0 0 .858-.858l.195-.682A.75.75 0 0 1 12 1ZM10 11a.75.75 0 0 1 .728.568.968.968 0 0 0 .704.704.75.75 0 0 1 0 1.456.968.968 0 0 0-.704.704.75.75 0 0 1-1.456 0 .968.968 0 0 0-.704-.704.75.75 0 0 1 0-1.456.968.968 0 0 0 .704-.704A.75.75 0 0 1 10 11Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
深度思考
|
||||
</button>
|
||||
|
||||
<button type="button" @click="data_active ? data_active=false: data_active=true" :style="data_active ? 'color: rgb(255 255 255)':'color: black'" class="bg-gradient-to-br from-blue-600 to-purple-600 focus-visible:outline-blue-600 dark:focus-visible:outline-blue-600 rounded-full inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs font-medium tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75" title="白色启用,黑色关闭,点击切换">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path fill-rule="evenodd" d="M5 4a.75.75 0 0 1 .738.616l.252 1.388A1.25 1.25 0 0 0 6.996 7.01l1.388.252a.75.75 0 0 1 0 1.476l-1.388.252A1.25 1.25 0 0 0 5.99 9.996l-.252 1.388a.75.75 0 0 1-1.476 0L4.01 9.996A1.25 1.25 0 0 0 3.004 8.99l-1.388-.252a.75.75 0 0 1 0-1.476l1.388-.252A1.25 1.25 0 0 0 4.01 6.004l.252-1.388A.75.75 0 0 1 5 4ZM12 1a.75.75 0 0 1 .721.544l.195.682c.118.415.443.74.858.858l.682.195a.75.75 0 0 1 0 1.442l-.682.195a1.25 1.25 0 0 0-.858.858l-.195.682a.75.75 0 0 1-1.442 0l-.195-.682a1.25 1.25 0 0 0-.858-.858l-.682-.195a.75.75 0 0 1 0-1.442l.682-.195a1.25 1.25 0 0 0 .858-.858l.195-.682A.75.75 0 0 1 12 1ZM10 11a.75.75 0 0 1 .728.568.968.968 0 0 0 .704.704.75.75 0 0 1 0 1.456.968.968 0 0 0-.704.704.75.75 0 0 1-1.456 0 .968.968 0 0 0-.704-.704.75.75 0 0 1 0-1.456.968.968 0 0 0 .704-.704A.75.75 0 0 1 10 11Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
数据分析
|
||||
</button>
|
||||
-->
|
||||
<button type="button" @click="netsearch_active ? netsearch_active=false: netsearch_active=true" :style="netsearch_active ? 'color: rgb(255 255 255)':'color: black'" class="bg-gradient-to-br from-blue-600 to-purple-600 focus-visible:outline-blue-600 dark:focus-visible:outline-blue-600 rounded-full inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs font-medium tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75" title="白色启用,黑色关闭,点击切换">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path fill-rule="evenodd" d="M5 4a.75.75 0 0 1 .738.616l.252 1.388A1.25 1.25 0 0 0 6.996 7.01l1.388.252a.75.75 0 0 1 0 1.476l-1.388.252A1.25 1.25 0 0 0 5.99 9.996l-.252 1.388a.75.75 0 0 1-1.476 0L4.01 9.996A1.25 1.25 0 0 0 3.004 8.99l-1.388-.252a.75.75 0 0 1 0-1.476l1.388-.252A1.25 1.25 0 0 0 4.01 6.004l.252-1.388A.75.75 0 0 1 5 4ZM12 1a.75.75 0 0 1 .721.544l.195.682c.118.415.443.74.858.858l.682.195a.75.75 0 0 1 0 1.442l-.682.195a1.25 1.25 0 0 0-.858.858l-.195.682a.75.75 0 0 1-1.442 0l-.195-.682a1.25 1.25 0 0 0-.858-.858l-.682-.195a.75.75 0 0 1 0-1.442l.682-.195a1.25 1.25 0 0 0 .858-.858l.195-.682A.75.75 0 0 1 12 1ZM10 11a.75.75 0 0 1 .728.568.968.968 0 0 0 .704.704.75.75 0 0 1 0 1.456.968.968 0 0 0-.704.704.75.75 0 0 1-1.456 0 .968.968 0 0 0-.704-.704.75.75 0 0 1 0-1.456.968.968 0 0 0 .704-.704A.75.75 0 0 1 10 11Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
联网搜索
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2">
|
||||
<!-- 刷新 -->
|
||||
<button @click="refresh" aria-label="create something epic" type="button" class="inline-flex justify-center items-center aspect-square whitespace-nowrap rounded-full bg-blue-700 p-2 text-sm font-medium tracking-wide text-white transition hover:opacity-75 text-center focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-700 active:opacity-100 active:outline-offset-0 disabled:opacity-75 disabled:cursor-not-allowed dark:bg-green-700 dark:text-white dark:focus-visible:outline-green-700" title="刷新还原">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="size-5 fill-white dark:fill-blue-700">
|
||||
<path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<!-- 多行输入
|
||||
<button @click="$refs.aiPromt.rows=10" aria-label="create something epic" type="button" class="inline-flex justify-center items-center aspect-square whitespace-nowrap rounded-full bg-blue-700 p-2 text-sm font-medium tracking-wide text-white transition hover:opacity-75 text-center focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-700 active:opacity-100 active:outline-offset-0 disabled:opacity-75 disabled:cursor-not-allowed dark:bg-green-700 dark:text-white dark:focus-visible:outline-green-700" title="多行输入">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="size-5 fill-white dark:fill-blue-700">
|
||||
<path d="M 2 4 H 18 M 2 9 H 18 M 2 14 H 18" stroke-width="1" stroke="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
-->
|
||||
<!-- 上传文件 -->
|
||||
<!-- 文件上传-->
|
||||
<input x-ref="fileInput" @input="upload_file" type="file" multiple hidden class="w-full overflow-clip rounded border border-red-700 bg-zinc-100/50 text-sm text-red-700 file:mr-4 file:cursor-pointer file:border-none file:bg-zinc-100 file:px-4 file:py-2 file:font-medium file:text-neutral-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-700 disabled:cursor-not-allowed disabled:opacity-75 dark:bg-zinc-800/50 dark:file:bg-zinc-800 dark:file:text-zinc-50 dark:focus-visible:outline-sky-600" />
|
||||
|
||||
<button aria-label="create something epic" type="button" class="inline-flex justify-center items-center aspect-square whitespace-nowrap rounded-full bg-blue-700 p-2 text-sm font-medium tracking-wide text-white transition hover:opacity-75 text-center focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-700 active:opacity-100 active:outline-offset-0 disabled:opacity-75 disabled:cursor-not-allowed dark:bg-green-700 dark:text-white dark:focus-visible:outline-green-700" title="上传文件">
|
||||
<svg @click="$refs.fileInput.click()" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" class="size-5 fill-white dark:fill-blue-700">
|
||||
<path fill-rule="evenodd" d="M10.5 3.75a6 6 0 0 0-5.98 6.496A5.25 5.25 0 0 0 6.75 20.25H18a4.5 4.5 0 0 0 2.206-8.423 3.75 3.75 0 0 0-4.133-4.303A6.001 6.001 0 0 0 10.5 3.75Zm2.03 5.47a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72v4.94a.75.75 0 0 0 1.5 0v-4.94l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</button>
|
||||
<!-- 管理 -->
|
||||
<button @click="gdSelectedTab = 'mgr'" aria-label="create something epic" type="button" class="inline-flex justify-center items-center aspect-square whitespace-nowrap rounded-full bg-blue-700 p-2 text-sm font-medium tracking-wide text-white transition hover:opacity-75 text-center focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-700 active:opacity-100 active:outline-offset-0 disabled:opacity-75 disabled:cursor-not-allowed dark:bg-green-700 dark:text-white dark:focus-visible:outline-green-700" title="管理智能体">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5 shrink-0" aria-hidden="true">
|
||||
<path d="M15.5 2A1.5 1.5 0 0 0 14 3.5v13a1.5 1.5 0 0 0 1.5 1.5h1a1.5 1.5 0 0 0 1.5-1.5v-13A1.5 1.5 0 0 0 16.5 2h-1ZM9.5 6A1.5 1.5 0 0 0 8 7.5v9A1.5 1.5 0 0 0 9.5 18h1a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 10.5 6h-1ZM3.5 10A1.5 1.5 0 0 0 2 11.5v5A1.5 1.5 0 0 0 3.5 18h1A1.5 1.5 0 0 0 6 16.5v-5A1.5 1.5 0 0 0 4.5 10h-1Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<!-- 开始对话 -->
|
||||
<button @click="enter_chat_agent('superman')" aria-label="create something epic" type="button" class="inline-flex justify-center items-center aspect-square whitespace-nowrap rounded-full bg-blue-700 p-2 text-sm font-medium tracking-wide text-white transition hover:opacity-75 text-center focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-700 active:opacity-100 active:outline-offset-0 disabled:opacity-75 disabled:cursor-not-allowed dark:bg-green-700 dark:text-white dark:focus-visible:outline-green-700" title="开始对话">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="size-5">
|
||||
<path d="M3.505 2.365A41.369 41.369 0 0 1 9 2c1.863 0 3.697.124 5.495.365 1.247.167 2.18 1.108 2.435 2.268a4.45 4.45 0 0 0-.577-.069 43.141 43.141 0 0 0-4.706 0C9.229 4.696 7.5 6.727 7.5 8.998v2.24c0 1.413.67 2.735 1.76 3.562l-2.98 2.98A.75.75 0 0 1 5 17.25v-3.443c-.501-.048-1-.106-1.495-.172C2.033 13.438 1 12.162 1 10.72V5.28c0-1.441 1.033-2.717 2.505-2.914Z" />
|
||||
<path d="M14 6c-.762 0-1.52.02-2.271.062C10.157 6.148 9 7.472 9 8.998v2.24c0 1.519 1.147 2.839 2.71 2.935.214.013.428.024.642.034.2.009.385.09.518.224l2.35 2.35a.75.75 0 0 0 1.28-.531v-2.07c1.453-.195 2.5-1.463 2.5-2.915V8.998c0-1.526-1.157-2.85-2.729-2.936A41.645 41.645 0 0 0 14 6Z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mt-3 border-l-2 pl-2 mx-auto w-full max-w-6xl text-md text-sky-700 lg:text-xl font-bold text-on-surface-strong dark:text-on-surface-dark-strong" aria-describedby="productDescription">
|
||||
我的发布(<span x-text="m_count"></span>)</h3>
|
||||
<!-- 知识助手的列表,每行4个 -->
|
||||
<div class="flex flex-wrap w-full mx-auto max-w-6xl">
|
||||
<template x-for="(item,index) in mItems" :key="item.id">
|
||||
<div class="item rounded-lg shadow-lg ">
|
||||
<!-- Header -->
|
||||
<div class="flex text-sky-700 text-md lg:text-xl font-bold text-on-surface-strong dark:text-on-surface-dark-strong" aria-describedby="productDescription" :title="item.catalog">
|
||||
<svg :style='{color:item.oth}' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5 shrink-0" aria-hidden="true" >
|
||||
<path d="M10.362 1.093a.75.75 0 0 0-.724 0L2.523 5.018 10 9.143l7.477-4.125-7.115-3.925ZM18 6.443l-7.25 4v8.25l6.862-3.786A.75.75 0 0 0 18 14.25V6.443ZM9.25 18.693v-8.25l-7.25-4v7.807a.75.75 0 0 0 .388.657l6.862 3.786Z"/>
|
||||
</svg>
|
||||
<span x-text="item.title" class="px-1"></span>
|
||||
</div>
|
||||
<!-- Content -->
|
||||
<p x-text="item.demo.length<=25 ? item.demo :item.demo.slice(0,25)+'...'" class="mb-2 text-pretty text-sm h-10">
|
||||
公司的各种规章制度,包括福利政策,考勤制度,差旅报销等
|
||||
</p>
|
||||
<div class="flex justify-center mt-4 gap-4">
|
||||
<!-- Indigo-Blue -->
|
||||
<button type="button" @click="enter_chat_agent(item.kasn)" :class='item.id==-1 ? "bg-zinc-200 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75": "text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75"'>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path d="M3.505 2.365A41.369 41.369 0 0 1 9 2c1.863 0 3.697.124 5.495.365 1.247.167 2.18 1.108 2.435 2.268a4.45 4.45 0 0 0-.577-.069 43.141 43.141 0 0 0-4.706 0C9.229 4.696 7.5 6.727 7.5 8.998v2.24c0 1.413.67 2.735 1.76 3.562l-2.98 2.98A.75.75 0 0 1 5 17.25v-3.443c-.501-.048-1-.106-1.495-.172C2.033 13.438 1 12.162 1 10.72V5.28c0-1.441 1.033-2.717 2.505-2.914Z" />
|
||||
<path d="M14 6c-.762 0-1.52.02-2.271.062C10.157 6.148 9 7.472 9 8.998v2.24c0 1.519 1.147 2.839 2.71 2.935.214.013.428.024.642.034.2.009.385.09.518.224l2.35 2.35a.75.75 0 0 0 1.28-.531v-2.07c1.453-.195 2.5-1.463 2.5-2.915V8.998c0-1.526-1.157-2.85-2.729-2.936A41.645 41.645 0 0 0 14 6Z" />
|
||||
</svg>
|
||||
对话
|
||||
</button>
|
||||
<button type="button" @click="do_share(item.title,item.kasn,item)" :class='item.id==-1 ? "bg-zinc-200 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75": "text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75"'>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path fill-rule="evenodd" d="M5 4a.75.75 0 0 1 .738.616l.252 1.388A1.25 1.25 0 0 0 6.996 7.01l1.388.252a.75.75 0 0 1 0 1.476l-1.388.252A1.25 1.25 0 0 0 5.99 9.996l-.252 1.388a.75.75 0 0 1-1.476 0L4.01 9.996A1.25 1.25 0 0 0 3.004 8.99l-1.388-.252a.75.75 0 0 1 0-1.476l1.388-.252A1.25 1.25 0 0 0 4.01 6.004l.252-1.388A.75.75 0 0 1 5 4ZM12 1a.75.75 0 0 1 .721.544l.195.682c.118.415.443.74.858.858l.682.195a.75.75 0 0 1 0 1.442l-.682.195a1.25 1.25 0 0 0-.858.858l-.195.682a.75.75 0 0 1-1.442 0l-.195-.682a1.25 1.25 0 0 0-.858-.858l-.682-.195a.75.75 0 0 1 0-1.442l.682-.195a1.25 1.25 0 0 0 .858-.858l.195-.682A.75.75 0 0 1 12 1ZM10 11a.75.75 0 0 1 .728.568.968.968 0 0 0 .704.704.75.75 0 0 1 0 1.456.968.968 0 0 0-.704.704.75.75 0 0 1-1.456 0 .968.968 0 0 0-.704-.704.75.75 0 0 1 0-1.456.968.968 0 0 0 .704-.704A.75.75 0 0 1 10 11Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
分享
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<h3 class="mt-2 border-l-2 pl-2 mx-auto w-full max-w-6xl text-md text-sky-700 lg:text-xl font-bold text-on-surface-strong dark:text-on-surface-dark-strong" aria-describedby="productDescription">
|
||||
我的订阅(<span x-text="s_count"></span>)</h3>
|
||||
<!-- 知识助手的列表,每行4个 -->
|
||||
<div class="flex flex-wrap w-full mx-auto max-w-6xl">
|
||||
<template x-for="(item,index) in sItems" :key="item.id">
|
||||
<div class="item rounded-lg shadow-lg">
|
||||
<!-- Header -->
|
||||
<div class="flex text-md text-sky-700 lg:text-xl font-bold text-on-surface-strong dark:text-on-surface-dark-strong" aria-describedby="productDescription">
|
||||
<svg :style='{color:item.oth}' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5 shrink-0" aria-hidden="true">
|
||||
<path d="M10.362 1.093a.75.75 0 0 0-.724 0L2.523 5.018 10 9.143l7.477-4.125-7.115-3.925ZM18 6.443l-7.25 4v8.25l6.862-3.786A.75.75 0 0 0 18 14.25V6.443ZM9.25 18.693v-8.25l-7.25-4v7.807a.75.75 0 0 0 .388.657l6.862 3.786Z"/>
|
||||
</svg>
|
||||
<span x-text="item.title" class="px-1"></span>
|
||||
</div>
|
||||
<!-- Content -->
|
||||
<p x-text="item.demo.length<=25 ? item.demo :item.demo.slice(0,25)+'...'" class="mb-2 text-pretty text-sm h-10">
|
||||
公司的各种规章制度,包括福利政策,考勤制度,差旅报销等
|
||||
</p>
|
||||
<div class="flex justify-center mt-4 gap-4">
|
||||
<!-- Indigo-Blue -->
|
||||
<button type="button" @click="enter_chat_agent(item.kasn)" :class='item.id==-1 ? "bg-zinc-200 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75": "text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75"'>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path d="M3.505 2.365A41.369 41.369 0 0 1 9 2c1.863 0 3.697.124 5.495.365 1.247.167 2.18 1.108 2.435 2.268a4.45 4.45 0 0 0-.577-.069 43.141 43.141 0 0 0-4.706 0C9.229 4.696 7.5 6.727 7.5 8.998v2.24c0 1.413.67 2.735 1.76 3.562l-2.98 2.98A.75.75 0 0 1 5 17.25v-3.443c-.501-.048-1-.106-1.495-.172C2.033 13.438 1 12.162 1 10.72V5.28c0-1.441 1.033-2.717 2.505-2.914Z" />
|
||||
<path d="M14 6c-.762 0-1.52.02-2.271.062C10.157 6.148 9 7.472 9 8.998v2.24c0 1.519 1.147 2.839 2.71 2.935.214.013.428.024.642.034.2.009.385.09.518.224l2.35 2.35a.75.75 0 0 0 1.28-.531v-2.07c1.453-.195 2.5-1.463 2.5-2.915V8.998c0-1.526-1.157-2.85-2.729-2.936A41.645 41.645 0 0 0 14 6Z" />
|
||||
</svg>
|
||||
对话
|
||||
</button>
|
||||
<button type="button" @click="do_cancel(item.title,item.kasn)" :class='item.id==-1 ? "bg-zinc-200 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75": "text-white bg-gradient-to-br from-indigo-600 to-blue-600 focus-visible:outline-indigo-600 dark:focus-visible:outline-indigo-600 rounded inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap px-4 py-2 text-xs tracking-wide transition hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 active:opacity-100 active:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-75"'>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="size-4">
|
||||
<path fill-rule="evenodd" d="M5 4a.75.75 0 0 1 .738.616l.252 1.388A1.25 1.25 0 0 0 6.996 7.01l1.388.252a.75.75 0 0 1 0 1.476l-1.388.252A1.25 1.25 0 0 0 5.99 9.996l-.252 1.388a.75.75 0 0 1-1.476 0L4.01 9.996A1.25 1.25 0 0 0 3.004 8.99l-1.388-.252a.75.75 0 0 1 0-1.476l1.388-.252A1.25 1.25 0 0 0 4.01 6.004l.252-1.388A.75.75 0 0 1 5 4ZM12 1a.75.75 0 0 1 .721.544l.195.682c.118.415.443.74.858.858l.682.195a.75.75 0 0 1 0 1.442l-.682.195a1.25 1.25 0 0 0-.858.858l-.195.682a.75.75 0 0 1-1.442 0l-.195-.682a1.25 1.25 0 0 0-.858-.858l-.682-.195a.75.75 0 0 1 0-1.442l.682-.195a1.25 1.25 0 0 0 .858-.858l.195-.682A.75.75 0 0 1 12 1ZM10 11a.75.75 0 0 1 .728.568.968.968 0 0 0 .704.704.75.75 0 0 1 0 1.456.968.968 0 0 0-.704.704.75.75 0 0 1-1.456 0 .968.968 0 0 0-.704-.704.75.75 0 0 1 0-1.456.968.968 0 0 0 .704-.704A.75.75 0 0 1 10 11Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
取消订阅
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Tab3 发布智能体 -->
|
||||
<div x-show="gdSelectedTab === 'mgr'" id="tabpanelSaved" role="tabpanel" aria-label="saved">
|
||||
<div alp-unit="gd_mgr.html" class="flex w-full mx-auto max-w-6xl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 智能体对话窗口-->
|
||||
<!-- <template x-if="!$store.nav.is_ground"> -->
|
||||
<div id="chat_agent" x-show="!$store.nav.is_ground" class="w-full h-full">
|
||||
<div alp-unit="chat_agent.html"></div>
|
||||
</div>
|
||||
<!-- </template> -->
|
||||
<!-- 分享窗口 -->
|
||||
<div x-cloak x-show="successModalIsOpen" x-transition.opacity.duration.200ms x-trap.inert.noscroll="successModalIsOpen" x-on:keydown.esc.window="successModalIsOpen = false" x-on:click.self="successModalIsOpen = false" class="fixed inset-0 z-30 flex items-end justify-center bg-black/20 p-4 pb-8 backdrop-blur-md sm:items-center lg:p-8" role="dialog" aria-modal="true" aria-labelledby="successModalTitle">
|
||||
<!-- Modal Dialog -->
|
||||
<div x-show="successModalIsOpen" x-transition:enter="transition ease-out duration-200 delay-100 motion-reduce:transition-opacity" x-transition:enter-start="opacity-0 scale-50" x-transition:enter-end="opacity-100 scale-100" class="flex max-w-lg flex-col gap-4 overflow-hidden rounded-radius border border-outline bg-surface text-on-surface dark:border-outline-dark dark:bg-surface-dark-alt dark:text-on-surface-dark">
|
||||
<!-- Dialog Header -->
|
||||
<div class="flex items-center justify-between border-b border-outline bg-surface-alt/60 px-4 py-2 dark:border-outline-dark dark:bg-surface-dark/20">
|
||||
<div class="flex items-center justify-center rounded-full bg-success/20 text-success p-1">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-6" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<h3 id="successModalTitle" class="mb-2 font-semibold tracking-wide text-on-surface-strong dark:text-on-surface-dark-strong">
|
||||
<span x-text="share_title"></span>
|
||||
智能体-分享订阅</h3>
|
||||
<button x-on:click="successModalIsOpen = false" aria-label="close modal">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" stroke="currentColor" fill="none" stroke-width="1.4" class="w-5 h-5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<!-- Dialog Body -->
|
||||
<div class="px-4">
|
||||
<h3 class="mb-2 font-semibold tracking-wide text-on-surface-strong">
|
||||
标签:<span x-text="share_agent.catalog"></span>
|
||||
</h3>
|
||||
<h3 class="mb-2 font-semibold tracking-wide text-on-surface-strong">
|
||||
类型:<span x-text='({0:"文件检索", 1: "目录检索", 2: "AI生成",3:"融合智能",100:"未来扩展" })[share_agent.atype] || "❓"'></span>
|
||||
</h3>
|
||||
<h3 class="mb-2 font-semibold tracking-wide text-on-surface-strong">
|
||||
简介:<span x-text="share_agent.demo"></span>
|
||||
</h3>
|
||||
<h3 class="mb-2 font-semibold tracking-wide text-on-surface-strong">
|
||||
功能:<span x-text="share_agent.guide"></span>
|
||||
</h3>
|
||||
<h3 x-text="share_url" class="mb-2 text-center font-semibold tracking-wide text-on-surface-strong"></h3>
|
||||
<p>复制上方链接到新的浏览器窗口打开即可,也可点击下方按钮直接访问</p>
|
||||
</div>
|
||||
<!-- Dialog Footer -->
|
||||
<div class="flex items-center justify-center border-outline p-4 dark:border-outline-dark">
|
||||
<button x-on:click="window.open(share_url, '_blank')" type="button" class="w-full whitespace-nowrap rounded-radius border border-success bg-success px-4 py-2 text-center text-sm font-semibold tracking-wide text-on-success transition hover:opacity-75 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-success active:opacity-100 active:outline-offset-0">直接访问</button>
|
||||
<button x-on:click="sub" type="button" class="w-full whitespace-nowrap rounded-radius border border-success bg-success px-4 py-2 text-center text-sm font-semibold tracking-wide text-on-success transition hover:opacity-75 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-success active:opacity-100 active:outline-offset-0">订阅</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 个人窗口 -->
|
||||
<div x-show="PeopleOpen" id="people_window" x-on:keydown.esc.window="PeopleOpen = false" class="fixed top-11 left-0 right-0 z-30 mx-auto max-w-4xl w-full overflow-hidden rounded border border-sky-700 bg-zinc-50 text-neutral-600 dark:bg-zinc-900 dark:text-zinc-200" role="alert">
|
||||
<div id="people_window_m" class="flex moved w-full items-center gap-2 bg-sky-700/90 p-2">
|
||||
<div class="ml-2">
|
||||
<h3 x-text="people_title" class="text-sm font-semibold text-white">个人文件夹</h3>
|
||||
</div>
|
||||
<button @click="PeopleOpen=false" class="ml-auto" aria-label="dismiss alert">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" stroke="currentColor" fill="none" stroke-width="2.5" class="w-4 h-4 shrink-0">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<!-- body-->
|
||||
<div class="flex w-full items-center gap-2 bg-sky-700/10 p-2" @fileselected="handleFileSelected($event)">
|
||||
<template x-if="FileSelecterOpen">
|
||||
<div id="kg_select" alp-unit="kg_select.aps" class="w-full overflow-hidden"></div>
|
||||
</template>
|
||||
<template x-if="SpaceOpen">
|
||||
<div id="space_select" alp-unit="baike_select.html" class="w-full overflow-hidden"></div>
|
||||
</template>
|
||||
<template x-if="HistoryOpen">
|
||||
<div id="his_select" alp-unit="chat_history.html" class="w-full overflow-hidden"></div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.item {
|
||||
background-color: rgb(250 250 250 / 1);
|
||||
border: 1px solid #ccc;
|
||||
margin: 8px;
|
||||
padding: 20px;
|
||||
/*text-align: center;*/
|
||||
width: calc(25% - 20px); /* 每个项目的宽度 */
|
||||
}
|
||||
#logo2 {
|
||||
width: 200px;
|
||||
height: 50px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function ground(){
|
||||
return {
|
||||
search: '',
|
||||
Agent_Kasn: "", //KAgent的识别码
|
||||
kagent_url: window.location.protocol+"//"+url.hostname+":7000?sn=",
|
||||
my_count: 0,
|
||||
view_count:0,
|
||||
m_count:0,
|
||||
s_count:0,
|
||||
pageSize:10,
|
||||
gdSelectedTab: "my",
|
||||
curPage: 1,
|
||||
super_query:"",
|
||||
old_query:'', //记录上一次的值
|
||||
aItems:[],
|
||||
Items:[],
|
||||
mItems:[], //自己发布的
|
||||
sItems:[], //自己订阅的
|
||||
successModalIsOpen:false,
|
||||
PeopleOpen: false, //个人窗口
|
||||
FileSelecterOpen: false, //个人文件夹
|
||||
SpaceOpen:false,
|
||||
HistoryOpen:false,
|
||||
show_list:true,
|
||||
share_url:"",
|
||||
share_title:"",
|
||||
share_agent:{}, //分享的agent
|
||||
data_active:true, //数据分析
|
||||
netsearch_active:true, //联网搜索
|
||||
ds_active:true, //深度思考
|
||||
people_files: "个人文件夹/"+this.$store.nav.username,
|
||||
people_space: "个人空间/"+this.$store.nav.username,
|
||||
people_history: this.$store.nav.username,
|
||||
people_title:"",
|
||||
cache_ai_file:"",//上传或选中的文件
|
||||
ischange:false, //上传了文件或选择了文件
|
||||
init(){
|
||||
this.fetchSomething();
|
||||
this.fetchMyList();
|
||||
|
||||
//动态加载,AI对话框
|
||||
this.$watch('FileSelecterOpen',value => {
|
||||
if (value){
|
||||
this.people_title="个人文件夹";
|
||||
this.$nextTick(() => {
|
||||
var dom = document.getElementById("kg_select")
|
||||
scan_alp_units(dom);
|
||||
});
|
||||
}
|
||||
});
|
||||
//动态加载,AI对话框
|
||||
this.$watch('SpaceOpen',value => {
|
||||
if (value){
|
||||
this.people_title="个人空间";
|
||||
this.$nextTick(() => {
|
||||
var dom = document.getElementById("space_select")
|
||||
scan_alp_units(dom);
|
||||
});
|
||||
}
|
||||
});
|
||||
//动态加载,AI对话框
|
||||
this.$watch('HistoryOpen',value => {
|
||||
if (value){
|
||||
this.people_title="对话历史";
|
||||
this.$nextTick(() => {
|
||||
var dom = document.getElementById("his_select")
|
||||
scan_alp_units(dom);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//主对话内容发生了改变
|
||||
this.$watch('super_query',value => {
|
||||
if (value!=this.old_query){
|
||||
this.ischange = true;
|
||||
this.old_query = value;
|
||||
}
|
||||
if(value.length>50){
|
||||
this.$refs.aiPromt.rows=10
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh(){ //刷新
|
||||
this.$refs.aiPromt.rows=2;
|
||||
this.Agent_Kasn="";
|
||||
this.cache_ai_file="";
|
||||
this.$refs.aiPromt.placeholder='我会联网搜索、数据分析和深度思考,也会调用在"我的发布"和"我的订阅"中的智能体来帮你完成任务规划和执行,有事不决请问我!';
|
||||
this.fetchSomething();
|
||||
this.fetchMyList();
|
||||
this.super_query="";
|
||||
this.ischange = false;
|
||||
},
|
||||
enter_chat_agent(kasn){
|
||||
this.$store.nav.is_ground=false;
|
||||
if (this.Agent_Kasn !=kasn || this.ischange){
|
||||
this.Agent_Kasn = kasn;
|
||||
this.ischange = false;
|
||||
//dom 更新后加载==动态加载
|
||||
this.$nextTick(() => {
|
||||
var dom = document.getElementById("chat_agent")
|
||||
scan_alp_units(dom);
|
||||
});
|
||||
}
|
||||
},
|
||||
do_share(title,sn,item){
|
||||
this.share_url=this.kagent_url+sn;
|
||||
this.successModalIsOpen=true;
|
||||
this.Agent_Kasn=sn;
|
||||
this.share_title = title;
|
||||
this.share_agent = item;
|
||||
},
|
||||
sub(){
|
||||
//订阅
|
||||
axios.put('/api/user_sn/'+this.Agent_Kasn).then(response => {
|
||||
this.successModalIsOpen=false;
|
||||
}).catch(error => {
|
||||
console.error('Error fetching data:', error);
|
||||
throw error; // 重新抛出错误以便调用者可以处理
|
||||
});
|
||||
},
|
||||
do_cancel(title,sn){
|
||||
//取消订阅
|
||||
axios.put('/api/cancel_sn/'+sn).then(response => {
|
||||
this.fetchMyList();
|
||||
}).catch(error => {
|
||||
console.error('Error fetching data:', error);
|
||||
throw error; // 重新抛出错误以便调用者可以处理
|
||||
});
|
||||
},
|
||||
fetchSomething() {
|
||||
axios.get('/api/kagent?q='+this.search).then(response => {
|
||||
//console.log('Data:', response.data);
|
||||
this.aItems = response.data.data;
|
||||
this.view_count = response.data.count;
|
||||
}).catch(error => {
|
||||
console.error('Error fetching data:', error);
|
||||
throw error; // 重新抛出错误以便调用者可以处理
|
||||
});
|
||||
},
|
||||
fetchMyList() {
|
||||
axios.get('/api/kagent/my?q='+this.search).then(response => {
|
||||
//console.log('Data:', response.data);
|
||||
this.mItems = response.data.data;
|
||||
this.m_count = response.data.count;
|
||||
this.sItems = response.data.sub_data;
|
||||
this.s_count = response.data.sub_count;
|
||||
this.my_count = this.m_count+this.s_count;
|
||||
}).catch(error => {
|
||||
console.error('Error fetching data:', error);
|
||||
throw error; // 重新抛出错误以便调用者可以处理
|
||||
});
|
||||
},
|
||||
upload_file(){
|
||||
const file = this.$refs.fileInput.files[0];
|
||||
//if (!file) return;
|
||||
this.ischange = true;
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append("curpath","");
|
||||
|
||||
try {
|
||||
axios.post('/api/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}).then( response =>{
|
||||
var doc = response.data;
|
||||
if (doc.errno === 1) {
|
||||
alert(doc.message);
|
||||
}else{
|
||||
this.$refs.aiPromt.placeholder="你上传了文件: "+doc.file.name+",你可以在个人文件夹查看,也可以直接开始对话";
|
||||
|
||||
this.cache_ai_file = doc.file;
|
||||
}
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
alert('An error occurred while uploading the file.');
|
||||
}
|
||||
},
|
||||
//个人文件夹选中
|
||||
handleFileSelected(event){
|
||||
var doc = event.detail;
|
||||
console.info(doc);
|
||||
|
||||
doc.name = doc.path;
|
||||
this.$refs.aiPromt.placeholder="你选择了文件: "+doc.path+",你可以针对此文件开始对话";
|
||||
this.cache_ai_file = doc;
|
||||
this.PeopleOpen = false;
|
||||
this.ischange = true;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//全局变量
|
||||
var isDragging = false;
|
||||
var offsetX, offsetY;
|
||||
//设置某个层可以鼠标拖动(position: absolute; /* 必须是absolute或fixed才能拖动 */)
|
||||
function set_draggable_by_id(id){
|
||||
//本体
|
||||
var draggable = document.getElementById(id);
|
||||
//拖拽的标题
|
||||
var draggable_m = document.getElementById(id+"_m");
|
||||
|
||||
draggable_m.onmousedown = function(e) {
|
||||
isDragging = true;
|
||||
// 计算鼠标相对于元素左上角的位置
|
||||
offsetX = e.clientX - draggable.offsetLeft;
|
||||
offsetY = e.clientY - draggable.offsetTop;
|
||||
console.info("开始拖动");
|
||||
// 在移动过程中持续更新位置
|
||||
document.onmousemove = function(e) {
|
||||
if (isDragging) {
|
||||
draggable.style.left = (e.clientX - offsetX) + 'px';
|
||||
draggable.style.top = (e.clientY - offsetY) + 'px';
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
//console.info("设置可拖动完成");
|
||||
|
||||
// 监听全局的mouseup事件来停止拖拽
|
||||
document.onmouseup = function() {
|
||||
isDragging = false;
|
||||
document.onmousemove = null;
|
||||
};
|
||||
}
|
||||
|
||||
set_draggable_by_id('people_window');
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user