fix: 参数配置编辑只读项禁用编辑

This commit is contained in:
TsMask
2023-11-28 15:19:20 +08:00
parent 55981f8936
commit c21fbd133a

View File

@@ -1330,11 +1330,7 @@ onMounted(() => {
<!-- 多列数据渲染 -->
<template #bodyCell="{ column, text, record }">
<template v-if="column?.key === 'index'">
<a-space
:size="16"
align="center"
v-if="!['read-only', 'ro'].includes(text.access)"
>
<a-space :size="16" align="center">
<a-tooltip>
<template #title>{{ t('common.editText') }}</template>
<a-button type="link" @click.prevent="arrayEdit(text)">
@@ -1423,11 +1419,7 @@ onMounted(() => {
</template>
<template #bodyCell="{ column, text, record }">
<template v-if="column?.key === 'index'">
<a-space
:size="8"
align="center"
v-if="!['read-only', 'ro'].includes(text.access)"
>
<a-space :size="8" align="center">
<a-tooltip>
<template #title>{{ t('common.editText') }}</template>
<a-button
@@ -1519,6 +1511,7 @@ onMounted(() => {
<template #title v-if="item.comment">
{{ item.comment }}
</template>
<div>
<div
v-if="
@@ -1529,7 +1522,7 @@ onMounted(() => {
<a-input-number
v-if="item['type'] === 'int'"
v-model:value="modalState.from[item.name]['value']"
:disabled="item.name === 'index'"
:disabled="['read-only', 'ro'].includes(item.access)"
style="width: 100%"
></a-input-number>
<a-switch
@@ -1537,10 +1530,12 @@ onMounted(() => {
v-model:checked="modalState.from[item.name]['value']"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
:disabled="['read-only', 'ro'].includes(item.access)"
></a-switch>
<a-select
v-else-if="item['type'] === 'enum'"
v-model:value="modalState.from[item.name]['value']"
:disabled="['read-only', 'ro'].includes(item.access)"
:allow-clear="true"
style="width: 100%"
>
@@ -1555,7 +1550,7 @@ onMounted(() => {
<a-input
v-else
v-model:value="modalState.from[item.name]['value']"
:disabled="item.name === 'index'"
:disabled="['read-only', 'ro'].includes(item.access)"
></a-input>
</div>
<div v-else>