Commit 50c3782ebfc173c28f5f74fd42922e4c0301e909

Authored by fengtao
2 parents c3ba1db0 fc683030

Merge branch 'main' into ft_local_dev

... ... @@ -14,9 +14,9 @@ VITE_PUBLIC_PATH = /
14 14 # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]]
15 15 # 线上测试环境
16 16 # VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]]
17   -# VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-drawio","http://localhost:3000/"]]
  17 +VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-drawio","http://localhost:3000/"]]
18 18 # VITE_PROXY = [["/api","http://121.37.251.8:8080/api"],["/thingskit-drawio","http://localhost:3000/"]]
19   -VITE_PROXY = [["/api","http://192.168.10.103:8080/api"],["/thingskit-drawio","http://192.168.10.136:8080/api"]]
  19 +# VITE_PROXY = [["/api","http://192.168.10.103:8080/api"],["/thingskit-drawio","http://192.168.10.136:8080/api"]]
20 20
21 21 # 实时数据的ws地址
22 22 # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token=
... ...
... ... @@ -230,7 +230,7 @@
230 230 <Dropdown
231 231 :dropMenuList="[
232 232 {
233   - text: '设计',
  233 + text: '编辑',
234 234 auth: 'api:yt:configuration:center:update',
235 235 icon: 'clarity:note-edit-line',
236 236 onClick: handleCreateOrUpdate.bind(null, item),
... ...
... ... @@ -219,7 +219,6 @@
219 219 });
220 220 send(sendValue);
221 221 send(sendValue1);
222   - console.log('建立连接了');
223 222 },
224 223 onMessage(_, e) {
225 224 const { data, update } = JSON.parse(e.data);
... ... @@ -471,14 +470,17 @@
471 470 justify-content: center;
472 471 font-size: 16px;
473 472 }
  473 +
474 474 .active {
475 475 color: #0960bd;
476 476 font-weight: 500;
477 477 }
  478 +
478 479 .extra-date {
479 480 display: flex;
480 481 align-items: center;
481 482 justify-content: space-between;
  483 +
482 484 span {
483 485 margin-right: 20px;
484 486 cursor: pointer;
... ...
... ... @@ -63,7 +63,6 @@
63 63 watch(
64 64 () => props.alarmList,
65 65 (newValue) => {
66   - console.log({ newValue, props });
67 66 let alarmTotal = 0;
68 67 for (const item of props.alarmList) {
69 68 alarmTotal += Number(item[1]);
... ...
... ... @@ -49,6 +49,12 @@ export const step1Schemas: FormSchema[] = [
49 49 show: false,
50 50 },
51 51 {
  52 + field: 'deviceProfileId',
  53 + label: '',
  54 + component: 'Input',
  55 + show: false,
  56 + },
  57 + {
52 58 field: 'profileId',
53 59 label: '所属产品',
54 60 required: true,
... ... @@ -59,9 +65,12 @@ export const step1Schemas: FormSchema[] = [
59 65 api: deviceProfile,
60 66 labelField: 'name',
61 67 valueField: 'tbProfileId',
62   - onChange(_value: string, option: { deviceType: string; transportType: string }) {
63   - const { deviceType, transportType } = option;
64   - setFieldsValue({ deviceType: deviceType, transportType });
  68 + onChange(
  69 + _value: string,
  70 + option: { deviceType: string; transportType: string; id: string }
  71 + ) {
  72 + const { deviceType, transportType, id } = option;
  73 + setFieldsValue({ deviceType: deviceType, transportType, deviceProfileId: id });
65 74 },
66 75 };
67 76 },
... ...
... ... @@ -32,7 +32,7 @@
32 32 }
33 33
34 34 const props = defineProps<{
35   - deviceDetail: Record<'tbDeviceId' | 'profileId' | 'id', string>;
  35 + deviceDetail: Record<'tbDeviceId' | 'profileId' | 'id' | 'deviceProfileId', string>;
36 36 }>();
37 37
38 38 const grid = {
... ... @@ -137,8 +137,8 @@
137 137
138 138 const { send, close, data } = useWebSocket(socketInfo.origin, {
139 139 async onConnected() {
140   - const { id, profileId } = props.deviceDetail;
141   - const value = await getDeviceAttrs(profileId, id);
  140 + const { id, deviceProfileId } = props.deviceDetail;
  141 + const value = await getDeviceAttrs(deviceProfileId, id);
142 142 socketInfo.attrKeys = value;
143 143 send(JSON.stringify(unref(getSendValue)));
144 144 },
... ...
... ... @@ -28,7 +28,7 @@ export const formSchema: FormSchema[] = [
28 28 },
29 29 },
30 30 {
31   - field: 'profileId',
  31 + field: 'deviceProfileId',
32 32 label: '',
33 33 component: 'ApiSelect',
34 34 componentProps: {
... ...
... ... @@ -13,6 +13,9 @@
13 13 <div class="absolute w-full h-full top-0 cursor-not-allowed"></div>
14 14 </div>
15 15 </Tabs.TabPane>
  16 + <Tabs.TabPane key="topic" tab="Topic">
  17 + <TopicPanel />
  18 + </Tabs.TabPane>
16 19 <Tabs.TabPane key="modelOfMatter" tab="物模型管理">
17 20 <PhysicalModelManagementStep :record="record" />
18 21 </Tabs.TabPane>
... ... @@ -28,10 +31,11 @@
28 31 import { ref, unref } from 'vue';
29 32 import { deviceConfigGetDetail } from '/@/api/device/deviceConfigApi';
30 33 import { DeviceRecord } from '/@/api/device/model/deviceModel';
  34 + import TopicPanel from './step/TopicPanel.vue';
31 35
32 36 defineEmits(['register']);
33 37
34   - type ActiveKey = 'product' | 'transport' | 'modelOfMatter';
  38 + type ActiveKey = 'product' | 'transport' | 'modelOfMatter' | 'topic';
35 39
36 40 const activeKey = ref<ActiveKey>('modelOfMatter');
37 41
... ...
... ... @@ -439,3 +439,26 @@ export const formSchema: FormSchema[] = [
439 439 },
440 440 },
441 441 ];
  442 +
  443 +export const topicTableColumn: BasicColumn[] = [
  444 + {
  445 + title: '功能',
  446 + dataIndex: 'function',
  447 + width: 100,
  448 + },
  449 + {
  450 + title: 'Topic类',
  451 + dataIndex: 'class',
  452 + width: 100,
  453 + },
  454 + {
  455 + title: '操作权限',
  456 + dataIndex: 'access',
  457 + width: 100,
  458 + },
  459 + {
  460 + title: '描述',
  461 + dataIndex: 'description',
  462 + width: 100,
  463 + },
  464 +];
... ...
  1 +<script lang="ts" setup>
  2 + import { topicTableColumn } from '../device.profile.data';
  3 + import { BasicTable, useTable } from '/@/components/Table';
  4 + const [register] = useTable({
  5 + title: 'Topic',
  6 + columns: topicTableColumn,
  7 + bordered: true,
  8 + showTableSetting: true,
  9 + });
  10 +</script>
  11 +
  12 +<template>
  13 + <section class="bg-gray-100 p-4 dark:bg-dark-900 w-full h-full">
  14 + <BasicTable @register="register" />
  15 + </section>
  16 +</template>
... ...