fix: bug#11328
This commit is contained in:
parent
391ed48365
commit
9c909edafd
|
@ -412,7 +412,6 @@ import {
|
|||
modify,
|
||||
} from '@/api/device/product';
|
||||
import { isNoCommunity } from '@/utils/utils';
|
||||
const productStore = useProductStore();
|
||||
import Driver from 'driver.js';
|
||||
import 'driver.js/dist/driver.min.css';
|
||||
import { marked } from 'marked';
|
||||
|
@ -420,7 +419,9 @@ import type { TableColumnType } from 'ant-design-vue';
|
|||
import { useMenuStore } from '@/store/menu';
|
||||
import _ from 'lodash';
|
||||
import { accessConfigTypeFilter } from '@/utils/setting';
|
||||
import DeviceApi from '@/api/media/device';
|
||||
|
||||
const productStore = useProductStore();
|
||||
const tableRef = ref();
|
||||
const formRef = ref();
|
||||
const menuStore = useMenuStore();
|
||||
|
@ -844,7 +845,9 @@ const submitData = async () => {
|
|||
obj.metadata = JSON.stringify(mdata);
|
||||
}
|
||||
}
|
||||
// 保存或者更新设备接入
|
||||
// DeviceApi.getConfiguration(current.value?.protocol, current.value?.transport)
|
||||
// visible.value = false;
|
||||
// 保存或者更新设备接入
|
||||
const resp: any = obj.id
|
||||
? await updateDevice(obj)
|
||||
: await saveDevice(obj);
|
||||
|
|
|
@ -81,7 +81,7 @@ import { ContextKey, arrayParamsKey, timeTypeKeys } from './util'
|
|||
import { useSceneStore } from 'store/scene'
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { Form } from 'jetlinks-ui-components'
|
||||
import {isArray, pick} from 'lodash-es'
|
||||
import { isArray, isObject, pick } from 'lodash-es'
|
||||
|
||||
const sceneStore = useSceneStore()
|
||||
const { data: formModel } = storeToRefs(sceneStore)
|
||||
|
@ -178,10 +178,20 @@ const handOptionByColumn = (option: any) => {
|
|||
}
|
||||
|
||||
if (option.dataType === 'boolean') {
|
||||
valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [
|
||||
{ label: '是', value: 'true' },
|
||||
{ label: '否', value: 'false' },
|
||||
]
|
||||
// 处理_options为Object时
|
||||
const _options = option.options || option.others
|
||||
if (isObject(_options)) {
|
||||
const bool = (_options as any)?.bool
|
||||
valueOptions.value = [
|
||||
{ label: bool.falseText, value: String(bool.falseValue)},
|
||||
{ label: bool.trueText, value: String(bool.trueValue)},
|
||||
]
|
||||
} else {
|
||||
valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [
|
||||
{ label: '是', value: 'true' },
|
||||
{ label: '否', value: 'false' },
|
||||
]
|
||||
}
|
||||
} else if(option.dataType === 'enum') {
|
||||
valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || []
|
||||
} else{
|
||||
|
|
Loading…
Reference in New Issue