|
|
@ -1,4 +1,6 @@ |
|
|
|
<script lang="ts"> |
|
|
|
import { createEventDispatcher } from 'svelte'; |
|
|
|
const dispatch = createEventDispatcher(); |
|
|
|
let list = [ |
|
|
|
{ |
|
|
|
title: '工作', |
|
|
@ -8,12 +10,16 @@ |
|
|
|
{ |
|
|
|
label: '工作总结', |
|
|
|
img: '/img/icon/work.png', |
|
|
|
imgActive: '/img/icon/work_active.png' |
|
|
|
imgActive: '/img/icon/work_active.png', |
|
|
|
active: false, |
|
|
|
placeholder: |
|
|
|
'<p>帮我写一份用于 例如<span style="color:#2c77f1 !important">项目进度、本周工作等</span> 的工作总结,包括<span style="color:#2c77f1 !important">工作内容、成果、风险点等。</span></p>' |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '工作总结', |
|
|
|
label: '文档生成', |
|
|
|
img: '/img/icon/document.png', |
|
|
|
imgActive: '/img/icon/document_active.png' |
|
|
|
imgActive: '/img/icon/document_active.png', |
|
|
|
active: false |
|
|
|
} |
|
|
|
], |
|
|
|
introduce: [ |
|
|
@ -26,8 +32,7 @@ |
|
|
|
{ |
|
|
|
label: '介绍' |
|
|
|
} |
|
|
|
], |
|
|
|
active:true |
|
|
|
] |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '知识库', |
|
|
@ -37,12 +42,8 @@ |
|
|
|
{ |
|
|
|
label: '检索知识库', |
|
|
|
img: '/img/icon/knowledge.png', |
|
|
|
imgActive: '/img/icon/knowledge_active.png' |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '上传文档', |
|
|
|
img: '/img/icon/upload.png', |
|
|
|
imgActive: '/img/icon/upload_active.png' |
|
|
|
imgActive: '/img/icon/knowledge_active.png', |
|
|
|
active: false |
|
|
|
} |
|
|
|
], |
|
|
|
introduce: [ |
|
|
@ -65,7 +66,8 @@ |
|
|
|
{ |
|
|
|
label: '历史消息', |
|
|
|
img: '/img/icon/record.png', |
|
|
|
imgActive: '/img/icon/record_active.png' |
|
|
|
imgActive: '/img/icon/record_active.png', |
|
|
|
active: false |
|
|
|
} |
|
|
|
], |
|
|
|
introduce: [ |
|
|
@ -81,7 +83,6 @@ |
|
|
|
] |
|
|
|
} |
|
|
|
]; |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<div class="flex flex-col border-box header_box"> |
|
|
@ -107,12 +108,24 @@ |
|
|
|
<div class="flex mt-5.5"> |
|
|
|
{#each item.buttons as but, index (index)} |
|
|
|
<button |
|
|
|
class="font-medium text-black text-base mr-4 bg-white rounded-2xl px-6 py-1 box-border flex items-center border" |
|
|
|
class="font-medium text-black text-base mr-4 bg-white rounded-2xl px-6 py-1 box-border flex items-center border {but.active |
|
|
|
? 'border-blue-500 text-blue-500' |
|
|
|
: ''}" |
|
|
|
on:click={() => { |
|
|
|
console.log(but, index); |
|
|
|
list.forEach((item) => { |
|
|
|
item.buttons.forEach((c) => { |
|
|
|
if (c.active === true && c.label !== but.label) { |
|
|
|
c.active = false; |
|
|
|
} else if (c.label === but.label) { |
|
|
|
c.active = true; |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
list = [...list]; |
|
|
|
dispatch('savePlaceholder',but.placeholder || null) |
|
|
|
}} |
|
|
|
> |
|
|
|
<img src={but.img} alt="" class="w-5 h-5" /> |
|
|
|
<img src={but.active ? but.imgActive : but.img} alt="" class="w-5 h-5 mr-1" /> |
|
|
|
{but.label} |
|
|
|
</button> |
|
|
|
{/each} |
|
|
|