Browse Source

修改提交

wangqin
Joe 10 months ago
parent
commit
31eef57653
  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}`,
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())}`
},

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

@ -9,7 +9,7 @@
</p>
<p class="desc-item">
<span>道路名称</span>
<span>{{ data.roadName || '-' }}</span>
<span>{{ roadName || '-' }}</span>
</p>
<p class="desc-item">
<span>所属机构</span>
@ -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;
},
}
</script>

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

@ -18,7 +18,7 @@
</div>
<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="right">
<div class="direction">
@ -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) {

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">
<ElTabPane label="详细设计" name="first">
<Descriptions :list="list" :data="dialogData" style="gap: 18px" />
<Descriptions :list="list" :data="data" style="gap: 18px" />
</ElTabPane>
<ElTabPane label="设备参数" name="second">设备参数</ElTabPane>
</ElTabs>
@ -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() { }

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 {};
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 || {}

Loading…
Cancel
Save