fix: bug#11085、11130、11081、11078、11162 采集器修复部分bug
This commit is contained in:
parent
dfa9a5ac63
commit
60edb1d11b
|
@ -46,8 +46,8 @@ export const readPoint = (collectorId: string, data: string[]) =>
|
||||||
export const writePoint = (collectorId: string, data: string[]) =>
|
export const writePoint = (collectorId: string, data: string[]) =>
|
||||||
server.post(`/data-collect/collector/${collectorId}/points/_write`, data);
|
server.post(`/data-collect/collector/${collectorId}/points/_write`, data);
|
||||||
|
|
||||||
export const queryPointNoPaging = () =>
|
export const queryPointNoPaging = (data: any) =>
|
||||||
server.post(`/data-collect/point/_query/no-paging`, { paging: false });
|
server.post(`/data-collect/point/_query/no-paging`, data);
|
||||||
|
|
||||||
export const scanOpcUAList = (data: any) =>
|
export const scanOpcUAList = (data: any) =>
|
||||||
server.get(
|
server.get(
|
||||||
|
|
|
@ -47,7 +47,11 @@
|
||||||
></j-input>
|
></j-input>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<div style="margin: -24px 0 0 10px">
|
<div style="margin: -24px 0 0 10px">
|
||||||
{{ record[dataIndex] }}
|
<Ellipsis style="width: calc(100% - 10px)">
|
||||||
|
<span>
|
||||||
|
{{ record[dataIndex] }}
|
||||||
|
</span>
|
||||||
|
</Ellipsis>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="dataIndex === 'accessModes'">
|
<template v-if="dataIndex === 'accessModes'">
|
||||||
|
@ -246,10 +250,8 @@ const changeValue = (index: number, type: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeCheckbox = async (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() 处理
|
//Dom未更新完成,需要用 setTimeout 或者 await nextTick() 处理
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// console.log(2, getTargetData(index, type).check,getTargetData(index, type));
|
|
||||||
let startIndex = 0;
|
let startIndex = 0;
|
||||||
const { dataSource } = modelRef;
|
const { dataSource } = modelRef;
|
||||||
const currentCheck = getTargetData(index, type).check;
|
const currentCheck = getTargetData(index, type).check;
|
||||||
|
|
|
@ -54,7 +54,6 @@ const props = defineProps({
|
||||||
const emits = defineEmits(['change']);
|
const emits = defineEmits(['change']);
|
||||||
|
|
||||||
const channelId = props.data?.channelId;
|
const channelId = props.data?.channelId;
|
||||||
|
|
||||||
const checkedKeys = ref<string[]>([]);
|
const checkedKeys = ref<string[]>([]);
|
||||||
const selectKeys = ref<string[]>([]);
|
const selectKeys = ref<string[]>([]);
|
||||||
const spinning = ref(false);
|
const spinning = ref(false);
|
||||||
|
@ -166,14 +165,29 @@ const updateTreeData = (list: any, key: string, children: any[]): any[] => {
|
||||||
|
|
||||||
const getPoint = async () => {
|
const getPoint = async () => {
|
||||||
spinning.value = true;
|
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) {
|
if (res.status === 200) {
|
||||||
selectKeys.value = res.result.map((item: any) => item.pointKey);
|
selectKeys.value = res.result.map((item: any) => item.pointKey);
|
||||||
}
|
}
|
||||||
getScanOpcUAList();
|
getScanOpcUAList();
|
||||||
spinning.value = false;
|
spinning.value = false;
|
||||||
};
|
};
|
||||||
getPoint();
|
|
||||||
|
onMounted(() => {
|
||||||
|
getPoint();
|
||||||
|
});
|
||||||
|
|
||||||
const getScanOpcUAList = async () => {
|
const getScanOpcUAList = async () => {
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template lang="">
|
<template lang="">
|
||||||
<j-modal title="扫描" :visible="true" width="90%" @cancel="handleCancel">
|
<j-modal title="扫描" :visible="true" width="95%" @cancel="handleCancel">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<Tree
|
<Tree
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
|
|
|
@ -114,15 +114,37 @@
|
||||||
</template>
|
</template>
|
||||||
<template #action>
|
<template #action>
|
||||||
<div class="card-box-action">
|
<div class="card-box-action">
|
||||||
<j-popconfirm
|
<PermissionButton
|
||||||
title="确定删除?"
|
type="text"
|
||||||
@confirm="handlDelete(slotProps.id)"
|
:tooltip="{
|
||||||
|
title: '删除',
|
||||||
|
}"
|
||||||
|
hasPermission="DataCollect/Collector:delete"
|
||||||
|
:popConfirm="{
|
||||||
|
title: `确定删除?`,
|
||||||
|
onConfirm: () =>
|
||||||
|
handlDelete(slotProps.id),
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<a><AIcon type="DeleteOutlined" /></a>
|
<a
|
||||||
</j-popconfirm>
|
style="
|
||||||
<a @click="handlEdit(slotProps)"
|
font-size: 20px;
|
||||||
><AIcon type="FormOutlined"
|
margin-top: -10px;
|
||||||
/></a>
|
"
|
||||||
|
><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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #img>
|
<template #img>
|
||||||
|
@ -526,7 +548,7 @@ const saveChange = (value: object) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSelectChange = (keys: string[]) => {
|
const onSelectChange = (keys: string[]) => {
|
||||||
_selectedRowKeys.value = [...keys];
|
_selectedRowKeys.value = [...keys];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -647,11 +669,11 @@ const handleSearch = (e: any) => {
|
||||||
color: #474747;
|
color: #474747;
|
||||||
}
|
}
|
||||||
.card-box-action {
|
.card-box-action {
|
||||||
width: 50px;
|
width: 90px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 20px;
|
margin-top: -10px;
|
||||||
}
|
}
|
||||||
.card-box-content {
|
.card-box-content {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
? '启用'
|
? '启用'
|
||||||
: '禁用',
|
: '禁用',
|
||||||
}"
|
}"
|
||||||
hasPermission="DataCollect/Collector:update"
|
hasPermission="DataCollect/Collector:action"
|
||||||
:popConfirm="{
|
:popConfirm="{
|
||||||
title:
|
title:
|
||||||
data?.state?.value === 'disabled'
|
data?.state?.value === 'disabled'
|
||||||
|
@ -271,11 +271,13 @@ onMounted(() => {
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => selectedKeys.value,
|
() => selectedKeys.value,
|
||||||
(n) => {
|
(n, p) => {
|
||||||
const key = _.isArray(n) ? n[0] : n;
|
const key = _.isArray(n) ? n[0] : n;
|
||||||
if (key) {
|
if (key) {
|
||||||
const row = collectorAll.value.find((i: any) => i.id === key);
|
const row = collectorAll.value.find((i: any) => i.id === key);
|
||||||
emits('change', row);
|
emits('change', row);
|
||||||
|
} else {
|
||||||
|
selectedKeys.value = p; // 防止取消
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</template>
|
</template>
|
||||||
<template #createTime="slotProps">
|
<template #createTime="slotProps">
|
||||||
<span>{{
|
<span>{{
|
||||||
moment(slotProps.createTime).format(
|
dayjs(slotProps.createTime).format(
|
||||||
'YYYY-MM-DD HH:mm:ss',
|
'YYYY-MM-DD HH:mm:ss',
|
||||||
)
|
)
|
||||||
}}</span>
|
}}</span>
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
<script lang="ts" setup name="FirmwarePage">
|
<script lang="ts" setup name="FirmwarePage">
|
||||||
import type { ActionsType } from '@/components/Table/index';
|
import type { ActionsType } from '@/components/Table/index';
|
||||||
import { query, queryProduct, remove } from '@/api/device/firmware';
|
import { query, queryProduct, remove } from '@/api/device/firmware';
|
||||||
import moment from 'moment';
|
import dayjs from 'dayjs';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import Save from './Save/index.vue';
|
import Save from './Save/index.vue';
|
||||||
import { useMenuStore } from 'store/menu';
|
import { useMenuStore } from 'store/menu';
|
||||||
|
@ -244,9 +244,11 @@ const saveChange = (value: FormDataType) => {
|
||||||
|
|
||||||
const handlDelete = async (id: string) => {
|
const handlDelete = async (id: string) => {
|
||||||
const res = await remove(id);
|
const res = await remove(id);
|
||||||
if (res.success) {
|
if (res.status === 200) {
|
||||||
onlyMessage('操作成功', 'success');
|
onlyMessage('操作成功', 'success');
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
|
} else {
|
||||||
|
onlyMessage(res?.message, 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue