Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
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
poc
poc-fe
Commits
e586238c
Commit
e586238c
authored
Oct 24, 2024
by
nick zheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'beta' into 'master'
fix: 限制拖拽上传文件类型及知识库排序 See merge request
!15
parents
fe8f9b36
7203551e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
4 deletions
+23
-4
zh-cn.yaml
src/locales/langs/zh-cn.yaml
+1
-0
zh-hk.yaml
src/locales/langs/zh-hk.yaml
+1
-0
columns.tsx
src/views/personal-space/personal-knowledge/columns.tsx
+3
-3
knowledge-type.ts
...views/personal-space/personal-knowledge/knowledge-type.ts
+1
-1
upload-file.vue
...ge/upload-knowledge/upload-local-document/upload-file.vue
+16
-0
locales.d.ts
types/locales.d.ts
+1
-0
No files found.
src/locales/langs/zh-cn.yaml
View file @
e586238c
...
@@ -16,6 +16,7 @@ common_module:
...
@@ -16,6 +16,7 @@ common_module:
name
:
'
名称'
name
:
'
名称'
desc
:
'
描述'
desc
:
'
描述'
publish_time_in
:
'
发布于'
publish_time_in
:
'
发布于'
created_time
:
'
创建时间'
modified_time
:
'
编辑时间'
modified_time
:
'
编辑时间'
is_open
:
'
启用'
is_open
:
'
启用'
status
:
'
状态'
status
:
'
状态'
...
...
src/locales/langs/zh-hk.yaml
View file @
e586238c
...
@@ -16,6 +16,7 @@ common_module:
...
@@ -16,6 +16,7 @@ common_module:
name
:
'
名稱'
name
:
'
名稱'
desc
:
'
描述'
desc
:
'
描述'
publish_time_in
:
'
發佈於'
publish_time_in
:
'
發佈於'
created_time
:
'
創建時間'
modified_time
:
'
編輯時間'
modified_time
:
'
編輯時間'
is_open
:
'
啓用'
is_open
:
'
啓用'
status
:
'
狀態'
status
:
'
狀態'
...
...
src/views/personal-space/personal-knowledge/columns.tsx
View file @
e586238c
...
@@ -35,15 +35,15 @@ export function createKnowledgeColumn(
...
@@ -35,15 +35,15 @@ export function createKnowledgeColumn(
},
},
},
},
{
{
title
:
()
=>
<
span
>
{
t
(
'common_module.
modifi
ed_time'
)
}
</
span
>,
title
:
()
=>
<
span
>
{
t
(
'common_module.
creat
ed_time'
)
}
</
span
>,
key
:
'
modifi
edTime'
,
key
:
'
creat
edTime'
,
align
:
'left'
,
align
:
'left'
,
ellipsis
:
{
ellipsis
:
{
tooltip
:
true
,
tooltip
:
true
,
},
},
width
:
170
,
width
:
170
,
render
(
row
:
KnowledgeItem
)
{
render
(
row
:
KnowledgeItem
)
{
return
formatDateTime
(
row
.
modifiedTime
)
||
'--'
return
row
.
createdTime
?
formatDateTime
(
row
.
createdTime
)
:
'--'
},
},
},
},
{
{
...
...
src/views/personal-space/personal-knowledge/knowledge-type.ts
View file @
e586238c
...
@@ -12,7 +12,7 @@ export interface KnowledgeItem {
...
@@ -12,7 +12,7 @@ export interface KnowledgeItem {
desc
:
string
desc
:
string
trainStatus
:
TrainStatus
trainStatus
:
TrainStatus
isOpen
:
'Y'
|
'N'
isOpen
:
'Y'
|
'N'
modifi
edTime
:
Date
creat
edTime
:
Date
}
}
export
interface
SegmentationConfigInterface
{
export
interface
SegmentationConfigInterface
{
...
...
src/views/personal-space/personal-knowledge/upload-knowledge/upload-local-document/upload-file.vue
View file @
e586238c
...
@@ -137,6 +137,21 @@ async function handleUpload(file: any) {
...
@@ -137,6 +137,21 @@ async function handleUpload(file: any) {
}
}
}
}
// 拖拽文件
function
handleDropFile
(
e
:
DragEvent
)
{
const
files
=
e
.
dataTransfer
?.
files
as
FileList
const
file
=
files
[
0
]
const
allowTypeList
=
[
'md'
,
'doc'
,
'docx'
,
'pdf'
,
'txt'
]
if
(
file
&&
!
allowTypeList
.
includes
(
file
.
name
.
split
(
'.'
)[
1
].
toLowerCase
()))
{
window
.
$message
.
error
(
t
(
'personal_space_module.knowledge_module.upload_document_module.upload_format_error_message'
),
)
return
false
}
}
function
handleRemoveFile
(
id
:
string
)
{
function
handleRemoveFile
(
id
:
string
)
{
uploadFileList
.
value
=
uploadFileList
.
value
.
filter
((
item
)
=>
item
.
id
!==
id
)
uploadFileList
.
value
=
uploadFileList
.
value
.
filter
((
item
)
=>
item
.
id
!==
id
)
}
}
...
@@ -158,6 +173,7 @@ function handleNextStep() {
...
@@ -158,6 +173,7 @@ function handleNextStep() {
accept=
".doc, .pdf, .docx, .txt, .md"
accept=
".doc, .pdf, .docx, .txt, .md"
@
before-upload=
"handleLimitUpload"
@
before-upload=
"handleLimitUpload"
@
change=
"handleUpload"
@
change=
"handleUpload"
@
drop=
"handleDropFile"
>
>
<NUploadDragger>
<NUploadDragger>
<div
class=
"mb-3 flex justify-center"
>
<div
class=
"mb-3 flex justify-center"
>
...
...
types/locales.d.ts
View file @
e586238c
...
@@ -21,6 +21,7 @@ declare namespace I18n {
...
@@ -21,6 +21,7 @@ declare namespace I18n {
name
:
string
name
:
string
desc
:
string
desc
:
string
publish_time_in
:
string
publish_time_in
:
string
created_time
:
string
modified_time
:
string
modified_time
:
string
is_open
:
string
is_open
:
string
status
:
string
status
:
string
...
...
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