Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-hs into develop

wangqin
hui 10 months ago
parent
commit
f9c34947df
  1. 24
      ruoyi-ui/src/views/JiHeExpressway/components/Descriptions.vue
  2. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/Descriptions.vue
  3. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ControlCamera/index.vue
  4. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue
  5. 15
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js

24
ruoyi-ui/src/views/JiHeExpressway/components/Descriptions.vue

@ -64,6 +64,19 @@ export default {
gridRow: `span ${item.gridRow || 1}`, gridRow: `span ${item.gridRow || 1}`,
gridColumn: `span ${item.gridColumn || 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: { methods: {
@ -72,17 +85,6 @@ export default {
gridTemplateColumns: `repeat(${this.column}, 1fr)`, 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) { getComponent(type) {
return `Form${type.replace(/^[a-z]/, word => word.toUpperCase())}` return `Form${type.replace(/^[a-z]/, word => word.toUpperCase())}`
}, },

7
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/Descriptions.vue

@ -9,7 +9,7 @@
</p> </p>
<p class="desc-item"> <p class="desc-item">
<span>道路名称</span> <span>道路名称</span>
<span>{{ data.roadName || '-' }}</span> <span>{{ roadName || '-' }}</span>
</p> </p>
<p class="desc-item"> <p class="desc-item">
<span>所属机构</span> <span>所属机构</span>
@ -61,7 +61,8 @@ export default {
return { return {
statusEnum: CameraStatusEnum[this.data.status] || {}, statusEnum: CameraStatusEnum[this.data.status] || {},
cameraType: CameraControlTypeEnum[this.data.ptzCtrl]?.text, cameraType: CameraControlTypeEnum[this.data.ptzCtrl]?.text,
organizationName: null organizationName: null,
roadName: ""
} }
}, },
async created() { async created() {
@ -81,7 +82,7 @@ export default {
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMarkId); const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMarkId);
if (roadInfo) this.data.roadName = roadInfo.dcRoad; if (roadInfo) this.roadName = roadInfo.roadName;
}, },
} }
</script> </script>

6
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ControlCamera/index.vue

@ -18,7 +18,7 @@
</div> </div>
<div class="content"> <div class="content">
<Descriptions :list="list" :data="dialogData" style="gap: 18px" /> <Descriptions :list="list" :data="data" style="gap: 18px" />
<div class="dash-line"></div> <div class="dash-line"></div>
<div class="right"> <div class="right">
<div class="direction"> <div class="direction">
@ -131,9 +131,11 @@ export default {
} }
}, },
async created() { async created() {
this.data = { ...this.dialogData, roadName: null }
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMarkId); const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMarkId);
if (roadInfo) this.dialogData.roadName = roadInfo.dcRoad; if (roadInfo) this.data.roadName = roadInfo.roadName;
}, },
methods: { methods: {
controlClick: throttle(function (type) { controlClick: throttle(function (type) {

7
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue

@ -5,7 +5,7 @@
<ElTabs v-model="activeName" @tab-click="handleClickTabs" class="tabs"> <ElTabs v-model="activeName" @tab-click="handleClickTabs" class="tabs">
<ElTabPane label="详细设计" name="first"> <ElTabPane label="详细设计" name="first">
<Descriptions :list="list" :data="dialogData" style="gap: 18px" /> <Descriptions :list="list" :data="data" style="gap: 18px" />
</ElTabPane> </ElTabPane>
<ElTabPane label="设备参数" name="second">设备参数</ElTabPane> <ElTabPane label="设备参数" name="second">设备参数</ElTabPane>
</ElTabs> </ElTabs>
@ -84,7 +84,7 @@ export default {
} }
}, },
async created() { async created() {
this.dialogData.roadName = "G35济泽高速"; this.data = { ...this.dialogData, roadName: null }
request({ request({
url: `/business/product/${this.dialogData.productId}`, url: `/business/product/${this.dialogData.productId}`,
@ -100,8 +100,9 @@ export default {
}); });
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMarkId); 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: { methods: {
handleClickTabs() { } handleClickTabs() { }

15
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 {}; if (!stakeMarkInfo.data[0]?.sectionId) return {};
const roadSectionInfo = await request({ const roadSectionInfo = await request({
url: `/business/roadSection/${stakeMarkInfo.data.sectionId}`, url: `/business/roadSection/${stakeMarkInfo.data[0].sectionId}`,
method: "get", method: "get",
}); });
console.log(
"%c [ roadSectionInfo ]-95-「httpList.js」",
"font-size:15px; background:#b16336; color:#f5a77a;",
roadSectionInfo
);
if (!roadSectionInfo.data?.roadId) return {}; if (!roadSectionInfo.data?.roadId) return {};
return ( return (
( (
await request({ await request({
url: `/business/road/${roadSectionInfo.roadId}`, url: `/business/road/${roadSectionInfo.data.roadId}`,
method: "get", method: "get",
}) })
).data || {} ).data || {}

Loading…
Cancel
Save