Browse Source

情报板记录

wangqin
hui 1 year ago
parent
commit
ba67e97e61
  1. 12
      ruoyi-ui/src/common/menuData.js
  2. 2
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue
  3. 111
      ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardRecordPreview.vue
  4. 123
      ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue
  5. 6
      ruoyi-ui/vue.config.js

12
ruoyi-ui/src/common/menuData.js

@ -177,12 +177,12 @@ export default [
path: "/service/board",
component: "service/board/index.vue",
},
// {
// title: "情报板记录",
// name: "boardRecord",
// path: "/service/boardRecord",
// component: "service/boardRecord/index.vue",
// },
{
title: "情报板记录",
name: "boardRecord",
path: "/service/boardRecord",
component: "service/boardRecord/index.vue",
},
{
title: "情报板敏感词",
name: "sensitive",

2
ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardPreview.vue

@ -74,7 +74,7 @@ export default {
this.boardStyle = {
width: `${arr[0] * scale}px`,
height: `${arr[1] * scale}px`,
"background-color":`${this.tpl.backgroundColor}px`,
"background-color":`${this.tpl.backgroundColor}`,
"align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.verticalAlignment] //formatStyle
}
let fontSize = 0;

111
ruoyi-ui/src/views/JiHeExpressway/components/infoBoard/BoardRecordPreview.vue

@ -0,0 +1,111 @@
<template>
<div class="boardPreview" ref="compBox">
<div class="boardBox" :style="boardStyle" v-if="isReady">
<p class="boardTxt" v-for="item,index in contentArr" :key="index" :style="boardTxtStyle" v-html="item" v-if="(index + 1) <= lineTotal">
</p>
</div>
</div>
</template>
<script>
export default {
name:"BoardPreview",
data(){
return {
isReady: false,
boardStyle:null,
boardTxtStyle:null,
contentArr:{
type:Array,
default:()=>[]
},
lineTotal: 0
}
},
props:{
tpl: {
type: Object,
default: ()=>{}
},
},
watch:{
tpl:{
handler(newV){
this.contentArr = this.tpl.CONTENT.replaceAll(/\\\\n/g, '\n').replaceAll(/\\=/g, '=').replaceAll(/\\,/g, ',').replaceAll(/ /g, '&nbsp').split('\n');
this.setStyle();
},
deep:true,
immediate:true
}
},
computed:{
},
mounted(){
},
methods:{
setStyle() {
this.$nextTick(() => {
let boxW = this.$refs["compBox"].clientWidth;
let boxH = this.$refs["compBox"].clientHeight;
let boardW = this.tpl.width;
let boardH = this.tpl.height;
let scale = 1;
if (boxH > 20) { //>020
if (boardW / boardH > boxW / boxH) {
scale = boxW / boardW;
} else {
scale = boxH / boardH;
}
} else {
if (boardW > boxW) {
scale = boxW / boardW;
}
}
this.boardStyle = {
width: `${boardW * scale}px`,
height: `${boardH * scale}px`,
"align-items" : ['flex-start', 'flex-end', 'center'][this.tpl.formatStyle] //formatStyle
}
let fontSize = 0;
if (_.isString(this.tpl.FONT_SIZE)) {
fontSize = this.tpl.FONT_SIZE.replace('px', '') * 1;
} else {
fontSize = this.tpl.fontSize;
}
this.boardTxtStyle = {
"color": "#" + this.tpl.COLOR, //fontColor
"font-size": `${fontSize*scale}px`,
"font-family": this.fontTypeDic[this.tpl.FONT || '3'], //fontType
"min-height": `${fontSize * scale}px`
}
this.lineTotal = Math.floor(boardH / fontSize);
this.isReady = true;
})
}
}
}
</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: center;
.boardTxt{
color: #f00;
line-height: 1;
margin-bottom: 0;
word-break: keep-all;
white-space: nowrap;
}
}
}
</style>

123
ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue

@ -1,6 +1,5 @@
<template>
<div class='board_record'>
<!-- 搜索栏 -->
<div class="filter">
<div>
@ -22,22 +21,38 @@
<!-- 内容 -->
<div class="body">
<Table :data="tableData">
<ElTableColumn label="序号" width="60" />
<ElTableColumn label="发布设备" width="60" />
<ElTableColumn label="屏幕尺寸" width="60" />
<ElTableColumn label="设备方向" width="60" />
<ElTableColumn label="设备桩号" width="60" />
<ElTableColumn prop="eventName" label="发布内容" width="240" />
<ElTableColumn prop="eventName" label="发布事件" width="240" />
<ElTableColumn prop="eventName" label="发布状态" width="240" />
<ElTableColumn prop="eventName" label="发布用户" width="240" />
<Table :data="tableData" height="100%">
<el-table-column label="序号" type="index" :index="indexMethod" width="60"/>
<ElTableColumn label="发布时间" prop="releaseTime" width="180"/>
<ElTableColumn label="设备ID" prop="deviceId" width="120"/>
<ElTableColumn label="设备名称" prop="deviceName" />
<ElTableColumn label="桩号" prop="stakeMark" width="100" />
<el-table-column
prop="direction"
label="方向"
width="120"
:formatter="formatterDirection" />
<ElTableColumn label="内容" prop="releaseContent" width="500" header-align="center">
<template slot-scope="scope">
<el-carousel direction="horizontal" :autoplay="false" indicator-position="inside" height="80px" arrow="never" class="board_shower">
<el-carousel-item v-for="item,index in JSON.parse(scope.row.releaseContent)" :key="index">
<BoardRecordPreview :tpl="item" style="height: 100%;"/>
</el-carousel-item>
</el-carousel>
</template>
</ElTableColumn>
<ElTableColumn label="状态" prop="releaseStatus" width="120" :formatter="formatterStatus"/>
<ElTableColumn label="用户名" prop="releaseUserName" width="180" />
<ElTableColumn label="用户ID" prop="releaseUserId" width="180" />
<ElTableColumn label="用户IP" prop="releaseIp" width="200" />
<!--
<ElTableColumn label="操作" width="210">
<template slot-scope="scope">
<ElButton type="text" style="color: #00D1FF;" @click="showDisposal(scope.row.eventType)">流程配置</ElButton>
<ElButton type="text" style="color: #00EBC1;" @click="showPhrases(scope.row)">常用语</ElButton>
</template>
</ElTableColumn>
-->
</Table>
</div>
@ -56,16 +71,20 @@ import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue';
import Pagination from '@screen/components/Pagination.vue';
import Table from '@screen/components/Table.vue';
import request from "@/utils/request";
import BoardRecordPreview from '@screen/components/infoBoard/BoardRecordPreview.vue'
import {DirectionTypes} from '@screen/utils/enum.js';
export default {
name: 'boardRecord',
components: {
ButtonGradient,
Pagination,
Table
Table,
BoardRecordPreview
},
data() {
return {
testData : {"STAY":"30","ACTION":"1","SPEED":"0","COLOR":"ffff00","FONT":"3","FONT_SIZE":"32","CONTENT":"因改扩建施工 平阴南、梁山收费站出入口封闭","width":"768","height":"64","formatStyle":"2"},
tableData: [],
isShowPhrases: false,
isShowDisposal: false,
@ -83,9 +102,18 @@ export default {
this.initData();
},
methods: {
indexMethod(index) {
return this.searchData.pageSize*(this.searchData.pageNum-1) + index + 1;
},
formatterDirection(row, column) {
return DirectionTypes[row.direction];
},
formatterStatus(row, column) {
return ["","成功"][row.releaseStatus];
},
initData() {
request({
url: `/business/dcEventType/list`,
url: `/business/boardReleaseLog/list`,
method: "get",
params: this.searchData,
}).then((result) => {
@ -96,44 +124,14 @@ export default {
},
onRefresh() {
this.tableData = [];
setTimeout(() => {
this.initData();
}, 100);
this.searchData.pageNum = 1;
this.initData();
},
onSizeChange(pageSize) {
this.tableData = [];
this.searchData.pageSize = pageSize;
this.getData();
},
showPhrases(data) {
if (data?.processConfigList.length <= 0) {
Message.warning('请先配置流程!');
return;
}
let process = []
data.processConfigList.forEach(it => {
process.push({
id: it.id,
commonPhrases: it.commonPhrases,
label: it.processNode,
isActive: false,
})
})
this.process = process;
this.isShowPhrases = true;
this.eventType = data.eventType;
},
showDisposal(eventType) {
this.isShowDisposal = true;
this.eventType = eventType;
},
onClosePhrases() {
this.isShowPhrases = false
},
onCloseDisposal() {
this.isShowDisposal = false;
},
onUpdatePhrasesData(phrasesData) {
this.phrasesData = phrasesData;
this.searchData.pageNum = 1;
this.initData();
}
}
}
@ -141,14 +139,11 @@ export default {
<style lang='scss' scoped>
.board_record {
padding: 21px;
padding: 0 14px 14px;
width:100%;
height: 100%;
display: flex;
flex-direction: column;
z-index: 6;
width: 100%;
height: 100%;
.filter {
height: 60px;
@ -164,15 +159,6 @@ export default {
.body {
flex: 1;
position: relative;
overflow: hidden;
.content {
position: absolute;
width: 100%;
height: 100%;
overflow: auto;
}
}
.footer {
@ -182,5 +168,18 @@ export default {
align-items: center;
justify-content: center;
}
.board_shower{
margin: 4px;
}
::v-deep .el-carousel__indicators--horizontal{
line-height: 0; height: 16px;
.el-carousel__indicator--horizontal{
padding: 7px 4px;
}
}
::v-deep .el-table__cell div {
padding: 0 10px !important;
}
}
</style>

6
ruoyi-ui/vue.config.js

@ -31,7 +31,7 @@ module.exports = {
devServer: {
host: "0.0.0.0",
port: port,
https: true,
// https: true,
open: true,
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
@ -52,8 +52,8 @@ module.exports = {
// target: `http://10.0.81.204:8087`, //现场后台 刘文阁
// target: `http://10.168.69.255:8087`, //正晨后台 连现场物联 刘文阁
// target: `http://10.168.78.135:8087`, //王钦
// target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2
target: `http://10.168.68.42:8087`, //王思祥
target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2
// target: `http://10.168.68.42:8087`, //王思祥
// target: `http://10.168.65.194:8087`, //赵祥龙
// target: `http://10.168.65.156:8097`, //孟
// target: `http://10.168.56.165:8087`, //王家宝

Loading…
Cancel
Save