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[]) => 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(

View File

@ -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">
<Ellipsis style="width: calc(100% - 10px)">
<span>
{{ record[dataIndex] }} {{ 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;

View File

@ -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;

View File

@ -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"

View File

@ -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;
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" ><AIcon type="FormOutlined"
/></a> /></a>
</PermissionButton>
</div> </div>
</template> </template>
<template #img> <template #img>
@ -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;

View File

@ -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; //
} }
}, },
); );

View File

@ -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');
} }
}; };