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 @@