diff --git a/src/api/device.ts b/src/api/device.ts
index fc5a495..eab5ef1 100644
--- a/src/api/device.ts
+++ b/src/api/device.ts
@@ -61,7 +61,7 @@ export function createDevice(data: DeviceCreateRecord) {
return axios.post(`/api/rest/device`, data);
}
-// 修改
+// 编辑
export function updateDevice(data: DeviceUpdateRecord) {
return axios.patch(`/api/rest/device/${data.id}`, data);
}
diff --git a/src/api/product.ts b/src/api/product.ts
index 7554b52..f527438 100644
--- a/src/api/product.ts
+++ b/src/api/product.ts
@@ -57,7 +57,7 @@ export function createProduct(data: ProductCreateRecord) {
return axios.post(`/api/rest/product`, data);
}
-// 修改
+// 编辑
export function updateProduct(data: ProductUpdateRecord) {
return axios.patch(`/api/rest/product/${data.id}`, data);
}
diff --git a/src/components/message-box/index.vue b/src/components/message-box/index.vue
index df0542f..474c0de 100644
--- a/src/components/message-box/index.vue
+++ b/src/components/message-box/index.vue
@@ -78,7 +78,7 @@
}
}
- // 修改消息状态
+ // 编辑消息状态
async function readMessage(data: MessageListType) {
const ids = data.map((item) => item.messageId);
await useMessageStore.setMessageStatus(ids);
@@ -104,7 +104,7 @@
const list = getUnreadList(type);
return list.length ? `(${list.length})` : ``;
};
- // 修改已读状态
+ // 编辑已读状态
const handleItemClick = (items: MessageListType) => {
if (renderList.value.length) readMessage([...items]);
};
diff --git a/src/router/routes/modules/iot.ts b/src/router/routes/modules/iot.ts
index 33bbe27..70d8e4d 100644
--- a/src/router/routes/modules/iot.ts
+++ b/src/router/routes/modules/iot.ts
@@ -73,6 +73,19 @@ const IOT: AppRouteRecordRaw = {
permissions: ['iot:device:query'],
},
},
+ {
+ path: 'cardDevice/:id',
+ name: 'cardDeviceDetail',
+ component: () =>
+ import('@/views/iot/deviceCard/components/device-detail.vue'),
+ meta: {
+ locale: '设备详情',
+ title: '设备详情',
+ requiresAuth: true,
+ showInMenu: false,
+ permissions: ['iot:device:query'],
+ },
+ },
{
path: 'product/tsl/:id',
name: 'productTsl',
diff --git a/src/views/iot/device/components/device-detail.vue b/src/views/iot/device/components/device-detail.vue
index 661f1a6..05bd629 100644
--- a/src/views/iot/device/components/device-detail.vue
+++ b/src/views/iot/device/components/device-detail.vue
@@ -41,7 +41,7 @@
style="padding-top: 20px"
>
-
+
基本信息
diff --git a/src/views/iot/device/components/device-edit.vue b/src/views/iot/device/components/device-edit.vue
index 4ffeeb8..f613e82 100644
--- a/src/views/iot/device/components/device-edit.vue
+++ b/src/views/iot/device/components/device-edit.vue
@@ -17,7 +17,7 @@
@click="handleClick"
>
- 修改
+ 编辑
-
+
取消
- 确定确定
@@ -319,7 +318,7 @@
const res = await updateDevice(formData.value);
if (res.status === 200) {
Message.success({
- content: '修改成功',
+ content: '编辑成功',
duration: 5 * 1000,
});
emit('refresh');
diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue
index ec19e55..2ec657e 100644
--- a/src/views/iot/device/index.vue
+++ b/src/views/iot/device/index.vue
@@ -30,13 +30,20 @@
-
+
+ @search="handleSearch"
+ >
+ {{
+ item.name
+ }}
+
@@ -163,6 +170,9 @@
{{ record.id }}
+
+ {{ record.state == "UNACTIVATED" ? '未激活' : '激活'}}
+
{{ record.online == true ? '是' : '否' }}
@@ -224,7 +234,7 @@
import useTableOption from '@/hooks/table-option';
import { Message } from '@arco-design/web-vue';
import { useRouter } from 'vue-router';
- import { deleteDevice, DeviceRecord, queryDeviceList } from '@/api/device';
+ import { deleteDevice, DeviceRecord, queryDeviceByName, queryDeviceList } from '@/api/device';
import DeviceEdit from '@/views/iot/device/components/device-edit.vue';
const generateFormModel = () => {
@@ -296,14 +306,7 @@
value: 'false',
},
]);
- const productOptions = computed(() => {
- return [
- {
- label: '全部',
- value: '',
- },
- ];
- });
+ const options = ref([]);
// 获取设备列表
const fetchData = async (params = { size: 10, current: 1 }) => {
@@ -327,6 +330,30 @@
} as unknown as DeviceRecord);
};
+ // 搜索
+ const handleSearch = (value: any) => {
+ if (value) {
+ loading.value = true;
+ options.value = [];
+ window.setTimeout(async () => {
+ const res = await queryDeviceByName({
+ name: value,
+ page: 1,
+ size: 5,
+ });
+ options.value = res.data.records.map((item: any) => {
+ return {
+ id: item.id,
+ name: item.name,
+ };
+ });
+ loading.value = false;
+ }, 1000);
+ } else {
+ options.value = [];
+ }
+ };
+
// 分页发生改变
const onPageChange = (current: number) => {
pagination.value.page = current;
diff --git a/src/views/iot/deviceCard/components/card-wrap.vue b/src/views/iot/deviceCard/components/card-wrap.vue
index 2f99997..c02196c 100644
--- a/src/views/iot/deviceCard/components/card-wrap.vue
+++ b/src/views/iot/deviceCard/components/card-wrap.vue
@@ -81,10 +81,12 @@
default: '',
},
});
+ const emit = defineEmits(['search']);
+
// 打开详情
function openDetail(id: number): void {
const url = router.resolve({
- name: 'deviceDetail',
+ name: 'cardDeviceDetail',
params: { id },
}).href;
router.push(url);
@@ -97,6 +99,7 @@
content: '删除成功',
duration: 5 * 1000,
});
+ emit('search');
}
};
diff --git a/src/views/iot/deviceCard/components/device-detail.vue b/src/views/iot/deviceCard/components/device-detail.vue
index 79b60f8..77e9ce3 100644
--- a/src/views/iot/deviceCard/components/device-detail.vue
+++ b/src/views/iot/deviceCard/components/device-detail.vue
@@ -40,7 +40,7 @@
style="padding-top: 20px"
>
-
+
基本信息
diff --git a/src/views/iot/deviceCard/components/device-edit.vue b/src/views/iot/deviceCard/components/device-edit.vue
index edc4ae0..5b8e668 100644
--- a/src/views/iot/deviceCard/components/device-edit.vue
+++ b/src/views/iot/deviceCard/components/device-edit.vue
@@ -35,7 +35,7 @@
@click="handleClick"
>
- 修改
+ 编辑
diff --git a/src/views/iot/product/components/product-edit.vue b/src/views/iot/product/components/product-edit.vue
index 54c8794..3628e04 100644
--- a/src/views/iot/product/components/product-edit.vue
+++ b/src/views/iot/product/components/product-edit.vue
@@ -17,7 +17,7 @@
@click="handleClick"
>
- 修改
+ 编辑
- 修改
+ 编辑
- 修改
+ 编辑
- 修改
+ 编辑
- 修改
+ 编辑
- 修改
+ 编辑
- 修改
+ 编辑
- 修改
+ 编辑
{
- const result = {}; // 报错修改的字段内容
+ const result = {}; // 报错编辑的字段内容
Object.keys(oldData).forEach((key) => {
if (oldData[key] !== newData[key]) {
result[key] = newData[key];
@@ -241,7 +241,7 @@
// const res = await userStore.updateUser(formData.value);
// if (res.status === 200) {
// Message.success({
- // content: '修改成功',
+ // content: '编辑成功',
// duration: 5 * 1000,
// });
// }
@@ -249,7 +249,7 @@
const res = await userStore.updateUser(formData.value);
if (res.status === 200) {
Message.success({
- content: '修改成功',
+ content: '编辑成功',
duration: 5 * 1000,
});
}
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 3292c39..8d736e0 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -405,12 +405,12 @@
const res = await userStore.enabledUser(record.id);
if (res.status === 200) {
Message.success({
- content: '修改状态成功',
+ content: '编辑状态成功',
duration: 3 * 1000,
});
} else {
Message.error({
- content: '修改状态失败',
+ content: '编辑状态失败',
duration: 3 * 1000,
});
}
diff --git a/src/views/system/user/locale/zh-CN.ts b/src/views/system/user/locale/zh-CN.ts
index 8e0dac9..7a063bf 100644
--- a/src/views/system/user/locale/zh-CN.ts
+++ b/src/views/system/user/locale/zh-CN.ts
@@ -37,8 +37,8 @@ export default {
'searchTable.actions.columnSetting': '列设置',
// modify
- 'modify.user.info.sucess': '修改成功',
- 'modify.user.info.fail': '修改失败',
+ 'modify.user.info.sucess': '编辑成功',
+ 'modify.user.info.fail': '编辑失败',
'user.info.username': '用户名',
'user.info.username.placeholder': '请输入用户名',
@@ -69,5 +69,5 @@ export default {
// modalTitle
'createUser': '新增用户',
- 'editUser': '修改用户信息',
+ 'editUser': '编辑用户信息',
};
diff --git a/src/views/user/setting/locale/zh-CN.ts b/src/views/user/setting/locale/zh-CN.ts
index cb47d6e..5e5b254 100644
--- a/src/views/user/setting/locale/zh-CN.ts
+++ b/src/views/user/setting/locale/zh-CN.ts
@@ -58,9 +58,9 @@ export default {
'userSetting.SecuritySettings.placeholder.email':
'您暂未设置邮箱,绑定邮箱可以用来找回密码、接收通知等。',
'userSetting.SecuritySettings.button.settings': '设置',
- 'userSetting.SecuritySettings.button.update': '修改',
+ 'userSetting.SecuritySettings.button.update': '编辑',
'userSetting.certification.title.enterprise': '企业实名认证',
- 'userSetting.certification.extra.enterprise': '修改认证主体',
+ 'userSetting.certification.extra.enterprise': '编辑认证主体',
'userSetting.certification.label.accountType': '账号类型',
'userSetting.certification.label.status': '认证状态',
'userSetting.certification.label.time': '认证时间',