From 649cab0a8fa2a97012acf9c941c4a0b0157cbdfc Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期二, 06 十一月 2018 16:07:09 +0800 Subject: [PATCH] 添加显示信号强度的图标 --- gx_tieta/WebRoot/js/elecircle.js | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 50 insertions(+), 10 deletions(-) diff --git a/gx_tieta/WebRoot/js/elecircle.js b/gx_tieta/WebRoot/js/elecircle.js index 9195d39..bf440a4 100644 --- a/gx_tieta/WebRoot/js/elecircle.js +++ b/gx_tieta/WebRoot/js/elecircle.js @@ -1125,6 +1125,46 @@ this.opts.push(txtInfor); } +// 缁樺埗鍥剧墖 +EleCircle.prototype.drawImg = function(options) { + var defaluts = { + img: '', + startX: 0, + startY: 0, + width: 30, + height: 30, + lineWidth: 4, + fontSize: 14, + fontWeight: '', + strokeStyle: '#000', + fillStyle: '#000', + isShow: true, + name:'', + id: '', + }; + + var opts = $.extend({}, defaluts, options || {}); + + if(opts.img != '' && opts.isShow) { + this.context.drawImage(opts.img, opts.startX, opts.startY, opts.width, opts.height); + + this.context.lineWidth = opts.lineWidth; + this.context.strokeStyle = opts.strokeStyle; + this.context.fillStyle = opts.fillStyle; + this.context.font = opts.fontSize+'px Arial'; + this.context.fillText(opts.name, opts.startX+30, opts.startY+25); + } + + // 瀛樺偍鍐呭 + var txtInfor = { + options: opts, + type:'drawImg', + }; + this.opts.push(txtInfor); + + +}; + // 閲嶆柊缁樺埗鍥� EleCircle.prototype.redraw =function() { this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); @@ -1443,7 +1483,7 @@ isCanMove: 1, clockwise: 0, txtFillStyle: '#000', - name: '鐢垫睜缁勬诞鍏呯姸鎬佺數娴佹柟鍚�' + name: '璁惧娴厖鐘舵�佺數娴佹柟鍚�' }, discharge: { points:[ @@ -1454,7 +1494,7 @@ isCanMove: 1, clockwise: 1, txtFillStyle: '#000', - name: '鐢垫睜缁勬斁鐢垫祴璇曟椂鐢垫祦鏂瑰悜' + name: '璁惧鏀剧數娴嬭瘯鏃剁數娴佹柟鍚�' }, constCharge: { points:[ @@ -1465,7 +1505,7 @@ isCanMove: 1, clockwise: 0, txtFillStyle: '#000', - name: '鐢垫睜缁勭ǔ娴佸厖鐢垫椂鐢垫祦鏂瑰悜' + name: '璁惧绋虫祦鍏呯數鏃剁數娴佹柟鍚�' }, directCharge: { points:[ @@ -1476,7 +1516,7 @@ isCanMove: 1, clockwise: 0, txtFillStyle: '#000', - name: '鐢垫睜缁勭洿杩炲厖鐢垫椂鐢垫祦鏂瑰悜' + name: '璁惧鐩磋繛鍏呯數鏃剁數娴佹柟鍚�' }, unLink: { points:[ @@ -1493,7 +1533,7 @@ name: 'K1/D1娴嬭瘯' }, powerCutDis: { - name: '鐢垫睜缁勫仠鐢垫斁鐢�' + name: '璁惧鍋滅數鏀剧數' } }; @@ -2088,19 +2128,19 @@ var titleList = { floatCharge:{ fillStyle: '#000', - name: '鐢垫睜缁勬诞鍏呯姸鎬�' + name: '璁惧娴厖鐘舵��' }, discharge: { fillStyle: '#000', - name: '鐢垫睜缁勬斁鐢垫祴璇�' + name: '璁惧鏀剧數娴嬭瘯' }, constCharge: { fillStyle: '#000', - name: '鐢垫睜缁勭ǔ娴佸厖鐢�' + name: '璁惧绋虫祦鍏呯數' }, directCharge: { fillStyle: '#000', - name: '鐢垫睜缁勭洿杩炲厖鐢�' + name: '璁惧鐩磋繛鍏呯數' }, unLink: { fillStyle: '#FF0000', @@ -2112,7 +2152,7 @@ }, powerCutDis: { fillStyle: '#000', - name: '鐢垫睜缁勫仠鐢垫斁鐢�' + name: '璁惧鍋滅數鏀剧數' } }; -- Gitblit v1.9.1