From 53900e620880324dc5becc4b35bfc555a160f3be Mon Sep 17 00:00:00 2001 From: wxlong Date: Thu, 4 Dec 2025 20:54:03 +0800 Subject: [PATCH] =?UTF-8?q?20251204=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=B0=8F=E7=8F=AD=E5=A4=9A=E5=AA=92=E4=BD=93?= =?UTF-8?q?=E5=8F=8A=E5=B1=9E=E6=80=A7=E6=9F=A5=E7=9C=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataManagement/DataManagement.vue | 80 ++++++++++++++++--- src/components/DataManagement/featureInfo.vue | 26 +++++- 2 files changed, 96 insertions(+), 10 deletions(-) diff --git a/src/components/DataManagement/DataManagement.vue b/src/components/DataManagement/DataManagement.vue index ee8548b..7b5a49d 100644 --- a/src/components/DataManagement/DataManagement.vue +++ b/src/components/DataManagement/DataManagement.vue @@ -135,18 +135,12 @@

-
+
返回父表 - - 进入子表 + @click="ifsub ? getGeoJson() : getSubGeoJson()" + >{{ ifsub ? '返回父表' : '进入子表' }} 0 && typeof parsed[0] === 'object' && parsed[0] !== null) { + // 提取所有 value 值,用逗号连接 + var values = parsed.map(function(item) { + // 如果 value 存在且不为空,返回 value;否则返回空字符串 + if (item.value !== undefined && item.value !== null && item.value !== '') { + return item.value + } + return '' + }).filter(function(v) { + return v !== '' + }) + // 如果所有值都为空,设置为空字符串;否则用逗号连接 + jsondata[key] = values.length > 0 ? values.join(', ') : '' + } + } catch (e) { + // 如果解析失败,保持原值 + console.warn('Failed to parse dictionary array for key:', key, e) + } + } + } + that.Info = jsondata } else if (response.data.status === '401') { that.$alert(response.data.message) @@ -1217,6 +1245,40 @@ export default { } jsondata.imagedata = imagedata jsondata.videodata = videodata + + // 处理字典数组:将属性值为字典数组的字段转换为 value 值 + for (var key in jsondata) { + // 排除特殊字段 + if (key === 'imagedata' || key === 'videodata' || key === 'mediaFileURLs' || key === 'id') { + continue + } + var value = jsondata[key] + // 检查是否为字符串且可能是JSON格式 + if (typeof value === 'string' && value.trim().startsWith('[') && value.trim().endsWith(']')) { + try { + var parsed = JSON.parse(value) + // 检查是否为数组且数组元素是对象 + if (Array.isArray(parsed) && parsed.length > 0 && typeof parsed[0] === 'object' && parsed[0] !== null) { + // 提取所有 value 值,用逗号连接 + var values = parsed.map(function(item) { + // 如果 value 存在且不为空,返回 value;否则返回空字符串 + if (item.value !== undefined && item.value !== null && item.value !== '') { + return item.value + } + return '' + }).filter(function(v) { + return v !== '' + }) + // 如果所有值都为空,设置为空字符串;否则用逗号连接 + jsondata[key] = values.length > 0 ? values.join(', ') : '' + } + } catch (e) { + // 如果解析失败,保持原值 + console.warn('Failed to parse dictionary array for key:', key, e) + } + } + } + that.EditionInfo = jsondata } else if (response.data.status === '401') { that.$alert(response.data.message) diff --git a/src/components/DataManagement/featureInfo.vue b/src/components/DataManagement/featureInfo.vue index f69e2dd..e3c432e 100644 --- a/src/components/DataManagement/featureInfo.vue +++ b/src/components/DataManagement/featureInfo.vue @@ -497,7 +497,31 @@ export default { } } -.attributes-section, +.attributes-section { + max-height: 400px; + overflow-y: auto; + min-height: 200px; + + /* 自定义滚动条样式 */ + &::-webkit-scrollbar { + width: 8px; + } + + &::-webkit-scrollbar-track { + background: rgba(232, 245, 233, 0.3); + border-radius: 4px; + } + + &::-webkit-scrollbar-thumb { + background: linear-gradient(180deg, #81c784, #66bb6a); + border-radius: 4px; + + &:hover { + background: linear-gradient(180deg, #66bb6a, #4caf50); + } + } +} + .images-section, .videos-section { min-height: 200px;