fix: 优化物模型-功能定义-输入
This commit is contained in:
parent
c56dbff80b
commit
a869162799
|
@ -87,6 +87,7 @@
|
|||
{{ sourceMap?.[data.record?.expands?.source] || '' }}
|
||||
</template>
|
||||
<template #inputs="{ data }">
|
||||
<InputParams v-model:value="dataSource[data.index]" />
|
||||
{{ data.record.inputs?.map(item => item.name).join(',') }}
|
||||
</template>
|
||||
<template #output="{ data }">
|
||||
|
@ -202,7 +203,7 @@ import { useMetadata, useOperateLimits } from './hooks';
|
|||
import { useColumns } from './columns';
|
||||
import { levelMap, sourceMap, expandsType, limitsMap } from './utils';
|
||||
import Rule from '@/components/Metadata/Rule';
|
||||
import { Source, OtherSetting } from './components';
|
||||
import { Source, OtherSetting, InputParams } from './components';
|
||||
import { saveProductVirtualProperty } from '@/api/device/product';
|
||||
import { saveDeviceVirtualProperty } from '@/api/device/instance';
|
||||
import { useInstanceStore } from '@/store/instance';
|
||||
|
|
|
@ -172,10 +172,7 @@ export const useColumns = (type?: MetadataType, target?: 'device' | 'product', d
|
|||
{
|
||||
title: '输入参数',
|
||||
dataIndex: 'inputs',
|
||||
type: 'components',
|
||||
components: {
|
||||
name: InputParams,
|
||||
}
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '输出参数',
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="values-test">
|
||||
{{ text }}
|
||||
</div>
|
||||
<!-- <OtherConfigInfo :value="formData"></OtherConfigInfo> -->
|
||||
<OtherConfigInfo :value="formData"></OtherConfigInfo>
|
||||
<DataTableEnum v-if="formData.type === 'enum'" v-model:value="formData" />
|
||||
<DataTableBoolean v-else-if="formData.type === 'boolean'" v-model:value="formData" />
|
||||
<DataTableDouble
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
<template>
|
||||
<div class="input-params">
|
||||
<div class="input-params-text">
|
||||
{{ dataSource?.map((item) => item.name).join(',') }}
|
||||
</div>
|
||||
<DataTableObject v-model:value="dataSource" :columns="columns" :onAdd="addItem" width="700px" @confirm="confirm">
|
||||
<template #valueType="{ data }">
|
||||
<span>{{ data.record.valueType?.type }}</span>
|
||||
|
@ -13,10 +9,11 @@
|
|||
<template #config="{ data }">
|
||||
<OtherConfigInfo :value="data.record.valueType"></OtherConfigInfo>
|
||||
</template>
|
||||
<j-button>
|
||||
<AIcon type="SettingOutlined" />
|
||||
配置
|
||||
</j-button>
|
||||
</DataTableObject>
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="InputParams">
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
type: 'components',
|
||||
dataIndex: 'valueTypes',
|
||||
components: {
|
||||
name: DataTableTypeSelect,
|
||||
name: Type,
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -32,7 +32,9 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
title: '操作'
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 60
|
||||
}
|
||||
]"
|
||||
@confirm="valueChange"
|
||||
|
@ -80,6 +82,7 @@ import {
|
|||
import DataTypeObjectChild from '../DataTypeObjectChild.vue';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import {typeSelectChange} from "@/views/device/components/Metadata/Base/columns";
|
||||
import Type from './Type.vue'
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<template>
|
||||
<DataTableTypeSelect
|
||||
v-model="myValue"
|
||||
:filter="['object']"
|
||||
@change="change"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="DataTypeSelect">
|
||||
import {
|
||||
DataTableTypeSelect,
|
||||
} from 'jetlinks-ui-components';
|
||||
import {typeSelectChange} from "@/views/device/components/Metadata/Base/columns";
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:value'])
|
||||
|
||||
const myValue = ref()
|
||||
|
||||
const change = (e: string) => {
|
||||
const obj = typeSelectChange(e)
|
||||
const _data = {...props.value}
|
||||
_data.valueType = obj
|
||||
emit('update:value', _data)
|
||||
}
|
||||
|
||||
watch(() => props.value, () => {
|
||||
myValue.value = props.value?.valueType?.type
|
||||
}, { immediate: true, deep: true})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -3825,8 +3825,8 @@ jetlinks-store@^0.0.3:
|
|||
|
||||
jetlinks-ui-components@^1.0.23, jetlinks-ui-components@^1.0.24:
|
||||
version "1.0.24"
|
||||
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#1b7ad3ecf9eb4cc8f42692f935d6f2c5cf70e597"
|
||||
integrity sha512-+tS6vzKJlphNUCR59Lc8vJpRfHIzSyMVuhHPfTH3dAa4Ow3OXaUxRdqJhQbDxIwptP3u2Rc7nxdZ5GZFMbJgjw==
|
||||
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#6633322daa90f3acd9a48aeab61c5eaf23c06e10"
|
||||
integrity sha512-5KxeoLb9tnA4TGoX5Q1e43jNobPmGfHk+lxZsxEs50LTaOYVj0E6DSqCfaHbLHrXMdCcL45eKRCauRusVIXQTA==
|
||||
dependencies:
|
||||
"@vueuse/core" "^9.12.0"
|
||||
"@vueuse/router" "^9.13.0"
|
||||
|
|
Loading…
Reference in New Issue