fix: 兼容物模型映射
This commit is contained in:
parent
e3ef99cbe1
commit
1d238367be
|
@ -51,9 +51,6 @@
|
||||||
<template #valueType="{ data }">
|
<template #valueType="{ data }">
|
||||||
{{ TypeStringMap[data.record.valueType?.type] }}
|
{{ TypeStringMap[data.record.valueType?.type] }}
|
||||||
</template>
|
</template>
|
||||||
<template #expands="{ data }">
|
|
||||||
{{ sourceMap?.[data.record?.expands?.source] || '' }}
|
|
||||||
</template>
|
|
||||||
<template #inputs="{ data }">
|
<template #inputs="{ data }">
|
||||||
<InputParams v-model:value="data.record.inputs" />
|
<InputParams v-model:value="data.record.inputs" />
|
||||||
</template>
|
</template>
|
||||||
|
@ -66,6 +63,9 @@
|
||||||
<template #expands="{ data }" v-if="type === 'events'">
|
<template #expands="{ data }" v-if="type === 'events'">
|
||||||
{{ levelMap?.[data.record.expands?.level] || '-' }}
|
{{ levelMap?.[data.record.expands?.level] || '-' }}
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="type === 'properties'" #expands="{ data }">
|
||||||
|
{{ data.record.id && !data.record?.expands?.source ? '设备' : sourceMap?.[data.record?.expands?.source] || '' }}
|
||||||
|
</template>
|
||||||
<template #properties="{ data }">
|
<template #properties="{ data }">
|
||||||
<ConfigParams v-model:value="data.record.valueType" />
|
<ConfigParams v-model:value="data.record.valueType" />
|
||||||
</template>
|
</template>
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
<template #other="{ data }">
|
<template #other="{ data }">
|
||||||
<j-tooltip
|
<j-tooltip
|
||||||
v-if="target === 'device' && productNoEdit.id?.includes?.(data.record._sortIndex)"
|
v-if="target === 'device' && productNoEdit.id?.includes?.(data.record._sortIndex)"
|
||||||
title="继承自产品物模型的数据不支持删除"
|
title="继承自产品物模型的数据不支持修改"
|
||||||
>
|
>
|
||||||
<!-- <ModelButton :disabled="true"/>-->
|
<!-- <ModelButton :disabled="true"/>-->
|
||||||
<j-button :disabled="true" type="link" style="padding-left: 0;">
|
<j-button :disabled="true" type="link" style="padding-left: 0;">
|
||||||
|
|
|
@ -416,7 +416,7 @@ export const useColumns = (type?: MetadataType, target?: 'device' | 'product', n
|
||||||
name: Source,
|
name: Source,
|
||||||
props: {
|
props: {
|
||||||
noEdit: noEdit?.value?.source || [],
|
noEdit: noEdit?.value?.source || [],
|
||||||
target: target
|
target: target,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doubleClick(record){
|
doubleClick(record){
|
||||||
|
@ -434,7 +434,6 @@ export const useColumns = (type?: MetadataType, target?: 'device' | 'product', n
|
||||||
rules: target !== 'device' ? [
|
rules: target !== 'device' ? [
|
||||||
{
|
{
|
||||||
callback: async (rule: any, value: any, dataSource: any[]) => {
|
callback: async (rule: any, value: any, dataSource: any[]) => {
|
||||||
console.log('value', value)
|
|
||||||
const field = rule.field.split('.')
|
const field = rule.field.split('.')
|
||||||
const fieldIndex = Number(field[1])
|
const fieldIndex = Number(field[1])
|
||||||
|
|
||||||
|
@ -455,24 +454,6 @@ export const useColumns = (type?: MetadataType, target?: 'device' | 'product', n
|
||||||
|
|
||||||
return Promise.reject('请选择属性来源');
|
return Promise.reject('请选择属性来源');
|
||||||
}
|
}
|
||||||
// if (value.source) {
|
|
||||||
// if(value.source !== 'rule') {
|
|
||||||
// if(value.type?.length) {
|
|
||||||
// return Promise.resolve();
|
|
||||||
// } else {
|
|
||||||
// return Promise.reject('请选择读写类型');
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// if(value.virtualRule?.script) {
|
|
||||||
// return Promise.resolve();
|
|
||||||
// }else {
|
|
||||||
// return Promise.reject('请配置规则');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// return Promise.reject('请选择属性来源');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
]: []
|
]: []
|
||||||
},
|
},
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
</j-scrollbar>
|
</j-scrollbar>
|
||||||
</template>
|
</template>
|
||||||
<j-button :disabled="!myValue" type="link" style="padding: 4px 8px">
|
<j-button style="padding: 4px 8px" type="link">
|
||||||
<AIcon type="EditOutlined" />
|
<AIcon type="EditOutlined" />
|
||||||
</j-button>
|
</j-button>
|
||||||
</j-popconfirm-modal>
|
</j-popconfirm-modal>
|
||||||
|
@ -146,7 +146,11 @@ const confirm = async () => {
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
() => {
|
() => {
|
||||||
|
if (props.value.id && !props.value?.expands?.source) {
|
||||||
|
myValue.value = 'device';
|
||||||
|
} else {
|
||||||
myValue.value = props.value?.expands?.source || '';
|
myValue.value = props.value?.expands?.source || '';
|
||||||
|
}
|
||||||
type.value = props.value?.expands?.type || [];
|
type.value = props.value?.expands?.type || [];
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
|
|
Loading…
Reference in New Issue