Commit 655799a1f9b99192743b62eac40ef9fc418c7c6b
Merge branch 'sqy_dev' into 'main'
fix:修改teambition上的几个问题:告警时间范围,消息配置回显错误,首页样式调整以及数据调整 See merge request huang/yun-teng-iot-front!102
Showing
13 changed files
with
53 additions
and
53 deletions
| 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 | export const alarmSearchSchemas: FormSchema[] = [ | 5 | export const alarmSearchSchemas: FormSchema[] = [ |
| 5 | { | 6 | { |
| 6 | field: 'status', | 7 | field: 'status', |
| @@ -57,6 +58,7 @@ export const alarmSearchSchemas: FormSchema[] = [ | @@ -57,6 +58,7 @@ export const alarmSearchSchemas: FormSchema[] = [ | ||
| 57 | component: 'DatePicker', | 58 | component: 'DatePicker', |
| 58 | componentProps: { | 59 | componentProps: { |
| 59 | valueFormat: 'x', | 60 | valueFormat: 'x', |
| 61 | + showTime: { defaultValue: dayjs('23:59:59', 'HH:mm:ss') }, | ||
| 60 | }, | 62 | }, |
| 61 | colProps: { span: 6 }, | 63 | colProps: { span: 6 }, |
| 62 | }, | 64 | }, |
| @@ -18,6 +18,7 @@ export const formSchema: FormSchema[] = [ | @@ -18,6 +18,7 @@ export const formSchema: FormSchema[] = [ | ||
| 18 | label: '', | 18 | label: '', |
| 19 | component: 'ApiTreeSelect', | 19 | component: 'ApiTreeSelect', |
| 20 | componentProps: { | 20 | componentProps: { |
| 21 | + placeholder: '请选择组织', | ||
| 21 | api: async () => { | 22 | api: async () => { |
| 22 | const data = await getOrganizationList(); | 23 | const data = await getOrganizationList(); |
| 23 | copyTransFun(data as any as any[]); | 24 | copyTransFun(data as any as any[]); |
| @@ -8,7 +8,11 @@ | @@ -8,7 +8,11 @@ | ||
| 8 | <div class="flex-auto"> | 8 | <div class="flex-auto"> |
| 9 | <div class="flex justify-between" style="align-items: center"> | 9 | <div class="flex justify-between" style="align-items: center"> |
| 10 | <div style="font-size: 1.625rem; color: #333; font-weight: bold"> | 10 | <div style="font-size: 1.625rem; color: #333; font-weight: bold"> |
| 11 | - <CountTo :startVal="1" :endVal="growCardList?.deviceInfo?.sumCount" /> | 11 | + <CountTo |
| 12 | + v-if="growCardList?.deviceInfo?.sumCount" | ||
| 13 | + :endVal="growCardList.deviceInfo.sumCount" | ||
| 14 | + /> | ||
| 15 | + <CountTo v-else :endVal="0" /> | ||
| 12 | </div> | 16 | </div> |
| 13 | <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | 17 | <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> |
| 14 | </div> | 18 | </div> |
| @@ -54,10 +58,18 @@ | @@ -54,10 +58,18 @@ | ||
| 54 | <div class="flex-auto"> | 58 | <div class="flex-auto"> |
| 55 | <div class="flex justify-between" style="align-items: center"> | 59 | <div class="flex justify-between" style="align-items: center"> |
| 56 | <div v-if="!isAdmin(role)" style="font-size: 1.625rem; color: #333; font-weight: bold"> | 60 | <div v-if="!isAdmin(role)" style="font-size: 1.625rem; color: #333; font-weight: bold"> |
| 57 | - <CountTo :end-val="growCardList?.alarmInfo?.sumCount" /> | 61 | + <CountTo |
| 62 | + v-if="growCardList?.alarmInfo?.sumCount" | ||
| 63 | + :end-val="growCardList.alarmInfo.sumCount" | ||
| 64 | + /> | ||
| 65 | + <CountTo v-else :end-val="0" /> | ||
| 58 | </div> | 66 | </div> |
| 59 | <div style="font-size: 1.625rem; color: #333; font-weight: bold" v-else> | 67 | <div style="font-size: 1.625rem; color: #333; font-weight: bold" v-else> |
| 60 | - <CountTo :end-val="growCardList?.tenantInfo?.sumCount" /> | 68 | + <CountTo |
| 69 | + v-if="growCardList?.tenantInfo?.sumCount" | ||
| 70 | + :end-val="growCardList.tenantInfo.sumCount" | ||
| 71 | + /> | ||
| 72 | + <CountTo v-else :end-val="0" /> | ||
| 61 | </div> | 73 | </div> |
| 62 | <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | 74 | <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> |
| 63 | </div> | 75 | </div> |
| @@ -84,23 +96,33 @@ | @@ -84,23 +96,33 @@ | ||
| 84 | <div> | 96 | <div> |
| 85 | <div style="align-items: center"> | 97 | <div style="align-items: center"> |
| 86 | <div style="font-size: 1.625rem; color: #333; font-weight: bold"> | 98 | <div style="font-size: 1.625rem; color: #333; font-weight: bold"> |
| 87 | - <CountTo :end-val="growCardList?.messageInfo?.messageCount" | ||
| 88 | - /></div> | 99 | + <CountTo |
| 100 | + v-if="growCardList?.messageInfo?.messageCount" | ||
| 101 | + :end-val="growCardList.messageInfo.messageCount" | ||
| 102 | + /> | ||
| 103 | + <CountTo v-else :end-val="0" /> | ||
| 104 | + </div> | ||
| 89 | 消息量(条) | 105 | 消息量(条) |
| 90 | </div> | 106 | </div> |
| 91 | <div> | 107 | <div> |
| 92 | <span class="mr-2">数据点</span> | 108 | <span class="mr-2">数据点</span> |
| 93 | <CountTo | 109 | <CountTo |
| 94 | style="color: #333; font-weight: bold" | 110 | style="color: #333; font-weight: bold" |
| 95 | - :end-val="growCardList?.messageInfo?.dataPointsCount" | 111 | + v-if="growCardList?.messageInfo?.dataPointsCount" |
| 112 | + :end-val="growCardList.messageInfo.dataPointsCount" | ||
| 96 | /> | 113 | /> |
| 114 | + <CountTo style="color: #333; font-weight: bold" :end-val="0" v-else /> | ||
| 97 | </div> | 115 | </div> |
| 98 | </div> | 116 | </div> |
| 99 | </div> | 117 | </div> |
| 100 | <div class="flex-auto" v-else> | 118 | <div class="flex-auto" v-else> |
| 101 | <div class="flex justify-between" style="align-items: center"> | 119 | <div class="flex justify-between" style="align-items: center"> |
| 102 | <div style="font-size: 1.625rem; color: #333; font-weight: bold"> | 120 | <div style="font-size: 1.625rem; color: #333; font-weight: bold"> |
| 103 | - <CountTo :end-val="growCardList?.customerInfo?.sumCount" /> | 121 | + <CountTo |
| 122 | + v-if="growCardList?.customerInfo?.sumCount" | ||
| 123 | + :end-val="growCardList.customerInfo.sumCount" | ||
| 124 | + /> | ||
| 125 | + <CountTo :end-val="0" v-else /> | ||
| 104 | </div> | 126 | </div> |
| 105 | <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | 127 | <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> |
| 106 | </div> | 128 | </div> |
| @@ -54,13 +54,9 @@ | @@ -54,13 +54,9 @@ | ||
| 54 | </CardMeta> | 54 | </CardMeta> |
| 55 | </Card> | 55 | </Card> |
| 56 | </div> | 56 | </div> |
| 57 | - | ||
| 58 | <Card v-else :bordered="false" :bodyStyle="{ padding: 0 }" v-bind="$attrs"> | 57 | <Card v-else :bordered="false" :bodyStyle="{ padding: 0 }" v-bind="$attrs"> |
| 59 | <Skeleton active :paragraph="{ rows: 10 }" :loading="!tenantTop10.length"> | 58 | <Skeleton active :paragraph="{ rows: 10 }" :loading="!tenantTop10.length"> |
| 60 | - <h1 style="color: rgba(0, 0, 0, 0.85); font-weight: bold; font-size: 16px"> | ||
| 61 | - 租户消息量TOP10</h1 | ||
| 62 | - > | ||
| 63 | - <Descriptions :column="1"> | 59 | + <Descriptions :column="1" style="min-height: 180px" title="租户消息量TOP10"> |
| 64 | <template v-for="(item, index) in tenantTop10" :key="item.name"> | 60 | <template v-for="(item, index) in tenantTop10" :key="item.name"> |
| 65 | <DescriptionsItem> | 61 | <DescriptionsItem> |
| 66 | <span | 62 | <span |
| @@ -44,6 +44,7 @@ | @@ -44,6 +44,7 @@ | ||
| 44 | series: [ | 44 | series: [ |
| 45 | { | 45 | { |
| 46 | name: '告警数', | 46 | name: '告警数', |
| 47 | + barMaxWidth: '4%', | ||
| 47 | type: 'bar', | 48 | type: 'bar', |
| 48 | stack: 'Total', | 49 | stack: 'Total', |
| 49 | data: props.alarmList, | 50 | data: props.alarmList, |
| @@ -78,6 +79,7 @@ | @@ -78,6 +79,7 @@ | ||
| 78 | type: 'bar', | 79 | type: 'bar', |
| 79 | stack: 'Total', | 80 | stack: 'Total', |
| 80 | color: '#3C78FF', | 81 | color: '#3C78FF', |
| 82 | + barMaxWidth: '4%', | ||
| 81 | data: newValue, | 83 | data: newValue, |
| 82 | }, | 84 | }, |
| 83 | ], | 85 | ], |
| @@ -67,12 +67,14 @@ | @@ -67,12 +67,14 @@ | ||
| 67 | type: 'bar', | 67 | type: 'bar', |
| 68 | stack: 'total', | 68 | stack: 'total', |
| 69 | data: newValue, | 69 | data: newValue, |
| 70 | + barMaxWidth: '4%', | ||
| 70 | color: '#5AEEED', | 71 | color: '#5AEEED', |
| 71 | }, | 72 | }, |
| 72 | { | 73 | { |
| 73 | name: '传输消息量', | 74 | name: '传输消息量', |
| 74 | type: 'bar', | 75 | type: 'bar', |
| 75 | stack: 'total', | 76 | stack: 'total', |
| 77 | + barMaxWidth: '4%', | ||
| 76 | data: newValue1, | 78 | data: newValue1, |
| 77 | color: '#3C78FF', | 79 | color: '#3C78FF', |
| 78 | }, | 80 | }, |
| @@ -3,6 +3,7 @@ import { FormSchema } from '/@/components/Form'; | @@ -3,6 +3,7 @@ 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 | export const columns: BasicColumn[] = [ | 7 | export const columns: BasicColumn[] = [ |
| 7 | { | 8 | { |
| 8 | title: '设备名称', | 9 | title: '设备名称', |
| @@ -99,6 +100,7 @@ export const alarmSearchSchemas: FormSchema[] = [ | @@ -99,6 +100,7 @@ export const alarmSearchSchemas: FormSchema[] = [ | ||
| 99 | component: 'DatePicker', | 100 | component: 'DatePicker', |
| 100 | componentProps: { | 101 | componentProps: { |
| 101 | valueFormat: 'x', | 102 | valueFormat: 'x', |
| 103 | + showTime: { defaultValue: dayjs('23:59:59', 'HH:mm:ss') }, | ||
| 102 | }, | 104 | }, |
| 103 | colProps: { span: 6 }, | 105 | colProps: { span: 6 }, |
| 104 | }, | 106 | }, |
| @@ -217,7 +219,7 @@ export const childDeviceSchemas: FormSchema[] = [ | @@ -217,7 +219,7 @@ export const childDeviceSchemas: FormSchema[] = [ | ||
| 217 | field: 'icon', | 219 | field: 'icon', |
| 218 | label: '设备配置', | 220 | label: '设备配置', |
| 219 | component: 'Select', | 221 | component: 'Select', |
| 220 | - colProps: { span: 12 }, | 222 | + colProps: { span: 6 }, |
| 221 | componentProps: { | 223 | componentProps: { |
| 222 | maxLength: 255, | 224 | maxLength: 255, |
| 223 | }, | 225 | }, |
| @@ -226,7 +228,7 @@ export const childDeviceSchemas: FormSchema[] = [ | @@ -226,7 +228,7 @@ export const childDeviceSchemas: FormSchema[] = [ | ||
| 226 | field: 'icon', | 228 | field: 'icon', |
| 227 | label: '设备名称', | 229 | label: '设备名称', |
| 228 | component: 'Input', | 230 | component: 'Input', |
| 229 | - colProps: { span: 12 }, | 231 | + colProps: { span: 6 }, |
| 230 | componentProps: { | 232 | componentProps: { |
| 231 | maxLength: 255, | 233 | maxLength: 255, |
| 232 | placeholder: '请输入设备名称', | 234 | placeholder: '请输入设备名称', |
| @@ -41,13 +41,13 @@ export const columns: BasicColumn[] = [ | @@ -41,13 +41,13 @@ export const columns: BasicColumn[] = [ | ||
| 41 | { | 41 | { |
| 42 | title: '最后连接时间', | 42 | title: '最后连接时间', |
| 43 | dataIndex: 'lastOnlineTime', | 43 | dataIndex: 'lastOnlineTime', |
| 44 | - format: (text) => formatToDate(text, 'YYYY-MM-DD HH:mm:ss'), | 44 | + format: (text) => text && formatToDate(text, 'YYYY-MM-DD HH:mm:ss'), |
| 45 | width: 180, | 45 | width: 180, |
| 46 | }, | 46 | }, |
| 47 | { | 47 | { |
| 48 | title: '最后断开时间', | 48 | title: '最后断开时间', |
| 49 | dataIndex: 'lastOfflineTime', | 49 | dataIndex: 'lastOfflineTime', |
| 50 | - format: (text) => formatToDate(text, 'YYYY-MM-DD HH:mm:ss'), | 50 | + format: (text) => text && formatToDate(text, 'YYYY-MM-DD HH:mm:ss'), |
| 51 | width: 180, | 51 | width: 180, |
| 52 | }, | 52 | }, |
| 53 | ]; | 53 | ]; |
| @@ -84,7 +84,7 @@ export const searchFormSchema: FormSchema[] = [ | @@ -84,7 +84,7 @@ export const searchFormSchema: FormSchema[] = [ | ||
| 84 | field: 'name', | 84 | field: 'name', |
| 85 | label: '设备名称', | 85 | label: '设备名称', |
| 86 | component: 'Input', | 86 | component: 'Input', |
| 87 | - colProps: { span: 7 }, | 87 | + colProps: { span: 6 }, |
| 88 | componentProps: { | 88 | componentProps: { |
| 89 | maxLength: 255, | 89 | maxLength: 255, |
| 90 | placeholder: '请输入设备名称', | 90 | placeholder: '请输入设备名称', |
| @@ -163,7 +163,6 @@ | @@ -163,7 +163,6 @@ | ||
| 163 | actionColumn: { | 163 | actionColumn: { |
| 164 | width: 300, | 164 | width: 300, |
| 165 | title: '操作', | 165 | title: '操作', |
| 166 | - dataIndex: 'action', | ||
| 167 | slots: { customRender: 'action' }, | 166 | slots: { customRender: 'action' }, |
| 168 | fixed: 'right', | 167 | fixed: 'right', |
| 169 | }, | 168 | }, |
| @@ -36,34 +36,13 @@ | @@ -36,34 +36,13 @@ | ||
| 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 | - console.log(data); | ||
| 40 | - // const config = data.record.config; | ||
| 41 | - // for (const key in config) { | ||
| 42 | - // Reflect.set(data.record, key + '', config[key]); | ||
| 43 | - // } | ||
| 44 | - // await setFieldsValue({ | ||
| 45 | - // ...data.record, | ||
| 46 | - // }); | ||
| 47 | - await setFieldsValue({ | ||
| 48 | - accessKeyId: data.record.config.accessKeyId, | ||
| 49 | - accessKeySecret: data.record.config.accessKeySecret, | ||
| 50 | - platformTypeDictText: data.record.platformTypeDictText, | ||
| 51 | - messageTypeDictText: data.record.messageTypeDictText, | ||
| 52 | - messageType: data.record.messageType, | ||
| 53 | - platformType: data.record.platformType, | ||
| 54 | - configName: data.record.configName, | ||
| 55 | - createTime: data.record.createTime, | ||
| 56 | - creator: data.record.creator, | ||
| 57 | - enabled: data.record.enabled, | ||
| 58 | - id: data.record.id, | ||
| 59 | - key: data.record.key, | ||
| 60 | - pendingStatus: data.record.pendingStatus, | ||
| 61 | - remark: data.record.remark, | ||
| 62 | - status: data.record.status, | ||
| 63 | - tenantId: data.record.tenantId, | ||
| 64 | - updateTime: data.record.updateTime, | ||
| 65 | - updater: data.record.updater, | ||
| 66 | - }); | 39 | + const { config } = data.record; |
| 40 | + for (const key in config) { | ||
| 41 | + Reflect.set(data.record, key + '', config[key]); | ||
| 42 | + } | ||
| 43 | + const editRecord = JSON.parse(JSON.stringify(data.record)); | ||
| 44 | + Reflect.deleteProperty(editRecord, 'config'); | ||
| 45 | + await setFieldsValue(editRecord); | ||
| 67 | } | 46 | } |
| 68 | }); | 47 | }); |
| 69 | 48 |
| @@ -90,13 +90,13 @@ export const searchFormSchema: FormSchema[] = [ | @@ -90,13 +90,13 @@ export const searchFormSchema: FormSchema[] = [ | ||
| 90 | field: 'status', | 90 | field: 'status', |
| 91 | label: '状态', | 91 | label: '状态', |
| 92 | component: 'Select', | 92 | component: 'Select', |
| 93 | + colProps: { span: 6 }, | ||
| 93 | componentProps: { | 94 | componentProps: { |
| 94 | options: [ | 95 | options: [ |
| 95 | { label: '已启用', value: 1 }, | 96 | { label: '已启用', value: 1 }, |
| 96 | { label: '已禁用', value: 0 }, | 97 | { label: '已禁用', value: 0 }, |
| 97 | ], | 98 | ], |
| 98 | }, | 99 | }, |
| 99 | - colProps: { span: 6 }, | ||
| 100 | }, | 100 | }, |
| 101 | ]; | 101 | ]; |
| 102 | 102 | ||
| @@ -156,7 +156,6 @@ export const formSchema: FormSchema[] = [ | @@ -156,7 +156,6 @@ export const formSchema: FormSchema[] = [ | ||
| 156 | maxLength: 36, | 156 | maxLength: 36, |
| 157 | placeholder: '请输入accessKeyId', | 157 | placeholder: '请输入accessKeyId', |
| 158 | }, | 158 | }, |
| 159 | - | ||
| 160 | ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')), | 159 | ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')), |
| 161 | }, | 160 | }, |
| 162 | { | 161 | { |
| @@ -205,7 +204,6 @@ export const formSchema: FormSchema[] = [ | @@ -205,7 +204,6 @@ export const formSchema: FormSchema[] = [ | ||
| 205 | maxLength: 255, | 204 | maxLength: 255, |
| 206 | placeholder: '请输入用户名', | 205 | placeholder: '请输入用户名', |
| 207 | }, | 206 | }, |
| 208 | - | ||
| 209 | component: 'Input', | 207 | component: 'Input', |
| 210 | ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')), | 208 | ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')), |
| 211 | }, | 209 | }, |
| @@ -213,7 +211,6 @@ export const formSchema: FormSchema[] = [ | @@ -213,7 +211,6 @@ export const formSchema: FormSchema[] = [ | ||
| 213 | field: 'password', | 211 | field: 'password', |
| 214 | label: '密码', | 212 | label: '密码', |
| 215 | required: true, | 213 | required: true, |
| 216 | - | ||
| 217 | component: 'InputPassword', | 214 | component: 'InputPassword', |
| 218 | ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')), | 215 | ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')), |
| 219 | }, | 216 | }, |
| @@ -256,7 +253,6 @@ export const formSchema: FormSchema[] = [ | @@ -256,7 +253,6 @@ export const formSchema: FormSchema[] = [ | ||
| 256 | maxLength: 255, | 253 | maxLength: 255, |
| 257 | placeholder: '请输入备注', | 254 | placeholder: '请输入备注', |
| 258 | }, | 255 | }, |
| 259 | - | ||
| 260 | component: 'InputTextArea', | 256 | component: 'InputTextArea', |
| 261 | }, | 257 | }, |
| 262 | { | 258 | { |
| @@ -97,7 +97,7 @@ | @@ -97,7 +97,7 @@ | ||
| 97 | function showData(record: Recordable) { | 97 | function showData(record: Recordable) { |
| 98 | Modal.info({ | 98 | Modal.info({ |
| 99 | title: '当前配置', | 99 | title: '当前配置', |
| 100 | - width: 480, | 100 | + width: 600, |
| 101 | content: h(JsonPreview, { data: JSON.parse(JSON.stringify(record.config)) }), | 101 | content: h(JsonPreview, { data: JSON.parse(JSON.stringify(record.config)) }), |
| 102 | }); | 102 | }); |
| 103 | } | 103 | } |