Browse Source

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

wangqin
刘朋 1 year ago
parent
commit
11a56c79fd
  1. BIN
      .DS_Store
  2. 8
      ruoyi-ui/src/api/MonthlyEquipment/index.js
  3. 8
      ruoyi-ui/src/api/board/board.js
  4. 1
      ruoyi-ui/src/common/getBoardBaseData.js
  5. 6
      ruoyi-ui/src/common/infoBoardTestData.js
  6. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/FocusedMonitoring/index.vue
  7. 41
      ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/statisticalAnalysis/index.vue
  8. 117
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardInfoEditor.vue
  9. 71
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardPreview.vue
  10. 117
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardTplPreview.vue
  11. 211
      ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue
  12. 74
      ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js
  13. 6
      ruoyi-ui/vue.config.js

BIN
.DS_Store

Binary file not shown.

8
ruoyi-ui/src/api/MonthlyEquipment/index.js

@ -43,9 +43,7 @@ export function getSystemStatusList(query) {
//设备状态列表按类型 //设备状态列表按类型
export function getSystemStatusExport(query) { export function getSystemStatusExport(query) {
//system/status/export //system/status/export
return download('/system/status/export',query,"file.xlsx"); //return download('/system/status/export',query,"file.xlsx");
// return request.post('/system/status/export',{ return request.post('/system/status/export?startTime='+query.startTime+"&time="+ query.time +"&type="+query.type,{},{ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
// ...query responseType: 'blob'})
// },{ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
// responseType: 'blob'})
} }

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

@ -10,4 +10,12 @@ export function getBoardList(query) {
deviceType:2 deviceType:2
} }
}) })
}
// 查询设备列表
export function getBoardDeviceInfo(deviceId) {
return request({
url: `/business/board/realtimeProperty/${deviceId}`,
method: 'get'
})
} }

1
ruoyi-ui/src/common/getBoardBaseData.js

@ -8,7 +8,6 @@ export default function(){
}); });
Vue.prototype.fontTypeDic = dic; Vue.prototype.fontTypeDic = dic;
Vue.prototype.fontTypeList = res.data; Vue.prototype.fontTypeList = res.data;
console.log(dic , "++==================");
// console.log(fontTypeList, "字体类型"); // console.log(fontTypeList, "字体类型");
}) })
getDicts('iot_devices_font_color').then(res => { getDicts('iot_devices_font_color').then(res => {

6
ruoyi-ui/src/common/infoBoardTestData.js

@ -37,7 +37,7 @@ export default [
"flashingFrequency": "5", //闪烁次数 "flashingFrequency": "5", //闪烁次数
"flickerSpeed": "0", //闪烁速度 "flickerSpeed": "0", //闪烁速度
"font": "微软雅黑", "font": "微软雅黑",
"fontSize": "14", "fontSize": "40",
"fontSpacing": "4", "fontSpacing": "4",
"fontStyle": "0", "fontStyle": "0",
"foregroundColor": "ffff00", "foregroundColor": "ffff00",
@ -64,8 +64,8 @@ export default [
}, },
{ {
"backgroundColor": "00000000", "backgroundColor": "00000000",
"displayAreaHeight": "180", "displayAreaHeight": "120",
"displayAreaWidth": "700", "displayAreaWidth": "768",
"flashingFrequency": "5", "flashingFrequency": "5",
"flickerSpeed": "0", "flickerSpeed": "0",
"font": "微软雅黑", "font": "微软雅黑",

4
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/FocusedMonitoring/index.vue

@ -13,10 +13,10 @@
<div>当前在途车辆</div> <div>当前在途车辆</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item">
<div> <p>
<span class="abnormal">0</span> <span class="abnormal">0</span>
<span>/0</span> <span>/0</span>
</div> </p>
<div>交通事件</div> <div>交通事件</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item">

41
ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/statisticalAnalysis/index.vue

@ -455,28 +455,25 @@ import * as echarts from "echarts";
}, },
// //
SystemStatusExport(){ SystemStatusExport(){
download(
"/fault/list/exportFaultReport", getSystemStatusExport({
{ faultId: row.id }, startTime:this.startTime,
"file.xlsx"); time:this.time,
// getSystemStatusExport({ type:this.typeQuery,
// startTime:this.startTime, }).then((res)=>{
// time:this.time, console.log(res);
// type:this.typeQuery, const url = window.URL.createObjectURL(new Blob([res]))
// }).then((res)=>{ let link = document.createElement('a')
// console.log(res); link.style.display = 'none'
// const url = window.URL.createObjectURL(new Blob([res])) link.href = url
// let link = document.createElement('a') link.setAttribute('download', '设备统计信息.xlsx')
// link.style.display = 'none' document.body.appendChild(link)
// link.href = url link.click()
// link.setAttribute('download', '.xlsx') URL.revokeObjectURL(link.href) // URL
// document.body.appendChild(link) document.body.removeChild(link)
// link.click() link = null
// URL.revokeObjectURL(link.href) // URL
// document.body.removeChild(link) })
// link = null
// })
}, },
queryChartList(){ queryChartList(){

117
ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardInfoEditor.vue

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :title="mode=='add'?'新增':'编辑'" :visible.sync="dialogVisible" width="43%" append-to-body :close-on-click-modal="false"> <el-dialog :title="mode=='add'?'新增':'编辑'" :visible.sync="dialogVisible" width="800px" append-to-body :close-on-click-modal="false">
<!-- <div style="color:#fff"> <!-- <div style="color:#fff">
<p>类型:{{type}} 增删改类型:{{mode}}</p> <p>类型:{{type}} 增删改类型:{{mode}}</p>
<p>模板id:{{ tpl }}</p> <p>模板id:{{ tpl }}</p>
@ -9,7 +9,7 @@
<div class="dialogCloseButton"></div> <div class="dialogCloseButton"></div>
</div> </div>
<el-card> <el-card>
<BoardPreview style="height: 200px; width: 100%;" :boardWH="screenSize" :tpl="dataForm"></BoardPreview> <BoardTplPreview style="height: 200px; width: 100%;" :boardWH="screenSize" :tpl="dataForm"></BoardTplPreview>
</el-card> </el-card>
<el-card> <el-card>
<el-form :model="dataForm" :rules="dataRule" label-width="110px" ref="dataForm" size="mini"> <el-form :model="dataForm" :rules="dataRule" label-width="110px" ref="dataForm" size="mini">
@ -23,11 +23,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col class="infoBoardButton" :span="16"> <el-col class="infoBoardButton" :span="16">
<el-radio-group v-model="dataForm.formatStyle"> <el-form-item label="对齐方式">
<el-radio-button label="0">左对齐</el-radio-button> <el-radio-group v-model="dataForm.formatStyle">
<el-radio-button label="2">中间对齐</el-radio-button> <el-radio-button label="0">左对齐</el-radio-button>
<el-radio-button label="1">右对齐</el-radio-button> <el-radio-button label="2">中间对齐</el-radio-button>
</el-radio-group> <el-radio-button label="1">右对齐</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -89,7 +91,7 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dataFormSubmitHandle" v-loading="loading" style="background-color: #10aac2;color:#fff;">确认</el-button> <el-button @click="dataFormSubmitHandle" v-loading="loading" style="background-color: #10aac2;color:#fff;">确认</el-button>
<el-button class="closeButton" style="background-color:#b5b5b6;color:#fff" @click="onClose">取消</el-button> <el-button style="background-color:#b5b5b6;color:#fff" @click="onClose">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@ -98,8 +100,8 @@ import { getTemplateList, addTemplate, addTemplateContent, editTemplateContent,
import { devicessize } from '@/api/information/api.js' import { devicessize } from '@/api/information/api.js'
import { checkIotBoardContent } from '@/api/board/vocabulary' import { checkIotBoardContent } from '@/api/board/vocabulary'
import BoardPreview from "./BoardPreview.vue" import BoardPreview from "./BoardPreview.vue"
import BoardTplPreview from "./BoardTplPreview.vue"
import infoBoardUtils from "@screen/utils/infoBoard.js" import infoBoardUtils from "@screen/utils/infoBoard.js"
import { after } from 'lodash'
export default { export default {
data() { data() {
return { return {
@ -215,15 +217,9 @@ export default {
} }
}, },
components:{ components:{
BoardPreview BoardPreview, BoardTplPreview
}, },
computed: { computed: {
divStyle: function () {
return {
width: this.width + 'px',
height: this.height + 'px'
}
}
}, },
watch: { watch: {
visible:{ visible:{
@ -235,11 +231,14 @@ export default {
dialogVisible(newV){ dialogVisible(newV){
this.$emit("update:visible", newV); this.$emit("update:visible", newV);
}, },
"tpl.id":{ tpl:{
handler(newV){ handler(newV){
// { "id": 3, "category": "0", "content": "", "screenSize": "768*64", "fontColor": "FFFF00", "fontSize": "64", "fontType": "2", "fontSpacing": "0", "rollingSpeed": null, "stopTime": "50", "inScreenMode": "1", "formatStyle": "2", "remark": null, "createTime": "2024-01-06 10:40:19", "updateTime": "2024-01-06 11:04:53" } // { "id": 3, "category": "0", "content": "", "screenSize": "768*64", "fontColor": "FFFF00", "fontSize": "64", "fontType": "2", "fontSpacing": "0", "rollingSpeed": null, "stopTime": "50", "inScreenMode": "1", "formatStyle": "2", "remark": null, "createTime": "2024-01-06 10:40:19", "updateTime": "2024-01-06 11:04:53" }
if(newV && Object.keys(newV).length>0){
this.initData(); this.initData();
} }
},
deep:true
}, },
"mode": { "mode": {
handler(newV) { handler(newV) {
@ -275,21 +274,59 @@ export default {
// getTemplateList({id:this.tpl.id}).then(res=>{ // getTemplateList({id:this.tpl.id}).then(res=>{
// console.log(res.data , "++++++++==========="); // console.log(res.data , "++++++++===========");
// }) // })
if (this.mode == "edit") { if(this.mode=="add"){
this.dataForm = infoBoardUtils.sourceFormat(this.tpl, this.type); let tplDefault= null;
}else{ if(this.type=="template"){
this.dataForm = { tplDefault = {
category : this.templateCategoryList[0].dictValue, category: this.templateCategoryList[0].dictValue,
formatStyle : 0, formatStyle: 0,
content : "请输入文字内容", content: "",
fontColor : this.colorList[0].dictValue, fontColor: this.colorList[0].dictValue,
fontSize : this.fontSizeList[0].dictValue, fontSize: this.fontSizeList[0].dictValue,
fontFamily : this.fontTypeList[0].dictValue, fontFamily: this.fontTypeList[0].dictValue,
stopTime : 5, stopTime: 5,
inScreenMode : this.inScreenModeList[0].dictValue, inScreenMode: this.inScreenModeList[0].dictValue,
screenSize : this.screenSize screenSize: this.screenSize
}
}
else{
tplDefault = {
"residenceTime": "50",
"intonation": "0",
"fontSpacing": "1",
"screenEntryMethod": "1",
"screenOutputMethod": "1",
"lineSpacing": "0",
"yCoordinate": "0",
"whetherToSynchronizePlayback": "0",
"whetherToPlayText": "0",
"playbackCount": "1",
"flashingFrequency": "5",
"backgroundColor": "8",
"foregroundColor": "FFFF00",
"textContent": "",
"fontStyle": "0",
"displayAreaWidth": "768",
"playbackDuration": "50",
"displayAreaHeight": "64",
"volume": "0",
"xCoordinate": "0",
"screenEntrySpeed": "1",
"horizontalAlignment": "2",
"playSpecialEffects": "0",
"setUpTheSpeaker": "0",
"flickerSpeed": "0",
"specialEffectsSpeed": "1",
"fontSize": "64",
"verticalAlignment": "2",
"speechSpeed": "0",
"font": "3"
}
}
this.dataForm = infoBoardUtils.dialogSourceFormat(tplDefault, this.type);
}else{
this.dataForm = infoBoardUtils.dialogSourceFormat(this.tpl, this.type);
} }
}
}, },
onClose(){ onClose(){
this.dialogVisible = false; this.dialogVisible = false;
@ -387,7 +424,7 @@ export default {
} }
})*/ })*/
let data = infoBoardUtils.saveFormat(this.dataForm, this.type); let data = infoBoardUtils.dialogSaveFormat(this.dataForm, this.type);
this.loading = true this.loading = true
// let templateId = ""; // let templateId = "";
@ -402,12 +439,16 @@ export default {
afterSave("新增"); afterSave("新增");
}); });
} }
}else{
this.loading = false
// this.dialogVisible = false
this.$emit("afterSubmit", { type: this.type, mode: this.mode, data:data });
} }
const afterSave = (para)=>{ const afterSave = (para)=>{
this.$message.success(para + '成功!') this.$message.success(para + '成功!')
this.loading = false this.loading = false
this.dialogVisible = false // this.dialogVisible = false
this.$emit("afterSubmit" , {type:this.type, mode:this.mode}); this.$emit("afterSubmit" , {type:this.type, mode:this.mode});
} }
@ -418,10 +459,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.infoBoardButton { .infoBoardButton {
::v-deep .el-radio-button--medium .el-radio-button__inner { ::v-deep .el-radio-button--medium .el-radio-button__inner {
height: 3vh; // height: 3vh;
line-height: 3vh; // line-height: 3vh;
padding: 0 0.6vw; // padding: 0 0.6vw;
font-size: 0.7vw; // font-size: 0.7vw;
} }
} }
.previewContentCSS { .previewContentCSS {

71
ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardPreview.vue

@ -26,21 +26,36 @@ export default {
}, },
tpl: { tpl: {
// { // {
// "id": 3, // "backgroundColor": "00000000",
// "category": "0", // "displayAreaHeight": "120",
// "content": "", // "displayAreaWidth": "768",
// "screenSize": "768*64", // "flashingFrequency": "5", //
// "fontColor": "FFFF00", // "flickerSpeed": "0", //
// "fontSize": "64", // "font": "",
// "fontType": "2", // "fontSize": "14",
// "fontSpacing": "0", // "fontSpacing": "4",
// "rollingSpeed": null, // "fontStyle": "0",
// "stopTime": "50", // "foregroundColor": "ffff00",
// "inScreenMode": "1", // "horizontalAlignment": "2",
// "formatStyle": "2", // "intonation": "0",
// "remark": null, // "lineSpacing": "0",
// "createTime": "2024-01-06 10:40:19", // "playSpecialEffects": "0",
// "updateTime": "2024-01-06 11:04:53" // "playbackCount": "1",
// "playbackDuration": "50",
// "residenceTime": "18", //
// "screenEntryMethod": "1", //
// "screenEntrySpeed": "1", //
// "screenOutputMethod": "1", //
// "setUpTheSpeaker": "0",
// "specialEffectsSpeed": "1",
// "speechSpeed": "0",
// "textContent": "100km/h",
// "verticalAlignment": "2",
// "volume": "0",
// "whetherToPlayText": "0",
// "whetherToSynchronizePlayback": "0",
// "xCoordinate": "0",
// "yCoordinate": "0"
// } // }
type: Object, type: Object,
@ -56,7 +71,7 @@ export default {
}, },
tpl:{ tpl:{
handler(newV){ handler(newV){
this.contentArr = this.tpl.content.replace(/\n|\r\n/g, '&&&&&').replace(/ /g, '&nbsp').split('&&&&&'); this.contentArr = this.tpl.textContent.replace(/\n|\r\n/g, '&&&&&').replace(/ /g, '&nbsp').split('&&&&&');
this.setStyle(); this.setStyle();
}, },
deep:true, deep:true,
@ -72,22 +87,26 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
let boxW = this.$refs["compBox"].offsetWidth; let boxW = this.$refs["compBox"].offsetWidth;
let boxH = this.$refs["compBox"].offsetHeight; let boxH = this.$refs["compBox"].offsetHeight;
let arr = this.boardWH.split("*"); let conW = this.tpl.displayAreaWidth;
let conH = this.tpl.displayAreaHeight;
let scale = 1; let scale = 1;
if (arr[0] / arr[1] > boxW / boxH) { if (conW / conH > boxW / boxH) {
scale = boxW / arr[0]; scale = boxW / conW;
} else { } else {
scale = boxH / arr[1]; scale = boxH / conH;
} }
this.boardStyle = { this.boardStyle = {
width: `${arr[0] * scale}px`, width: `${conW * scale}px`,
height: `${arr[1] * scale}px`, height: `${conH * scale}px`,
"align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.formatStyle] "background-color":`${this.tpl.backgroundColor}px`,
"align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.horizontalAlignment]
} }
let fontSize = +this.tpl.fontSize.replace("px", "");
fontSize = fontSize * scale;
this.boardTxtStyle = { this.boardTxtStyle = {
"color": "#" + this.tpl.fontColor, "color": "#" + this.tpl.foregroundColor,
"font-size": `${this.tpl.fontSize.replace('px','')*scale}px`, "font-size": `${fontSize}px`,
"font-family": this.fontTypeDic[this.tpl.fontType], "font-family": this.tpl.font,
"min-height": `${this.tpl.fontSize.replace('px', '') * scale}px` "min-height": `${this.tpl.fontSize.replace('px', '') * scale}px`
} }
}) })

117
ruoyi-ui/src/views/JiHeExpressway/pages/service/board/BoardTplPreview.vue

@ -0,0 +1,117 @@
<template>
<div class="boardPreview" ref="compBox">
<div class="boardBox" :style="boardStyle">
<p class="boardTxt" v-for="item,index in contentArr" :key="index" :style="boardTxtStyle" v-html="item">
</p>
</div>
</div>
</template>
<script>
export default {
name:"BoardPreview",
data(){
return {
boardStyle:null,
boardTxtStyle:null,
contentArr:{
type:Array,
default:()=>[]
}
}
},
props:{
boardWH: {
type: String,
default: "300*200"
},
tpl: {
// {
// "id": 3,
// "category": "0",
// "content": "",
// "screenSize": "768*64",
// "fontColor": "FFFF00",
// "fontSize": "64",
// "fontType": "2",
// "fontSpacing": "0",
// "rollingSpeed": null,
// "stopTime": "50",
// "inScreenMode": "1",
// "formatStyle": "2",
// "remark": null,
// "createTime": "2024-01-06 10:40:19",
// "updateTime": "2024-01-06 11:04:53"
// }
type: Object,
default: {}
},
},
watch:{
boardWH:{
handler(newV){
this.setStyle();
},
immediate:true
},
tpl:{
handler(newV){
this.contentArr = this.tpl.content.replace(/\n|\r\n/g, '&&&&&').replace(/ /g, '&nbsp').split('&&&&&');
this.setStyle();
},
deep:true,
immediate:true
}
},
computed:{
},
mounted(){
},
methods:{
setStyle() {
this.$nextTick(() => {
let boxW = this.$refs["compBox"].offsetWidth;
let boxH = this.$refs["compBox"].offsetHeight;
let arr = this.boardWH.split("*");
let scale = 1;
if (arr[0] / arr[1] > boxW / boxH) {
scale = boxW / arr[0];
} else {
scale = boxH / arr[1];
}
this.boardStyle = {
width: `${arr[0] * scale}px`,
height: `${arr[1] * scale}px`,
"align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.formatStyle]
}
this.boardTxtStyle = {
"color": "#" + this.tpl.fontColor,
"font-size": `${this.tpl.fontSize.replace('px','')*scale}px`,
"font-family": this.fontTypeDic[this.tpl.fontType],
"min-height": `${this.tpl.fontSize.replace('px', '') * scale}px`
}
})
}
}
}
</script>
<style lang="scss" scoped>
.boardPreview{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
.boardBox {
background-color: #000;
display: flex;
overflow: hidden;
flex-direction: column;
justify-content: flex-start;
.boardTxt{
color: #f00;
line-height: 1;
margin-bottom: 0;
}
}
}
</style>

211
ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue

@ -1,6 +1,7 @@
<template> <template>
<div class="infoBoardBox"> <div class="infoBoardBox">
<div class="infoBoardCon"> <div class="infoBoardCon">
<!-- ++++++++++设备列表++++++++++ -->
<div style="width: 20%" class="part partLeft"> <div style="width: 20%" class="part partLeft">
<div class="partTitle boardListTitle"> <div class="partTitle boardListTitle">
<img class="qbbBigDot" src="@/assets/screen/xtb/qbbdot.png" alt=""> <img class="qbbBigDot" src="@/assets/screen/xtb/qbbdot.png" alt="">
@ -22,9 +23,8 @@
<div v-if="item.list.length > 0"> <div v-if="item.list.length > 0">
<!-- <el-checkbox style="width: 100%" :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选 <!-- <el-checkbox style="width: 100%" :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
</el-checkbox> --> </el-checkbox> -->
<el-checkbox-group class="checkbox" v-model="checkedCities" @change="handleCheckedCitiesChange" <el-checkbox-group class="checkbox" v-model="checkedCities" @change="onSelectDevice" :max="1">
:max="1"> <el-checkbox v-for="(itm, index) in item.list" :label="itm.iotDeviceId" :key="index">
<el-checkbox v-for="(itm, index) in item.list" :label="itm.id" :key="index">
<el-tooltip :content="itm.ip" placement="top"> <el-tooltip :content="itm.ip" placement="top">
<div>{{ itm.deviceName }}</div> <div>{{ itm.deviceName }}</div>
</el-tooltip> </el-tooltip>
@ -41,6 +41,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<!-- ++++++++++中间部分单个设备++++++++++ -->
<div style="width: 37.8%" class="part partMiddle"> <div style="width: 37.8%" class="part partMiddle">
<div class="partTitle partDeviceTempateTitle"> <div class="partTitle partDeviceTempateTitle">
@ -54,65 +55,30 @@
</div> </div>
<div class="controlBox"> <div class="controlBox">
<el-button type="primary" @click.native="openDialogVisible(1, 2)">添加信息</el-button> <el-button type="primary" @click.native="____onAddDeviceItem()">添加信息</el-button>
<el-button type="primary" @click="publishInfo" :disabled="contentList.length == 0">发布信息</el-button> <el-button type="primary" @click="publishInfo" :disabled="contentList.length == 0">发布信息</el-button>
</div> </div>
</div> </div>
<div class="partCon"> <div class="partCon">
<el-table :data="contentList" row-key="ID" v-loading="loading" <!-- {{ selectedBdMsg }} -->
style="height: 100%;padding: 0 1vh; background-color: #112d3b;overflow-y: scroll;" :key="toggleIndex"> <vuescroll :ops="scrollOptions" class="templateBox">
<el-table-column width="545"> <div v-for="(itm, indx) in selectedBdMsg" :key="indx" class="tplItem">
<template slot-scope="scope"> <!-- 模板内容 -->
<div class="con"> <BoardPreview class="boardPreview" :boardWH="selectedSize" :tpl="itm"></BoardPreview>
<div style="background: black; position: relative" :style="{ <!-- 操作按钮 -->
color: getColorStyle(scope.row.COLOR), <div class="infoBtnBox">
fontSize: getFontSize(scope.row.FONT_SIZE), <el-tooltip content="编辑" placement="top">
fontFamily: scope.row.FONT, <p @click="____onEditBoardItem(itm, indx)" class="btn btnEdit"></p>
width: getScreenSize(form.selectedPixel, 'width') + 'px', </el-tooltip>
height: getScreenSize(form.selectedPixel, 'height') + 'px', <el-tooltip content="删除" placement="top">
'lineHeight': '1', <p @click="____onDeleteBoardItem(indx)" class="btn btnDelete"></p>
'display': 'flex', </el-tooltip>
'align-items': 'center', </div>
'justify-content': getTextAlign(scope.row.formatStyle), </div>
}"> </vuescroll>
<span :style="{
/*left: getCoordinate(
scope.row.COORDINATE.substring(0, 3),
'left'
),
top: getCoordinate(
scope.row.COORDINATE.substring(3, 6),
'top'
),*/
position: 'relative',
maxHeight: getScreenSize(form.selectedPixel, 'height') + 'px',
}" class="infoTxt"
v-html="scope.row.CONTENT ? scope.row.CONTENT.replace(/\n|\r\n/g, '<br>').replace(/ /g, '&nb sp'): ''"></span>
</div>
</div>
</template>
</el-table-column>
<el-table-column width="130">
<template slot-scope="scope">
<div class="infoBtnBox">
<!-- <el-tooltip content="加入信息模板" placement="top">
<div @click="arrowRight(scope.row)"></div>
</el-tooltip> -->
<el-tooltip content="编辑" placement="top">
<div @click="openQbbDrawer(scope.row, scope.$index, 1)" class="edit"></div>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<div @click="delQbbDrawer(scope.$index)" class="del"></div>
</el-tooltip>
</div>
</template>
</el-table-column>
</el-table>
</div> </div>
</div> </div>
<!-- 信息模板 --> <!-- ++++++++++右边部分信息模板++++++++++ -->
<div style=" width: 42.2%" class="part partRight"> <div style=" width: 42.2%" class="part partRight">
<div class="partTitle partDeviceTempateTitle"> <div class="partTitle partDeviceTempateTitle">
<div> <div>
@ -135,7 +101,7 @@
<h3>{{ item.dictLabel }}</h3> <h3>{{ item.dictLabel }}</h3>
<div v-for="(itm, indx) in item.list" :key="indx" class="tplItem"> <div v-for="(itm, indx) in item.list" :key="indx" class="tplItem">
<!-- 模板内容 --> <!-- 模板内容 -->
<BoardPreview class="boardPreview" :boardWH="selectedSize" :tpl="itm"></BoardPreview> <BoardTplPreview class="boardPreview" :boardWH="selectedSize" :tpl="itm"></BoardTplPreview>
<!-- <div class="infoPreview"> <!-- <div class="infoPreview">
<div class="infoBox" :style="____boardBgStyle"> <div class="infoBox" :style="____boardBgStyle">
<span class="infoTxt" :style="____boardTxtStyle(itm)" v-html="itm.content.replace(/\n|\r\n/g, '<br>').replace(/ /g, '&nbsp')"></span> <span class="infoTxt" :style="____boardTxtStyle(itm)" v-html="itm.content.replace(/\n|\r\n/g, '<br>').replace(/ /g, '&nbsp')"></span>
@ -189,13 +155,16 @@ import { getUserDeptId } from '@/api/system/user'
import { listTunnels, devicessize, information, getBoardInfo, getBoardEditInfo, getboardSizeDic, getBoardContentData, deviceControl } from '@/api/information/api.js' import { listTunnels, devicessize, information, getBoardInfo, getBoardEditInfo, getboardSizeDic, getBoardContentData, deviceControl } from '@/api/information/api.js'
import { uploadBoardEditInfo, getAllVmsTemplate, addTemplate, addTemplateContent, getBoardContent, deleteTemplate, splicingBoard } from '@/api/board/template' import { uploadBoardEditInfo, getAllVmsTemplate, addTemplate, addTemplateContent, getBoardContent, deleteTemplate, splicingBoard } from '@/api/board/template'
import { invokedFunction, getDeviceRealtimeProperty } from '@/api/device/device' import { invokedFunction, getDeviceRealtimeProperty } from '@/api/device/device'
import { getBoardList } from '@/api/board/board' import { getBoardList, getBoardDeviceInfo } from '@/api/board/board'
import { getTemplateList } from '@/api/board/template' import { getTemplateList } from '@/api/board/template'
import BoardPreview from './BoardPreview' import BoardPreview from './BoardPreview'
import BoardTplPreview from './BoardTplPreview'
import vuescroll from 'vuescroll' import vuescroll from 'vuescroll'
import scrollOptions from '@/common/scrollbar.js' import scrollOptions from '@/common/scrollbar.js'
import infoBoardUtils from "@screen/utils/infoBoard.js"
// //
export const deepClone = data => { export const deepClone = data => {
// //
@ -227,6 +196,7 @@ export default {
BoardInfoEditor, BoardInfoEditor,
editInfo, editInfo,
BoardPreview, BoardPreview,
BoardTplPreview,
vuescroll vuescroll
}, },
dicts: ['iot_board_direction'], dicts: ['iot_board_direction'],
@ -281,7 +251,8 @@ export default {
visible: false, visible: false,
tpl: {} tpl: {}
}, },
scrollOptions scrollOptions,
boardItemEdtingIndex: -1
} }
}, },
watch: { watch: {
@ -290,6 +261,11 @@ export default {
this.rowDrop() this.rowDrop()
}) })
}, },
"editDialog.visible": function (newV) {
if (!newV) {
this.editDialog.tpl = null
}
}
// boardSizeDic: function (newVal, oldVal) { // boardSizeDic: function (newVal, oldVal) {
// console.log(newVal, 'selectedSize') // console.log(newVal, 'selectedSize')
// if (newVal.length == 0) { // if (newVal.length == 0) {
@ -412,6 +388,7 @@ export default {
} }
if (!this.selectedDevice.deviceName) { if (!this.selectedDevice.deviceName) {
this.selectedDevice = item; this.selectedDevice = item;
this.selectedDeviceId = item.iotDeviceId;
this.____getBoardMessage(); this.____getBoardMessage();
} }
}) })
@ -421,8 +398,23 @@ export default {
}, },
____getBoardMessage() { ____getBoardMessage() {
if (process.env.NODE_ENV == 'development') {
// import("@/common/infoBoardTestData.js").then(res=>{
// this.selectedBdMsg = res.default.data["3A"].content;
// })
}
if (!this.selectedDeviceId) {
return;
}
getBoardDeviceInfo(this.selectedDeviceId).then(res => {
this.selectedBdMsg = res.data["3A"].content;
console.log(this.selectedBdMsg);
}).catch(err => {
})
// //
this.selectedBdMsg = [];
}, },
____onAddTemplate() { ____onAddTemplate() {
this.editDialog = { this.editDialog = {
@ -432,6 +424,8 @@ export default {
} }
}, },
____onEditTemplate(tpl) { ____onEditTemplate(tpl) {
// type : board template
// mode : edit add
this.editDialog = { this.editDialog = {
visible: true, visible: true,
mode: "edit", mode: "edit",
@ -439,7 +433,37 @@ export default {
tpl tpl
} }
}, },
____onEditBoardItem(tpl, index) {
// type : board template
// mode : edit add
this.boardItemEdtingIndex = index;
this.editDialog = {
visible: true,
mode: "edit",
type: "device",
tpl
}
},
____onAddDeviceItem() {
this.editDialog = {
visible: true,
mode: "add",
type: "device",
tpl: {
"textContent": ""
}
}
},
____onEditSubmit(para) { ____onEditSubmit(para) {
this.editDialog.tpl = {};
this.editDialog.visible = false;
if (para.type == "device") {
if (para.mode == "edit") {
this.selectedBdMsg[this.boardItemEdtingIndex] = para.data;
} else {
this.selectedBdMsg.push(para.data);
}
}
this.____refreshPageData(para); this.____refreshPageData(para);
}, },
____refreshPageData(para) { ____refreshPageData(para) {
@ -577,10 +601,10 @@ export default {
}, },
// //
delQbbDrawer(index) { ____onDeleteBoardItem(index) {
if (index > -1) { if (index > -1) {
this.contentList.splice(index, 1) this.selectedBdMsg.splice(index, 1)
this.$message.success('删除成功') this.$message.success('删除成功,发布后才能生效。')
} }
}, },
@ -687,8 +711,12 @@ export default {
}, },
// //
handleCheckedCitiesChange(value) { onSelectDevice(value) {
console.log(value, 'value') this.selectedDeviceId = value[0];
this.selctedDevice = _.find(this.boardSizeDic[this.selectedSize].list, { iotDeviceId: value[0] });
// this.selectedDevice = this.deviceList
this.____getBoardMessage();
this.checkedCities = value this.checkedCities = value
let val = JSON.parse(JSON.stringify(value)) let val = JSON.parse(JSON.stringify(value))
for (let itm of this.deviceList) { for (let itm of this.deviceList) {
@ -861,18 +889,6 @@ export default {
return value return value
}, },
//
openQbbDrawer(item, index, type) {
this.index_ = index
console.log(item)
this.boardEmitItem = item
this.boardEmitItem.screenSize = this.form.selectedPixel
this.boardEmitItem.deviceId = this.deviceId
this.boardEmitItem.type = type
this.showEmit = true
},
// //
getColorStyle(font) { getColorStyle(font) {
if (font == '黄色' || font == 'yellow' || font == '4') { if (font == '黄色' || font == 'yellow' || font == '4') {
@ -901,43 +917,6 @@ export default {
} }
}, },
//
getFontSize(font, screenSize) {
if (!font) {
return
}
let width = ''
let height = ''
if (!screenSize) {
width = this.form.selectedPixel.split('*')[0]
height = this.form.selectedPixel.split('*')[1]
} else {
width = screenSize.split('*')[0]
height = screenSize.split('*')[1]
}
if (width <= 450 && height <= 75) {
if (font.toString().length == 2) {
return font + 'px'
} else {
return font.substring(0, 2) + 'px'
}
} else {
if (width / 450 > height / 75) {
if (font.toString().length == 2) {
return font / (width / 450) + 'px'
} else {
return font.substring(0, 2) / (width / 450) + 'px'
}
} else {
if (font.toString().length == 2) {
return font / (height / 75) + 'px'
} else {
return font.substring(0, 2) / (height / 75) + 'px'
}
}
}
},
// //
getCoordinate(coordinate, type, screenSize) { getCoordinate(coordinate, type, screenSize) {
let width = '' let width = ''
@ -1119,7 +1098,7 @@ export default {
margin-right: 14px; margin-right: 14px;
display: flex; display: flex;
align-items: stretch; align-items: stretch;
margin-bottom: 10px; padding-bottom: 10px;
.boardPreview { .boardPreview {
border: 2px solid #004c64; border: 2px solid #004c64;
@ -1132,9 +1111,7 @@ export default {
width: 160px; width: 160px;
height: 80px; height: 80px;
display: flex; display: flex;
float: right;
margin-left: 10px; margin-left: 10px;
padding: 0 0.2vw;
/* // border: solid 1px #05afe3; */ /* // border: solid 1px #05afe3; */
border: 2px solid #004c64; border: 2px solid #004c64;
display: flex; display: flex;

74
ruoyi-ui/src/views/JiHeExpressway/utils/infoBoard.js

@ -1,23 +1,73 @@
import Vue from 'vue';
export default { export default {
sourceFormat(data, type){ deviceFontToEdit(font){
let data1 = _.cloneDeep(data); //字体转换
data1.stopTime = data1.stopTime*0.1 // ["SimSun", "KaiTi", "SimHei", "FangSong", "LiSu"]
// let idx = 0;
// const arr = ["宋体", "楷体", ["黑体","微软雅黑"], "仿宋", "隶书"];
// arr.forEach((item,index)=>{
// if(item.includes(font)){
// idx = index;
// return
// }
// });
// return idx+'';
let fontTypeList = Vue.prototype.fontTypeList;
fontTypeList.forEach(item => {
// if(item.)
});
return "SimHei"
},
editFontToDevice(){
let fontTypeList = Vue.prototype.fontTypeList;
fontTypeList.forEach(item => {
// if(item.)
});
return "黑体"
},
dialogSourceFormat(data, type){
let data1
if(type=='template'){ if(type=='template'){
data1 = _.cloneDeep(data);
} else { data1.stopTime = data1.stopTime*0.1
}
else{
data1 = {
formatStyle: data.horizontalAlignment,
content: data.textContent,
fontColor: data.foregroundColor.toUpperCase(),
fontSize: data.fontSize.replace("px",""),
// fontFamily: this.deviceFontToEdit(data.font),
fontFamily: data.font,
stopTime: data.residenceTime,
inScreenMode: data.screenEntryMethod,
origin: data
}
} }
return data1 return data1
}, },
saveFormat(data, type) { dialogSaveFormat(data, type) {
let data1 = _.cloneDeep(data); let data1;
data1.stopTime = data1.stopTime * 10 + "";
if (type == 'template') { if (type == 'template') {
data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime * 10 + "";
} else { } else {
let temp = {
horizontalAlignment : data.formatStyle,
textContent : data.content,
foregroundColor: data.fontColor.toLowerCase(),
fontSize: data.fontSize,
font: data.fontFamily,
residenceTime : data.stopTime,
screenEntryMethod : data.inScreenMode
}
data1 = _.merge(data.origin, temp);
} }
return data1; return data1;
},
templateToDevice(data) {
return {
}
} }
} }

6
ruoyi-ui/vue.config.js

@ -41,12 +41,10 @@ module.exports = {
// target: `http://192.168.0.194:8080`, // target: `http://192.168.0.194:8080`,
// target: `http://10.0.81.201:8080`, // target: `http://10.0.81.201:8080`,
// target: `http://10.168.73.36:8080`, // 周乐 // target: `http://10.168.73.36:8080`, // 周乐
//target: `http://10.168.77.209:8080`, // 刘朋 // target: `http://10.168.77.209:8080`, // 刘朋
// target:'http://10.168.66.196:8080',
// target: `http://10.168.66.196:8080`, //刘文阁 // target: `http://10.168.66.196:8080`, //刘文阁
// target: `http://10.168.56.206:8087`, //孟 // target: `http://10.168.56.206:8087`, //孟
// target: `http://10.0.81.209:8087`, target: `http://10.0.81.202:8087`, //现场后台
target: `http://10.0.81.202:8087`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save