Commit abb741590426e3a8495621e76b2133ac93f6414e

Authored by sqy
1 parent 139b9a72

'fix:修改告警时间只能选择一个问题'

... ... @@ -53,12 +53,11 @@ export const alarmSearchSchemas: FormSchema[] = [
53 53 },
54 54 },
55 55 {
56   - field: 'endTime',
  56 + field: 'alarmTime',
57 57 label: '告警时间',
58   - component: 'DatePicker',
  58 + component: 'RangePicker',
59 59 componentProps: {
60   - valueFormat: 'x',
61   - showTime: { defaultValue: moment('23:59:59', 'HH:mm:ss') },
  60 + showTime: { defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] },
62 61 },
63 62 colProps: { span: 6 },
64 63 },
... ...
... ... @@ -37,11 +37,12 @@
37 37 title: '告警记录列表',
38 38 api: getDeviceAlarm,
39 39 columns: alarmColumns,
  40 + useSearchForm: true,
40 41 formConfig: {
41 42 labelWidth: 120,
42 43 schemas: alarmSearchSchemas,
  44 + fieldMapToTime: [['alarmTime', ['startTime', 'endTime'], 'x']],
43 45 },
44   - useSearchForm: true,
45 46 bordered: true,
46 47 showIndexColumn: false,
47 48 showTableSetting: true,
... ... @@ -51,9 +52,9 @@
51 52 slots: { customRender: 'action' },
52 53 fixed: 'right',
53 54 },
54   - beforeFetch: (data) => {
55   - Reflect.set(data, 'startTime', null);
56   - },
  55 + // beforeFetch: (data) => {
  56 + // Reflect.set(data, 'startTime', null);
  57 + // },
57 58 });
58 59 const [registerDetailDrawer, { openDrawer }] = useDrawer();
59 60 const handleDetail = (record: Recordable) => {
... ...
... ... @@ -104,12 +104,11 @@ export const alarmSearchSchemas: FormSchema[] = [
104 104 },
105 105 },
106 106 {
107   - field: 'endTime',
  107 + field: 'alarmTime',
108 108 label: '告警时间',
109   - component: 'DatePicker',
  109 + component: 'RangePicker',
110 110 componentProps: {
111   - valueFormat: 'x',
112   - showTime: { defaultValue: moment('23:59:59', 'HH:mm:ss') },
  111 + showTime: { defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] },
113 112 },
114 113 colProps: { span: 6 },
115 114 },
... ...
... ... @@ -44,13 +44,13 @@
44 44 formConfig: {
45 45 labelWidth: 100,
46 46 schemas: alarmSearchSchemas,
  47 + fieldMapToTime: [['alarmTime', ['startTime', 'endTime'], 'x']],
47 48 },
48 49 showTableSetting: true,
49 50 bordered: true,
50 51 showIndexColumn: false,
51 52 beforeFetch: (data) => {
52 53 Reflect.set(data, 'deviceId', props.id);
53   - Reflect.set(data, 'startTime', null);
54 54 },
55 55 actionColumn: {
56 56 width: 200,
... ...
... ... @@ -244,10 +244,11 @@
244 244 <div style="font-size:16px;font-weight:bold">${name}</div>
245 245 ${
246 246 deviceState === 'INACTIVE'
247   - ? `<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="${djh}">待激活</div>`
  247 + ? `<div style="display:flex;align-items:center;"><img style="width:15px;height:15px" src="${djh}" class="mr-1">待激活</div>`
248 248 : deviceState === 'ONLINE'
249   - ? `<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="${online}">在线</div>`
250   - : `<div style="display:flex;align-items:center"><img style="width:15px;height:15px" src="${lx1}">离线</div>`
  249 + ? `<div style="display:flex;align-items:center; ">
  250 + <img style="width:15px;height:15px" src="${online}" class="mr-1">在线</div>`
  251 + : `<div style="display:flex;align-items:center;"><img style="width:15px;height:15px" src="${lx1}" class="mr-1">离线</div>`
251 252 }
252 253 </div>
253 254 <div>所属组织:${organizationDTO.name}</div>
... ...
... ... @@ -344,5 +344,3 @@
344 344 },
345 345 });
346 346 </script>
347   -
348   -<style lang="less" scoped></style>
... ...