fix: 【数据源】API数据源复制设置了主键的表无法修改主键

This commit is contained in:
taojinlong 2024-12-04 10:53:49 +08:00
parent e5457757b9
commit b745be32f4

View File

@ -417,6 +417,22 @@ const disabledFieldLength = item => {
}
}
const disabledSetKey = item => {
if (item.hasOwnProperty('children') && item.children.length > 0) {
return true
}
if (copyItem.value || copyDs.value) {
return false
}
if (editItem.value) {
return true
}
if (!item.checked) {
return true
}
return false
}
const disabledChangeFieldByChildren = item => {
if (apiItem.type == 'params') {
return true
@ -808,7 +824,7 @@ defineExpose({
<el-checkbox
:key="scope.row.jsonPath"
v-model="scope.row.primaryKey"
:disabled="editItem || !scope.row.checked"
:disabled="disabledSetKey(scope.row)"
>
</el-checkbox>
</template>