Commit 42d661dc375de8c2ad7bbfa3810018139240b68b
Merge branch 'f-dev' into 'main'
fix:修改Teambition上的问题 See merge request huang/yun-teng-iot-front!241
Showing
13 changed files
with
122 additions
and
34 deletions
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; |
| 14 | 14 | import { useDesign } from '/@/hooks/web/useDesign'; |
| 15 | 15 | import { useUserStore } from '/@/store/modules/user'; |
| 16 | + | |
| 16 | 17 | const props = defineProps({ |
| 17 | 18 | /** |
| 18 | 19 | * The theme of the current parent component | ... | ... |
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | import { CreateContextOptions } from '/@/components/ContextMenu'; |
| 32 | 32 | |
| 33 | 33 | import { CheckEvent } from './typing'; |
| 34 | - import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue'; | |
| 34 | + import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons-vue'; | |
| 35 | 35 | |
| 36 | 36 | interface State { |
| 37 | 37 | expandedKeys: Keys; |
| ... | ... | @@ -398,6 +398,22 @@ |
| 398 | 398 | ); |
| 399 | 399 | }); |
| 400 | 400 | } |
| 401 | + /** | |
| 402 | + * 只针对表格分页和组织列表分页的Tree(不是通过弹窗显示,默认是关闭的并且图标显示) | |
| 403 | + * 如果是其他弹窗出来的Tree(会造成默认是关闭的并且图标显示),则在对应页面重写css样式即可 | |
| 404 | + * <style scoped lang="less"> | |
| 405 | + :deep(.vben-basic-tree) { | |
| 406 | + width: 100% !important; | |
| 407 | + } | |
| 408 | + :deep(.is-unflod) { | |
| 409 | + display: none !important; | |
| 410 | + } | |
| 411 | + :deep(.is-flod) { | |
| 412 | + display: none !important; | |
| 413 | + } | |
| 414 | + </style> | |
| 415 | + TODO下次优化通过传配置值来动态显示那些页面需要默认展开或收起 | |
| 416 | + */ | |
| 401 | 417 | return () => { |
| 402 | 418 | const { title, helpMessage, toolbar, search, checkable } = props; |
| 403 | 419 | const showTitle = title || toolbar || search || slots.headerTitle; |
| ... | ... | @@ -435,24 +451,19 @@ |
| 435 | 451 | <span |
| 436 | 452 | v-show={unref(isFlod)} |
| 437 | 453 | onClick={() => handleFlodOrUnFoldFunc(false)} |
| 438 | - style={ | |
| 439 | - isFlod.value | |
| 440 | - ? 'z-index:9999;cursor:pointer;position:absolute;top:40vh;left:17.5vw' | |
| 441 | - : 'z-index:9999;cursor:pointer;position:absolute;top:40vh;left:0.5vw' | |
| 442 | - } | |
| 454 | + class={['is-flod', unref(isFlod) ? 'fold-right' : 'fold-left']} | |
| 443 | 455 | > |
| 444 | - <RightOutlined /> | |
| 456 | + <DoubleLeftOutlined /> | |
| 445 | 457 | </span> |
| 446 | 458 | <span |
| 447 | 459 | v-show={!unref(isFlod) && unref(treeDataRef).length != 0} |
| 448 | 460 | onClick={() => handleFlodOrUnFoldFunc(true)} |
| 449 | - style={ | |
| 450 | - isFlod.value | |
| 451 | - ? 'z-index:9999;cursor:pointer;position:absolute;top:40vh;left:17.5vw' | |
| 452 | - : 'z-index:9999;cursor:pointer;position:absolute;top:40vh;left:0.5vw' | |
| 453 | - } | |
| 461 | + class={[ | |
| 462 | + 'is-unflod', | |
| 463 | + !unref(isFlod) && unref(treeDataRef).length != 0 ? 'fold-left' : 'fold-right', | |
| 464 | + ]} | |
| 454 | 465 | > |
| 455 | - <LeftOutlined /> | |
| 466 | + <DoubleRightOutlined /> | |
| 456 | 467 | </span> |
| 457 | 468 | </div> |
| 458 | 469 | ); |
| ... | ... | @@ -461,6 +472,20 @@ |
| 461 | 472 | }); |
| 462 | 473 | </script> |
| 463 | 474 | <style lang="less"> |
| 475 | + .fold-left { | |
| 476 | + z-index: 9999; | |
| 477 | + cursor: pointer; | |
| 478 | + position: absolute; | |
| 479 | + top: 0.85rem; | |
| 480 | + left: 0.5vw; | |
| 481 | + } | |
| 482 | + .fold-right { | |
| 483 | + z-index: 9999; | |
| 484 | + cursor: pointer; | |
| 485 | + position: absolute; | |
| 486 | + top: 0.85rem; | |
| 487 | + left: 17.5vw; | |
| 488 | + } | |
| 464 | 489 | @prefix-cls: ~'@{namespace}-basic-tree'; |
| 465 | 490 | |
| 466 | 491 | .@{prefix-cls} { | ... | ... |
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | > |
| 20 | 20 | <img v-if="tenantLogo" :src="tenantLogo" alt="avatar" /> |
| 21 | 21 | <div v-else> |
| 22 | - <loading-outlined v-if="loading"></loading-outlined> | |
| 22 | + <LoadingOutlined v-if="loading" /> | |
| 23 | 23 | <plus-outlined v-else /> |
| 24 | 24 | <div class="ant-upload-text">上传</div> |
| 25 | 25 | </div> |
| ... | ... | @@ -73,8 +73,8 @@ |
| 73 | 73 | |
| 74 | 74 | async function customUpload({ file }) { |
| 75 | 75 | if (beforeUpload(file)) { |
| 76 | + tenantLogo.value = ''; | |
| 76 | 77 | loading.value = true; |
| 77 | - | |
| 78 | 78 | const formData = new FormData(); |
| 79 | 79 | formData.append('file', file); |
| 80 | 80 | const response = await upload(formData); | ... | ... |
| ... | ... | @@ -14,7 +14,13 @@ |
| 14 | 14 | /> |
| 15 | 15 | <CountTo v-else :endVal="0" /> |
| 16 | 16 | </div> |
| 17 | - <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | |
| 17 | + <Tooltip> | |
| 18 | + <template #title> | |
| 19 | + 设备数 :{{ growCardList?.deviceInfo.sumCount }} 今日新增 | |
| 20 | + {{ toThousands(growCardList?.deviceInfo?.todayAdd) }} | |
| 21 | + </template> | |
| 22 | + <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | |
| 23 | + </Tooltip> | |
| 18 | 24 | </div> |
| 19 | 25 | <div> 设备数 </div> |
| 20 | 26 | </div> |
| ... | ... | @@ -49,7 +55,16 @@ |
| 49 | 55 | /> |
| 50 | 56 | <CountTo v-else :end-val="0" /> |
| 51 | 57 | </div> |
| 52 | - <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | |
| 58 | + <Tooltip> | |
| 59 | + <template #title> | |
| 60 | + {{ | |
| 61 | + !isAdmin(role) | |
| 62 | + ? `告警数:今日新增${toThousands(growCardList?.alarmInfo?.todayAdd)}` | |
| 63 | + : `租户总量:今日新增${toThousands(growCardList?.alarmInfo?.todayAdd)}` | |
| 64 | + }} | |
| 65 | + </template> | |
| 66 | + <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | |
| 67 | + </Tooltip> | |
| 53 | 68 | </div> |
| 54 | 69 | <div> {{ !isAdmin(role) ? `告警数` : '租户总量' }}</div> |
| 55 | 70 | </div> |
| ... | ... | @@ -87,7 +102,16 @@ |
| 87 | 102 | /> |
| 88 | 103 | <CountTo v-else :end-val="0" /> |
| 89 | 104 | </div> |
| 90 | - <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | |
| 105 | + <Tooltip> | |
| 106 | + <template #title> | |
| 107 | + {{ | |
| 108 | + !isAdmin(role) | |
| 109 | + ? `消息数:今日新增${toThousands(growCardList?.messageInfo?.todayMessageAdd)}` | |
| 110 | + : `客户总量:今日新增${toThousands(growCardList?.messageInfo?.todayMessageAdd)}` | |
| 111 | + }} | |
| 112 | + </template> | |
| 113 | + <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" /> | |
| 114 | + </Tooltip> | |
| 91 | 115 | </div> |
| 92 | 116 | <div> {{ !isAdmin(role) ? `消息数` : '客户总量' }}</div> |
| 93 | 117 | </div> |
| ... | ... | @@ -108,6 +132,8 @@ |
| 108 | 132 | import { isAdmin } from '/@/enums/roleEnum'; |
| 109 | 133 | import { toThousands } from '/@/utils/fnUtils'; |
| 110 | 134 | import { CountTo } from '/@/components/CountTo/index'; |
| 135 | + import { Tooltip } from 'ant-design-vue'; | |
| 136 | + | |
| 111 | 137 | defineProps<{ |
| 112 | 138 | role: string; |
| 113 | 139 | }>(); | ... | ... |
| ... | ... | @@ -39,11 +39,7 @@ |
| 39 | 39 | </Card> |
| 40 | 40 | <Card title="联系我们" :bordered="false" v-bind="$attrs" :headStyle="{ padding: 0 }"> |
| 41 | 41 | <template #cover> |
| 42 | - <img | |
| 43 | - :src="getQrCode" | |
| 44 | - v-if="getQrCode" | |
| 45 | - style="width: 150px; height: 150px; margin: 50px auto" | |
| 46 | - /> | |
| 42 | + <img :src="getQrCode" v-if="getQrCode" /> | |
| 47 | 43 | <Empty v-else :image="Empty.PRESENTED_IMAGE_SIMPLE" /> |
| 48 | 44 | </template> |
| 49 | 45 | <CardMeta> | ... | ... |
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | > |
| 14 | 14 | <img v-if="devicePic" :src="devicePic" alt="avatar" /> |
| 15 | 15 | <div v-else> |
| 16 | - <loading-outlined v-if="loading"></loading-outlined> | |
| 16 | + <LoadingOutlined v-if="loading" /> | |
| 17 | 17 | <PlusOutlined v-else /> |
| 18 | 18 | <div class="ant-upload-text">图片上传</div> |
| 19 | 19 | </div> |
| ... | ... | @@ -143,6 +143,7 @@ |
| 143 | 143 | // 图片上传 |
| 144 | 144 | async function customUpload({ file }) { |
| 145 | 145 | if (beforeUpload(file)) { |
| 146 | + devicePic.value = ''; | |
| 146 | 147 | loading.value = true; |
| 147 | 148 | const formData = new FormData(); |
| 148 | 149 | formData.append('file', file); | ... | ... |
| ... | ... | @@ -273,6 +273,11 @@ |
| 273 | 273 | map.removeOverlay(preMarker); |
| 274 | 274 | } |
| 275 | 275 | map.addOverlay(marker); |
| 276 | + //标注监听事件 | |
| 277 | + marker.addEventListener('click', function () { | |
| 278 | + map.openInfoWindow(infoWindow, map.getCenter()); | |
| 279 | + }); | |
| 280 | + //标注监听事件 | |
| 276 | 281 | } else { |
| 277 | 282 | const point = new BMap.Point(106.63028229687498, 36.06735821600903); |
| 278 | 283 | let options = { | ... | ... |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | style="width: 6.25rem; height: 6.25rem" |
| 21 | 21 | /> |
| 22 | 22 | <div v-else> |
| 23 | - <loading-outlined v-if="loading"></loading-outlined> | |
| 23 | + <LoadingOutlined v-if="loading" /> | |
| 24 | 24 | <PlusOutlined v-else /> |
| 25 | 25 | <div class="ant-upload-text">图片上传</div> |
| 26 | 26 | </div> |
| ... | ... | @@ -79,8 +79,8 @@ |
| 79 | 79 | }; |
| 80 | 80 | const customUploadqrcodePic = async ({ file }) => { |
| 81 | 81 | if (beforeUploadqrcodePic(file)) { |
| 82 | + peresonalPic.value = ''; | |
| 82 | 83 | loading.value = true; |
| 83 | - | |
| 84 | 84 | const formData = new FormData(); |
| 85 | 85 | formData.append('file', file); |
| 86 | 86 | const response = await uploadApi(formData); | ... | ... |
| ... | ... | @@ -30,7 +30,7 @@ |
| 30 | 30 | import { ref, computed } from 'vue'; |
| 31 | 31 | import { useDrawerInner, BasicDrawer } from '/@/components/Drawer/index'; |
| 32 | 32 | import { useForm, BasicForm } from '/@/components/Form/index'; |
| 33 | - import { formSchema } from '../config/config.data.ts'; | |
| 33 | + import { formSchema } from '../config/config.data'; | |
| 34 | 34 | import { Card, Tag } from 'ant-design-vue'; |
| 35 | 35 | import { createOrEditTransformScriptApi } from '/@/api/device/TransformScriptApi'; |
| 36 | 36 | import { useMessage } from '/@/hooks/web/useMessage'; |
| ... | ... | @@ -53,7 +53,7 @@ |
| 53 | 53 | setFieldsValue(data.record); |
| 54 | 54 | } |
| 55 | 55 | }); |
| 56 | - const [registerForm, { getFieldsValue, setFieldsValue, resetFields }] = useForm({ | |
| 56 | + const [registerForm, { validate, setFieldsValue, resetFields }] = useForm({ | |
| 57 | 57 | showActionButtonGroup: false, |
| 58 | 58 | colProps: { span: 24 }, |
| 59 | 59 | schemas: formSchema, |
| ... | ... | @@ -84,9 +84,10 @@ |
| 84 | 84 | emit('isStatus', { status: 1, jsCode }); |
| 85 | 85 | }; |
| 86 | 86 | const handleSubmit = async () => { |
| 87 | - setDrawerProps({ confirmLoading: true }); | |
| 88 | - const fieldsValue = getFieldsValue(); | |
| 89 | 87 | try { |
| 88 | + setDrawerProps({ confirmLoading: true }); | |
| 89 | + const fieldsValue = await validate(); | |
| 90 | + if (!fieldsValue) return; | |
| 90 | 91 | await createOrEditTransformScriptApi({ |
| 91 | 92 | configuration: { |
| 92 | 93 | jsScript: aceEditor.value.getValue(), |
| ... | ... | @@ -99,8 +100,6 @@ |
| 99 | 100 | const { createMessage } = useMessage(); |
| 100 | 101 | createMessage.success('保存成功'); |
| 101 | 102 | } catch (e) { |
| 102 | - const { createMessage } = useMessage(); | |
| 103 | - createMessage.success('保存失败'); | |
| 104 | 103 | } finally { |
| 105 | 104 | setTimeout(() => { |
| 106 | 105 | setDrawerProps({ confirmLoading: false }); | ... | ... |
| ... | ... | @@ -167,3 +167,14 @@ |
| 167 | 167 | }, |
| 168 | 168 | }); |
| 169 | 169 | </script> |
| 170 | +<style scoped lang="less"> | |
| 171 | + :deep(.vben-basic-tree) { | |
| 172 | + width: 100% !important; | |
| 173 | + } | |
| 174 | + :deep(.is-unflod) { | |
| 175 | + display: none !important; | |
| 176 | + } | |
| 177 | + :deep(.is-flod) { | |
| 178 | + display: none !important; | |
| 179 | + } | |
| 180 | +</style> | ... | ... |
| ... | ... | @@ -180,3 +180,15 @@ |
| 180 | 180 | }, |
| 181 | 181 | }); |
| 182 | 182 | </script> |
| 183 | + | |
| 184 | +<style scoped lang="less"> | |
| 185 | + :deep(.vben-basic-tree) { | |
| 186 | + width: 100% !important; | |
| 187 | + } | |
| 188 | + :deep(.is-unflod) { | |
| 189 | + display: none !important; | |
| 190 | + } | |
| 191 | + :deep(.is-flod) { | |
| 192 | + display: none !important; | |
| 193 | + } | |
| 194 | +</style> | ... | ... |
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | > |
| 20 | 20 | <img v-if="tenantLogo" :src="tenantLogo" alt="avatar" /> |
| 21 | 21 | <div v-else> |
| 22 | - <loading-outlined v-if="loading"></loading-outlined> | |
| 22 | + <LoadingOutlined v-if="loading" /> | |
| 23 | 23 | <plus-outlined v-else /> |
| 24 | 24 | <div class="ant-upload-text">上传</div> |
| 25 | 25 | </div> |
| ... | ... | @@ -59,8 +59,8 @@ |
| 59 | 59 | |
| 60 | 60 | async function customUpload({ file }) { |
| 61 | 61 | if (beforeUpload(file)) { |
| 62 | + tenantLogo.value = ''; | |
| 62 | 63 | loading.value = true; |
| 63 | - | |
| 64 | 64 | const formData = new FormData(); |
| 65 | 65 | formData.append('file', file); |
| 66 | 66 | const response = await upload(formData); | ... | ... |
| ... | ... | @@ -183,3 +183,15 @@ |
| 183 | 183 | }, |
| 184 | 184 | }); |
| 185 | 185 | </script> |
| 186 | + | |
| 187 | +<style scoped lang="less"> | |
| 188 | + :deep(.vben-basic-tree) { | |
| 189 | + width: 100% !important; | |
| 190 | + } | |
| 191 | + :deep(.is-unflod) { | |
| 192 | + display: none !important; | |
| 193 | + } | |
| 194 | + :deep(.is-flod) { | |
| 195 | + display: none !important; | |
| 196 | + } | |
| 197 | +</style> | ... | ... |