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