Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigDataSystem
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
张伯涛
bigDataSystem
Commits
80dffd56
Commit
80dffd56
authored
Nov 08, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改知识库
parent
524d1cc9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
12 deletions
+64
-12
data.ts
src/views/knowledgeBase/data.ts
+4
-4
improtModal.vue
src/views/knowledgeBase/improtModal.vue
+0
-1
knowledgeBaseData.ts
src/views/knowledgeBase/knowledgeBaseData.ts
+8
-4
knowledgeModal.vue
src/views/knowledgeBase/knowledgeModal.vue
+52
-3
No files found.
src/views/knowledgeBase/data.ts
View file @
80dffd56
...
@@ -97,14 +97,14 @@ export const formSchema: FormSchema[] = [
...
@@ -97,14 +97,14 @@ export const formSchema: FormSchema[] = [
required
:
true
,
required
:
true
,
},
},
{
{
field
:
'dept
Name
'
,
field
:
'dept
Id
'
,
label
:
'权属机构'
,
label
:
'权属机构'
,
component
:
'TreeSelect'
,
component
:
'TreeSelect'
,
colProps
:
{
lg
:
24
,
md
:
24
},
colProps
:
{
lg
:
24
,
md
:
24
},
componentProps
:
{
componentProps
:
{
fieldNames
:
{
fieldNames
:
{
label
:
'deptName'
,
label
:
'deptName'
,
value
:
'
deptName
'
,
value
:
'
businessId
'
,
},
},
getPopupContainer
:
()
=>
document
.
body
,
getPopupContainer
:
()
=>
document
.
body
,
},
},
...
@@ -121,14 +121,14 @@ export const formSchema: FormSchema[] = [
...
@@ -121,14 +121,14 @@ export const formSchema: FormSchema[] = [
export
const
importFormSchema
:
FormSchema
[]
=
[
export
const
importFormSchema
:
FormSchema
[]
=
[
{
{
field
:
'dept
Name
'
,
field
:
'dept
Id
'
,
label
:
'导入至'
,
label
:
'导入至'
,
component
:
'TreeSelect'
,
component
:
'TreeSelect'
,
colProps
:
{
lg
:
24
,
md
:
24
},
colProps
:
{
lg
:
24
,
md
:
24
},
componentProps
:
{
componentProps
:
{
fieldNames
:
{
fieldNames
:
{
label
:
'deptName'
,
label
:
'deptName'
,
value
:
'
deptName
'
,
value
:
'
businessId
'
,
},
},
getPopupContainer
:
()
=>
document
.
body
,
getPopupContainer
:
()
=>
document
.
body
,
},
},
...
...
src/views/knowledgeBase/improtModal.vue
View file @
80dffd56
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
UserDetailApi
}
from
'@/api/system/user/user'
;
import
{
importFormSchema
}
from
'@/views/knowledgeBase/data'
;
import
{
importFormSchema
}
from
'@/views/knowledgeBase/data'
;
defineOptions
({
name
:
'AccountModal'
});
defineOptions
({
name
:
'AccountModal'
});
...
...
src/views/knowledgeBase/knowledgeBaseData.ts
View file @
80dffd56
...
@@ -67,7 +67,8 @@ export const knowledgeData: any[] = [
...
@@ -67,7 +67,8 @@ export const knowledgeData: any[] = [
fileType
:
'test'
,
fileType
:
'test'
,
createDate
:
'2024-10-24 10:04:04'
,
createDate
:
'2024-10-24 10:04:04'
,
createBy
:
'admin'
,
createBy
:
'admin'
,
deptName
:
'财务部门'
,
deptId
:
'102'
,
deptName
:
'研发部门'
,
updateDate
:
'2024-10-24 10:04:04'
,
updateDate
:
'2024-10-24 10:04:04'
,
updateBy
:
'admin'
,
updateBy
:
'admin'
,
},
},
...
@@ -80,7 +81,8 @@ export const knowledgeData: any[] = [
...
@@ -80,7 +81,8 @@ export const knowledgeData: any[] = [
fileType
:
'test'
,
fileType
:
'test'
,
createDate
:
'2024-10-24 10:04:04'
,
createDate
:
'2024-10-24 10:04:04'
,
createBy
:
'admin'
,
createBy
:
'admin'
,
deptName
:
'财务部门'
,
deptId
:
'102'
,
deptName
:
'研发部门'
,
updateDate
:
'2024-10-24 10:04:04'
,
updateDate
:
'2024-10-24 10:04:04'
,
updateBy
:
'admin'
,
updateBy
:
'admin'
,
},
},
...
@@ -93,7 +95,8 @@ export const knowledgeData: any[] = [
...
@@ -93,7 +95,8 @@ export const knowledgeData: any[] = [
fileType
:
'test'
,
fileType
:
'test'
,
createDate
:
'2024-10-24 10:04:04'
,
createDate
:
'2024-10-24 10:04:04'
,
createBy
:
'admin'
,
createBy
:
'admin'
,
deptName
:
'研发部门'
,
deptId
:
'103'
,
deptName
:
'市场部门'
,
updateDate
:
'2024-10-24 10:04:04'
,
updateDate
:
'2024-10-24 10:04:04'
,
updateBy
:
'admin'
,
updateBy
:
'admin'
,
},
},
...
@@ -106,7 +109,8 @@ export const knowledgeData: any[] = [
...
@@ -106,7 +109,8 @@ export const knowledgeData: any[] = [
fileType
:
'test'
,
fileType
:
'test'
,
createDate
:
'2024-10-24 10:04:04'
,
createDate
:
'2024-10-24 10:04:04'
,
createBy
:
'admin'
,
createBy
:
'admin'
,
deptName
:
'研发部门'
,
deptId
:
'103'
,
deptName
:
'市场部门'
,
updateDate
:
'2024-10-24 10:04:04'
,
updateDate
:
'2024-10-24 10:04:04'
,
updateBy
:
'admin'
,
updateBy
:
'admin'
,
},
},
...
...
src/views/knowledgeBase/knowledgeModal.vue
View file @
80dffd56
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
formSchema
}
from
'@/views/knowledgeBase/data'
;
import
{
formSchema
}
from
'@/views/knowledgeBase/data'
;
import
{
knowledgeData
}
from
'@/views/knowledgeBase/knowledgeBaseData'
;
import
{
knowledgeData
}
from
'@/views/knowledgeBase/knowledgeBaseData'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
defineOptions
({
name
:
'KnowledgeModal'
});
defineOptions
({
name
:
'KnowledgeModal'
});
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
const
tableData
=
ref
([]);
const
tableData
=
ref
([]);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
resetFields
}]
=
useForm
({
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
}]
=
useForm
({
labelWidth
:
100
,
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
formSchema
,
schemas
:
formSchema
,
...
@@ -50,10 +50,59 @@
...
@@ -50,10 +50,59 @@
userData
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
===
rowId
.
value
);
userData
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
===
rowId
.
value
);
setFieldsValue
(
userData
[
0
]);
setFieldsValue
(
userData
[
0
]);
}
}
const
treeData
=
await
getDeptList
();
const
treeList
=
handleTree
(
treeData
.
data
,
'businessId'
,
undefined
,
undefined
,
undefined
);
updateSchema
([
{
field
:
'username'
,
show
:
!
unref
(
isUpdate
),
},
{
field
:
'password'
,
show
:
!
unref
(
isUpdate
),
},
{
field
:
'flag'
,
show
:
!
unref
(
isUpdate
),
},
{
field
:
'deptId'
,
componentProps
:
{
treeData
:
treeList
,
},
},
]);
});
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增文件'
:
'编辑文件'
));
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增文件'
:
'编辑文件'
));
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
id
=
id
||
'id'
;
parentId
=
parentId
||
'parentId'
;
children
=
children
||
'children'
;
rootId
=
rootId
||
Math
.
min
.
apply
(
Math
,
data
.
map
((
item
)
=>
{
return
item
[
parentId
];
}),
)
||
0
;
// 对源数据深度克隆
const
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
// 循环所有项
const
treeData
=
cloneData
.
filter
((
father
)
=>
{
const
branchArr
=
cloneData
.
filter
((
child
)
=>
{
// 返回每一项的子级数组
return
father
[
id
]
===
child
[
parentId
];
});
branchArr
.
length
>
0
?
(
father
.
children
=
branchArr
)
:
''
;
// 返回第一层
return
father
[
parentId
]
===
rootId
;
});
return
treeData
!==
''
?
treeData
:
data
;
}
async
function
handleSubmit
()
{
async
function
handleSubmit
()
{
closeModal
();
closeModal
();
}
}
...
...
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