fix(issue#3 追报): 公网7890系第三方网关定位+CMPP版本协商(3.0按1B布局应答)+ISMG串掺shared_secret+系统配置弹窗防截断

This commit is contained in:
2026-11-18 10:58:18 +08:00
parent 7d34130079
commit cc99aac16f
8 changed files with 157 additions and 10 deletions
+27 -3
View File
@@ -36,13 +36,20 @@
</template>
</el-table>
<el-dialog v-model="dlg" :title="editing ? '编辑参数' : '新增参数'" width="520px">
<el-dialog v-model="dlg" :title="editing ? '编辑参数' : '新增参数'" width="520px"
align-center append-to-body class="sc-dlg">
<el-form label-width="90px">
<el-form-item label="配置键">
<el-select v-model="form.cfg_key" filterable allow-create default-first-option
:disabled="editing" placeholder="选择已知键或输入新键" style="width: 100%" data-testid="cfg-key">
<el-option v-for="k in KNOWN_CFG_KEYS" :key="k.key" :value="k.key" :label="`${k.key}(${k.label})`" />
<el-option v-for="k in KNOWN_CFG_KEYS" :key="k.key" :value="k.key" :label="k.key">
<div class="sc-opt">
<span class="sc-opt-key">{{ k.key }}</span>
<span class="sc-opt-label">{{ k.label }}</span>
</div>
</el-option>
</el-select>
<div v-if="keyHint" class="sc-key-hint">{{ keyHint }}</div>
</el-form-item>
<el-form-item label="配置值">
<el-input v-model="form.cfg_value" type="textarea" :rows="2" maxlength="1024" show-word-limit
@@ -63,7 +70,7 @@
<script setup lang="ts">
// Issue#3 方案B:系统配置页(keep-alive 缓存锚点——组件名必须=路由 name)。
defineOptions({ name: 'system' })
import { onMounted, ref } from 'vue'
import { computed, onMounted, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { KNOWN_CFG_KEYS, systemApi, type SystemConfigRow } from '@/api/system'
@@ -74,6 +81,12 @@ const saving = ref(false)
const editing = ref(false)
const form = ref({ cfg_key: '', cfg_value: '', remark: '' })
// 选中已知键时在下方给出该键的生效说明(替代下拉里拼接长 label 被截断)。
const keyHint = computed(() => {
const hit = KNOWN_CFG_KEYS.find((k) => k.key === form.value.cfg_key)
return hit?.hint ?? ''
})
async function reload() {
loading.value = true
try {
@@ -127,4 +140,15 @@ async function save() {
.sc-hint-key { font-family: monospace; }
.sc-key { font-family: monospace; }
.sc-val { font-family: monospace; }
.sc-key-hint { font-size: var(--gosms-fs-xs, 12px); color: var(--gosms-text-dim, #909399); line-height: 1.5; margin-top: 4px; word-break: break-all; }
</style>
<style>
/* 弹窗防截断(append-to-body 后为全局层):窄视口不右溢、超高内容内滚、footer 恒可见。 */
.sc-dlg { max-width: 92vw; }
.sc-dlg .el-dialog__body { max-height: 62vh; overflow-y: auto; }
/* 下拉选项两行:key 等宽主行 + 中文说明副行(单行拼接长 label 会省略号截断)。 */
.sc-opt { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.sc-opt-key { font-family: monospace; font-size: 13px; }
.sc-opt-label { font-size: 12px; color: #909399; }
</style>