From 80faeb5f0f22f88db2634027f0755836c23d1d25 Mon Sep 17 00:00:00 2001
From: easy <1358086367@qq.com>
Date: Thu, 9 Mar 2023 15:05:05 +0800
Subject: [PATCH 01/11] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E8=87=AA?=
=?UTF-8?q?=E6=B5=8B=20=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/home/components/BootCardSmall.vue | 27 +++++--------------
.../components/ComprehensiveHome/index.vue | 5 +---
.../home/components/DevOpsHome/index.vue | 6 ++---
src/views/home/components/DeviceCountCard.vue | 18 ++++++++-----
src/views/home/index.vue | 7 ++---
5 files changed, 26 insertions(+), 37 deletions(-)
diff --git a/src/views/home/components/BootCardSmall.vue b/src/views/home/components/BootCardSmall.vue
index 1b2c3080..bc811cdb 100644
--- a/src/views/home/components/BootCardSmall.vue
+++ b/src/views/home/components/BootCardSmall.vue
@@ -28,34 +28,19 @@
diff --git a/src/views/home/components/ComprehensiveHome/index.vue b/src/views/home/components/ComprehensiveHome/index.vue
index bd103aa4..7fdf7ecf 100644
--- a/src/views/home/components/ComprehensiveHome/index.vue
+++ b/src/views/home/components/ComprehensiveHome/index.vue
@@ -182,10 +182,7 @@ const opsBootConfig: bootConfig[] = [
{
english: 'STEP3',
label: '实时监控',
- link: 'link/Dashboard',
- params: {
- save: true,
- },
+ link: 'link/DashBoard',
image: '/images/home/guide-home6.png',
},
];
diff --git a/src/views/home/components/DevOpsHome/index.vue b/src/views/home/components/DevOpsHome/index.vue
index 7b28a992..2aca3796 100644
--- a/src/views/home/components/DevOpsHome/index.vue
+++ b/src/views/home/components/DevOpsHome/index.vue
@@ -32,12 +32,12 @@ const opsBootConfig: bootConfig[] = [
{
english: 'STEP1',
label: '设备接入配置',
- link: 'link/accessConfig',
+ link: 'link/AccessConfig',
},
{
english: 'STEP2',
label: '日志排查',
- link: 'link/Log',
+ link: 'Log',
params: {
key: 'system',
},
@@ -45,7 +45,7 @@ const opsBootConfig: bootConfig[] = [
{
english: 'STEP3',
label: '实时监控',
- link: 'link/dashboard',
+ link: 'link/DashBoard',
params: {
type: 'add',
},
diff --git a/src/views/home/components/DeviceCountCard.vue b/src/views/home/components/DeviceCountCard.vue
index a22e3483..e2b6cfce 100644
--- a/src/views/home/components/DeviceCountCard.vue
+++ b/src/views/home/components/DeviceCountCard.vue
@@ -26,13 +26,19 @@ const { jumpPage } = useMenuStore();
const projectNum = ref(0);
const deviceNum = ref(0);
+const menuPermission = useMenuStore().hasPermission;
const getData = () => {
- getDeviceCount_api().then((resp: any) => {
- deviceNum.value = resp.result;
- });
- getProductCount_api({}).then((resp: any) => {
- projectNum.value = resp.result;
- });
+ // 有产品菜单权限则获取数据
+ menuPermission('device/Product') &&
+ getDeviceCount_api().then((resp: any) => {
+ deviceNum.value = resp.result;
+ });
+
+ // 有设备菜单权限则获取数据
+ menuPermission('device/Instance') &&
+ getProductCount_api({}).then((resp: any) => {
+ projectNum.value = resp.result;
+ });
};
getData();
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 73a2948b..9ace54d0 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -52,9 +52,10 @@ const secureKey = ref('');
const setCurrentView = () => {
getView_api().then((resp: any) => {
if (resp.status === 200) {
- if (resp.result) currentView.value = resp.result?.content;
- else if (resp.result.username === 'admin') {
- currentView.value = 'comprehensive';
+ if (resp.result) {
+ if (resp.result.username === 'admin')
+ currentView.value = 'comprehensive';
+ else currentView.value = resp.result?.content;
} else currentView.value = 'init';
}
});
From 57a2aceaa9ee4ecda7e3535298310880d9ac3d7d Mon Sep 17 00:00:00 2001
From: JiangQiming <291854119@qq.com>
Date: Thu, 9 Mar 2023 16:02:39 +0800
Subject: [PATCH 02/11] =?UTF-8?q?update:=20=E8=A7=86=E9=A2=91=E4=B8=AD?=
=?UTF-8?q?=E5=BF=83=E7=BB=84=E4=BB=B6=E6=9B=BF=E6=8D=A2=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/media/Device/Save/SaveProduct.vue | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/views/media/Device/Save/SaveProduct.vue b/src/views/media/Device/Save/SaveProduct.vue
index 09c5d573..298c1b49 100644
--- a/src/views/media/Device/Save/SaveProduct.vue
+++ b/src/views/media/Device/Save/SaveProduct.vue
@@ -84,14 +84,16 @@
?.addresses"
:key="`${i.address}_address${idx}`"
>
-
+
+
+
@@ -263,6 +265,7 @@ const handleCancel = () => {
text-align: center;
.gateway-item {
padding: 16px;
+ text-align: left;
.card-item-content-title,
.desc,
.subtitle {
From 16422906087fd34cf396b3b3f6d8d575cef7e669 Mon Sep 17 00:00:00 2001
From: wangshuaiswim
Date: Thu, 9 Mar 2023 16:04:11 +0800
Subject: [PATCH 03/11] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=A9?=
=?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=A7=84=E5=88=99=E5=B1=9E=E6=80=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/FRuleEditor/Debug/index.vue | 10 +-
src/components/FRuleEditor/index.vue | 1 -
.../Metadata/VirtualRuleParam/index.vue | 2 +-
.../Metadata/Base/Edit/ExpandsForm.vue | 2 +-
.../device/components/Metadata/Base/index.vue | 110 +++++++++++-------
5 files changed, 73 insertions(+), 52 deletions(-)
diff --git a/src/components/FRuleEditor/Debug/index.vue b/src/components/FRuleEditor/Debug/index.vue
index 14257edb..1d89dd9a 100644
--- a/src/components/FRuleEditor/Debug/index.vue
+++ b/src/components/FRuleEditor/Debug/index.vue
@@ -135,18 +135,18 @@ const runScript = () => {
});
if (ws.value) {
- ws.value.unsubscribe();
+ ws.value.unsubscribe?.();
}
if (!props.virtualRule?.script) {
isBeginning.value = true;
message.warning('请编辑规则');
return;
}
- ws.value = getWebSocket(`virtual-property-debug-${ruleEditorStore.state.property}-${new Date().getTime()}`,
+ ws.value = getWebSocket(`virtual-property-debug-${props.id}-${new Date().getTime()}`,
'/virtual-property-debug',
{
virtualId: `${virtualIdRef.value}-virtual-id`,
- property: ruleEditorStore.state.property,
+ property: props.id,
virtualRule: {
...props.virtualRule,
},
@@ -163,7 +163,7 @@ const beginAction = () => {
const stopAction = () => {
isBeginning.value = true;
if (ws.value) {
- ws.value.unsubscribe();
+ ws.value.unsubscribe?.();
}
}
const clearAction = () => {
@@ -172,7 +172,7 @@ const clearAction = () => {
onUnmounted(() => {
if (ws.value) {
- ws.value.unsubscribe();
+ ws.value.unsubscribe?.();
}
})
diff --git a/src/components/FRuleEditor/index.vue b/src/components/FRuleEditor/index.vue
index 70cb6fe4..bd12a913 100644
--- a/src/components/FRuleEditor/index.vue
+++ b/src/components/FRuleEditor/index.vue
@@ -1,6 +1,5 @@
- {{ _value }}
diff --git a/src/components/Metadata/VirtualRuleParam/index.vue b/src/components/Metadata/VirtualRuleParam/index.vue
index b8a712f9..5452a0e5 100644
--- a/src/components/Metadata/VirtualRuleParam/index.vue
+++ b/src/components/Metadata/VirtualRuleParam/index.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/views/device/components/Metadata/Base/Edit/ExpandsForm.vue b/src/views/device/components/Metadata/Base/Edit/ExpandsForm.vue
index 9193eaf2..2259d44e 100644
--- a/src/views/device/components/Metadata/Base/Edit/ExpandsForm.vue
+++ b/src/views/device/components/Metadata/Base/Edit/ExpandsForm.vue
@@ -86,7 +86,7 @@ const metadataStore = useMetadataStore()
onMounted(() => {
if (props.type === 'product' || !props.value?.source) {
- emit('update:value', { ...props.value, source: 'device' })
+ emit('update:value', { source: 'device', ...props.value })
}
})
diff --git a/src/views/device/components/Metadata/Base/index.vue b/src/views/device/components/Metadata/Base/index.vue
index 115ba9cb..35948645 100644
--- a/src/views/device/components/Metadata/Base/index.vue
+++ b/src/views/device/components/Metadata/Base/index.vue
@@ -1,9 +1,9 @@
-
-
+
+
+
+
+ {{ levelMap[record.expands?.level] || '-' }}
+
+
+ {{ record.async ? '是' : '否' }}
+
+
+ {{ record.valueType?.type }}
+
+
+ {{ sourceMap[record.expands?.source] }}
+
+
+
+ {{ expandsType[item] }}
+
+
+
+
+
+
+
+
+
+
+
+
-
- {{ levelMap[slotProps.expands?.level] || '-' }}
-
-
- {{ slotProps.async ? '是' : '否' }}
-
-
- {{ slotProps.valueType?.type }}
-
-
- {{ sourceMap[slotProps.expands?.source] }}
-
-
-
- {{ expandsType[item] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
\ No newline at end of file
+
\ No newline at end of file
From 37e381f961c0c4b35264fd01ba2b9dccdd23e93d Mon Sep 17 00:00:00 2001
From: easy <1358086367@qq.com>
Date: Thu, 9 Mar 2023 17:28:35 +0800
Subject: [PATCH 04/11] =?UTF-8?q?fix:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD?=
=?UTF-8?q?=E5=BF=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/AIcon/index.tsx | 1 +
.../Center/components/EditInfoDialog.vue | 27 ++++++++++--
.../Center/components/EditPasswordDialog.vue | 17 +++++---
src/views/account/Center/index.vue | 43 ++++++++++++++++---
.../components/EditDialog.vue | 19 +++++---
src/views/home/index.vue | 29 ++++++++++---
src/views/system/Platforms/Api/index.vue | 17 +++++---
7 files changed, 119 insertions(+), 34 deletions(-)
diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx
index e480afc3..390fe993 100644
--- a/src/components/AIcon/index.tsx
+++ b/src/components/AIcon/index.tsx
@@ -77,6 +77,7 @@ const iconKeys = [
'CloudDownloadOutlined',
'PauseCircleOutlined',,
'FormOutlined',
+ 'EyeInvisibleOutlined',
]
const Icon = (props: {type: string}) => {
diff --git a/src/views/account/Center/components/EditInfoDialog.vue b/src/views/account/Center/components/EditInfoDialog.vue
index fbbbd69d..dc39e839 100644
--- a/src/views/account/Center/components/EditInfoDialog.vue
+++ b/src/views/account/Center/components/EditInfoDialog.vue
@@ -5,6 +5,7 @@
@ok="handleOk"
width="770px"
@cancel="emits('update:visible', false)"
+ :confirmLoading="loading"
>
@@ -12,7 +13,10 @@
-
+
-
+
();
+const loading = ref(false)
const form = ref(props.data);
const formRef = ref();
const handleOk = () => {
formRef.value?.validate().then(() => {
+ loading.value = true
updateMeInfo_api(form.value).then((resp) => {
if (resp.status === 200) {
message.success('保存成功');
emits('ok');
emits('update:visible', false);
}
- });
+ }).finally(()=>loading.value = false)
});
};
diff --git a/src/views/account/Center/components/EditPasswordDialog.vue b/src/views/account/Center/components/EditPasswordDialog.vue
index 768d3521..566f2bf0 100644
--- a/src/views/account/Center/components/EditPasswordDialog.vue
+++ b/src/views/account/Center/components/EditPasswordDialog.vue
@@ -4,6 +4,7 @@
title="重置密码"
@ok="handleOk"
width="520px"
+ :confirmLoading="loading"
@cancel="emits('update:visible', false)"
>
@@ -11,7 +12,7 @@
label="旧密码"
name="oldPassword"
:rules="[
- { required: true },
+ { required: true, message: '请输入密码' },
{ validator: checkMothods.old, trigger: 'blur' },
]"
>
@@ -24,7 +25,7 @@
label="密码"
name="newPassword"
:rules="[
- { required: true },
+ { required: true,message:'请输入密码' },
{ validator: checkMothods.new, trigger: 'blur' },
]"
>
@@ -37,7 +38,7 @@
label="确认密码"
name="confirmPassword"
:rules="[
- { required: true },
+ { required: true, message: '请输入确认密码' },
{ validator: checkMothods.confirm, trigger: 'blur' },
]"
>
@@ -63,6 +64,7 @@ const emits = defineEmits(['ok', 'update:visible']);
const props = defineProps<{
visible: boolean;
}>();
+const loading = ref(false)
const formRef = ref();
const form = ref({
oldPassword: '',
@@ -72,7 +74,7 @@ const form = ref({
const checkMothods = {
old: async (_rule: Rule, value: string) => {
- if (!value) return Promise.reject('请输入密码');
+ if (!value) return Promise.reject();
try {
const resp: any = await checkOldPassword_api(value);
if (resp.status === 200 && !resp.result.passed)
@@ -83,7 +85,7 @@ const checkMothods = {
}
},
new: async (_rule: Rule, value: string) => {
- if (!value) return Promise.reject('请输入密码');
+ if (!value) return Promise.reject();
else if (
form.value.confirmPassword &&
value !== form.value.confirmPassword
@@ -99,7 +101,7 @@ const checkMothods = {
}
},
confirm: async (_rule: Rule, value: string) => {
- if (!value) return Promise.reject('请输入确认密码');
+ if (!value) return Promise.reject();
try {
const resp: any = await validateField_api('password', value);
@@ -114,6 +116,7 @@ const checkMothods = {
const handleOk = () => {
formRef.value?.validate().then(() => {
+ loading.value = true
const params = {
oldPassword: form.value.oldPassword,
newPassword: form.value.newPassword,
@@ -124,7 +127,7 @@ const handleOk = () => {
emits('ok');
emits('update:visible', false);
}
- });
+ }).finally(()=>loading.value = false)
});
};
console.clear();
diff --git a/src/views/account/Center/index.vue b/src/views/account/Center/index.vue
index 9d0a09ff..f3b392d0 100644
--- a/src/views/account/Center/index.vue
+++ b/src/views/account/Center/index.vue
@@ -8,10 +8,15 @@
style="width: 350px; justify-content: center"
>
+
+
注册时间
-
{{ moment(userInfo.createTime).format('YYYY-MM-DD HH:mm:ss') }}
+
+ {{
+ moment(userInfo.createTime).format(
+ 'YYYY-MM-DD HH:mm:ss',
+ )
+ }}
+
电话
-
{{ userInfo.telephone }}
+
{{ userInfo.telephone || '-' }}
姓名
@@ -117,7 +129,7 @@
type="link"
@click="editPasswordVisible = true"
>
-
+
@@ -205,7 +217,7 @@
{
+ const imageTypes = ['jpg', 'png', 'jfif', 'pjp', 'pjpeg', 'jpeg'];
+ const typeBool =
+ imageTypes.filter((typeStr) => type.includes(typeStr)).length > 0;
+ const sizeBool = size < 4 * 1024 * 1024;
+
+ (typeBool && sizeBool) || message.error('请上传正确格式的图片');
+ return typeBool && sizeBool;
+ },
});
// 首页视图
const isApiUser = ref();
@@ -346,7 +367,7 @@ function getViews() {
background-color: #f0f2f5;
min-height: 100vh;
.card {
- margin: 24px;
+ margin: 16px 0;
padding: 24px;
background-color: #fff;
position: relative;
@@ -370,6 +391,18 @@ function getViews() {
flex-wrap: wrap;
.content-item {
margin-right: 24px;
+
+ .default-avatar {
+ background-color: #ccc;
+ color: #fff;
+ border-radius: 50%;
+ font-size: 70px;
+ width: 140px;
+ height: 140px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
.info-card {
width: 25%;
diff --git a/src/views/account/NotificationSubscription/components/EditDialog.vue b/src/views/account/NotificationSubscription/components/EditDialog.vue
index b006439d..f164c35f 100644
--- a/src/views/account/NotificationSubscription/components/EditDialog.vue
+++ b/src/views/account/NotificationSubscription/components/EditDialog.vue
@@ -3,6 +3,7 @@
visible
:title="props.data.id ? '编辑' : '新增'"
width="865px"
+ :confirmLoading="loading"
@ok="confirm"
@cancel="emits('update:visible', false)"
>
@@ -92,6 +93,7 @@ const props = defineProps<{
data: rowType;
}>();
+const loading = ref(false);
const initForm = {
subscribeName: '',
topicConfig: {},
@@ -106,13 +108,16 @@ const form = ref({
const confirm = () => {
formRef.value &&
formRef.value.validate().then(() => {
- save_api(form.value).then((resp) => {
- if (resp.status === 200) {
- message.success('操作成功');
- emits('ok')
- emits('update:visible', false);
- }
- });
+ loading.value = true;
+ save_api(form.value)
+ .then((resp) => {
+ if (resp.status === 200) {
+ message.success('操作成功');
+ emits('ok');
+ emits('update:visible', false);
+ }
+ })
+ .finally(() => (loading.value = false));
});
};
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 9ace54d0..72e5709a 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -17,12 +17,22 @@
基本信息
- clientId:
- {{ clientId }}
+ clientId:
+ {{ clientId }}
- secureKey:
- {{ secureKey }}
+ secureKey:
+
+ {{ showKey ? secureKey : '****************' }}
+
+
@@ -47,7 +57,7 @@ const currentView = ref('');
const loading = ref(true);
const clientId = useUserInfo().$state.userInfos.id;
const secureKey = ref('');
-
+const showKey = ref(false);
// 获取选择的视图
const setCurrentView = () => {
getView_api().then((resp: any) => {
@@ -91,6 +101,15 @@ if (isNoCommunity) {
p {
margin: 0;
font-size: 16px;
+
+ .label {
+ font-weight: bold;
+ margin-right: 3px;
+ }
+ .value {
+ margin-right: 10px;
+ font-size: 14px;
+ }
}
}
}
diff --git a/src/views/system/Platforms/Api/index.vue b/src/views/system/Platforms/Api/index.vue
index 5e4c3fe1..2a337461 100644
--- a/src/views/system/Platforms/Api/index.vue
+++ b/src/views/system/Platforms/Api/index.vue
@@ -3,7 +3,7 @@
-
+
.api-page-container {
- .tree-content {
- padding-bottom: 30px;
- height: calc(100vh - 230px);
- overflow-y: auto;
- border-right: 1px solid #e9e9e9;
+ .content {
+ background-color: #fff;
+ padding: 24px;
+ margin: 0 !important;
+ .tree-content {
+ padding-bottom: 30px;
+ height: calc(100vh - 230px);
+ overflow-y: auto;
+ border-right: 1px solid #e9e9e9;
+ }
}
}
From 9cd78db1f68c0d150b1cba9ae68863758c134c8f Mon Sep 17 00:00:00 2001
From: wangshuaiswim
Date: Thu, 9 Mar 2023 17:39:17 +0800
Subject: [PATCH 05/11] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=A9?=
=?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=A7=84=E5=88=99=E8=B0=83=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/FRuleEditor/Debug/index.vue | 39 ++++++++++++++--------
1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/src/components/FRuleEditor/Debug/index.vue b/src/components/FRuleEditor/Debug/index.vue
index 1d89dd9a..0cc843e0 100644
--- a/src/components/FRuleEditor/Debug/index.vue
+++ b/src/components/FRuleEditor/Debug/index.vue
@@ -15,7 +15,7 @@
-
+
@@ -58,8 +58,8 @@
-
+
{{ item.content }}
@@ -78,6 +78,7 @@ import { message } from 'ant-design-vue';
import { useRuleEditorStore } from '@/store/ruleEditor';
import moment from 'moment';
import { getWebSocket } from '@/utils/websocket';
+import { PropertyMetadata } from '@/views/device/Product/typings';
const props = defineProps({
@@ -143,17 +144,17 @@ const runScript = () => {
return;
}
ws.value = getWebSocket(`virtual-property-debug-${props.id}-${new Date().getTime()}`,
- '/virtual-property-debug',
- {
- virtualId: `${virtualIdRef.value}-virtual-id`,
- property: props.id,
- virtualRule: {
- ...props.virtualRule,
- },
- properties: _properties || [],
- })
+ '/virtual-property-debug',
+ {
+ virtualId: `${virtualIdRef.value}-virtual-id`,
+ property: props.id,
+ virtualRule: {
+ ...props.virtualRule,
+ },
+ properties: _properties || [],
+ })
ws.value.subscribe((data: any) => {
- ruleEditorStore.state.log.push({ time: new Date().getTime(), content: JSON.stringify(data.payload) });
+ ruleEditorStore.state.log.push({ time: new Date().getTime(), content: JSON.stringify(data.payload) });
})
}
const beginAction = () => {
@@ -175,6 +176,18 @@ onUnmounted(() => {
ws.value.unsubscribe?.();
}
})
+
+const options = ref<{ label: string, value: string }[]>()
+const getProperty = () => {
+ const metadata = productStore.current.metadata || '{}';
+ const _p: PropertyMetadata[] = JSON.parse(metadata).properties || [];
+ options.value = _p.filter((p) => p.id !== props.id).map((item) => ({
+ label: item.name,
+ value: item.id,
+ }));
+ console.log(options.value)
+}
+getProperty()
\ No newline at end of file
diff --git a/src/views/rule-engine/Scene/Save/action/Device/actions/EditTable.vue b/src/views/rule-engine/Scene/Save/action/Device/actions/EditTable.vue
index 6ba31ca4..e0774a9b 100644
--- a/src/views/rule-engine/Scene/Save/action/Device/actions/EditTable.vue
+++ b/src/views/rule-engine/Scene/Save/action/Device/actions/EditTable.vue
@@ -8,12 +8,20 @@
>
@@ -21,7 +29,8 @@
\ No newline at end of file
diff --git a/src/views/rule-engine/Scene/Save/action/Device/actions/WriteProperty.vue b/src/views/rule-engine/Scene/Save/action/Device/actions/WriteProperty.vue
new file mode 100644
index 00000000..b1ed87ed
--- /dev/null
+++ b/src/views/rule-engine/Scene/Save/action/Device/actions/WriteProperty.vue
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+ {{ item?.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue b/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue
index df605d47..5697da00 100644
--- a/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue
+++ b/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue
@@ -9,6 +9,7 @@
@@ -21,7 +22,7 @@
showSearch
placeholder="请选择功能"
v-model:value="modelRef.message.functionId"
- @change="onFunctionChange"
+ @change="(val) => onFunctionChange(val, [])"
>
-
+
@@ -60,44 +61,11 @@
-
-
-
-
- {{ item?.name }}
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -108,6 +76,13 @@ import { getImage } from '@/utils/comm';
import TopCard from '../device/TopCard.vue';
import { detail } from '@/api/device/instance';
import EditTable from './EditTable.vue';
+import WriteProperty from './WriteProperty.vue';
+import { queryBuiltInParams } from '@/api/rule-engine/scene';
+import { useSceneStore } from '@/store/scene';
+import { storeToRefs } from 'pinia'
+
+const sceneStore = useSceneStore();
+const { data } = storeToRefs(sceneStore);
const TypeList = [
{
@@ -172,44 +147,93 @@ const deviceMessageType = computed(() => {
return modelRef.message.messageType;
});
-const onFunctionChange = (val: string) => {
+const builtInList = ref([]);
+
+const onFunctionChange = (val: string, values?: any[]) => {
const _item = (metadata.value?.functions || []).find((item: any) => {
return val === item.id;
});
const list = (_item?.inputs || []).map((item: any) => {
+ const _a = values?.find((i) => i.name === item.id);
return {
id: item.id,
- name: item.name,
- value: undefined,
+ value: _a?.value,
valueType: item?.valueType?.type,
+ ..._a,
+ name: item.name,
};
});
modelRef.message.inputs = list;
};
-watchEffect(() => {
- // console.log(props.values)
- // console.log(metadata.value)
- // Object.assign()
-});
+const onMessageTypeChange = (val: string) => {
+ if (['WRITE_PROPERTY', 'INVOKE_FUNCTION'].includes(val)) {
+ const _params = {
+ branch: props.thenName,
+ branchGroup: props.branchGroup,
+ action: props.name - 1,
+ };
+ queryBuiltInParams(unref(data), _params).then((res: any) => {
+ if (res.status === 200) {
+ builtInList.value = res.result
+ }
+ });
+ }
+};
watch(
- () => [props.values?.productDetail, props.values.deviceDetail],
- ([newVal1, newVal2]) => {
- if (newVal1) {
- if (props.values?.selector === 'fixed') {
- detail(newVal2.id).then((resp) => {
- if (resp.status === 200) {
- metadata.value = JSON.parse(
- resp.result?.metadata || '{}',
- );
- }
- });
+ () => [
+ props.values?.productDetail,
+ props.values.selectorValues,
+ props.values?.selector,
+ ],
+ ([newVal1, newVal2, newVal3]) => {
+ if (newVal1?.id) {
+ if (newVal3?.selector === 'fixed') {
+ const id = newVal2?.[0]?.value;
+ if (id) {
+ detail(id).then((resp) => {
+ if (resp.status === 200) {
+ metadata.value = JSON.parse(
+ resp.result?.metadata || '{}',
+ );
+ }
+ });
+ }
} else {
metadata.value = JSON.parse(newVal1?.metadata || '{}');
}
}
},
+ { immediate: true, deep: true },
+);
+
+watch(
+ () => props.values?.message,
+ (newVal) => {
+ if (newVal?.messageType) {
+ modelRef.message = newVal;
+ if (newVal.messageType === 'INVOKE_FUNCTION' && newVal.functionId) {
+ onFunctionChange(newVal.functionId, newVal?.inputs);
+ }
+ onMessageTypeChange(newVal.messageType)
+ }
+ },
{ deep: true, immediate: true },
);
+
+const onFormSave = () => {
+ return new Promise((resolve, reject) => {
+ formRef.value
+ .validate()
+ .then(async (_data: any) => {
+ resolve(_data);
+ })
+ .catch((err: any) => {
+ reject(err);
+ });
+ });
+};
+
+defineExpose({ onFormSave });
\ No newline at end of file
diff --git a/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue b/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue
index ef3237fb..0dd67d5a 100644
--- a/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue
+++ b/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue
@@ -1,11 +1,11 @@
-
+ />
@@ -108,6 +109,7 @@ const props = defineProps({
},
});
+// save保存deviceDetail
const emits = defineEmits(['save', 'cancel']);
const sceneStore = useSceneStore();
@@ -122,6 +124,7 @@ const modelRef = reactive({
source: '',
relationName: '',
upperKey: '',
+ message: undefined,
});
const list = ref([]);
@@ -160,7 +163,7 @@ const filterTree = (nodes: any[]) => {
if (!nodes?.length) {
return nodes;
}
- return nodes.filter((it) => {
+ const arr = nodes.filter((it) => {
if (
it.children.find(
(item: any) =>
@@ -173,43 +176,16 @@ const filterTree = (nodes: any[]) => {
}
return false;
});
-};
-
-const treeDataFilter = (arr: any[]) => {
- if (Array.isArray(arr) && arr.length) {
- const list: any[] = [];
- arr.map((item: any) => {
- if (item.children) {
- const children = treeDataFilter(item.children);
- if (children.length) {
- list.push({
- ...item,
- title: item.name,
- value: item.id,
- disabled: true,
- children,
- });
- }
- } else {
- if (
- item.children.find(
- (item: any) =>
- item.id.indexOf(
- 'deviceId' || 'device_id' || 'device_Id',
- ) > -1,
- ) &&
- !item.children.find(
- (item: any) => item.id.indexOf('bolaen') > -1,
- )
- ) {
- list.push(item);
- }
- }
- });
- return list;
- } else {
- return [];
- }
+ return arr.map((item) => {
+ if (item.children) {
+ }
+ return {
+ ...item,
+ title: item.name,
+ value: item.id,
+ disabled: !!item.children,
+ };
+ });
};
const sourceChangeEvent = async () => {
@@ -220,11 +196,9 @@ const sourceChangeEvent = async () => {
};
const resp = await queryBuiltInParams(unref(data), _params);
if (resp.status === 200) {
- // const array = filterTree(resp.result as any[]);
+ const array = filterTree(resp.result as any[]);
//判断相同产品才有按变量
// if (props.formProductId === DeviceModel.productId)// TODO
- console.log(array);
- const arr = treeDataFilter(resp.result as any[]);
builtInList.value = array;
}
};
@@ -293,6 +267,7 @@ const filterType = async () => {
};
const onSelectorChange = (val: string) => {
+ modelRef.selectorValues = undefined;
if (val === 'relation') {
queryRelationList();
}
@@ -300,7 +275,17 @@ const onSelectorChange = (val: string) => {
const onDeviceChange = (_detail: any) => {
if (_detail) {
- emits('save', modelRef, _detail);
+ if (_detail.id) {
+ modelRef.deviceId = _detail.id;
+ modelRef.selectorValues = [
+ { value: _detail.id, name: _detail.name },
+ ] as any;
+ modelRef.message = {} as any;
+ } else {
+ modelRef.deviceId = '';
+ modelRef.selectorValues = [] as any;
+ }
+ emits('save', unref(modelRef), _detail);
}
};
@@ -310,7 +295,7 @@ const onRelationChange = (val: any, options: any) => {
modelRef.selectorValues = val;
modelRef.upperKey = 'scene.deviceId';
modelRef.relationName = options.label;
- emits('save', modelRef, {});
+ emits('save', unref(modelRef), {});
};
const onTagChange = (val: any[], arr: any[]) => {
@@ -321,11 +306,12 @@ const onTagChange = (val: any[], arr: any[]) => {
if (arr) {
tagList.value = arr;
}
+ emits('save', unref(modelRef), {});
};
const onVariableChange = (val: any, node: any) => {
modelRef.deviceId = val;
- // modelRef.deviceDetail = node;
+ emits('save', unref(modelRef), node);
modelRef.selectorValues = [{ value: val, name: node.description }] as any;
};
@@ -348,6 +334,21 @@ watch(
deep: true,
},
);
+
+const onFormSave = () => {
+ return new Promise((resolve, reject) => {
+ formRef.value
+ .validate()
+ .then(async (_data: any) => {
+ resolve(_data);
+ })
+ .catch((err: any) => {
+ reject(err);
+ });
+ });
+};
+
+defineExpose({ onFormSave });
diff --git a/src/views/media/Device/Channel/index.less b/src/views/media/Device/Channel/index.less
new file mode 100644
index 00000000..ee596623
--- /dev/null
+++ b/src/views/media/Device/Channel/index.less
@@ -0,0 +1,48 @@
+.device-channel-warp {
+ display: flex;
+
+ .left-warp {
+ position: relative;
+ margin-right: 16px;
+ padding: 20px;
+ background-color: #fff;
+ border-radius: 2px;
+
+ .left-content {
+ width: 0;
+ height: 100%;
+ overflow: hidden;
+
+ &.active {
+ width: 260px;
+ }
+ }
+
+ .left-warp--btn {
+ position: absolute;
+ top: 50%;
+ right: 0;
+ padding: 20px 4px;
+ color: rgba(#000, 0.3);
+ background-color: rgba(#f0f0f0, 6);
+ border-radius: ~'100% 0 0 100% / 50% 0 0 50%';
+ cursor: pointer;
+
+ &:hover {
+ color: rgba(#000, 0.5);
+ background-color: rgba(#f0f0f0, 8);
+ }
+
+ &.active {
+ right: 50%;
+ background-color: transparent;
+ border-radius: 0;
+ transform: translateX(50%) rotate(180deg);
+ }
+ }
+ }
+
+ .right {
+ flex: 1;
+ }
+}
diff --git a/src/views/media/Device/Channel/index.vue b/src/views/media/Device/Channel/index.vue
index 94d5b9c6..b39e302a 100644
--- a/src/views/media/Device/Channel/index.vue
+++ b/src/views/media/Device/Channel/index.vue
@@ -1,82 +1,102 @@
-
-
-
-
-
+
+
+
+
+
- 新增
-
-
- 新增
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+ 新增
+
+
+ 新增
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
f.key !== 'delete')
: actions;
};
+
+// 左侧树
+const show = ref(false);
+const deviceId = computed(() => route.query.id as string);
+const handleSelect = (key: string) => {
+ if (key === deviceId.value && listRef.value?.reload) {
+ listRef.value?.reload();
+ } else {
+ params.value = {
+ terms: [
+ {
+ column: 'parentId',
+ value: key,
+ },
+ ],
+ };
+ }
+};
+
diff --git a/src/views/notice/Config/index.vue b/src/views/notice/Config/index.vue
index 5ea89785..0ba66bc8 100644
--- a/src/views/notice/Config/index.vue
+++ b/src/views/notice/Config/index.vue
@@ -257,9 +257,7 @@ const columns = [
* @param params
*/
const handleSearch = (e: any) => {
- console.log('handleSearch:', e);
params.value = e;
- console.log('params.value: ', params.value);
};
/**
From d2e7a410b7ccf0bb988cd47c1d5a619ed2806f61 Mon Sep 17 00:00:00 2001
From: easy <1358086367@qq.com>
Date: Thu, 9 Mar 2023 19:52:00 +0800
Subject: [PATCH 08/11] =?UTF-8?q?fix:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD?=
=?UTF-8?q?=E5=BF=83=E8=87=AA=E6=B5=8B=E3=80=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/account/notificationRecord.ts | 2 +-
src/components/Layout/components/Notice.vue | 16 ++++++++--
.../account/NotificationRecord/index.vue | 20 ++++++------
.../NotificationSubscription/index.vue | 32 +++++++++----------
.../components/ComprehensiveHome/index.vue | 21 +++++++++---
.../home/components/DeviceHome/index.vue | 8 ++---
6 files changed, 59 insertions(+), 40 deletions(-)
diff --git a/src/api/account/notificationRecord.ts b/src/api/account/notificationRecord.ts
index 18217d85..58cb612f 100644
--- a/src/api/account/notificationRecord.ts
+++ b/src/api/account/notificationRecord.ts
@@ -1,7 +1,7 @@
import server from '@/utils/request'
// 获取记录列表
-export const getList_api = (data:object): any =>server.get(`/notifications/_query`,encodeParams(data))
+export const getList_api = (data:object): any =>server.post(`/notifications/_query`,data)
// 修改记录状态
export const changeStatus_api = (type:'_read'|'_unread',data:string[]): any =>server.post(`/notifications/${type}`,data)
diff --git a/src/components/Layout/components/Notice.vue b/src/components/Layout/components/Notice.vue
index 07423bc1..58bba839 100644
--- a/src/components/Layout/components/Notice.vue
+++ b/src/components/Layout/components/Notice.vue
@@ -26,7 +26,7 @@ import { notification } from 'ant-design-vue';
import { changeStatus_api } from '@/api/account/notificationRecord';
import { useUserInfo } from '@/store/userInfo';
-const updateCount = computed(()=>useUserInfo().$state.alarmUpdateCount);
+const updateCount = computed(() => useUserInfo().$state.alarmUpdateCount);
const total = ref(0);
const list = ref([]);
@@ -50,10 +50,20 @@ const subscribeNotice = () => {
const getList = () => {
loading.value = true;
const params = {
- 'terms[0].column': 'state',
- 'terms[0].value': 'unread',
'sorts[0].name': 'notifyTime',
'sorts[0].order': 'desc',
+ terms: [
+ {
+ terms: [
+ {
+ type: 'or',
+ value: 'unread',
+ termType: 'eq',
+ column: 'state',
+ },
+ ],
+ },
+ ],
};
getList_api(params)
.then((resp: any) => {
diff --git a/src/views/account/NotificationRecord/index.vue b/src/views/account/NotificationRecord/index.vue
index 84790dbc..a6d380d3 100644
--- a/src/views/account/NotificationRecord/index.vue
+++ b/src/views/account/NotificationRecord/index.vue
@@ -1,14 +1,17 @@
-
+
queryParams = {...params}"
+ />
1
-
+ >
+
{
- query.params.value = { ...params };
- },
-};
+const queryParams = ref({});
const tableRef = ref();
const table = {
diff --git a/src/views/account/NotificationSubscription/index.vue b/src/views/account/NotificationSubscription/index.vue
index f0a82188..91b1d6f6 100644
--- a/src/views/account/NotificationSubscription/index.vue
+++ b/src/views/account/NotificationSubscription/index.vue
@@ -1,13 +1,16 @@
-
+
queryParams = {...params}"
+ />
{
- query.params.value = {...params};
- },
-};
+const queryParams = ref({});
const dialogVisible = ref(false);
const tableRef = ref();
const table = {
- seletctRow: ref(),
+ seletctRow: ref({}),
edit: (row?: rowType) => {
table.seletctRow = {
...(row || ({} as any)),
@@ -176,12 +174,12 @@ const table = {
});
},
delete: (row: rowType) => {
- remove_api(row.id as string).then(resp=>{
- if(resp.status === 200) {
- message.success('操作成功!')
- table.refresh()
- }else message.warning('操作失败!')
- })
+ remove_api(row.id as string).then((resp) => {
+ if (resp.status === 200) {
+ message.success('操作成功!');
+ table.refresh();
+ } else message.warning('操作失败!');
+ });
},
refresh: () => {
tableRef.value && tableRef.value.reload();
diff --git a/src/views/home/components/ComprehensiveHome/index.vue b/src/views/home/components/ComprehensiveHome/index.vue
index 7fdf7ecf..bbdb6b3b 100644
--- a/src/views/home/components/ComprehensiveHome/index.vue
+++ b/src/views/home/components/ComprehensiveHome/index.vue
@@ -36,7 +36,7 @@
jumpPage('device/Product/Detail', { id })"
+ @confirm="(id:string)=>jumpPage('device/Product/Detail', { id, tab: 'Device'})"
/>
diff --git a/src/views/home/components/DeviceHome/index.vue b/src/views/home/components/DeviceHome/index.vue
index 82313882..9fcc868e 100644
--- a/src/views/home/components/DeviceHome/index.vue
+++ b/src/views/home/components/DeviceHome/index.vue
@@ -23,7 +23,7 @@
jumpPage('device/Product/Detail', { id })"
+ @confirm="(id:string)=>jumpPage('device/Product/Detail', { id, tab: 'Device'})"
/>
Date: Thu, 9 Mar 2023 20:00:52 +0800
Subject: [PATCH 09/11] =?UTF-8?q?update:=20=E7=BB=84=E4=BB=B6=E6=9B=B4?=
=?UTF-8?q?=E6=8D=A2=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/media/Device/Channel/Tree/index.vue | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/views/media/Device/Channel/Tree/index.vue b/src/views/media/Device/Channel/Tree/index.vue
index 4aa6160d..5cf04f0c 100644
--- a/src/views/media/Device/Channel/Tree/index.vue
+++ b/src/views/media/Device/Channel/Tree/index.vue
@@ -1,10 +1,7 @@
-
+
@@ -71,13 +68,13 @@ const getDeviceDetail = async (id: string) => {
}
};
-const queryTree = (e: any) => {
+const queryTree = debounce((e: any) => {
getTreeData(props.deviceId, {
terms: [
{ column: 'name', termType: 'like', value: `%${e.target.value}%` },
],
});
-};
+}, 300);
watchEffect(() => {
getDeviceDetail(props.deviceId);
From b583fa77a9543e6bbd4f21a0546484c189041731 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Fri, 10 Mar 2023 10:03:01 +0800
Subject: [PATCH 10/11] =?UTF-8?q?update:=20=E5=9C=BA=E6=99=AF=E8=81=94?=
=?UTF-8?q?=E5=8A=A8ParamsDropdown=20=E6=B7=BB=E5=8A=A0=E6=8F=92=E6=A7=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DropdownButton/DropdownButton.vue | 47 ++++++---
.../Save/components/DropdownButton/Menus.vue | 3 +
.../Save/components/DropdownButton/Time.vue | 6 +-
.../Save/components/DropdownButton/util.ts | 6 +-
.../Save/components/ParamsDropdown/index.vue | 63 +++++++-----
.../Save/components/ParamsDropdown/typings.ts | 7 +-
.../Save/components/Terms/ParamsItem.vue | 98 ++++++++++++++-----
.../Scene/Save/components/Terms/Terms.vue | 12 ++-
src/views/rule-engine/Scene/index.vue | 2 +-
src/views/rule-engine/Scene/typings.ts | 2 +-
yarn.lock | 4 +-
11 files changed, 173 insertions(+), 77 deletions(-)
diff --git a/src/views/rule-engine/Scene/Save/components/DropdownButton/DropdownButton.vue b/src/views/rule-engine/Scene/Save/components/DropdownButton/DropdownButton.vue
index 52992e07..eaee2eef 100644
--- a/src/views/rule-engine/Scene/Save/components/DropdownButton/DropdownButton.vue
+++ b/src/views/rule-engine/Scene/Save/components/DropdownButton/DropdownButton.vue
@@ -1,8 +1,17 @@
-
-
-
- {{ label }}
+
+
@@ -18,7 +27,7 @@
:type='component'
@change='timeSelect'
/>
-
+
()
const label = ref(props.placeholder)
const selectValue = ref(props.value)
-const flatMapTree = new Map()
+const visible = ref(false)
-const LabelStyle = computed(() => {
- return {
- color: selectValue.value ? '#' : '#'
- }
-})
+const visibleChange = (v: boolean) => {
+ visible.value = v
+}
const dropdownButtonClass = computed(() => ({
'dropdown-button': true,
@@ -112,24 +119,34 @@ const dropdownButtonClass = computed(() => ({
'type': props.type === 'type',
}))
-const treeSelect = (v: any) => {
-
+const treeSelect = (v: any, option: any) => {
+ const node = option.node
+ visible.value = false
+ label.value = node.fullname || node.name
+ selectValue.value = v[0]
+ emit('update:value', node[props.valueName])
+ emit('select', node)
}
const timeSelect = (v: string) => {
+ selectValue.value = v
+ visible.value = false
emit('update:value', v)
emit('select', v)
}
const menuSelect = (v: any) => {
const option = getOption(props.options, props.value, props.valueName)
+ selectValue.value = v.key
+ visible.value = false
emit('update:value', v.key)
emit('select', option)
}
watchEffect(() => {
const option = getOption(props.options, props.value, props.valueName)
- if (option && Object.keys(option).length) {
+ selectValue.value = props.value
+ if (option) {
label.value = option[props.labelName] || option.name
} else {
label.value = props.value || props.placeholder
diff --git a/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue b/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue
index 0a48897a..32eba60e 100644
--- a/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue
+++ b/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue
@@ -55,6 +55,9 @@ const click = (e: any) => {
})
}
+watch(() => props.value, () => {
+ myValue.value = props.value
+}, { immediate: true})
\ No newline at end of file
diff --git a/src/views/rule-engine/Scene/Save/components/DropdownButton/util.ts b/src/views/rule-engine/Scene/Save/components/DropdownButton/util.ts
index ba64375e..b421a271 100644
--- a/src/views/rule-engine/Scene/Save/components/DropdownButton/util.ts
+++ b/src/views/rule-engine/Scene/Save/components/DropdownButton/util.ts
@@ -26,7 +26,7 @@ export const getComponent = (type: string): string => {
}
export const getOption = (data: any[], value?: string | number | boolean, key: string = 'name'): DropdownButtonOptions | any => {
- let option = {}
+ let option
if (!value) return option
for (let i = 0; i < data.length; i++) {
const item = data[i]
@@ -35,7 +35,9 @@ export const getOption = (data: any[], value?: string | number | boolean, key: s
break
} else if (item.children && item.children.length){
option = getOption(item.children, value, key)
- if (option) break
+ if (option) {
+ break
+ }
}
}
return option
diff --git a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue
index 65010591..5f212557 100644
--- a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue
+++ b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue
@@ -5,9 +5,13 @@
v-model:visible='visible'
@visibleChange='visibleChange'
>
-