Browse Source

feat 行车诱导 数据获取

wangqin
qingzhengli 8 months ago
parent
commit
c35abc6b21
  1. 20
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue
  2. 49
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue
  3. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js
  4. 1471
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue
  5. 20
      ruoyi-ui/src/views/JiHeExpressway/utils/deviceControl.js
  6. 16
      ruoyi-ui/src/views/JiHeExpressway/utils/enum.js

20
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue

@ -35,6 +35,7 @@ import request from "@/utils/request";
import { Message } from "element-ui";
// import { axiosIns } from "@screen/utils/axios/auth.js";
import { handle3CResult } from "@screen/utils/deviceControl.js"
const workStatus = [
{
@ -198,24 +199,7 @@ export default {
formData.controlType = data.mode;
switch (data.mode) {
case "00":
formData.onWorkStatus = data.onWorkStatus;
formData.inWorkStatus = data.inWorkStatus;
break;
case "01":
case "02":
await this.requestURL("3C")
.then((data2) => {
formData.onWorkStatus = data2.onWorkStatus;
formData.inWorkStatus = data2.inWorkStatus;
if (data.mode === '01')
formData.displayTime = [data.startDisplay, data.endDisplay];
})
.catch(() => { });
break;
}
await handle3CResult(data, formData, this.requestURL);
this.oldFormData = { ...formData };

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

@ -17,10 +17,7 @@
</div>
<!-- <DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId || '8697-1'" /> -->
<DeviceControlDialog
v-model="deviceControlVisible"
:deviceId="dialogData.iotDeviceId"
/>
<DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId" />
</Dialog>
</template>
@ -35,7 +32,10 @@ import {
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import Video from "@screen/components/Video";
import request from "@/utils/request";
import { delay } from "@screen/utils/common.js"
import { handle3CResult } from "@screen/utils/deviceControl.js"
import { controlModelMap, gzztMap } from "@screen/utils/enum.js";
import { find } from "lodash";
import { dialogDelayVisible } from "./../mixin";
//
@ -116,19 +116,30 @@ export default {
.then((data) => {
this.dialogData.brand = data.brand;
})
.catch((err) => {});
this.requestURL(52)
.then((result) => {
this.data.workMode = {
"00": "手动控制",
"01": "自动控制",
"02": "万年历",
}[result.mode];
this.data.onWorkStatus = result.onWorkStatus;
this.data.inWorkStatus = result.inWorkStatus;
})
.catch((err) => {});
.catch((err) => { });
// this.requestURL(52)
// .then((result) => {
// this.data.workMode = {
// "00": "",
// "01": "",
// "02": "",
// }[result.mode];
// this.data.onWorkStatus = result.onWorkStatus;
// this.data.inWorkStatus = result.inWorkStatus;
// })
// .catch((err) => { });
this.requestURL()
.then(async (data) => {
await delay(0);
const formData = {};
formData.controlType = data.mode;
await handle3CResult(data, formData, this.requestURL);
formData.controlType && (this.$set(this.data, "workMode", controlModelMap[formData.controlType]))//(this.data.workMode = controlModelMap[formData.controlType]);
formData.inWorkStatus && (this.$set(this.data, "inWorkStatus", gzztMap[formData.inWorkStatus]))//(this.data.inWorkStatus = gzztMap[formData.inWorkStatus]);
formData.onWorkStatus && (this.$set(this.data, "onWorkStatus", gzztMap[formData.onWorkStatus]))//(this.data.onWorkStatus = gzztMap[formData.onWorkStatus]);
});
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark);
console.log(
@ -194,7 +205,7 @@ export default {
align-items: center;
justify-content: end;
> div {
>div {
font-size: 16px;
padding: 6px 12px;
}

1
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

@ -100,6 +100,7 @@ function resolveDataOptions(data, config, component, isDefault) {
const formData = extData?.otherConfig
? JSON.parse(extData.otherConfig)
: null;
console.log(component, "DialogComponent");
this.dialogConfig = {
component,
data: {

1471
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue

File diff suppressed because it is too large

20
ruoyi-ui/src/views/JiHeExpressway/utils/deviceControl.js

@ -0,0 +1,20 @@
export async function handle3CResult(data, formData, requestURL) {
switch (data.mode) {
case "00":
formData.onWorkStatus = data.onWorkStatus;
formData.inWorkStatus = data.inWorkStatus;
break;
case "01":
case "02":
await requestURL("3C")
.then((data2) => {
formData.onWorkStatus = data2.onWorkStatus;
formData.inWorkStatus = data2.inWorkStatus;
if (data.mode === "01")
formData.displayTime = [data.startDisplay, data.endDisplay];
})
.catch(() => {});
break;
}
}

16
ruoyi-ui/src/views/JiHeExpressway/utils/enum.js

@ -309,3 +309,19 @@ export const DirectionTypes = {
3: "济南方向",
2: "双向",
};
//行车诱导相关
export const controlModelMap = {
"00": "手动模式",
"01": "自动模式",
"02": "万年历",
};
export const gzztMap = {
"00": "不更新",
"01": "常亮",
"02": "流水",
"03": "闪烁",
"04": "关闭",
};

Loading…
Cancel
Save