fix: 优化物模型-功能定义-输出
This commit is contained in:
parent
d76aa3f65c
commit
90df330400
|
@ -162,6 +162,7 @@
|
|||
style="padding: 0"
|
||||
danger
|
||||
:pop-confirm="{
|
||||
placement: 'topRight',
|
||||
title: dataSource.length === 1 ? '这是最后一条数据了,确认删除?' : '确认删除?',
|
||||
onConfirm: async () => {
|
||||
await removeItem(data.index, dataSource.length === 1);
|
||||
|
|
|
@ -90,7 +90,7 @@ export const useColumns = (type?: MetadataType, target?: 'device' | 'product', d
|
|||
const hasId = oldValue.some((item) => item.id === value)
|
||||
if (value) {
|
||||
if (hasId) {
|
||||
return Promise.reject('标识重复')
|
||||
return Promise.reject('该标识存在')
|
||||
}
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
v-if="type === 'array'"
|
||||
v-model:value="_valueType.elementType"
|
||||
:unitOptions="options"
|
||||
placement="topRight"
|
||||
@confirm="valueChange"
|
||||
/>
|
||||
<DataTableObject
|
||||
v-else-if="type === 'object'"
|
||||
v-model:value="_valueType.properties"
|
||||
placement="topRight"
|
||||
:columns="[
|
||||
{ title: '参数标识', dataIndex: 'id', type: 'text', width: 100 },
|
||||
{ title: '参数名称', dataIndex: 'name', type: 'text', width: 100 },
|
||||
|
@ -48,25 +50,28 @@
|
|||
<OtherConfigInfo :value="data.record.valueType"></OtherConfigInfo>
|
||||
</template>
|
||||
</DataTableObject>
|
||||
<DataTableEnum v-else-if="type === 'enum'" v-model:value="_valueType" @confirm="valueChange"/>
|
||||
<DataTableBoolean v-else-if="type === 'boolean'" v-model:value="_valueType" @confirm="valueChange"/>
|
||||
<DataTableEnum v-else-if="type === 'enum'" v-model:value="_valueType" placement="topRight" @confirm="valueChange"/>
|
||||
<DataTableBoolean v-else-if="type === 'boolean'" v-model:value="_valueType" placement="topRight" @confirm="valueChange"/>
|
||||
<DataTableDouble
|
||||
v-else-if="['float', 'double'].includes(type)"
|
||||
:options="options"
|
||||
v-model:value="_valueType"
|
||||
placement="topRight"
|
||||
@confirm="valueChange"
|
||||
/>
|
||||
<DataTableInteger
|
||||
v-else-if="['int', 'long'].includes(type)"
|
||||
:options="options"
|
||||
v-model:value="_valueType.unit"
|
||||
placement="topRight"
|
||||
@confirm="valueChange"
|
||||
/>
|
||||
<DataTableFile v-else-if="type === 'file'" v-model:value="_valueType.fileType" @confirm="valueChange"/>
|
||||
<DataTableDate v-else-if="type === 'date'" v-model:value="_valueType.format" @confirm="valueChange"/>
|
||||
<DataTableFile v-else-if="type === 'file'" v-model:value="_valueType.fileType" placement="topRight" @confirm="valueChange"/>
|
||||
<DataTableDate v-else-if="type === 'date'" v-model:value="_valueType.format" placement="topRight" @confirm="valueChange"/>
|
||||
<DataTableString
|
||||
v-else-if="['string', 'password'].includes(type)"
|
||||
v-model:value="_valueType.maxLength"
|
||||
placement="topRight"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -93,7 +93,7 @@ watch(() => JSON.stringify(dataSource.value), () => {
|
|||
const hasId = oldValue.some((item) => item.id === value)
|
||||
if (value) {
|
||||
if (hasId) {
|
||||
return Promise.reject('标识重复')
|
||||
return Promise.reject('该标识存在')
|
||||
}
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
@ -127,10 +127,6 @@ watch(() => JSON.stringify(dataSource.value), () => {
|
|||
{
|
||||
title: '其他配置',
|
||||
dataIndex: 'config',
|
||||
type: 'components',
|
||||
components: {
|
||||
name: DataTypeObjectChild
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
{{ data.record.range === 'true' ? '范围值' : '固定值'}}
|
||||
</template>
|
||||
<template #value="{data}">
|
||||
{{ data.record.range === 'true' ? data.record.value.toString() : data.record.value }}
|
||||
{{ data.record.range === 'true' ? data.record.value?.toString() : data.record.value }}
|
||||
</template>
|
||||
<template #action="{data}">
|
||||
<j-button
|
||||
|
|
|
@ -71,7 +71,7 @@ const showText = computed(() => {
|
|||
if (props.value.range === 'false') {
|
||||
return props.value.value || ''
|
||||
} else {
|
||||
return props.value.value[0] ? props.value.value.join('-') : ''
|
||||
return props.value.value?.[0] ? props.value.value.join('-') : ''
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
@visibleChange="visibleChange"
|
||||
>
|
||||
<template #content>
|
||||
<j-scrollbar height="350">
|
||||
<j-collapse v-model:activeKey="activeKey" >
|
||||
<j-scrollbar height="350" v-if="showMetrics || config.length > 0">
|
||||
<j-collapse v-model:activeKey="activeKey">
|
||||
<j-collapse-panel v-for="(item, index) in config" :key="'store_'+index" :header="item.name">
|
||||
<j-table
|
||||
:columns="columns"
|
||||
|
@ -40,7 +40,14 @@
|
|||
<Metrics ref="metricsRef" :value="myValue.expands?.metrics" :type="props.value?.valueType?.type"/>
|
||||
</j-collapse-panel>
|
||||
</j-collapse>
|
||||
|
||||
</j-scrollbar>
|
||||
<div v-else style="padding-top: 24px">
|
||||
<j-empty
|
||||
description="没有动态配置项"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<j-button>
|
||||
<AIcon type="SettingOutlined" />
|
||||
|
@ -123,8 +130,13 @@ const getConfig = async () => {
|
|||
if (resp.status === 200) {
|
||||
|
||||
config.value = resp.result
|
||||
if (resp.result.length && !configValue.value) {
|
||||
if (resp.result.length) {
|
||||
activeKey.value = ['store_0']
|
||||
} else if (showMetrics.value) {
|
||||
activeKey.value = ['metrics']
|
||||
}
|
||||
|
||||
if (resp.result.length && !configValue.value) {
|
||||
resp.result.forEach(a => {
|
||||
if (a.properties) {
|
||||
a.properties.forEach(b => {
|
||||
|
@ -132,8 +144,6 @@ const getConfig = async () => {
|
|||
})
|
||||
}
|
||||
})
|
||||
} else if (showMetrics.value) {
|
||||
activeKey.value = ['metrics']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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#6633322daa90f3acd9a48aeab61c5eaf23c06e10"
|
||||
integrity sha512-5KxeoLb9tnA4TGoX5Q1e43jNobPmGfHk+lxZsxEs50LTaOYVj0E6DSqCfaHbLHrXMdCcL45eKRCauRusVIXQTA==
|
||||
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#4fed08d639873b642911b808d94ef64856c62cd1"
|
||||
integrity sha512-bFdN1VdrOR8bmHlE81h5MoTSSwpXPS/qjW0ppDZU55qm8GtNszZfGBi8VeWD2Kvn1oTM43ldyVcGVqipl2DtMQ==
|
||||
dependencies:
|
||||
"@vueuse/core" "^9.12.0"
|
||||
"@vueuse/router" "^9.13.0"
|
||||
|
|
Loading…
Reference in New Issue