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,6 +13,7 @@ | ||
13 | import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; | 13 | import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; |
14 | import { useDesign } from '/@/hooks/web/useDesign'; | 14 | import { useDesign } from '/@/hooks/web/useDesign'; |
15 | import { useUserStore } from '/@/store/modules/user'; | 15 | import { useUserStore } from '/@/store/modules/user'; |
16 | + | ||
16 | const props = defineProps({ | 17 | const props = defineProps({ |
17 | /** | 18 | /** |
18 | * The theme of the current parent component | 19 | * The theme of the current parent component |
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | import { CreateContextOptions } from '/@/components/ContextMenu'; | 31 | import { CreateContextOptions } from '/@/components/ContextMenu'; |
32 | 32 | ||
33 | import { CheckEvent } from './typing'; | 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 | interface State { | 36 | interface State { |
37 | expandedKeys: Keys; | 37 | expandedKeys: Keys; |
@@ -398,6 +398,22 @@ | @@ -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 | return () => { | 417 | return () => { |
402 | const { title, helpMessage, toolbar, search, checkable } = props; | 418 | const { title, helpMessage, toolbar, search, checkable } = props; |
403 | const showTitle = title || toolbar || search || slots.headerTitle; | 419 | const showTitle = title || toolbar || search || slots.headerTitle; |
@@ -435,24 +451,19 @@ | @@ -435,24 +451,19 @@ | ||
435 | <span | 451 | <span |
436 | v-show={unref(isFlod)} | 452 | v-show={unref(isFlod)} |
437 | onClick={() => handleFlodOrUnFoldFunc(false)} | 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 | </span> | 457 | </span> |
446 | <span | 458 | <span |
447 | v-show={!unref(isFlod) && unref(treeDataRef).length != 0} | 459 | v-show={!unref(isFlod) && unref(treeDataRef).length != 0} |
448 | onClick={() => handleFlodOrUnFoldFunc(true)} | 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 | </span> | 467 | </span> |
457 | </div> | 468 | </div> |
458 | ); | 469 | ); |
@@ -461,6 +472,20 @@ | @@ -461,6 +472,20 @@ | ||
461 | }); | 472 | }); |
462 | </script> | 473 | </script> |
463 | <style lang="less"> | 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 | @prefix-cls: ~'@{namespace}-basic-tree'; | 489 | @prefix-cls: ~'@{namespace}-basic-tree'; |
465 | 490 | ||
466 | .@{prefix-cls} { | 491 | .@{prefix-cls} { |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | > | 19 | > |
20 | <img v-if="tenantLogo" :src="tenantLogo" alt="avatar" /> | 20 | <img v-if="tenantLogo" :src="tenantLogo" alt="avatar" /> |
21 | <div v-else> | 21 | <div v-else> |
22 | - <loading-outlined v-if="loading"></loading-outlined> | 22 | + <LoadingOutlined v-if="loading" /> |
23 | <plus-outlined v-else /> | 23 | <plus-outlined v-else /> |
24 | <div class="ant-upload-text">上传</div> | 24 | <div class="ant-upload-text">上传</div> |
25 | </div> | 25 | </div> |
@@ -73,8 +73,8 @@ | @@ -73,8 +73,8 @@ | ||
73 | 73 | ||
74 | async function customUpload({ file }) { | 74 | async function customUpload({ file }) { |
75 | if (beforeUpload(file)) { | 75 | if (beforeUpload(file)) { |
76 | + tenantLogo.value = ''; | ||
76 | loading.value = true; | 77 | loading.value = true; |
77 | - | ||
78 | const formData = new FormData(); | 78 | const formData = new FormData(); |
79 | formData.append('file', file); | 79 | formData.append('file', file); |
80 | const response = await upload(formData); | 80 | const response = await upload(formData); |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | /> | 14 | /> |
15 | <CountTo v-else :endVal="0" /> | 15 | <CountTo v-else :endVal="0" /> |
16 | </div> | 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 | </div> | 24 | </div> |
19 | <div> 设备数 </div> | 25 | <div> 设备数 </div> |
20 | </div> | 26 | </div> |
@@ -49,7 +55,16 @@ | @@ -49,7 +55,16 @@ | ||
49 | /> | 55 | /> |
50 | <CountTo v-else :end-val="0" /> | 56 | <CountTo v-else :end-val="0" /> |
51 | </div> | 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 | </div> | 68 | </div> |
54 | <div> {{ !isAdmin(role) ? `告警数` : '租户总量' }}</div> | 69 | <div> {{ !isAdmin(role) ? `告警数` : '租户总量' }}</div> |
55 | </div> | 70 | </div> |
@@ -87,7 +102,16 @@ | @@ -87,7 +102,16 @@ | ||
87 | /> | 102 | /> |
88 | <CountTo v-else :end-val="0" /> | 103 | <CountTo v-else :end-val="0" /> |
89 | </div> | 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 | </div> | 115 | </div> |
92 | <div> {{ !isAdmin(role) ? `消息数` : '客户总量' }}</div> | 116 | <div> {{ !isAdmin(role) ? `消息数` : '客户总量' }}</div> |
93 | </div> | 117 | </div> |
@@ -108,6 +132,8 @@ | @@ -108,6 +132,8 @@ | ||
108 | import { isAdmin } from '/@/enums/roleEnum'; | 132 | import { isAdmin } from '/@/enums/roleEnum'; |
109 | import { toThousands } from '/@/utils/fnUtils'; | 133 | import { toThousands } from '/@/utils/fnUtils'; |
110 | import { CountTo } from '/@/components/CountTo/index'; | 134 | import { CountTo } from '/@/components/CountTo/index'; |
135 | + import { Tooltip } from 'ant-design-vue'; | ||
136 | + | ||
111 | defineProps<{ | 137 | defineProps<{ |
112 | role: string; | 138 | role: string; |
113 | }>(); | 139 | }>(); |
@@ -39,11 +39,7 @@ | @@ -39,11 +39,7 @@ | ||
39 | </Card> | 39 | </Card> |
40 | <Card title="联系我们" :bordered="false" v-bind="$attrs" :headStyle="{ padding: 0 }"> | 40 | <Card title="联系我们" :bordered="false" v-bind="$attrs" :headStyle="{ padding: 0 }"> |
41 | <template #cover> | 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 | <Empty v-else :image="Empty.PRESENTED_IMAGE_SIMPLE" /> | 43 | <Empty v-else :image="Empty.PRESENTED_IMAGE_SIMPLE" /> |
48 | </template> | 44 | </template> |
49 | <CardMeta> | 45 | <CardMeta> |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | > | 13 | > |
14 | <img v-if="devicePic" :src="devicePic" alt="avatar" /> | 14 | <img v-if="devicePic" :src="devicePic" alt="avatar" /> |
15 | <div v-else> | 15 | <div v-else> |
16 | - <loading-outlined v-if="loading"></loading-outlined> | 16 | + <LoadingOutlined v-if="loading" /> |
17 | <PlusOutlined v-else /> | 17 | <PlusOutlined v-else /> |
18 | <div class="ant-upload-text">图片上传</div> | 18 | <div class="ant-upload-text">图片上传</div> |
19 | </div> | 19 | </div> |
@@ -143,6 +143,7 @@ | @@ -143,6 +143,7 @@ | ||
143 | // 图片上传 | 143 | // 图片上传 |
144 | async function customUpload({ file }) { | 144 | async function customUpload({ file }) { |
145 | if (beforeUpload(file)) { | 145 | if (beforeUpload(file)) { |
146 | + devicePic.value = ''; | ||
146 | loading.value = true; | 147 | loading.value = true; |
147 | const formData = new FormData(); | 148 | const formData = new FormData(); |
148 | formData.append('file', file); | 149 | formData.append('file', file); |
@@ -273,6 +273,11 @@ | @@ -273,6 +273,11 @@ | ||
273 | map.removeOverlay(preMarker); | 273 | map.removeOverlay(preMarker); |
274 | } | 274 | } |
275 | map.addOverlay(marker); | 275 | map.addOverlay(marker); |
276 | + //标注监听事件 | ||
277 | + marker.addEventListener('click', function () { | ||
278 | + map.openInfoWindow(infoWindow, map.getCenter()); | ||
279 | + }); | ||
280 | + //标注监听事件 | ||
276 | } else { | 281 | } else { |
277 | const point = new BMap.Point(106.63028229687498, 36.06735821600903); | 282 | const point = new BMap.Point(106.63028229687498, 36.06735821600903); |
278 | let options = { | 283 | let options = { |
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | style="width: 6.25rem; height: 6.25rem" | 20 | style="width: 6.25rem; height: 6.25rem" |
21 | /> | 21 | /> |
22 | <div v-else> | 22 | <div v-else> |
23 | - <loading-outlined v-if="loading"></loading-outlined> | 23 | + <LoadingOutlined v-if="loading" /> |
24 | <PlusOutlined v-else /> | 24 | <PlusOutlined v-else /> |
25 | <div class="ant-upload-text">图片上传</div> | 25 | <div class="ant-upload-text">图片上传</div> |
26 | </div> | 26 | </div> |
@@ -79,8 +79,8 @@ | @@ -79,8 +79,8 @@ | ||
79 | }; | 79 | }; |
80 | const customUploadqrcodePic = async ({ file }) => { | 80 | const customUploadqrcodePic = async ({ file }) => { |
81 | if (beforeUploadqrcodePic(file)) { | 81 | if (beforeUploadqrcodePic(file)) { |
82 | + peresonalPic.value = ''; | ||
82 | loading.value = true; | 83 | loading.value = true; |
83 | - | ||
84 | const formData = new FormData(); | 84 | const formData = new FormData(); |
85 | formData.append('file', file); | 85 | formData.append('file', file); |
86 | const response = await uploadApi(formData); | 86 | const response = await uploadApi(formData); |
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | import { ref, computed } from 'vue'; | 30 | import { ref, computed } from 'vue'; |
31 | import { useDrawerInner, BasicDrawer } from '/@/components/Drawer/index'; | 31 | import { useDrawerInner, BasicDrawer } from '/@/components/Drawer/index'; |
32 | import { useForm, BasicForm } from '/@/components/Form/index'; | 32 | import { useForm, BasicForm } from '/@/components/Form/index'; |
33 | - import { formSchema } from '../config/config.data.ts'; | 33 | + import { formSchema } from '../config/config.data'; |
34 | import { Card, Tag } from 'ant-design-vue'; | 34 | import { Card, Tag } from 'ant-design-vue'; |
35 | import { createOrEditTransformScriptApi } from '/@/api/device/TransformScriptApi'; | 35 | import { createOrEditTransformScriptApi } from '/@/api/device/TransformScriptApi'; |
36 | import { useMessage } from '/@/hooks/web/useMessage'; | 36 | import { useMessage } from '/@/hooks/web/useMessage'; |
@@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
53 | setFieldsValue(data.record); | 53 | setFieldsValue(data.record); |
54 | } | 54 | } |
55 | }); | 55 | }); |
56 | - const [registerForm, { getFieldsValue, setFieldsValue, resetFields }] = useForm({ | 56 | + const [registerForm, { validate, setFieldsValue, resetFields }] = useForm({ |
57 | showActionButtonGroup: false, | 57 | showActionButtonGroup: false, |
58 | colProps: { span: 24 }, | 58 | colProps: { span: 24 }, |
59 | schemas: formSchema, | 59 | schemas: formSchema, |
@@ -84,9 +84,10 @@ | @@ -84,9 +84,10 @@ | ||
84 | emit('isStatus', { status: 1, jsCode }); | 84 | emit('isStatus', { status: 1, jsCode }); |
85 | }; | 85 | }; |
86 | const handleSubmit = async () => { | 86 | const handleSubmit = async () => { |
87 | - setDrawerProps({ confirmLoading: true }); | ||
88 | - const fieldsValue = getFieldsValue(); | ||
89 | try { | 87 | try { |
88 | + setDrawerProps({ confirmLoading: true }); | ||
89 | + const fieldsValue = await validate(); | ||
90 | + if (!fieldsValue) return; | ||
90 | await createOrEditTransformScriptApi({ | 91 | await createOrEditTransformScriptApi({ |
91 | configuration: { | 92 | configuration: { |
92 | jsScript: aceEditor.value.getValue(), | 93 | jsScript: aceEditor.value.getValue(), |
@@ -99,8 +100,6 @@ | @@ -99,8 +100,6 @@ | ||
99 | const { createMessage } = useMessage(); | 100 | const { createMessage } = useMessage(); |
100 | createMessage.success('保存成功'); | 101 | createMessage.success('保存成功'); |
101 | } catch (e) { | 102 | } catch (e) { |
102 | - const { createMessage } = useMessage(); | ||
103 | - createMessage.success('保存失败'); | ||
104 | } finally { | 103 | } finally { |
105 | setTimeout(() => { | 104 | setTimeout(() => { |
106 | setDrawerProps({ confirmLoading: false }); | 105 | setDrawerProps({ confirmLoading: false }); |
@@ -167,3 +167,14 @@ | @@ -167,3 +167,14 @@ | ||
167 | }, | 167 | }, |
168 | }); | 168 | }); |
169 | </script> | 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,3 +180,15 @@ | ||
180 | }, | 180 | }, |
181 | }); | 181 | }); |
182 | </script> | 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,7 +19,7 @@ | ||
19 | > | 19 | > |
20 | <img v-if="tenantLogo" :src="tenantLogo" alt="avatar" /> | 20 | <img v-if="tenantLogo" :src="tenantLogo" alt="avatar" /> |
21 | <div v-else> | 21 | <div v-else> |
22 | - <loading-outlined v-if="loading"></loading-outlined> | 22 | + <LoadingOutlined v-if="loading" /> |
23 | <plus-outlined v-else /> | 23 | <plus-outlined v-else /> |
24 | <div class="ant-upload-text">上传</div> | 24 | <div class="ant-upload-text">上传</div> |
25 | </div> | 25 | </div> |
@@ -59,8 +59,8 @@ | @@ -59,8 +59,8 @@ | ||
59 | 59 | ||
60 | async function customUpload({ file }) { | 60 | async function customUpload({ file }) { |
61 | if (beforeUpload(file)) { | 61 | if (beforeUpload(file)) { |
62 | + tenantLogo.value = ''; | ||
62 | loading.value = true; | 63 | loading.value = true; |
63 | - | ||
64 | const formData = new FormData(); | 64 | const formData = new FormData(); |
65 | formData.append('file', file); | 65 | formData.append('file', file); |
66 | const response = await upload(formData); | 66 | const response = await upload(formData); |
@@ -183,3 +183,15 @@ | @@ -183,3 +183,15 @@ | ||
183 | }, | 183 | }, |
184 | }); | 184 | }); |
185 | </script> | 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> |