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

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

@ -22,7 +22,7 @@
<HomeVector class="item" /> <HomeVector class="item" />
<HomeWord class="item" /> <HomeWord class="item" />
<!-- <HomeVectorControl class="item" /> --> <!-- <HomeVectorControl class="item" /> -->
<!-- <HomeFrameControl class="item" /> --> <HomeFrameControl class="item" />
</div> </div>
<ConditionStatistics class="right card-menu" /> <ConditionStatistics class="right card-menu" />
</div> </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" /> <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" ? formData.videoList[0] : ''" :camId="formData.upCamId" :pileNum="formData.stakeMark" rangeIndex="upCamera"
:videoType="formData.videoType" /> :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" ? formData.videoList[1] : ''" :camId="formData.downCamId" :pileNum="formData.stakeMark" rangeIndex="downCamera"
:videoType="formData.videoType" /> :videoType="formData.videoType" />
@ -51,6 +53,7 @@ import Form from "@screen/components/FormConfig";
import { formList } from "./data"; import { formList } from "./data";
// import { timeLine2List } from "@screen/pages/control/event/commandDispatch/Cards/DisposalProcess/data.js" // import { timeLine2List } from "@screen/pages/control/event/commandDispatch/Cards/DisposalProcess/data.js"
import Video from "@screen/components/Video"; import Video from "@screen/components/Video";
import VideoMulti from "@screen/components/VideoMulti";
import Carousel from "./Carousel/index.vue"; import Carousel from "./Carousel/index.vue";
import EventPlanDialog from "./eventPlanDialog/index.vue"; import EventPlanDialog from "./eventPlanDialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue"; import Button from "@screen/components/Buttons/Button.vue";
@ -66,6 +69,7 @@ export default {
TimeLine1, TimeLine1,
TimeLine2, TimeLine2,
Video, Video,
VideoMulti,
Carousel, Carousel,
Button, Button,
EventPlanDialog, EventPlanDialog,

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

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

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

@ -162,7 +162,7 @@ export default {
formData.lang = ""; formData.lang = "";
} }
if (this.index == 2 && formData.dcEventTrafficControl.facilityId instanceof Array) { 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.facilityIds = ids
formData.dcEventTrafficControl.facilityId = '' 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'] // 'https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-480p.mp4']
} }
data.videoType = "mp4"; data.videoType = "mp4";
data.component = "Video";
this.detailDialogFormData = data; this.detailDialogFormData = data;
// console.log('data', this.detailDialogFormData) // console.log('data', this.detailDialogFormData)
@ -316,16 +317,12 @@ export default {
data.videoList = []; data.videoList = [];
const { downCamera, upCamera } = ((await getNearCameraNew(data.stakeMark))?.data || {});// data.component = "VideoMulti";
data.downCamId = downCamera?.camId;
data.upCamId = upCamera?.camId; // const { downCamera, upCamera } = ((await getNearCameraNew(data.stakeMark))?.data || {});//
// data.downCamId = downCamera?.camId;
// data.upCamId = upCamera?.camId;
data.videoType = "flv"; 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; 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-option label="智能发布" :value="2"></el-option>
</el-select> </el-select>
</el-col> --> </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-input v-model="tableInfo.hf_content" placeholder="请输入发布内容"></el-input>
</el-col> </el-col>
</el-row> </el-row>
@ -213,10 +213,6 @@ export default {
}, },
{ {
value: 3, value: 3,
label: '事发下游最近'
},
{
value: 4,
label: '最近公里数' label: '最近公里数'
}, },
], ],

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

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

Loading…
Cancel
Save