From 31eef57653868f563bd7753042df631bdc7c5708 Mon Sep 17 00:00:00 2001 From: Joe <1712833832@qq.com> Date: Fri, 19 Jan 2024 13:19:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Descriptions.vue | 24 ++++++++++--------- .../Dialogs/Camera/Descriptions.vue | 7 +++--- .../Dialogs/ControlCamera/index.vue | 6 +++-- .../Dialogs/DrivingGuidance/index.vue | 7 +++--- .../RoadAndEvents/utils/httpList.js | 15 ++++++++++-- 5 files changed, 38 insertions(+), 21 deletions(-) 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 @@