Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lmp_web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yujian
lmp_web
Commits
041aadbe
Commit
041aadbe
authored
Mar 05, 2024
by
mhw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
0295590b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
34 deletions
+46
-34
index.vue
.../modelService/testOnline/components/contentView/index.vue
+13
-12
index.vue
...ing/modelService/testOnline/components/rightBox/index.vue
+33
-22
No files found.
src/views/gptTraining/modelService/testOnline/components/contentView/index.vue
View file @
041aadbe
<!-- 答案内容预览 -->
<
template
>
<vue-markdown
:source=
"content"
v-highlight
class=
"markdown-body"
>
<vue-markdown
:source=
"content"
v-highlight
class=
"markdown-body"
>
</vue-markdown>
</
template
>
...
...
@@ -59,7 +61,7 @@ export default {
anchorTags
.
forEach
((
aTag
)
=>
{
let
tagUrl
=
aTag
.
getAttribute
(
'href'
)
||
''
let
isFile
=
[
'pdf'
,
'jpg'
,
'gif'
,
'jpeg'
,
'png'
,
'docx'
,
'doc'
,
'xlsx'
,
'xls'
,
'mp4'
,
'webm'
,
'ogg'
,
'ogv'
,
'txt'
].
indexOf
(
tagUrl
.
split
(
'.'
).
pop
().
toLowerCase
())
!==
-
1
let
isFile2
=
[
'html'
,
'md'
,
'json'
,
'jsonl'
,
'csv'
,
'pdf'
,
'png'
,
'jpg'
,
'jpeg'
,
'bmp'
,
'eml'
,
'msg'
,
'epub'
,
'xlsx'
,
'xlsd'
,
'ipynb'
,
'odt'
,
'py'
,
'rst'
,
'rtf'
,
'srt'
,
'toml'
,
'tsv'
,
'docx'
,
'doc'
,
'xml'
,
'ppt'
,
'pptx'
,
'txt'
,
'htm'
].
indexOf
(
tagUrl
.
split
(
'.'
).
pop
().
toLowerCase
())
!==
-
1
if
(
isFile2
||
aTag
.
className
===
'show_detail'
)
{
// 判断知识库以及基于文件问答 的文件类型,并添加dom以及样式 || 添加特殊a标签展示详情内容
...
...
@@ -71,7 +73,7 @@ export default {
event
.
preventDefault
();
that
.
$dialog
.
show
(
'文件预览'
,
filePreview
,
{
area
:
[
'100%'
,
'100%'
]
},
{
url
:
tagUrl
}).
then
(
res
=>
{
},
{
url
:
tagUrl
}).
then
(
res
=>
{
}).
catch
(
e
=>
{
});
}
...
...
@@ -87,7 +89,7 @@ export default {
<i class="el-icon-arrow-down"></i>
</button>
`
);
var
buttonDom
=
aTag
.
nextElementSibling
;
// 下拉按钮
let
describeDom
=
aTag
.
parentNode
.
querySelector
(
'.describe-view'
)
||
aTag
.
parentNode
.
parentNode
.
querySelector
(
'.describe-view'
)
// 详情
this
.
initNetwork
(
describeDom
,
describeDom
.
getAttribute
(
'data'
))
...
...
@@ -142,13 +144,13 @@ export default {
size
:
12
}
},
physics
:
{
enabled
:
true
,
barnesHut
:
{
gravitationalConstant
:
-
2000
}
}
};
// eslint-disable-next-line no-unused-vars
...
...
@@ -157,7 +159,7 @@ export default {
container
.
setAttribute
(
'isfull'
,
'0'
)
let
fullDom
=
document
.
createElement
(
'div'
)
fullDom
.
classList
.
add
(
'el-icon-full-screen'
,
'full'
)
container
.
appendChild
(
fullDom
)
fullDom
.
addEventListener
(
'click'
,
()
=>
{
if
(
container
.
getAttribute
(
'isfull'
)
!==
'0'
)
{
...
...
@@ -173,7 +175,7 @@ export default {
}
else
{
document
.
querySelector
(
'.full'
).
style
.
color
=
'#fff'
document
.
querySelector
(
'.down'
).
style
.
color
=
'#fff'
fullDom
.
classList
.
remove
(
'el-icon-full-screen'
)
fullDom
.
classList
.
add
(
'el-icon-close'
)
container
.
style
.
height
=
'100%'
;
...
...
@@ -229,7 +231,7 @@ export default {
<
style
>
.describe-view
{
overflow
:
hidden
!important
;
transition
:
all
0.5s
;
transition
:
all
0.5s
;
color
:
#000
;
font-size
:
14px
;
background-color
:
#fff
;
...
...
@@ -239,13 +241,12 @@ export default {
}
</
style
>
<
style
>
.vis-label
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.full
{
.full
{
width
:
20px
;
height
:
20px
;
/* background: #0092FF; */
...
...
@@ -257,7 +258,7 @@ export default {
border-radius
:
5px
;
/* transition: all 0.5s; */
}
.down
{
.down
{
width
:
20px
;
height
:
20px
;
/* background: #0092FF; */
...
...
src/views/gptTraining/modelService/testOnline/components/rightBox/index.vue
View file @
041aadbe
<!-- 右侧聊天界面 -->
<
template
>
<div
class=
"box"
ref=
"box"
>
<div
class=
"contentBox"
ref=
"contentBox"
v-if=
"myHistory.length > 0"
>
<div
v-for=
" item in myHistory"
:key=
"item.id"
>
<div
class=
"box"
ref=
"box"
>
<div
class=
"contentBox"
ref=
"contentBox"
v-if=
"myHistory.length > 0"
>
<div
v-for=
"item in myHistory"
:key=
"item.id"
>
<div
class=
"userBox"
>
<div
class=
"content"
>
<contentView
:content=
"item.content"
/>
</div>
<div
class=
"icon"
>
{{
item
.
role
}}
</div>
</div>
<div
v-if=
"item.answer"
class=
"gptBox"
>
<div
class=
"icon"
>
GPT
</div>
<div
v-if=
"item.answer"
class=
"gptBox"
>
<div
class=
"icon"
>
GPT
</div>
<div
class=
"content"
>
<contentView
:content=
"item.answer"
:ref=
"'contentView' + item.id"
/>
<contentView
:content=
"item.answer"
:ref=
"'contentView' + item.id"
/>
</div>
</div>
</div>
</div>
<div
class=
"initBox"
ref=
"initBox"
v-else
>
<div
class=
"initBox"
ref=
"initBox"
v-else
>
<div
class=
"text"
>
你好,
<br>
我是人工智能语言模型
<br>
我可以回答你的问题,为你提供有用信息,帮助你完成创作。
<br>
你好,
<br
/
>
我是人工智能语言模型
<br
/
>
我可以回答你的问题,为你提供有用信息,帮助你完成创作。
<br
/
>
</div>
</div>
<div
class=
"inputBox"
>
<el-input
placeholder=
"请输入内容"
v-model=
"inputContent"
class=
"input-with-select"
@
keyup
.
enter
.
native=
"submit"
>
<el-button
slot=
"append"
icon=
"el-icon-position"
@
click=
"submit"
></el-button>
<el-input
placeholder=
"请输入内容"
v-model=
"inputContent"
class=
"input-with-select"
@
keyup
.
enter
.
native=
"submit"
>
<el-button
slot=
"append"
icon=
"el-icon-position"
@
click=
"submit"
></el-button>
</el-input>
<el-button
icon=
"el-icon-delete"
style=
"margin-left:10px"
@
click=
"clear"
type=
"danger"
plain
></el-button>
<el-button
icon=
"el-icon-delete"
style=
"margin-left: 10px"
@
click=
"clear"
type=
"danger"
plain
></el-button>
</div>
<div
id=
"network"
></div>
</div>
...
...
@@ -169,13 +180,14 @@ export default {
nowChat
.
answer
+=
item
.
answer
||
'
\
n'
+
item
.
docs
})
}
else
if
(
this
.
chatForm
.
pattern
===
'知识图谱问答'
)
{
console
.
log
(
data
);
let
temporary
=
JSON
.
parse
(
`[
${
data
}
]`
.
replace
(
/}{/g
,
'},{'
))
temporary
.
forEach
((
item
)
=>
{
console
.
log
(
item
);
this
.
modifyContent
(
item
)
// 修改返回内容
nowChat
.
excludeReferenceAnswer
+=
item
.
answer
||
''
// 排除回答中的引用内容
nowChat
.
answer
+=
item
.
answer
||
'
\
n'
+
item
.
docs
nowChat
.
answer
+=
item
.
answer
||
'
\
n'
+
item
.
docs
.
join
()
// nowChat.answer += item.answer += '\n' + item.docs.join()
})
}
...
...
@@ -216,7 +228,6 @@ export default {
var
data
=
match2
[
1
]
// 修改文本内容
textAfterSpecifiedString
=
`<div class="describe-view" data="
${
data
}
" >
${
textAfterSpecifiedString
}
</div>`
item2
=
item2
.
replace
(
match2
[
2
],
textAfterSpecifiedString
)
}
return
item2
.
replace
(
'出处'
,
'知识溯源'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment