Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冯丙见
AI私人知识库
提交
d966ca23
A
AI私人知识库
项目概览
冯丙见
/
AI私人知识库
与 Fork 源项目一致
Fork自
冯丙见 / AI绘图
通知
1
Star
128
Fork
113
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AI私人知识库
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d966ca23
编写于
1月 12, 2024
作者:
W
weixin_44463441
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fri Jan 12 10:08:00 CST 2024 inscode
上级
a34ffdcb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
20 deletion
+34
-20
src/App.vue
src/App.vue
+10
-12
src/components/content/index.vue
src/components/content/index.vue
+20
-7
src/js/repEs.js
src/js/repEs.js
+4
-1
未找到文件。
src/App.vue
浏览文件 @
d966ca23
<
template
>
<div
class=
"w-full h-
screen
"
>
<div
class=
"w-full h-
dvh
"
>
<!-- toolbar -->
<div
class=
"w-full h-14
pt-2 border-b-2 shadow-2xl fixed bg-slate-200 flex items-center
"
>
<div
class=
"w-full h-14
border-b-2 shadow-2xl fixed bg-slate-200 flex justify-between items-center px-4 md:px-10
"
>
<div
class=
"flex-none w-1/3"
>
</div>
<div
class=
"flex-none w-1/3 text-center"
>
<span
class=
"leading-10 font-bold"
>
{{
name
}}
{{
config
?.
mode
===
'
completions
'
?
'
(无上下文)
'
:
''
}}
</span>
<div
class=
"flex-none flex gap-2 items-center"
>
<img
class=
"w-8 h-8 rounded-full"
src=
"https://csdn-665-inscode.s3.cn-north-1.jdcloud-oss.com/inscode/202307/622aa39c1f9b166ab1a38c05/1689313832234-63659446-QeEVrAvJoQIMBZjs2NChZ0MzsXv2Gz8B/avatar"
/>
<span
class=
"font-bold"
>
{{
name
}}
</span>
</div>
<div
class=
"flex-none
w-1/3 *:ml-4 *:text-gray-600 *:hover:text-gray-900 text-sm float-right flex justify-end pr-4
"
>
<button
@
click=
"page='chat'"
>
Chat
</button>
<button
@
click=
"page='content'"
>
知识库
</button>
<div
class=
"flex-none
*:ml-4 text-sm flex justify-end items-center
"
>
<button
@
click=
"page='chat'"
:class=
"['text-gray-600', page === 'chat' ? 'text-blue-600' : '', page === 'chat' ? 'underline' : '']"
>
Chat
</button>
<button
@
click=
"page='content'"
:class=
"['text-gray-600', page === 'content' ? 'text-blue-600' : '', page === 'content' ? 'underline' : '']"
>
知识库
</button>
<button>
设置
</button>
<svg
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
viewBox=
"0 0 24 24"
stroke-width=
"1.5"
stroke=
"currentColor"
...
...
@@ -155,7 +153,7 @@ export default {
},
data
()
{
return
{
page
:
''
,
page
:
'
chat
'
,
id
:
0
,
name
:
'
加载中...
'
,
userAvatarList
:
[],
...
...
src/components/content/index.vue
浏览文件 @
d966ca23
...
...
@@ -3,27 +3,39 @@
<div
class=
"p-4"
>
<div
class=
"flex ju"
>
<input
class=
"block my-2 w-full"
v-model=
"newContent"
maxLength=
"50"
/>
<button
class=
"bg-gray-300 px-4 h-10 rounded hover:bg-gray-400"
@
click=
"add"
>
add
</button>
<button
class=
"bg-gray-300 px-4 h-10 rounded hover:bg-gray-400 ml-2"
@
click=
"search"
>
search
</button>
</div>
<span>
添加内容
</span>
<textarea
class=
"block my-2 w-full"
v-model=
"newContent"
maxLength=
"512"
></textarea>
<button
class=
"bg-gray-300 py-2 px-4 rounded hover:bg-gray-400"
@
click=
"add"
>
add
</button>
<button
class=
"bg-gray-300 py-2 px-4 rounded hover:bg-gray-400 ml-2"
@
click=
"search"
>
search
</button>
<div
class=
"w-full mt-4"
>
<div
class=
"float-right"
>
<span
class=
"text-gray-500 text-sm"
>
共
{{
data
?.
total
}}
条数据
</span>
</div>
<table
class=
"table-auto w-full bg-gray-200 text-left"
>
<thead>
<tr
class=
"h-10 *:border-b *:border-slate-300 *:pl-2 *:bold"
>
<th
>
ID
</th>
<th
>
#
</th>
<th
>
内容
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
v-for=
"
item in
list"
class=
"*:h-12 *:border-b *:border-slate-300 *:pl-2 *:hover:bg-gray-300"
>
<td
class=
"w-[80px]"
>
{{
i
tem
.
_id
}}
</td>
<tr
v-for=
"
(item, index) in data.
list"
class=
"*:h-12 *:border-b *:border-slate-300 *:pl-2 *:hover:bg-gray-300"
>
<td
class=
"w-[80px]"
>
{{
i
ndex
+
1
}}
</td>
<td>
<textarea
class=
"my-2 w-full bg-gray-100 max-h-48 border-gray-300"
v-model=
"item.content"
maxLength=
"512"
></textarea>
<textarea
class=
"my-2 w-full bg-gray-100 max-h-48 border-gray-300
text-slate-600 text-sm
"
v-model=
"item.content"
maxLength=
"512"
></textarea>
</td>
<td
class=
"*:py-1 *:px-4 *:rounded-md *:mr-2 *:text-gray-100 w-[160px]"
>
<button
@
click=
"deleteItem(item)"
class=
"bg-orange-400 hover:bg-orange-500"
>
删除
</button>
...
...
@@ -53,7 +65,8 @@ export default {
data
()
{
return
{
newContent
:
''
,
list
:
[]
list
:
[],
data
:
{}
}
},
methods
:
{
...
...
@@ -71,7 +84,7 @@ export default {
search
()
{
esClient
.
query
(
this
.
newContent
).
then
(
res
=>
{
console
.
info
(
res
)
this
.
list
=
res
this
.
data
=
res
})
},
...
...
src/js/repEs.js
浏览文件 @
d966ca23
...
...
@@ -50,7 +50,10 @@ class RepEs {
});
}
resolve
(
result
)
resolve
({
total
:
total
,
list
:
result
})
}).
catch
((
err
)
=>
{
console
.
error
(
err
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录