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
e60e7e52
Commit
e60e7e52
authored
Dec 22, 2023
by
mhw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
引用展开收缩
parent
25dc1fb3
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
102 additions
and
44 deletions
+102
-44
KnowledgeManage.js
src/api/GptController/KnowledgeManage.js
+3
-0
base.scss
src/assets/style/base.scss
+3
-1
message.css
src/assets/theme/message.css
+1
-0
development.js
src/core/config/development.js
+2
-2
index.js
src/core/http/index.js
+13
-2
index.vue
...aining/knowledgeBase/dialog/importConfiguration/index.vue
+5
-3
index.vue
.../modelService/testOnline/components/contentView/index.vue
+73
-34
index.vue
...ning/modelService/testOnline/components/leftBox/index.vue
+1
-1
vue.config.js
vue.config.js
+1
-1
No files found.
src/api/GptController/KnowledgeManage.js
View file @
e60e7e52
...
@@ -45,4 +45,7 @@ export default class KnowledgeManage {
...
@@ -45,4 +45,7 @@ export default class KnowledgeManage {
static
listForTree
(
sender
,
params
,
axiosOption
,
httpOption
)
{
static
listForTree
(
sender
,
params
,
axiosOption
,
httpOption
)
{
return
sender
.
doUrl
(
'/admin/app/knowledgeManage/listForTree'
,
'post'
,
params
,
axiosOption
,
httpOption
);
return
sender
.
doUrl
(
'/admin/app/knowledgeManage/listForTree'
,
'post'
,
params
,
axiosOption
,
httpOption
);
}
}
static
load
(
sender
,
params
,
axiosOption
,
httpOption
)
{
return
sender
.
doUrl
(
'/admin/app/knowledgeManage/load'
,
'post'
,
params
,
axiosOption
,
httpOption
);
}
}
}
src/assets/style/base.scss
View file @
e60e7e52
...
@@ -14,7 +14,9 @@ html, body {
...
@@ -14,7 +14,9 @@ html, body {
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
}
}
.el-message
{
white-space
:
pre-line
;
}
.omit_2
{
.omit_2
{
/*2行省略 */
/*2行省略 */
text-overflow
:
-
o-ellipsis-lastline
;
text-overflow
:
-
o-ellipsis-lastline
;
...
...
src/assets/theme/message.css
View file @
e60e7e52
...
@@ -269,6 +269,7 @@
...
@@ -269,6 +269,7 @@
/* Break-point
/* Break-point
--------------------------*/
--------------------------*/
.el-message
{
.el-message
{
white-space
:
pre-line
;
min-width
:
380px
;
min-width
:
380px
;
-webkit-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
...
...
src/core/config/development.js
View file @
e60e7e52
module
.
exports
=
{
module
.
exports
=
{
baseUrl
:
'http://192.168.
83.215
:8082/'
,
baseUrl
:
'http://192.168.
0.36
:8082/'
,
wsUrl
:
'ws://1
27.0.0.1
:7860/'
,
wsUrl
:
'ws://1
92.168.0.36
:7860/'
,
projectName
:
'灵境大模型平台'
projectName
:
'灵境大模型平台'
}
}
src/core/http/index.js
View file @
e60e7e52
...
@@ -189,13 +189,24 @@ const fetchUpload = function (url, params, isDefUrl = true) {
...
@@ -189,13 +189,24 @@ const fetchUpload = function (url, params, isDefUrl = true) {
}
}
]
]
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
);
console
.
log
(
res
,
res
.
data
.
msg
);
if
((
res
.
data
&&
res
.
data
.
success
)
||
res
.
data
.
code
===
200
)
{
if
((
res
.
data
&&
res
.
data
.
success
)
||
res
.
data
.
code
===
200
)
{
resolve
(
res
.
data
);
resolve
(
res
.
data
);
}
else
{
}
else
{
reject
(
res
)
let
failedFiles
=
res
.
data
?.
data
?.
failed_files
let
msg
=
''
if
(
failedFiles
)
{
for
(
const
key
in
failedFiles
)
{
if
(
Object
.
hasOwnProperty
.
call
(
failedFiles
,
key
))
{
const
element
=
failedFiles
[
key
];
msg
+=
key
+
':'
+
element
+
'
\
n'
}
}
}
showErrorMessage
({
showErrorMessage
({
showClose
:
true
,
showClose
:
true
,
message
:
res
.
data
.
errorMessage
?
res
.
data
.
errorMessage
:
'数据请求失败'
message
:
res
.
data
.
errorMessage
||
res
.
data
.
msg
?
res
.
data
.
errorMessage
||
msg
:
'数据请求失败'
});
});
}
}
}).
catch
(
e
=>
{
}).
catch
(
e
=>
{
...
...
src/views/gptTraining/knowledgeBase/dialog/importConfiguration/index.vue
View file @
e60e7e52
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
<el-form-item
label=
"上传知识库文件:"
prop=
"filesArr"
>
<el-form-item
label=
"上传知识库文件:"
prop=
"filesArr"
>
<el-button
@
click=
"clickUp"
:size=
"defaultFormItemSize"
type=
"primary"
>
上传
</el-button>
<el-button
@
click=
"clickUp"
:size=
"defaultFormItemSize"
type=
"primary"
>
上传
</el-button>
<input
style=
"display:none"
ref=
"upFile"
type=
"file"
@
change=
"fileinfo($event.target.files)"
multiple
accept=
".html, .md, .json, .jsonl, .csv, .pdf, .png, .jpg, .jpeg, .bmp, .eml, .msg, .epub, .xlsx, .xls, .ipynb, .odt, .py, .rst, .rtf, .srt, .toml, .tsv, .docx, .doc, .xml, .ppt, .pptx, .txt, .htm"
>
<input
style=
"display:none"
ref=
"upFile"
type=
"file"
@
change=
"fileinfo($event.target.files)"
multiple
accept=
".html, .md, .json, .jsonl, .csv, .pdf, .png, .jpg, .jpeg, .bmp, .eml, .msg, .epub, .xlsx, .xls, .ipynb, .odt, .py, .rst, .rtf, .srt, .toml, .tsv, .docx, .doc, .xml, .ppt, .pptx, .txt, .htm"
>
<div
class=
"el-upload__tip"
><i
class=
"el-icon-document"
style=
"color:#909399;margin-right:5px"
></i>
可上传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文件
</div>
<div
class=
"el-upload__tip"
>
可上传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文件
</div>
<div
class=
"itemFile"
v-for=
"(item,index) in files"
:key=
"item.name"
>
{{
item
.
name
}}
<div
class=
"itemFile"
v-for=
"(item,index) in files"
:key=
"item.name"
>
<i
class=
"el-icon-document"
style=
"color:#909399;margin-right:5px"
></i>
{{
item
.
name
}}
<i
class=
"el-icon-circle-close"
style=
"color:#0092FF;cursor: pointer;"
@
click=
"clearFile(index)"
></i>
<i
class=
"el-icon-circle-close"
style=
"color:#0092FF;cursor: pointer;"
@
click=
"clearFile(index)"
></i>
</div>
</div>
</el-form-item>
</el-form-item>
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</el-slider>
</el-slider>
</el-form-item>
</el-form-item>
<el-form-item
label=
"相邻文本重合长度:"
>
<el-form-item
label=
"相邻文本重合长度:"
>
<el-slider
:min=
"0"
:max=
"
12
"
v-model=
"form.chunk_overlap"
show-input
>
<el-slider
:min=
"0"
:max=
"
250
"
v-model=
"form.chunk_overlap"
show-input
>
</el-slider>
</el-slider>
</el-form-item>
</el-form-item>
<el-form-item
label=
"开启中文标题加强:"
>
<el-form-item
label=
"开启中文标题加强:"
>
...
@@ -121,6 +121,8 @@ export default {
...
@@ -121,6 +121,8 @@ export default {
this
.
fullscreenLoading
=
false
this
.
fullscreenLoading
=
false
this
.
$parent
.
onCancel
(
false
)
this
.
$parent
.
onCancel
(
false
)
}).
catch
(
e
=>
{
}).
catch
(
e
=>
{
this
.
fullscreenLoading
=
false
this
.
getFiles
()
reject
(
e
);
reject
(
e
);
});
});
}
}
...
...
src/views/gptTraining/modelService/testOnline/components/contentView/index.vue
View file @
e60e7e52
<!-- 答案内容预览 -->
<!-- 答案内容预览 -->
<
template
>
<
template
>
<vue-markdown
:source=
"content"
v-highlight
class=
"markdown-body"
:id=
"'myContainer'+index"
>
<vue-markdown
:source=
"content"
v-highlight
class=
"markdown-body"
:id=
"'myContainer'+index"
>
</vue-markdown>
</vue-markdown>
</
template
>
</
template
>
...
@@ -18,7 +18,7 @@ export default {
...
@@ -18,7 +18,7 @@ export default {
};
};
},
},
props
:
[
'content'
,
'index'
,
'isSuccess'
],
props
:
[
'content'
,
'index'
,
'isSuccess'
],
components
:
{
VueMarkdown
},
components
:
{
VueMarkdown
},
computed
:
{},
computed
:
{},
...
@@ -42,15 +42,26 @@ export default {
...
@@ -42,15 +42,26 @@ export default {
watch
:
{
watch
:
{
'isSuccess'
()
{
'isSuccess'
()
{
if
(
this
.
isSuccess
)
{
if
(
this
.
isSuccess
)
{
let
that
=
this
const
anchorTags
=
document
.
querySelectorAll
(
`#myContainer
${
this
.
index
}
a`
);
const
anchorTags
=
document
.
querySelectorAll
(
`#myContainer
${
this
.
index
}
a`
);
this
.
preview
(
anchorTags
)
}
}
},
methods
:
{
preview
(
anchorTags
)
{
let
that
=
this
// 遍历并输出链接的 href 属性
// 遍历并输出链接的 href 属性
anchorTags
.
forEach
((
aTag
)
=>
{
anchorTags
.
forEach
((
aTag
)
=>
{
aTag
.
addEventListener
(
'click'
,
function
(
event
)
{
let
tagUrl
=
aTag
.
getAttribute
(
'href'
)
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
if
(
isFile
)
{
this
.
setDescribeStyle
(
aTag
)
}
aTag
.
addEventListener
(
'click'
,
function
(
event
)
{
let
url
;
let
url
;
// alert(aTag.getAttribute('href'))
if
(
isFile
)
{
if
([
'pdf'
,
'jpg'
,
'gif'
,
'jpeg'
,
'png'
,
'docx'
,
'doc'
,
'xlsx'
,
'xls'
,
'mp4'
,
'webm'
,
'ogg'
,
'ogv'
,
'txt'
].
indexOf
(
tagUrl
.
split
(
'.'
).
pop
().
toLowerCase
())
!==
-
1
)
{
// 阻止默认点击事件
// 阻止默认点击事件
event
.
preventDefault
();
event
.
preventDefault
();
...
@@ -61,28 +72,56 @@ export default {
...
@@ -61,28 +72,56 @@ export default {
}
}
that
.
$dialog
.
show
(
'文件预览'
,
filePreview
,
{
that
.
$dialog
.
show
(
'文件预览'
,
filePreview
,
{
area
:
[
'100%'
,
'100%'
]
area
:
[
'100%'
,
'100%'
]
},
{
url
}).
then
(
res
=>
{
},
{
url
}).
then
(
res
=>
{
}).
catch
(
e
=>
{
});
}).
catch
(
e
=>
{
});
}
}
});
});
});
});
}
}
},
},
methods
:
{
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>
<i class="el-icon-arrow-down"></i>
</button>
`
);
describeDom
.
classList
.
add
(
'describe'
)
let
height
=
describeDom
.
scrollHeight
describeDom
.
setAttribute
(
'style'
,
`height:
${
height
}
px;`
)
describeDom
.
previousElementSibling
.
addEventListener
(
'click'
,
function
(
event
)
{
if
(
height
>
0
&&
(
describeDom
.
style
.
height
!==
'0px'
&&
describeDom
.
style
.
height
!==
''
))
{
describeDom
.
setAttribute
(
'style'
,
'height:0px;'
)
}
else
{
describeDom
.
setAttribute
(
'style'
,
`height:
${
height
}
px;`
)
}
})
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.markdown-body
{
.markdown-body
{
background
:
none
!important
;
background
:
none
!important
;
font-size
:
14px
!important
;
font-size
:
14px
!important
;
}
}
.markdown-body
pre
{
.markdown-body
pre
{
background-color
:
#3b3d3f
;
background-color
:
#3b3d3f
;
}
}
</
style
>
</
style
>
<
style
>
.describe
{
overflow
:
hidden
;
transition
:
0.5s
all
;
color
:
#007fff
;
font-size
:
14px
;
background-color
:
#fff
;
border-radius
:
10px
;
padding
:
0
20px
0
20px
;
}
</
style
>
src/views/gptTraining/modelService/testOnline/components/leftBox/index.vue
View file @
e60e7e52
...
@@ -195,7 +195,7 @@ export default {
...
@@ -195,7 +195,7 @@ export default {
},
},
getKnowledgeList
()
{
getKnowledgeList
()
{
let
params
=
{}
let
params
=
{}
KnowledgeManage
.
l
istForTree
(
this
,
params
).
then
(
res
=>
{
KnowledgeManage
.
l
oad
(
this
,
params
).
then
(
res
=>
{
this
.
knowledgeList
=
res
.
data
this
.
knowledgeList
=
res
.
data
}).
catch
(
e
=>
{
}).
catch
(
e
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
...
...
vue.config.js
View file @
e60e7e52
...
@@ -6,7 +6,7 @@ module.exports = {//
...
@@ -6,7 +6,7 @@ module.exports = {//
proxy
:
{
proxy
:
{
'/2api'
:
{
'/2api'
:
{
/* 目标代理服务器地址 */
/* 目标代理服务器地址 */
target
:
'http://1
27.0.0.1
:7861'
,
//
target
:
'http://1
92.168.0.36
:7861'
,
//
/* 允许跨域 */
/* 允许跨域 */
changeOrigin
:
true
,
changeOrigin
:
true
,
ws
:
true
,
ws
:
true
,
...
...
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