From 4ce8a15b6ec0be64cac50c38f5552ef1196a5570 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Mon, 6 Mar 2023 17:42:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=BE=E5=A4=87=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ValueItem/index.vue | 25 +- .../Detail/Diagnose/Message/Dialog/index.vue | 17 +- .../Diagnose/Message/Function/EditTable.vue | 6 +- .../Diagnose/Message/Function/index.vue | 90 +++--- .../Detail/Diagnose/Message/Log/index.vue | 107 +++++++- .../Detail/Diagnose/Message/index.vue | 24 +- .../Diagnose/Status/DiagnosticAdvice.tsx | 15 +- .../Diagnose/Status/ManualInspection.tsx | 108 ++++---- .../Instance/Detail/Diagnose/Status/index.tsx | 99 ++++++- .../device/Instance/Detail/Diagnose/index.vue | 6 +- .../Detail/Info/components/Config/Save.vue | 4 +- .../Detail/Info/components/Config/index.vue | 2 +- .../Detail/Info/components/Relation/Save.vue | 2 +- .../Detail/Info/components/Tags/Save.vue | 2 +- .../device/Instance/Detail/Log/index.vue | 8 +- .../Instance/Detail/Running/Event/index.vue | 43 ++- .../Detail/Running/Property/Detail/Charts.vue | 38 +-- .../Running/Property/Detail/PropertyAMap.vue | 12 +- .../Detail/Running/Property/Detail/Table.vue | 33 ++- .../Running/Property/Detail/TimeComponent.vue | 16 +- .../Detail/Running/Property/Detail/index.vue | 20 +- .../Detail/Running/Property/Indicators.vue | 208 ++++++++------ .../Detail/Running/Property/PropertyCard.vue | 20 +- .../Instance/Detail/Running/Property/Save.vue | 19 +- .../Detail/Running/Property/ValueDetail.vue | 6 +- .../Detail/Running/Property/ValueRender.vue | 258 +++++++++++------- .../Detail/Running/Property/index.vue | 80 ++---- .../components/BindParentDevice/index.vue | 175 ++++++++++++ .../components/EditTable/PatchMapping.vue | 34 +-- .../Detail/components/EditTable/index.vue | 68 ++--- .../Instance/Detail/components/MSelect.vue | 8 +- src/views/device/Instance/Detail/index.vue | 26 +- src/views/device/Instance/Import/index.vue | 2 +- src/views/device/Instance/Process/index.vue | 8 +- src/views/device/Instance/Save/index.vue | 2 +- src/views/device/Instance/index.vue | 25 +- yarn.lock | 4 +- 37 files changed, 1061 insertions(+), 559 deletions(-) create mode 100644 src/views/device/Instance/Detail/components/BindParentDevice/index.vue diff --git a/src/components/ValueItem/index.vue b/src/components/ValueItem/index.vue index 3e7528ae..ecd0ac16 100644 --- a/src/components/ValueItem/index.vue +++ b/src/components/ValueItem/index.vue @@ -1,14 +1,14 @@ - - - - - + - - - + - - + - - + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Diagnose/Message/index.vue b/src/views/device/Instance/Detail/Diagnose/Message/index.vue index bac6d51c..f5bed24d 100644 --- a/src/views/device/Instance/Detail/Diagnose/Message/index.vue +++ b/src/views/device/Instance/Detail/Diagnose/Message/index.vue @@ -1,20 +1,20 @@ - - - - + + + + - {{ item.text }} - - + + @@ -26,8 +26,8 @@ - - + + @@ -38,11 +38,11 @@ :key="item.key" /> - + - - + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Event/index.vue b/src/views/device/Instance/Detail/Running/Event/index.vue index a9e169ad..3059d3bf 100644 --- a/src/views/device/Instance/Detail/Running/Event/index.vue +++ b/src/views/device/Instance/Detail/Running/Event/index.vue @@ -1,28 +1,30 @@ - - + - {{ moment(slotProps.timestamp).format('YYYY-MM-DD HH:mm:ss') }} + {{ dayjs(slotProps.timestamp).format('YYYY-MM-DD HH:mm:ss') }} - + - + - + \ No newline at end of file + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue b/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue index 57c25647..6b7f6571 100644 --- a/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue +++ b/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue @@ -1,36 +1,36 @@ - + - + 统计周期: - - 实际值 + 实际值 - 按分钟统计 - 按小时统计 - 按天统计 - 按周统计 - 按月统计 - + 按分钟统计 + 按小时统计 + 按天统计 + 按周统计 + 按月统计 + 统计规则: - - 平均值 - 最大值 - 最小值 - 总数 - + + 平均值 + 最大值 + 最小值 + 总数 + - + - + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Property/index.vue b/src/views/device/Instance/Detail/Running/Property/index.vue index f0d6036a..fd9db835 100644 --- a/src/views/device/Instance/Detail/Running/Property/index.vue +++ b/src/views/device/Instance/Detail/Running/Property/index.vue @@ -2,7 +2,8 @@ @@ -58,26 +59,6 @@ - - - @@ -107,6 +88,7 @@ import { message } from 'ant-design-vue'; import { getWebSocket } from '@/utils/websocket'; import { map } from 'rxjs/operators'; import { queryDashboard } from '@/api/comm'; + const columns = [ { title: '名称', @@ -142,9 +124,6 @@ const _data = defineProps({ const value = ref(''); const dataSource = ref([]); const _dataSource = ref([]); -const pageIndex = ref(0); -const pageSize = ref(8); -const total = ref(0); const editVisible = ref(false); // 编辑 const detailVisible = ref(false); // 详情 const currentInfo = ref>({}); @@ -152,6 +131,9 @@ const instanceStore = useInstanceStore(); const indicatorVisible = ref(false); // 指标 const loading = ref(false); const propertyValue = ref>({}); +const _params = reactive({ + name: '', +}); const subRef = ref(); @@ -309,39 +291,35 @@ const getDashboard = async () => { loading.value = false; }; -const query = (page: number, size: number, value: string) => { - pageIndex.value = page || 0; - pageSize.value = size || 8; - const _from = pageIndex.value * pageSize.value; - const _to = (pageIndex.value + 1) * pageSize.value; - const arr = _.cloneDeep(_dataSource.value); - if (unref(value)) { - const li = arr.filter((i: any) => { - return i?.name.indexOf(unref(value)) !== -1; +const query = (params: Record) => + new Promise((resolve) => { + const _from = params.pageIndex * params.pageSize; + const _to = (params.pageIndex + 1) * params.pageSize; + let arr = _.cloneDeep(_dataSource.value); + if (params?.name) { + const li = _dataSource.value.filter((i: any) => { + return i?.name.indexOf(params.name) !== -1; + }); + arr = _.cloneDeep(li); + } + resolve({ + result: { + data: arr.slice(_from, _to), + pageIndex: params.pageIndex || 0, + pageSize: params.pageSize || 12, + total: arr.length, + }, + status: 200, }); - dataSource.value = li.slice(_from, _to); - total.value = li.length; - } else { - dataSource.value = arr.slice(_from, _to); - total.value = arr.length; - } - getDashboard(); -}; - -const pageChange = (page: number, size: number) => { - if (size === pageSize.value) { - query(page - 1, size, value.value); - } else { - query(0, size, value.value); - } -}; + getDashboard(); + }); watch( () => _data.data, (newVal) => { if (newVal.length) { _dataSource.value = newVal as PropertyData[]; - query(0, 8, value.value); + _params.name = ''; } }, { @@ -351,7 +329,7 @@ watch( ); const onSearch = () => { - query(0, 8, value.value); + _params.name = value.value; }; onUnmounted(() => { diff --git a/src/views/device/Instance/Detail/components/BindParentDevice/index.vue b/src/views/device/Instance/Detail/components/BindParentDevice/index.vue new file mode 100644 index 00000000..4d2a4cd6 --- /dev/null +++ b/src/views/device/Instance/Detail/components/BindParentDevice/index.vue @@ -0,0 +1,175 @@ + + + + + + + {{ + slotProps.registryTime + ? dayjs(slotProps.registryTime).format( + 'YYYY-MM-DD HH:mm:ss', + ) + : '' + }} + + + + + + + + + + + diff --git a/src/views/device/Instance/Detail/components/EditTable/PatchMapping.vue b/src/views/device/Instance/Detail/components/EditTable/PatchMapping.vue index 2597cd04..add45b11 100644 --- a/src/views/device/Instance/Detail/components/EditTable/PatchMapping.vue +++ b/src/views/device/Instance/Detail/components/EditTable/PatchMapping.vue @@ -1,5 +1,5 @@ - 采集器的点位名称与属性名称一致时将自动映射绑定;有多个采集器点位名称与属性名称一致时以第1个采集器的点位数据进行绑定 - + - - + - + - 加入右侧加入右侧 - - + - + {{ item.title }} - - + - + - - + + - + - + \ No newline at end of file diff --git a/src/views/device/Instance/Process/index.vue b/src/views/device/Instance/Process/index.vue index 7dda3761..05b405ac 100644 --- a/src/views/device/Instance/Process/index.vue +++ b/src/views/device/Instance/Process/index.vue @@ -1,12 +1,12 @@ - + - - + + 总数量:{{count}} {{errMessage}} - + diff --git a/yarn.lock b/yarn.lock index 1bda2b9a..40dff6cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3903,8 +3903,8 @@ jetlinks-store@^0.0.3: jetlinks-ui-components@^1.0.4: version "1.0.4" - resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.4.tgz#31f6879f83d394ba45bfd6e94ce0b20de817d490" - integrity sha512-5X26+GsqsduCUSmlaYOAw/MDwKRsZFnifzzRqHcm5qbCi0KrrkID9aKatsMRaeTVEEca1/nzPaPGgXAo6bEpfQ== + resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.4.tgz#418d9218c2d0076b4a16606eb87ea755db303409" + integrity sha512-7c509Xx4YVamM/R6Xg62iIOxh2gWz8ASKCN2Pa8lU2CP1n+Vn5Xi5Q0fpd0AiFdi1QadssGaGUkpzbqCqWXLsQ== dependencies: "@vueuse/core" "^9.12.0" ant-design-vue "^3.2.15"
总数量:{{count}}