-
{{ instanceStore.current.name }}
+
+ {{ instanceStore.current.name }}
+
@@ -116,8 +118,8 @@ import Function from './Function/index.vue';
import Modbus from './Modbus/index.vue';
import OPCUA from './OPCUA/index.vue';
import EdgeMap from './EdgeMap/index.vue';
-import Parsing from './Parsing/index.vue'
-import Log from './Log/index.vue'
+import Parsing from './Parsing/index.vue';
+import Log from './Log/index.vue';
import { _deploy, _disconnect } from '@/api/device/instance';
import { message } from 'jetlinks-ui-components';
import { getImage } from '@/utils/comm';
@@ -149,17 +151,13 @@ const list = ref([
key: 'Metadata',
tab: '物模型',
},
- {
- key: 'Log',
- tab: '日志管理',
- },
{
key: 'Function',
tab: '设备功能',
},
{
- key: 'ChildDevice',
- tab: '子设备',
+ key: 'Log',
+ tab: '日志管理',
},
]);
@@ -174,7 +172,7 @@ const tabs = {
OPCUA,
EdgeMap,
Parsing,
- Log
+ Log,
};
const getStatus = (id: string) => {
@@ -255,6 +253,17 @@ watchEffect(() => {
tab: '设备诊断',
});
}
+ if (
+ instanceStore.current.features?.find(
+ (item: any) => item.id === 'transparentCodec',
+ ) &&
+ !keys.includes('Parsing')
+ ) {
+ list.value.push({
+ key: 'Parsing',
+ tab: '数据解析',
+ });
+ }
if (
instanceStore.current.protocol === 'modbus-tcp' &&
!keys.includes('Modbus')
@@ -273,6 +282,13 @@ watchEffect(() => {
tab: 'OPC UA',
});
}
+ if (instanceStore.current.deviceType?.value === 'gateway') {
+ // 产品类型为网关的情况下才显示此模块
+ list.value.push({
+ key: 'ChildDevice',
+ tab: '子设备',
+ });
+ }
if (
instanceStore.current.accessProvider === 'edge-child-device' &&
instanceStore.current.parentId &&
@@ -283,15 +299,6 @@ watchEffect(() => {
tab: '边缘端映射',
});
}
- if (
- instanceStore.current.features?.find((item: any) => item.id === 'transparentCodec') &&
- !keys.includes('Parsing')
- ) {
- list.value.push({
- key: 'Parsing',
- tab: '数据解析',
- });
- }
});
onUnmounted(() => {
diff --git a/src/views/device/Instance/Export/index.vue b/src/views/device/Instance/Export/index.vue
index 1b422fde..1a14d9dd 100644
--- a/src/views/device/Instance/Export/index.vue
+++ b/src/views/device/Instance/Export/index.vue
@@ -51,7 +51,6 @@
import { queryNoPagingPost } from '@/api/device/product';
import { downloadFile } from '@/utils/utils';
import encodeQuery from '@/utils/encodeQuery';
-import { BASE_API_PATH } from '@/utils/variable';
import { deviceExport } from '@/api/device/instance';
const emit = defineEmits(['close']);
diff --git a/src/views/device/Instance/Process/index.vue b/src/views/device/Instance/Process/index.vue
index 05b405ac..784f6554 100644
--- a/src/views/device/Instance/Process/index.vue
+++ b/src/views/device/Instance/Process/index.vue
@@ -1,92 +1,106 @@
-
+
-
+
- 总数量:{{count}}
- {{errMessage}}
+ 总数量:{{ count }}
+ {{ errMessage }}
\ No newline at end of file
diff --git a/src/views/device/Instance/Save/index.vue b/src/views/device/Instance/Save/index.vue
index 76f5549e..f1ef6769 100644
--- a/src/views/device/Instance/Save/index.vue
+++ b/src/views/device/Instance/Save/index.vue
@@ -9,12 +9,7 @@
:confirmLoading="loading"
>
-
+
@@ -22,14 +17,33 @@
-
+
ID
-
+
+ style="margin-left: 2px"
+ />
@@ -39,7 +53,20 @@
:disabled="!!data?.id"
/>
-
+
-
+
- 所属产品
+ 所属产品
+ style="margin-left: 2px"
+ />
@@ -68,10 +105,20 @@
v-for="item in productList"
:key="item.id"
:label="item.name"
- >{{item.name}}
+ >{{ item.name }}
-
+
, value: string) => {
}
};
-const rules = {
- name: [
- {
- required: true,
- message: '请输入名称',
- },
- {
- max: 64,
- message: '最多输入64个字符',
- },
- ],
- photoUrl: [
- {
- required: true,
- message: '请上传图标',
- },
- ],
- productId: [
- {
- required: true,
- message: '请选择所属产品',
- },
- ],
- id: [
- {
- max: 64,
- message: '最多输入64个字符',
- },
- {
- pattern: /^[j-zA-Z0-9_\-]+$/,
- message: '请输入英文或者数字或者-或者_',
- },
- {
- validator: vailId,
- trigger: 'blur',
- },
- ],
-};
-
watch(
() => props.data,
(newValue) => {
@@ -199,13 +207,13 @@ const handleSave = () => {
.validate()
.then(async (_data: any) => {
loading.value = true;
- const obj = {...toRaw(modelRef), ..._data}
- if(!obj.id){
- delete obj.id
+ const obj = { ..._data };
+ if (!obj.id) {
+ delete obj.id;
}
const resp = await update(obj).finally(() => {
loading.value = false;
- })
+ });
if (resp.status === 200) {
message.success('操作成功!');
emit('save');
diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue
index 5acf8604..f40fb78e 100644
--- a/src/views/device/Instance/index.vue
+++ b/src/views/device/Instance/index.vue
@@ -252,6 +252,7 @@
@close="operationVisible = false"
:api="api"
:type="type"
+ @save="onRefresh"
/>
new Promise((resolve) => {
getProviders().then((resp: any) => {
diff --git a/src/views/rule-engine/Scene/Save/Timer/index.vue b/src/views/rule-engine/Scene/Save/Timer/index.vue
index 55646c35..de0a67d1 100644
--- a/src/views/rule-engine/Scene/Save/Timer/index.vue
+++ b/src/views/rule-engine/Scene/Save/Timer/index.vue
@@ -13,17 +13,16 @@
import { useSceneStore } from '@/store/scene';
import Action from '../action/index.vue';
import { storeToRefs } from 'pinia';
-import { ActionsType } from '@/components/Table';
+import { ActionsType } from '@/views/rule-engine/Scene/typings';
const sceneStore = useSceneStore();
const { data } = storeToRefs(sceneStore);
-const onActionAdd = (_data: ActionsType) => {
- console.log(_data)
- // if (data?.branches && _data) {
- // const newThen = [...data?.branches?.[0].then, data];
- // data.branches[0].then = newThen;
- // }
+const onActionAdd = (_data: any) => {
+ if (data.value?.branches && _data) {
+ data?.value.branches?.[0].then.push(_data)
+ console.log(data?.value.branches?.[0].then)
+ }
};
const onActionUpdate = (_data: ActionsType, type: boolean) => {
diff --git a/src/views/rule-engine/Scene/Save/action/Modal/index.vue b/src/views/rule-engine/Scene/Save/action/Modal/index.vue
index 52b0aa4a..1b9da241 100644
--- a/src/views/rule-engine/Scene/Save/action/Modal/index.vue
+++ b/src/views/rule-engine/Scene/Save/action/Modal/index.vue
@@ -18,13 +18,7 @@
},
]"
>
-
-
+
-
-
+
+
+
+
![]()
+
+
{{item.label}}
+
+
@@ -26,9 +34,13 @@ const props = defineProps({
type: String,
default: '',
},
+ disabled: {
+ type: Boolean,
+ default: false,
+ },
});
-const emit = defineEmits(['update:value'])
+const emit = defineEmits(['update:value']);
const loading = ref(false);
const notifyType = ref('');
@@ -37,17 +49,19 @@ const options = ref([]);
watch(
() => props.value,
(newVal) => {
- notifyType.value = newVal
+ notifyType.value = newVal;
},
{ deep: true, immediate: true },
);
-const onRadioChange = (e: any) => {
- emit('update:value', e.target.value)
-}
+const onSelect = (val: string) => {
+ if (!props.disabled) {
+ emit('update:value', val);
+ }
+};
onMounted(() => {
- loading.value = true
+ loading.value = true;
notice.queryMessageType().then((resp) => {
if (resp.status === 200) {
options.value = (resp.result as any[]).map((item) => {
@@ -58,11 +72,65 @@ onMounted(() => {
};
});
}
- loading.value = false
+ loading.value = false;
});
- notifyType.value = props.value
+ notifyType.value = props.value;
});
\ No newline at end of file
diff --git a/src/views/rule-engine/Scene/Save/action/index.vue b/src/views/rule-engine/Scene/Save/action/index.vue
index 0f2cf3e7..230fe39d 100644
--- a/src/views/rule-engine/Scene/Save/action/index.vue
+++ b/src/views/rule-engine/Scene/Save/action/index.vue
@@ -26,7 +26,7 @@
:actions="
serialArray.length ? serialArray[0].actions : []
"
- @add="onAdd"
+ @add="(_item) => onAdd(_item, false)"
@delete="onDelete"
/>
@@ -50,7 +50,7 @@
? parallelArray[0].actions
: []
"
- @add="onAdd"
+ @add="(_item) => onAdd(_item, true)"
@delete="onDelete"
/>
@@ -98,6 +98,8 @@ watch(
parallelArray.value = newVal.filter((item) => item.parallel);
serialArray.value = newVal.filter((item) => !item.parallel);
+ console.log(parallelArray.value, serialArray.value, '123')
+
const isSerialActions = serialArray.value.some((item) => {
return !!item.actions.length;
});
@@ -128,7 +130,7 @@ const onDelete = (_key: string) => {
emit('update', serialArray[0], false);
}
};
-const onAdd = (actionItem: any) => {
+const onAdd = (actionItem: any, _parallel: boolean) => {
const newParallelArray = [...parallelArray.value];
if (newParallelArray.length) {
const indexOf = newParallelArray[0].actions?.findIndex(
@@ -140,12 +142,11 @@ const onAdd = (actionItem: any) => {
newParallelArray[0].actions.push(actionItem);
}
parallelArray.value = [...newParallelArray];
- console.log(parallelArray.value);
- emit('update', newParallelArray[0], true);
+ emit('update', newParallelArray[0], _parallel);
} else {
actionItem.key = randomString();
emit('add', {
- parallel: true,
+ parallel: _parallel,
key: randomString(),
actions: [actionItem],
});
diff --git a/src/views/rule-engine/Scene/Save/components/CardSelect.vue b/src/views/rule-engine/Scene/Save/components/CardSelect.vue
new file mode 100644
index 00000000..17228c11
--- /dev/null
+++ b/src/views/rule-engine/Scene/Save/components/CardSelect.vue
@@ -0,0 +1,128 @@
+
+
+
+
+
+
{{ item.label }}
+
{{ item.subLabel }}
+
+
+
![]()
+
+
+
+
+
+
+
+
+
\ No newline at end of file