From dc486af223f7a2bbf9f781160d369c08950bf7ca Mon Sep 17 00:00:00 2001
From: 100011797 <2642441182@qq.com>
Date: Fri, 17 Mar 2023 16:32:30 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8D=A1=E7=89=87=E8=83=8C=E6=99=AF?=
=?UTF-8?q?=E9=A2=9C=E8=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...iaabled.png => access-config-disabled.png} | Bin
src/components/BadgeStatus/color.ts | 12 +-
src/components/CardBox/index.vue | 60 +++-
src/views/Northbound/AliCloud/index.vue | 40 +--
.../DuerOS/Detail/command/EditTable.vue | 156 ++++++----
.../DuerOS/Detail/command/index.vue | 293 +++++++++++-------
src/views/Northbound/DuerOS/Detail/index.vue | 14 +-
src/views/Northbound/DuerOS/index.vue | 34 +-
src/views/device/Instance/Detail/index.vue | 36 ++-
src/views/device/Instance/index.vue | 28 +-
10 files changed, 433 insertions(+), 240 deletions(-)
rename public/images/{access-config-diaabled.png => access-config-disabled.png} (100%)
diff --git a/public/images/access-config-diaabled.png b/public/images/access-config-disabled.png
similarity index 100%
rename from public/images/access-config-diaabled.png
rename to public/images/access-config-disabled.png
diff --git a/src/components/BadgeStatus/color.ts b/src/components/BadgeStatus/color.ts
index 6d9f18d3..c3f05abf 100644
--- a/src/components/BadgeStatus/color.ts
+++ b/src/components/BadgeStatus/color.ts
@@ -1,12 +1,12 @@
const color = {
- 'processing': '64, 169, 255',
- 'error': '247, 79, 70',
- 'success': '74, 234, 220',
- 'warning': '250, 178, 71',
- 'default': '63, 73, 96'
+ 'processing': '9, 46, 231',
+ 'error': '229, 0, 18',
+ 'success': '36, 178, 118',
+ 'warning': '255, 144, 0',
+ 'default': '102, 102, 102'
}
-export const getHexColor = (code: string, pe: number = 0.3) => {
+export const getHexColor = (code: string, pe: number = 0.1) => {
const _color = color[code] || color.default
if (code === 'default') {
pe = 0.1
diff --git a/src/components/CardBox/index.vue b/src/components/CardBox/index.vue
index 6174471a..4ef5c521 100644
--- a/src/components/CardBox/index.vue
+++ b/src/components/CardBox/index.vue
@@ -6,6 +6,18 @@
@click="handleClick"
>
+
+
-
-
import BadgeStatus from '@/components/BadgeStatus/index.vue';
-import { getHexColor } from '../BadgeStatus/color'
+import color, { getHexColor } from '../BadgeStatus/color';
import type { ActionsType } from '@/components/Table';
import { PropType } from 'vue';
@@ -123,6 +133,15 @@ const props = defineProps({
},
});
+const getBackgroundColor = (code: string) => {
+ const _color = color[code] || color.default;
+ return `linear-gradient(
+ 188.4deg,
+ rgba(${_color}, 0.03) 22.94%,
+ rgba(${_color}, 0) 94.62%
+ )`;
+};
+
const handleClick = () => {
emit('click', props.value);
};
@@ -257,6 +276,33 @@ const handleClick = () => {
}
}
+ .card-content-bg1 {
+ position: absolute;
+ right: -5%;
+ height: 100%;
+ width: 44.65%;
+ top: 0;
+ background: linear-gradient(
+ 188.4deg,
+ rgba(229, 0, 18, 0.03) 22.94%,
+ rgba(229, 0, 18, 0) 94.62%
+ );
+ transform: skewX(-15deg);
+ }
+
+ .card-content-bg2 {
+ position: absolute;
+ right: -5%;
+ height: 100%;
+ width: calc(44.65% + 34px);
+ top: 0;
+ background: linear-gradient(
+ 188.4deg,
+ rgba(229, 0, 18, 0.03) 22.94%,
+ rgba(229, 0, 18, 0) 94.62%
+ );
+ transform: skewX(-15deg);
+ }
.card-mask {
position: absolute;
top: 0;
@@ -268,7 +314,7 @@ const handleClick = () => {
width: 100%;
height: 100%;
color: #fff;
- background-color: rgba(#000, .5);
+ background-color: rgba(#000, 0.5);
visibility: hidden;
cursor: pointer;
transition: all 0.3s;
diff --git a/src/views/Northbound/AliCloud/index.vue b/src/views/Northbound/AliCloud/index.vue
index ec33051d..e5acf97c 100644
--- a/src/views/Northbound/AliCloud/index.vue
+++ b/src/views/Northbound/AliCloud/index.vue
@@ -27,11 +27,12 @@
@@ -39,19 +40,20 @@
-
- {{ slotProps.name }}
-
-
+
+
+ {{ slotProps.name }}
+
+
+
网桥产品
- {{ slotProps?.bridgeProductName }}
+
+ {{ slotProps?.bridgeProductName }}
+
@@ -85,9 +87,13 @@
-
@@ -100,7 +106,7 @@
:disabled="i.disabled"
:popConfirm="i.popConfirm"
:tooltip="i.tooltip"
- style="padding: 0px"
+ style="padding: 0 5px"
@click="i.onClick"
type="link"
:hasPermission="'Northbound/AliCloud:' + i.key"
@@ -116,20 +122,17 @@
\ No newline at end of file
+const onChange = () => {
+ _emit('update:modelValue', modelRef.dataSource);
+};
+
+const onSave = () =>
+ new Promise((resolve, reject) => {
+ formRef.value
+ .validate()
+ .then(() => {
+ resolve([...modelRef.dataSource]);
+ })
+ .catch(() => {
+ reject(false);
+ });
+ });
+
+defineExpose({ onSave });
+
+
+
\ No newline at end of file
diff --git a/src/views/Northbound/DuerOS/Detail/command/index.vue b/src/views/Northbound/DuerOS/Detail/command/index.vue
index efd19ebc..fc2ec36c 100644
--- a/src/views/Northbound/DuerOS/Detail/command/index.vue
+++ b/src/views/Northbound/DuerOS/Detail/command/index.vue
@@ -1,76 +1,156 @@
-
+
-
-
- 读取属性
- 修改属性
- 调用功能
+
+
+ 读取属性
+ 修改属性
+ 调用功能
-
-
-
- {{i.name}}
+
+
+
+ {{ i.name }}
-
-
+
+
-
-
- {{i.name}}
+
+
+ {{ i.name }}
-
-
-
+
+
+
@@ -78,101 +158,106 @@
\ No newline at end of file
diff --git a/src/views/Northbound/DuerOS/Detail/index.vue b/src/views/Northbound/DuerOS/Detail/index.vue
index 36894c24..46d2d739 100644
--- a/src/views/Northbound/DuerOS/Detail/index.vue
+++ b/src/views/Northbound/DuerOS/Detail/index.vue
@@ -171,7 +171,8 @@
>
保存
@@ -626,12 +631,11 @@ const saveBtn = async () => {
loading.value = true;
const resp = await savePatch(data).finally(() => {
loading.value = false;
- })
+ });
if (resp.status === 200) {
message.success('操作成功!');
formRef.value.resetFields();
menuStory.jumpPage('Northbound/DuerOS');
-
}
}
})
diff --git a/src/views/Northbound/DuerOS/index.vue b/src/views/Northbound/DuerOS/index.vue
index 7d4b4f02..c9e735d9 100644
--- a/src/views/Northbound/DuerOS/index.vue
+++ b/src/views/Northbound/DuerOS/index.vue
@@ -27,11 +27,12 @@
@@ -39,13 +40,12 @@
-
- {{ slotProps.name }}
-
-
+
+
+ {{ slotProps.name }}
+
+
+
产品
@@ -85,9 +85,13 @@
-
@@ -105,7 +109,7 @@
:tooltip="{
...i.tooltip,
}"
- style="padding: 0px"
+ style="padding: 0 5px"
@click="i.onClick"
type="link"
:hasPermission="'Northbound/DuerOS:' + i.key"
@@ -132,15 +136,12 @@ import type { ActionsType } from '@/views/device/Instance/typings';
import { getImage } from '@/utils/comm';
import { message } from 'jetlinks-ui-components';
import { useMenuStore } from 'store/menu';
+import BadgeStatus from '@/components/BadgeStatus/index.vue';
const instanceRef = ref>({});
const params = ref>({});
const menuStory = useMenuStore();
-const statusMap = new Map();
-statusMap.set('enabled', 'success');
-statusMap.set('disabled', 'error');
-
const columns = [
{
title: '名称',
@@ -193,6 +194,7 @@ const columns = [
title: '说明',
dataIndex: 'description',
key: 'description',
+ ellipsis: true,
},
{
title: '状态',
@@ -211,7 +213,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
- width: 250,
+ width: 200,
scopedSlots: true,
},
];
diff --git a/src/views/device/Instance/Detail/index.vue b/src/views/device/Instance/Detail/index.vue
index cd613b7e..5ef614f4 100644
--- a/src/views/device/Instance/Detail/index.vue
+++ b/src/views/device/Instance/Detail/index.vue
@@ -8,20 +8,25 @@
-
-
+
返回
+
{{ instanceStore.current.name }}
-
+
+ 状态:
+
+ {{ instanceStore.current.state?.text }}
+
+
{{
instanceStore.current.id
@@ -199,8 +204,8 @@ watch(
);
onMounted(() => {
- instanceStore.tabActiveKey = history.state?.params?.tab || 'Info'
-})
+ instanceStore.tabActiveKey = history.state?.params?.tab || 'Info';
+});
const onBack = () => {
menuStory.jumpPage('device/Instance');
@@ -284,7 +289,10 @@ watchEffect(() => {
tab: 'OPC UA',
});
}
- if (instanceStore.current.deviceType?.value === 'gateway' && !keys.includes('ChildDevice')) {
+ if (
+ instanceStore.current.deviceType?.value === 'gateway' &&
+ !keys.includes('ChildDevice')
+ ) {
// 产品类型为网关的情况下才显示此模块
list.value.push({
key: 'ChildDevice',
diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue
index 54f908da..82b6bd6a 100644
--- a/src/views/device/Instance/index.vue
+++ b/src/views/device/Instance/index.vue
@@ -143,7 +143,7 @@
:status="slotProps.state?.value"
:statusText="slotProps.state?.text"
:statusNames="{
- online: 'success',
+ online: 'processing',
offline: 'error',
notActive: 'warning',
}"
@@ -202,9 +202,14 @@
-
@@ -226,7 +231,7 @@
}"
@click="i.onClick"
type="link"
- style="padding: 0px"
+ style="padding: 0 5px"
:hasPermission="'device/Instance:' + i.key"
>
@@ -289,6 +294,7 @@ import { queryTree } from '@/api/device/category';
import { useMenuStore } from '@/store/menu';
import type { ActionsType } from './typings';
import dayjs from 'dayjs';
+import BadgeStatus from '@/components/BadgeStatus/index.vue';
const instanceRef = ref>({});
const params = ref>({});
@@ -303,11 +309,6 @@ const type = ref('');
const menuStory = useMenuStore();
-const statusMap = new Map();
-statusMap.set('online', 'success');
-statusMap.set('offline', 'error');
-statusMap.set('notActive', 'warning');
-
const columns = [
{
title: 'ID',
@@ -479,6 +480,7 @@ const columns = [
title: '说明',
dataIndex: 'describe',
key: 'describe',
+ ellipsis: true,
search: {
type: 'string',
},
@@ -487,7 +489,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
- width: 250,
+ width: 200,
scopedSlots: true,
},
];
@@ -525,10 +527,10 @@ const paramsFormat = (
};
onMounted(() => {
- if(history.state?.params?.type === 'add'){
- handleAdd()
+ if (history.state?.params?.type === 'add') {
+ handleAdd();
}
-})
+});
const handleParams = (config: Record) => {
const _terms: Record = {};