feat: 参数配置access只读属性支持['read-only', 'read', 'ro']

This commit is contained in:
TsMask
2024-04-11 11:53:17 +08:00
parent 612fb77861
commit aca842f8c2

View File

@@ -1349,7 +1349,7 @@ onMounted(() => {
<EditOutlined <EditOutlined
class="editable-cell__icon" class="editable-cell__icon"
@click="listEdit(record)" @click="listEdit(record)"
v-if="!['read-only', 'ro'].includes(record.access)" v-if="!['read-only', 'read', 'ro'].includes(record.access)"
/> />
</div> </div>
</div> </div>
@@ -1601,7 +1601,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="['read-only', 'ro'].includes(item.access)" :disabled="['read-only', 'read', 'ro'].includes(item.access)"
style="width: 100%" style="width: 100%"
></a-input-number> ></a-input-number>
<a-switch <a-switch
@@ -1609,12 +1609,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)" :disabled="['read-only', 'read', '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)" :disabled="['read-only', 'read', 'ro'].includes(item.access)"
:allow-clear="true" :allow-clear="true"
style="width: 100%" style="width: 100%"
> >
@@ -1629,7 +1629,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="['read-only', 'ro'].includes(item.access)" :disabled="['read-only', 'read', 'ro'].includes(item.access)"
></a-input> ></a-input>
</div> </div>
<div v-else> <div v-else>