Browse Source

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

wangqin
zhangzhang 7 months ago
parent
commit
bc78dee09a
  1. 182
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue
  2. 29
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue
  3. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js
  4. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue
  5. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue
  6. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js
  7. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue
  8. 15
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue
  9. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/ScopeTable.vue
  10. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue

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

@ -0,0 +1,182 @@
<template>
<div class="body">
<div class="right" :style="{ width: isMultiControl ? '100%' : undefined }">
<div class="top-content">
<Video v-if="!isMultiControl" class="item-video" :pileNum="pileNum" />
<label style="width: 99px;">发布内容: </label>
<ElInput type="textarea" v-model="releaseMessage" :autosize="{ minRows: 3, maxRows: 3 }" :maxlength="150"
showWordLimit placeholder="请输入发布内容" />
</div>
<div class="footer">
<Button @click.native="handleSubmit" :loading="submitting">
确定
</Button>
<Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick">
取消
</Button>
</div>
</div>
</div>
</template>
<script>
import Dialog from "@screen/components/Dialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
import Video from "@screen/components/Video";
import CheckboxGroup from "@screen/components/FormConfig/components/ElCheckboxGroup.vue";
import request from "@/utils/request";
import { batchFunctions } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { Message } from "element-ui";
export default {
name: "BroadcastReleases",
components: {
Dialog,
Button,
Video,
CheckboxGroup,
},
model: {
prop: "visible",
event: "update:value",
},
props: {
visible: Boolean,
pileNum: String,
otherConfig: String,
isMultiControl: Boolean,
selectItems: {
type: Array,
default: () => []
}
},
data() {
return {
submitting: false,
checkList: [],
releaseMessage: null,
// musicList: [],
};
},
computed: {
modelVisible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:value", val);
},
},
},
created() {
// getDeviceList(5).then((data) => {
// if (Array.isArray(data))
// this.musicList = data.map((item) => ({
// ...item,
// disabled: item.deviceState != 1,
// }));
// });
},
methods: {
cancelClick() {
this.$emit("update:activeIcon", null);
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("请至少选择一个广播设备!");
this.submitting = true;
batchFunctions(
{
"devices": selectItems,
"functions": [
{
"functionId": "1",//便
"params": {
name: "task-3",
outVol: "6",
priority: "1",
text: this.releaseMessage.trim(),
repeatTimes: "3",
termList: checkList,
functionType: "startPaTts",
}
}
]
})
.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}个!`);
}
})
.finally(() => {
this.submitting = false;
});
},
},
};
</script>
<style lang="scss" scoped>
.body {
display: flex;
gap: 9px;
height: 100%;
padding-right: 9px;
margin-top: 15px;
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
.top-content {
display: flex;
flex-direction: row;
// gap: 9px;
align-items: center;
.item-video {
width: 545px;
}
label {
font-size: 15px;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #3de8ff;
line-height: 19px;
vertical-align: middle;
text-align: right;
padding-right: 12px;
box-sizing: border-box;
}
}
}
}
.footer {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 9px;
}
</style>

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

@ -13,14 +13,14 @@
<i class="el-icon-close" />
</span>
<Form v-model="data" labelWidth="90px" column="2" class="form" ref="FormConfigRef" :formList="formList" />
<component :is="componentMap[DeviceTopics[data.deviceType]]" :isMultiControl="true"></component>
<!-- -->
<div class="footer">
<Button @click.native="">
<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">
确认
</Button>
<Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="cancelClick"> 取消 </Button>
</div>
</div> -->
</div>
</ElPopover>
@ -38,11 +38,9 @@ import { getDeviceList } from "@screen/pages/Home/components/RoadAndEvents/utils
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 BroadcastParam from "@screen/pages/Home/components/Dialogs/Broadcast/components/BroadcastParam.vue";
import Vue from "vue";
import BroadcastParam from "@screen/pages/Home/components/Dialogs/Broadcast/components/BroadcastParamMulti.vue";
import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent";
import { DeviceForMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent"
const componentMap = { "语音广播": "BroadcastParam" } //DeviceTopics[deviceType]
//"": undefined, "": undefined, "": undefined, "": undefined,"": "DeviceParams",
const controlMulti = Object.keys(componentMap);//6
@ -51,13 +49,14 @@ const DeviceTopics = {};//6种批量控制 事件专题 {key:label}
Object.keys(DeviceForMap).forEach(DeviceLabel => {
controlMulti.indexOf(DeviceLabel) !== -1 && (DeviceTopics[DeviceForMap[DeviceLabel].deviceType] = DeviceLabel);
});
const deviceTypeDefault = Object.keys(DeviceTopics)[0];
async function setDeviceOptions(config, filterData, formList) {
const data = await getDeviceList(config.deviceType, filterData).then(async (data) => {
await delay(600);
return data;
});
formList[4].options.options = data.map(item => {
return { label: `${item.deviceName}`, value: JSON.stringify({ id: item.id, iotDeviceId: item.iotDeviceId }), disabled: item.deviceState != 1 }
return { label: `${item.deviceName}`, value: JSON.stringify({ id: item.id, iotDeviceId: item.iotDeviceId, deviceType: item.deviceType, otherConfig: item.otherConfig }), disabled: item.deviceState != 1 }
})
};
function changeHandle(data, formList) {
@ -85,6 +84,7 @@ export default {
label: "设备类型:",
key: "deviceType",
type: "select",
default: deviceTypeDefault,
options: {
clearable: true,
options: Object.keys(DeviceTopics).map(key => { return { label: DeviceTopics[key], value: key } }),
@ -92,7 +92,6 @@ export default {
ons: { //on element
change(value, ...args) {
const { data, formList } = args.slice(-1)[0]; //data formList
console.log(Vue, this)
if (data.deviceType) changeHandle(data, formList);
else data.childType = undefined;
}
@ -274,14 +273,18 @@ export default {
// deep: true
// }
// },
mounted() {
changeHandle(this.data, this.formList);
},
methods: {
submitClick() {
this.$refs.ControlComponent.handleSubmit()
},
cancelClick() {
this.activeIcon = null;
},
handleClick(type) {
console.log("type: ", type);
this.activeIcon = this.activeIcon === type ? null : type;
console.log("this.activeIcon", this.activeIcon);
},
filterEnd(data) {
this.activeIcon = null;

8
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js

@ -3,6 +3,14 @@ import { Message } from "element-ui";
import moment from "moment";
import request from "@/utils/request";
export function batchFunctions(data) {
return request({
url: `/business/device/batchFunctions`,
method: "post",
data: data,
});
}
/**
*
* @param {string} camId 相机 ID

2
ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue

@ -22,7 +22,7 @@
<HomeVector class="item" />
<HomeWord class="item" />
<!-- <HomeVectorControl class="item" /> -->
<!-- <HomeFrameControl class="item" /> -->
<HomeFrameControl class="item" />
</div>
<ConditionStatistics class="right card-menu" />
</div>

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

@ -5,13 +5,15 @@
}">
<Form :formList="formList" :dFormData="formData" label-width="100px" />
<div class="video-pic">
<div class="video-pic" :style="{ height: formData.component === 'VideoMulti' ? '220px' : undefined }">
<Video v-if="activeName != '-1'" style="height: 100%; width: 380px" :showHeader="false" :url="formData.videoList && formData.videoList.length > 0
<component :is="formData.component" v-if="activeName != '-1'" style="height: 100%; width: 380px"
:showHeader="false" :url="formData.videoList && formData.videoList.length > 0
? formData.videoList[0] : ''" :camId="formData.upCamId" :pileNum="formData.stakeMark" rangeIndex="upCamera"
:videoType="formData.videoType" />
<Video v-if="activeName != '-1'" style="height: 100%; width: 380px" :showHeader="false" :url="formData.videoList && formData.videoList.length > 0
<component :is="formData.component" v-if="activeName != '-1'" style="height: 100%; width: 380px"
:showHeader="false" :url="formData.videoList && formData.videoList.length > 0
? formData.videoList[1] : ''" :camId="formData.downCamId" :pileNum="formData.stakeMark" rangeIndex="downCamera"
:videoType="formData.videoType" />
@ -51,6 +53,7 @@ import Form from "@screen/components/FormConfig";
import { formList } from "./data";
// import { timeLine2List } from "@screen/pages/control/event/commandDispatch/Cards/DisposalProcess/data.js"
import Video from "@screen/components/Video";
import VideoMulti from "@screen/components/VideoMulti";
import Carousel from "./Carousel/index.vue";
import EventPlanDialog from "./eventPlanDialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
@ -66,6 +69,7 @@ export default {
TimeLine1,
TimeLine2,
Video,
VideoMulti,
Carousel,
Button,
EventPlanDialog,

4
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js

@ -945,7 +945,7 @@ export const tabConfigList = [
},
{
label: "限制类型:",
key: "dcEventAccident.limitedType",
key: "dcEventTrafficControl.limitedType",
required: true,
type: "select",
options: {
@ -963,7 +963,7 @@ export const tabConfigList = [
},
{
label: "车辆类型:",
key: "dcEventAccident.vehicleType",
key: "dcEventTrafficControl.vehicleType",
required: true,
type: "select",
options: {

2
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue

@ -162,7 +162,7 @@ export default {
formData.lang = "";
}
if (this.index == 2 && formData.dcEventTrafficControl.facilityId instanceof Array) {
let ids = formData.dcEventTrafficControl.facilityId.join(',');
let ids = formData.dcEventTrafficControl.facilityId;
formData.dcEventTrafficControl.facilityIds = ids
formData.dcEventTrafficControl.facilityId = ''
}

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

@ -299,6 +299,7 @@ export default {
// 'https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-480p.mp4']
}
data.videoType = "mp4";
data.component = "Video";
this.detailDialogFormData = data;
// console.log('data', this.detailDialogFormData)
@ -316,16 +317,12 @@ export default {
data.videoList = [];
const { downCamera, upCamera } = ((await getNearCameraNew(data.stakeMark))?.data || {});//
data.downCamId = downCamera?.camId;
data.upCamId = upCamera?.camId;
data.component = "VideoMulti";
// const { downCamera, upCamera } = ((await getNearCameraNew(data.stakeMark))?.data || {});//
// data.downCamId = downCamera?.camId;
// data.upCamId = upCamera?.camId;
data.videoType = "flv";
// if (data.otherConfig) {
// let otherConfig = JSON.parse(data.otherConfig);
// // data.pictures = otherConfig.pictures || [];
// data.videoList = otherConfig.videoList || [];
// //data.videoList = otherConfig.videoList || ['https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-480p.mp4']
// }
this.detailDialogFormData = data;

6
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/ScopeTable.vue

@ -155,7 +155,7 @@
<el-option label="智能发布" :value="2"></el-option>
</el-select>
</el-col> -->
<el-col v-if="tableInfo.deviceType == 5 && tableInfo.hf_operationType == 1" :span="4">
<el-col v-if="tableInfo.deviceType == 5" :span="4">
<el-input v-model="tableInfo.hf_content" placeholder="请输入发布内容"></el-input>
</el-col>
</el-row>
@ -213,10 +213,6 @@ export default {
},
{
value: 3,
label: '事发下游最近'
},
{
value: 4,
label: '最近公里数'
},
],

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

@ -273,7 +273,7 @@ export default {
let dcArr = [];
this.tableData.forEach(item => {
let dcData = {
id: item.id || '',
id: null,
deviceType: item.deviceType,
searchRule: item.searchRule,
number: item.number
@ -346,13 +346,13 @@ export default {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
this.$emit("reInitData", true);
})
.catch(() => {
Message.error("提交失败");
})
.finally(() => {
this.submitting = false;
this.$emit("reInitData", true);
});
}
}

Loading…
Cancel
Save