fix: 查询存储策略增加防抖节流

This commit is contained in:
wangshuaiswim 2023-03-24 18:06:43 +08:00
parent ebd304fdba
commit bba4650fc8
1 changed files with 3 additions and 2 deletions

View File

@ -70,6 +70,7 @@ import { EventLevel, ExpandsTypeList } from '@/views/device/data';
import { useMetadataStore } from '@/store/metadata';
import { validateJson } from './validator';
import { Rule } from 'ant-design-vue/es/form';
import { debounce } from 'lodash';
const props = defineProps({
type: {
@ -98,7 +99,7 @@ if (props.modelType === 'events' || props.modelType === 'tags') {
const productStore = useProductStore()
const config = ref<Record<any, any>[]>([])
const asyncOtherConfig = async () => {
const asyncOtherConfig = debounce(async () => {
if (props.type !== 'product') return
const { valueType, id } = props.value
const { type } = valueType || {}
@ -115,7 +116,7 @@ const asyncOtherConfig = async () => {
if (resp.status === 200) {
config.value = resp.result
}
}
}, 500)
onMounted(() => {
if (props.modelType === 'properties') {