fix: 物模型TSL修改
This commit is contained in:
parent
5a613e40e9
commit
bee4050386
|
@ -7,7 +7,7 @@
|
|||
message: 'ID只能由数字、字母、下划线、中划线组成',
|
||||
},
|
||||
]">
|
||||
<a-input v-model:value="value.id" size="small" @change="asyncOtherConfig"></a-input>
|
||||
<a-input v-model:value="value.id" size="small" @change="asyncOtherConfig" :disabled="metadataStore.model.action === 'edit'"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="名称" name="name" :rules="[
|
||||
{ required: true, message: '请输入名称' },
|
||||
|
@ -67,6 +67,7 @@ import { useProductStore } from '@/store/product';
|
|||
import { getMetadataConfig } from '@/api/device/product'
|
||||
import JsonParam from '@/components/Metadata/JsonParam/index.vue'
|
||||
import { EventLevel, ExpandsTypeList } from '@/views/device/data';
|
||||
import { useMetadataStore } from '@/store/metadata';
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
|
@ -83,6 +84,9 @@ const props = defineProps({
|
|||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const metadataStore = useMetadataStore()
|
||||
|
||||
if (props.modelType === 'events' || props.modelType === 'tags') {
|
||||
if (!props.value.expands) {
|
||||
props.value.expands = {}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</a-form-item>
|
||||
<a-form-item v-if="type === 'product' && ['int', 'float', 'double', 'long', 'date', 'string', 'boolean'].includes(valueType.type)"
|
||||
label="指标配置" :name="name.concat(['metrics'])">
|
||||
<metrics-param v-model:value="_value.metrics" :type="valueType.type" :enum="valueType"></metrics-param>
|
||||
<metrics-param v-model:value="_value.metrics" :type="valueType.type" :enum="valueType" :name="name.concat(['metrics'])"></metrics-param>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<script setup lang="ts" name="ExpandsForm">
|
||||
|
|
|
@ -122,7 +122,7 @@ watch(
|
|||
)
|
||||
|
||||
watch(
|
||||
[props.visible, props.type],
|
||||
() => [props.visible, props.type],
|
||||
() => {
|
||||
if (props.visible) {
|
||||
loading.value = true
|
||||
|
@ -136,7 +136,7 @@ watch(
|
|||
} else {
|
||||
productDetail(id as string).then((resp) => {
|
||||
loading.value = false
|
||||
// productStore.setCurrent(resp.result)
|
||||
productStore.setCurrent(resp.result)
|
||||
value.value = resp.result.metadata
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue