fix: bug#19071
This commit is contained in:
parent
f90ee686c1
commit
f319d4e0e2
|
@ -6,10 +6,9 @@ import { EventLevel } from "@/views/device/data";
|
|||
import {MetadataType} from "@/views/device/Product/typings";
|
||||
import { getUnit } from '@/api/device/instance';
|
||||
import {Ref} from "vue";
|
||||
import {omit, pick} from "lodash-es";
|
||||
import {omit, pick, isObject, cloneDeep} from "lodash-es";
|
||||
import { message } from 'jetlinks-ui-components'
|
||||
import { onlyMessage } from "@/utils/comm";
|
||||
import {cloneDeep} from "lodash";
|
||||
interface DataTableColumnProps extends ColumnProps {
|
||||
type?: string,
|
||||
components?: {
|
||||
|
@ -37,9 +36,7 @@ const type = {
|
|||
report: '上报',
|
||||
};
|
||||
|
||||
export const validatorConfig = (value: any, isObject: boolean = false) => {
|
||||
|
||||
console.log(value)
|
||||
export const validatorConfig = (value: any, _isObject: boolean = false) => {
|
||||
|
||||
if (!value) {
|
||||
return Promise.resolve()
|
||||
|
@ -52,11 +49,11 @@ export const validatorConfig = (value: any, isObject: boolean = false) => {
|
|||
return Promise.reject('请选择元素类型')
|
||||
}
|
||||
|
||||
if (isObject && value.type === 'object' && !value.properties?.length) {
|
||||
if (_isObject && value.type === 'object' && !value.properties?.length) {
|
||||
return Promise.reject('请添加参数')
|
||||
}
|
||||
|
||||
if (value.type === 'file' && (!value.fileType || !Object.keys(value.fileType).length)) {
|
||||
if (value.type === 'file' && (!value.fileType || (isObject(value.fileType) && !Object.keys(value.fileType).length))) {
|
||||
return Promise.reject('请选择文件类型')
|
||||
}
|
||||
|
||||
|
|
|
@ -55,15 +55,15 @@
|
|||
import { getUnit } from '@/api/device/instance';
|
||||
import {
|
||||
DataTableTypeSelect,
|
||||
DataTableArray,
|
||||
DataTableString,
|
||||
DataTableInteger,
|
||||
DataTableDouble,
|
||||
DataTableBoolean,
|
||||
DataTableEnum,
|
||||
DataTableFile,
|
||||
DataTableDate,
|
||||
DataTableObject,
|
||||
DataTableArray,
|
||||
DataTableString,
|
||||
DataTableInteger,
|
||||
DataTableDouble,
|
||||
DataTableBoolean,
|
||||
DataTableEnum,
|
||||
DataTableFile,
|
||||
DataTableDate,
|
||||
DataTableObject, Form,
|
||||
} from 'jetlinks-ui-components';
|
||||
|
||||
import ConfigModal from '@/views/device/components/Metadata/Base/components/ConfigModal.vue'
|
||||
|
@ -83,7 +83,7 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
|
||||
const formItemContext = Form.useInjectFormItemContext();
|
||||
const options = ref<{ label: string; value: string }[]>([]);
|
||||
const emit = defineEmits(['update:value']);
|
||||
|
||||
|
@ -235,6 +235,7 @@ const valueChange = () => {
|
|||
...props.value,
|
||||
output: {...data.value, type: type.value},
|
||||
});
|
||||
formItemContext.onFieldChange()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue