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