diff --git a/.env.development b/.env.development
index 2744ed2..e8590b2 100644
--- a/.env.development
+++ b/.env.development
@@ -1,8 +1,8 @@
# 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 木鸢物联平台
# 开发环境配置
VITE_APP_ENV = 'development'
-# 若依管理系统/开发环境
+# 木鸢物联平台/开发环境
VITE_APP_BASE_API = '/dev-api'
diff --git a/.env.production b/.env.production
index d857bba..7f0f858 100644
--- a/.env.production
+++ b/.env.production
@@ -1,10 +1,10 @@
# 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 木鸢物联平台
# 生产环境配置
VITE_APP_ENV = 'production'
-# 若依管理系统/生产环境
+# 木鸢物联平台/生产环境
VITE_APP_BASE_API = '/prod-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli
diff --git a/.env.staging b/.env.staging
index fa7c357..31589e8 100644
--- a/.env.staging
+++ b/.env.staging
@@ -1,10 +1,10 @@
# 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 木鸢物联平台
# 生产环境配置
VITE_APP_ENV = 'staging'
-# 若依管理系统/生产环境
+# 木鸢物联平台/生产环境
VITE_APP_BASE_API = '/stage-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli
diff --git a/index.html b/index.html
index 58b2893..63977d3 100644
--- a/index.html
+++ b/index.html
@@ -9,7 +9,7 @@
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
/>
-
若依管理系统
+ 木鸢物联平台
-
+
@@ -210,14 +210,15 @@
-
diff --git a/src/views/iot/device/detail-panes/DeviceLog.vue b/src/views/iot/device/detail-panes/DeviceLog.vue
new file mode 100644
index 0000000..fa6d8c8
--- /dev/null
+++ b/src/views/iot/device/detail-panes/DeviceLog.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/views/iot/device/detail-panes/OperatingStatus.vue b/src/views/iot/device/detail-panes/OperatingStatus.vue
new file mode 100644
index 0000000..55e2043
--- /dev/null
+++ b/src/views/iot/device/detail-panes/OperatingStatus.vue
@@ -0,0 +1,148 @@
+
+
+
+ 属性
+ 事件
+
+
+
+
+
+ {{
+ dataList.find((el) => el.identifier === row.identifier)?.value ??
+ "-"
+ }}
+
+
+
+
+ {{
+ dataList.find((el) => el.identifier === row.identifier)
+ ?.createTime ?? "-"
+ }}
+
+
+
+
+ 历史
+
+ 下发
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/device/detail-panes/UpgradeLog.vue b/src/views/iot/device/detail-panes/UpgradeLog.vue
new file mode 100644
index 0000000..fa6d8c8
--- /dev/null
+++ b/src/views/iot/device/detail-panes/UpgradeLog.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/views/iot/device/detail.vue b/src/views/iot/device/detail.vue
new file mode 100644
index 0000000..59cf89c
--- /dev/null
+++ b/src/views/iot/device/detail.vue
@@ -0,0 +1,304 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue
index dba50b2..0fa0f45 100644
--- a/src/views/iot/device/index.vue
+++ b/src/views/iot/device/index.vue
@@ -5,6 +5,7 @@
ref="queryRef"
:inline="true"
:model="queryParams"
+ :size="productId ? 'small' : 'default'"
label-width="68px"
>
@@ -15,7 +16,7 @@
@keyup.enter="handleQuery"
/>
-
+
-->
-
+
{{ row.groupName }}
@@ -270,12 +275,21 @@
label="操作"
>
+
+
+
+
+
+
+
+
+
修改
@@ -322,6 +336,7 @@
+
+
+
+
+
@@ -496,12 +521,30 @@ import ImageUpload from "@/components/ImageUpload/index.vue";
import { listProduct } from "@/api/product/product";
import { deviceStatusMap, isShadowDict, locationWayMap } from "@/constant/dict";
import UserTreeSelect from "@/components/UserTreeSelect/index.vue";
-import { getCurrentInstance, reactive, ref, toRefs } from "vue";
+import {
+ getCurrentInstance,
+ reactive,
+ ref,
+ shallowRef,
+ toRefs,
+ watchEffect,
+} from "vue";
import DictTag from "@/components/DictTag/index.vue";
import { parseTime } from "@/utils/ruoyi";
+import { useRouter } from "vue-router";
+import { loadMap } from "@/utils/amap";
+import MapSelect from "@/components/MapSelect/index.vue";
+const router = useRouter();
const { proxy } = getCurrentInstance();
+const props = defineProps({
+ productId: {
+ type: Number,
+ default: null,
+ },
+});
+
const deviceList = ref([]);
const open = ref(false);
const loading = ref(true);
@@ -548,6 +591,11 @@ const data = reactive({
const { queryParams, form, rules } = toRefs(data);
+watchEffect(() => {
+ queryParams.value.productId = props.productId;
+ getList();
+});
+
/** 查询设备列表 */
function getList() {
loading.value = true;
@@ -608,15 +656,22 @@ function resetQuery() {
// 多选框选中数据
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.deviceId);
- single.value = selection.length != 1;
+ single.value = selection.length !== 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
-function handleAdd() {
+async function handleAdd() {
reset();
+ form.value.productId = props.productId;
open.value = true;
title.value = "添加设备";
+ if (!AMap.value) AMap.value = await loadMap([]);
+ if (!map.value)
+ map.value = new AMap.value.Map("map-container", {
+ zoom: 11,
+ });
+ map.value.on("click", handleMapClick);
}
/** 修改按钮操作 */
@@ -630,6 +685,10 @@ function handleUpdate(row) {
});
}
+function handleDetail(row) {
+ router.push(`/device/device/detail?id=${row.deviceId}`);
+}
+
/** 提交按钮 */
function submitForm() {
proxy.$refs["deviceRef"].validate((valid) => {
@@ -693,6 +752,23 @@ const handleUserSelected = (data) => {
userOpen.value = false;
};
-getList();
+const AMap = shallowRef();
+const map = shallowRef();
+const handleMapClick = (event) => {
+ map.value.clearMap();
+ const { lnglat } = event;
+ form.value.latitude = lnglat.lat;
+ form.value.longitude = lnglat.lng;
+ const marker = new AMap.value.Marker({
+ position: lnglat,
+ });
+ map.value.add(marker);
+};
+
+const handleMapSelected = (lnglat) => {
+ form.value.latitude = lnglat.lat;
+ form.value.longitude = lnglat.lng;
+};
+
getProductOptions();
diff --git a/src/views/login.vue b/src/views/login.vue
index 17e2280..93c8a70 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -11,8 +11,8 @@
-
-