123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- /**
- * 创建UIAnchor界面
- * @param {Object} obj - 创建界面的父物体
- * @param {String} value - 创建界面的类型
- */
- function createUIAnchor(floorNum) {
- let anchorCreateJson = {
- type: "UIAnchor",
- // element: $(".pictureMarker")[0],
- // position: [100, -10, -21],
- // parent: app.query('#1F1FS01')[0],
- // pivotPixel: [parseFloat($(".textAndPictureMarker").css("width")) / 2, parseFloat($(".textAndPictureMarker").css("height"))],
- }
- var s = app.query('#' + floorNum)[0];
- let n = Math.ceil(Math.random() * 10)
- anchorCreateJson.element = $(".textAndPictureMarker")[0];
- //anchorCreateJson.position = [5, 2, n];
- anchorCreateJson.parent = app.query('#' + floorNum)[0];
- anchorCreateJson.pivotPixel = [parseFloat($(".textAndPictureMarker").css("width")) / 2, parseFloat($(".textAndPictureMarker").css("height"))];
- let tempTopCard = app.create(anchorCreateJson); // 创建顶牌
- tempTopCard.visible = true; // 设置初始顶牌状态
- }
- function deviceIcon_click(dwtype, floorNum, ownercode) {
- let funcName = "icon_click";
- var data = {
- 'dwtype': dwtype,
- 'level': floorNum,
- 'id': ownercode
- }
- var message = {
- 'funcName': funcName, // 所要调用父页面里的函数名
- 'param': data
- }
- // 向父窗体(用户主页面)发送消息
- // 第一个参数是具体的信息内容,
- // 第二个参数是接收消息的窗口的源(origin),即"协议 + 域名 + 端口"。也可以设为*,表示不限制域名,向所有窗口发送
- window.parent.postMessage(message, '*');
- }
- //======================================================================================================================
- // 添加html
- function create_html() {
- var sign =
- `<div
- </div>`
- $('#div3d').append($(sign));
- }
- function create_element(dName, deviceTypes, floorNum, ownercode) {
- var srcElem = document.getElementById('board');
- if (deviceTypes == 'YTVA') {
- var sign =
- `<div class="sign" id=${dName} style="font-size: 12px;width: 120px;text-align: center;background-color: rgba(0, 0, 0, .6);border: 0px solid #eeeeee;border-radius: 8px;color: #eee;position: absolute;top: 0;left: 0;z-index: 10;display: none;">
- <div class="s1" style="margin: 5px 0px 5px 0px;line-height: 32px;overflow: hidden;">
- <span class="span-l icon" style="float: left;width: 30px;height: 30px;background:url(https://s3.ax1x.com/2021/03/10/6J9mvD.png) no-repeat center;margin: 1px 1px 1px 5px;"></span>
- <span class="span-l font" style="float: left;margin: 0px 0px 0px 1px;">${dName}</span>
- </div>
- </div>`
- } else if (deviceTypes == 'YTWP') {
- var sign =
- `<div class="sign" id=${dName} style="font-size: 12px;width: 120px;text-align: center;background-color: rgba(0, 0, 0, .6);border: 0px solid #eeeeee;border-radius: 8px;color: #eee;position: absolute;top: 0;left: 0;z-index: 10;display: none;">
- <div class="s1" style="margin: 5px 0px 5px 0px;line-height: 32px;overflow: hidden;">
- <span class="span-l icon" style="float: left;width: 30px;height: 30px;background:url(https://s3.ax1x.com/2021/03/10/6J9GPP.png) no-repeat center;margin: 1px 1px 1px 5px;"></span>
- <span class="span-l font" style="float: left;margin: 0px 0px 0px 1px;">${dName}</span>
- </div>
- </div>`
- } else if (deviceTypes == 'YTCI') {
- var sign =
- `<div class="sign" id=${dName} style="font-size: 12px;width: 120px;text-align: center;background-color: rgba(0, 0, 0, .6);border: 0px solid #eeeeee;border-radius: 8px;color: #eee;position: absolute;top: 0;left: 0;z-index: 10;display: none;">
- <div class="s1" style="margin: 5px 0px 5px 0px;line-height: 32px;overflow: hidden;">
- <span class="span-l icon" style="float: left;width: 30px;height: 30px;background:url(https://s3.ax1x.com/2021/03/10/6J935t.png) no-repeat center;margin: 1px 1px 1px 5px;"></span>
- <span class="span-l font" style="float: left;margin: 0px 0px 0px 1px;">${dName}</span>
- </div>
- </div>`
- } else if (deviceTypes == 'YTEF') {
- var sign =
- `<div class="sign" id=${dName} style="font-size: 12px;width: 120px;text-align: center;background-color: rgba(0, 0, 0, .6);border: 0px solid #eeeeee;border-radius: 8px;color: #eee;position: absolute;top: 0;left: 0;z-index: 10;display: none;">
- <div class="s1" style="margin: 5px 0px 5px 0px;line-height: 32px;overflow: hidden;">
- <span class="span-l icon" style="float: left;width: 30px;height: 30px;background:url(https://s3.ax1x.com/2021/03/10/6J91UI.png) no-repeat center;margin: 1px 1px 1px 5px;"></span>
- <span class="span-l font" style="float: left;margin: 0px 0px 0px 1px;">${dName}</span>
- </div>
- </div>`
- } else if (deviceTypes == 'YTFC') {
- var sign =
- `<div class="sign" id=${dName} style="font-size: 12px;width: 120px;text-align: center;background-color: rgba(0, 0, 0, .6);border: 0px solid #eeeeee;border-radius: 8px;color: #eee;position: absolute;top: 0;left: 0;z-index: 10;display: none;">
- <div class="s1" style="margin: 5px 0px 5px 0px;line-height: 32px;overflow: hidden;">
- <span class="span-l icon" style="float: left;width: 30px;height: 30px;background:url(https://s3.ax1x.com/2021/03/10/6J9lVA.png) no-repeat center;margin: 1px 1px 1px 5px;"></span>
|