Commit 59bfea9ee0a3e73f402ab0a132d9fa8db82fbe1c

Authored by xp.Huang
2 parents 65f607a6 46b59c87

Merge branch 'sqy_dev' into 'main'

调整bug,修复

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