fix: 配置参数输入框充满

This commit is contained in:
TsMask
2023-11-06 17:28:57 +08:00
parent 33f16f6173
commit 0580fdf941
4 changed files with 203 additions and 185 deletions

View File

@@ -11,7 +11,7 @@ VITE_APP_NAME = "核心网管理平台"
VITE_APP_CODE = "CoreNet"
# 应用版本
VITE_APP_VERSION = "1.23.0"
VITE_APP_VERSION = "2.2311.7"
# 接口基础URL地址-不带/后缀
VITE_API_BASE_URL = "/omc-api"

View File

@@ -11,7 +11,7 @@ VITE_APP_NAME = "核心网管理平台"
VITE_APP_CODE = "CoreNet"
# 应用版本
VITE_APP_VERSION = "1.23.1101"
VITE_APP_VERSION = "2.2311.7.1106"
# 接口基础URL地址-不带/后缀
VITE_API_BASE_URL = "/omc-api"

View File

@@ -1148,54 +1148,62 @@ onMounted(() => {
"
class="editable-cell__input-wrapper"
>
<a-space :size="16" align="center" direction="horizontal">
<a-input
v-if="
['string', 'ipv6', 'ipv4', 'regex'].includes(
record['type']
)
"
v-model:value="tableState.editRecord['value']"
></a-input>
<a-input-number
v-else-if="record['type'] === 'int'"
v-model:value="tableState.editRecord['value']"
:min="0"
:max="65535"
style="min-width: 180px;"
></a-input-number>
<a-switch
v-else-if="record['type'] === 'bool'"
v-model:checked="tableState.editRecord['value']"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
></a-switch>
<a-select
v-else-if="record['type'] === 'enum'"
v-model:value="tableState.editRecord['value']"
:allow-clear="true"
style="min-width: 180px;"
<a-input
v-if="
['string', 'ipv6', 'ipv4', 'regex'].includes(
record['type']
)
"
v-model:value="tableState.editRecord['value']"
></a-input>
<a-input-number
v-else-if="record['type'] === 'int'"
v-model:value="tableState.editRecord['value']"
:min="0"
:max="65535"
style="width: 100%"
></a-input-number>
<a-switch
v-else-if="record['type'] === 'bool'"
v-model:checked="tableState.editRecord['value']"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
></a-switch>
<a-select
v-else-if="record['type'] === 'enum'"
v-model:value="tableState.editRecord['value']"
:allow-clear="true"
style="width: 100%"
>
<a-select-option
:value="+v"
:key="+v"
v-for="(k, v) in JSON.parse(record['filter'])"
>
<a-select-option
:value="+v"
:key="+v"
v-for="(k, v) in JSON.parse(record['filter'])"
>
{{ k }}
</a-select-option>
</a-select>
{{ k }}
</a-select-option>
</a-select>
<a-space :size="16" align="center">
<a-popconfirm
title="确认更新该属性值吗?"
placement="top"
@confirm="listEditOk()"
>
<CheckOutlined class="editable-cell__icon-edit" />
<a-button
type="text"
class="editable-cell__icon-edit"
>
<template #icon><CheckOutlined /></template>
</a-button>
</a-popconfirm>
<CloseOutlined
<a-button
type="text"
class="editable-cell__icon-edit"
@click="listEditClose()"
/>
>
<template #icon><CloseOutlined /></template>
</a-button>
</a-space>
</div>
<div v-else class="editable-cell__text-wrapper">
@@ -1269,18 +1277,23 @@ onMounted(() => {
placement="left"
@confirm="arrayEditOk()"
>
<CheckOutlined class="editable-cell__icon-edit" />
<a-button type="text" class="editable-cell__icon-edit">
<template #icon><CheckOutlined /></template>
</a-button>
</a-popconfirm>
</a-tooltip>
<a-tooltip>
<template #title>取消</template>
<CloseOutlined
<a-button
type="text"
class="editable-cell__icon-edit"
@click="arrayEditClose()"
/>
@click.prevent="arrayEditClose()"
>
<template #icon><CloseOutlined /></template>
</a-button>
</a-tooltip>
</a-space>
<a-space :size="8" align="center" v-else>
<a-space :size="16" align="center" v-else>
<a-tooltip>
<template #title>{{ t('common.editText') }}</template>
<a-button type="link" @click.prevent="arrayEdit(record)">
@@ -1312,51 +1325,49 @@ onMounted(() => {
"
class="editable-cell__input-wrapper"
>
<a-space :size="16" align="center" direction="horizontal">
<a-input
v-if="
['string', 'ipv6', 'ipv4', 'regex'].includes(
text['type']
)
"
v-model:value="
tableState.editRecord[text.name]['value']
"
style="width: 100%"
></a-input>
<a-input-number
v-else-if="text['type'] === 'int'"
v-model:value="
tableState.editRecord[text.name]['value']
"
:min="0"
:max="65535"
style="width: 100%"
></a-input-number>
<a-switch
v-else-if="text['type'] === 'bool'"
v-model:checked="
tableState.editRecord[text.name]['value']
"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
></a-switch>
<a-select
v-else-if="text['type'] === 'enum'"
v-model:value="
tableState.editRecord[text.name]['value']
"
style="min-width: 180px;"
<a-input
v-if="
['string', 'ipv6', 'ipv4', 'regex'].includes(
text['type']
)
"
v-model:value="
tableState.editRecord[text.name]['value']
"
style="width: 100%"
></a-input>
<a-input-number
v-else-if="text['type'] === 'int'"
v-model:value="
tableState.editRecord[text.name]['value']
"
:min="0"
:max="65535"
style="width: 100%"
></a-input-number>
<a-switch
v-else-if="text['type'] === 'bool'"
v-model:checked="
tableState.editRecord[text.name]['value']
"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
></a-switch>
<a-select
v-else-if="text['type'] === 'enum'"
v-model:value="
tableState.editRecord[text.name]['value']
"
style="width: 100%"
>
<a-select-option
:value="+v"
:key="+v"
v-for="(k, v) in JSON.parse(text['filter'])"
>
<a-select-option
:value="+v"
:key="+v"
v-for="(k, v) in JSON.parse(text['filter'])"
>
{{ k }}
</a-select-option>
</a-select>
</a-space>
{{ k }}
</a-select-option>
</a-select>
</div>
<a-button
type="link"
@@ -1430,15 +1441,23 @@ onMounted(() => {
placement="left"
@confirm="arrayChildEditOk()"
>
<CheckOutlined class="editable-cell__icon-edit" />
<a-button
type="text"
class="editable-cell__icon-edit"
>
<template #icon><CheckOutlined /></template>
</a-button>
</a-popconfirm>
</a-tooltip>
<a-tooltip>
<template #title>取消</template>
<CloseOutlined
<a-button
type="text"
class="editable-cell__icon-edit"
@click="arrayChildEditClose()"
/>
@click.prevent="arrayChildEditClose()"
>
<template #icon><CloseOutlined /></template>
</a-button>
</a-tooltip>
</a-space>
<a-space :size="8" align="center" v-else>
@@ -1479,64 +1498,58 @@ onMounted(() => {
"
class="editable-cell__input-wrapper"
>
<a-space
:size="16"
align="center"
direction="horizontal"
<a-input
v-if="
['string', 'ipv6', 'ipv4', 'regex'].includes(
text['type']
)
"
v-model:value="
tableState.arrayChildEditRecord[text.name][
'value'
]
"
style="width: 100%"
></a-input>
<a-input-number
v-else-if="text['type'] === 'int'"
v-model:value="
tableState.arrayChildEditRecord[text.name][
'value'
]
"
:min="0"
:max="65535"
style="width: 100%"
></a-input-number>
<a-switch
v-else-if="text['type'] === 'bool'"
v-model:checked="
tableState.arrayChildEditRecord[text.name][
'value'
]
"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
></a-switch>
<a-select
v-else-if="text['type'] === 'enum'"
v-model:value="
tableState.arrayChildEditRecord[text.name][
'value'
]
"
:allow-clear="true"
style="width: 100%"
>
<a-input
v-if="
['string', 'ipv6', 'ipv4', 'regex'].includes(
text['type']
)
"
v-model:value="
tableState.arrayChildEditRecord[text.name][
'value'
]
"
style="width: 100%;"
></a-input>
<a-input-number
v-else-if="text['type'] === 'int'"
v-model:value="
tableState.arrayChildEditRecord[text.name][
'value'
]
"
:min="0"
:max="65535"
style="width: 100%;"
></a-input-number>
<a-switch
v-else-if="text['type'] === 'bool'"
v-model:checked="
tableState.arrayChildEditRecord[text.name][
'value'
]
"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
></a-switch>
<a-select
v-else-if="text['type'] === 'enum'"
v-model:value="
tableState.arrayChildEditRecord[text.name][
'value'
]
"
:allow-clear="true"
style="min-width: 180px;"
<a-select-option
:value="+v"
:key="+v"
v-for="(k, v) in JSON.parse(text['filter'])"
>
<a-select-option
:value="+v"
:key="+v"
v-for="(k, v) in JSON.parse(text['filter'])"
>
{{ k }}
</a-select-option>
</a-select>
</a-space>
{{ k }}
</a-select-option>
</a-select>
</div>
<a-button
type="link"
@@ -1583,5 +1596,10 @@ onMounted(() => {
&__text-wrapper:hover &__icon {
display: inline-block;
}
&__input-wrapper {
display: flex;
justify-content: start;
align-items: center;
}
}
</style>

View File

@@ -1429,7 +1429,7 @@ let modalArrayChildState: ModalArrayChildStateType = reactive({
</a-space>
</div>
<div v-else class="editable-cell__text-wrapper">
{{ `${text}` || '&nbsp;' }}
{{ `${record.value}` || '&nbsp;' }}
<EditOutlined
class="editable-cell__icon"
v-if="record.access !== 'read'"
@@ -1490,42 +1490,42 @@ let modalArrayChildState: ModalArrayChildStateType = reactive({
"
class="editable-cell__input-wrapper"
>
<a-space :size="16" align="center" direction="horizontal">
<a-input
v-if="
['string', 'ipv6', 'ipv4', 'regex'].includes(
item['type']
)
"
v-model:value="state.editRecord[item.name]['value']"
></a-input>
<a-input-number
v-else-if="item['type'] === 'int'"
v-model:value="state.editRecord[item.name]['value']"
:min="0"
:max="65535"
></a-input-number>
<a-switch
v-else-if="item['type'] === 'bool'"
v-model:checked="state.editRecord[item.name]['value']"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
></a-switch>
<a-select
v-else-if="item['type'] === 'enum'"
v-model:value="state.editRecord[item.name]['value']"
:allow-clear="true"
style="width: 100%"
<a-input
v-if="
['string', 'ipv6', 'ipv4', 'regex'].includes(
item['type']
)
"
v-model:value="state.editRecord[item.name]['value']"
style="width: 100%"
></a-input>
<a-input-number
v-else-if="item['type'] === 'int'"
v-model:value="state.editRecord[item.name]['value']"
:min="0"
:max="65535"
style="width: 100%"
></a-input-number>
<a-switch
v-else-if="item['type'] === 'bool'"
v-model:checked="state.editRecord[item.name]['value']"
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
></a-switch>
<a-select
v-else-if="item['type'] === 'enum'"
v-model:value="state.editRecord[item.name]['value']"
:allow-clear="true"
style="width: 100%"
>
<a-select-option
:value="+v"
:key="+v"
v-for="(k, v) in JSON.parse(item['filter'])"
>
<a-select-option
:value="+v"
:key="+v"
v-for="(k, v) in JSON.parse(item['filter'])"
>
{{ k }}
</a-select-option>
</a-select>
</a-space>
{{ k }}
</a-select-option>
</a-select>
</div>
<a-button
type="link"