From beebc3fafa63b67a84af99d8f1b1ebc2cf035ae2 Mon Sep 17 00:00:00 2001
From: blp <2962632571@qq.com>
Date: Wed, 8 Feb 2023 14:43:13 +0800
Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=A0=B7=E5=BC=8F=E5=86=B2=E7=AA=81?=
=?UTF-8?q?=EF=BC=8C=E7=B1=BB=E5=90=8D=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/iot-card/CardManagement/Detail/index.vue | 8 ++++----
src/views/iot-card/Dashboard/index.vue | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/views/iot-card/CardManagement/Detail/index.vue b/src/views/iot-card/CardManagement/Detail/index.vue
index 580fe4df..e36063b1 100644
--- a/src/views/iot-card/CardManagement/Detail/index.vue
+++ b/src/views/iot-card/CardManagement/Detail/index.vue
@@ -119,7 +119,7 @@
-
+
昨日流量消耗
@@ -137,7 +137,7 @@
/>
-
+
当月流量消耗
@@ -152,7 +152,7 @@
-
+
本年流量消耗
@@ -328,7 +328,7 @@ getDataTotal();
align-items: center;
padding: 20px;
- .info {
+ .flow-info {
// width: 180px;
width: 28%;
.label {
diff --git a/src/views/iot-card/Dashboard/index.vue b/src/views/iot-card/Dashboard/index.vue
index 4bc42f09..ece76606 100644
--- a/src/views/iot-card/Dashboard/index.vue
+++ b/src/views/iot-card/Dashboard/index.vue
@@ -7,7 +7,7 @@
-
+
昨日流量消耗
@@ -27,7 +27,7 @@
-
+
当月流量消耗
@@ -44,7 +44,7 @@
-
+
本年流量消耗
@@ -279,7 +279,7 @@ getDataTotal();
align-items: center;
padding: 20px;
- .info {
+ .flow-info {
// width: 180px;
width: 28%;
.label {
From 839d14937da27654bf5fcf99d58b37603cce2520 Mon Sep 17 00:00:00 2001
From: xiongqian <2167232911@qq.com>
Date: Wed, 8 Feb 2023 17:00:43 +0800
Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E4=BA=A7=E5=93=81=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Product/Detail/DeviceAccess/index.css | 59 ++++++++++++++++
src/views/device/Product/Save/index.vue | 27 ++++++--
src/views/device/Product/index.vue | 67 +++++++++++++++++--
3 files changed, 142 insertions(+), 11 deletions(-)
create mode 100644 src/views/device/Product/Detail/DeviceAccess/index.css
diff --git a/src/views/device/Product/Detail/DeviceAccess/index.css b/src/views/device/Product/Detail/DeviceAccess/index.css
new file mode 100644
index 00000000..beb6493a
--- /dev/null
+++ b/src/views/device/Product/Detail/DeviceAccess/index.css
@@ -0,0 +1,59 @@
+.config .title {
+ width: 100%;
+ margin-bottom: 10px;
+ color: rgba(0, 0, 0, 0.8);
+ font-weight: 600;
+}
+.config .title::before {
+ margin-right: 10px;
+ background-color: #2810ff;
+ content: '|';
+}
+.config .item {
+ margin-bottom: 10px;
+}
+.config .item .context {
+ margin: 5px 0;
+ color: rgba(0, 0, 0, 0.8);
+}
+.info {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 630px;
+ padding: 20px;
+ background-color: #e6e6e6;
+}
+.driver .driver-next-btn {
+ color: #fff !important;
+ font-size: 14px !important;
+ line-height: 22px !important;
+ text-shadow: 0 0 black !important;
+ background-color: #2f54eb !important;
+}
+.driver .driver-prev-btn {
+ font-size: 14px !important;
+ line-height: 22px !important;
+ background-color: #fff !important;
+}
+.driver .driver-prev-btn.driver-disabled {
+ display: none !important;
+}
+.driver .driver-close-btn {
+ padding: 5px 0 0 0 !important;
+ color: #828282 !important;
+ font-size: 14px !important;
+ background-color: #fff !important;
+ border: none !important;
+}
+.driver .driver-popover-description {
+ margin-bottom: 10px !important;
+}
+.driver .driver-popover-title {
+ display: flex !important;
+ justify-content: space-between !important;
+}
+.driver .driver-popover-title #guide {
+ margin-top: 3px;
+ font-size: 14px;
+}
diff --git a/src/views/device/Product/Save/index.vue b/src/views/device/Product/Save/index.vue
index 15881242..26f9a59c 100644
--- a/src/views/device/Product/Save/index.vue
+++ b/src/views/device/Product/Save/index.vue
@@ -487,6 +487,7 @@ defineExpose({
.button-style {
background-color: #fff;
height: 66px;
+ overflow: hidden;
.card-content {
width: 100%;
.img-style {
@@ -498,23 +499,35 @@ defineExpose({
right: -22px;
bottom: -22px;
z-index: 2;
+
width: 44px;
height: 44px;
- color: #2f54eb;
- // background-color: #2f54eb;
+ color: #fff;
+ background-color: @primary-color-active;
transform: rotate(-45deg);
> div {
position: relative;
height: 100%;
transform: rotate(45deg);
- background-color: transparent;
+
+ > span {
+ position: absolute;
+ top: 6px;
+ left: 6px;
+ font-size: 12px;
+ }
+ }
+ }
+ &.checked {
+ position: relative;
+ color: @primary-color-active;
+ border-color: @primary-color-active;
+
+ > .checked-icon {
+ display: block;
}
}
}
- // &:hover {
- // color: #2f54eb;
- // border: 1px solid #2f54eb;
- // }
}
diff --git a/src/views/device/Product/index.vue b/src/views/device/Product/index.vue
index 68c98dc4..a35bffd1 100644
--- a/src/views/device/Product/index.vue
+++ b/src/views/device/Product/index.vue
@@ -15,9 +15,19 @@
:params="params"
>
- 新增
+
+ 新增
+
+ 导入
+
+
{{ slotProps.deviceType.text }}
@@ -172,8 +182,10 @@ import {
addProduct,
editProduct,
queryProductId,
+ updateDevice,
} from '@/api/device/product';
-import { isNoCommunity } from '@/utils/utils';
+import { isNoCommunity, downloadObject } from '@/utils/utils';
+import { omit } from 'lodash-es';
import { typeOptions } from '@/components/Search/util';
import Save from './Save/index.vue';
/**
@@ -293,6 +305,17 @@ const getActions = (
},
icon: 'icon-xiazai',
+ onClick: () => {
+ const extra = omit(data, [
+ 'transportProtocol',
+ 'protocolName',
+ 'accessId',
+ 'accessName',
+ 'accessProvider',
+ 'messageProtocol',
+ ]);
+ downloadObject(extra, '产品');
+ },
},
{
key: 'action',
@@ -356,6 +379,42 @@ const add = () => {
saveRef.value.show(currentForm.value);
});
};
+
+/**
+ * 导入
+ */
+const beforeUpload = (file: any) => {
+ const reader = new FileReader();
+ reader.readAsText(file);
+ reader.onload = async (result) => {
+ const text = result.target?.result;
+ console.log('text: ', text);
+ if (!file.type.includes('json')) {
+ message.error('请上传json格式文件');
+ return false;
+ }
+ try {
+ const data = JSON.parse(text || '{}');
+ // 设置导入的产品状态为未发布
+ data.state = 0;
+ if (Array.isArray(data)) {
+ message.error('请上传json格式文件');
+ return false;
+ }
+ delete data.state;
+ const res = await updateDevice(data);
+ if (res.status === 200) {
+ message.success('操作成功');
+ tableRef.value?.reload();
+ }
+ return true;
+ } catch {
+ message.error('请上传json格式文件');
+ }
+ return true;
+ };
+ return false;
+};
/**
* 查看
*/