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}}