-
+
+
diff --git a/src/views/iot/deviceType/ParamWrap.vue b/src/views/iot/deviceType/ParamWrap.vue
new file mode 100644
index 00000000..48c86af4
--- /dev/null
+++ b/src/views/iot/deviceType/ParamWrap.vue
@@ -0,0 +1,214 @@
+
+
+
+
+
+
+
+
+ {{ scope.row.paramKeyError }}
+
+
+
+
+
+
+
+ {{ scope.row.paramNameError }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加参数
+
+
+
+
+
+
+
diff --git a/src/views/iot/deviceType/index.vue b/src/views/iot/deviceType/index.vue
new file mode 100644
index 00000000..a62155b6
--- /dev/null
+++ b/src/views/iot/deviceType/index.vue
@@ -0,0 +1,383 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.status === '0' ? '启用' : '停用' }}
+
+
+
+
+
+
+ 修改
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dict.dictLabel }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/model/index.vue b/src/views/iot/model/index.vue
index 19eaec67..53103326 100644
--- a/src/views/iot/model/index.vue
+++ b/src/views/iot/model/index.vue
@@ -316,12 +316,13 @@
placeholder="请选择设备类型"
size="small"
style="width: 100%"
+ @change="handleDeviceTypeChange"
>
@@ -335,7 +336,7 @@
@@ -470,6 +471,7 @@ import groupForm from "@/views/profile/attribute/groupForm";
import paramsJson from "@/views/profile/attribute/paramsJson";
import { listModelSeries, getModelSeries } from "@/api/iot/modelSeries";
import ParamsJsonWrap from "@/views/profile/attribute/paramsJson";
+import { listDeviceType } from '../../../api/iot/deviceType'
const deviceStartsOpt = {
0: "禁用",
@@ -612,10 +614,26 @@ export default {
},
// 查询设备类型列表
getDeviceTypeList() {
- listDeviceTypeList().then(response => {
- this.deviceTypeList = response.data;
+ listDeviceType({pageNum: 1,pageSize: 999,status: 0}).then(response => {
+ if(response.rows){
+ this.deviceTypeList = response.rows.map(item => {
+ let categoryParamList = [];
+ if(item.categoryParam){
+ categoryParamList = JSON.parse(item.categoryParam) || []
+ }
+ return {
+ ...item,
+ categoryParamList
+ };
+ });
+ }else{
+ this.deviceTypeList = [];
+ }
});
},
+ handleDeviceTypeChange(e){
+ this.form.paramList = this.deviceTypeList.find(item => item.categoryKey === e).categoryParamList || [];
+ },
openProductTableSelectDialog() {
this.selectResult = {};
this.tableSelectOption = {
diff --git a/src/views/iot/modelScries/index.vue b/src/views/iot/modelScries/index.vue
index aa3873a7..43e2fd62 100644
--- a/src/views/iot/modelScries/index.vue
+++ b/src/views/iot/modelScries/index.vue
@@ -217,12 +217,13 @@
placeholder="请选择设备类型"
size="small"
style="width: 100%"
+ @change="handleDeviceTypeChange"
>
@@ -236,7 +237,7 @@
@@ -325,6 +326,7 @@ import paramsJson from "@/views/profile/attribute/paramsJson";
import ParamWrap from "@/components/ParamWrap/deviceParam";
import AttributeView from "@/views/profile/attribute/index";
import ParamsJsonWrap from "@/views/profile/attribute/paramsJson";
+import { listDeviceType } from '../../../api/iot/deviceType'
export default {
name: "ModelSeries",
@@ -457,10 +459,26 @@ export default {
},
// 查询设备类型列表
getDeviceTypeList() {
- listDeviceTypeList().then((response) => {
- this.deviceTypeList = response.data;
+ listDeviceType({pageNum: 1,pageSize: 999,status: 0}).then(response => {
+ if(response.rows){
+ this.deviceTypeList = response.rows.map(item => {
+ let categoryParamList = [];
+ if(item.categoryParam){
+ categoryParamList = JSON.parse(item.categoryParam) || []
+ }
+ return {
+ ...item,
+ categoryParamList
+ };
+ });
+ }else{
+ this.deviceTypeList = [];
+ }
});
},
+ handleDeviceTypeChange(e){
+ this.form.paramList = this.deviceTypeList.find(item => item.categoryKey === e).categoryParamList || [];
+ },
sortChange(column) {
const sort = {
isAsc: column.order === "descending" ? "desc" : "asc",
diff --git a/src/views/iot/project/index.vue b/src/views/iot/project/index.vue
index 318568cf..9bc973d1 100644
--- a/src/views/iot/project/index.vue
+++ b/src/views/iot/project/index.vue
@@ -451,7 +451,7 @@ const selectDeviceTable = {
params: {
deviceName: "",
parentId: 0,
- deviceType: "MINIATURE_BREAKER",
+ deviceType: "10002",
},
inline: true,
queryChilds: [
diff --git a/src/views/iot/project/profile/spaceDevice.vue b/src/views/iot/project/profile/spaceDevice.vue
index 3a1fc93e..56f9c5f0 100644
--- a/src/views/iot/project/profile/spaceDevice.vue
+++ b/src/views/iot/project/profile/spaceDevice.vue
@@ -25,7 +25,7 @@
size="mini"
type="text"
icon="el-icon-delete"
- v-if="scope.row.deviceType !== 'MINIATURE_BREAKER'"
+ v-if="scope.row.deviceType !== '10002'"
@click="handleDelete(scope.row)"
>删除
@@ -163,7 +163,7 @@ export default {
deviceName: "",
modelId: "",
parentId: 0,
- deviceType: "GATEWAY_CONTROLLER"
+ deviceType: "10001"
},
page: {
pageSize: 10,
diff --git a/src/views/iot/project/profileV2/DeviceGroupDevice.vue b/src/views/iot/project/profileV2/DeviceGroupDevice.vue
index ddb7ad77..a89178b8 100644
--- a/src/views/iot/project/profileV2/DeviceGroupDevice.vue
+++ b/src/views/iot/project/profileV2/DeviceGroupDevice.vue
@@ -22,7 +22,7 @@
删除
@@ -163,7 +163,7 @@ export default {
deviceName: "",
modelId: "",
parentId: 0,
- deviceType: "GATEWAY_CONTROLLER"
+ deviceType: "10001"
},
page: {
pageSize: 10,
diff --git a/src/views/iot/video/camera/index.vue b/src/views/iot/video/camera/index.vue
index 836286cd..9ad8752c 100644
--- a/src/views/iot/video/camera/index.vue
+++ b/src/views/iot/video/camera/index.vue
@@ -494,7 +494,7 @@ const selectDevieTable = {
labelWidth: "68px",
params: {
deviceName: "",
- deviceType: "VIDEO_MONITOR",
+ deviceType: "10007",
},
inline: true,
queryChilds: [
diff --git a/src/views/personal/circuitBreaker/index.vue b/src/views/personal/circuitBreaker/index.vue
index e5f72f79..aef7b10d 100644
--- a/src/views/personal/circuitBreaker/index.vue
+++ b/src/views/personal/circuitBreaker/index.vue
@@ -277,7 +277,7 @@ export default {
});
},
deviceTypeChange(val) {
- if (val !== "MINIATURE_BREAKER") {
+ if (val !== "10002") {
this.form.parentId = 0;
this.form.parentName = "";
} else if (!val) {
@@ -295,7 +295,7 @@ export default {
getList() {
this.loading = true;
listDevice(Object.assign(this.queryParams , {
- deviceType: 'GATEWAY_CONTROLLER'
+ deviceType: '10001'
})).then(response => {
this.deviceList = response.rows;
this.total = response.total;
@@ -358,7 +358,7 @@ export default {
if (valid) {
this.form.paramList = this.$refs.paramWrap.getResult();
this.form.lineType =
- this.form.deviceType === "MINIATURE_BREAKER"
+ this.form.deviceType === "10002"
? this.form.lineType
: undefined;
if (this.form.deviceId != null) {
diff --git a/src/views/personal/device/index.vue b/src/views/personal/device/index.vue
index 0a0b8c0f..19e3a89f 100644
--- a/src/views/personal/device/index.vue
+++ b/src/views/personal/device/index.vue
@@ -31,10 +31,10 @@
@@ -130,6 +130,7 @@ import {
// import { listDeviceTypeList } from "@/api/tenant/device";
import DetailsWrap from "./profile/details";
import GatewayDetail from '@/views/profile/DeviceDetailsView/index'
+import { listDeviceType } from '../../../api/iot/deviceType'
const deviceStatusOpt = {
ONLINE: "在线",
OFFLINE: "离线",
@@ -185,7 +186,7 @@ export default {
isAsc: "desc"
},
// 表单校验
- deviceTypeList: {}
+ deviceTypeList: []
};
},
created() {
@@ -219,14 +220,14 @@ export default {
},
handleDetails(row) {
this.sourceId = row.deviceId;
- this.componectVal = row.deviceType === 'GATEWAY_CONTROLLER'? 'GatewayDetail' : "DetailsWrap";
+ this.componectVal = row.deviceType === '10001'? 'GatewayDetail' : "DetailsWrap";
},
// 跳转详情页
toTableClick() {
this.componectVal = "";
},
deviceTypeChange(val) {
- if (val !== "MINIATURE_BREAKER") {
+ if (val !== "10002") {
this.form.parentId = 0;
this.form.parentName = "";
} else if (!val) {
@@ -236,8 +237,12 @@ export default {
},
// 查询设备类型列表
getDeviceTypeList() {
- listDeviceTypeList().then(response => {
- this.deviceTypeList = response.data;
+ listDeviceType({pageNum: 1,pageSize: 999,status: 0}).then(response => {
+ if(response.rows){
+ this.deviceTypeList = response.rows || [];
+ }else{
+ this.deviceTypeList = [];
+ }
});
},
/** 查询设备列表 */
diff --git a/src/views/personal/device/profile/details.vue b/src/views/personal/device/profile/details.vue
index df4e79b9..d178283b 100644
--- a/src/views/personal/device/profile/details.vue
+++ b/src/views/personal/device/profile/details.vue
@@ -40,7 +40,7 @@