Compare commits

...

2 Commits

  1. 3
      ruoyi-ui/src/api/board/board.js
  2. 249
      ruoyi-ui/src/views/JiHeExpressway/components/broadcast/BroadcastTplList.vue
  3. 22
      ruoyi-ui/src/views/JiHeExpressway/mixins/broadcast.js
  4. 44
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastReleases.vue
  5. 5
      ruoyi-ui/src/views/JiHeExpressway/pages/service/InformationReleaseManagement/Cards/AuditDetails/index.vue
  6. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/Card.vue
  7. 352
      ruoyi-ui/src/views/JiHeExpressway/pages/service/broadcast/index.vue
  8. 2
      ruoyi-ui/vue.config.js

3
ruoyi-ui/src/api/board/board.js

@ -85,7 +85,8 @@ export function publishToBoard(data) {
]
}
})
});
}

249
ruoyi-ui/src/views/JiHeExpressway/components/broadcast/BroadcastTplList.vue

@ -0,0 +1,249 @@
<template>
<div class="comp_box">
<vuescroll :ops="scrollOptions" class="scroller">
<div v-for="(item, index) in templateAvailable">
<!-- 原来是<el-collapse v-model="activeNames"> -->
<h3>{{ item.dictLabel }}</h3>
<div v-for="(itm, indx) in item.list" :key="indx" class="tplItem" :class="page!='home' ? 'item_sub' : 'item_home'" >
<!-- 模板内容 -->
<BroadcastTplShower class=" boardPreview" :text="itm.content" />
<div class="infoBtnBox">
<el-tooltip content="加入待下发信息" placement="top">
<p @click="____onTplToDevice(itm)" class="btn btnApply">
</p>
</el-tooltip>
<template v-if="page!='home'">
<el-tooltip content="编辑" placement="top">
<p @click="____onEditTemplate(itm)" class="btn btnEdit"></p>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<p @click="____onDeleteTemplate(itm)" class="btn btnDelete"></p>
</el-tooltip>
</template>
</div>
</div>
</div>
</vuescroll>
<broadcastEditor @afterSubmit="____onEditSubmit" :mode="editDialog.mode" :type="editDialog.type"
:visible.sync="editDialog.visible" :tpl="editDialog.tpl"></broadcastEditor>
</div>
</template>
<script>
import { getTemplateList, deleteTemplate } from "@/api/broadcast/template";
import BroadcastTplShower from "@screen/components/broadcast/BroadcastTplShower.vue";
import broadcastEditor from "@screen/components/broadcast/broadcastEditor";
import scrollOptions from "@/common/scrollbar.js";
import vuescroll from "vuescroll";
export default {
name: "BoardPreview",
data() {
return {
tplCategory: [], //
templateAll: [],
templateAvailable: [],
editDialog: {
mode: "",
type: "",
visible: false,
tpl: {},
},
scrollOptions
}
},
components:{
BroadcastTplShower,
broadcastEditor,
vuescroll
},
created(){
Promise.all([
this.____getTemplateCategory(),
this.____getAllTemplate()
]).then((res) => {
this.____sortTemplate();
});
},
props: {
text: {
type: String,
default: "测试文字"
},
page: {
type: String,
default: "channel" //channel: home:
},
},
watch: {
},
computed: {
},
mounted() {
},
methods: {
//
____getTemplateCategory() {
return this.getDicts("iot_template_category").then((res) => {
this.tplCategory = res.data;
});
},
____getAllTemplate() {
return getTemplateList().then((res) => {
this.templateAll = res.rows;
});
},
____sortTemplate() {
this.templateAvailable = [];
this.tplCategory.forEach((item, index) => {
let temp = _.filter(this.templateAll, { category: item.dictValue });
if (temp.length > 0) {
this.templateAvailable.push({
...item,
list: temp,
});
}
});
},
//
____onTplToDevice(item) {
this.$emit("onAddToDevice",item)
},
____onEditTemplate(tpl) {
// type : board template
// mode : edit add
this.editDialog = {
visible: true,
mode: "edit",
type: "template",
tpl,
};
},
/** 删除按钮操作 */
____onDeleteTemplate(item) {
const id = item.id;
let content = "确认删除?";
this.$confirm(content, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
deleteTemplate(id).then(() => {
this.$message.success("删除成功");
this.____refreshData();
});
});
},
____refreshData(){
this.____getAllTemplate().then(this.____sortTemplate);
},
____onEditSubmit(){
this.editDialog.tpl = {};
this.editDialog.visible = false;
this.____refreshData();
}
}
}
</script>
<style lang="scss" scoped>
.comp_box{
.scroller {
.tplItem {
margin-right: 14px;
display: flex;
align-items: stretch;
padding-bottom: 10px;
.boardPreview {
// width: 560px;
// height:80px;
flex: 1;
}
.infoBtnBox {
height: 50px;
display: flex;
justify-content: space-around;
align-items: center;
.btn {
background-repeat: no-repeat;
background-size: 100% 100%;
width: 40px;
height: 40px;
&.btnApply {
background-image: url(~@/assets/jihe/images/button/toLeft.svg);
}
&.btnEdit {
background-image: url(~@/assets/jihe/images/button/edit.svg);
}
&.btnDelete {
background-image: url(~@/assets/jihe/images/button/delete.svg);
}
}
i {
font-size: 24px;
color: #666;
padding-left: 4px;
cursor: pointer;
caret-color: rgba(0, 0, 0, 0);
user-select: none;
}
i:hover {
color: #05afe3;
}
.disabledClass {
pointer-events: none;
cursor: auto !important;
color: #ccc;
}
}
}
.tplItem.item_home {
.boardPreview {
border: none;
}
.infoBtnBox {
width: 60px;
border: none;
background-color: #133242;
}
}
.tplItem.item_sub {
.boardPreview {
border: 2px solid #004c64;
}
.infoBtnBox {
margin-left: 10px;
width: 160px;
border: 2px solid #004c64;
background-color: #133242;
}
}
}
}
</style>

22
ruoyi-ui/src/views/JiHeExpressway/mixins/broadcast.js

@ -18,28 +18,6 @@ export default {
},
};
},
// 从模板新增待下发
____onTplToDevice(item, showDialog) {
// if(this.checkedDeviceIds.length<=0){
// this.$message.warning('未选择设备!');
// return;
// }
if (this.selectedBdMsg.length >= 1){
this.$message({
type: "warning",
message: "只能发布一条语音广播!",
});
return;
}
this.editDialog = {
visible: showDialog == false ? false : true,
mode: "toDevice",
type: "template",
tpl: item,
};
},
// 发布信息
____publishInfo() {
let deviceList = [];

44
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastReleases.vue

@ -1,5 +1,5 @@
<template>
<Dialog v-model="modelVisible" title="广播发布" width="850px">
<Dialog v-model="modelVisible" title="广播发布" width="1230px">
<div class="BroadcastReleases">
<!-- <BroadcastParam v-model="modelVisible" :pileNum="pileNum" :otherConfig="otherConfig" /> -->
<div class="body">
@ -12,12 +12,9 @@
</template>
</CheckboxGroup>
</div>
<div class="right">
<div class="middle">
<div class="top-content">
<Video class="item-video" :pileNum="pileNum" />
<el-form ref="form" :model="dataForm" :rules="dataRule" label-width=" 90px">
<el-form-item label="音量" prop="outVol">
<el-row :gutter="0">
@ -50,9 +47,6 @@
:maxlength="150" showWordLimit placeholder="请输入发布内容" />
</el-form-item>
</el-form>
<!-- <label>发布内容: </label>
<ElInput type="textarea" v-model="dataForm.content" :autosize="{ minRows: 3, maxRows: 3 }" :maxlength="150"
showWordLimit placeholder="请输入发布内容" /> -->
@ -68,6 +62,15 @@
</Button>
</div>
</div>
<div class="broadcast_template">
<!-- <h3 class="title">语音广播模板</h3> -->
<WgtTitle :title="`广播内容模板`" class="title">
<!-- <div class="titleBtnBox">
<el-button class="btnInfoBoard" type="add" @click="____onAddTemplate">添加模板</el-button>
</div> -->
</WgtTitle>
<BroadcastTplList class="list" @onAddToDevice="onAddFromTpl" page="home" />
</div>
</div>
</div>
</Dialog>
@ -84,14 +87,19 @@ import { getDeviceList } from "@screen/pages/Home/components/RoadAndEvents/utils
import { Message } from "element-ui";
import { broadcastPriority } from "@screen/utils/enum.js";
import BroadcastTplList from "@screen/components/broadcast/BroadcastTplList.vue";
import WgtTitle from "@screen/pages/perception/widgets/title";
export default {
name: "BroadcastReleases",
components: {
BroadcastTplList,
Dialog,
Button,
Video,
CheckboxGroup,
BroadcastParam
BroadcastParam,
WgtTitle
},
model: {
prop: "visible",
@ -201,6 +209,14 @@ export default {
this.submitting = false;
});
},
onAddFromTpl(item){
this.dataForm = {
content: item.content,
priority: item.priority,
repeatTimes: +item.repeatTimes,
outVol: +item.outVol
};
}
},
};
</script>
@ -243,7 +259,7 @@ export default {
.state {
width: 18px;
height: 18px;
margin-right: 4px;
margin-middle: 4px;
}
.huiduButton {
@ -273,7 +289,8 @@ export default {
}
}
.right {
.middle {
width: 550px;
display: flex;
flex-direction: column;
justify-content: space-between;
@ -296,6 +313,11 @@ export default {
}
}
}
.broadcast_template{
flex: 1; display: flex; flex-direction: column;
.title{ height: 40px;}
.list{ flex: 1; height: 0}
}
}
.footer {

5
ruoyi-ui/src/views/JiHeExpressway/pages/service/InformationReleaseManagement/Cards/AuditDetails/index.vue

@ -34,8 +34,9 @@ export default {
}).then(res=>{
console.log(id, res)
let list = []
res.data.forEach(e => {
console.log(e,'---')
let temp = res.data;
// let temp = [...res.data, ...res.data, ...res.data];
temp.forEach(e => {
list.push({
source: "1",
onlyright:true,

2
ruoyi-ui/src/views/JiHeExpressway/pages/service/PublishingChannelManagement/components/Card.vue

@ -63,7 +63,7 @@ export default {
this.$parent.handleOpenDialogAddEdit(this.data);
},
handleDelete(item) {
this.$confirm("确定要删除该任务么?", "操作确认", {
this.$confirm("确定要删除么?", "操作确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",

352
ruoyi-ui/src/views/JiHeExpressway/pages/service/broadcast/index.vue

@ -142,49 +142,14 @@
</div>
</div>
<!-- ++++++++++右边部分信息模板++++++++++ -->
<div style="width: 42.2%" class="part partRight">
<!-- <div class="partTitle partDeviceTempateTitle">
<div>
<div style="display: flex;justify-content: start !important;align-items: center;">
<img class="qbbBigDot" src="@/assets/screen/xtb/qbbdot.png" alt="">
<div>信息模板<span v-if="selectedSize">{{ selectedSize }}</span></div>
</div>
<img class="qbbBigDotBa" src="@/assets/screen/xtb/qbba.png" alt="">
</div>
<div class="controlBox">
<el-button class="btnInfoBoard" type="add" @click="____onAddTemplate">添加模板</el-button>
</div>
</div> -->
<WgtTitle :title="`广播内容模板`">
<div style="width: 42.2%;" class="part partRight tpl_box">
<WgtTitle :title="`广播内容模板`" class="tpl_title">
<div class="titleBtnBox">
<el-button class="btnInfoBoard" type="add" @click="____onAddTemplate">添加模板</el-button>
</div>
</WgtTitle>
<div class="partCon">
<vuescroll :ops="scrollOptions" class="templateBox">
<div v-for="(item, index) in templateAvailable">
<!-- 原来是<el-collapse v-model="activeNames"> -->
<h3>{{ item.dictLabel }}</h3>
<div v-for="(itm, indx) in item.list" :key="indx" class="tplItem">
<!-- 模板内容 -->
<BroadcastTplShower class="boardPreview" :text="itm.content" />
<div class="infoBtnBox">
<el-tooltip content="加入待下发信息" placement="top">
<p @click="____onTplToDevice(itm, false)" class="btn btnApply">
</p>
</el-tooltip>
<el-tooltip content="编辑" placement="top">
<p @click="____onEditTemplate(itm)" class="btn btnEdit"></p>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<p @click="____onDeleteTemplate(itm)" class="btn btnDelete"></p>
</el-tooltip>
</div>
</div>
</div>
</vuescroll>
</div>
<BroadcastTplList class="tpl_list" ref="tpl_list" @onAddToDevice="____onAddFromTpl" />
</div>
</div>
<broadcastEditor @afterSubmit="____onEditSubmit" :mode="editDialog.mode" :type="editDialog.type"
@ -197,10 +162,8 @@ import draggable from "vuedraggable";
import Sortable from "sortablejs";
import editInfo from "./editInfo";
import {
getTemplateList,
addTemplate,
addTemplateContent,
deleteTemplate,
} from "@/api/broadcast/template";
import {
getDeviceRealtimeProperty,
@ -221,11 +184,12 @@ import WgtTitle from "@screen/pages/perception/widgets/title";
import broadcast from "@screen/mixins/broadcast";
import { initSearch } from "@screen/utils/enum/common.js"
import BroadcastTplList from "@screen/components/broadcast/BroadcastTplList.vue";
export default {
name: "Device",
mixins: [broadcast],
components: {
BroadcastTplList,
draggable,
WgtTitle,
broadcastEditor,
@ -262,8 +226,6 @@ export default {
devicessizeList: [], //
deviceList: [], //
checkedDeviceIds: [], //
templateAll:[],
templateAvailable: [],
form: {},
supplier: null, //
activeNames: [], //
@ -309,13 +271,10 @@ export default {
},
created() {
Promise.all([
this.____initDirection(),
this.____getTemplateCategory(),
this.____getAllTemplate()
this.____initDirection()
]).then((res) => {
this.____resetForm();
this.____getIotBoard();
this.____sortTemplate();
});
},
mounted() {
@ -331,19 +290,6 @@ export default {
};
},
//
____getTemplateCategory() {
return this.getDicts("iot_template_category").then((res) => {
this.tplCategory = res.data;
});
},
____getAllTemplate() {
return getTemplateList().then((res) => {
this.templateAll = res.rows;
});
},
//
rowDrop() {
if (JSON.parse(JSON.stringify(this.contentList)).length > 0) {
@ -458,16 +404,6 @@ export default {
},
};
},
____onEditTemplate(tpl) {
// type : board template
// mode : edit add
this.editDialog = {
visible: true,
mode: "edit",
type: "template",
tpl,
};
},
____onDragend(evt) {
// console.log(evt, this.selectedBdMsg , "+++=======")
},
@ -482,6 +418,23 @@ export default {
tpl,
};
},
____onAddFromTpl(item){
// if(this.checkedDeviceIds.length<=0){ // this.$message.warning('!'); // return; // }
if(this.selectedBdMsg.length >= 1) {
this.$message({
type: "warning",
message: "只能发布一条语音广播!",
});
return;
}
this.editDialog = {
visible: false,
mode: "toDevice",
type: "template",
tpl: item,
};
},
//
____onEditSubmit(para) {
this.editDialog.tpl = {};
@ -498,18 +451,19 @@ export default {
this.$delete(temp, "id");
this.selectedBdMsg.push(temp);
} else {
this.____refreshPageData(para);
this.____refreshPageData();
}
},
____refreshPageData(para) {
if (para.type == "template") {
____refreshPageData() {
this.$refs["tplList"].____refreshData();
// if (para.type == "template") {
this.____getAllTemplate().then((res) => {
this.____sortTemplate();
});
// this.____getAllTemplate().then((res) => {
// this.____sortTemplate();
// });
} else {
}
// } else {
// }
},
//
@ -537,22 +491,6 @@ export default {
this.showEmit = true;
},
/** 删除按钮操作 */
____onDeleteTemplate(item) {
const id = item.id;
let content = "确认删除?";
this.$confirm(content, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
deleteTemplate(id).then(() => {
this.$message.success("删除成功");
this.____refreshPageData({ type: "template" });
});
});
},
//
____onDeleteBoardItem(index) {
if (index > -1) {
@ -592,22 +530,6 @@ export default {
// this.____forkDeviceInfo(this.selectedDevices);
},
____sortTemplate() {
this.templateAvailable = [];
this.tplCategory.forEach((item, index) => {
let temp = _.filter(this.templateAll, { category: item.dictValue });
if(temp.length>0){
this.templateAvailable.push({
...item,
list: temp,
});
}
});
},
//
async onSubmit(deviceId) {
@ -860,118 +782,132 @@ export default {
}
}
.templateBox {
width: 100%;
height: 100%;
transition: all linear 0.3s;
opacity: 1;
transform: translateX(0);
&.hide {
transform: translateX(20px);
opacity: 0;
transition: all linear 0.3s;
}
.tplItem {
margin-right: 14px;
display: flex;
align-items: stretch;
padding-bottom: 10px;
.boardPreview {
border: 2px solid #004c64;
// width: 560px;
// height:80px;
flex: 1;
}
.infoBtnBox {
width: 160px;
height: 50px;
display: flex;
margin-left: 10px;
/* // border: solid 1px #05afe3; */
border: 2px solid #004c64;
background-color: #133242;
display: flex;
justify-content: space-around;
align-items: center;
.btn {
background-repeat: no-repeat;
background-size: 100% 100%;
width: 40px;
height: 40px;
&.btnApply {
background-image: url(~@/assets/jihe/images/button/toLeft.svg);
}
&.btnEdit {
background-image: url(~@/assets/jihe/images/button/edit.svg);
.templateBox {
width: 100%;
height: 100%;
transition: all linear 0.3s;
opacity: 1;
transform: translateX(0);
&.hide {
transform: translateX(20px);
opacity: 0;
transition: all linear 0.3s;
}
&.btnDelete {
background-image: url(~@/assets/jihe/images/button/delete.svg);
.tplItem {
margin-right: 14px;
display: flex;
align-items: stretch;
padding-bottom: 10px;
.boardPreview {
border: 2px solid #004c64;
// width: 560px;
// height:80px;
flex: 1;
}
.infoBtnBox {
width: 160px;
height: 50px;
display: flex;
margin-left: 10px;
/* // border: solid 1px #05afe3; */
border: 2px solid #004c64;
background-color: #133242;
display: flex;
justify-content: space-around;
align-items: center;
.btn {
background-repeat: no-repeat;
background-size: 100% 100%;
width: 40px;
height: 40px;
&.btnApply {
background-image: url(~@/assets/jihe/images/button/toLeft.svg);
}
&.btnEdit {
background-image: url(~@/assets/jihe/images/button/edit.svg);
}
&.btnDelete {
background-image: url(~@/assets/jihe/images/button/delete.svg);
}
}
i {
font-size: 24px;
color: #666;
padding-left: 4px;
cursor: pointer;
caret-color: rgba(0, 0, 0, 0);
user-select: none;
}
i:hover {
color: #05afe3;
}
.disabledClass {
pointer-events: none;
cursor: auto !important;
color: #ccc;
}
}
}
}
i {
font-size: 24px;
color: #666;
padding-left: 4px;
cursor: pointer;
caret-color: rgba(0, 0, 0, 0);
user-select: none;
}
.tplItem.ghost_class {
i:hover {
color: #05afe3;
}
.boardPreview,
.infoBtnBox {
border-color: #F00;
}
}
.disabledClass {
pointer-events: none;
cursor: auto !important;
color: #ccc;
}
}
}
.tplItem.chosen_class {
.tplItem.ghost_class {
.boardPreview,
.infoBtnBox {
border-color: #0A0;
}
}
.boardPreview,
.infoBtnBox {
border-color: #F00;
}
}
.tplItem.drag_class {
.tplItem.chosen_class {
.boardPreview,
.infoBtnBox {
border-color: #FF0;
}
}
.boardPreview,
.infoBtnBox {
border-color: #0A0;
}
}
.el-collapse {
max-height: 100% !important;
overflow: auto;
border-bottom: none;
border-top: none;
padding: 0 0.5vw;
}
}
}
}
.tplItem.drag_class {
.tpl_box {
display: flex;
flex-direction: column;
.boardPreview,
.infoBtnBox {
border-color: #FF0;
}
}
.tpl_title {
}
.el-collapse {
max-height: 100% !important;
overflow: auto;
border-bottom: none;
border-top: none;
padding: 0 0.5vw;
}
.tpl_list {
flex: 1;
height: 0;
padding-left:10px;
}
}
}
.checkbox {
.boardLabel {}

2
ruoyi-ui/vue.config.js

@ -56,7 +56,7 @@ module.exports = {
// target: `http://10.168.68.42:8087`, //王思祥
// target: `http://10.168.72.174:8087`, //赵祥龙
// target: `http://10.168.65.156:8097`, //孟
// target: `http://10.168.56.165:8087`, //王家宝
// target: `http://10.168.76.181:8089`, //王家宝
// target: `http://10.168.77.128:8087`, //王兴琳
// target: `http://10.168.65.103:8097`,
changeOrigin: true,

Loading…
Cancel
Save