Commit 59bfea9ee0a3e73f402ab0a132d9fa8db82fbe1c
Merge branch 'sqy_dev' into 'main'
调整bug,修复 See merge request huang/yun-teng-iot-front!27
Showing
10 changed files
with
36 additions
and
21 deletions
@@ -7,11 +7,11 @@ dist | @@ -7,11 +7,11 @@ dist | ||
7 | tests/server/static | 7 | tests/server/static |
8 | tests/server/static/upload | 8 | tests/server/static/upload |
9 | 9 | ||
10 | +.env.development | ||
10 | .local | 11 | .local |
11 | # local env files | 12 | # local env files |
12 | .env.local | 13 | .env.local |
13 | .env.*.local | 14 | .env.*.local |
14 | -.env.*development | ||
15 | .env.*test | 15 | .env.*test |
16 | .env.*production | 16 | .env.*production |
17 | .eslintcache | 17 | .eslintcache |
@@ -45,7 +45,7 @@ export const deleteAlarmContact = (ids: string[]) => { | @@ -45,7 +45,7 @@ export const deleteAlarmContact = (ids: string[]) => { | ||
45 | // 新增或者编辑 | 45 | // 新增或者编辑 |
46 | export const saveOrEditAlarmContact = (params: ContactInfo, isUpdate: boolean) => { | 46 | export const saveOrEditAlarmContact = (params: ContactInfo, isUpdate: boolean) => { |
47 | if (isUpdate) return updateAlarmContact(params); | 47 | if (isUpdate) return updateAlarmContact(params); |
48 | - addAlarmContact(params); | 48 | + return addAlarmContact(params); |
49 | }; | 49 | }; |
50 | 50 | ||
51 | // 查询设备分页数据 | 51 | // 查询设备分页数据 |
@@ -16,7 +16,7 @@ enum DeviceManagerApi { | @@ -16,7 +16,7 @@ enum DeviceManagerApi { | ||
16 | */ | 16 | */ |
17 | DEVICE_PROFILE_URL = '/deviceProfile', | 17 | DEVICE_PROFILE_URL = '/deviceProfile', |
18 | 18 | ||
19 | - DEVICE_PROFILE_URL_ME = '/deviceProfile/me', | 19 | + DEVICE_PROFILE_URL_ME = '/deviceProfile/me/list', |
20 | } | 20 | } |
21 | 21 | ||
22 | export const devicePage = (params: DeviceQueryParam) => { | 22 | export const devicePage = (params: DeviceQueryParam) => { |
@@ -42,7 +42,7 @@ export const getAccountList = (params: AccountParams) => | @@ -42,7 +42,7 @@ export const getAccountList = (params: AccountParams) => | ||
42 | */ | 42 | */ |
43 | export const getOrganizationList = (params?: OrganizationListItem) => | 43 | export const getOrganizationList = (params?: OrganizationListItem) => |
44 | defHttp.get<OrganizationListGetResultModel>({ | 44 | defHttp.get<OrganizationListGetResultModel>({ |
45 | - url: Api.BaseOrganization + '/me/organizations', | 45 | + url: Api.BaseOrganization + '/me/list', |
46 | params, | 46 | params, |
47 | }); | 47 | }); |
48 | 48 |
@@ -7,7 +7,7 @@ import { copyTransFun } from '/@/utils/fnUtils'; | @@ -7,7 +7,7 @@ import { copyTransFun } from '/@/utils/fnUtils'; | ||
7 | export const step1Schemas: FormSchema[] = [ | 7 | export const step1Schemas: FormSchema[] = [ |
8 | { | 8 | { |
9 | field: 'icon', | 9 | field: 'icon', |
10 | - label: '设备图片: ', | 10 | + label: '设备图片', |
11 | slot: 'iconSelect', | 11 | slot: 'iconSelect', |
12 | component: 'Input', | 12 | component: 'Input', |
13 | }, | 13 | }, |
@@ -84,14 +84,14 @@ export const step1Schemas: FormSchema[] = [ | @@ -84,14 +84,14 @@ export const step1Schemas: FormSchema[] = [ | ||
84 | show: false, | 84 | show: false, |
85 | }, | 85 | }, |
86 | { | 86 | { |
87 | - field: 'profileId', | ||
88 | - label: '设备配置id', | 87 | + field: 'deviceToken', |
88 | + label: '设备唯一token', | ||
89 | component: 'Input', | 89 | component: 'Input', |
90 | show: false, | 90 | show: false, |
91 | }, | 91 | }, |
92 | { | 92 | { |
93 | - field: 'deviceToken', | ||
94 | - label: '设备唯一token', | 93 | + field: 'tenantId', |
94 | + label: '租户Code', | ||
95 | component: 'Input', | 95 | component: 'Input', |
96 | show: false, | 96 | show: false, |
97 | }, | 97 | }, |
@@ -111,8 +111,8 @@ | @@ -111,8 +111,8 @@ | ||
111 | } else { | 111 | } else { |
112 | if (!DeviceStep2Ref?.value?.creaentialsPassword.isCreaentials) { | 112 | if (!DeviceStep2Ref?.value?.creaentialsPassword.isCreaentials) { |
113 | const valid = await DeviceStep2Ref?.value?.validate(); | 113 | const valid = await DeviceStep2Ref?.value?.validate(); |
114 | - if (!valid) return; | ||
115 | // 第二页验证通过情况 | 114 | // 第二页验证通过情况 |
115 | + if (!valid) return; | ||
116 | handleCancel(); | 116 | handleCancel(); |
117 | closeModal(); | 117 | closeModal(); |
118 | } | 118 | } |
@@ -13,7 +13,6 @@ | @@ -13,7 +13,6 @@ | ||
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 | - <!-- <LoadingOutlined v-if="loading" /> --> | ||
17 | <PlusOutlined /> | 16 | <PlusOutlined /> |
18 | <div class="ant-upload-text">图片上传</div> | 17 | <div class="ant-upload-text">图片上传</div> |
19 | </div> | 18 | </div> |
@@ -18,8 +18,8 @@ | @@ -18,8 +18,8 @@ | ||
18 | <div ref="wrapRef" style="height: 400px; width: 90%" class="ml-6"></div> | 18 | <div ref="wrapRef" style="height: 400px; width: 90%" class="ml-6"></div> |
19 | </div> | 19 | </div> |
20 | <div class="mt-4"> | 20 | <div class="mt-4"> |
21 | - <a-button type="primary" class="mr-4">复制设备ID</a-button> | ||
22 | - <a-button type="primary">复制访问令牌</a-button> | 21 | + <a-button type="primary" class="mr-4" @click="copyDeviceId">复制设备ID</a-button> |
22 | + <a-button type="primary" @click="copyToken">复制访问令牌</a-button> | ||
23 | </div> | 23 | </div> |
24 | </div> | 24 | </div> |
25 | </template> | 25 | </template> |
@@ -28,6 +28,8 @@ | @@ -28,6 +28,8 @@ | ||
28 | import { Image, Table } from 'ant-design-vue'; | 28 | import { Image, Table } from 'ant-design-vue'; |
29 | import { columns } from '../../config/detail.config'; | 29 | import { columns } from '../../config/detail.config'; |
30 | import { useScript } from '/@/hooks/web/useScript'; | 30 | import { useScript } from '/@/hooks/web/useScript'; |
31 | + import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; | ||
32 | + import { useMessage } from '/@/hooks/web/useMessage'; | ||
31 | export default defineComponent({ | 33 | export default defineComponent({ |
32 | components: { | 34 | components: { |
33 | Image, | 35 | Image, |
@@ -39,7 +41,7 @@ | @@ -39,7 +41,7 @@ | ||
39 | required: true, | 41 | required: true, |
40 | }, | 42 | }, |
41 | }, | 43 | }, |
42 | - setup() { | 44 | + setup(props) { |
43 | const BAI_DU_MAP_URL = | 45 | const BAI_DU_MAP_URL = |
44 | 'https://api.map.baidu.com/getscript?v=3.0&ak=7uOPPyAHn2Y2ZryeQqHtcRqtIY374vKa'; | 46 | 'https://api.map.baidu.com/getscript?v=3.0&ak=7uOPPyAHn2Y2ZryeQqHtcRqtIY374vKa'; |
45 | const wrapRef = ref<HTMLDivElement | null>(null); | 47 | const wrapRef = ref<HTMLDivElement | null>(null); |
@@ -79,10 +81,26 @@ | @@ -79,10 +81,26 @@ | ||
79 | map.enableScrollWheelZoom(true); | 81 | map.enableScrollWheelZoom(true); |
80 | map.addOverlay(marker); | 82 | map.addOverlay(marker); |
81 | } | 83 | } |
84 | + const { createMessage } = useMessage(); | ||
85 | + const { clipboardRef } = useCopyToClipboard(); | ||
86 | + const copyDeviceId = () => { | ||
87 | + clipboardRef.value = props.deviceDetail.id; | ||
88 | + if (unref(clipboardRef)) { | ||
89 | + createMessage.success('复制成功~'); | ||
90 | + } | ||
91 | + }; | ||
92 | + const copyToken = () => { | ||
93 | + clipboardRef.value = props.deviceDetail.deviceToken; | ||
94 | + if (unref(clipboardRef)) { | ||
95 | + createMessage.success('复制成功~'); | ||
96 | + } | ||
97 | + }; | ||
82 | 98 | ||
83 | return { | 99 | return { |
84 | columns, | 100 | columns, |
85 | wrapRef, | 101 | wrapRef, |
102 | + copyDeviceId, | ||
103 | + copyToken, | ||
86 | initMap, | 104 | initMap, |
87 | }; | 105 | }; |
88 | }, | 106 | }, |
@@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
6 | <a-button type="primary" @click="handleCreate"> 新增设备 </a-button> | 6 | <a-button type="primary" @click="handleCreate"> 新增设备 </a-button> |
7 | </template> | 7 | </template> |
8 | <template #deviceProfile="{ record }"> | 8 | <template #deviceProfile="{ record }"> |
9 | - <a-button type="link" class="ml-2" @click="goDeviceProfile"> | 9 | + <!-- <a-button type="link" class="ml-2" @click="goDeviceProfile"> |
10 | {{ record.deviceProfile.name }} | 10 | {{ record.deviceProfile.name }} |
11 | - </a-button> | 11 | + </a-button> --> |
12 | </template> | 12 | </template> |
13 | <template #organizationId="{ record }"> | 13 | <template #organizationId="{ record }"> |
14 | {{ record.organizationDTO.name }} | 14 | {{ record.organizationDTO.name }} |
@@ -127,7 +127,7 @@ | @@ -127,7 +127,7 @@ | ||
127 | title: '操作', | 127 | title: '操作', |
128 | dataIndex: 'action', | 128 | dataIndex: 'action', |
129 | slots: { customRender: 'action' }, | 129 | slots: { customRender: 'action' }, |
130 | - fixed: undefined, | 130 | + fixed: 'right', |
131 | }, | 131 | }, |
132 | }); | 132 | }); |
133 | const handleReload = () => { | 133 | const handleReload = () => { |
@@ -112,8 +112,6 @@ | @@ -112,8 +112,6 @@ | ||
112 | codeTown: fieldsValue.nameTown, | 112 | codeTown: fieldsValue.nameTown, |
113 | qrCode: qrcodePic.value, | 113 | qrCode: qrcodePic.value, |
114 | }; | 114 | }; |
115 | - console.log(fieldsValue); | ||
116 | - console.log(newFieldValue); | ||
117 | await updateEnterPriseDetail(newFieldValue); | 115 | await updateEnterPriseDetail(newFieldValue); |
118 | compState.value.loading = false; | 116 | compState.value.loading = false; |
119 | createMessage.success('更新信息成功'); | 117 | createMessage.success('更新信息成功'); |
@@ -261,10 +259,10 @@ | @@ -261,10 +259,10 @@ | ||
261 | 259 | ||
262 | onMounted(async () => { | 260 | onMounted(async () => { |
263 | const res = await getEnterPriseDetail(); | 261 | const res = await getEnterPriseDetail(); |
264 | - updateCityData(res.codeProv, res.codeCity, res.codeCoun, res.codeTown); | 262 | + const { codeProv, codeCity, codeCoun, codeTown } = res.sysTown; |
263 | + updateCityData(codeProv, codeCity, codeCoun, codeTown); | ||
265 | setFieldsValue(res); | 264 | setFieldsValue(res); |
266 | qrcodePic.value = res.qrCode; | 265 | qrcodePic.value = res.qrCode; |
267 | - console.log(res); | ||
268 | }); | 266 | }); |
269 | 267 | ||
270 | return { | 268 | return { |