Commit 3a8fb10c92cc959326426cbb357452c68d196861

Authored by sqy
1 parent f93f5282

'fix:修改消息记录的时间选择,告警联系人组织回显修改'

1 import { alarmLevel, statusType } from '/@/views/device/manage/config/detail.config'; 1 import { alarmLevel, statusType } from '/@/views/device/manage/config/detail.config';
2 import { FormSchema } from '/@/components/Form'; 2 import { FormSchema } from '/@/components/Form';
3 import { BasicColumn } from '/@/components/Table'; 3 import { BasicColumn } from '/@/components/Table';
4 -import dayjs from 'moment'; 4 +import moment from 'moment';
5 export const alarmSearchSchemas: FormSchema[] = [ 5 export const alarmSearchSchemas: FormSchema[] = [
6 { 6 {
7 field: 'status', 7 field: 'status',
@@ -58,7 +58,7 @@ export const alarmSearchSchemas: FormSchema[] = [ @@ -58,7 +58,7 @@ export const alarmSearchSchemas: FormSchema[] = [
58 component: 'DatePicker', 58 component: 'DatePicker',
59 componentProps: { 59 componentProps: {
60 valueFormat: 'x', 60 valueFormat: 'x',
61 - showTime: { defaultValue: dayjs('23:59:59', 'HH:mm:ss') }, 61 + showTime: { defaultValue: moment('23:59:59', 'HH:mm:ss') },
62 }, 62 },
63 colProps: { span: 6 }, 63 colProps: { span: 6 },
64 }, 64 },
@@ -36,9 +36,12 @@ @@ -36,9 +36,12 @@
36 setDrawerProps({ confirmLoading: false }); 36 setDrawerProps({ confirmLoading: false });
37 isUpdate.value = !!data?.isUpdate; 37 isUpdate.value = !!data?.isUpdate;
38 if (unref(isUpdate)) { 38 if (unref(isUpdate)) {
39 - await setFieldsValue({  
40 - ...data.record,  
41 - }); 39 + if (data.record.organizationDTO) {
  40 + await setFieldsValue(data.record);
  41 + } else {
  42 + Reflect.deleteProperty(data.record, 'organizationId');
  43 + await setFieldsValue(data.record);
  44 + }
42 } 45 }
43 }); 46 });
44 47
@@ -3,17 +3,17 @@ import { FormSchema } from '/@/components/Form'; @@ -3,17 +3,17 @@ import { FormSchema } from '/@/components/Form';
3 import { BasicColumn } from '/@/components/Table'; 3 import { BasicColumn } from '/@/components/Table';
4 import { DeviceTypeEnum } from '/@/api/device/model/deviceModel'; 4 import { DeviceTypeEnum } from '/@/api/device/model/deviceModel';
5 import { getCustomerList } from '/@/api/device/deviceManager'; 5 import { getCustomerList } from '/@/api/device/deviceManager';
6 -import dayjs from 'moment'; 6 +import moment from 'moment';
7 export const columns: BasicColumn[] = [ 7 export const columns: BasicColumn[] = [
8 { 8 {
9 title: '设备名称', 9 title: '设备名称',
10 dataIndex: 'name', 10 dataIndex: 'name',
11 - width: 120, 11 + width: 160,
12 }, 12 },
13 { 13 {
14 title: '设备标签', 14 title: '设备标签',
15 dataIndex: 'label', 15 dataIndex: 'label',
16 - width: 100, 16 + width: 160,
17 }, 17 },
18 { 18 {
19 title: '设备配置', 19 title: '设备配置',
@@ -34,7 +34,7 @@ export const columns: BasicColumn[] = [ @@ -34,7 +34,7 @@ export const columns: BasicColumn[] = [
34 { 34 {
35 title: '描述', 35 title: '描述',
36 dataIndex: 'description', 36 dataIndex: 'description',
37 - width: 180, 37 + width: 160,
38 }, 38 },
39 ]; 39 ];
40 // 实时数据表格 40 // 实时数据表格
@@ -100,7 +100,7 @@ export const alarmSearchSchemas: FormSchema[] = [ @@ -100,7 +100,7 @@ export const alarmSearchSchemas: FormSchema[] = [
100 component: 'DatePicker', 100 component: 'DatePicker',
101 componentProps: { 101 componentProps: {
102 valueFormat: 'x', 102 valueFormat: 'x',
103 - showTime: { defaultValue: dayjs('23:59:59', 'HH:mm:ss') }, 103 + showTime: { defaultValue: moment('23:59:59', 'HH:mm:ss') },
104 }, 104 },
105 colProps: { span: 6 }, 105 colProps: { span: 6 },
106 }, 106 },
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </div> 23 </div>
24 <div v-if="deviceDetail?.deviceInfo?.address" class="mt-4"> 24 <div v-if="deviceDetail?.deviceInfo?.address" class="mt-4">
25 <p>设备位置</p> 25 <p>设备位置</p>
26 - <div ref="wrapRef" style="height: 400px; width: 100%"></div> 26 + <div ref="wrapRef" style="height: 550px; width: 100%"></div>
27 </div> 27 </div>
28 </div> 28 </div>
29 </template> 29 </template>
@@ -3,6 +3,7 @@ import { FormSchema } from '/@/components/Table'; @@ -3,6 +3,7 @@ import { FormSchema } from '/@/components/Table';
3 import { h } from 'vue'; 3 import { h } from 'vue';
4 import { Tag } from 'ant-design-vue'; 4 import { Tag } from 'ant-design-vue';
5 import { useI18n } from '/@/hooks/web/useI18n'; 5 import { useI18n } from '/@/hooks/web/useI18n';
  6 +import moment from 'moment';
6 const { t } = useI18n(); 7 const { t } = useI18n();
7 export const columns: BasicColumn[] = [ 8 export const columns: BasicColumn[] = [
8 { 9 {
@@ -75,6 +76,11 @@ export const searchFormSchema: FormSchema[] = [ @@ -75,6 +76,11 @@ export const searchFormSchema: FormSchema[] = [
75 field: 'sendTime', 76 field: 'sendTime',
76 label: '发送时间', 77 label: '发送时间',
77 component: 'RangePicker', 78 component: 'RangePicker',
  79 + componentProps: {
  80 + showTime: {
  81 + defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],
  82 + },
  83 + },
78 colProps: { span: 6 }, 84 colProps: { span: 6 },
79 }, 85 },
80 ]; 86 ];
@@ -3,8 +3,7 @@ import { FormSchema } from '/@/components/Table'; @@ -3,8 +3,7 @@ import { FormSchema } from '/@/components/Table';
3 import { h } from 'vue'; 3 import { h } from 'vue';
4 import { Tag } from 'ant-design-vue'; 4 import { Tag } from 'ant-design-vue';
5 import { useI18n } from '/@/hooks/web/useI18n'; 5 import { useI18n } from '/@/hooks/web/useI18n';
6 -import { phoneRule } from '/@/utils/rules';  
7 - 6 +import moment from 'moment';
8 const { t } = useI18n(); 7 const { t } = useI18n();
9 export const columns: BasicColumn[] = [ 8 export const columns: BasicColumn[] = [
10 { 9 {
@@ -62,6 +61,11 @@ export const searchFormSchema: FormSchema[] = [ @@ -62,6 +61,11 @@ export const searchFormSchema: FormSchema[] = [
62 field: 'sendTime', 61 field: 'sendTime',
63 label: '发送时间', 62 label: '发送时间',
64 component: 'RangePicker', 63 component: 'RangePicker',
  64 + componentProps: {
  65 + showTime: {
  66 + defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],
  67 + },
  68 + },
65 colProps: { span: 6 }, 69 colProps: { span: 6 },
66 }, 70 },
67 ]; 71 ];