|
|
@ -83,15 +83,21 @@ |
|
|
|
<el-checkbox-group |
|
|
|
class="deviceList" |
|
|
|
v-model="checkedDeviceIds" |
|
|
|
:max="2" |
|
|
|
@change="____onSelectDevices" |
|
|
|
> |
|
|
|
<el-checkbox |
|
|
|
v-for="(itm, index) in item.list" |
|
|
|
:label="itm.iotDeviceId" |
|
|
|
:key="index" |
|
|
|
:disabled="!itm.iotDeviceId || itm.iotDeviceId.includes('null') || itm.deviceState == 0 || itm.deviceState == null" |
|
|
|
> |
|
|
|
<div class="title">{{ itm.deviceName }}</div> |
|
|
|
<el-tooltip content="设备未接入" placement="top" v-if="!itm.iotDeviceId || itm.iotDeviceId.includes('null_')"> |
|
|
|
<div class="title">{{ itm.deviceName }}</div> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip content="设备离线" placement="top" v-else-if="itm.deviceState == 0 || itm.deviceState == null"> |
|
|
|
<div class="title">{{ itm.deviceName }}</div> |
|
|
|
</el-tooltip> |
|
|
|
<div v-else class="title">{{ itm.deviceName }}</div> |
|
|
|
<el-tooltip :content="(itm.deviceState == 0 || itm.deviceState == null) ? '离线' : '在线'" placement="top"> |
|
|
|
<img src="@/assets/jihe/images/offline.svg" class="state" v-if="itm.deviceState=='0' || itm.deviceState==null"> |
|
|
|
<img src="@/assets/jihe/images/online.svg" class="state" v-else> |
|
|
@ -307,29 +313,12 @@ |
|
|
|
<script> |
|
|
|
import Sortable from "sortablejs"; |
|
|
|
import editInfo from "./editInfo"; |
|
|
|
import boardData from "./boardData"; |
|
|
|
import { getUserDeptId } from "@/api/system/user"; |
|
|
|
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 { |
|
|
|
invokedFunction, |
|
|
|
getDeviceRealtimeProperty, |
|
|
|
} from "@/api/device/device"; |
|
|
|
import { getBoardList, getBoardDeviceInfo } from "@/api/board/board"; |
|
|
@ -341,8 +330,6 @@ import BoardInfoEditor from "@screen/components/infoBoard/BoardInfoEditor"; |
|
|
|
import vuescroll from "vuescroll"; |
|
|
|
import scrollOptions from "@/common/scrollbar.js"; |
|
|
|
|
|
|
|
import infoBoardUtils from "@screen/utils/infoBoard.js"; |
|
|
|
|
|
|
|
import testDeviceList from "@screen/testData/deviceList.js"; |
|
|
|
import testDeviceInfo from "@screen/testData/infoBoard.js"; |
|
|
|
|
|
|
@ -365,13 +352,14 @@ export default { |
|
|
|
|
|
|
|
data() { |
|
|
|
return { |
|
|
|
multiPublish: true, |
|
|
|
toggleIndex: 0, |
|
|
|
toRightCategory: "", //向右类别绑定 |
|
|
|
arrowRightVisible: false, //向右类别弹窗 |
|
|
|
loading: false, |
|
|
|
submitButton: false, //回读禁用 |
|
|
|
selectedSize: "", //情报板设备 绑定 |
|
|
|
selectedDevice: {}, |
|
|
|
selectedDevices: [], |
|
|
|
boardSizeDic: {}, //情报板设备字典 |
|
|
|
boardDirectionList: [], //方向 |
|
|
|
userQueryParams: { |
|
|
@ -574,12 +562,11 @@ export default { |
|
|
|
if (!this.selectedSize) { |
|
|
|
this.selectedSize = item.otherConfig.screenSize; |
|
|
|
} |
|
|
|
// if (!this.selectedDevice.deviceName) { |
|
|
|
// this.selectedDevice = item; |
|
|
|
// if (!this.selectedDevices.deviceName) { |
|
|
|
// this.selectedDevices = item; |
|
|
|
// } |
|
|
|
}); |
|
|
|
this.____onChangeSize(); |
|
|
|
// this.____getDeviceInfo(); |
|
|
|
} else { |
|
|
|
getBoardList(param).then((res) => { |
|
|
|
res.data.forEach((item, index) => { |
|
|
@ -596,8 +583,8 @@ export default { |
|
|
|
if (!this.selectedSize) { |
|
|
|
this.selectedSize = item.otherConfig.screenSize; |
|
|
|
} |
|
|
|
// if (!this.selectedDevice.deviceName) { |
|
|
|
// this.selectedDevice = item; |
|
|
|
// if (!this.selectedDevices.deviceName) { |
|
|
|
// this.selectedDevices = item; |
|
|
|
// } |
|
|
|
}); |
|
|
|
this.____onChangeSize(); |
|
|
@ -605,22 +592,6 @@ export default { |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
____getDeviceInfo() { |
|
|
|
if (IS_TESTING) { |
|
|
|
this.selectedBdMsg = _.cloneDeep(testDeviceInfo.data["3A"].content); |
|
|
|
} else { |
|
|
|
if (!this.selectedDevice.iotDeviceId) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
getBoardDeviceInfo(this.selectedDevice.iotDeviceId) |
|
|
|
.then((res) => { |
|
|
|
this.selectedBdMsg = res.data["3A"].content; |
|
|
|
}) |
|
|
|
.catch((err) => {}); |
|
|
|
} |
|
|
|
}, |
|
|
|
____forkDeviceInfo(deviceFrom) { |
|
|
|
//从目标设备取得信息 |
|
|
|
|
|
|
@ -819,7 +790,7 @@ export default { |
|
|
|
|
|
|
|
// 发布信息 |
|
|
|
____onPublish() { |
|
|
|
if (!this.selectedDevice.iotDeviceId) { |
|
|
|
if (!this.selectedDevices.length) { |
|
|
|
this.$message.warning("请选择设备!"); |
|
|
|
return; |
|
|
|
} |
|
|
@ -827,57 +798,33 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 接收子组件form表单 修改 |
|
|
|
receiveForm(form) { |
|
|
|
receiveForm(form) { |
|
|
|
console.log(form, "接收子组件form表单 修改"); |
|
|
|
this.contentList.splice(this.index_, 1, form); |
|
|
|
this.$forceUpdate(); |
|
|
|
this.allVmsTemplate("no"); |
|
|
|
}, |
|
|
|
|
|
|
|
// 全选 |
|
|
|
handleCheckAllChange(val) { |
|
|
|
this.checkedDeviceIds = val ? this.deviceList : []; |
|
|
|
}, |
|
|
|
|
|
|
|
// 多选 |
|
|
|
____onSelectDevices(arr) { |
|
|
|
if (arr.length == 0) { |
|
|
|
this.selectedDevice = {}; |
|
|
|
|
|
|
|
this.selectedDevices = []; |
|
|
|
if (this.checkedDeviceIds.length == 0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
this.checkedDeviceIds = [arr.pop()]; |
|
|
|
if (!this.checkedDeviceIds[0] || this.checkedDeviceIds[0].includes("null_")) { |
|
|
|
this.$message.warning("设备未接入!"); |
|
|
|
} |
|
|
|
this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, { |
|
|
|
iotDeviceId: this.checkedDeviceIds[0], |
|
|
|
|
|
|
|
this.selectedDevices = _.filter(this.boardSizeDic[this.selectedSize].list, (item)=>{ |
|
|
|
return this.checkedDeviceIds.includes(item.iotDeviceId) |
|
|
|
}); |
|
|
|
// this.____forkDeviceInfo(this.selectedDevice); |
|
|
|
|
|
|
|
// this.____forkDeviceInfo(this.selectedDevices); |
|
|
|
}, |
|
|
|
// ____onCheckDeviceInfo(item) { |
|
|
|
// this.selectedDevice = _.find(this.boardSizeDic[this.selectedSize].list, { iotDeviceId: value[0] }); |
|
|
|
// this.selectedDevice = item; |
|
|
|
// this.selectedDevice = this.deviceList |
|
|
|
// this.____forkDeviceInfo(); |
|
|
|
|
|
|
|
// this.checkedDeviceIds = value |
|
|
|
// let val = JSON.parse(JSON.stringify(value)) |
|
|
|
// for (let itm of this.deviceList) { |
|
|
|
// if (val.indexOf(itm) > -1) { |
|
|
|
// this.checkAll = true |
|
|
|
// } else { |
|
|
|
// this.checkAll = false |
|
|
|
// return |
|
|
|
// } |
|
|
|
// } |
|
|
|
// this.$forceUpdate() |
|
|
|
// }, |
|
|
|
|
|
|
|
// 情报板列表手风琴 |
|
|
|
____onChangeSize(val) { |
|
|
|
console.log("777777"); |
|
|
|
this.____setAvailableTemplate(); |
|
|
|
this.checkedDeviceIds = []; |
|
|
|
this.selectedDevice = {}; |
|
|
|
this.selectedDevices = []; |
|
|
|
this.selectedBdMsg = []; |
|
|
|
// this.contentList = [] |
|
|
|
// this.deviceList = [] |
|
|
@ -1012,39 +959,6 @@ export default { |
|
|
|
return value; |
|
|
|
}, |
|
|
|
|
|
|
|
// 转颜色 |
|
|
|
getColorStyle(font) { |
|
|
|
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 == "blue" || font == "3") { |
|
|
|
return "#0000FF"; |
|
|
|
} else if (font == "7" || font == "white") { |
|
|
|
return "#FFFFFF"; |
|
|
|
} else { |
|
|
|
return "#" + font; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 居中 |
|
|
|
getTextAlign(font) { |
|
|
|
if (font == "0") { |
|
|
|
return "left"; |
|
|
|
} else if (font == "1") { |
|
|
|
return "right"; |
|
|
|
} else { |
|
|
|
return "center"; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 换算文字在模板的位置 |
|
|
|
getCoordinate(coordinate, type, screenSize) { |
|
|
|
let width = ""; |
|
|
@ -1082,50 +996,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
getFontStyle(font) { |
|
|
|
if (font == "宋体") { |
|
|
|
return "Simsun"; |
|
|
|
} else if (font == "黑体") { |
|
|
|
return "SimHei"; |
|
|
|
} else if (font == "楷体") { |
|
|
|
return "KaiTi"; |
|
|
|
} else { |
|
|
|
return font; |
|
|
|
} |
|
|
|
}, |
|
|
|
getFont(font) { |
|
|
|
if (font == "KaiTi" || font == "k") { |
|
|
|
return "楷体"; |
|
|
|
} else if (font == "SimSun" || font == "s") { |
|
|
|
return "宋体"; |
|
|
|
} else if (font == "SimHei" || font == "h") { |
|
|
|
return "黑体"; |
|
|
|
} else if (font == "FangSong" || font == "f") { |
|
|
|
return "仿宋"; |
|
|
|
} else if (font == "LiSu" || font == "l") { |
|
|
|
return "隶书"; |
|
|
|
} else { |
|
|
|
return font; |
|
|
|
} |
|
|
|
}, |
|
|
|
// // 上移 |
|
|
|
// moveTop(i, item) { |
|
|
|
// if (item && i) { |
|
|
|
// let obj = { ...this.contentList[i - 1] }; |
|
|
|
// this.contentList.splice(i - 1, 1, item); |
|
|
|
// this.contentList.splice(i, 1, obj); |
|
|
|
// this.$forceUpdate(); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// // 下移 |
|
|
|
// moveBottom(i, item) { |
|
|
|
// if (item && typeof i === "number") { |
|
|
|
// let obj = { ...this.contentList[i + 1] }; |
|
|
|
// this.contentList.splice(i + 1, 1, item); |
|
|
|
// this.contentList.splice(i, 1, obj); |
|
|
|
// this.$forceUpdate(); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
dialogClose() { |
|
|
|
this.showEmit = false; |
|
|
|
this.arrowRightVisible = false; |
|
|
|