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
fa68f4e8
Commit
fa68f4e8
authored
Nov 06, 2024
by
hubaoshan
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c6331401
729e4758
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
189 additions
and
190 deletions
+189
-190
EditRowTable.vue
src/views/metaModel/knowledgeModel/EditRowTable.vue
+189
-190
No files found.
src/views/metaModel/knowledgeModel/EditRowTable.vue
View file @
fa68f4e8
<
template
>
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass=
"flex"
>
<ModelTree
class=
"w-1/4 xl:w-1/5"
@
select=
"handleSelect"
/>
<BasicTable
@
register=
"registerTable"
class=
"w-3/4 xl:w-4/5"
:searchInfo=
"searchInfo"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleCreateFile"
>
新建文件夹
</a-button>
<a-button
type=
"primary"
@
click=
"handleCreateModel"
>
新建元模型
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'action'"
>
<TableAction
:actions=
"[
{
// icon: 'clarity:note-edit-line',
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
color: 'error',
label: '删除',
popConfirm: {
title: '是否确认删除',
placement: 'left',
confirm: handleDelete.bind(null, record),
},
},
{
label: '移动',
onClick: handleMove.bind(null, record),
},
]"
/>
</
template
>
</template>
</BasicTable>
<PageWrapper
style=
"height: 100%"
>
<Row>
<Col
:span=
"24"
style=
"height: 800px"
>
<Card>
<BasicTable
@
register=
"registerTable"
minheight:600px
style=
"height: 800px"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleCreateFile"
>
新建文件夹
</a-button>
<a-button
type=
"primary"
@
click=
"handleCreateModel"
>
新建元模型
</a-button>
</
template
>
</BasicTable>
</Card>
</Col>
</Row>
<Row>
<Col
:span=
"24"
style=
"height: 800px"
>
<Card>
<BasicTable
@
register=
"registerTable"
class=
"height"
style=
"height: 800px"
>
<
template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleCreateFile"
>
新建文件夹
</a-button>
<a-button
type=
"primary"
@
click=
"handleCreateModel"
>
新建元模型
</a-button>
</
template
>
</BasicTable>
</Card>
</Col>
</Row>
<Row>
<Col
:span=
"24"
style=
"height: 800px"
>
<Card>
<BasicTable
@
register=
"registerTable"
class=
"height"
minheight:600px
style=
"height: 800px"
>
<
template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleCreateFile"
>
新建文件夹
</a-button>
<a-button
type=
"primary"
@
click=
"handleCreateModel"
>
新建元模型
</a-button>
</
template
>
</BasicTable>
</Card>
</Col>
</Row>
<ModelModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
</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
ModelTree
from
'./ModelTree.vu
e'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage
'
;
import
{
useModal
}
from
'@/components/Modal
'
;
import
ModelModal
from
'./modelModal.vue
'
;
import
{
columns
,
searchFormSchema
}
from
'./model.data
'
;
import
{
useGo
}
from
'@/hooks/web/usePage
'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router
'
;
import
{
useFilterStore
}
from
'@/store/modules/filter
Data'
;
import
{
TreeData
}
from
'@/views/metaModel/knowledgeModel/modelData
'
;
import
{
reactive
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
}
from
'@/components/Table'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useMessage
}
from
'@/hooks/web/useMessag
e'
;
import
{
useModal
}
from
'@/components/Modal
'
;
import
ModelModal
from
'./modelModal.vue
'
;
import
{
columns
,
searchFormSchema
}
from
'./editModel.data
'
;
import
{
useGo
}
from
'@/hooks/web/usePage
'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router
'
;
import
{
useFilterStore
}
from
'@/store/modules/filterData
'
;
import
{
editTableData
}
from
'@/views/metaModel/knowledgeModel/model
Data'
;
import
{
Col
,
Row
,
Card
}
from
'ant-design-vue
'
;
defineOptions
({
name
:
'AccountManagement'
});
const
{
createMessage
}
=
useMessage
();
const
filterStore
=
useFilterStore
();
const
route
=
useRoute
();
const
go
=
useGo
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerAddUserModal
,
{
openModal
:
addUserModal
}]
=
useModal
();
const
[
registerMoveUser
,
{
openModal
:
openMoveUserModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tableData
=
ref
([]);
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
,
getRowSelection
},
]
=
useTable
({
title
:
''
,
api
:
async
(
params
)
=>
{
console
.
log
(
'params:'
,
params
);
const
response
=
{
pageNu
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
var
data
=
[];
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
var
data
=
[];
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
!==
100
);
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
columns
,
rowSelection
:
true
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{
searchInfo
.
modelId
=
''
;
defineOptions
({
name
:
'AccountManagement'
});
const
{
createMessage
}
=
useMessage
();
const
filterStore
=
useFilterStore
();
const
route
=
useRoute
();
const
go
=
useGo
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerAddUserModal
,
{
openModal
:
addUserModal
}]
=
useModal
();
const
[
registerMoveUser
,
{
openModal
:
openMoveUserModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tableData
=
ref
([]);
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
,
getRowSelection
},
]
=
useTable
({
title
:
''
,
api
:
async
(
params
)
=>
{
console
.
log
(
'params:'
,
params
);
const
response
=
{
pageNu
:
'1'
,
pageSize
:
'10'
,
pages
:
'1'
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
//过滤data中的数据,取出等于params.deptId的数据
var
data
=
[];
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
var
data
=
[];
data
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
!==
100
);
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
columns
,
rowSelection
:
false
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
},
useSearchForm
:
false
,
showTableSetting
:
false
,
showIndexColumn
:
false
,
pagination
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
return
info
;
},
actionColumn
:
{
width
:
150
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
},
useSearchForm
:
true
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
return
info
;
},
actionColumn
:
{
width
:
150
,
title
:
'操作'
,
dataIndex
:
'action'
,
},
});
/** 新增元模型*/
function
handleCreateModel
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
/** 新增文件夹
*/
function
handleCreateFile
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
/** 新增元模型
*/
function
handleCreateModel
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
/** 移动按钮*/
function
handleMove
(
record
:
Recordable
)
{
openMoveUserModal
(
true
,
{
record
,
isMove
:
true
,
});
}
/** 新增文件夹*/
function
handleCreateFile
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
/** 编辑
按钮*/
function
handleEdit
(
record
:
Recordable
)
{
open
Modal
(
true
,
{
record
,
isUpdat
e
:
true
,
});
}
/** 移动
按钮*/
function
handleMove
(
record
:
Recordable
)
{
openMoveUser
Modal
(
true
,
{
record
,
isMov
e
:
true
,
});
}
/** 删除按钮*/
function
handleDelete
(
record
:
Recordable
)
{
tableData
.
value
.
splice
(
tableData
.
value
.
findIndex
((
item
)
=>
item
.
businessId
===
record
.
businessId
),
1
,
);
createMessage
.
success
(
'删除成功!'
);
reload
();
}
/** 编辑按钮*/
function
handleEdit
(
record
:
Recordable
)
{
openModal
(
true
,
{
record
,
isUpdate
:
true
,
});
}
/** 新增/编辑成功*/
function
handleSuccess
({
isUpdate
,
values
})
{
if
(
isUpdate
)
{
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
//修改表单的值
const
result
=
updateTableDataRecord
(
values
.
businessId
,
values
);
reload
();
}
else
{
tableData
.
value
.
push
(
values
);
/** 删除按钮*/
function
handleDelete
(
record
:
Recordable
)
{
tableData
.
value
.
splice
(
tableData
.
value
.
findIndex
((
item
)
=>
item
.
businessId
===
record
.
businessId
),
1
,
);
createMessage
.
success
(
'删除成功!'
);
reload
();
}
}
/** 移动*/
function
handleMoveSuccess
({
isMove
,
values
})
{
const
rowSelection
=
getRowSelection
().
selectedRowKeys
;
if
(
rowSelection
.
length
>
0
)
{
//批量移动
for
(
let
i
=
0
;
i
<
rowSelection
.
length
;
i
++
)
{
const
result
=
updateTableDataRecord
(
values
[
i
].
institutionId
,
values
[
i
]);
/** 新增/编辑成功*/
function
handleSuccess
({
isUpdate
,
values
})
{
if
(
isUpdate
)
{
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
//修改表单的值
const
result
=
updateTableDataRecord
(
values
.
businessId
,
values
);
reload
();
}
else
{
tableData
.
value
.
push
(
values
);
reload
();
}
}
else
{
//单个移动
const
result
=
updateTableDataRecord
(
values
.
businessId
,
values
);
}
reload
();
}
/** 部门树的select*/
function
handleSelect
(
modelId
=
''
)
{
searchInfo
.
modelId
=
modelId
;
reload
();
}
/** 移动*/
function
handleMoveSuccess
({
isMove
,
values
})
{
const
rowSelection
=
getRowSelection
().
selectedRowKeys
;
if
(
rowSelection
.
length
>
0
)
{
//批量移动
for
(
let
i
=
0
;
i
<
rowSelection
.
length
;
i
++
)
{
const
result
=
updateTableDataRecord
(
values
[
i
].
institutionId
,
values
[
i
]);
}
}
else
{
//单个移动
const
result
=
updateTableDataRecord
(
values
.
businessId
,
values
);
}
reload
();
}
function
handleView
(
record
:
Recordable
)
{
go
(
'/system/account_detail/'
+
record
.
id
);
}
/** 部门树的select*/
function
handleSelect
(
modelId
=
''
)
{
searchInfo
.
modelId
=
modelId
;
reload
();
}
onMounted
(()
=>
{
tableData
.
value
=
TreeData
;
const
path
=
route
.
path
;
if
(
filterStore
.
getSearchParams
[
path
])
{
if
(
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]
!==
{}))
{
const
params
=
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]);
getForm
().
setFieldsValue
({
page
:
params
.
page
,
pageSize
:
params
.
pageSize
,
username
:
params
.
username
,
flag
:
params
.
flag
,
});
searchInfo
.
institutionId
=
params
.
institutionId
;
}
function
handleView
(
record
:
Recordable
)
{
go
(
'/system/account_detail/'
+
record
.
id
);
}
});
onBeforeRouteLeave
((
to
,
from
,
next
)
=>
{
const
params
=
Object
.
assign
({},
getSearchInfo
(),
getForm
().
getFieldsValue
());
filterStore
.
setSearchParams
({
path
:
from
.
path
,
param
:
{
...
params
,
},
onMounted
(()
=>
{
tableData
.
value
=
editTableData
;
});
onBeforeRouteLeave
((
to
,
from
,
next
)
=>
{
const
params
=
Object
.
assign
({},
getSearchInfo
(),
getForm
().
getFieldsValue
());
filterStore
.
setSearchParams
({
path
:
from
.
path
,
param
:
{
...
params
,
},
});
next
();
// 允许导航
});
next
();
// 允许导航
});
</
script
>
<
style
>
.height
{
.ant-table-container
{
.ant-table-body
{
min-height
:
1000px
;
}
}
}
</
style
>
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