fix: bug#11085、11130、11081、11078、11162 采集器修复部分bug

This commit is contained in:
jackhoo_98 2023-03-28 21:05:15 +08:00
parent dfa9a5ac63
commit 60edb1d11b
7 changed files with 67 additions and 25 deletions

View File

@ -46,8 +46,8 @@ export const readPoint = (collectorId: string, data: string[]) =>
export const writePoint = (collectorId: string, data: string[]) =>
server.post(`/data-collect/collector/${collectorId}/points/_write`, data);
export const queryPointNoPaging = () =>
server.post(`/data-collect/point/_query/no-paging`, { paging: false });
export const queryPointNoPaging = (data: any) =>
server.post(`/data-collect/point/_query/no-paging`, data);
export const scanOpcUAList = (data: any) =>
server.get(

View File

@ -47,7 +47,11 @@
></j-input>
</j-form-item>
<div style="margin: -24px 0 0 10px">
{{ record[dataIndex] }}
<Ellipsis style="width: calc(100% - 10px)">
<span>
{{ record[dataIndex] }}
</span>
</Ellipsis>
</div>
</template>
<template v-if="dataIndex === 'accessModes'">
@ -246,10 +250,8 @@ const changeValue = (index: number, type: string) => {
};
const changeCheckbox = async (index: number, type: string) => {
// console.log(1, getTargetData(index, type).check,getTargetData(index, type));
//Dom setTimeout await nextTick()
setTimeout(() => {
// console.log(2, getTargetData(index, type).check,getTargetData(index, type));
let startIndex = 0;
const { dataSource } = modelRef;
const currentCheck = getTargetData(index, type).check;

View File

@ -54,7 +54,6 @@ const props = defineProps({
const emits = defineEmits(['change']);
const channelId = props.data?.channelId;
const checkedKeys = ref<string[]>([]);
const selectKeys = ref<string[]>([]);
const spinning = ref(false);
@ -166,14 +165,29 @@ const updateTreeData = (list: any, key: string, children: any[]): any[] => {
const getPoint = async () => {
spinning.value = true;
const res: any = await queryPointNoPaging();
const res: any = await queryPointNoPaging({
paging: false,
terms: [
{
terms: [
{
column: 'collectorId',
value: props.data?.id,
},
],
},
],
});
if (res.status === 200) {
selectKeys.value = res.result.map((item: any) => item.pointKey);
}
getScanOpcUAList();
spinning.value = false;
};
getPoint();
onMounted(() => {
getPoint();
});
const getScanOpcUAList = async () => {
spinning.value = true;

View File

@ -1,5 +1,5 @@
<template lang="">
<j-modal title="扫描" :visible="true" width="90%" @cancel="handleCancel">
<j-modal title="扫描" :visible="true" width="95%" @cancel="handleCancel">
<div class="content">
<Tree
:data="treeData"

View File

@ -114,15 +114,37 @@
</template>
<template #action>
<div class="card-box-action">
<j-popconfirm
title="确定删除?"
@confirm="handlDelete(slotProps.id)"
<PermissionButton
type="text"
:tooltip="{
title: '删除',
}"
hasPermission="DataCollect/Collector:delete"
:popConfirm="{
title: `确定删除?`,
onConfirm: () =>
handlDelete(slotProps.id),
}"
>
<a><AIcon type="DeleteOutlined" /></a>
</j-popconfirm>
<a @click="handlEdit(slotProps)"
><AIcon type="FormOutlined"
/></a>
<a
style="
font-size: 20px;
margin-top: -10px;
"
><AIcon type="DeleteOutlined"
/></a>
</PermissionButton>
<PermissionButton
class="add-btn"
type="text"
@click="handlEdit(slotProps)"
hasPermission="DataCollect/Collector:update"
>
<a style="font-size: 20px"
><AIcon type="FormOutlined"
/></a>
</PermissionButton>
</div>
</template>
<template #img>
@ -526,7 +548,7 @@ const saveChange = (value: object) => {
}
};
const onSelectChange = (keys: string[]) => {
const onSelectChange = (keys: string[]) => {
_selectedRowKeys.value = [...keys];
};
@ -647,11 +669,11 @@ const handleSearch = (e: any) => {
color: #474747;
}
.card-box-action {
width: 50px;
width: 90px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 20px;
margin-top: -10px;
}
.card-box-content {
margin-top: 20px;

View File

@ -70,7 +70,7 @@
? '启用'
: '禁用',
}"
hasPermission="DataCollect/Collector:update"
hasPermission="DataCollect/Collector:action"
:popConfirm="{
title:
data?.state?.value === 'disabled'
@ -271,11 +271,13 @@ onMounted(() => {
watch(
() => selectedKeys.value,
(n) => {
(n, p) => {
const key = _.isArray(n) ? n[0] : n;
if (key) {
const row = collectorAll.value.find((i: any) => i.id === key);
emits('change', row);
} else {
selectedKeys.value = p; //
}
},
);

View File

@ -31,7 +31,7 @@
</template>
<template #createTime="slotProps">
<span>{{
moment(slotProps.createTime).format(
dayjs(slotProps.createTime).format(
'YYYY-MM-DD HH:mm:ss',
)
}}</span>
@ -69,7 +69,7 @@
<script lang="ts" setup name="FirmwarePage">
import type { ActionsType } from '@/components/Table/index';
import { query, queryProduct, remove } from '@/api/device/firmware';
import moment from 'moment';
import dayjs from 'dayjs';
import _ from 'lodash';
import Save from './Save/index.vue';
import { useMenuStore } from 'store/menu';
@ -244,9 +244,11 @@ const saveChange = (value: FormDataType) => {
const handlDelete = async (id: string) => {
const res = await remove(id);
if (res.success) {
if (res.status === 200) {
onlyMessage('操作成功', 'success');
tableRef.value.reload();
} else {
onlyMessage(res?.message, 'error');
}
};