fix: bug#10406、10399、10390、10391、10410、10387、10392、10425、10415、10416、10417、10412、10409、10405

This commit is contained in:
JiangQiming 2023-03-15 17:42:42 +08:00
parent 2aeaae3a50
commit 42df14d815
8 changed files with 63 additions and 41 deletions

View File

@ -10,12 +10,7 @@
@cancel="_vis = false"
:confirmLoading="loading"
>
<pro-search
type="simple"
:columns="columns"
target="media"
@search="handleSearch"
/>
<pro-search :columns="columns" target="media" @search="handleSearch" />
<JProTable
ref="listRef"
@ -23,6 +18,7 @@
:columns="columns"
:request="CascadeApi.queryChannelList"
:defaultParams="{
pageSize: 10,
sorts: [{ name: 'name', order: 'desc' }],
terms: [
{
@ -46,6 +42,10 @@
onSelectAll: onSelectAllChange,
}"
@cancelSelect="_selectedRowKeys = []"
:pagination="{
showSizeChanger: true,
pageSizeOptions: ['10', '20', '50', '100'],
}"
>
<template #headerTitle>
<h3>通道列表</h3>
@ -96,6 +96,7 @@ watch(
() => _vis.value,
(val) => {
if (val) handleSearch({ terms: [] });
else _selectedRowKeys.value = [];
},
);

View File

@ -1,12 +1,7 @@
<!-- 国标级联-通道列表 -->
<template>
<page-container>
<pro-search
type="simple"
:columns="columns"
target="media"
@search="handleSearch"
/>
<pro-search :columns="columns" target="media" @search="handleSearch" />
<JProTable
ref="listRef"
@ -14,6 +9,7 @@
:columns="columns"
:request="(e:any) => CascadeApi.queryBindChannel(route?.query.id as string, e)"
:defaultParams="{
pageSize: 10,
sorts: [{ name: 'name', order: 'desc' }],
}"
:params="params"
@ -23,6 +19,10 @@
onSelectAll: onSelectAllChange,
}"
@cancelSelect="_selectedRowKeys = []"
:pagination="{
showSizeChanger: true,
pageSizeOptions: ['10', '20', '50', '100'],
}"
>
<template #headerTitle>
<h3>通道列表</h3>
@ -50,9 +50,9 @@
</j-space>
</j-tooltip>
</template>
<template #gbChannelId="slotProps">
<template #channelId="slotProps">
<j-space>
<Ellipsis>
<Ellipsis style="width: 150px">
{{ slotProps.gbChannelId }}
</Ellipsis>
<j-popover
@ -73,6 +73,7 @@
<j-input
v-model:value="gbID"
@change="validField(slotProps)"
placeholder="请输入国标ID"
/>
<div
class="error"
@ -179,8 +180,8 @@ const columns = [
},
{
title: '国标ID',
dataIndex: 'gbChannelId',
key: 'gbChannelId',
dataIndex: 'channelId',
key: 'channelId',
scopedSlots: true,
headerCell: 'gbChannelIdHeader', //
search: {
@ -204,7 +205,7 @@ const columns = [
},
},
{
title: '状态',
title: '在线状态',
dataIndex: 'status',
key: 'status',
scopedSlots: true,

View File

@ -17,8 +17,8 @@
message: '请输入名称',
},
{
max: 84,
message: '最多可输入84个字符',
max: 64,
message: '最多可输入64个字符',
},
]"
>
@ -238,6 +238,7 @@
v-model:value="formData.host"
placeholder="请选择IP地址"
:options="allList"
@change="setPorts"
/>
</j-col>
<j-col :span="10">
@ -301,7 +302,7 @@
<j-radio-group
button-style="solid"
v-model:value="formData.transport"
@change="setPorts"
@change="handleTransportChange"
>
<j-radio-button value="UDP">
UDP
@ -616,19 +617,29 @@ const getAllList = async () => {
allList.value = result.map((m: any) => ({
label: m.host,
value: m.host,
...m,
}));
setPorts();
};
getAllList();
const handleTransportChange = () => {
formData.value.host = undefined;
formData.value.port = undefined;
setPorts();
};
/**
* 传输协议改变, 获取对应的端口
* 获取端口
*/
const allListPorts = ref([]);
const setPorts = () => {
allListPorts.value = allList.value.find(
(f: any) => f.host === formData.value.host,
)?.ports[formData.value.transport || ''];
if (!formData.value.host) return;
allListPorts.value = allList.value
.find((f: any) => f.host === formData.value.host)
?.ports[formData.value.transport || '']?.map((m: string) => ({
label: m,
value: m,
}));
};
/**

View File

@ -237,20 +237,12 @@ const handleSearch = (e: any) => {
const lastValueFrom = async (params: any) => {
const res = await CascadeApi.list(params);
res.result.data.forEach(async (item: any) => {
const resp = await queryChannelCount(item.id);
const resp = await CascadeApi.queryBindChannel(item.id, {});
item.count = resp.result.total;
});
return res;
};
/**
* 查询通道数量
* @param id
*/
const queryChannelCount = async (id: string) => {
return await CascadeApi.queryBindChannel(id, {});
};
/**
* 新增
*/

View File

@ -3,13 +3,15 @@
<div class="top-card-content">
<div class="content-left">
<div class="content-left-title">
<span>{{ title }}</span>
<j-tooltip placement="top" v-if="tooltip">
<template #title>
<span>{{ tooltip }}</span>
</template>
<AIcon type="QuestionCircleOutlined" />
</j-tooltip>
<j-space>
<span>{{ title }}</span>
<j-tooltip placement="top" v-if="tooltip">
<template #title>
<span>{{ tooltip }}</span>
</template>
<AIcon type="QuestionCircleOutlined" />
</j-tooltip>
</j-space>
</div>
<div class="content-left-value">{{ value }}</div>
</div>

View File

@ -28,13 +28,18 @@
<JProTable
ref="listRef"
model="table"
:columns="columns"
:request="(e:any) => ChannelApi.list(e, route?.query.id as string)"
:defaultParams="{
pageSize: 10,
sorts: [{ name: 'notifyTime', order: 'desc' }],
}"
:params="params"
model="table"
:pagination="{
showSizeChanger: true,
pageSizeOptions: ['10', '20', '50', '100'],
}"
>
<template #headerTitle>
<j-tooltip

View File

@ -13,6 +13,7 @@
sorts: [{ name: 'createTime', order: 'desc' }],
}"
:params="params"
:gridColumn="3"
>
<template #headerTitle>
<PermissionButton

View File

@ -44,6 +44,7 @@
:columns="columns"
:request="deviceApi.list"
:defaultParams="{
pageSize: 10,
sorts: [{ name: 'createTime', order: 'desc' }],
}"
:params="params"
@ -56,7 +57,14 @@
deviceItem = record;
}
}"
:pagination="{
showSizeChanger: true,
pageSizeOptions: ['10', '20', '50', '100'],
}"
>
<template #channelNumber="slotProps">
<span>{{ slotProps.channelNumber || 0 }}</span>
</template>
<template #state="slotProps">
<a-space>
<a-badge
@ -166,6 +174,7 @@ const columns = [
title: '通道数量',
dataIndex: 'channelNumber',
key: 'channelNumber',
scopedSlots: true,
},
{
title: '状态',