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
9b7e49cd
Commit
9b7e49cd
authored
Dec 21, 2023
by
mhw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频预览
parent
28b16207
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
70 deletions
+77
-70
index.vue
src/views/gptTraining/knowledgeBase/card/index.vue
+7
-20
index.vue
src/views/gptTraining/knowledgeBase/index.vue
+20
-3
index.vue
...e/testOnline/components/contentView/filePreview/index.vue
+49
-46
index.vue
.../modelService/testOnline/components/contentView/index.vue
+1
-1
No files found.
src/views/gptTraining/knowledgeBase/card/index.vue
View file @
9b7e49cd
<!-- -->
<
template
>
<div
class=
"cardBox"
>
<el-card
class=
"box-card"
v-for=
"item in dataList"
:key=
"item.knowledgeId"
>
<el-card
class=
"box-card"
>
<div
class=
"titleBox"
>
<div
class=
"title omit"
>
{{
item
.
knowledgeName
}}
</div>
<!--
<div>
...
...
@@ -41,8 +41,7 @@
</div>
</div>
</el-card>
<div
class=
"box-card-2"
v-for=
"item in 3"
:key=
"item"
></div>
</div>
</
template
>
<
script
>
...
...
@@ -53,7 +52,7 @@ export default {
return
{
};
},
props
:
[
'
dataList
'
,
'isPreset'
,
'refresh'
],
props
:
[
'
item
'
,
'isPreset'
,
'refresh'
],
components
:
{},
computed
:
{
...
...
@@ -90,11 +89,11 @@ export default {
}
},
edit
(
item
)
{
this
.
$dialog
.
show
(
'修改
模版
'
,
editOrAdd
,
{
this
.
$dialog
.
show
(
'修改
知识库
'
,
editOrAdd
,
{
area
:
[
'100%'
,
'100%'
]
},
{
isEdit
:
true
,
item
:
item
}).
then
(
res
=>
{
this
.
refresh
();
}).
catch
(
e
=>
{
});
}).
catch
(
e
=>
{
this
.
refresh
();
});
},
del
(
item
)
{
this
.
$confirm
(
'是否确认删除'
,
'提示'
,
{
...
...
@@ -140,12 +139,7 @@ export default {
min-width
:
300px
;
background
:
linear-gradient
(
to
bottom
,
#e7efff
10%
,
#fff
50%
);
}
.box-card-2
{
width
:
calc
(
100%
/
4
-
20px
);
min-width
:
300px
;
flex-shrink
:
0
;
height
:
0
;
}
div
/
deep
/
.el-divider--horizontal
{
margin
:
14px
0
0
0
;
}
...
...
@@ -179,14 +173,7 @@ div /deep/.el-divider--horizontal {
justify-content
:
space-between
;
margin-bottom
:
16px
;
}
.cardBox
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-around
;
align-content
:
flex-start
;
justify-content
:
space-between
;
}
.tagBox
{
margin-bottom
:
10px
;
}
...
...
src/views/gptTraining/knowledgeBase/index.vue
View file @
9b7e49cd
...
...
@@ -17,7 +17,10 @@
</el-form-item>
</filter-box>
</el-form>
<card
:dataList=
'myDataSetPage.tableData.impl.dataList'
:refresh=
"refresh"
></card>
<div
class=
"cardBox"
>
<card
v-for=
"item in myDataSetPage.tableData.impl.dataList"
:item=
"item"
:key=
"item.knowledgeId"
:refresh=
"refresh"
></card>
<div
class=
"box-card-2"
v-for=
"item in 3"
:key=
"item"
></div>
</div>
<el-row
slot=
"pagination"
type=
"flex"
justify=
"end"
style=
"margin-top: 16px;"
>
<el-pagination
:total=
"myDataSetPage.tableData.impl.totalCount"
:current-page=
"myDataSetPage.tableData.impl.currentPage"
:page-size=
"myDataSetPage.tableData.impl.pageSize"
:page-sizes=
"[10, 20, 50, 100]"
layout=
"total, prev, pager, next, sizes"
@
current-change=
"myDataSetPage.tableData.impl.onCurrentPageChange"
@
size-change=
"myDataSetPage.tableData.impl.onPageSizeChange"
>
</el-pagination>
...
...
@@ -83,14 +86,14 @@ export default {
area
:
[
'100%'
,
'100%'
]
},
{
isEdit
:
false
}).
then
(
res
=>
{
this
.
refresh
();
}).
catch
(
e
=>
{
});
}).
catch
(
e
=>
{
this
.
refresh
();
});
},
edit
(
item
)
{
this
.
$dialog
.
show
(
'修改知识库'
,
editOrAdd
,
{
area
:
[
'100%'
,
'100%'
]
},
{
isEdit
:
true
,
item
:
item
}).
then
(
res
=>
{
this
.
refresh
();
}).
catch
(
e
=>
{
});
}).
catch
(
e
=>
{
this
.
refresh
();
});
},
del
(
item
)
{
this
.
$confirm
(
'是否确认删除'
,
'提示'
,
{
...
...
@@ -182,4 +185,18 @@ export default {
margin-bottom
:
20px
;
}
}
.cardBox
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-around
;
align-content
:
flex-start
;
justify-content
:
space-between
;
}
.box-card-2
{
width
:
calc
(
100%
/
4
-
20px
);
min-width
:
300px
;
flex-shrink
:
0
;
height
:
0
;
}
</
style
>
src/views/gptTraining/modelService/testOnline/components/contentView/filePreview/index.vue
View file @
9b7e49cd
<!-- 文件预览 -->
<
template
>
<div
style=
"height: calc(100vh - 100px);position: relative;"
v-loading
.
fullscreen
.
lock=
"fullscreenLoading"
>
<div
class=
"down"
><a
:href=
"url"
>
下载文件
</a></div>
<div
style=
"height: calc(100vh - 100px);position: relative;"
v-loading
.
fullscreen
.
lock=
"fullscreenLoading"
>
<div
class=
"down"
><a
:href=
"url"
>
下载文件
</a></div>
<div
class=
"image"
v-if=
"['jpg','gif','jpeg','png'].indexOf(fileType)>-1&&url"
>
<el-image
:src=
"url"
>
</el-image>
</div>
<vue-office-docx
v-if=
"['docx','doc'].indexOf(fileType)>-1&&url"
:src=
"url"
style=
"height: 100%;"
@
rendered=
"rendered"
@
error=
"fullscreenLoading=false"
/>
<vue-office-docx
v-if=
"['docx','doc'].indexOf(fileType)>-1&&url"
:src=
"url"
style=
"height: 100%;"
@
rendered=
"rendered"
@
error=
"fullscreenLoading=false"
/>
<vue-office-excel
v-else-if=
"['xlsx','xls'].indexOf(fileType)>-1&&url"
:src=
"url"
style=
"height: 100%;"
@
rendered=
"rendered"
@
error=
"fullscreenLoading=false"
/>
<template
v-else-if=
"['pdf'].indexOf(fileType)>-1&&url"
>
<div
class=
"pagination"
>
共
{{
pageCount
}}
页
<!--
<el-button
size=
"mini"
type=
"primary"
@
click=
"changePdfPage(0)"
class=
"turn"
:disabled=
" currentPage==1"
>
上一页
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"changePdfPage(1)"
class=
"turn"
:disabled=
"currentPage==pageCount"
>
下一页
</el-button>
-->
当前第
<el-input-number
v-model=
"currentPage"
size=
"mini"
:min=
"1"
></el-input-number
>
页
</div>
<pdf
:page=
"currentPage"
:src=
"url"
class=
"pdf"
></pdf>
<template
v-else-if=
"['pdf'].indexOf(fileType)>-1&&url"
>
<div
class=
"pagination"
>
共
{{
pageCount
}}
页
当前第
<el-input-number
v-model=
"currentPage"
size=
"mini"
:min=
"1"
></el-input-number>
页
</div>
<pdf
:page=
"currentPage"
:src=
"url"
class=
"pdf"
></pdf>
</
template
>
<div
class=
"txt"
v-else-if=
"['txt'].indexOf(fileType)>-1"
v-html=
"txtContent"
>
</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"
/>
您的浏览器不支持 video 标签。
</video>
</div>
</div>
</template>
...
...
@@ -61,7 +64,7 @@ export default {
if
(
this
.
fileType
===
'txt'
)
{
this
.
getFileFromUrl
(
this
.
file
.
url
,
'txt.txt'
).
then
((
res
)
=>
{
const
fileReader
=
new
FileReader
();
fileReader
.
addEventListener
(
'load'
,
()
=>
{
const
fileContent
=
fileReader
.
result
;
// 处理文件内容
...
...
@@ -130,43 +133,43 @@ export default {
</
script
>
<
style
scoped
>
.txt
{
.txt
{
height
:
100%
;
overflow
:
auto
;
}
.pagination
{
font-size
:
14px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
position
:
absolute
;
top
:
0px
;
right
:
1
0px
;
z-index
:
10
;
.pagination
{
font-size
:
14px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
position
:
fixed
;
top
:
5
0px
;
right
:
2
0px
;
z-index
:
10
;
}
.down
{
width
:
100%
;
.down
{
width
:
100%
;
}
.down
a
{
background-color
:
#0092FF
;
color
:
#FFFFFF
;
display
:
inline-block
;
line-height
:
1
;
white-space
:
nowrap
;
cursor
:
pointer
;
background
:
#FFFFFF
;
border
:
1px
solid
#0092FF
;
border-color
:
#0092FF
;
text-align
:
center
;
box-sizing
:
border-box
;
outline
:
none
;
margin
:
0
;
transition
:
.1s
;
font-weight
:
500
;
padding
:
12px
2
0px
;
font-size
:
1
4
px
;
border-radius
:
4px
;
z-index
:
100
;
.down
a
{
text-decoration
:
none
;
background-color
:
#0092ff
;
color
:
#ffffff
;
display
:
inline-block
;
line-height
:
1
;
white-space
:
nowrap
;
cursor
:
pointer
;
border
:
1px
solid
#0092ff
;
border-color
:
#0092ff
;
text-align
:
center
;
box-sizing
:
border-box
;
outline
:
none
;
margin
:
0
;
transition
:
0
.1s
;
font-weight
:
500
;
padding
:
8px
1
0px
;
font-size
:
1
2
px
;
border-radius
:
4px
;
z-index
:
100
;
}
</
style
>
src/views/gptTraining/modelService/testOnline/components/contentView/index.vue
View file @
9b7e49cd
...
...
@@ -50,7 +50,7 @@ export default {
let
tagUrl
=
aTag
.
getAttribute
(
'href'
)
let
url
;
// alert(aTag.getAttribute('href'))
if
([
'
jpg'
,
'gif'
,
'jpeg'
,
'png'
,
'docx'
,
'doc'
,
'xlsx'
,
'xls
'
].
indexOf
(
tagUrl
.
split
(
'.'
).
pop
().
toLowerCase
())
!==
-
1
)
{
if
([
'
pdf'
,
'jpg'
,
'gif'
,
'jpeg'
,
'png'
,
'docx'
,
'doc'
,
'xlsx'
,
'xls'
,
'mp4'
,
'webm'
,
'ogg'
,
'ogv
'
].
indexOf
(
tagUrl
.
split
(
'.'
).
pop
().
toLowerCase
())
!==
-
1
)
{
// 阻止默认点击事件
event
.
preventDefault
();
...
...
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