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. 21
      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 { Message } from "element-ui";
// import { axiosIns } from "@screen/utils/axios/auth.js"; // import { axiosIns } from "@screen/utils/axios/auth.js";
import { handle3CResult } from "@screen/utils/deviceControl.js"
const workStatus = [ const workStatus = [
{ {
@ -198,24 +199,7 @@ export default {
formData.controlType = data.mode; formData.controlType = data.mode;
switch (data.mode) { await handle3CResult(data, formData, this.requestURL);
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;
}
this.oldFormData = { ...formData }; this.oldFormData = { ...formData };

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

@ -17,10 +17,7 @@
</div> </div>
<!-- <DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId || '8697-1'" /> --> <!-- <DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId || '8697-1'" /> -->
<DeviceControlDialog <DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId" />
v-model="deviceControlVisible"
:deviceId="dialogData.iotDeviceId"
/>
</Dialog> </Dialog>
</template> </template>
@ -35,7 +32,10 @@ import {
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import Video from "@screen/components/Video"; import Video from "@screen/components/Video";
import request from "@/utils/request"; 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"; import { dialogDelayVisible } from "./../mixin";
// //
@ -116,19 +116,30 @@ export default {
.then((data) => { .then((data) => {
this.dialogData.brand = data.brand; this.dialogData.brand = data.brand;
}) })
.catch((err) => {}); .catch((err) => { });
this.requestURL(52) // this.requestURL(52)
.then((result) => { // .then((result) => {
this.data.workMode = { // this.data.workMode = {
"00": "手动控制", // "00": "",
"01": "自动控制", // "01": "",
"02": "万年历", // "02": "",
}[result.mode]; // }[result.mode];
this.data.onWorkStatus = result.onWorkStatus; // this.data.onWorkStatus = result.onWorkStatus;
this.data.inWorkStatus = result.inWorkStatus; // this.data.inWorkStatus = result.inWorkStatus;
}) // })
.catch((err) => {}); // .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); const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark);
console.log( console.log(
@ -194,7 +205,7 @@ export default {
align-items: center; align-items: center;
justify-content: end; justify-content: end;
> div { >div {
font-size: 16px; font-size: 16px;
padding: 6px 12px; 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 const formData = extData?.otherConfig
? JSON.parse(extData.otherConfig) ? JSON.parse(extData.otherConfig)
: null; : null;
console.log(component, "DialogComponent");
this.dialogConfig = { this.dialogConfig = {
component, component,
data: { data: {

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

@ -14,8 +14,7 @@
</el-form-item> </el-form-item>
<el-form-item required label="事件类型:" prop="eventType"> <el-form-item required label="事件类型:" prop="eventType">
<el-select v-model="formData.eventType" placeholder="请选择事件类型" @change="changeEventType"> <el-select v-model="formData.eventType" placeholder="请选择事件类型" @change="changeEventType">
<el-option v-for="item in eventOptions" :key="item.value" :label="item.label" <el-option v-for="item in eventOptions" :key="item.value" :label="item.label" :value="item.value">
:value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -23,8 +22,7 @@
<el-form-item label="触发类型:" prop="triggerMechanism"> <el-form-item label="触发类型:" prop="triggerMechanism">
<el-select v-model="formData.triggerMechanism" placeholder="请选择触发类型"> <el-select v-model="formData.triggerMechanism" placeholder="请选择触发类型">
<el-option v-for="item in mechanismOptions" :key="item.value" :label="item.label" <el-option v-for="item in mechanismOptions" :key="item.value" :label="item.label" :value="item.value">
:value="item.value">
</el-option> </el-option>
</el-select> </el-select>
@ -70,7 +68,7 @@ import Button from '@screen/components/Buttons/Button.vue';
import request from '@/utils/request'; import request from '@/utils/request';
import { Message } from "element-ui"; import { Message } from "element-ui";
import { throttle } from "lodash" import { throttle } from "lodash"
import { controlModelMap, gzztMap } from "@screen/utils/enum.js";
const optionsMap = { const optionsMap = {
1: { 1: {
1: [ 1: [
@ -412,12 +410,7 @@ const typeMap = {
] ]
} }
const gzztMap = {
"01": '常亮',
"02": '流水',
"03": '闪烁',
"04": '关闭',
}
const gzmsMap = { const gzmsMap = {
"SETMD0": "激光关闭", "SETMD0": "激光关闭",
"SETMD1": "常亮模式", "SETMD1": "常亮模式",
@ -430,11 +423,7 @@ const gzmsMap = {
"SETMD8": "自定义模式2", "SETMD8": "自定义模式2",
"SETMD9": "自定义模式3", "SETMD9": "自定义模式3",
} }
const controlModelMap = {
"00": '手动模式',
"01": '自动模式',
"02": '万年历',
}
export default { export default {
name: 'addAndEditDialog', name: 'addAndEditDialog',
components: { components: {

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

Loading…
Cancel
Save