From da2126d874ae1e052f912ce5e320937dee4785aa Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Tue, 28 Mar 2023 15:01:40 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20bug#11122=E3=80=8111120=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=BD=91=E7=BB=9C=E7=BB=84=E4=BB=B6=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/link/Type/Detail/index.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/link/Type/Detail/index.vue b/src/views/link/Type/Detail/index.vue index 0be2e4a6..336cc907 100644 --- a/src/views/link/Type/Detail/index.vue +++ b/src/views/link/Type/Detail/index.vue @@ -1021,7 +1021,9 @@ type="primary" @click="saveData" :loading="loading" - :hasPermission="`link/Type:${id ? 'update' : 'add'}`" + :hasPermission="`link/Type:${ + id !== ':id' ? 'update' : 'add' + }`" > 保存 @@ -1219,7 +1221,9 @@ const saveData = async () => { loading.value = true; const resp: any = - id === ':id' ? await save(params) : await update({ ...params, id }); + id === ':id' + ? await save(params).catch(() => {}) + : await update({ ...params, id }).catch(() => {}); loading.value = false; if (resp?.status === 200) { onlyMessage('操作成功', 'success'); From 716df458913f6ef84a0051423cbf411ee6dfc7ad Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 28 Mar 2023 15:06:19 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E5=9C=BA=E6=99=AF=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NormalUpload/index.vue | 21 +++++++------- src/views/device/Instance/Import/index.vue | 5 +++- src/views/device/Instance/Save/index.vue | 2 ++ .../device/components/Metadata/Cat/index.vue | 15 ++++++---- .../Scene/Save/action/Delay/index.vue | 28 +++++++++++-------- .../Save/action/Device/device/Device.vue | 3 +- .../Scene/Save/action/Device/device/Tag.vue | 16 +++++------ .../Scene/Save/action/ListItem/Item.vue | 8 +++--- .../action/Notify/VariableDefinitions.vue | 15 ++++++++-- .../action/Notify/variableItem/BuildIn.vue | 19 ++++++++----- 10 files changed, 80 insertions(+), 52 deletions(-) diff --git a/src/components/NormalUpload/index.vue b/src/components/NormalUpload/index.vue index 15c365c5..296164f1 100644 --- a/src/components/NormalUpload/index.vue +++ b/src/components/NormalUpload/index.vue @@ -1,6 +1,6 @@ @@ -100,6 +102,7 @@ const handleCancel = () => { }; const handleSave = () => { + emit('close'); emit('save'); }; \ 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 21b63b15..17ac2138 100644 --- a/src/views/device/Instance/Save/index.vue +++ b/src/views/device/Instance/Save/index.vue @@ -193,6 +193,8 @@ watch( } }); Object.assign(modelRef, newValue); + // description 和 describe 处理 + modelRef.describe = newValue?.describe || newValue?.description }, { immediate: true, deep: true }, ); diff --git a/src/views/device/components/Metadata/Cat/index.vue b/src/views/device/components/Metadata/Cat/index.vue index 9ff7c0bd..8dcdda33 100644 --- a/src/views/device/components/Metadata/Cat/index.vue +++ b/src/views/device/components/Metadata/Cat/index.vue @@ -117,11 +117,16 @@ const routeChange = async (id: string) => { }); } } -watch( - () => route.params.id, - (id) => routeChange(id as string), - { immediate: true } -) + +// watch( +// () => route.params.id, +// (id) => routeChange(id as string), +// { immediate: true } +// ) + +onMounted(() => { + routeChange(route.params.id as string) +}) watch( () => [props.visible, props.type], diff --git a/src/views/rule-engine/Scene/Save/action/Delay/index.vue b/src/views/rule-engine/Scene/Save/action/Delay/index.vue index 6a79672e..cf1a8d28 100644 --- a/src/views/rule-engine/Scene/Save/action/Delay/index.vue +++ b/src/views/rule-engine/Scene/Save/action/Delay/index.vue @@ -12,7 +12,7 @@ placeholder="请输入时间" v-model:value="_value" :precision="3" - :min="0" + :min="0.001" :max="65535" > @@ -79,7 +84,6 @@ const formRef = ref(); const modelRef = reactive({}); watchEffect(() => { - console.log(props?.value) Object.assign(modelRef, props?.value); }); @@ -88,6 +92,9 @@ const getType = (item: any) => { }; const checkValue = (_rule: any, value: any, item: any) => { + if(!value){ + return Promise.resolve(); + } const type = item.expands?.businessType || item?.type; if (type === 'file') { return Promise.resolve(); @@ -153,7 +160,7 @@ const checkValue = (_rule: any, value: any, item: any) => { if ( props.notify.notifyType && ['sms', 'voice'].includes(props?.notify?.notifyType) && - value?.source !== 'relation' + value?.source !== 'relation' && value?.value ) { const reg = /^[1][3-9]\d{9}$/; if (!reg.test(value?.value)) { @@ -173,6 +180,8 @@ const onChange = (val: any, type: any) => { emit('change', { tagName: val }); } else if (type === 'user') { emit('change', { sendTo: val }); + } else if (type === 'build-in') { + // emit('change', { sendTo: val }); } }; diff --git a/src/views/rule-engine/Scene/Save/action/Notify/variableItem/BuildIn.vue b/src/views/rule-engine/Scene/Save/action/Notify/variableItem/BuildIn.vue index 107679fa..019698f7 100644 --- a/src/views/rule-engine/Scene/Save/action/Notify/variableItem/BuildIn.vue +++ b/src/views/rule-engine/Scene/Save/action/Notify/variableItem/BuildIn.vue @@ -16,12 +16,14 @@ placeholder="请选择参数" style="width: calc(100% - 120px)" :fieldNames="{ label: 'name', value: 'id' }" - @change="(val) => itemOnChange(undefined, val)" + @change="(val, label) => itemOnChange(undefined, val, label)" > @@ -84,7 +86,7 @@ const props = defineProps({ }, }); -const emit = defineEmits(['update:value']); +const emit = defineEmits(['update:value', 'change']); const source = computed(() => { return props.value?.source || 'fixed'; @@ -97,15 +99,18 @@ const sourceChange = (val: any) => { emit('update:value', { ...props.value, source: val, - value: undefined + value: undefined, }); }; -const itemOnChange = (val: any, _upperKey?: string) => { +const itemOnChange = (val: any, _upperKey?: string, label?: any) => { emit('update:value', { ...props.value, value: val, - upperKey: _upperKey + upperKey: _upperKey, + }); + emit('change', { + sendTo: label?.[0] || val, }); }; @@ -164,7 +169,7 @@ watch( watch( () => props.value.upperKey, (newVal) => { - upperKey.value = newVal + upperKey.value = newVal; }, { immediate: true }, ); From 166d99b019b9ffaa65610890aba772cdc4ae5967 Mon Sep 17 00:00:00 2001 From: wangshuaiswim Date: Tue, 28 Mar 2023 15:10:07 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=A9=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E8=A7=84=E5=88=99=E5=88=9D=E5=A7=8B=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Metadata/VirtualRuleParam/index.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/Metadata/VirtualRuleParam/index.vue b/src/components/Metadata/VirtualRuleParam/index.vue index 751a1033..a858a468 100644 --- a/src/components/Metadata/VirtualRuleParam/index.vue +++ b/src/components/Metadata/VirtualRuleParam/index.vue @@ -42,9 +42,7 @@ import { getStreamingAggType } from '@/api/device/product' const props = defineProps({ value: { type: Object, - default: () => ({ - type: 'script', - }) + default: () => ({}) }, name: { type: Array as PropType<(string| number)[]>, @@ -89,7 +87,7 @@ const changeWindow = (val: boolean | string | number) => { props.value.window = {} } } else { - delete props.value.type + props.value.type = 'script' } } From fed965488bd33fefec924617fd64701b262ae8d6 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 28 Mar 2023 15:25:15 +0800 Subject: [PATCH 4/6] fix: 11086 --- src/views/edge/Device/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/edge/Device/index.vue b/src/views/edge/Device/index.vue index 177bf623..e275e26b 100644 --- a/src/views/edge/Device/index.vue +++ b/src/views/edge/Device/index.vue @@ -110,9 +110,9 @@ }" /> -