@@ -402,7 +405,7 @@ export default {
text-align: left;
width: 100%;
float: left;
- height: 40px;
+ height: auto;
.top-label {
float: left;
width: calc(100% - 200px);
diff --git a/src/views/tenant/device/index.vue b/src/views/tenant/device/index.vue
index cf1b27de..96bb3f9a 100644
--- a/src/views/tenant/device/index.vue
+++ b/src/views/tenant/device/index.vue
@@ -73,6 +73,17 @@
+
+
+
+
+
@@ -82,6 +93,11 @@
未激活
+
+
+ {{ val }}
+
+
返回列表
+
+
+
@@ -124,6 +143,7 @@ import {
} from "@/api/tenant/device";
import DetailsWrap from './profile/details'
import GatewayDetail from '@/views/profile/DeviceDetailsView/index'
+import JsBarcode from "jsbarcode";
const deviceStatusOpt = {
ONLINE: "在线",
OFFLINE: "离线",
@@ -145,6 +165,8 @@ export default {
return {
deviceStatusOpt,
lineTypeOpt,
+ imgModelShow:false,
+ qrCodeUrl:'',
sourceId: "",
componectVal: "",
selectTableShow: false,
@@ -190,6 +212,10 @@ export default {
this.getList();
},
methods: {
+ lookQrCode(url){
+ this.qrCodeUrl = url;
+ this.imgModelShow = true;
+ },
sortChange(column) {
const sort = {
isAsc: column.order === "descending" ? "desc" : "asc",
@@ -234,9 +260,29 @@ export default {
getList() {
this.loading = true;
listDevice(this.queryParams).then(response => {
- this.deviceList = response.rows;
+ let list = response.rows.map(item=>{
+ if(item.deviceLabel && item.deviceLabel[0] == '空间'){
+ item.deviceLabel.shift();
+ return item;
+ }
+ return item;
+ })
+ this.deviceList = list;
this.total = response.total;
this.loading = false;
+ this.$nextTick(() => {
+ this.deviceList.forEach((item,index) => {
+ JsBarcode(this.$refs["qrCodeDiv" + item.deviceKey], item.deviceKey, {
+ format: "CODE128", //条形码的格式
+ width: 2, //线宽
+ height: 65, //条码高度
+ lineColor: "#000", //线条颜色
+ displayValue: true, //是否显示文字
+ margin: 3 //设置条形码周围的空白区域
+ });
+ this.deviceList[index].qrCodeUrl=this.$refs["qrCodeDiv" + item.deviceKey].src;
+ })
+ })
});
},
/** 搜索按钮操作 */
diff --git a/src/views/tenant/device/profile/details.vue b/src/views/tenant/device/profile/details.vue
index a46a07f3..1c36b5de 100644
--- a/src/views/tenant/device/profile/details.vue
+++ b/src/views/tenant/device/profile/details.vue
@@ -1,10 +1,10 @@
-
+
- {{item.deviceName}}
+ {{item.deviceName}}
@@ -17,9 +17,9 @@
@@ -30,7 +30,7 @@
-
+
-
+
@@ -108,6 +108,9 @@ export default {
// 设备详情
deviceInfo() {
getDevice(this.deviceId).then(response => {
+ if(response.data.deviceLabel && response.data.deviceLabel[0] == '空间'){
+ response.data.deviceLabel.shift();
+ }
this.infoData = response.data;
if (this.breadcrumbList.length <= 0) {
this.breadcrumbList.push(this.infoData);
diff --git a/src/views/tenant/device/profile/info.vue b/src/views/tenant/device/profile/info.vue
index 1a41a3fd..0548d1f2 100644
--- a/src/views/tenant/device/profile/info.vue
+++ b/src/views/tenant/device/profile/info.vue
@@ -11,13 +11,16 @@
+
+ {{ val }}
+
设备Key
{{infoData.deviceKey}}
- 复制
+ 复制
@@ -32,25 +35,25 @@
********
{{infoData.devicePassword}}
显示
复制
隐藏
@@ -72,25 +75,25 @@
********
{{infoData.deviceSecret}}
显示
复制
隐藏
@@ -104,10 +107,10 @@
当前状态
-
在线
-
离线
-
脱线
-
未激活
+
在线
+
离线
+
脱线
+
未激活
@@ -163,7 +166,7 @@ export default {
text-align: left;
width: 100%;
float: left;
- height: 40px;
+ height: auto;
.top-label {
float: left;
width: calc(100% - 200px);