diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Descriptions.vue b/ruoyi-ui/src/views/JiHeExpressway/components/Descriptions.vue index 2686b17e..a9da0db4 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Descriptions.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/Descriptions.vue @@ -64,6 +64,19 @@ export default { gridRow: `span ${item.gridRow || 1}`, gridColumn: `span ${item.gridColumn || 1}`, }) + }, + getText() { + return (item) => { + const result = this.data[item.key]; + + if (item.enum) return EnumMap[item.enum][result]?.text; + + const templateResult = item.key?.replace(/\$\{[^}]+\}/g, (key) => this.data[key.slice(2, -1)]); + + if (templateResult && templateResult != item.key) return templateResult + + return result || item.text; + } } }, methods: { @@ -72,17 +85,6 @@ export default { gridTemplateColumns: `repeat(${this.column}, 1fr)`, } }, - getText(item) { - const result = this.data[item.key]; - - if (item.enum) return EnumMap[item.enum][result]?.text; - - const templateResult = item.key?.replace(/\$\{[^}]+\}/g, (key) => this.data[key.slice(2, -1)]); - - if (templateResult && templateResult != item.key) return templateResult - - return result || item.text; - }, getComponent(type) { return `Form${type.replace(/^[a-z]/, word => word.toUpperCase())}` }, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/Descriptions.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/Descriptions.vue index 50f7b74d..5bdd5278 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/Descriptions.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/Descriptions.vue @@ -9,7 +9,7 @@

道路名称: - {{ data.roadName || '-' }} + {{ roadName || '-' }}

所属机构: @@ -61,7 +61,8 @@ export default { return { statusEnum: CameraStatusEnum[this.data.status] || {}, cameraType: CameraControlTypeEnum[this.data.ptzCtrl]?.text, - organizationName: null + organizationName: null, + roadName: "" } }, async created() { @@ -81,7 +82,7 @@ export default { const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMarkId); - if (roadInfo) this.data.roadName = roadInfo.dcRoad; + if (roadInfo) this.roadName = roadInfo.roadName; }, } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ControlCamera/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ControlCamera/index.vue index 28739d2c..b5a2d832 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ControlCamera/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ControlCamera/index.vue @@ -18,7 +18,7 @@

- +
@@ -131,9 +131,11 @@ export default { } }, async created() { + this.data = { ...this.dialogData, roadName: null } + const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMarkId); - if (roadInfo) this.dialogData.roadName = roadInfo.dcRoad; + if (roadInfo) this.data.roadName = roadInfo.roadName; }, methods: { controlClick: throttle(function (type) { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue index f6499850..7b557162 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue @@ -5,7 +5,7 @@ - + 设备参数 @@ -84,7 +84,7 @@ export default { } }, async created() { - this.dialogData.roadName = "G35济泽高速"; + this.data = { ...this.dialogData, roadName: null } request({ url: `/business/product/${this.dialogData.productId}`, @@ -100,8 +100,9 @@ export default { }); const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMarkId); + console.log("%c [ roadInfo ]-103-「index.vue」", "font-size:15px; background:#36347c; color:#7a78c0;", roadInfo.roadName); - if (roadInfo) this.dialogData.roadName = roadInfo.dcRoad; + if (roadInfo) this.data.roadName = roadInfo.roadName; }, methods: { handleClickTabs() { } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js index 21753b05..49e4b9c3 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js @@ -82,19 +82,30 @@ export async function getRoadInfoByStakeMark(stakeMarkId) { }, }); + console.log( + "%c [ stakeMarkInfo ]-86-「httpList.js」", + "font-size:15px; background:#4f7740; color:#93bb84;", + stakeMarkInfo + ); + if (!stakeMarkInfo.data[0]?.sectionId) return {}; const roadSectionInfo = await request({ - url: `/business/roadSection/${stakeMarkInfo.data.sectionId}`, + url: `/business/roadSection/${stakeMarkInfo.data[0].sectionId}`, method: "get", }); + console.log( + "%c [ roadSectionInfo ]-95-「httpList.js」", + "font-size:15px; background:#b16336; color:#f5a77a;", + roadSectionInfo + ); if (!roadSectionInfo.data?.roadId) return {}; return ( ( await request({ - url: `/business/road/${roadSectionInfo.roadId}`, + url: `/business/road/${roadSectionInfo.data.roadId}`, method: "get", }) ).data || {}