fix: bug#16358、16366、16374、16375、16379、16385

This commit is contained in:
leiqiaochu 2023-07-14 16:21:43 +08:00
parent b1b09150ff
commit 5998fe7409
5 changed files with 58 additions and 20 deletions

View File

@ -1,14 +1,14 @@
<template>
<div>
<j-dropdown placement="bottomRight">
<div style="cursor: pointer;height: 100%;">
<div style="cursor: pointer;height: 100%;white-space: nowrap;overflow: hidden;text-overflow:ellipsis; max-width: 170px;" >
<j-avatar
:src="userInfo.userInfos?.avatar"
alt=""
:size="24"
style="margin-right: 12px"
/>
<span>{{ userInfo.userInfos?.name }}</span>
<span>{{ userInfo.userInfos?.name }}</span>
</div>
<template #overlay>
<j-menu>
@ -43,4 +43,5 @@ const logOut = () => {
};
</script>
<style scoped></style>
<style scoped>
</style>

View File

@ -8,10 +8,10 @@
@change="onChange"
:pagination="{
current: (dataSource?.pageIndex || 0) + 1,
pageSize: dataSource?.pageSize || 10,
pageSize: dataSource?.pageSize || 12,
showSizeChanger: true,
total: dataSource?.total || 0,
pageSizeOptions: ['8', '12', '24', '60', '100']
pageSizeOptions: ['12', '24', '48', '96']
}"
>
<template #bodyCell="{ column, record }">
@ -92,7 +92,7 @@ const _props = defineProps({
const instanceStore = useInstanceStore();
const dataSource = ref({
pageIndex: 0,
pageSize: 10,
pageSize: 12,
data: [],
total: 0
});
@ -158,7 +158,7 @@ watch(
([newVal]) => {
if (newVal) {
queryPropertyData({
pageSize: _props.data.valueType?.type === 'file' ? 5 : 10,
pageSize: 12,
pageIndex: 0,
});
}

View File

@ -57,7 +57,6 @@
<Ellipsis
style="
width: calc(100% - 100px);
margin-bottom: 20px;
"
>
<span class="card-title">
@ -113,16 +112,15 @@
<Ellipsis
style="
width: calc(100% - 10px);
display: flex;
margin-top: 4px;
"
:lineClamp="2"
>
<span>
<div>
{{
slotProps.protocolDetail
.name
}}
</span>
</div>
</Ellipsis>
</j-col>
</j-row>

View File

@ -14,7 +14,9 @@
:params="params"
:rowSelection="{
selectedRowKeys: _selectedRowKeys,
onChange: onSelectChange,
onSelect: onSelectChange,
onSelectAll: selectAll,
onSelectNone: cancelSelectAll,
}"
>
<template #headerTitle>
@ -246,10 +248,44 @@ const listRef = ref();
const _selectedRowKeys = ref<string[]>([]);
const bindVis = ref(false);
const onSelectChange = (keys: string[]) => {
_selectedRowKeys.value = [...keys];
const channelIdMap = new Map();
const onSelectChange = (row: any,selected:Boolean) => {
const arr = new Set(_selectedRowKeys.value);
if(selected){
arr.add(row.id)
channelIdMap.set(row.id,row.channelId)
}else{
arr.delete(row.id)
channelIdMap.delete(row.id)
}
_selectedRowKeys.value = [...arr.values()];
};
const selectAll = (selected: Boolean, selectedRows: any,changeRows:any) => {
if (selected) {
changeRows.map((i: any) => {
if (!_selectedRowKeys.value.includes(i.id)) {
_selectedRowKeys.value.push(i.id)
channelIdMap.set(i.id,i.channelId)
}
})
} else {
const arr = changeRows.map((item: any) => item.id)
const _ids: string[] = [];
_selectedRowKeys.value.map((i: any) => {
if (!arr.includes(i)) {
_ids.push(i)
}else{
channelIdMap.delete(i)
}
})
_selectedRowKeys.value = _ids;
}
}
const cancelSelectAll = () =>{
_selectedRowKeys.value = [];
channelIdMap.clear();
}
/**
* 表格操作按钮
* @param data 表格数据项
@ -296,15 +332,16 @@ const handleMultipleUnbind = async () => {
onlyMessage('请先选择需要解绑的通道列表', 'error');
return;
}
const channelIds = listRef.value?._dataSource
.filter((f: any) => _selectedRowKeys.value.includes(f.id))
.map((m: any) => m.channelId);
// const channelIds = listRef.value?._dataSource
// .filter((f: any) => _selectedRowKeys.value.includes(f.id))
// .map((m: any) => m.channelId);
const resp = await CascadeApi.unbindChannel(
route.query.id as string,
channelIds,
[...channelIdMap.values()]
);
if (resp.success) {
onlyMessage('操作成功!');
_selectedRowKeys.value = []
listRef.value?.reload();
} else {
onlyMessage('操作失败!', 'error');

View File

@ -46,9 +46,11 @@
</slot>
</template>
<template #content>
<h3 class="card-item-content-title">
<Ellipsis style="width: calc(100% - 100px);">
<h3 style="font-size: 16px;font-weight: 700;color: #315efb;">
{{ slotProps.name }}
</h3>
</Ellipsis>
<j-row>
<j-col :span="12">
<div class="card-item-content-text">