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
c6def1d2
Commit
c6def1d2
authored
Nov 13, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改血缘
parent
8e044c3d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
338 additions
and
367 deletions
+338
-367
data.ts
src/views/kinship/kinshipAnalysis/data.ts
+1
-1
data.ts
src/views/kinship/kinshipEdit/data.ts
+66
-0
index.vue
src/views/kinship/kinshipEdit/index.vue
+104
-183
kinshipEditData.ts
src/views/kinship/kinshipEdit/kinshipEditData.ts
+63
-0
index.vue
src/views/kinship/kinshipParse/index.vue
+104
-183
No files found.
src/views/kinship/kinshipAnalysis/data.ts
View file @
c6def1d2
...
...
@@ -69,7 +69,7 @@ export const storageManagementColumns: BasicColumn[] = [
width
:
120
,
},
{
title
:
'清理血缘关系
树
'
,
title
:
'清理血缘关系
数
'
,
dataIndex
:
'num'
,
width
:
120
,
},
...
...
src/views/kinship/kinshipEdit/data.ts
0 → 100644
View file @
c6def1d2
import
{
FormSchema
}
from
"@/components/Form"
;
import
{
BasicColumn
}
from
"@/components/Table"
;
export
const
formSchema
:
FormSchema
[]
=
[
{
field
:
'file'
,
component
:
'Upload'
,
label
:
'血缘编辑文件'
,
colProps
:
{
lg
:
24
,
md
:
24
},
rules
:
[{
required
:
true
,
message
:
'请选择上传文件'
}],
},
];
export
const
columns
:
BasicColumn
[]
=
[
{
title
:
'工作表名'
,
dataIndex
:
'name'
,
width
:
120
,
},
{
title
:
'编号'
,
dataIndex
:
'code'
,
width
:
120
,
},
{
title
:
'错误类型'
,
dataIndex
:
'type'
,
width
:
120
,
},
];
export
const
historyColumns
:
BasicColumn
[]
=
[
{
title
:
'用户'
,
dataIndex
:
'name'
,
width
:
120
,
},
{
title
:
'编辑时间'
,
dataIndex
:
'date'
,
width
:
120
,
},
{
title
:
'上传文件'
,
dataIndex
:
'fileName'
,
width
:
120
,
},
{
title
:
'编辑结果'
,
dataIndex
:
'type'
,
width
:
120
,
},
];
export
const
SearchFormSchema
:
FormSchema
[]
=
[
{
field
:
'name'
,
label
:
'名称'
,
component
:
'Input'
,
colProps
:
{
span
:
8
},
},
{
field
:
'isKinship'
,
component
:
'Checkbox'
,
label
:
'仅显示我上传的'
,
colProps
:
{
span
:
8
},
labelWidth
:
120
,
},
];
src/views/kinship/kinshipEdit/index.vue
View file @
c6def1d2
<
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>
<PageWrapper
title=
"血缘编辑"
class=
"content-padding"
contentBackground
>
<template
#
footer
>
<a-tabs
default-active-key=
"1"
v-model:activeKey=
"currentKey"
>
<a-tab-pane
key=
"1"
tab=
"编辑"
/>
<a-tab-pane
key=
"2"
tab=
"编辑历史"
/>
</a-tabs>
</
template
>
<div
class=
"pt-4 m-4 desc-wrap"
>
<
template
v-if=
"currentKey == '1'"
>
<BasicForm
@
register=
"registerForm"
/>
<div
style=
"padding-left: 100px"
>
<a-button
type=
"primary"
@
click=
"handleSubmit"
>
提交
</a-button>
</div>
<BasicTable
@
register=
"registerTable"
/>
</
template
>
<
template
v-if=
"currentKey == '2'"
>
<BasicTable
@
register=
"registerHistoryTable"
>
<template
#
bodyCell=
"
{ column, record }">
<template
v-if=
"column.key === 'type'"
>
<Tag
color=
"error"
v-if=
"record.type === '0'"
>
导入失败
</Tag>
</
template
>
<
template
v-if=
"column.key === 'type'"
>
<Tag
color=
"success"
v-if=
"record.type === '1'"
>
导入成功
</Tag>
</
template
>
<
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
),
onClick: handleDownload.bind(null
),
},
{
icon: 'ant-design:delete-outlined',
...
...
@@ -30,7 +38,7 @@
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record
),
confirm: handleDelete.bind(null
),
},
},
]"
...
...
@@ -38,40 +46,39 @@
</
template
>
</template>
</BasicTable>
<knowledgeModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
<importModal
@
register=
"registerImport"
@
success=
"handleSuccess"
/>
<addModal
@
register=
"registerAdd"
/>
</template>
</div>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
Tabs
,
Tag
}
from
'ant-design-vue'
;
import
{
BasicTable
,
TableAction
,
useTable
}
from
'@/components/Table'
;
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'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
formSchema
,
columns
,
historyColumns
,
SearchFormSchema
,
}
from
'@/views/kinship/kinshipEdit/data'
;
import
{
editData
,
historyData
}
from
'@/views/kinship/kinshipEdit/kinshipEditData'
;
defineOptions
({
name
:
'AccountDetail'
});
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
{
createMessage
,
createConfirm
}
=
useMessage
();
const
ATabs
=
Tabs
;
const
ATabPane
=
Tabs
.
TabPane
;
const
currentKey
=
ref
(
'1'
);
const
[
registerTable
,
{
reload
}]
=
useTable
({
title
:
'错误列表'
,
api
:
async
()
=>
{
const
response
=
{
pageNu
:
'1'
,
pageNu
m
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
...
...
@@ -80,141 +87,55 @@
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
);
}
var
data
=
[];
data
=
tableData
.
value
;
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
rowSelection
:
true
,
striped
:
false
,
pagination
:
false
,
columns
,
useSearchForm
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
showIndexColumn
:
false
,
});
const
[
registerForm
,
{
resetFields
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
formSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
const
[
registerHistoryTable
]
=
useTable
({
dataSource
:
historyData
,
columns
:
historyColumns
,
pagination
:
true
,
showIndexColumn
:
false
,
useSearchForm
:
true
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
s
earchFormSchema
,
schemas
:
S
earchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{
searchInfo
.
fileTypeId
=
''
;
},
},
useSearchForm
:
true
,
showIndexColumn
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
console
.
log
(
'handleSearchInfoFn'
,
info
);
return
info
;
},
actionColumn
:
{
width
:
1
4
0
,
width
:
1
5
0
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
scroll
:
{
y
:
400
},
});
/** 新增按钮*/
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
handleSubmit
()
{
createMessage
.
success
(
'提交成功'
);
}
/** 新增/编辑成功*/
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
,
});
function
handleDownload
()
{
createMessage
.
success
(
'下载成功'
);
}
/** 部门树的select*/
function
handleSelect
(
workSpaceName
=
''
)
{
searchInfo
.
fileTypeId
=
workSpaceName
;
reload
();
function
handleDelete
()
{
createMessage
.
success
(
'删除成功'
);
}
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
();
// 允许导航
resetFields
();
tableData
.
value
=
editData
;
});
</
script
>
src/views/kinship/kinshipEdit/kinshipEditData.ts
0 → 100644
View file @
c6def1d2
export
const
editData
:
any
[]
=
[
{
name
:
'Sheet0'
,
code
:
'C2'
,
type
:
'数据源不存在'
,
},
{
name
:
'Sheet1'
,
code
:
'C3'
,
type
:
'数据源不存在'
,
},
{
name
:
'Sheet2'
,
code
:
'C4'
,
type
:
'数据源不存在'
,
},
{
name
:
'Sheet3'
,
code
:
'C5'
,
type
:
'数据源不存在'
,
},
{
name
:
'Sheet4'
,
code
:
'C6'
,
type
:
'数据源不存在'
,
},
{
name
:
'Sheet5'
,
code
:
'C7'
,
type
:
'数据源不存在'
,
},
{
name
:
'Sheet6'
,
code
:
'C8'
,
type
:
'数据源不存在'
,
},
];
export
const
historyData
:
any
[]
=
[
{
name
:
'admin'
,
date
:
'2022-01-01 12:00:00'
,
fileName
:
'test.xlsx'
,
type
:
'1'
,
},
{
name
:
'admin'
,
date
:
'2022-01-01 12:00:00'
,
fileName
:
'test.xlsx'
,
type
:
'0'
,
},
{
name
:
'admin'
,
date
:
'2022-01-01 12:00:00'
,
fileName
:
'test.xlsx'
,
type
:
'1'
,
},
{
name
:
'admin'
,
date
:
'2022-01-01 12:00:00'
,
fileName
:
'test.xlsx'
,
type
:
'0'
,
},
];
src/views/kinship/kinshipParse/index.vue
View file @
c6def1d2
<
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>
<PageWrapper
title=
"血缘解析"
class=
"content-padding"
contentBackground
>
<template
#
footer
>
<a-tabs
default-active-key=
"1"
v-model:activeKey=
"currentKey"
>
<a-tab-pane
key=
"1"
tab=
"编辑"
/>
<a-tab-pane
key=
"2"
tab=
"编辑历史"
/>
</a-tabs>
</
template
>
<div
class=
"pt-4 m-4 desc-wrap"
>
<
template
v-if=
"currentKey == '1'"
>
<BasicForm
@
register=
"registerForm"
/>
<div
style=
"padding-left: 100px"
>
<a-button
type=
"primary"
@
click=
"handleSubmit"
>
提交
</a-button>
</div>
<BasicTable
@
register=
"registerTable"
/>
</
template
>
<
template
v-if=
"currentKey == '2'"
>
<BasicTable
@
register=
"registerHistoryTable"
>
<template
#
bodyCell=
"
{ column, record }">
<template
v-if=
"column.key === 'type'"
>
<Tag
color=
"error"
v-if=
"record.type === '0'"
>
导入失败
</Tag>
</
template
>
<
template
v-if=
"column.key === 'type'"
>
<Tag
color=
"success"
v-if=
"record.type === '1'"
>
导入成功
</Tag>
</
template
>
<
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
),
onClick: handleDownload.bind(null
),
},
{
icon: 'ant-design:delete-outlined',
...
...
@@ -30,7 +38,7 @@
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record
),
confirm: handleDelete.bind(null
),
},
},
]"
...
...
@@ -38,40 +46,39 @@
</
template
>
</template>
</BasicTable>
<knowledgeModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
<importModal
@
register=
"registerImport"
@
success=
"handleSuccess"
/>
<addModal
@
register=
"registerAdd"
/>
</template>
</div>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
Tabs
,
Tag
}
from
'ant-design-vue'
;
import
{
BasicTable
,
TableAction
,
useTable
}
from
'@/components/Table'
;
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'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
formSchema
,
columns
,
historyColumns
,
SearchFormSchema
,
}
from
'@/views/kinship/kinshipEdit/data'
;
import
{
editData
,
historyData
}
from
'@/views/kinship/kinshipEdit/kinshipEditData'
;
defineOptions
({
name
:
'AccountDetail'
});
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
{
createMessage
,
createConfirm
}
=
useMessage
();
const
ATabs
=
Tabs
;
const
ATabPane
=
Tabs
.
TabPane
;
const
currentKey
=
ref
(
'1'
);
const
[
registerTable
,
{
reload
}]
=
useTable
({
title
:
'错误列表'
,
api
:
async
()
=>
{
const
response
=
{
pageNu
:
'1'
,
pageNu
m
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
...
...
@@ -80,141 +87,55 @@
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
);
}
var
data
=
[];
data
=
tableData
.
value
;
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
rowSelection
:
true
,
striped
:
false
,
pagination
:
false
,
columns
,
useSearchForm
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
showIndexColumn
:
false
,
});
const
[
registerForm
,
{
resetFields
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
formSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
const
[
registerHistoryTable
]
=
useTable
({
dataSource
:
historyData
,
columns
:
historyColumns
,
pagination
:
true
,
showIndexColumn
:
false
,
useSearchForm
:
true
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
s
earchFormSchema
,
schemas
:
S
earchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{
searchInfo
.
fileTypeId
=
''
;
},
},
useSearchForm
:
true
,
showIndexColumn
:
false
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
console
.
log
(
'handleSearchInfoFn'
,
info
);
return
info
;
},
actionColumn
:
{
width
:
1
4
0
,
width
:
1
5
0
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
scroll
:
{
y
:
400
},
});
/** 新增按钮*/
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
handleSubmit
()
{
createMessage
.
success
(
'提交成功'
);
}
/** 新增/编辑成功*/
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
,
});
function
handleDownload
()
{
createMessage
.
success
(
'下载成功'
);
}
/** 部门树的select*/
function
handleSelect
(
workSpaceName
=
''
)
{
searchInfo
.
fileTypeId
=
workSpaceName
;
reload
();
function
handleDelete
()
{
createMessage
.
success
(
'删除成功'
);
}
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
();
// 允许导航
resetFields
();
tableData
.
value
=
editData
;
});
</
script
>
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