fix: bug#19080
This commit is contained in:
parent
aa0ffab927
commit
5382aee3fe
|
@ -21,7 +21,6 @@
|
||||||
{{ TypeStringMap[data.record.valueType?.type] }}
|
{{ TypeStringMap[data.record.valueType?.type] }}
|
||||||
</template>
|
</template>
|
||||||
<template #config="{ data }">
|
<template #config="{ data }">
|
||||||
<!-- <OtherConfigInfo :value="data.record.valueType"></OtherConfigInfo>-->
|
|
||||||
<ConfigModal v-model:value="data.record.valueType" :showOther="false" />
|
<ConfigModal v-model:value="data.record.valueType" :showOther="false" />
|
||||||
</template>
|
</template>
|
||||||
</DataTableObject>
|
</DataTableObject>
|
||||||
|
@ -54,7 +53,7 @@
|
||||||
|
|
||||||
<script setup lang="ts" name="MetadataDataType">
|
<script setup lang="ts" name="MetadataDataType">
|
||||||
import { getUnit } from '@/api/device/instance';
|
import { getUnit } from '@/api/device/instance';
|
||||||
import { ValueObject } from '../components'
|
import {DataType, ValueObject} from '../components'
|
||||||
import {
|
import {
|
||||||
DataTableTypeSelect,
|
DataTableTypeSelect,
|
||||||
DataTableArray,
|
DataTableArray,
|
||||||
|
@ -68,7 +67,7 @@ import {
|
||||||
DataTableObject,
|
DataTableObject,
|
||||||
} from 'jetlinks-ui-components';
|
} from 'jetlinks-ui-components';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import {handleTypeValue, typeSelectChange, TypeStringMap, useUnit} from '../columns'
|
import {handleTypeValue, typeSelectChange, TypeStringMap, useUnit, validatorConfig} from '../columns'
|
||||||
import ConfigModal from './ConfigModal.vue'
|
import ConfigModal from './ConfigModal.vue'
|
||||||
import { Form } from 'jetlinks-ui-components'
|
import { Form } from 'jetlinks-ui-components'
|
||||||
|
|
||||||
|
@ -137,7 +136,6 @@ const columns = [{
|
||||||
required: true,
|
required: true,
|
||||||
rules: [{
|
rules: [{
|
||||||
validator(_: any, value: any) {
|
validator(_: any, value: any) {
|
||||||
console.log('validator',value)
|
|
||||||
if (!value?.type) {
|
if (!value?.type) {
|
||||||
return Promise.reject('请选择数据类型')
|
return Promise.reject('请选择数据类型')
|
||||||
}
|
}
|
||||||
|
@ -150,7 +148,23 @@ const columns = [{
|
||||||
{
|
{
|
||||||
title: '其他配置',
|
title: '其他配置',
|
||||||
dataIndex: 'config',
|
dataIndex: 'config',
|
||||||
width: 100
|
width: 100,
|
||||||
|
// components: {
|
||||||
|
// name: ConfigModal,
|
||||||
|
// props: {
|
||||||
|
// showOther: false
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
form: {
|
||||||
|
rules: [{
|
||||||
|
callback(rule: any, value: any, dataSource: any[]) {
|
||||||
|
const field = rule.field.split('.')
|
||||||
|
const fieldIndex = Number(field[1])
|
||||||
|
const values = dataSource.find((item, index) => index === fieldIndex)
|
||||||
|
return validatorConfig(values?.valueType)
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
|
Loading…
Reference in New Issue