Browse Source

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

wangqin
zhangzhang 1 year ago
parent
commit
bc62d16017
  1. 27
      ruoyi-ui/src/views/JiHeExpressway/components/Descriptions.vue
  2. 26
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue
  3. 247
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue
  4. 309
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceParam.vue
  5. 39
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue
  6. 365
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceControlDialog.vue
  7. 425
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue
  8. 24
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/index.vue
  9. 139
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParams.vue
  10. 207
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParamsMulti.vue
  11. 33
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue
  12. 2566
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/EventInformation/components/EditEventInformationDialog/data.js
  13. 285
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/EventInformation/components/EditEventInformationDialog/index.vue
  14. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/EventInformation/index.vue
  15. 44
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/ReleaseInformation/index.vue
  16. 29
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue
  17. 18
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js
  18. 19
      ruoyi-ui/src/views/JiHeExpressway/utils/common.js

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

@ -1,16 +1,8 @@
<template>
<div class="Descriptions keep-ratio" origin="left" :style="getStyle()">
<div
class="item"
v-for="(item, index) in getResolveList"
:key="`${item.key || item.label}${index}`"
:style="[gridStyle(item, index), transformStyle(itemStyle)]"
v-if="item.visible != false"
>
<div
class="text title"
:style="{ ...transformStyle(titleStyle), width: labelWidth }"
>
<div class="item" v-for="(item, index) in getResolveList" :key="`${item.key || item.label}${index}`"
:style="[gridStyle(item, index), transformStyle(itemStyle)]" v-if="item.visible != false">
<div v-if="!item.labelHidden" class="text title" :style="{ ...transformStyle(titleStyle), width: labelWidth }">
<p>
<slot :name="`title-${item.key || item.label}`" :data="item">
{{ item.label || "-" }}
@ -18,18 +10,9 @@
</p>
:
</div>
<ContentText
:style="transformStyle(titleStyle)"
class="content text"
:data="data"
:_config="item"
>
<ContentText :style="transformStyle(titleStyle)" class="content text" :data="data" :_config="item">
<template #default="{ value }">
<slot
:name="`content-${item.key || item.label}`"
:value="value"
:data="item"
>
<slot :name="`content-${item.key || item.label}`" :value="value" :data="item">
{{ value }}
</slot>
</template>

26
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue

@ -9,7 +9,7 @@
showWordLimit placeholder="请输入发布内容" />
</div>
<div class="footer">
<!-- <div class="footer">
<Button @click.native="handleSubmit" :loading="submitting">
确定
</Button>
@ -17,7 +17,7 @@
<Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick">
取消
</Button>
</div>
</div> -->
</div>
</div>
</template>
@ -30,6 +30,7 @@ import CheckboxGroup from "@screen/components/FormConfig/components/ElCheckboxGr
import request from "@/utils/request";
import { batchFunctions } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { multiResultShow } from "@screen/utils/common";
import { Message } from "element-ui";
@ -85,18 +86,19 @@ export default {
methods: {
cancelClick() {
this.$emit("update:activeIcon", null);
this.submitting = false;
this.$emit("update:submitting", false);
// this.submitting = false;
},
handleSubmit() {
const selectItems = this.selectItems.map(item => JSON.parse(item));
console.log(this.selectItems, selectItems, "selectItems");
const checkList = selectItems.map(item => JSON.parse(item.otherConfig));
if (!this.releaseMessage?.trim())
return Message.error("发布内容不能为空!");
if (!selectItems.length)
return Message.error("请至少选择一个广播设备!");
return Message.error("请至少选择一个设备!");
this.submitting = true;
// this.submitting = true;
this.$emit("update:submitting", true);
batchFunctions(
{
@ -118,17 +120,11 @@ export default {
]
})
.then((data) => {
const allItems = data.data;
const successItems = allItems.filter(item => item.result.retCode == 0);
console.log("xxxxxxx111")
if (successItems.length == allItems.length) {
Message.success("广播设置成功!");
} else {
Message.error(`广播设置失败, 失败${allItems.length - successItems.length}个!`);
}
multiResultShow(data.data, item => item.result.retCode == 0, "广播设置");
})
.finally(() => {
this.submitting = false;
// this.submitting = false;
this.$emit("update:submitting", false);
});
},
},

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

@ -1,28 +1,12 @@
<template>
<Dialog v-model="modelVisible" title="设备操作" width="600px">
<div class="DeviceControlDialog">
<Form
v-model="formData"
class="form"
ref="FormConfigRef"
:formList="formList"
column="1"
labelWidth="120px"
/>
<div class="tips" v-if="formData.controlType === '01'">
说明: 定时控制模式下,诱导灯在开始时间自动打开,结束时间自动关闭
</div>
<div class="tips" v-if="formData.controlType === '02'">
说明: 万年历自动模式下,诱导灯在白天会自动关闭,夜晚会自动打开
</div>
</div>
<DeviceParam v-model="modelVisible" ref="DeviceParam" :deviceId="deviceId" :id="id" :deviceType="deviceType"
@update:submitting="(val) => { submitting = val }">
</DeviceParam>
<template #footer>
<Button
style="background-color: rgba(0, 179, 204, 0.3)"
@click.native="(modelVisible = false), (submitting = false)"
>
<Button style="background-color: rgba(0, 179, 204, 0.3)"
@click.native="(modelVisible = false), (submitting = false)">
取消
</Button>
<Button @click.native="handleSubmit" :loading="submitting"> 确定 </Button>
@ -35,38 +19,9 @@ import Dialog from "@screen/components/Dialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
import Form from "@screen/components/FormConfig";
import { cloneDeep } from "lodash";
import { delay } from "@screen/utils/common.js";
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 = [
{
key: "00",
label: "不更新状态",
disabled: false,
},
{
key: "01",
label: "常亮",
},
{
key: "02",
label: "流水",
},
{
key: "03",
label: "闪烁",
},
{
key: "04",
label: "关闭",
disabled: false,
},
];
import DeviceParam from "./DeviceParam.vue";
export default {
name: "DeviceControlDialog",
@ -74,6 +29,7 @@ export default {
Dialog,
Button,
Form,
DeviceParam,
},
model: {
prop: "visible",
@ -82,99 +38,12 @@ export default {
props: {
visible: Boolean,
deviceId: String,
id: String,
deviceType: String,
},
inject: ["requestURL"],
data() {
return {
submitting: false,
formData: {},
formList: [
{
label: "类型:",
key: "controlType",
type: "RadioGroup",
default: "00",
ons: {
input: (value, { data }) => {
const oldFormData = this.oldFormData;
if (!oldFormData) return;
this.formList[1].options.options.splice(-1, 1, {
...workStatus.slice(-1)[0],
disabled: value != "00",
});
this.formList[1].options.options.splice(0, 1, {
...workStatus[0],
disabled: value != "00",
});
switch (value) {
case "01":
if (["04", "00"].includes(data.onWorkStatus))
data.onWorkStatus = null;
if (["04", "00"].includes(data.inWorkStatus))
data.inWorkStatus = null;
Array.isArray(oldFormData.displayTime) &&
(data.displayTime = [...oldFormData.displayTime]);
break;
}
},
},
options: {
type: "circle",
options: [
{
key: "00",
label: "手动控制",
},
{
key: "01",
label: "自动控制",
},
{
key: "02",
label: "万年历",
},
],
},
},
{
label: "上行工作状态:",
key: "onWorkStatus",
required: true,
type: "select",
options: {
placeholder: "请选择",
options: workStatus,
},
},
{
label: "下行工作状态:",
key: "inWorkStatus",
required: true,
type: "select",
options: {
placeholder: "请选择",
options: workStatus,
},
},
{
label: "选择时间:",
key: "displayTime",
type: "timePicker",
required: true,
visible: (data) => data.controlType == "01",
options: {
isRange: true,
rangeSeparator: "至",
valueFormat: "HH:mm",
startPlaceholder: "开始时间",
endPlaceholder: "结束时间",
},
},
],
};
},
computed: {
@ -187,105 +56,9 @@ export default {
},
},
},
watch: {
modelVisible: {
immediate: true,
handler(bool) {
if (!bool) return;
this.reDisplay();
},
},
},
methods: {
reDisplay() {
this.requestURL().then(async (data) => {
await delay(0);
const formData = this.$refs.FormConfigRef?.formData;
formData.controlType = data.mode;
await handle3CResult(data, formData, this.requestURL);
this.oldFormData = { ...formData };
});
},
handleSubmit() {
const result = {},
formData = this.$refs.FormConfigRef?.formData;
result.mode = formData.controlType;
delete result.controlType;
if (result.mode === "01") {
if (!formData.displayTime?.length)
return Message.error(`时间不能为空!`);
}
if (!formData.onWorkStatus || !formData.inWorkStatus)
return Message.error(`工作状态不能为空!`);
if (["01", "02"].includes(result.mode)) {
if (["04", "00"].includes(formData.onWorkStatus))
return Message.error(`上行工作状态不能选择当前类型!`);
if (["04", "00"].includes(formData.inWorkStatus))
return Message.error(`下行工作状态不能选择当前类型!`);
}
result.onWorkStatus = formData.onWorkStatus;
result.inWorkStatus = formData.inWorkStatus;
this.submitting = true;
// this.submitting = false;
// return;
/**
* 接口 地址
*
* https://www.showdoc.com.cn/2450725213006196/10877717880262686
*/
let promise = [];
switch (result.mode) {
case "00":
promise.push(this.requestURL("51", result));
break;
case "01":
case "02":
const options = { mode: result.mode };
if (result.mode === "01") {
options.startDisplayTime = formData.displayTime[0];
options.endDisplayTime = formData.displayTime[1];
}
promise.push(
this.requestURL("30", {
onWorkStatus: result.onWorkStatus,
inWorkStatus: result.inWorkStatus,
}),
this.requestURL("51", options)
);
break;
}
Promise.all(promise)
.then(() => {
this.modelVisible = false;
})
.catch((err) => {
console.log(
"%c [ err ]-110-「DeviceControlDialog.vue」",
"font-size:15px; background:#547bf2; color:#98bfff;",
err
);
Message.error(`设备操作失败!`);
})
.finally(() => {
this.submitting = false;
});
this.$refs.DeviceParam.handleSubmit();
},
},
};

309
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceParam.vue

@ -0,0 +1,309 @@
<template>
<div class="DeviceControlDialog" :style="{
'margin-top': isMultiControl ? '15px' : undefined,
'width': isMultiControl ? '100%' : undefined,
}">
<Form v-model="formData" class="form" ref="FormConfigRef" :formList="formList" column="1" labelWidth="120px" />
<div class="tips" v-if="formData.controlType === '01'">
说明: 定时控制模式下,诱导灯在开始时间自动打开,结束时间自动关闭
</div>
<div class="tips" v-if="formData.controlType === '02'">
说明: 万年历自动模式下,诱导灯在白天会自动关闭,夜晚会自动打开
</div>
</div>
</template>
<script>
import Dialog from "@screen/components/Dialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
import Form from "@screen/components/FormConfig";
import { cloneDeep } from "lodash";
import { delay } from "@screen/utils/common.js";
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";
import { batchFunctions } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { multiResultShow } from "@screen/utils/common";
const workStatus = [
{
key: "00",
label: "不更新状态",
disabled: false,
},
{
key: "01",
label: "常亮",
},
{
key: "02",
label: "流水",
},
{
key: "03",
label: "闪烁",
},
{
key: "04",
label: "关闭",
disabled: false,
},
];
export default {
name: "DeviceControlDialog",
components: {
Dialog,
Button,
Form,
},
model: {
prop: "visible",
event: "update:value",
},
props: {
visible: Boolean,
deviceId: String,
id: String,
deviceType: String,
isMultiControl: Boolean,
selectItems: {
type: Array,
default: () => []
}
},
inject: ["requestURL", "updateFormData"],
data() {
return {
formData: {},
formList: [
{
label: "类型:",
key: "controlType",
type: "RadioGroup",
default: "00",
ons: {
input: (value, { data }) => {
const oldFormData = this.oldFormData;
if (!oldFormData) return;
this.formList[1].options.options.splice(-1, 1, {
...workStatus.slice(-1)[0],
disabled: value != "00",
});
this.formList[1].options.options.splice(0, 1, {
...workStatus[0],
disabled: value != "00",
});
switch (value) {
case "01":
if (["04", "00"].includes(data.onWorkStatus))
data.onWorkStatus = null;
if (["04", "00"].includes(data.inWorkStatus))
data.inWorkStatus = null;
Array.isArray(oldFormData.displayTime) &&
(data.displayTime = [...oldFormData.displayTime]);
break;
}
},
},
options: {
type: "circle",
options: [
{
key: "00",
label: "手动控制",
},
{
key: "01",
label: "自动控制",
},
{
key: "02",
label: "万年历",
},
],
},
},
{
label: "上行工作状态:",
key: "onWorkStatus",
required: true,
type: "select",
options: {
placeholder: "请选择",
options: workStatus,
},
},
{
label: "下行工作状态:",
key: "inWorkStatus",
required: true,
type: "select",
options: {
placeholder: "请选择",
options: workStatus,
},
},
{
label: "选择时间:",
key: "displayTime",
type: "timePicker",
required: true,
visible: (data) => data.controlType == "01",
options: {
isRange: true,
rangeSeparator: "至",
valueFormat: "HH:mm",
startPlaceholder: "开始时间",
endPlaceholder: "结束时间",
},
},
],
};
},
mounted() {
this.$emit("update:submitting", false);
if (!this.isMultiControl)
this.reDisplay();
},
methods: {
reDisplay() {
console.log(this.requestURL)
this.requestURL().then(async (data) => {
await delay(0);
const formData = this.$refs.FormConfigRef?.formData;
formData.controlType = data.mode;
await handle3CResult(data, formData, this.requestURL);
this.oldFormData = { ...formData };
});
},
handleSubmit() {
const result = {},
formData = this.$refs.FormConfigRef?.formData;
result.mode = formData.controlType;
delete result.controlType;
if (result.mode === "01") {
if (!formData.displayTime?.length)
return Message.error(`时间不能为空!`);
}
if (!formData.onWorkStatus || !formData.inWorkStatus)
return Message.error(`工作状态不能为空!`);
if (["01", "02"].includes(result.mode)) {
if (["04", "00"].includes(formData.onWorkStatus))
return Message.error(`上行工作状态不能选择当前类型!`);
if (["04", "00"].includes(formData.inWorkStatus))
return Message.error(`下行工作状态不能选择当前类型!`);
}
if (this.isMultiControl && !this.selectItems.length) {
return Message.error("请至少选择一个设备!");
}
const selectItems = this.selectItems.map(item => JSON.parse(item));
result.onWorkStatus = formData.onWorkStatus;
result.inWorkStatus = formData.inWorkStatus;
this.$emit("update:submitting", true);
let devices;
if (this.isMultiControl) devices = selectItems;
else devices = [{
iotDeviceId: this.deviceId,
id: this.id,
deviceType: this.deviceType
}]
const functions = [];
/**
* 接口 地址
*
* https://www.showdoc.com.cn/2450725213006196/10877717880262686
*/
let promise = [];
switch (result.mode) {
case "00":
// promise.push(this.requestURL("51", result));
functions.push({ "functionId": "51", "params": result })
break;
case "01":
case "02":
const options = { mode: result.mode };
if (result.mode === "01") {
options.startDisplayTime = formData.displayTime[0];
options.endDisplayTime = formData.displayTime[1];
}
functions.push({
"functionId": "30", "params": {
onWorkStatus: result.onWorkStatus,
inWorkStatus: result.inWorkStatus,
}
},
{ "functionId": "51", "params": options })
// promise.push(
// this.requestURL("30", {
// onWorkStatus: result.onWorkStatus,
// inWorkStatus: result.inWorkStatus,
// }),
// this.requestURL("51", options)
// );
break;
}
console.log(result, "resultxxxxx")
batchFunctions({
devices: devices,
functions: functions
})
// Promise.all(promise)
.then(() => {
this.$emit("update:value", false); // this.modelVisible = false;
Message.success(`操作成功`);
this.updateFormData({ ...result, workMode: result.mode });
})
.catch((err) => {
console.log(
"%c [ err ]-110-「DeviceControlDialog.vue」",
"font-size:15px; background:#547bf2; color:#98bfff;",
err
);
Message.error(`设备操作失败!`);
})
.finally(() => {
this.$emit("update:submitting", false);
});
},
},
};
</script>
<style lang="scss" scoped>
.DeviceControlDialog {
width: 450px;
height: 210px;
display: flex;
flex-direction: column;
gap: 15px;
.tips {
font-size: 12px;
}
}
</style>

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

@ -9,11 +9,7 @@
</ElTabPane>
<!-- <ElTabPane label="设备参数" name="second">设备参数</ElTabPane> -->
<ElTabPane label="在线率统计" name="third">
<LineChart
v-if="activeName === 'third'"
:productId="dialogData.id"
style="height: 180px"
/>
<LineChart v-if="activeName === 'third'" :productId="dialogData.id" style="height: 180px" />
</ElTabPane>
</ElTabs>
@ -21,12 +17,9 @@
<Button @click.native="deviceControlVisible = true">设备操作</Button>
</div>
</div>
<!-- <DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId || '8697-1'" /> -->
<DeviceControlDialog
v-model="deviceControlVisible"
:deviceId="dialogData.iotDeviceId"
/>
<DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId" :id="dialogData.id"
:deviceType="dialogData.deviceType" />
</Dialog>
</template>
@ -44,7 +37,7 @@ 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 { find, assign } from "lodash";
import { dialogDelayVisible } from "./../mixin";
import LineChart from "../../LineChart/index.vue";
@ -55,6 +48,7 @@ export default {
provide() {
return {
requestURL: this.requestURL,
updateFormData: this.updateFormData
};
},
components: {
@ -127,7 +121,7 @@ export default {
.then((data) => {
this.dialogData.brand = data.brand;
})
.catch((err) => {});
.catch((err) => { });
// this.requestURL(52)
// .then((result) => {
@ -145,13 +139,7 @@ export default {
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]);
this.updateFormData({ ...formData, workMode: data.mode });
});
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark);
@ -164,7 +152,16 @@ export default {
if (roadInfo) this.data.roadName = roadInfo.roadName;
},
methods: {
handleClickTabs() {},
updateFormData(formData) {
formData.workMode &&
this.$set(this.data, "workMode", controlModelMap[formData.workMode]); //(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]);
},
handleClickTabs() { },
requestURL(functionId = 52, options = {}) {
return new Promise((resolve, reject) => {
request
@ -219,7 +216,7 @@ export default {
align-items: center;
justify-content: end;
> div {
>div {
font-size: 16px;
padding: 6px 12px;
}

365
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceControlDialog.vue

@ -1,86 +1,9 @@
<template>
<Dialog v-model="modelVisible" title="设备操作" width="910px">
<div class="DeviceControlDialog">
<ElTabs v-model="activeName" class="tabs" @tab-click="tabClick">
<ElTabPane label="一般模式" name="first">
<Form v-model="formData" class="form" ref="FormConfigRef" :formList="formList1" column="1"
labelWidth="120px" />
</ElTabPane>
<ElTabPane label="自定义模式" name="second">
<!-- <div style="display: flex; margin: 20px 0">
<p style="width: 115px">工作时长():</p>
<el-input-number v-model="onWorkStatus2" :min="0" :max="999" label="工作时长(s分):"></el-input-number>
</div> -->
<Table :data="tableData">
<ElTableColumn prop="ds" label="段数"></ElTableColumn>
<ElTableColumn prop="time" width="120" label="时间(毫秒)">
<template slot-scope="scope">
<div style="display: flex">
<el-input-number style="width: 120px" v-model="scope.row.time" :min="0"></el-input-number>
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="A" label="线路A">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.A" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="B" label="线路B">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.B" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="C" label="线路C">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.C" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="D" label="线路D">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.D" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="E" label="线路E">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.E" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="F" label="线路F">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.F" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="G" label="线路G">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.G" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="H" label="线路H">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.H" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
</Table>
</ElTabPane>
</ElTabs>
<DeviceParam v-model="modelVisible" ref="DeviceParam" :deviceId="this.deviceId" :productId="this.productId"
:deviceType="deviceType" @update:submitting="(val) => { submitting = val }">
</DeviceParam>
</div>
<template #footer>
@ -100,7 +23,7 @@ import Button from "@screen/components/Buttons/Button.vue";
import Form from "@screen/components/FormConfig";
import request from "@/utils/request";
import { Message } from "element-ui";
import DeviceParam from "./DeviceParam.vue";
export default {
name: "DeviceControlDialog",
components: {
@ -108,6 +31,7 @@ export default {
Button,
Form,
Table,
DeviceParam,
},
model: {
prop: "visible",
@ -116,158 +40,17 @@ export default {
props: {
visible: Boolean,
deviceId: String,
productId: String
productId: String,
deviceType: String
},
data() {
return {
submitting: false,
activeName: "first",
onWorkStatus2: 0,
formData: {},
duan: [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
],
tableData: [
// {
// ds: 'A',
// time: 0,
// A: false,
// B: false,
// C: false,
// D: false,
// E: false,
// F: false,
// G: false,
// H: false,
// }
],
formList1: [
{
label: "工作模式:",
key: "controlType",
type: "select",
default: "1",
options: {
options: [
{
value: "0",
label: "激光关闭",
},
{
value: "1",
label: "常亮模式",
},
{
value: "2",
label: "间隔100ms闪烁模式",
},
{
value: "3",
label: "间隔200ms闪烁模式",
},
{
value: "4",
label: "间隔500ms闪烁模式",
},
{
value: "5",
label: "2次闪烁模式",
},
{
value: "6",
label: "SOS模式",
},
{
value: "7",
label: "自定义模式",
},
],
},
},
{
label: "工作时长(分):",
key: "onWorkStatus",
required: true,
default: 0,
type: "inputNumber",
options: {
min: 0,
max: 999,
},
},
],
formList2: [
{
label: "工作模式:",
key: "controlType",
type: "RadioGroup",
default: "00",
options: {
type: "circle",
options: [
{
key: "00",
label: "常量",
},
{
key: "01",
label: "闪烁",
},
],
},
},
{
label: "线路选择:",
key: "onWorkStatus2",
required: true,
type: "select",
options: {
placeholder: "请选择",
},
},
{
label: "工作时长:",
key: "onWorkStatus",
required: true,
type: "select",
options: {
placeholder: "请选择",
},
},
],
rules: {
onWorkStatus: [
{ required: true, message: "工作时长不能为空", trigger: "blur" },
],
},
};
},
computed: {
modelVisible: {
get() {
if (this.visible) {
// this.deviceId = 'K82+285';
this.initData();
}
return this.visible;
},
set(val) {
@ -275,141 +58,9 @@ export default {
},
},
},
// watch: {
// modelVisible: {
// immediate: true,
// handler(bool) {
// if (!bool) return;
// // this.requestURL();
// }
// }
// },
methods: {
async initData() {
//
let result = await this.requestURL("ASKMD");
// if (result.data == 7) {
// this.activeName = "second";
// this.tabClick();
// } else {
this.formData.controlType = result.data + "" || "1";
//
let resultTime = await this.requestURL("ASKTM");
this.formData.onWorkStatus = resultTime.data || 0;
this.activeName = "first";
// }
},
async requestURL(functionId, options = {}) {
let result = await request({
url: `/business/device/functions/${this.deviceId}/${functionId}`,
method: "post",
data: options,
});
if (result.code != 200) return Message.error(result?.msg);
//SETMDASKMDSETTMASKTMSETDFASKDF
console.log("aaaa", result);
return result;
},
async tabClick() {
if (this.activeName == "second") {
//
let result = await request({
url: `/business/device/properties/latest/${this.deviceId}`,
method: "get",
});
if (result.code != 200) return Message.error(result?.msg);
this.tableData = [];
let tData = [];
result.data.forEach((item) => {
if (item.property == "TM") {
this.onWorkStatus2 = item.value;
} else if (item.property == "MD") {
} else {
let data = JSON.parse(item.formatValue || {});
tData.push({ ...data, ds: item.property });
}
});
tData.sort((a, b) => a.ds.toUpperCase().localeCompare(b.ds.toUpperCase()));
this.tableData = tData;
} else {
//
let resultTime = await this.requestURL("ASKTM");
this.formData.onWorkStatus = resultTime.data || 0;
this.activeName = "first";
}
},
async handleSubmit() {
if (this.activeName == "first") {
//
this.$refs.FormConfigRef.validate().then(async (formData) => {
console.log("formData", formData);
//
await this.requestURL("SETMD", { SET: formData.controlType });
//
let res = await this.requestURL("SETTM", {
SET: formData.onWorkStatus,
});
console.log("res", res);
if (res.code == 200) {
Message.success("设置成功!");
this.$emit("update:value", false);
}
});
} else if (this.activeName == "second") {
//
let rData = [];
this.tableData.forEach((it, index) => {
rData.push({
functionId: "SETDF",
params: {
order: 7,
time: it.time,
numberOfSegments: it.ds || this.duan[index],
A: Number(it.A),
B: Number(it.B),
C: Number(it.C),
D: Number(it.D),
E: Number(it.E),
F: Number(it.F),
G: Number(it.G),
H: Number(it.H),
}
});
});
//
let res = await request({
url: `/business/device/batchFunctions`,
method: "post",
// data: {
// deviceId: this.deviceId,
// functionId: "SETDF",
// params: rData,
// },
data: {
devices: [{
iotDeviceId: this.deviceId,
id: this.productId,
deviceType: 10
}],
functions: rData
}
});
if (res.code == 200) {
Message.success("设置成功!");
this.$emit("update:value", false);
}
//
// let res = await this.requestURL("SETTM", { SET: this.onWorkStatus2 });
// if (res.code == 200) {
// Message.success("");
// this.$emit("update:value", false);
// }
}
this.$refs.DeviceParam?.handleSubmit();
},
},
};

425
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue

@ -0,0 +1,425 @@
<template>
<div :style="{
'max-height': isMultiControl ? '250px' : undefined, 'overflow-y': isMultiControl ? 'auto' : undefined,
'margin-left': isMultiControl ? '14px' : undefined
}">
<ElTabs v-model="activeName" class="tabs" @tab-click="tabClick">
<ElTabPane label="一般模式" name="first">
<Form v-model="formData" class="form" ref="FormConfigRef" :formList="formList1" column="1" labelWidth="120px" />
</ElTabPane>
<ElTabPane label="自定义模式" name="second">
<!-- <div style="display: flex; margin: 20px 0">
<p style="width: 115px">工作时长():</p>
<el-input-number v-model="onWorkStatus2" :min="0" :max="999" label="工作时长(s分):"></el-input-number>
</div> -->
<Table :data="tableData">
<ElTableColumn prop="ds" label="段数"></ElTableColumn>
<ElTableColumn prop="time" width="120" label="时间(毫秒)">
<template slot-scope="scope">
<div style="display: flex">
<el-input-number style="width: 120px" v-model="scope.row.time" :min="0"></el-input-number>
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="A" label="线路A">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.A" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="B" label="线路B">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.B" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="C" label="线路C">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.C" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="D" label="线路D">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.D" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="E" label="线路E">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.E" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="F" label="线路F">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.F" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="G" label="线路G">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.G" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="H" label="线路H">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.H" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
</Table>
</ElTabPane>
</ElTabs>
</div>
</template>
<script>
import Table from "@screen/components/Table.vue";
import Dialog from "@screen/components/Dialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
import Form from "@screen/components/FormConfig";
import request from "@/utils/request";
import { Message } from "element-ui";
import { batchFunctions } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { multiResultShow } from "@screen/utils/common";
export default {
name: "DeviceControlDialog",
components: {
Dialog,
Button,
Form,
Table,
},
model: {
prop: "visible",
event: "update:value",
},
props: {
visible: Boolean,
deviceId: String,
productId: String,
deviceType: String,
isMultiControl: Boolean,
selectItems: {
type: Array,
default: () => []
}
},
data() {
return {
submitting: false,
activeName: "first",
onWorkStatus2: 0,
formData: {},
duan: [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
],
tableData: [
// {
// ds: 'A',
// time: 0,
// A: false,
// B: false,
// C: false,
// D: false,
// E: false,
// F: false,
// G: false,
// H: false,
// }
],
formList1: [
{
label: "工作模式:",
key: "controlType",
type: "select",
default: "1",
options: {
options: [
{
value: "0",
label: "激光关闭",
},
{
value: "1",
label: "常亮模式",
},
{
value: "2",
label: "间隔100ms闪烁模式",
},
{
value: "3",
label: "间隔200ms闪烁模式",
},
{
value: "4",
label: "间隔500ms闪烁模式",
},
{
value: "5",
label: "2次闪烁模式",
},
{
value: "6",
label: "SOS模式",
},
{
value: "7",
label: "自定义模式",
},
],
},
},
{
label: "工作时长(分):",
key: "onWorkStatus",
required: true,
default: 0,
type: "inputNumber",
options: {
min: 0,
max: 999,
},
},
],
formList2: [
{
label: "工作模式:",
key: "controlType",
type: "RadioGroup",
default: "00",
options: {
type: "circle",
options: [
{
key: "00",
label: "常量",
},
{
key: "01",
label: "闪烁",
},
],
},
},
{
label: "线路选择:",
key: "onWorkStatus2",
required: true,
type: "select",
options: {
placeholder: "请选择",
},
},
{
label: "工作时长:",
key: "onWorkStatus",
required: true,
type: "select",
options: {
placeholder: "请选择",
},
},
],
rules: {
onWorkStatus: [
{ required: true, message: "工作时长不能为空", trigger: "blur" },
],
},
};
},
mounted() {
this.$emit("update:submitting", false);
if (!this.isMultiControl)
this.initData();
},
methods: {
async initData() {
//
let result = await this.requestURL("ASKMD");
// if (result.data == 7) {
// this.activeName = "second";
// this.tabClick();
// } else {
this.formData.controlType = result.data + "" || "1";
//
let resultTime = await this.requestURL("ASKTM");
this.formData.onWorkStatus = resultTime.data || 0;
this.activeName = "first";
// }
},
async requestURL(functionId, options = {}) {
let result = await request({
url: `/business/device/functions/${this.deviceId}/${functionId}`,
method: "post",
data: options,
});
if (result.code != 200) return Message.error(result?.msg);
//SETMDASKMDSETTMASKTMSETDFASKDF
return result;
},
async tabClick() {
if (this.activeName == "second") {
if (this.isMultiControl)
this.tableData = this.duan.map(item => {
return {
ds: item,
time: 0,
A: false,
B: false,
C: false,
D: false,
E: false,
F: false,
G: false,
H: false,
}
});
else {
//
let result = await request({
url: `/business/device/properties/latest/${this.deviceId}`,
method: "get",
});
if (result.code != 200) return Message.error(result?.msg);
this.tableData = [];
let tData = [];
result.data.forEach((item) => {
if (item.property == "TM") {
this.onWorkStatus2 = item.value;
} else if (item.property == "MD") {
} else {
let data = JSON.parse(item.formatValue || {});
tData.push({ ...data, ds: item.property });
}
});
tData.sort((a, b) => a.ds.toUpperCase().localeCompare(b.ds.toUpperCase()));
this.tableData = tData;
}
} else {
if (!this.isMultiControl) {
//
let resultTime = await this.requestURL("ASKTM");
this.formData.onWorkStatus = resultTime.data || 0;
this.activeName = "first";
}
}
},
async handleSubmit() {
if (this.isMultiControl && !this.selectItems.length) {
return Message.error("请至少选择一个设备!");
}
const selectItems = this.selectItems.map(item => JSON.parse(item));
let devices;
if (this.isMultiControl) devices = selectItems;
else devices = [{
iotDeviceId: this.deviceId,
id: this.productId,
deviceType: this.deviceType
}]
this.$emit("update:submitting", true);
if (this.activeName == "first") {
//
this.$refs.FormConfigRef.validate().then(async (formData) => {
//
// await this.requestURL("SETMD", { SET: formData.controlType });
//
// let res = await this.requestURL("SETTM", {
// SET: formData.onWorkStatus,
// });
let res = await batchFunctions({
devices: devices,
functions: [
{ "functionId": "SETMD", "params": { SET: formData.controlType } },//
{
"functionId": "SETTM", "params": { //
SET: formData.onWorkStatus,
}
}
]
});
if (res.code == 200) {
Message.success("设置成功!");
this.$emit("update:value", false);
}
});
} else if (this.activeName == "second") {
//
let rData = [];
this.tableData.forEach((it, index) => {
rData.push({
functionId: "SETDF",
params: {
order: 7,
time: it.time,
numberOfSegments: it.ds || this.duan[index],
A: Number(it.A),
B: Number(it.B),
C: Number(it.C),
D: Number(it.D),
E: Number(it.E),
F: Number(it.F),
G: Number(it.G),
H: Number(it.H),
}
});
});
//
let res = await batchFunctions({
devices: devices,
functions: rData
});
if (res.code == 200) {
Message.success("设置成功!");
this.$emit("update:value", false);
}
//
// let res = await this.requestURL("SETTM", { SET: this.onWorkStatus2 });
// if (res.code == 200) {
// Message.success("");
// this.$emit("update:value", false);
// }
}
this.$emit("update:submitting", false);
},
},
};
</script>
<style lang="scss" scoped></style>

24
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/index.vue

@ -4,20 +4,11 @@
<Video class="video-stream" :pileNum="dialogData.stakeMark" />
<ElTabs v-model="activeName" @tab-click="handleClickTabs" class="tabs">
<ElTabPane label="基本信息" name="first">
<Descriptions
labelWidth="72px"
:list="list"
:data="data"
style="gap: 18px"
/>
<Descriptions labelWidth="72px" :list="list" :data="data" style="gap: 18px" />
</ElTabPane>
<!-- <ElTabPane label="设备参数" name="second">设备参数</ElTabPane> -->
<ElTabPane label="在线率统计" name="third">
<LineChart
v-if="activeName === 'third'"
:productId="dialogData.id"
style="height: 180px"
/>
<LineChart v-if="activeName === 'third'" :productId="dialogData.id" style="height: 180px" />
</ElTabPane>
</ElTabs>
</div>
@ -26,11 +17,8 @@
<Button @click.native="deviceControlVisible = true">设备操作</Button>
</template>
<!-- 设备操作弹窗 -->
<DeviceControlDialog
v-model="deviceControlVisible"
:deviceId="dialogData.iotDeviceId"
:productId="dialogData.id"
/>
<DeviceControlDialog v-model="deviceControlVisible" :deviceId="dialogData.iotDeviceId" :productId="dialogData.id"
:deviceType="dialogData.deviceType" />
</Dialog>
</template>
@ -115,7 +103,7 @@ export default {
if (roadInfo) this.$set(this.data, "roadName", roadInfo.roadName);
},
methods: {
handleClickTabs() {},
handleClickTabs() { },
},
};
</script>
@ -156,7 +144,7 @@ export default {
align-items: center;
justify-content: end;
> div {
>div {
font-size: 16px;
padding: 6px 12px;
}

139
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParams.vue

@ -4,9 +4,11 @@
<Descriptions :list="devicesList" style="gap: 18px;" column="5">
<template v-for="item in devicesList.slice(0, -1)" #[`content-${getSlotKey(item.key)}`]="{ data }">
<span>{{ data.text }}</span>
<Switcher v-if="!disabled" class="switcher" :activeOption="activeOption" :value="data.state"
<Switcher v-if="!disabled" class="switcher" :activeOption="activeOption" :value="data.state"
@change="(value) => handleSwitcherChange(value, data)" />
<ElTag style="margin-left: 20px;" v-else effect="dark" :type="data.state?'':'info'">{{ data.state?'开':'关' }}</ElTag>
<ElTag style="margin-left: 20px;" v-else effect="dark" :type="data.state ? '' : 'info'">{{ data.state ? '开' :
'关' }}
</ElTag>
</template>
</Descriptions>
</div>
@ -49,93 +51,93 @@ export default {
},
created() {
Promise.all([this.getAc(), this.getDc()]).then(res=>{
// if (result.code != 200) return;
Promise.all([this.getAc(), this.getDc()]).then(res => {
// if (result.code != 200) return;
let ac = res[0].data;
let dc = res[1].data;
let deviceInfo = _.merge({}, ac, dc);
const typeMap = {
ac: '220v',
dc: '12v',
}
for (const key in deviceInfo.formatValue) {
// electricity
// voltage
if (key.includes('electricity')) {
const args = key.match(/[a-z]+|[0-9]+$/g);
const typeMap = {
ac: '220v',
dc: '12v',
}
for (const key in deviceInfo.formatValue) {
// electricity
// voltage
if (key.includes('electricity')) {
const args = key.match(/[a-z]+|[0-9]+$/g);
const type = args[0], num = args.slice(-1)[0], prefix = args.slice(0, 2).join('_');
// console.log(type , num , prefix , "+++=========="); //dc 2 dc_out
this.devicesList.push(
{
label: `支路${num}${typeMap[type]}) 电压`,
key: `${prefix}_voltage_${num}`,
text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 3
},
{
label: '电流',
key: `${prefix}_electricity_${num}`,
text: deviceInfo.formatValue[key],
gridColumn: 2,
state: deviceInfo.value[key] > 0
}
);
}
const type = args[0], num = args.slice(-1)[0], prefix = args.slice(0, 2).join('_');
// console.log(type , num , prefix , "+++=========="); //dc 2 dc_out
this.devicesList.push(
{
label: `支路${num}${typeMap[type]}) 电压`,
key: `${prefix}_voltage_${num}`,
text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 3
},
{
label: '电流',
key: `${prefix}_electricity_${num}`,
text: deviceInfo.formatValue[key],
gridColumn: 2,
state: deviceInfo.value[key] > 0
}
);
}
this.devicesList.push(
{
label: '风扇',
key: `fan_status`,
// key: `aa_electricity_1`,
text: { 0: '正常', 1: '开' }[deviceInfo.formatValue['fan_status']] || '-',
gridColumn: 2,
state: (deviceInfo.formatValue['fan_status']==='0')
},
{
label: '温度',
key: `temperature`,
text: deviceInfo.formatValue['temperature'] ? `${deviceInfo.formatValue['temperature']} °C` : '-',
gridColumn: 2
},
{
}
this.devicesList.push(
{
label: '风扇',
key: `fan_status`,
// key: `aa_electricity_1`,
text: { 0: '正常', 1: '开' }[deviceInfo.formatValue['fan_status']] || '-',
gridColumn: 2,
state: (deviceInfo.formatValue['fan_status'] === '0')
},
{
label: '温度',
key: `temperature`,
text: deviceInfo.formatValue['temperature'] ? `${deviceInfo.formatValue['temperature']} °C` : '-',
gridColumn: 2
},
{
label: '箱门',
key: `door_status`,
text: { 0: '关闭', 1: '打开' }[deviceInfo.formatValue['door_status']] || '-',
gridColumn: 1
},
{
label: '湿度',
key: `humidity`,
text: deviceInfo.formatValue['humidity'] ? `${deviceInfo.formatValue['humidity']} %` : '-',
gridColumn: 2
},
{
label: '市电掉电',
key: `power_status`,
text: { 0: '正常', 1: '掉电' }[deviceInfo.formatValue['power_status']] || '-',
gridColumn: 2
},
)
// this.data = result.rows;
// this.total = result.total;
})
{
label: '湿度',
key: `humidity`,
text: deviceInfo.formatValue['humidity'] ? `${deviceInfo.formatValue['humidity']} %` : '-',
gridColumn: 2
},
{
label: '市电掉电',
key: `power_status`,
text: { 0: '正常', 1: '掉电' }[deviceInfo.formatValue['power_status']] || '-',
gridColumn: 2
},
)
// this.data = result.rows;
// this.total = result.total;
})
.finally(() => {
this.secondLoading = false
})
},
methods: {
getAc(){
getAc() {
return request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}/1ac`,
method: "get",
params: {}
})
},
getDc(){
getDc() {
return request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}/1dc`,
method: "get",
@ -145,17 +147,16 @@ export default {
async handleSwitcherChange(value, data) {
let str = data.state ? "关闭" : "开启";
let deviceName = "";
if(data.key.includes("fan")){
if (data.key.includes("fan")) {
str += "风扇?";
deviceName = "fan_out_en";
}else{
} else {
str += "该支路?"
deviceName = data.key.match(/^[a-z]+_out|[0-9]+/g).join("_") + "_en"; //dc_out_2_en ac_out_2_en;
}
data.state = value;
const isContinue = await confirm({ message: `${str}` })
.catch(() => {
console.log(data.state,value,333)
data.state = !value;
});

207
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParamsMulti.vue

@ -2,8 +2,8 @@
<div class='DeviceParams'>
<div class="no-data" v-if="!devicesList.length" v-loading="secondLoading">暂无设备参数</div>
<Descriptions :list="devicesList" style="gap: 18px;" column="5">
<template v-for="item in devicesList.slice(0, -1)" #[`content-${getSlotKey(item.key)}`]="{ data }">
<span>{{ data.text }}</span>
<template v-for="item in devicesList" #[`content-${item.key}`]="{ data }">
<span style="font-size: 15px;font-weight: 400;color: #3de8ff;">{{ data.text }}</span>
<Switcher v-if="!disabled" class="switcher" :activeOption="activeOption" :value="data.state"
@change="(value) => handleSwitcherChange(value, data)" />
<ElTag style="margin-left: 20px;" v-else effect="dark" :type="data.state ? '' : 'info'">{{ data.state ? '开' :
@ -17,10 +17,12 @@
<script>
import Descriptions from '@screen/components/Descriptions.vue';
import Switcher from '@screen/pages/service/PublishingChannelManagement/components/Switcher.vue';
import { cloneDeep } from 'lodash';
import request from "@/utils/request";
import { Message } from 'element-ui';
import { confirm } from "@screen/utils/common";
import { batchFunctions } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { multiResultShow } from "@screen/utils/common";
export default {
name: 'DeviceParams',
@ -34,12 +36,57 @@ export default {
default: () => ({})
},
disabled: Boolean,
isMultiControl: Boolean
isMultiControl: Boolean,
selectItems: {
type: Array,
default: () => []
}
},
data() {
return {
secondLoading: true,
devicesList: [],
devicesList: [
{
labelHidden: true,
text: `支路1 (220v): `,
key: `ac_out_1_en`,
// text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 1,
state: 0
},
{
labelHidden: true,
text: `支路2 (220v): `,
key: `ac_out_2_en`,
// text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 1,
state: 0
},
{
labelHidden: true,
text: `支路1 (12v): `,
key: `dc_out_1_en`,
// text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 1,
state: 0
},
{
labelHidden: true,
text: `支路2 (12v): `,
key: `dc_out_2_en`,
// text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 1,
state: 0
},
{
labelHidden: true,
text: '风扇:',
key: `fan_out_en`,
// text: { 0: '', 1: '' }[deviceInfo.formatValue['fan_status']] || '-',
gridColumn: 1,
state: 0
},
],
activeOption: {
active: {
text: "开"
@ -52,135 +99,50 @@ export default {
},
created() {
Promise.all([this.getAc(), this.getDc()]).then(res => {
// if (result.code != 200) return;
let ac = res[0].data;
let dc = res[1].data;
let deviceInfo = _.merge({}, ac, dc);
console.log(deviceInfo, "deviceInfo11")
const typeMap = {
ac: '220v',
dc: '12v',
}
for (const key in deviceInfo.formatValue) {
// electricity
// voltage
if (key.includes('electricity')) {
const args = key.match(/[a-z]+|[0-9]+$/g);
const type = args[0], num = args.slice(-1)[0], prefix = args.slice(0, 2).join('_');
// console.log(type , num , prefix , "+++=========="); //dc 2 dc_out
this.devicesList.push(
{
label: `支路${num}${typeMap[type]}) 电压`,
key: `${prefix}_voltage_${num}`,
text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 3
},
{
label: '电流',
key: `${prefix}_electricity_${num}`,
text: deviceInfo.formatValue[key],
gridColumn: 2,
state: deviceInfo.value[key] > 0
}
);
}
}
this.devicesList.push(
{
label: '风扇',
key: `fan_status`,
// key: `aa_electricity_1`,
text: { 0: '正常', 1: '开' }[deviceInfo.formatValue['fan_status']] || '-',
gridColumn: 2,
state: (deviceInfo.formatValue['fan_status'] === '0')
},
{
label: '温度',
key: `temperature`,
text: deviceInfo.formatValue['temperature'] ? `${deviceInfo.formatValue['temperature']} °C` : '-',
gridColumn: 2
},
{
label: '箱门',
key: `door_status`,
text: { 0: '关闭', 1: '打开' }[deviceInfo.formatValue['door_status']] || '-',
gridColumn: 1
},
{
label: '湿度',
key: `humidity`,
text: deviceInfo.formatValue['humidity'] ? `${deviceInfo.formatValue['humidity']} %` : '-',
gridColumn: 2
},
{
label: '市电掉电',
key: `power_status`,
text: { 0: '正常', 1: '掉电' }[deviceInfo.formatValue['power_status']] || '-',
gridColumn: 2
},
)
// this.data = result.rows;
// this.total = result.total;
})
.finally(() => {
this.secondLoading = false
})
},
methods: {
getAc() {
return request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}/1ac`,
method: "get",
params: {}
})
},
getDc() {
return request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}/1dc`,
method: "get",
params: {}
})
},
async handleSwitcherChange(value, data) {
let str = data.state ? "关闭" : "开启";
let deviceName = "";
if (data.key.includes("fan")) {
str += "风扇?";
deviceName = "fan_out_en";
} else {
str += "该支路?"
deviceName = data.key.match(/^[a-z]+_out|[0-9]+/g).join("_") + "_en"; //dc_out_2_en ac_out_2_en;
}
let deviceName = data.key;
str += `${data.text.replace(":", "")}?`;
// if (data.key.includes("fan")) {
// str += "?";
// deviceName = "fan_out_en";
// } else {
// str += "?"
// deviceName = data.key.match(/^[a-z]+_out|[0-9]+/g).join("_") + "_en"; //dc_out_2_en ac_out_2_en;
// }
data.state = value;
if (!this.selectItems.length) {
setTimeout(() => { data.state = !value; }, 10);
return Message.error("请至少选择一个设备!");
}
const selectItems = this.selectItems.map(item => JSON.parse(item));
const isContinue = await confirm({ message: `${str}` })
.catch(() => {
console.log(data.state, value, 333)
data.state = !value;
});
if (!isContinue) return;
// https://www.yuque.com/dayuanzhong-ovjwn/gkht0m/ww776d5kzs72ilzh?singleDoc=
request({
url: `/business/device/functions/${this.dialogData.iotDeviceId}/${102}`,
method: "POST",
data: {
deviceName,
// 1=0=
value: value ? 1 : 0
}
})
batchFunctions(
{
"devices": selectItems,
"functions": [
{
"functionId": "102",
"params": {
deviceName,
// 1=0=
value: value ? 1 : 0
}
}
]
})
.then(result => {
if (result.code != 200) {
Message.error("操作失败");
data.state = !value;
return;
};
Message.success("操作成功");
multiResultShow(result.data, item => item.result.code == 200, "操作");
})
.catch(() => {
data.state = !value;
@ -197,5 +159,8 @@ export default {
<style lang='scss' scoped>
.DeviceParams {
height: 100%;
padding-right: 9px;
padding-left: 14px;
margin-top: 15px;
}
</style>

33
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue

@ -14,13 +14,14 @@
</span>
<Form v-model="data" labelWidth="90px" column="2" class="form" ref="FormConfigRef" :formList="formList" />
<component ref="ControlComponent" :is="componentMap[DeviceTopics[data.deviceType]]" :isMultiControl="true"
:selectItems="data.childType" @update:activeIcon="(val) => { this.activeIcon = val }"></component>
<!-- <div class="footer">
<Button @click.native="submitClick">
:selectItems="data.childType" @update:activeIcon="(val) => { this.activeIcon = val }"
@update:submitting="(val) => { submitting = val }"></component>
<div v-if="hiddenDevices.indexOf(componentMap[DeviceTopics[data.deviceType]]) == -1" class="footer">
<Button @click.native="submitClick" :loading="submitting">
确认
</Button>
<Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick"> 取消 </Button>
</div> -->
</div>
</div>
</ElPopover>
@ -37,12 +38,20 @@ import { ChildTypes } from "@screen/utils/enum.js"
import { getDeviceList } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { delay } from "@screen/utils/common";
import { initSearch } from "@screen/utils/enum/common.js"
import DeviceParams from "@screen/pages/Home/components/Dialogs/SmartDevice/components/DeviceParams.vue";
import SmartDeviceParams from "@screen/pages/Home/components/Dialogs/SmartDevice/components/DeviceParamsMulti.vue";
import BroadcastParam from "@screen/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue";
import FatigueWakesUpParam from "@screen/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceParam.vue";
import DrivingGuidanceParam from "@screen/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceParam.vue";
import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent";
const componentMap = { "语音广播": "BroadcastParam" } //DeviceTopics[deviceType]
//"": undefined, "": undefined, "": undefined, "": undefined,"": "DeviceParams",
const componentMap = {
"设备箱": "SmartDeviceParams", "语音广播": "BroadcastParam", "疲劳唤醒": "FatigueWakesUpParam",
"行车诱导": "DrivingGuidanceParam"
} //DeviceTopics[deviceType]
//"": undefined, , , "": undefined,
const hiddenDevices = ["SmartDeviceParams"];
const controlMulti = Object.keys(componentMap);//6
const DeviceTopics = {};//6 {key:label}
@ -72,13 +81,17 @@ export default {
components: {
Button,
Form,
DeviceParams,
BroadcastParam
SmartDeviceParams,
BroadcastParam,
FatigueWakesUpParam,
DrivingGuidanceParam,
},
data() {
return {
activeIcon: null,
data: {},
hiddenDevices,
submitting: false,
formList: [
{
label: "设备类型:",
@ -278,7 +291,7 @@ export default {
},
methods: {
submitClick() {
this.$refs.ControlComponent.handleSubmit()
this.$refs.ControlComponent?.handleSubmit();
},
cancelClick() {
this.activeIcon = null;

2566
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/EventInformation/components/EditEventInformationDialog/data.js

File diff suppressed because it is too large

285
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/EventInformation/components/EditEventInformationDialog/index.vue

@ -1,11 +1,11 @@
<template>
<Dialog v-model="modelVisible" title="修改事件信息" width="550px">
<Dialog v-model="modelVisible" title="修改事件信息" width="1100px" top="10%">
<div class="EditEventInformationDialog">
<Form class="form" :formList="formConfigList" labelWidth="120px" />
<Form class="form" ref="FormConfigRef" :formList="formConfigList" v-model="fData" labelWidth="120px" />
<div class="footer">
<Button>保存</Button>
<Button style="background: #c9c9c9">关闭</Button>
<Button @click.native="onSubmit" :loading="submitting">保存</Button>
<Button style="background: #c9c9c9" @click.native="modelVisible = false">关闭</Button>
</div>
</div>
</Dialog>
@ -15,8 +15,107 @@
import Dialog from "@screen/components/Dialog/index";
import Form from "@screen/components/FormConfig";
import Button from "@screen/components/Buttons/Button.vue";
import request from "@/utils/request";
import { tabConfigList } from "./data.js";
import { Message } from "element-ui";
import { formConfigList } from "./data.js";
const eventInfo = {
id: "60f022d95a7c4b6cada2d780246543d8",
deptId: null,
deptName: null,
stakeMark: "k103+900",
endStakeMark: null,
direction: "菏泽方向",
userId: 1,
startTime: null,
endTime: null,
estimatedEndTime: "2024-02-22 10:44:27",
eventLevel: 1,
eventType: 1,
stringEventType: "交通事故",
eventSubclass: "其他事故",
eventCause: "其他事故",
description: "其他事故",
eventState: 0,
eventSource: null,
stringEventSource: "96659",
eventNature: null,
eventSourceTips: null,
inTunnel: null,
roadId: null,
occurrenceTime: "2024-02-22 10:44:18",
isPerceived: 0,
lang: "2,3",
roadName: "济菏高速",
organizationName: "研发部门",
processConfigList: [
{
"id": 8,
"eventType": 1,
"nodeNode": "1",
"processNode": "接警记录",
"commonPhrases": ""
},
],
eventTitle: "发生其他事故事故",
dimension: null,
longitude: null,
dcEventMap: null,
dcEventAbnormalWeather: null,
dcEventAccident: {
searchValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
params: {},
id: "60f022d95a7c4b6cada2d780246543d8",
reporterName: "王兴琳",
reporterPhoneNumber: "19806119906",
locationType: 1,
trafficJam: 100,
weatherCondition: 1,
impactLevel: 2,
isReverseCargo: 1,
isMaintenance: 1,
policeContact: "96659",
towingServiceContact: "19806119906",
congestionAhead: 0,
atIntersection: 0,
onCurve: 1,
spillageItem: "抛洒物",
vehicleOwnerPhone: "19806119906",
smallCar: 10,
trucks: 0,
buses: 0,
tankers: 0,
minorInjuries: 1,
seriousInjuries: null,
fatalities: null,
isPrivate: null,
facilityId: null,
rampId: null,
location: null,
dcEvent: null
},
dcEventConstruction: null,
dcEventServiceArea: null,
dcEventTrafficCongestion: null,
dcEventVehicleAccident: null,
dcEventTrafficControl: null,
nickName: "管理员",
stringEventState: "待确认",
commonPhrases: null,
nodeNode: null,
eventName: "交通事故",
processNode: null,
updateTime: null,
createTime: "2024-02-22 10:49:34",
remark: null,
subclass: "1-5",
linkId: null
};
export default {
name: "EditEventInformationDialog",
@ -34,19 +133,191 @@ export default {
},
data() {
return {
formConfigList,
formConfigList: [],
submitting: false,
fData: {},
resultEventData: {},
eventId: '1a91d65cc31f4a9d90122888edb31043',
roads: [],
direction: [],
lwss: []
};
},
computed: {
modelVisible: {
get() {
if (this.visible) {
this.initData()
}
return this.visible;
},
set(val) {
console.log('val', val)
this.$emit("close", val);
},
},
},
mounted() {
},
methods: {
async initData() {
let infoData = await request({
url: `/dc/system/event/eventSubclass/1/60f022d95a7c4b6cada2d780246543d8`,//
method: "get",
})
if (infoData.code != 200) return Message.error(infoData?.msg);
this.resultEventData = { ...infoData.data };
let info = infoData.data;
if (typeof info.stakeMark == 'string') {
let numbers = info.stakeMark.match(/\d+/g).map(Number);
// console.log('numbers', numbers);
info.stakeMark = numbers;
}
this.fData = info;
let configList = tabConfigList.find(item => item.label == this.fData.eventName)
this.formConfigList = configList.formConfig.list
await Promise.all([
//
request({
url: `/business/road/query`,
method: "get",
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
this.roads = [];
result.data.forEach((it) => {
this.roads.push({ key: it.id, label: it.roadName });
});
})
.catch((err) => {
Message.error("查询失败4", err);
}),
//
request({
url: `/system/dict/data/type/iot_event_direction`,
method: "get",
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
this.direction = []
result.data.forEach((it) => {
this.direction.push({ key: it.dictValue, label: it.dictLabel });
});
})
.catch((err) => {
Message.error("查询失败5", err);
}),
// 1 2 3 4 5 6
request({
url: `/business/facility/query`,
method: "get",
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
this.lwss = [];
result.data.forEach((it) =>
this.lwss.push({
key: it.id,
label: it.facilityName,
type: it.facilityType,
})
);
})
.catch((err) => {
console.log("err", err);
Message.error("查询失败6", err);
}),
])
this.formConfigList.forEach((it) => {
if (it.key == "direction") {
it.options.options = this.direction;
}
if (it.key == "roadId") {
it.options.options = this.roads;
}
if (it.key == "dcEventServiceArea.facilityId") {
it.options.options = this.lwss.filter((ss) => ss.type == 6);
}
});
},
onSubmit() {
this.$refs.FormConfigRef.validate().then((formData) => {
this.submitting = true;
let eventType = this.resultEventData.eventType;
formData.eventType == eventType;
if ((eventType == 1 || eventType == 2) && Array.isArray(formData.lang)) {
formData.lang = formData.lang.join(",");
}
if (eventType == 3 && formData.dcEventTrafficControl.facilityId instanceof Array) {
let ids = formData.dcEventTrafficControl.facilityId;
formData.dcEventTrafficControl.facilityIds = ids
formData.dcEventTrafficControl.facilityId = ''
}
if (formData.endStakeMark && formData.endStakeMark[0] != null) {
let endStakeMark = formData.endStakeMark;
let strMark = endStakeMark && endStakeMark.length > 0 ? "K" + endStakeMark[0] + "+" + endStakeMark[1] : "";
if (eventType == 4) {
formData.dcEventTrafficCongestion.endStakeMark = strMark;
}
if (eventType == 7) {
formData.dcEventConstruction.endStakeMark = strMark;
}
if (eventType == 10) {
formData.dcEventAbnormalWeather.endStakeMark = strMark;
}
formData.endStakeMark = "";
} else {
formData.endStakeMark = "";
}
let stakeMark = formData.stakeMark;
// console.log('formData', {
// ...formData,
// id: this.resultEventData.id,
// eventState: this.resultEventData.eventState,
// stakeMark: (stakeMark && stakeMark[0] != null) ? ((stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '') : '',
// })
// this.submitting = false;
// return;
request({
url: `/dc/system/event`,
method: "put",
data: {
...formData,
id: this.resultEventData.id,
eventState: this.resultEventData.eventState,
stakeMark:
stakeMark && stakeMark[0] != null
? stakeMark && stakeMark.length > 0
? "K" + stakeMark[0] + "+" + stakeMark[1]
: ""
: "",
},
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
})
.catch(() => {
Message.error("提交失败");
})
.finally(() => {
this.submitting = false;
});
});
}
}
};
</script>
@ -54,7 +325,7 @@ export default {
.EditEventInformationDialog {
gap: 9px;
width: 1050px;
height: 810px;
height: 850px;
display: flex;
flex-direction: column;

7
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/EventInformation/index.vue

@ -22,7 +22,7 @@
<div class="tag" >{{ detailData.eventLevel?`${detailData.eventCause+['','一','二','三','四','五'][detailData.eventLevel]}级事件` : '暂无事件等级' }}</div>
</div>
<EditEventInformationDialog v-model="editEventInformationDialogVisible" />
<EditEventInformationDialog v-model="editEventInformationDialogVisible" @close="closeDialog"/>
</Card>
</template>
@ -80,6 +80,11 @@ export default {
],
editEventInformationDialogVisible: false
}
},
methods: {
closeDialog(){
this.editEventInformationDialogVisible = false;
}
}
}
</script>

44
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/ReleaseInformation/index.vue

@ -25,7 +25,7 @@
</Descriptions> -->
<div class="bottom">
<ButtonGradient @click="confirm" class="title-button special-button">
<ButtonGradient @click.native="handleSubmit" :loading="submitting" class="title-button special-button">
一键发布
</ButtonGradient>
<!-- <ButtonGradient class="title-button special-button">
@ -42,7 +42,7 @@ import Form from '@screen/components/FormConfig';
import CheckboxGroup from '@screen/components/FormConfig/components/ElCheckboxGroup.vue';
import Descriptions from '@screen/components/Descriptions.vue';
import { provideMixin } from "./../../mixin"
import { method, result } from "lodash";
import request from "@/utils/request";
export default {
name: 'ReleaseInformation',
@ -70,6 +70,7 @@ export default {
{ key: '3', label: '网站' },
{ key: '4', label: '新浪' },
],
submitting: false,
formList: [{
label: "发布内容:",
key: "content",
@ -90,13 +91,44 @@ export default {
}
},
methods: {
async confirm(){
async handleSubmit(){
await this.$refs.FormMsgRef.validate()
.then((res) => {
console.log(res)
.then(async (res) => {
const {content,type} = res;
if(content === null){
this.$message.warning(`未输入发布内容`);
return;
}
if(type.length === 0){
this.$message.warning(`未选择发布平台`);
return;
}
// res.eventid =
if(type.indexOf('1') !== -1){
res.phone = '13589019062'
}
res.eventId = this.detailData.id;
this.submitting = true;
await request({
url: `/business/sms/pushAll`,
method: "post",
data: res,
})
.then((result) => {
if (result.code != 200) return this.$message.error(result?.msg);
this.$message.success("提交成功");
this.modelVisible = false;
})
.catch(() => {
this.$message.error("提交失败");
})
.finally(() => {
this.submitting = false;
});
})
.catch((err) => {
console.log("catch");
console.log("catch"+err);
});
}
}

29
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue

@ -199,9 +199,10 @@ export default {
url: `/system/process/list`,
method: "get",
params: { eventId: this.formData.id },
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
const rows = result.rows;
}).then((rows) => {
console.log('rows',rows)
// if (result.code != 200) return Message.error(result?.msg);
// const rows = result.rows;
this.timeLine1List = [];
this.timeLine2List = [];
@ -234,6 +235,28 @@ export default {
});
});
},
getProcessNode() {
return request({
url:
`/dc/system/event/getProcessNode/${this.formData.id}`,
method: "GET",
})
.then((result) => {
if (result.code != 200) return [];
// this.timeLine1List = result.data.map((item) => {
// return {
// time: item.operationTime,
// label: item.processNode,
// isActive: item.status == 1 ? true : false,
// };
// });
// this.options = result.data.filter((item) => {
// item.status == 0;
// return item;
// });
})
.catch((err) => []);
},
onCloseAddNew() {
this.isShowDialog = false;
},

18
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js

@ -731,10 +731,10 @@ export const locationMode = {
default: "1",
options: {
options: [
{ key: "1", label: "高速主线" },
{ key: "2", label: "服务区" },
{ key: "3", label: "立交桥" },
{ key: "4", label: "收费站" },
{ key: 1, label: "高速主线" },
{ key: 2, label: "服务区" },
{ key: 3, label: "立交桥" },
{ key: 4, label: "收费站" },
],
},
ons: {
@ -907,11 +907,11 @@ export const effect = {
type: "select",
options: {
options: [
{ key: "1", label: "无" },
{ key: "2", label: "危化品泄漏" },
{ key: "3", label: "整车自燃" },
{ key: "4", label: "车辆复燃" },
{ key: "5", label: "散装人工倒货" },
{ key: 1, label: "无" },
{ key: 2, label: "危化品泄漏" },
{ key: 3, label: "整车自燃" },
{ key: 4, label: "车辆复燃" },
{ key: 5, label: "散装人工倒货" },
],
},
};

19
ruoyi-ui/src/views/JiHeExpressway/utils/common.js

@ -1,6 +1,25 @@
import request from "@/utils/request";
import { Message, MessageBox } from "element-ui";
/**
*
* @param {*} result 结果数组
* @param {*} predicate 断言函数
* @param {*} operationName 操作名称
*/
export const multiResultShow = (allItems, predicate, operationName) => {
const successItems = allItems.filter(predicate);
if (successItems.length == allItems.length) {
Message.success(`${operationName}成功!`);
} else {
Message.error(
`${operationName}成功${successItems.length}个, 失败${
allItems.length - successItems.length
}!`
);
}
};
export function delay(ms = 240) {
return new Promise((resolve) => setTimeout(() => resolve(void 0), ms));
}

Loading…
Cancel
Save