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
8a6467b1
Commit
8a6467b1
authored
Nov 13, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改血缘
parent
c41d1fb0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
928 additions
and
3 deletions
+928
-3
analysisData.ts
src/views/kinship/kinshipAnalysis/analysisData.ts
+0
-0
data.ts
src/views/kinship/kinshipAnalysis/data.ts
+0
-0
index.vue
src/views/kinship/kinshipAnalysis/index.vue
+128
-0
storageManagementModal.vue
src/views/kinship/kinshipAnalysis/storageManagementModal.vue
+137
-0
index.vue
src/views/kinship/kinshipEdit/index.vue
+220
-0
index.vue
src/views/kinship/kinshipOperations/index.vue
+220
-0
index.vue
src/views/kinship/kinshipParse/index.vue
+220
-0
index.vue
src/views/metadata/index.vue
+3
-3
No files found.
src/views/kinship/kinshipAnalysis/analysisData.ts
0 → 100644
View file @
8a6467b1
src/views/kinship/kinshipAnalysis/data.ts
0 → 100644
View file @
8a6467b1
src/views/kinship/kinshipAnalysis/index.vue
0 → 100644
View file @
8a6467b1
<
template
>
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
<GroupTree
class=
"w-1/3 xl:w-2/9"
@
select=
"onNodeSelect"
/>
<div
class=
"w-2/3 xl:w-7/9"
>
<BasicTable
@
register=
"registerTable"
:searchInfo=
"searchInfo"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleManage"
>
存储管理
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'dataSourceStatus'"
>
<Tag
color=
"error"
v-if=
"record.dataSourceStatus === '0'"
>
数据待采集
</Tag>
</
template
>
<
template
v-if=
"column.key === 'dataSourceStatus'"
>
<Tag
color=
"warning"
v-if=
"record.dataSourceStatus === '1'"
>
数据采集中
</Tag>
</
template
>
<
template
v-if=
"column.key === 'dataSourceStatus'"
>
<Tag
color=
"success"
v-if=
"record.dataSourceStatus === '2'"
>
采集已完成
</Tag>
</
template
>
</template>
</BasicTable>
</div>
<storageManagementModal
@
register=
"registerStorageManagementModal"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
onMounted
,
ref
}
from
'vue'
;
import
{
Tag
}
from
'ant-design-vue'
;
import
{
BasicTable
,
useTable
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
sourceColumns
,
sourceSearchFormSchema
}
from
'@/views/metadata/data'
;
import
GroupTree
from
'@/views/metadata/GroupTree.vue'
;
import
{
metadataData
}
from
'@/views/metadata/metadataData'
;
import
storageManagementModal
from
'./storageManagementModal.vue'
;
defineOptions
({
name
:
'Metadata'
});
const
title
=
ref
(
'数据库资源对象资源'
);
const
{
createMessage
}
=
useMessage
();
const
[
registerStorageManagementModal
,
{
openModal
:
openStorageManagementModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tableData
=
ref
([]);
const
selectedNode
=
ref
(
null
);
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
}]
=
useTable
({
title
:
title
,
api
:
async
()
=>
{
const
response
=
{
pageNum
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
var
data
=
[];
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
parentId
!==
0
);
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
striped
:
false
,
columns
:
sourceColumns
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
sourceSearchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{},
},
useSearchForm
:
true
,
showIndexColumn
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
tableData
.
value
=
metadataData
.
filter
(
(
item
)
=>
(
info
.
name
===
undefined
||
item
.
name
.
includes
(
info
.
name
))
&&
(
info
.
workSpaceName
===
undefined
||
info
.
workSpaceName
===
'数据库对象资源'
||
item
.
workSpaceName
.
includes
(
info
.
workSpaceName
)),
);
console
.
log
(
'tableData'
,
tableData
.
value
);
console
.
log
(
'info'
,
info
);
return
info
;
},
});
// 选中节点
async
function
onNodeSelect
(
node
:
any
)
{
selectedNode
.
value
=
node
;
title
.
value
=
node
.
workSpaceName
;
await
getForm
().
setFieldsValue
({
workSpaceName
:
title
.
value
,
});
const
info
=
await
getForm
().
getFieldsValue
();
tableData
.
value
=
metadataData
.
filter
(
(
item
)
=>
(
info
.
name
===
undefined
||
item
.
name
.
includes
(
info
.
name
))
&&
(
info
.
workSpaceName
===
undefined
||
info
.
workSpaceName
===
'数据库对象资源'
||
item
.
workSpaceName
.
includes
(
info
.
workSpaceName
)),
);
await
reload
();
}
/** 新增/编辑成功*/
function
handleSuccess
({
isUpdate
,
values
})
{
if
(
isUpdate
)
{
// 演示不刷新表格直接更新内部数据。
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
// console.log(result);
reload
();
}
else
{
reload
();
}
}
function
handleManage
()
{
openStorageManagementModal
(
true
,
{
title
:
'存储管理'
,
});
}
// 设置图表选项
onMounted
(()
=>
{
tableData
.
value
=
metadataData
;
});
</
script
>
src/views/kinship/kinshipAnalysis/storageManagementModal.vue
0 → 100644
View file @
8a6467b1
<
template
>
<BasicModal
width=
"80%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"title"
@
ok=
"handleSubmit"
>
<div
style=
"display: flex; justify-content: flex-end; padding-bottom: 10px"
>
<a-button
style=
"margin-right: 5px"
type=
"primary"
@
click=
"deleteAll"
>
批量删除
</a-button>
<a-button
style=
"margin-right: 5px"
type=
"primary"
@
click=
"handleImport"
>
规则设置
</a-button>
</div>
<template
#
footer
>
<a-button
type=
"primary"
@
click=
"handleSubmit"
>
关闭
</a-button>
</
template
>
<BasicTable
@
register=
"registerTable"
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
//配置详情
icon: 'clarity:note-edit-line',
label: '',
onClick: handleEdit.bind(null),
},
{
icon: 'ant-design:delete-outlined',
color: 'error',
label: '',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null),
},
},
{
//失败日志
icon: 'clarity:contract-line',
label: '',
ifShow: record.status === '失败',
onClick: handleDetail.bind(null),
},
]"
/>
</
template
>
</template>
</BasicTable>
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
BasicTable
,
TableAction
,
useTable
}
from
'@/components/Table'
;
import
{
storageManagementColumns
,
storageManagementFormSchema
}
from
'@/views/metadata/data'
;
import
{
storageManagementData
}
from
'@/views/metadata/metadataData'
;
defineOptions
({
name
:
'KnowledgeModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
title
=
ref
();
const
tableData
=
ref
([]);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerTable
,
{
reload
}]
=
useTable
({
api
:
async
()
=>
{
const
response
=
{
pageNum
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
var
data
=
[];
data
=
tableData
.
value
;
return
{
...
response
,
data
:
data
};
},
pagination
:
false
,
columns
:
storageManagementColumns
,
useSearchForm
:
true
,
showTableSetting
:
false
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
storageManagementFormSchema
,
autoSubmitOnEnter
:
true
,
},
rowKey
:
'id'
,
rowSelection
:
true
,
bordered
:
true
,
showIndexColumn
:
false
,
actionColumn
:
{
width
:
150
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
await
reload
();
setModalProps
({
confirmLoading
:
false
});
title
.
value
=
data
.
title
;
});
async
function
handleSubmit
()
{
closeModal
();
}
function
handleDetail
()
{
createMessage
.
success
(
'提交成功'
);
}
function
handleEdit
()
{
createMessage
.
success
(
'提交成功'
);
}
function
handleDelete
()
{
createMessage
.
success
(
'删除成功'
);
}
function
deleteAll
()
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认删除'
,
content
:
'确认批量删除选中数据吗?'
,
onOk
()
{
createMessage
.
success
(
'批量删除成功!'
);
},
});
}
function
handleImport
()
{
createMessage
.
success
(
'导出完成'
);
}
onMounted
(()
=>
{
tableData
.
value
=
storageManagementData
;
});
</
script
>
src/views/kinship/kinshipEdit/index.vue
0 → 100644
View file @
8a6467b1
<
template
>
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
<GroupTree
class=
"w-1/5 xl:w-1/8"
@
select=
"handleSelect"
/>
<BasicTable
@
register=
"registerTable"
class=
"w-4/5 xl:w-7/8"
:searchInfo=
"searchInfo"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleDeleteIds"
>
删除
</a-button>
<a-button
type=
"primary"
@
click=
"download"
>
下载
</a-button>
<a-button
type=
"primary"
@
click=
"handleImport"
>
导入
</a-button>
<a-button
type=
"primary"
@
click=
"handleAdd"
>
新建文件夹
</a-button>
<a-button
type=
"primary"
@
click=
"handleCreate"
>
新建文件
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'clarity:contract-line',
label: '',
onClick: handleView.bind(null, record),
},
{
icon: 'clarity:download-line',
label: '',
onClick: download.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
color: 'error',
label: '',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</
template
>
</template>
</BasicTable>
<knowledgeModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
<importModal
@
register=
"registerImport"
@
success=
"handleSuccess"
/>
<addModal
@
register=
"registerAdd"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
knowledgeModal
from
'@/views/knowledgeBase/knowledgeModal.vue'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
useFilterStore
}
from
'@/store/modules/filterData'
;
import
{
columns
,
searchFormSchema
}
from
'@/views/knowledgeBase/data'
;
import
GroupTree
from
'@/views/knowledgeBase/GroupTree.vue'
;
import
{
knowledgeData
}
from
'@/views/knowledgeBase/knowledgeBaseData'
;
import
importModal
from
'@/views/knowledgeBase/improtModal.vue'
;
import
addModal
from
'@/views/knowledgeBase/addModal.vue'
;
defineOptions
({
name
:
'KnowledgeBase'
});
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
filterStore
=
useFilterStore
();
const
route
=
useRoute
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerImport
,
{
openModal
:
openImportModal
}]
=
useModal
();
const
[
registerAdd
,
{
openModal
:
openAddModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tableData
=
ref
([]);
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
}]
=
useTable
({
title
:
'知识库'
,
api
:
async
(
params
)
=>
{
const
response
=
{
pageNu
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
let
data
=
[];
if
(
params
.
fileTypeId
==
100
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
parentId
!==
0
);
}
else
if
(
params
.
fileTypeId
==
101
||
params
.
fileTypeId
==
111
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
101
);
}
else
if
(
params
.
fileTypeId
==
107
||
params
.
fileTypeId
==
112
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
107
);
}
else
if
(
params
.
fileTypeId
==
203
||
params
.
fileTypeId
==
113
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
''
);
}
else
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
parentId
!==
0
);
}
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
rowSelection
:
true
,
striped
:
false
,
columns
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{
searchInfo
.
fileTypeId
=
''
;
},
},
useSearchForm
:
true
,
showIndexColumn
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
console
.
log
(
'handleSearchInfoFn'
,
info
);
return
info
;
},
actionColumn
:
{
width
:
140
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
/** 新增按钮*/
function
handleCreate
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
function
handleAdd
()
{
openAddModal
(
true
,
{
isUpdate
:
false
,
});
}
function
handleImport
()
{
openImportModal
(
true
,
{
isUpdate
:
false
,
});
}
/** 下载按钮*/
function
download
()
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认下载'
,
content
:
'确认下载?'
,
onOk
()
{
createMessage
.
success
(
'下载成功!'
);
},
});
}
/** 批量删除按钮*/
function
handleDeleteIds
()
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认删除'
,
content
:
'确认批量删除选中数据吗?'
,
onOk
()
{
createMessage
.
success
(
'批量删除成功!'
);
},
});
}
/** 重置密码弹窗确定按钮*/
/** 删除按钮*/
function
handleDelete
(
record
:
Recordable
)
{
createMessage
.
success
(
'删除成功!'
);
reload
();
}
/** 新增/编辑成功*/
function
handleSuccess
({
isUpdate
,
values
})
{
if
(
isUpdate
)
{
// 演示不刷新表格直接更新内部数据。
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
console
.
log
(
result
);
reload
();
}
else
{
reload
();
}
}
function
handleView
(
record
:
Recordable
)
{
openModal
(
true
,
{
record
,
isUpdate
:
true
,
disable
:
true
,
});
}
/** 部门树的select*/
function
handleSelect
(
workSpaceName
=
''
)
{
searchInfo
.
fileTypeId
=
workSpaceName
;
reload
();
}
onMounted
(()
=>
{
tableData
.
value
=
knowledgeData
;
const
path
=
route
.
path
;
if
(
filterStore
.
getSearchParams
[
path
])
{
if
(
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]
!==
{}))
{
const
params
=
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]);
console
.
log
(
'11111111111111111111111111111'
,
params
);
getForm
().
setFieldsValue
({
page
:
params
.
page
,
pageSize
:
params
.
pageSize
,
username
:
params
.
username
,
flag
:
params
.
flag
,
});
searchInfo
.
deptId
=
params
.
deptId
;
}
}
});
onBeforeRouteLeave
((
to
,
from
,
next
)
=>
{
const
params
=
Object
.
assign
({},
getSearchInfo
(),
getForm
().
getFieldsValue
());
console
.
log
(
'path'
,
from
.
path
);
console
.
log
(
'params'
,
params
);
filterStore
.
setSearchParams
({
path
:
from
.
path
,
param
:
{
...
params
,
},
});
next
();
// 允许导航
});
</
script
>
src/views/kinship/kinshipOperations/index.vue
0 → 100644
View file @
8a6467b1
<
template
>
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
<GroupTree
class=
"w-1/5 xl:w-1/8"
@
select=
"handleSelect"
/>
<BasicTable
@
register=
"registerTable"
class=
"w-4/5 xl:w-7/8"
:searchInfo=
"searchInfo"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleDeleteIds"
>
删除
</a-button>
<a-button
type=
"primary"
@
click=
"download"
>
下载
</a-button>
<a-button
type=
"primary"
@
click=
"handleImport"
>
导入
</a-button>
<a-button
type=
"primary"
@
click=
"handleAdd"
>
新建文件夹
</a-button>
<a-button
type=
"primary"
@
click=
"handleCreate"
>
新建文件
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'clarity:contract-line',
label: '',
onClick: handleView.bind(null, record),
},
{
icon: 'clarity:download-line',
label: '',
onClick: download.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
color: 'error',
label: '',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</
template
>
</template>
</BasicTable>
<knowledgeModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
<importModal
@
register=
"registerImport"
@
success=
"handleSuccess"
/>
<addModal
@
register=
"registerAdd"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
knowledgeModal
from
'@/views/knowledgeBase/knowledgeModal.vue'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
useFilterStore
}
from
'@/store/modules/filterData'
;
import
{
columns
,
searchFormSchema
}
from
'@/views/knowledgeBase/data'
;
import
GroupTree
from
'@/views/knowledgeBase/GroupTree.vue'
;
import
{
knowledgeData
}
from
'@/views/knowledgeBase/knowledgeBaseData'
;
import
importModal
from
'@/views/knowledgeBase/improtModal.vue'
;
import
addModal
from
'@/views/knowledgeBase/addModal.vue'
;
defineOptions
({
name
:
'KnowledgeBase'
});
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
filterStore
=
useFilterStore
();
const
route
=
useRoute
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerImport
,
{
openModal
:
openImportModal
}]
=
useModal
();
const
[
registerAdd
,
{
openModal
:
openAddModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tableData
=
ref
([]);
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
}]
=
useTable
({
title
:
'知识库'
,
api
:
async
(
params
)
=>
{
const
response
=
{
pageNu
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
let
data
=
[];
if
(
params
.
fileTypeId
==
100
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
parentId
!==
0
);
}
else
if
(
params
.
fileTypeId
==
101
||
params
.
fileTypeId
==
111
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
101
);
}
else
if
(
params
.
fileTypeId
==
107
||
params
.
fileTypeId
==
112
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
107
);
}
else
if
(
params
.
fileTypeId
==
203
||
params
.
fileTypeId
==
113
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
''
);
}
else
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
parentId
!==
0
);
}
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
rowSelection
:
true
,
striped
:
false
,
columns
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{
searchInfo
.
fileTypeId
=
''
;
},
},
useSearchForm
:
true
,
showIndexColumn
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
console
.
log
(
'handleSearchInfoFn'
,
info
);
return
info
;
},
actionColumn
:
{
width
:
140
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
/** 新增按钮*/
function
handleCreate
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
function
handleAdd
()
{
openAddModal
(
true
,
{
isUpdate
:
false
,
});
}
function
handleImport
()
{
openImportModal
(
true
,
{
isUpdate
:
false
,
});
}
/** 下载按钮*/
function
download
()
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认下载'
,
content
:
'确认下载?'
,
onOk
()
{
createMessage
.
success
(
'下载成功!'
);
},
});
}
/** 批量删除按钮*/
function
handleDeleteIds
()
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认删除'
,
content
:
'确认批量删除选中数据吗?'
,
onOk
()
{
createMessage
.
success
(
'批量删除成功!'
);
},
});
}
/** 重置密码弹窗确定按钮*/
/** 删除按钮*/
function
handleDelete
(
record
:
Recordable
)
{
createMessage
.
success
(
'删除成功!'
);
reload
();
}
/** 新增/编辑成功*/
function
handleSuccess
({
isUpdate
,
values
})
{
if
(
isUpdate
)
{
// 演示不刷新表格直接更新内部数据。
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
console
.
log
(
result
);
reload
();
}
else
{
reload
();
}
}
function
handleView
(
record
:
Recordable
)
{
openModal
(
true
,
{
record
,
isUpdate
:
true
,
disable
:
true
,
});
}
/** 部门树的select*/
function
handleSelect
(
workSpaceName
=
''
)
{
searchInfo
.
fileTypeId
=
workSpaceName
;
reload
();
}
onMounted
(()
=>
{
tableData
.
value
=
knowledgeData
;
const
path
=
route
.
path
;
if
(
filterStore
.
getSearchParams
[
path
])
{
if
(
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]
!==
{}))
{
const
params
=
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]);
console
.
log
(
'11111111111111111111111111111'
,
params
);
getForm
().
setFieldsValue
({
page
:
params
.
page
,
pageSize
:
params
.
pageSize
,
username
:
params
.
username
,
flag
:
params
.
flag
,
});
searchInfo
.
deptId
=
params
.
deptId
;
}
}
});
onBeforeRouteLeave
((
to
,
from
,
next
)
=>
{
const
params
=
Object
.
assign
({},
getSearchInfo
(),
getForm
().
getFieldsValue
());
console
.
log
(
'path'
,
from
.
path
);
console
.
log
(
'params'
,
params
);
filterStore
.
setSearchParams
({
path
:
from
.
path
,
param
:
{
...
params
,
},
});
next
();
// 允许导航
});
</
script
>
src/views/kinship/kinshipParse/index.vue
0 → 100644
View file @
8a6467b1
<
template
>
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
<GroupTree
class=
"w-1/5 xl:w-1/8"
@
select=
"handleSelect"
/>
<BasicTable
@
register=
"registerTable"
class=
"w-4/5 xl:w-7/8"
:searchInfo=
"searchInfo"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleDeleteIds"
>
删除
</a-button>
<a-button
type=
"primary"
@
click=
"download"
>
下载
</a-button>
<a-button
type=
"primary"
@
click=
"handleImport"
>
导入
</a-button>
<a-button
type=
"primary"
@
click=
"handleAdd"
>
新建文件夹
</a-button>
<a-button
type=
"primary"
@
click=
"handleCreate"
>
新建文件
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
icon: 'clarity:contract-line',
label: '',
onClick: handleView.bind(null, record),
},
{
icon: 'clarity:download-line',
label: '',
onClick: download.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
color: 'error',
label: '',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</
template
>
</template>
</BasicTable>
<knowledgeModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
<importModal
@
register=
"registerImport"
@
success=
"handleSuccess"
/>
<addModal
@
register=
"registerAdd"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
knowledgeModal
from
'@/views/knowledgeBase/knowledgeModal.vue'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
useFilterStore
}
from
'@/store/modules/filterData'
;
import
{
columns
,
searchFormSchema
}
from
'@/views/knowledgeBase/data'
;
import
GroupTree
from
'@/views/knowledgeBase/GroupTree.vue'
;
import
{
knowledgeData
}
from
'@/views/knowledgeBase/knowledgeBaseData'
;
import
importModal
from
'@/views/knowledgeBase/improtModal.vue'
;
import
addModal
from
'@/views/knowledgeBase/addModal.vue'
;
defineOptions
({
name
:
'KnowledgeBase'
});
const
{
createMessage
,
createConfirm
}
=
useMessage
();
const
filterStore
=
useFilterStore
();
const
route
=
useRoute
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerImport
,
{
openModal
:
openImportModal
}]
=
useModal
();
const
[
registerAdd
,
{
openModal
:
openAddModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tableData
=
ref
([]);
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
}]
=
useTable
({
title
:
'知识库'
,
api
:
async
(
params
)
=>
{
const
response
=
{
pageNu
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
let
data
=
[];
if
(
params
.
fileTypeId
==
100
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
parentId
!==
0
);
}
else
if
(
params
.
fileTypeId
==
101
||
params
.
fileTypeId
==
111
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
101
);
}
else
if
(
params
.
fileTypeId
==
107
||
params
.
fileTypeId
==
112
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
107
);
}
else
if
(
params
.
fileTypeId
==
203
||
params
.
fileTypeId
==
113
)
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
fileTypeId
==
''
);
}
else
{
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
parentId
!==
0
);
}
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
rowSelection
:
true
,
striped
:
false
,
columns
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{
searchInfo
.
fileTypeId
=
''
;
},
},
useSearchForm
:
true
,
showIndexColumn
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
console
.
log
(
'handleSearchInfoFn'
,
info
);
return
info
;
},
actionColumn
:
{
width
:
140
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
/** 新增按钮*/
function
handleCreate
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
function
handleAdd
()
{
openAddModal
(
true
,
{
isUpdate
:
false
,
});
}
function
handleImport
()
{
openImportModal
(
true
,
{
isUpdate
:
false
,
});
}
/** 下载按钮*/
function
download
()
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认下载'
,
content
:
'确认下载?'
,
onOk
()
{
createMessage
.
success
(
'下载成功!'
);
},
});
}
/** 批量删除按钮*/
function
handleDeleteIds
()
{
createConfirm
({
iconType
:
'warning'
,
title
:
'确认删除'
,
content
:
'确认批量删除选中数据吗?'
,
onOk
()
{
createMessage
.
success
(
'批量删除成功!'
);
},
});
}
/** 重置密码弹窗确定按钮*/
/** 删除按钮*/
function
handleDelete
(
record
:
Recordable
)
{
createMessage
.
success
(
'删除成功!'
);
reload
();
}
/** 新增/编辑成功*/
function
handleSuccess
({
isUpdate
,
values
})
{
if
(
isUpdate
)
{
// 演示不刷新表格直接更新内部数据。
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
console
.
log
(
result
);
reload
();
}
else
{
reload
();
}
}
function
handleView
(
record
:
Recordable
)
{
openModal
(
true
,
{
record
,
isUpdate
:
true
,
disable
:
true
,
});
}
/** 部门树的select*/
function
handleSelect
(
workSpaceName
=
''
)
{
searchInfo
.
fileTypeId
=
workSpaceName
;
reload
();
}
onMounted
(()
=>
{
tableData
.
value
=
knowledgeData
;
const
path
=
route
.
path
;
if
(
filterStore
.
getSearchParams
[
path
])
{
if
(
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]
!==
{}))
{
const
params
=
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]);
console
.
log
(
'11111111111111111111111111111'
,
params
);
getForm
().
setFieldsValue
({
page
:
params
.
page
,
pageSize
:
params
.
pageSize
,
username
:
params
.
username
,
flag
:
params
.
flag
,
});
searchInfo
.
deptId
=
params
.
deptId
;
}
}
});
onBeforeRouteLeave
((
to
,
from
,
next
)
=>
{
const
params
=
Object
.
assign
({},
getSearchInfo
(),
getForm
().
getFieldsValue
());
console
.
log
(
'path'
,
from
.
path
);
console
.
log
(
'params'
,
params
);
filterStore
.
setSearchParams
({
path
:
from
.
path
,
param
:
{
...
params
,
},
});
next
();
// 允许导航
});
</
script
>
src/views/metadata/index.vue
View file @
8a6467b1
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
<div
id=
"chart2"
class=
"chart"
></div>
<div
id=
"chart2"
class=
"chart"
></div>
</div>
</div>
<BasicTable
@
register=
"registerTable"
:searchInfo=
"searchInfo"
>
<BasicTable
@
register=
"registerTable"
:searchInfo=
"searchInfo"
>
<
template
#
toolbar
>
<
!--
<template
#
toolbar
>
--
>
<a-button
type=
"primary"
@
click=
"handleManage"
>
存储管理
</a-button
>
<!--
<a-button
type=
"primary"
@
click=
"handleManage"
>
存储管理
</a-button>
--
>
<
/
template
>
<
!--
</
template
>
--
>
<
template
#
bodyCell=
"{ column, record }"
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'dataSourceStatus'"
>
<template
v-if=
"column.key === 'dataSourceStatus'"
>
<Tag
color=
"error"
v-if=
"record.dataSourceStatus === '0'"
>
数据待采集
</Tag>
<Tag
color=
"error"
v-if=
"record.dataSourceStatus === '0'"
>
数据待采集
</Tag>
...
...
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