Commit 3c854a1722e01d220868c139d5460f0a35396b86

Authored by xp.Huang
2 parents 7822d425 c39fa33f

Merge branch 'ww' into 'main'

fix: BUG in teambition

See merge request huang/yun-teng-iot-front!411
@@ -25,7 +25,7 @@ export const step1Schemas: FormSchema[] = [ @@ -25,7 +25,7 @@ export const step1Schemas: FormSchema[] = [
25 colProps: { span: 14 }, 25 colProps: { span: 14 },
26 componentProps: { 26 componentProps: {
27 placeholder: '设备名称', 27 placeholder: '设备名称',
28 - maxLength: 30, 28 + maxLength: 255,
29 }, 29 },
30 }, 30 },
31 { 31 {
@@ -34,6 +34,9 @@ export const step1Schemas: FormSchema[] = [ @@ -34,6 +34,9 @@ export const step1Schemas: FormSchema[] = [
34 component: 'Input', 34 component: 'Input',
35 labelWidth: 60, 35 labelWidth: 60,
36 colProps: { span: 10 }, 36 colProps: { span: 10 },
  37 + componentProps: {
  38 + maxLength: 255,
  39 + },
37 }, 40 },
38 { 41 {
39 field: 'sn', 42 field: 'sn',
@@ -8,6 +8,8 @@ import moment from 'moment'; @@ -8,6 +8,8 @@ import moment from 'moment';
8 import { h } from 'vue'; 8 import { h } from 'vue';
9 import { Button } from 'ant-design-vue'; 9 import { Button } from 'ant-design-vue';
10 import { TypeEnum } from './data'; 10 import { TypeEnum } from './data';
  11 +import { PageEnum } from '/@/enums/pageEnum';
  12 +import { useGo } from '/@/hooks/web/usePage';
11 13
12 // 设备详情的描述 14 // 设备详情的描述
13 export const descSchema = (emit: EmitType): DescItem[] => { 15 export const descSchema = (emit: EmitType): DescItem[] => {
@@ -27,11 +29,15 @@ export const descSchema = (emit: EmitType): DescItem[] => { @@ -27,11 +29,15 @@ export const descSchema = (emit: EmitType): DescItem[] => {
27 { 29 {
28 field: 'deviceProfile.name', 30 field: 'deviceProfile.name',
29 label: '产品', 31 label: '产品',
30 - render(val, data) {  
31 - if (TypeEnum.SENSOR !== data.deviceType) return val; 32 + render(val) {
  33 + const go = useGo();
32 return h( 34 return h(
33 Button, 35 Button,
34 - { type: 'link', style: { padding: 0 }, onClick: () => emit('open-gateway-device', data) }, 36 + {
  37 + type: 'link',
  38 + style: { padding: 0 },
  39 + onClick: () => go(PageEnum.DEVICE_PROFILE + '?name=' + String(val)),
  40 + },
35 { default: () => val } 41 { default: () => val }
36 ); 42 );
37 }, 43 },
@@ -40,6 +46,14 @@ export const descSchema = (emit: EmitType): DescItem[] => { @@ -40,6 +46,14 @@ export const descSchema = (emit: EmitType): DescItem[] => {
40 field: 'gatewayName', 46 field: 'gatewayName',
41 label: '所属网关', 47 label: '所属网关',
42 show: (data) => !!data.gatewayName, 48 show: (data) => !!data.gatewayName,
  49 + render(val, data) {
  50 + if (TypeEnum.SENSOR !== data.deviceType) return val;
  51 + return h(
  52 + Button,
  53 + { type: 'link', style: { padding: 0 }, onClick: () => emit('open-gateway-device', data) },
  54 + { default: () => val }
  55 + );
  56 + },
43 }, 57 },
44 { 58 {
45 field: 'deviceType', 59 field: 'deviceType',
@@ -47,8 +47,8 @@ @@ -47,8 +47,8 @@
47 </div> 47 </div>
48 </BasicModal> 48 </BasicModal>
49 </div> 49 </div>
50 - <Description @register="register" class="mt-4" :data="deviceDetail" /> </div  
51 - >设备Topic 50 + <Description @register="register" class="mt-4" :data="deviceDetail" />
  51 + </div>
52 <div class="mt-4"> 52 <div class="mt-4">
53 <a-button type="primary" class="mr-4" @click="copyTbDeviceId">复制设备ID</a-button> 53 <a-button type="primary" class="mr-4" @click="copyTbDeviceId">复制设备ID</a-button>
54 <a-button type="primary" class="mr-4" @click="copyDeviceToken">复制访问令牌</a-button> 54 <a-button type="primary" class="mr-4" @click="copyDeviceToken">复制访问令牌</a-button>
@@ -292,5 +292,6 @@ @@ -292,5 +292,6 @@
292 <style> 292 <style>
293 .history-modal .ant-input-number { 293 .history-modal .ant-input-number {
294 min-width: 0 !important; 294 min-width: 0 !important;
  295 + width: 100% !important;
295 } 296 }
296 </style> 297 </style>
@@ -2,14 +2,14 @@ @@ -2,14 +2,14 @@
2 import { BasicForm, useForm } from '/@/components/Form'; 2 import { BasicForm, useForm } from '/@/components/Form';
3 import { defaultSchemas, SchemaFiled } from './config'; 3 import { defaultSchemas, SchemaFiled } from './config';
4 import { onMounted } from 'vue'; 4 import { onMounted } from 'vue';
  5 + import { useGridLayout } from '/@/hooks/component/useGridLayout';
  6 + import { ColEx } from '/@/components/Form/src/types';
5 7
6 const emit = defineEmits(['register']); 8 const emit = defineEmits(['register']);
7 const [register, method] = useForm({ 9 const [register, method] = useForm({
8 schemas: defaultSchemas, 10 schemas: defaultSchemas,
9 labelWidth: 120, 11 labelWidth: 120,
10 - baseColProps: {  
11 - span: 5,  
12 - }, 12 + baseColProps: useGridLayout(2, 3, 4) as unknown as ColEx,
13 fieldMapToTime: [ 13 fieldMapToTime: [
14 [SchemaFiled.DATE_RANGE, [SchemaFiled.START_TS, SchemaFiled.END_TS], 'YYYY-MM-DD HH:mm:ss'], 14 [SchemaFiled.DATE_RANGE, [SchemaFiled.START_TS, SchemaFiled.END_TS], 'YYYY-MM-DD HH:mm:ss'],
15 ], 15 ],
@@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
43 width="70%" 43 width="70%"
44 :minHeight="400" 44 :minHeight="400"
45 :footer="null" 45 :footer="null"
  46 + wrap-class-name="history-trend-model"
46 :canFullscreen="false" 47 :canFullscreen="false"
47 @cancel="handleCancelModal" 48 @cancel="handleCancelModal"
48 > 49 >
@@ -218,8 +219,8 @@ @@ -218,8 +219,8 @@
218 }); 219 });
219 220
220 markerList.forEach((record) => { 221 markerList.forEach((record) => {
221 - unref(BMapInstance).addOverlay(record.marker);  
222 - unref(BMapInstance).addOverlay(record.label); 222 + unref(BMapInstance)?.addOverlay(record.marker);
  223 + unref(BMapInstance)?.addOverlay(record.label);
223 const isAlarmStatus = !!record.alarmStatus; 224 const isAlarmStatus = !!record.alarmStatus;
224 if (isAlarmStatus) { 225 if (isAlarmStatus) {
225 const alarmStatusClassName = 'device-status__alarm'; 226 const alarmStatusClassName = 'device-status__alarm';
@@ -487,6 +488,11 @@ @@ -487,6 +488,11 @@
487 } 488 }
488 </style> 489 </style>
489 <style> 490 <style>
  491 + .history-trend-model .ant-input-number {
  492 + min-width: 0 !important;
  493 + width: 100% !important;
  494 + }
  495 +
490 .device-status__alarm { 496 .device-status__alarm {
491 transform-origin: 10px 15px; 497 transform-origin: 10px 15px;
492 animation: 0.5s linear 0s infinite alternate Scale; 498 animation: 0.5s linear 0s infinite alternate Scale;
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 <BasicModal 2 <BasicModal
3 title="物模型TSL" 3 title="物模型TSL"
4 :maskClosable="false" 4 :maskClosable="false"
  5 + destroyOnClose
5 v-bind="$attrs" 6 v-bind="$attrs"
6 width="55rem" 7 width="55rem"
7 @register="register" 8 @register="register"
@@ -28,9 +28,10 @@ @@ -28,9 +28,10 @@
28 </template> 28 </template>
29 </Tabs> 29 </Tabs>
30 </div> 30 </div>
31 - <div> 31 + <div class="relative">
32 <Spin :spinning="loading"> 32 <Spin :spinning="loading">
33 <div id="jsoneditor" ref="jsoneditorEl"></div> 33 <div id="jsoneditor" ref="jsoneditorEl"></div>
  34 + <div class="absolute top-0 left-0 w-full h-full"></div>
34 </Spin> 35 </Spin>
35 </div> 36 </div>
36 </div> 37 </div>
@@ -216,10 +216,15 @@ @@ -216,10 +216,15 @@
216 <template> 216 <template>
217 <div class="w-full h-full flex justify-center items-center flex-col p-2"> 217 <div class="w-full h-full flex justify-center items-center flex-col p-2">
218 <div 218 <div
219 - class="w-full flex" 219 + class="w-full flex justify-end"
220 v-if="props.layout?.componentType === FrontComponent.MAP_COMPONENT_TRACK_HISTORY" 220 v-if="props.layout?.componentType === FrontComponent.MAP_COMPONENT_TRACK_HISTORY"
221 > 221 >
222 - <Button type="text" class="!px-2 flex-auto !text-left truncate" @click="handleTrackSwitch"> 222 + <Button
  223 + v-if="!random"
  224 + type="text"
  225 + class="!px-2 flex-auto !text-left truncate"
  226 + @click="handleTrackSwitch"
  227 + >
223 <div class="w-full truncate text-gray-500 flex items-center"> 228 <div class="w-full truncate text-gray-500 flex items-center">
224 <ClockCircleOutlined /> 229 <ClockCircleOutlined />
225 <span class="mx-1">历史</span> 230 <span class="mx-1">历史</span>