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 }, );