@@ -152,10 +155,13 @@
{
@@ -3155,8 +1313,7 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
- })
- .then(() => {
+ }).then(() => {
let loading = this.$loading({
lock: true,
text: 'Loading',
@@ -3165,83 +1322,78 @@ export default {
})
const objAll = {}
objAll.deviceIds = this.checkedCities.toString()
- console.log(objAll, 'objAll')
let that = this
- console.log(this.contentList, 'this.contentList')
+
+ let devicePixel = this.form.devicePixel.split('*')
let newArr = this.contentList.map(function (item) {
let obj = {}
+
obj.STAY = item.STAY
obj.ACTION = item.ACTION
obj.SPEED = item.SPEED
obj.COORDINATE = item.COORDINATE.replace('-', '0')
+ obj.x = obj.COORDINATE.substring(0,3)
+ obj.y = obj.COORDINATE.substring(3,6)
obj.COLOR = that.getColorValue(item.COLOR)
obj.FONT = that.getFontValue(item.FONT)
-
obj.FONT_SIZE = item.FONT_SIZE.substring(0, 2)
obj.CONTENT = item.CONTENT.replace(/\n|\r\n/g, '')
+ obj.width = devicePixel[0]
+ obj.height = devicePixel[1]
return obj
})
objAll.parameters = newArr
const param = {
objectData: JSON.stringify(objAll)
}
- console.log(param, 'param')
- deviceControl(param)
- // splicingBoard(param)
- .then(res => {
- console.log(res, '返回结果')
- loading.close()
- this.$modal.msgSuccess('发布成功')
- })
- .catch(() => {
- loading.close()
+ console.log(newArr, 'newArr')
+
+ invokedFunction(65,13,{parameters:newArr}).then(res =>{
+ debugger
+ if (res.data.result == '01'){
+
+ invokedFunction(65,'1B',{}).then(res =>{
+ debugger
+ console.log("1B---------------------------------")
+ console.log(res)
+
+ }).catch(()=>{
+
})
- // console.log(this.contentList, "发布信息");
- // var content = "";
- // var playList = "[Playlist]";
- // var Item_Start = "ITEM_NO=";
- // var Item_Content = "ITEM";
- // content += playList;
- // var length = parseInt(this.contentList.length);
- // var Item_No = Item_Start + length + "";
- // var value = "";
- // content += Item_No;
- // for (var i = 0; i < this.contentList.length; i++) {
- // value = ("000" + i).slice(-3);
- // content += Item_Content + value + "=";
- // content += this.contentList[i].STAY + ",";
- // content += this.contentList[i].ACTION + ",";
- // content += this.contentList[i].SPEED + "," + "\\";
- // content +=
- // "C" + this.contentList[i].COORDINATE.replace("-", "0") + "\\";
- // content += "S00\\";
- // content +=
- // "c" + this.getColorValue(this.contentList[i].COLOR) + "\\";
- // content += "f" + this.getFontValue(this.contentList[i].FONT);
- // content +=
- // this.contentList[i].FONT_SIZE.substring(0, 2) +
- // this.contentList[i].FONT_SIZE.substring(0, 2);
- // content += this.contentList[i].CONTENT.replace(
- // /\n|\r\n/g,
- // ""
- // );
-
- // if (i + 1 != this.contentList.length) {
- // content += "";
- // }
- // }
- // console.log(content, "content");
-
- // let protocolType = "GUANGDIAN_V33";
- // let deviceld = this.checkedCities.toString();
- // uploadBoardEditInfo(deviceld, protocolType, content).then((response) => {
- // console.log(response, "返回结果");
- // loading.close();
- // this.$modal.msgSuccess("发布成功");
-
- // }).catch(() => {
- // loading.close();
- // })
+ }
+ }).catch(()=>{
+
+ })
+
+
+ invokedFunction(65,11,{deviceId : '65535',fileName:'play001.lst'}).then(res =>{
+ debugger
+ loading.close()
+ console.log('11-------------------------------------')
+ console.log(res)
+ if (res.data.result == '01'){
+ invokedFunction(65,13,{parameters:newArr}).then(res =>{
+ debugger
+ console.log('13-----------------------------')
+ console.log(res)
+ if (res.data.result == '01'){
+
+ invokedFunction(65,'1B',{}).then(res =>{
+ debugger
+ console.log("1B---------------------------------")
+ console.log(res)
+
+ }).catch(()=>{
+
+ })
+ }
+ }).catch(()=>{
+
+ })
+ }
+ }).catch(()=>{
+ loading.close()
+ })
})
.catch(() => {
this.$message({
@@ -3353,7 +1505,7 @@ export default {
const param = {
deviceId: deviceId
}
- await getBoardContentData(param)
+ /* await getBoardContentData(param)
.then(res => {
console.log(res, 'onSubmit')
var contents = res.data.parameters
@@ -3374,62 +1526,60 @@ export default {
.catch(e => {
this.loading = false
this.submitButton = false
+ })*/
+ await getDeviceRealtimeProperty('65','3A',{ async: false})
+ .then(res => {
+ debugger
+ if ("3A" in res.data){
+ var contents = res.data['3A'].content
+ console.log(contents, 'onSubmit-----contents')
+ for (let i = 0; i < contents.length; i++) {
+ let item = contents[i]
+ item.COLOR = this.getColorStyle(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
+ item.formatStyle = item.verticalAlignment
+ this.contentList.push(item)
+ }
+ console.log(this.contentList, 'onSubmit-----this.contentList')
+ // this.rowDrop();
+ }
+ this.loading = false
+ this.submitButton = false
+ })
+ .catch(e => {
+ this.$modal.msgError("回读失败,请重试");
+ this.loading = false
+ this.submitButton = false
})
- // await getBoardEditInfo(deviceId).then((response) => {
- // console.log(response, "response");
- // if (response.code != 200) {
- // this.$message.error(`设备网络连接异常,请稍后重试`);
- // this.loading = false;
- // this.submitButton = false;
- // return;
- // }
- // if (response.data[0] == undefined) {
- // this.$message(response.msg);
- // return;
- // }
-
- // var parseObject = JSON.parse(response.data[0]);
- // console.log(parseObject, "parseObject")
- // var protocolType = parseObject.support.PROTOCOL_TYPE;
- // var contents = parseObject.content;
- // if (
- // typeof contents == "undefined" ||
- // typeof protocolType == "undefined"
- // ) {
- // this.$message(response.msg);
- // this.$forceUpdate();
- // this.loading = false;
- // return;
- // }
- // this.supplier = protocolType;
- // console.log(contents, "contents");
- // for (var i = 0; i < contents.length; i++) {
- // var content = contents[i];
- // var itemId = "ITEM" + this.formatNum(i, 3);
- // var con = content[itemId][0];
- // con.COLOR = this.getColorStyle(con.COLOR);
- // con.FONT_SIZE = Number(con.FONT_SIZE.substring(0, 2)) + "px";
- // con.ID = i;
-
- // this.contentList.push(con);
- // }
- // console.log(this.contentList, "this.contentList");
- // this.submitButton = false;
- // this.loading = false;
- // this.$forceUpdate();
- // });
+ this.deviceId = deviceId
+ this.form.devicePixel = '768*64'
+
// 根据情报板id获取分辨率
- getBoardInfo(deviceId).then(res => {
+ /*getBoardInfo(deviceId).then(res => {
console.log(res, 'getBoardInfo')
- this.deviceId = res.data.deviceId
this.form.devicePixel = res.data.pixel
if (res.data.deviceId) {
this.disabledButton = false
} else {
this.disabledButton = true
}
- })
+ })*/
+ },
+
+ covering(value){
+
+ if (value.length < 3){
+ value = '0'+value
+ return this.covering(value)
+ }
+
+ return value
},
// 待下发 编辑
@@ -3446,16 +1596,29 @@ export default {
// 转颜色
getColorStyle(font) {
- if (font == '黄色' || font == '255255000000') {
- return 'yellow'
- } else if (font == '红色' || font == '255000000000') {
- return 'red'
- } else if (font == '绿色' || font == 'GreenYellow' || font == '000255000000') {
+ if (font == '黄色' || font == 'yellow' || font == '4') {
+ return '#FFFF00'
+ } else if (font == '红色' || font == 'red' || font == '1') {
+ return '#FF0000'
+ } else if (font == '绿色' || font == 'GreenYellow' || font == '000255000000' || font == '2') {
return '#00FF00'
- } else if (font == '蓝色' || font == '000000255000') {
- return 'blue'
+ } else if (font == '蓝色' || font == 'blue' || font == '3') {
+ return '#0000FF'
+ } else if (font == '7' || font == 'white') {
+ return '#FFFFFF'
} else {
- return font
+ return '#' + font
+ }
+ },
+
+ // 居中
+ getTextAlign(font) {
+ if (font == '0'){
+ return 'left'
+ } else if (font == '1'){
+ return 'right'
+ } else {
+ return 'center'
}
},
@@ -3873,7 +2036,7 @@ export default {
.boardTextStyle {
position: absolute;
- line-height: 1;
+ /*line-height: 1;*/
caret-color: rgba(0, 0, 0, 0);
user-select: none;
white-space: normal;