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
481f7e42
Commit
481f7e42
authored
Dec 23, 2023
by
mhw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预览修改
parent
2276fb6b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
24 deletions
+29
-24
base.scss
src/assets/style/base.scss
+3
-0
index.vue
...e/testOnline/components/contentView/filePreview/index.vue
+4
-3
index.vue
.../modelService/testOnline/components/contentView/index.vue
+2
-9
index.vue
...ing/modelService/testOnline/components/rightBox/index.vue
+20
-12
No files found.
src/assets/style/base.scss
View file @
481f7e42
...
...
@@ -8,6 +8,9 @@ html, body {
font-family
:
Arial
,
"Helvetica Neue"
,
Helvetica
,
"PingFang SC"
,
"Hiragino Sans GB"
,
"Microsoft YaHei"
,
"微软雅黑"
,
sans-serif
;
background-color
:
rgb
(
228
,
240
,
255
);
}
div
{
word-break
:break-all
}
.omit
{
/* 一行省略 */
overflow
:
hidden
;
...
...
src/views/gptTraining/modelService/testOnline/components/contentView/filePreview/index.vue
View file @
481f7e42
...
...
@@ -18,9 +18,9 @@
</div>
<div
class=
"video"
v-if=
"['mp4', 'webm', 'ogg', 'ogv'].indexOf(fileType)>-1&&url"
>
<video
controls
style=
"width: 100%"
>
<source
:src=
"
item
"
type=
"video/mp4"
/>
<source
:src=
"
item
"
type=
"video/ogg"
/>
<source
:src=
"
item
"
type=
"video/webm"
/>
<source
:src=
"
url
"
type=
"video/mp4"
/>
<source
:src=
"
url
"
type=
"video/ogg"
/>
<source
:src=
"
url
"
type=
"video/webm"
/>
您的浏览器不支持 video 标签。
</video>
</div>
...
...
@@ -57,6 +57,7 @@ export default {
props
:
[
'url'
],
computed
:
{
fileType
()
{
console
.
log
(
this
.
url
);
return
this
.
url
.
split
(
'.'
).
pop
().
toLowerCase
();
}
},
...
...
src/views/gptTraining/modelService/testOnline/components/contentView/index.vue
View file @
481f7e42
...
...
@@ -62,18 +62,12 @@ export default {
this
.
setDescribeStyle
(
aTag
)
}
aTag
.
addEventListener
(
'click'
,
function
(
event
)
{
let
url
;
if
(
isFile
)
{
// 判断可预览文件类型
// 阻止默认点击事件
event
.
preventDefault
();
if
(
tagUrl
.
indexOf
(
'https'
)
!==
-
1
)
{
url
=
tagUrl
.
replace
(
/^https:
\/\/[^/]
+
\/
/
,
`https://
${
window
.
location
.
hostname
}
:
${
window
.
location
.
port
}
/`
);
}
else
{
url
=
tagUrl
.
replace
(
/^http:
\/\/[^/]
+
\/
/
,
`http://
${
window
.
location
.
hostname
}
:
${
window
.
location
.
port
}
/`
);
}
that
.
$dialog
.
show
(
'文件预览'
,
filePreview
,
{
area
:
[
'100%'
,
'100%'
]
},
{
u
rl
}).
then
(
res
=>
{
},
{
url
:
tagU
rl
}).
then
(
res
=>
{
}).
catch
(
e
=>
{
});
}
...
...
@@ -83,7 +77,6 @@ export default {
setDescribeStyle
(
aTag
)
{
let
describeDom
=
aTag
.
parentNode
.
nextElementSibling
// 在当前元素前插入新的 HTML 内容
describeDom
.
insertAdjacentHTML
(
'beforebegin'
,
`
<button style="margin-bottom:10px" type="button" class="el-button el-button--primary el-button--mini is-round">
<span style="margin-right:5px">详情</span>
...
...
@@ -120,7 +113,7 @@ export default {
.describe
{
overflow
:
hidden
;
transition
:
0.5s
all
;
color
:
#00
7fff
;
color
:
#00
0
;
font-size
:
14px
;
background-color
:
#fff
;
border-radius
:
10px
;
...
...
src/views/gptTraining/modelService/testOnline/components/rightBox/index.vue
View file @
481f7e42
...
...
@@ -140,18 +140,13 @@ export default {
},
onmessage
(
data
)
{
console
.
log
(
data
);
let
nowChat
=
this
.
myHistory
[
this
.
myHistory
.
length
-
1
]
if
(
this
.
chatForm
.
pattern
===
'通用智能问答'
)
{
nowChat
.
answer
+=
data
}
else
if
(
this
.
chatForm
.
pattern
===
'专业知识库问答'
)
{
let
temporary
=
JSON
.
parse
(
`[
${
data
}
]`
.
replace
(
/}{/g
,
'},{'
))
temporary
.
forEach
((
item
)
=>
{
if
(
item
.
docs
)
{
item
.
docs
=
item
.
docs
.
map
((
item2
)
=>
{
return
item2
.
replace
(
'出处'
,
'知识溯源'
)
})
}
this
.
modifyContent
(
item
)
// 修改返回内容
nowChat
.
excludeReferenceAnswer
+=
item
.
answer
||
''
// 排除回答中的引用内容
nowChat
.
answer
+=
item
.
answer
||
'
\
n'
+
item
.
docs
})
...
...
@@ -159,13 +154,9 @@ export default {
}
else
if
(
this
.
chatForm
.
pattern
===
'文件对话'
)
{
let
temporary
=
JSON
.
parse
(
`[
${
data
}
]`
.
replace
(
/}{/g
,
'},{'
))
temporary
.
forEach
((
item
)
=>
{
if
(
item
.
docs
)
{
item
.
docs
=
item
.
docs
.
map
((
item2
)
=>
{
return
item2
.
replace
(
'出处'
,
'知识溯源'
)
})
}
this
.
modifyContent
(
item
)
// 修改返回内容
nowChat
.
excludeReferenceAnswer
+=
item
.
answer
||
''
// 排除回答中的引用内容
nowChat
.
answer
+=
item
.
answer
||
'
\
n'
+
item
.
docs
})
...
...
@@ -175,6 +166,23 @@ export default {
this
.
$refs
.
contentBox
.
scrollTo
(
0
,
this
.
$refs
.
contentBox
.
scrollHeight
)
})
},
modifyContent
(
item
)
{
// 修改返回内容
if
(
item
.
docs
)
{
item
.
docs
=
item
.
docs
.
map
((
item2
)
=>
{
let
tagUrl
=
item2
.
match
(
/
\]\((
.*
?)\)
/g
)[
0
].
slice
(
2
,
-
1
)
let
url
=
''
if
(
tagUrl
.
indexOf
(
'https'
)
!==
-
1
)
{
url
=
tagUrl
.
replace
(
/^https:
\/\/[^/]
+
\/
/
,
`https://
${
window
.
location
.
hostname
}
:
${
window
.
location
.
port
}
/`
);
item2
=
item2
.
replace
(
/
\]\((
.*
?)\)
/g
,
`](
${
url
}
)`
)
}
else
{
url
=
tagUrl
.
replace
(
/^http:
\/\/[^/]
+
\/
/
,
`http://
${
window
.
location
.
hostname
}
:
${
window
.
location
.
port
}
/`
);
item2
=
item2
.
replace
(
/
\]\((
.*
?)\)
/g
,
`](
${
url
}
)`
)
}
return
item2
.
replace
(
'出处'
,
'知识溯源'
)
})
}
},
generateRandomString
(
length
)
{
const
characters
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
;
const
charactersLength
=
characters
.
length
;
...
...
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