Browse Source

fix-更新一下

wangqin
IAMHERE 1 year ago
parent
commit
161bd741bb
  1. 203
      ruoyi-ui/src/views/boardView/addinfo.vue
  2. 241
      ruoyi-ui/src/views/boardView/editInfo.vue
  3. 268
      ruoyi-ui/src/views/index.vue
  4. 18
      ruoyi-ui/src/views/map/index.vue

203
ruoyi-ui/src/views/boardView/addinfo.vue

@ -10,6 +10,9 @@
<div v-on:ondragenter="ondragenter" v-on:drop="faceDrop" v-on:dragover="allowDrop" :style="{ <div v-on:ondragenter="ondragenter" v-on:drop="faceDrop" v-on:dragover="allowDrop" :style="{
width: boardWidth + 'px', width: boardWidth + 'px',
height: boardHeight + 'px', height: boardHeight + 'px',
position: 'relative',
lineHeight:boardHeight + 'px',
justifyContent: getTextAlign(dataForm.formatStyle)
}" class="blackBoard2"> }" class="blackBoard2">
<span :style="{ <span :style="{
color: getColorStyle(dataForm.COLOR), color: getColorStyle(dataForm.COLOR),
@ -51,10 +54,10 @@
</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="radio1" @input="alignment(radio1)"> <el-radio-group v-model="formatStyle" @input="alignment(formatStyle)">
<el-radio-button :label="1">左对齐</el-radio-button> <el-radio-button :label="0">左对齐</el-radio-button>
<el-radio-button :label="2">左右居中</el-radio-button> <el-radio-button :label="2">左右居中</el-radio-button>
<el-radio-button :label="3">右对齐</el-radio-button> <el-radio-button :label="1">右对齐</el-radio-button>
</el-radio-group> </el-radio-group>
</el-col> </el-col>
</el-row> </el-row>
@ -86,7 +89,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="COLOR" label="字体颜色"> <el-form-item prop="COLOR" label="字体颜色">
<el-select v-model="dataForm.COLOR" filterable placeholder="请选择"> <el-select v-model="dataForm.COLOR" filterable placeholder="请选择">
<el-option v-for="item in colorOptions" :key="item.cssClass" :label="item.dictLabel" :value="item.cssClass"> <el-option v-for="item in colorOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -94,7 +97,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="FONT_SIZE" label="字体大小"> <el-form-item prop="FONT_SIZE" label="字体大小">
<el-select v-model="dataForm.FONT_SIZE" style="width: 100%" @change="changeFontSize"> <el-select v-model="dataForm.FONT_SIZE" style="width: 100%" @change="changeFontSize">
<el-option v-for="item in fontSizeOpt" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"> <el-option v-for="item in fontSizeOpt" :key="item.dictLabel" :label="item.dictLabel" :value="item.dictLabel">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -102,7 +105,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="FONT" label="字体类型"> <el-form-item prop="FONT" label="字体类型">
<el-select v-model="dataForm.FONT" filterable placeholder="请选择"> <el-select v-model="dataForm.FONT" filterable placeholder="请选择">
<el-option v-for="item in fontTypeOptions" :key="item.dictLabel" :label="item.dictLabel" :value="item.dictLabel"> <el-option v-for="item in fontTypeOptions" :key="item.cssClass" :label="item.dictLabel" :value="item.cssClass">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -268,7 +271,8 @@ export default {
iotTemplateCategoryList: [], iotTemplateCategoryList: [],
infoType: '', infoType: '',
devicePixelBoolean: false, devicePixelBoolean: false,
categoryRules: false categoryRules: false,
formatStyle: '2'
} }
}, },
// directives: { // directives: {
@ -402,14 +406,15 @@ export default {
this.height = '40' this.height = '40'
this.dataForm = { this.dataForm = {
CONTENT: '请输入内容', CONTENT: '请输入内容',
COLOR: 'yellow', COLOR: 'FF0000',
FONT: '黑体', FONT: '黑体',
SPEED: '1', SPEED: '1',
ACTION: '1', ACTION: '1',
// COORDINATE: "", // COORDINATE: "",
STATE: 'true', STATE: 'true',
STAY: '5', STAY: '5',
screenSize: devicePixel screenSize: devicePixel,
formatStyle: '2'
} }
this.content = '请输入内容' this.content = '请输入内容'
} else { } else {
@ -529,6 +534,7 @@ export default {
return this.$modal.msgError('情报板所属类别不能为空') return this.$modal.msgError('情报板所属类别不能为空')
} }
this.$emit('addInfo', this.dataForm) this.$emit('addInfo', this.dataForm)
this.dialogVisible = false
// //
/*checkIotBoardContent(this.dataForm.CONTENT).then(response => { /*checkIotBoardContent(this.dataForm.CONTENT).then(response => {
if (response.data == 0) { if (response.data == 0) {
@ -613,80 +619,81 @@ export default {
} }
})*/ })*/
this.loading = true // this.loading = true
// let templateId = ""; // // let templateId = "";
let method = 'put' // let method = 'put'
if (this.isAdd) { // if (this.isAdd) {
if (this.infoType == 1) { // if (this.infoType == 1) {
// // //
this.dataForm.STAY = Number(this.dataForm.STAY) * 100 // this.dataForm.STAY = Number(this.dataForm.STAY) * 100
this.$emit('addInfo', this.dataForm) // this.$emit('addInfo', this.dataForm)
} else { // } else {
// // //
const params1 = { // const params1 = {
applyType: '', // applyType: '',
category: this.dataForm.category, // category: this.dataForm.category,
coordinate: '', // coordinate: '',
height: '', // height: '',
id: '', // id: '',
imageUrl: '', // imageUrl: '',
imgSizeFrom: '', // imgSizeFrom: '',
inScreenMode: this.dataForm.ACTION, // inScreenMode: this.dataForm.ACTION,
remark: '', // remark: '',
screenSize: this.dataForm.screenSize, // screenSize: this.dataForm.screenSize,
stopTime: Number(this.dataForm.STAY) * 100, // stopTime: Number(this.dataForm.STAY) * 100,
vmsType: '', // vmsType: '',
width: '' // width: ''
} // }
const templateContent = [] // const templateContent = []
templateContent.push({ // templateContent.push({
content: this.dataForm.CONTENT, // content: this.dataForm.CONTENT,
coordinate: this.dataForm.COORDINATE, // coordinate: this.dataForm.COORDINATE,
fontColor: this.getColorStyle(this.dataForm.COLOR), // fontColor: this.getColorStyle(this.dataForm.COLOR),
fontSize: this.dataForm.FONT_SIZE.substring(0, 2), // fontSize: this.dataForm.FONT_SIZE.substring(0, 2),
fontSpacing: this.dataForm.SPEED, // fontSpacing: this.dataForm.SPEED,
fontType: this.getFontStyle(this.dataForm.FONT) // fontType: this.getFontStyle(this.dataForm.FONT),
}) // formatStyle: this.dataForm.formatStyle
// this.$emit("addInfoMode", this.dataForm); // })
addTemplate(params1, method).then(data => { // // this.$emit("addInfoMode", this.dataForm);
console.log(data, '新增口') // addTemplate(params1, method).then(data => {
let params2 = { // console.log(data, '')
templateContent: templateContent, // let params2 = {
templateId: data // templateContent: templateContent,
} // templateId: data
addTemplateContent(params2) // }
.then(res => { // addTemplateContent(params2)
if (res.code == 200) { // .then(res => {
this.$emit('getActiveNames') // if (res.code == 200) {
this.$message.success('添加成功') // this.$emit('getActiveNames')
} // this.$message.success('')
}) // }
.catch(err => { // })
throw err // .catch(err => {
}) // throw err
}) // })
} // })
} else { // }
// // // } else {
// editTemplate(this.dataForm).then((data) => {}); // // //
// this.templateContent.forEach((e) => { // // editTemplate(this.dataForm).then((data) => {});
// e.img = e.imageName; // // this.templateContent.forEach((e) => {
// }); // // e.img = e.imageName;
// var params = { // // });
// templateContent: this.templateContent, // // var params = {
// templateId: this.dataForm.id, // // templateContent: this.templateContent,
// templateDelContent: this.templateDelContent, // // templateId: this.dataForm.id,
// }; // // templateDelContent: this.templateDelContent,
// editTemplateContent(params).then((response) => { // // };
// // console.log(response, ""); // // editTemplateContent(params).then((response) => {
// }); // // // console.log(response, "");
} // // });
this.loading = false // }
this.dialogVisible = false // this.loading = false
this.isAdd = false // this.dialogVisible = false
this.$emit('refreshDataList', this.dataForm) // this.isAdd = false
var textBoard2 = document.getElementsByClassName('textBoard2') // this.$emit('refreshDataList', this.dataForm)
textBoard2[0].style.position = 'absolute' // var textBoard2 = document.getElementsByClassName('textBoard2')
// textBoard2[0].style.position = 'absolute'
}, },
/*********************************************业务代码***********************************************/ /*********************************************业务代码***********************************************/
getFontStyle(font) { getFontStyle(font) {
@ -703,16 +710,16 @@ export default {
} }
}, },
getColorStyle(font) { getColorStyle(font) {
if (font == '黄色') { if (font == '黄色' || font == 'yellow') {
return 'yellow' return '#FFFF00'
} else if (font == '红色') { } else if (font == '红色' || font == 'red') {
return 'red' return '#FF0000'
} else if (font == '绿色' || font == 'GreenYellow') { } else if (font == '绿色' || font == 'GreenYellow') {
return '#00FF00' return '#00FF00'
} else if (font == '蓝色') { } else if (font == '蓝色' || font == 'blue') {
return 'blue' return '#0000FF'
} else { } else {
return font return '#' + font
} }
}, },
// //
@ -730,7 +737,7 @@ export default {
switch (alignmentNum) { switch (alignmentNum) {
// //
case 1: case 0:
divContent2[0].style.justifyContent = 'left' divContent2[0].style.justifyContent = 'left'
divContent2[0].style.alignItems = 'center' divContent2[0].style.alignItems = 'center'
// textBoard2[0].style.textAlign = "left"; // textBoard2[0].style.textAlign = "left";
@ -746,7 +753,7 @@ export default {
break break
// //
case 3: case 1:
divContent2[0].style.justifyContent = 'right' divContent2[0].style.justifyContent = 'right'
divContent2[0].style.alignItems = 'center' divContent2[0].style.alignItems = 'center'
// textBoard2[0].style.textAlign = "right"; // textBoard2[0].style.textAlign = "right";
@ -780,12 +787,24 @@ export default {
var textTop = this.addZero(textBoard2[0].offsetTop) var textTop = this.addZero(textBoard2[0].offsetTop)
this.dataForm.COORDINATE = textLeft + textTop this.dataForm.COORDINATE = textLeft + textTop
// console.log(this.dataForm.COORDINATE, "this.dataForm.COORDINATE"); // console.log(this.dataForm.COORDINATE, "this.dataForm.COORDINATE");
if (alignmentNum != undefined) {
this.dataForm.formatStyle = alignmentNum
}
}, },
addZero(num) { addZero(num) {
return ('000' + num).slice(-3) return ('000' + num).slice(-3)
}, },
/*增加新的内容*/ /*增加新的内容*/
getTextAlign(font) {
if (font == '0') {
return 'left'
} else if (font == '1') {
return 'right'
} else {
return 'center'
}
},
/*删除内容*/ /*删除内容*/
// delTemplateContent(data) { // delTemplateContent(data) {
// for (let i = 0; i < this.templateContent.length; i++) { // for (let i = 0; i < this.templateContent.length; i++) {

241
ruoyi-ui/src/views/boardView/editInfo.vue

@ -12,15 +12,15 @@
height: getDevicePixel(boardHeight, 1), height: getDevicePixel(boardHeight, 1),
position: 'relative', position: 'relative',
lineHeight:boardHeight + 'px', lineHeight:boardHeight + 'px',
textAlign: getTextAlign(dataForm.formatStyle) textAlign: getTextAlign(dataForm.formatStyle),
justifyContent: getTextAlign(dataForm.formatStyle)
}"> }">
<span class="textBoard1 boardTextStyle" :style="{ <span class="textBoard1 boardTextStyle" :style="{
color: getColorStyle(dataForm.COLOR), color: getColorStyle(dataForm.COLOR),
fontSize: getFontSize(dataForm.FONT_SIZE), fontSize: getFontSize(dataForm.FONT_SIZE),
fontFamily: dataForm.FONT, fontFamily: dataForm.FONT,
zIndex: '1000', zIndex: '1000',
left: getCoordinate(dataForm.COORDINATE.substring(0, 3), 0),
top: getCoordinate(dataForm.COORDINATE.substring(3, 6), 1),
maxHeight:getDevicePixel(boardHeight, 1), maxHeight:getDevicePixel(boardHeight, 1),
}" v-html=" }" v-html="
dataForm.CONTENT.replace(/\n|\r\n/g, '<br>').replace( dataForm.CONTENT.replace(/\n|\r\n/g, '<br>').replace(
@ -43,10 +43,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16" class="infoBoardButton"> <el-col :span="16" class="infoBoardButton">
<el-radio-group v-model="radio1" @input="alignment(radio1)"> <el-radio-group v-model="formatStyle" @input="alignment(formatStyle)">
<el-radio-button :label="1">左对齐</el-radio-button> <el-radio-button :label="0">左对齐</el-radio-button>
<el-radio-button :label="2">左右居中</el-radio-button> <el-radio-button :label="2">左右居中</el-radio-button>
<el-radio-button :label="3">右对齐</el-radio-button> <el-radio-button :label="1">右对齐</el-radio-button>
</el-radio-group> </el-radio-group>
<!-- <el-button type="info" plain @click="alignment(6)" size="mini">下对齐</el-button> <!-- <el-button type="info" plain @click="alignment(6)" size="mini">下对齐</el-button>
<el-button type="info" plain @click="alignment(5)" size="mini">上下居中</el-button> <el-button type="info" plain @click="alignment(5)" size="mini">上下居中</el-button>
@ -74,21 +74,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="screenSize" label="屏幕尺寸"> <el-form-item prop="screenSize" label="屏幕尺寸">
<el-input disabled v-model="dataForm.screenSize"></el-input> <el-input disabled v-model="dataForm.screenSize"></el-input>
<!-- <el-select
@change="resolvingPowerType"
v-model="dataForm.screenSize"
filterable
placeholder="请选择"
disabled
>
<el-option
v-for="item in screenSizeOptions"
:key="item.type"
:label="item.type"
:value="item.type"
>
</el-option>
</el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -103,7 +89,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="COLOR" label="字体颜色"> <el-form-item prop="COLOR" label="字体颜色">
<el-select v-model="dataForm.COLOR" filterable placeholder="请选择"> <el-select v-model="dataForm.COLOR" filterable placeholder="请选择">
<el-option v-for="item in colorOptions" :key="item.cssClass" :label="item.dictLabel" :value="item.cssClass"> <el-option v-for="item in colorOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -124,41 +110,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="6">
<el-form-item prop="SPEED" label="字体间距">
<el-input-number
:min="0"
controls-position="right"
v-model="dataForm.SPEED"
style="width: 100%"
/>
</el-form-item>
</el-col> -->
<!-- <el-col :span="24" v-show="templateContent.length > 1">
<el-divider></el-divider>
</el-col> -->
<!-- <el-col :span="6">
<el-form-item prop="rollSpeed" label="滚动速度">
<el-input-number
:min="0"
controls-position="right"
v-model="dataForm.rollSpeed"
style="width: 100%"
/>
</el-form-item>
</el-col> -->
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="STAY" label="停留时间(秒)"> <el-form-item prop="STAY" label="停留时间(秒)">
<el-input-number :min="0" controls-position="right" v-model="dataForm.STAY" style="width: 100%" /> <el-input-number :min="0" controls-position="right" v-model="dataForm.STAY" style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="6">
<el-form-item prop="remark" label="备注">
<el-input v-model="dataForm.remark" style="width: 100%" />
</el-form-item>
</el-col> -->
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
@ -222,7 +180,7 @@ export default {
data() { data() {
return { return {
radio1: '0', formatStyle: 2,
alignmentNum: 2, alignmentNum: 2,
iotTemplateCategoryList: [], iotTemplateCategoryList: [],
content: '', content: '',
@ -480,6 +438,7 @@ export default {
this.itemPropertyMap = new HashMap() this.itemPropertyMap = new HashMap()
this.alignmentNum = 2 this.alignmentNum = 2
this.dataForm = JSON.parse(JSON.stringify(this.boardEmitItem)) this.dataForm = JSON.parse(JSON.stringify(this.boardEmitItem))
this.dataForm.formatStyle = this.formatStyle
this.dataForm.COLOR = this.getColorValue(this.boardEmitItem.COLOR) this.dataForm.COLOR = this.getColorValue(this.boardEmitItem.COLOR)
console.log(this.dataForm, 'this.dataForm') console.log(this.dataForm, 'this.dataForm')
// this.dataForm.FONT = this.getFont(this.boardEmitItem.FONT) // this.dataForm.FONT = this.getFont(this.boardEmitItem.FONT)
@ -515,7 +474,7 @@ export default {
switch (alignmentNum) { switch (alignmentNum) {
// //
case 1: case 0:
textBoard1[0].style.position = 'static' textBoard1[0].style.position = 'static'
divContent1[0].style.justifyContent = 'left' divContent1[0].style.justifyContent = 'left'
divContent1[0].style.alignItems = 'center' divContent1[0].style.alignItems = 'center'
@ -527,25 +486,25 @@ export default {
divContent1[0].style.alignItems = 'center' divContent1[0].style.alignItems = 'center'
break break
// //
case 3: case 1:
divContent1[0].style.justifyContent = 'right' divContent1[0].style.justifyContent = 'right'
divContent1[0].style.alignItems = 'center' divContent1[0].style.alignItems = 'center'
textBoard1[0].style.position = 'static' textBoard1[0].style.position = 'static'
break break
// //
case 4: case 3:
divContent1[0].style.alignItems = 'flex-start' divContent1[0].style.alignItems = 'flex-start'
textBoard1[0].style.position = 'static' textBoard1[0].style.position = 'static'
break break
// //
case 5: case 4:
divContent1[0].style.alignItems = 'center' divContent1[0].style.alignItems = 'center'
textBoard1[0].style.position = 'static' textBoard1[0].style.position = 'static'
break break
// //
case 6: case 5:
divContent1[0].style.alignItems = 'flex-end' divContent1[0].style.alignItems = 'flex-end'
textBoard1[0].style.position = 'static' textBoard1[0].style.position = 'static'
@ -554,7 +513,7 @@ export default {
var textLeft = this.addZero(JSON.parse(JSON.stringify(textBoard1[0].offsetLeft))) var textLeft = this.addZero(JSON.parse(JSON.stringify(textBoard1[0].offsetLeft)))
var textTop = this.addZero(textBoard1[0].offsetTop) var textTop = this.addZero(textBoard1[0].offsetTop)
console.log('宽高比11111111', textLeft, textTop)
this.dataForm.COORDINATE = textLeft + textTop this.dataForm.COORDINATE = textLeft + textTop
this.dataForm.formatStyle = alignmentNum this.dataForm.formatStyle = alignmentNum
}, },
@ -601,86 +560,86 @@ export default {
if (!this.dataForm.CONTENT.trim()) { if (!this.dataForm.CONTENT.trim()) {
return this.$modal.msgError('当前输入内容为空') return this.$modal.msgError('当前输入内容为空')
} }
this.loading = true // this.loading = true
// console.log(' ', this.dataForm) // console.log(' ', this.dataForm)
this.$emit('receiveForm', this.dataForm) this.$emit('receiveForm', this.dataForm)
this.loading = false // this.loading = false
this.isAdd = false // this.isAdd = false
if (this.dataForm.type == 1) { // if (this.dataForm.type == 1) {
this.dataForm.STAY = Number(this.dataForm.STAY) * 100 // this.dataForm.STAY = Number(this.dataForm.STAY) * 100
this.$emit('receiveForm', this.dataForm) // this.$emit('receiveForm', this.dataForm)
console.log('this.dataForm修改后给父组件传表单内容', this.dataForm) // console.log('this.dataForm', this.dataForm)
} else { // } else {
const tcontent = { // const tcontent = {
content: this.dataForm.CONTENT, // content: this.dataForm.CONTENT,
text: this.dataForm.CONTENT, // text: this.dataForm.CONTENT,
coordinate: this.dataForm.COORDINATE, // coordinate: this.dataForm.COORDINATE,
createBy: null, // createBy: null,
createTime: null, // createTime: null,
fontColor: this.dataForm.COLOR, // fontColor: this.dataForm.COLOR,
fontSize: this.dataForm.FONT_SIZE.substring(0, 2), // fontSize: this.dataForm.FONT_SIZE.replace(/\D/g, ''),
fontSpacing: this.dataForm.SPEED, // fontSpacing: this.dataForm.SPEED,
fontType: this.dataForm.FONT, // fontType: this.dataForm.FONT,
height: null, // height: null,
id: this.dataForm.id, // id: this.dataForm.id,
imageUrl: null, // imageUrl: null,
params: {}, // params: {},
remark: null, // remark: null,
searchValue: null, // searchValue: null,
templateId: this.dataForm.id, // templateId: this.dataForm.id,
updateBy: null, // updateBy: null,
updateTime: null, // updateTime: null,
width: null // width: null
} // }
const param = { // const param = {
applyType: '', // applyType: '',
category: this.dataForm.category, // category: this.dataForm.category,
createBy: null, // createBy: null,
createTime: null, // createTime: null,
dictLable: null, // dictLable: null,
id: this.dataForm.id, // id: this.dataForm.id,
inScreenMode: this.dataForm.ACTION, // inScreenMode: this.dataForm.ACTION,
isCurrency: null, // isCurrency: null,
params: {}, // params: {},
remark: '', // remark: '',
screenSize: this.dataForm.screenSize, // screenSize: this.dataForm.screenSize,
searchValue: null, // searchValue: null,
stopTime: Number(this.dataForm.STAY) * 100, // stopTime: Number(this.dataForm.STAY) * 100,
tcontents: null, // tcontents: null,
templateType: null, // templateType: null,
updateBy: null, // updateBy: null,
updateTime: null, // updateTime: null,
vmsType: '', // vmsType: '',
tcontent: tcontent, // tcontent: tcontent,
templateId: this.dataForm.id // templateId: this.dataForm.id
} // }
editTemplate(param).then(data => {}) // editTemplate(param).then(data => {})
let templateContent = [] // let templateContent = []
templateContent.push({ // templateContent.push({
content: this.dataForm.CONTENT, // content: this.dataForm.CONTENT,
fontColor: this.dataForm.COLOR, // fontColor: this.dataForm.COLOR,
fontSize: this.dataForm.FONT_SIZE.substring(0, 2), // fontSize: this.dataForm.FONT_SIZE.replace(/\D/g, ''),
fontType: this.dataForm.FONT, // fontType: this.dataForm.FONT,
fontSpacing: this.dataForm.SPEED, // fontSpacing: this.dataForm.SPEED,
coordinate: this.dataForm.COORDINATE, // coordinate: this.dataForm.COORDINATE,
id: this.dataForm.tcontentsId, // id: this.dataForm.tcontentsId,
templateId: this.dataForm.id, // templateId: this.dataForm.id,
formatStyle: this.dataForm.formatStyle // formatStyle: this.dataForm.formatStyle
}) // })
var params = { // var params = {
templateContent: templateContent, // templateContent: templateContent,
templateId: this.dataForm.id, // templateId: this.dataForm.id,
templateDelContent: [] // templateDelContent: []
} // }
console.log(params, 'params') // console.log(params, 'params')
editTemplateContent(params).then(response => { // editTemplateContent(params).then(response => {
console.log(response, '返回结果') // console.log(response, '')
this.$modal.msgSuccess('修改成功') // this.$modal.msgSuccess('')
}) // })
this.$forceUpdate() // this.$forceUpdate()
} // }
this.closeDialog() this.closeDialog()
/*checkIotBoardContent(this.dataForm.CONTENT).then(response => { /*checkIotBoardContent(this.dataForm.CONTENT).then(response => {
@ -785,16 +744,16 @@ export default {
} }
}, },
getColorStyle(font) { getColorStyle(font) {
if (font == '黄色') { if (font == '黄色' || font == 'yellow') {
return 'yellow' return '#FFFF00'
} else if (font == '红色') { } else if (font == '红色' || font == 'red') {
return 'red' return '#FF0000'
} else if (font == '绿色' || font == 'GreenYellow') { } else if (font == '绿色' || font == 'GreenYellow') {
return '#00FF00' return '#00FF00'
} else if (font == '蓝色') { } else if (font == '蓝色' || font == 'blue') {
return 'blue' return '#0000FF'
} else { } else {
return font return '#' + font
} }
}, },
closeDialog() { closeDialog() {
@ -838,7 +797,7 @@ export default {
getFontSize(size) { getFontSize(size) {
if (this.boardWidth > 768) { if (this.boardWidth > 768) {
let i = this.boardWidth / 768 let i = this.boardWidth / 768
return size.substring(0, 2) / i - 2 + 'px' return size.replace(/\D/g, '') / i - 2 + 'px'
} else { } else {
return size return size
} }

268
ruoyi-ui/src/views/index.vue

@ -21,8 +21,8 @@
<div v-if="dialogInfoList.length > 0" class="dialog_info_left_show_box" style="height: 100%;"> <div v-if="dialogInfoList.length > 0" class="dialog_info_left_show_box" style="height: 100%;">
<div class="dialog_info_left_show_box_item" v-for="i in dialogInfoList" :key="i.id"> <div class="dialog_info_left_show_box_item" v-for="i in dialogInfoList" :key="i.id">
<div class="dialog_info_left_show_l"> <div class="dialog_info_left_show_l">
<div class="dialog_info_left_show_l_xsq" :style="{'width':processString(i.screenSize,'w') / getScrollSz(processString(i.screenSize,'w'))+'px','height':processString(i.screenSize,'h') / getScrollSz(processString(i.screenSize,'w'))+'px','padding-left':processStrNum(i.tcontents[0].coordinate,'l') / getScrollSz(processString(i.screenSize,'w'))+'px','padding-top':processStrNum(i.tcontents[0].coordinate,'t') / getScrollSz(processString(i.screenSize,'w'))+'px'}"> <div class="dialog_info_left_show_l_xsq" :style="{'width':processString(i.screenSize,'w') / getScrollSz(processString(i.screenSize,'w'))+'px','height':processString(i.screenSize,'h') / getScrollSz(processString(i.screenSize,'w'))+'px','justify-content':getTextAlign(i.tcontents[0].formatStyle)}">
<div class="dialog_info_left_show_l_xsq_txt" :style="{'font-size':i.tcontents[0].fontSize / getScrollSz(processString(i.screenSize,'w'))+'px','color':i.tcontents[0].fontColor,'font-family':i.tcontents[0].fontType}" v-html="i.tcontents[0].content"></div> <div class="dialog_info_left_show_l_xsq_txt" :style="{'font-size':i.tcontents[0].fontSize / getScrollSz(processString(i.screenSize,'w'))+'px','color':'#'+i.tcontents[0].fontColor,'font-family':i.tcontents[0].fontType,}" v-html="i.tcontents[0].content"></div>
</div> </div>
</div> </div>
<div class="dialog_info_left_show_r"> <div class="dialog_info_left_show_r">
@ -65,8 +65,8 @@
<div class="dialog_info_left_show_box" style="overflow-y: visible;"> <div class="dialog_info_left_show_box" style="overflow-y: visible;">
<div class="dialog_info_left_show_box_item" v-for="i in item.mbList" :key="i.id"> <div class="dialog_info_left_show_box_item" v-for="i in item.mbList" :key="i.id">
<div class="dialog_info_left_show_l" style="width:16vw;"> <div class="dialog_info_left_show_l" style="width:16vw;">
<div class="dialog_info_left_show_l_xsq" :style="{'width':processString(i.screenSize,'w') / getScrollSz(processString(i.screenSize,'w'))+'px','height':processString(i.screenSize,'h') / getScrollSz(processString(i.screenSize,'w'))+'px','padding-left':processStrNum(i.tcontents[0].coordinate,'l') / getScrollSz(processString(i.screenSize,'w'))+'px','padding-top':processStrNum(i.tcontents[0].coordinate,'t') / getScrollSz(processString(i.screenSize,'w'))+'px'}"> <div class="dialog_info_left_show_l_xsq" :style="{'width':processString(i.screenSize,'w') / getScrollSz(processString(i.screenSize,'w'))+'px','height':processString(i.screenSize,'h') / getScrollSz(processString(i.screenSize,'w'))+'px','justify-content':getTextAlign(i.tcontents[0].formatStyle)}">
<div class="dialog_info_left_show_l_xsq_txt" :style="{'font-size':i.tcontents[0].fontSize / getScrollSz(processString(i.screenSize,'w'))+'px','color':i.tcontents[0].fontColor,'font-family':i.tcontents[0].fontType}" v-html="i.tcontents[0].content"></div> <div class="dialog_info_left_show_l_xsq_txt" :style="{'font-size':i.tcontents[0].fontSize / getScrollSz(processString(i.screenSize,'w'))+'px','color':'#'+i.tcontents[0].fontColor,'font-family':i.tcontents[0].fontType}" v-html="i.tcontents[0].content"></div>
</div> </div>
</div> </div>
<div class="dialog_info_left_show_r" style="width: 3.5vw;"> <div class="dialog_info_left_show_r" style="width: 3.5vw;">
@ -171,21 +171,23 @@ import GaoDeMap from '@/views/map/index.vue'
import carECharts from '@/views/echarts/carECharts.vue' import carECharts from '@/views/echarts/carECharts.vue'
import addBoard from '@/views/boardView/addinfo.vue' import addBoard from '@/views/boardView/addinfo.vue'
import editBoard from '@/views/boardView/editInfo.vue' import editBoard from '@/views/boardView/editInfo.vue'
import { invokedFunction } from '@/api/device/device.js' import { invokedFunction, getDeviceRealtimeProperty } from '@/api/device/device.js'
import { getAllVmsTemplate, deleteTemplate } from '@/api//board/template.js' import { getAllVmsTemplate, deleteTemplate } from '@/api//board/template.js'
import { getDicts } from '@/api/system/dict/data.js' import { getDicts } from '@/api/system/dict/data.js'
export default { export default {
name: 'indexView', name: 'indexView',
data() { data() {
return { return {
formData: [],
mapIds: '',
screenDataSize: '', screenDataSize: '',
activeNames: [], activeNames: [],
showEmit: false, showEmit: false,
boardEmitItem: {}, // boardEmitItem: {}, //
activeName: 'first', activeName: 'first',
dialogTit: '门架式可变信息标志YK16+270', dialogTit: '门架式可变信息标志YK16+270',
dialogInfoLeft: true, dialogInfoLeft: false,
dialogInfoRight: true, dialogInfoRight: false,
mapDialogTop: '0px', mapDialogTop: '0px',
mapDialogLeft: '0px', mapDialogLeft: '0px',
keyMonitoringList: [ keyMonitoringList: [
@ -277,10 +279,14 @@ export default {
methods: { methods: {
// //
mapClickEvent(e) { mapClickEvent(e) {
this.dialogInfoList = []
console.log('父组件地图点位', e) console.log('父组件地图点位', e)
this.dialogInfoLeft = true this.dialogInfoLeft = true
this.mapIds = e.target._opts.extData.ids
this.screenDataSize = e.target._opts.extData.screenSize this.screenDataSize = e.target._opts.extData.screenSize
this.dialogTit = e.target._opts.extData.tit
this.getTemplateHeaderFn() this.getTemplateHeaderFn()
this.onSubmit(this.mapIds)
// this.mapDialogTop = e.pixel.y + 'px' // this.mapDialogTop = e.pixel.y + 'px'
// this.mapDialogLeft = e.pixel.x + 'px' // this.mapDialogLeft = e.pixel.x + 'px'
// this.$refs.mapDialog.style.top = e.pixel.y + 'px' // this.$refs.mapDialog.style.top = e.pixel.y + 'px'
@ -289,9 +295,203 @@ export default {
}, },
// //
InformationReleaseFn() { InformationReleaseFn() {
invokedFunction('65', '').then(res => { // invokedFunction('65', '').then(res => {
// console.log(res)
// })
this.$confirm('是否确定发布情报板?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const objAll = {}
// objAll.deviceIds = this.checkedCities.toString()
objAll.deviceIds = this.mapIds
let that = this
// let devicePixel = this.form.devicePixel.split('*')
console.log('接口参数', this.dialogInfoList)
let newArr = this.dialogInfoList.map(item => {
let obj = {}
obj.STAY = item.stopTime
obj.ACTION = item.inScreenMode
obj.SPEED = item.tcontents[0].fontSpacing
obj.COORDINATE = item.screenSize.replace('*', '')
obj.COLOR = item.tcontents[0].fontColor
obj.FONT = this.getFontValue(item.tcontents[0].fontType)
obj.FONT_SIZE = item.tcontents[0].fontSize
obj.CONTENT = item.tcontents[0].content.replaceAll(',', '\\,')
obj.CONTENT = item.tcontents[0].content.replaceAll('=', '\\=')
obj.CONTENT = item.tcontents[0].content.replace(/\n/g, '\\\\n')
// obj.CONTENT = item.tcontents[0].content.replace(/\n|\r\n/g, '<r><n>')
obj.width = this.processString(item.screenSize, 'w')
obj.height = this.processString(item.screenSize, 'h')
obj.formatStyle = item.tcontents[0].formatStyle
return obj
})
objAll.parameters = newArr
const param = {
objectData: JSON.stringify(objAll)
}
console.log('newArr11111', newArr)
/* invokedFunction(65,'1B',{fileId:'1'}).then(res =>{
debugger
console.log('发布消息,播放文件-----------------------------')
console.log(res)
}).catch(()=>{
this.$modal.msgError("发布失败,请重试");
})*/
invokedFunction(595, 11, { size: '65535', fileName: 'play099.lst' })
.then(res => {
debugger
console.log('发布消息,校验文件名-------------------------------------')
console.log(res)
if (res.data.result == '01') {
invokedFunction(595, 13, { parameters: newArr })
.then(res => {
debugger
console.log('发布消息,发送文件内容-----------------------------')
console.log(res)
if (res.data.result == '01') {
invokedFunction(595, '1B', { fileId: '99' })
.then(res => {
debugger
console.log('发布消息,播放文件-----------------------------')
console.log(res) console.log(res)
}) })
.catch(() => {
this.$modal.msgError('发布失败,请重试')
})
}
})
.catch(() => {
this.$modal.msgError('发布失败,请重试')
})
}
})
.catch(() => {
this.$modal.msgError('发布失败,请重试')
})
loading.close()
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消发布情报板'
})
loading.close()
})
},
//
onSubmit(deviceId) {
// this.submitButton = true
// // this.loading = true
// this.contentList = []
// //
// const param = {
// deviceId: deviceId
// }
/* await getBoardContentData(param)
.then(res => {
console.log(res, 'onSubmit')
var contents = res.data.parameters
console.log(contents, 'onSubmit-----contents')
for (let i = 0; i < contents.length; i++) {
let item = contents[i]
item.COLOR = this.getColorStyle(item.COLOR)
item.FONT_SIZE = Number(item.FONT_SIZE.substring(0, 2)) + 'px'
item.ID = i
item.FONT = this.getFont(item.FONT)
this.contentList.push(item)
}
console.log(this.contentList, 'onSubmit-----this.contentList')
this.loading = false
this.submitButton = false
// this.rowDrop();
})
.catch(e => {
this.loading = false
this.submitButton = false
})*/
getDeviceRealtimeProperty(deviceId, '3A', { async: false })
.then(res => {
console.log('回读消息------------------------')
var contentsA = res.data['3A'].content
console.log('回读消息--1111111111---', contentsA)
this.dialogInfoList = contentsA.map(item => {
return {
...item,
stopTime: item.residenceTime,
inScreenMode: item.screenEntryMethod,
screenSize: item.displayAreaWidth + '*' + item.displayAreaHeight,
tcontents: [
{
...item,
fontSpacing: item.fontSpacing,
fontSize: parseInt(item.fontSize.replace(/\D/g, '')),
fontType: item.font,
fontColor: item.foregroundColor.toUpperCase(),
formatStyle: item.horizontalAlignment,
content: item.textContent.replaceAll('\\,', ',').replaceAll('\\=', '=').replaceAll('\\\\n', '\n')
}
]
}
})
console.log('回读处理后的数据', this.dialogInfoList)
// for (let i = 0; i < contents.length; i++) {
// let item = contents[i]
// item.COLOR = item.foregroundColor
// item.FONT_SIZE = item.fontSize + 'px'
// item.ID = i
// item.FONT = item.font
// item.COORDINATE = this.covering(item.xCoordinate) + this.covering(item.yCoordinate)
// ;(item.screenSize = item.displayAreaWidth + '*' + item.displayAreaHeight), (item.CONTENT = item.textContent.replaceAll('\\,', ','))
// item.CONTENT = item.CONTENT.replaceAll('\\=', '=')
// item.CONTENT = item.CONTENT.replaceAll('\\\\n', '\n')
// item.formatStyle = item.verticalAlignment
// this.contentList.push(item)
// this.form.devicePixel = item.screenSize
// }
// console.log(this.contentList, 'onSubmit-----this.contentList')
// this.rowDrop();
// this.loading = false
// this.submitButton = false
})
.catch(e => {
this.$modal.msgError('回读失败,请重试')
})
// this.deviceId = deviceId
// id
/*getBoardInfo(deviceId).then(res => {
console.log(res, 'getBoardInfo')
this.form.devicePixel = res.data.pixel
if (res.data.deviceId) {
this.disabledButton = false
} else {
this.disabledButton = true
}
})*/
}, },
// //
getTemplateHeaderFn() { getTemplateHeaderFn() {
@ -324,16 +524,22 @@ export default {
addInfo(form) { addInfo(form) {
console.log('待发新增', form) console.log('待发新增', form)
this.dialogInfoList.push({ this.dialogInfoList.push({
id: form.id,
screenSize: form.screenSize,
COORDINATE: form.coordinate,
...form, ...form,
tcontents: [{ ...form, content: form.CONTENT, fontSize: parseInt(form.FONT_SIZE.replace(/\D/g, '')), fontType: form.FONT, fontColor: form.COLOR }],
id: Math.floor(Math.random() * 10000000000000000), id: Math.floor(Math.random() * 10000000000000000),
txt: form.CONTENT, txt: form.CONTENT,
fz: parseInt(form.FONT_SIZE.replace(/\D/g, '')), fz: parseInt(form.FONT_SIZE.replace(/\D/g, '')),
fm: form.FONT, fm: form.FONT,
formatStyle: form.formatStyle,
...this.processString(form.screenSize), ...this.processString(form.screenSize),
...this.processStrNum(form.COORDINATE) ...this.processStrNum(form.COORDINATE)
}) })
this.getTemplateHeaderFn() console.log('新增模板111', this.dialogInfoList)
console.log(this.dialogInfoList) // this.getTemplateHeaderFn()
// console.log(this.dialogInfoList)
// form.ID = this.contentList.length // form.ID = this.contentList.length
// this.contentList.push(deepClone(form)) // this.contentList.push(deepClone(form))
// this.$message.success('') // this.$message.success('')
@ -345,9 +551,10 @@ export default {
}, },
// //
editOutline(item, index, type) { editOutline(item, index, type) {
this.showEmit = true
this.index = index this.index = index
this.editType = type this.editType = type
console.log(item, '修改弹窗') console.log('修改弹窗', item)
this.boardEmitItem = { this.boardEmitItem = {
FONT_SIZE: item.tcontents[0].fontSize + 'px', FONT_SIZE: item.tcontents[0].fontSize + 'px',
COLOR: item.tcontents[0].fontColor, COLOR: item.tcontents[0].fontColor,
@ -355,6 +562,7 @@ export default {
COORDINATE: item.tcontents[0].coordinate, COORDINATE: item.tcontents[0].coordinate,
FONT: this.getFont(item.tcontents[0].fontType), FONT: this.getFont(item.tcontents[0].fontType),
SPEED: item.tcontents[0].fontSpacing, SPEED: item.tcontents[0].fontSpacing,
formatStyle: item.tcontents[0].formatStyle,
ACTION: item.inScreenMode, // ACTION: item.inScreenMode, //
STAY: item.stopTime, // STAY: item.stopTime, //
type: type, type: type,
@ -363,7 +571,6 @@ export default {
id: item.id, id: item.id,
tcontentsId: item.tcontents[0].id tcontentsId: item.tcontents[0].id
} }
this.showEmit = true
}, },
// // // // // //
// openQbbDrawer(item, index, type) { // openQbbDrawer(item, index, type) {
@ -379,14 +586,16 @@ export default {
// form // form
receiveForm(form) { receiveForm(form) {
console.log('接收子组件form表单 修改111111111', form) console.log('接收子组件form表单 修改111111111', form)
this.formData = form
console.log('开始的数据', this.dialogInfoList) console.log('开始的数据', this.dialogInfoList)
this.dialogInfoList = this.dialogInfoList.map(item => { this.dialogInfoList = this.dialogInfoList.map(item => {
if (item.id === form.id) { if (item.id === form.id) {
return { ...item, tcontents: [{ ...item.tcontents[0], ...form, content: form.CONTENT }] } return { ...item, tcontents: [{ ...item.tcontents[0], ...form, content: form.CONTENT, fontSize: parseInt(form.FONT_SIZE.replace(/\D/g, '')), fontType: form.FONT, fontColor: form.COLOR }] }
} }
return item return item
}) })
this.getTemplateHeaderFn() console.log('修改后的数据', this.dialogInfoList)
// this.getTemplateHeaderFn()
this.$forceUpdate() this.$forceUpdate()
}, },
dialogClose() { dialogClose() {
@ -482,6 +691,33 @@ export default {
} else { } else {
return font return font
} }
},
//
getFontValue(font) {
if (font == '黑体' || font == 'SimHei') return '1'
if (font == '楷体' || font == 'KaiTi') return '2'
if (font == '仿宋' || font == 'FangSong') return '4'
if (font == '隶书' || font == 'LiSu') return '5'
else return '3' //
},
//
getColorValue(color) {
if (color == '蓝色' || color == 'blue') return '0000FF'
if (color == '绿色' || color == '#00FF00' || color == 'GreenYellow') return '00FF00'
if (color == '红色' || color == 'red') return 'FF0000'
if (color == '黄色' || color == 'yellow') return 'FFFF00'
return 'FFFFFF' //
},
//
getTextAlign(font) {
if (font == '0') {
return 'left'
} else if (font == '1') {
return 'right'
} else {
return 'center'
}
} }
} }
} }
@ -921,9 +1157,9 @@ export default {
background-color: #000; background-color: #000;
line-height: 1; line-height: 1;
// text-align: center; // text-align: center;
// display: flex; display: flex;
// justify-content: center; // justify-content: center;
// align-items: center; align-items: center;
} }
.show_r_btn { .show_r_btn {

18
ruoyi-ui/src/views/map/index.vue

@ -16,24 +16,28 @@ export default {
addMarkDataList: [], addMarkDataList: [],
markDataList: [ markDataList: [
{ {
id: 1601, id: 2001,
tit: '服务区', ids: '65',
tit: '门架式可变信息标志K103+900',
longitude: 116.86532, longitude: 116.86532,
latitude: 36.57979, latitude: 36.57979,
screenSize: '768*64', screenSize: '768*64',
imgUrl: require('@/assets/screen/xtb/fwqdot.png') imgUrl: require('@/assets/screen/xtb/fwqdot.png')
}, },
{ {
id: 1601, id: 2002,
tit: '立交', ids: '595',
tit: '门架式可变信息标志K57+595',
longitude: 116.665377, longitude: 116.665377,
latitude: 36.396199, latitude: 36.396199,
screenSize: '192*160', screenSize: '768*64',
imgUrl: require('@/assets/screen/xtb/ljdot.png') imgUrl: require('@/assets/screen/xtb/ljdot.png')
}, },
{ {
id: 1601, id: 2003,
tit: '收费站', tit: '',
ids: '',
longitude: 116.500411, longitude: 116.500411,
latitude: 36.297617, latitude: 36.297617,
screenSize: '480*48', screenSize: '480*48',

Loading…
Cancel
Save