Commit 458028f2 authored by sxl's avatar sxl 💬

add:去掉报警线,在水位连一条线

parent d78199a3
...@@ -91,12 +91,12 @@ export default { ...@@ -91,12 +91,12 @@ export default {
b2_a1: [], b2_a1: [],
b2a_2b: [], b2a_2b: [],
b2_a3: [], b2_a3: [],
views: [], views: []
}, },
title: '', title: '',
// 原有数据保持不变 // 原有数据保持不变
showUnListModal: false, // 控制模态框显示 showUnListModal: false, // 控制模态框显示
currentUnList: [], // 当前离线设备列表 currentUnList: [] // 当前离线设备列表
} }
}, },
mounted() { mounted() {
...@@ -110,17 +110,17 @@ export default { ...@@ -110,17 +110,17 @@ export default {
var nowTimeEl = this.$el.querySelector('#nowTime') var nowTimeEl = this.$el.querySelector('#nowTime')
var Loop1 = qf.Async.intervalLoop( var Loop1 = qf.Async.intervalLoop(
1000, 1000,
function () { function() {
var dateTime = Tools.Dates.format('yyyy年MM月dd日 HH:mm:ss') var dateTime = Tools.Dates.format('yyyy年MM月dd日 HH:mm:ss')
dateTime = dateTime.replace(/年|月|日/g, function (a) { dateTime = dateTime.replace(/年|月|日/g, function(a) {
return '<span>' + a + '</span>' return '<span>' + a + '</span>'
}) })
nowTimeEl.innerHTML = dateTime nowTimeEl.innerHTML = dateTime
// Loop1.clear(); // Loop1.clear();
}, },
function () { function() {
var dateTime = Tools.Dates.format('yyyy年MM月dd日 HH:mm:ss') var dateTime = Tools.Dates.format('yyyy年MM月dd日 HH:mm:ss')
dateTime = dateTime.replace(/年|月|日/g, function (a) { dateTime = dateTime.replace(/年|月|日/g, function(a) {
return '<span>' + a + '</span>' return '<span>' + a + '</span>'
}) })
nowTimeEl.innerHTML = dateTime nowTimeEl.innerHTML = dateTime
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
) )
qf( qf(
function () { function() {
this.initData() this.initData()
}.bind(this) }.bind(this)
) )
...@@ -140,13 +140,13 @@ export default { ...@@ -140,13 +140,13 @@ export default {
qf.Async.loopList.call( qf.Async.loopList.call(
this, this,
list, list,
function (key, item, next) { function(key, item, next) {
var alarmDict = [ var alarmDict = [
'', '',
{ name: '红色报警', color: 'red' }, { name: '红色报警', color: 'red' },
{ name: '橙色报警', color: 'orange' }, { name: '橙色报警', color: 'orange' },
{ name: '黄色报警', color: '#FFC900' }, { name: '黄色报警', color: '#FFC900' },
{ name: '蓝色报警', color: 'blue' }, { name: '蓝色报警', color: 'blue' }
] ]
var alarmItem = alarmDict[item.alarmlevel] var alarmItem = alarmDict[item.alarmlevel]
var name = item.equipname var name = item.equipname
...@@ -172,12 +172,12 @@ export default { ...@@ -172,12 +172,12 @@ export default {
')</div><div>时间:' + ')</div><div>时间:' +
item.time + item.time +
divStr, divStr,
onClose: function (v) { onClose: function(v) {
setTimeout(function () { setTimeout(function() {
next() next()
}, ~~(1 + Math.random() * 3) * 1000) }, ~~(1 + Math.random() * 3) * 1000)
}, },
onClick: function (tag) { onClick: function(tag) {
if (tag.nodeName === 'BUTTON') { if (tag.nodeName === 'BUTTON') {
var self = this var self = this
var id = tag.dataset.id var id = tag.dataset.id
...@@ -186,11 +186,11 @@ export default { ...@@ -186,11 +186,11 @@ export default {
Notify.pause() Notify.pause()
that.openRelieveAlarm( that.openRelieveAlarm(
{ equipno: item.equipno }, { equipno: item.equipno },
function () { function() {
Notify.close(true) Notify.close(true)
reqAlarmsPopup() reqAlarmsPopup()
}, },
function () { function() {
Notify.recover() Notify.recover()
} }
) )
...@@ -203,7 +203,7 @@ export default { ...@@ -203,7 +203,7 @@ export default {
closeBtnColor: '#eee', closeBtnColor: '#eee',
width: '350px', width: '350px',
html: '点击确认后,该条数据仍会处于报警状态,但是不会再提示,您确认要这么做吗?', html: '点击确认后,该条数据仍会处于报警状态,但是不会再提示,您确认要这么做吗?',
confirm: function (el) { confirm: function(el) {
var parm = { id: item.id } var parm = { id: item.id }
that.pageApi.alterAbnormal('put', parm).then(res => { that.pageApi.alterAbnormal('put', parm).then(res => {
if (res.code === 200) { if (res.code === 200) {
...@@ -211,9 +211,9 @@ export default { ...@@ -211,9 +211,9 @@ export default {
} }
}) })
}, },
close: function () { close: function() {
Notify.recover() Notify.recover()
}, }
}) })
} else if (id === '2') { } else if (id === '2') {
// 不再提示 // 不再提示
...@@ -221,11 +221,11 @@ export default { ...@@ -221,11 +221,11 @@ export default {
Notify.close() Notify.close()
} }
} }
}, }
}) })
}, },
function () { function() {
setTimeout(function () { setTimeout(function() {
reqAlarmsPopup() reqAlarmsPopup()
}, 15000) }, 15000)
} }
...@@ -248,7 +248,7 @@ export default { ...@@ -248,7 +248,7 @@ export default {
// onload // onload
this.$nextTick(() => { this.$nextTick(() => {
new qf.Async.intervalLoop(600000, function () { new qf.Async.intervalLoop(600000, function() {
// 加载数据 // 加载数据
self.loadViewData(self.area.views) self.loadViewData(self.area.views)
}) })
...@@ -285,13 +285,13 @@ export default { ...@@ -285,13 +285,13 @@ export default {
Tools.asyncLoop.call( Tools.asyncLoop.call(
this, this,
panels, panels,
function (key, panel, next) { function(key, panel, next) {
var item = panel.item var item = panel.item
var param = { var param = {
range: item.range, range: item.range,
subitem: item.subitem, subitem: item.subitem,
values: item.values, values: item.values,
deviceid: item.deviceid, deviceid: item.deviceid
} }
var type = panel.type var type = panel.type
if (type === 't_1') { if (type === 't_1') {
...@@ -299,7 +299,7 @@ export default { ...@@ -299,7 +299,7 @@ export default {
reqApi.common.requstEdge('get', item.requrl, param).then(res => { reqApi.common.requstEdge('get', item.requrl, param).then(res => {
var data = res.body || {} var data = res.body || {}
var opts = { var opts = {
chartConfig: {}, chartConfig: {}
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -313,10 +313,10 @@ export default { ...@@ -313,10 +313,10 @@ export default {
column: { column: {
grouping: false, grouping: false,
shadow: false, shadow: false,
borderWidth: 0, borderWidth: 0
}, }
}, }
}, }
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -328,11 +328,11 @@ export default { ...@@ -328,11 +328,11 @@ export default {
chartConfig: { chartConfig: {
xAxis: { xAxis: {
labels: { labels: {
rotation: 0, // 设置轴标签旋转角度 rotation: 0 // 设置轴标签旋转角度
}, }
}, }
}, },
warningLine: 'double', warningLine: 'double'
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -346,10 +346,10 @@ export default { ...@@ -346,10 +346,10 @@ export default {
chart: { chart: {
type: chartType, type: chartType,
borderWidth: 0, borderWidth: 0,
marginLeft: 55, marginLeft: 55
}, }
}, },
warningLine: 'double', warningLine: 'double'
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -362,8 +362,8 @@ export default { ...@@ -362,8 +362,8 @@ export default {
chart: { type: 'bar', marginLeft: 55 }, chart: { type: 'bar', marginLeft: 55 },
xAxis: { xAxis: {
labels: { labels: {
rotation: 0, // 设置轴标签旋转角度 rotation: 0 // 设置轴标签旋转角度
}, }
}, },
/* /*
plotOptions: { plotOptions: {
...@@ -372,12 +372,12 @@ export default { ...@@ -372,12 +372,12 @@ export default {
} }
}, */ }, */
tooltip: { tooltip: {
formatter: function () { formatter: function() {
return this.series.name + '' + this.key + '<br/>' + Math.abs(this.y) + '' return this.series.name + '' + this.key + '<br/>' + Math.abs(this.y) + ''
}, }
}, }
}, },
callback: function (key, extend, give) { callback: function(key, extend, give) {
if (key === 'series' && give[key].constructor.name === 'Array') { if (key === 'series' && give[key].constructor.name === 'Array') {
var mobj = extend[key] var mobj = extend[key]
var asobj = give[key] var asobj = give[key]
...@@ -388,7 +388,7 @@ export default { ...@@ -388,7 +388,7 @@ export default {
arr[i] = 0 - val arr[i] = 0 - val
} }
} }
}, }
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -401,19 +401,19 @@ export default { ...@@ -401,19 +401,19 @@ export default {
xAxis: [ xAxis: [
{ {
labels: { labels: {
rotation: -25, // 设置轴标签旋转角度 rotation: -25 // 设置轴标签旋转角度
}, }
}, }
], ],
series: [ series: [
{ {
type: 'column', type: 'column',
color: '#1DF7F9', color: '#1DF7F9',
borderRadius: '.05rem', borderRadius: '.05rem'
}, },
{ type: 'column', color: '#FAE728', borderRadius: '.05rem' }, { type: 'column', color: '#FAE728', borderRadius: '.05rem' }
], ]
}, }
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -432,20 +432,20 @@ export default { ...@@ -432,20 +432,20 @@ export default {
alpha: 10, alpha: 10,
beta: 5, // 左右 beta: 5, // 左右
depth: 50, depth: 50,
viewDistance: 0, viewDistance: 0
}, }
}, },
plotOptions: { plotOptions: {
series: { series: {
depth: 25, depth: 25
// colorByPoint: true // colorByPoint: true
}, }
}, },
series: [ series: [
{ type: 'column', color: '#00B2FC', showInLegend: false }, { type: 'column', color: '#00B2FC', showInLegend: false }
// {type:'spline', color:'#FBC000', showInLegend:false, dashStyle:'Dash', lineWidth:1,} // {type:'spline', color:'#FBC000', showInLegend:false, dashStyle:'Dash', lineWidth:1,}
], ]
}, }
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -459,53 +459,53 @@ export default { ...@@ -459,53 +459,53 @@ export default {
svalue: '12.00', svalue: '12.00',
time: 1723248388000, time: 1723248388000,
sensroname: '气象站东PM25', sensroname: '气象站东PM25',
sensorid: '37068520080801', sensorid: '37068520080801'
}, },
{ {
unit: 'ug/m³', unit: 'ug/m³',
svalue: '12.00', svalue: '12.00',
time: 1723248388000, time: 1723248388000,
sensroname: '气象站东PM10', sensroname: '气象站东PM10',
sensorid: '37068520080802', sensorid: '37068520080802'
}, },
{ {
unit: 'db', unit: 'db',
svalue: '52.20', svalue: '52.20',
time: 1723248389000, time: 1723248389000,
sensroname: '气象站东噪音', sensroname: '气象站东噪音',
sensorid: '37068520080803', sensorid: '37068520080803'
}, },
{ {
unit: '', unit: '',
svalue: '29.25', svalue: '29.25',
time: 1723248390000, time: 1723248390000,
sensroname: '气象站东温度', sensroname: '气象站东温度',
sensorid: '37068520080804', sensorid: '37068520080804'
}, },
{ {
unit: '%RH', unit: '%RH',
svalue: '82.81', svalue: '82.81',
time: 1723248391000, time: 1723248391000,
sensroname: '气象站东湿度', sensroname: '气象站东湿度',
sensorid: '37068520080805', sensorid: '37068520080805'
}, },
{ {
unit: 'm/s', unit: 'm/s',
svalue: '2.80', svalue: '2.80',
time: 1723248393000, time: 1723248393000,
sensroname: '气象站东风速', sensroname: '气象站东风速',
sensorid: '37068520080807', sensorid: '37068520080807'
}, },
{ {
unit: '', unit: '',
svalue: '西南', svalue: '西南',
time: 1723248392000, time: 1723248392000,
sensroname: '气象站东风向', sensroname: '气象站东风向',
sensorid: '37068520080808', sensorid: '37068520080808'
}, }
], ],
code: 200, code: 200,
msg: '操作成功', msg: '操作成功'
} }
var types = ['PM25', 'PM10', '噪音', '温度', '湿度', '风速', '风向'] var types = ['PM25', 'PM10', '噪音', '温度', '湿度', '风速', '风向']
...@@ -524,7 +524,7 @@ export default { ...@@ -524,7 +524,7 @@ export default {
var div = document.createElement('div') var div = document.createElement('div')
// 2024/8/10(周六) 为了缩减设备名称, 类型名称过长超出边界,添加对类型过滤 // 2024/8/10(周六) 为了缩减设备名称, 类型名称过长超出边界,添加对类型过滤
var name = types.find(function (val, i) { var name = types.find(function(val, i) {
if (item.sensroname.includes(val)) { if (item.sensroname.includes(val)) {
return 1 return 1
} }
...@@ -551,10 +551,10 @@ export default { ...@@ -551,10 +551,10 @@ export default {
var opts = { var opts = {
chartConfig: { chartConfig: {
series: [ series: [
{ type: 'column', color: '#00B2FC' }, { type: 'column', color: '#00B2FC' }
// {type:'spline', color:'#FBC000', dashStyle:'ShortDot',} // {type:'spline', color:'#FBC000', dashStyle:'ShortDot',}
], ]
}, }
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -576,7 +576,7 @@ export default { ...@@ -576,7 +576,7 @@ export default {
chart: { chart: {
backgroundColor: 'transparent', backgroundColor: 'transparent',
marginBottom: null, marginBottom: null,
marginLeft: null, marginLeft: null
}, },
title: { title: {
floating: true, floating: true,
...@@ -585,13 +585,13 @@ export default { ...@@ -585,13 +585,13 @@ export default {
y: 22, y: 22,
floating: true, floating: true,
style: { style: {
color: '#00f6ff', color: '#00f6ff'
}, }
}, },
tooltip: { tooltip: {
formatter: function (e) { formatter: function(e) {
return this.key + '' + this.y return this.key + '' + this.y
}, }
}, },
plotOptions: { plotOptions: {
pie: { pie: {
...@@ -605,10 +605,10 @@ export default { ...@@ -605,10 +605,10 @@ export default {
distance: 10, distance: 10,
format: '<b>{point.name}</b>: {point.y}', format: '<b>{point.name}</b>: {point.y}',
style: { style: {
color: 'black', color: 'black'
}, }
}, }
}, }
}, },
series: [ series: [
{ {
...@@ -617,13 +617,13 @@ export default { ...@@ -617,13 +617,13 @@ export default {
name: '设备数量', name: '设备数量',
data: [ data: [
{ name: '在线', y: data.online, color: '#48abe1' }, { name: '在线', y: data.online, color: '#48abe1' },
{ name: '离线', y: data.unline, color: '#064f94' }, { name: '离线', y: data.unline, color: '#064f94' }
], ]
}, }
], ]
}, },
isSeriesData: true, isSeriesData: true,
type: item.type, type: item.type
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -643,7 +643,7 @@ export default { ...@@ -643,7 +643,7 @@ export default {
name: item.name + ' ' + kitem.name, name: item.name + ' ' + kitem.name,
value: data[kitem.key], value: data[kitem.key],
unit: item.eqdanwei, unit: item.eqdanwei,
time: time, time: time
}) })
} }
} }
...@@ -708,7 +708,7 @@ export default { ...@@ -708,7 +708,7 @@ export default {
var param = { c: 'code', a: 'getcode', id: 48, icon: 1, py: city } var param = { c: 'code', a: 'getcode', id: 48, icon: 1, py: city }
reqApi.getWeather(param).then(res => { reqApi.getWeather(param).then(res => {
var body = document.createElement('div') var body = document.createElement('div')
setTimeout(function () { setTimeout(function() {
body.innerHTML = res body.innerHTML = res
var styles = body.querySelectorAll('link') var styles = body.querySelectorAll('link')
for (var style of styles) { for (var style of styles) {
...@@ -750,7 +750,7 @@ export default { ...@@ -750,7 +750,7 @@ export default {
appSecret: data.v_appsecret, appSecret: data.v_appsecret,
name: data.v_name, name: data.v_name,
channel: data.v_channel, channel: data.v_channel,
remark: data.v_remark, remark: data.v_remark
} }
panel.setData(vparam) panel.setData(vparam)
}) })
...@@ -778,10 +778,10 @@ export default { ...@@ -778,10 +778,10 @@ export default {
column: { column: {
grouping: false, grouping: false,
shadow: false, shadow: false,
borderWidth: 0, borderWidth: 0
}, }
}, }
}, }
} }
Highchart.template.high(panel.el, data, opts) Highchart.template.high(panel.el, data, opts)
}) })
...@@ -791,13 +791,13 @@ export default { ...@@ -791,13 +791,13 @@ export default {
var data = res.body || {} var data = res.body || {}
this.cuCharts(panel.el, data, { this.cuCharts(panel.el, data, {
axisLineWidth: 2, axisLineWidth: 2,
axisColor: 'pink', axisColor: 'pink'
}) })
}) })
} }
next() next()
}, },
function () {} function() {}
) )
}, },
// 新增:为 t_10 类下最后一个 li 添加点击事件 // 新增:为 t_10 类下最后一个 li 添加点击事件
...@@ -850,7 +850,7 @@ export default { ...@@ -850,7 +850,7 @@ export default {
}, },
cuCharts(ctn, data, opts) { cuCharts(ctn, data, opts) {
// //
var cuCharts = function (ctn, data, opts) { var cuCharts = function(ctn, data, opts) {
var ctn = (this.ctn = typeof element === 'string' ? document.getElementById(ctn) : ctn) var ctn = (this.ctn = typeof element === 'string' ? document.getElementById(ctn) : ctn)
if (!ctn) return console.log('%c cuCharts Error Element is a invalid param! ', 'color:red') if (!ctn) return console.log('%c cuCharts Error Element is a invalid param! ', 'color:red')
var self = this var self = this
...@@ -869,7 +869,7 @@ export default { ...@@ -869,7 +869,7 @@ export default {
damWidth: data.dissect.width || 100, damWidth: data.dissect.width || 100,
axisLineWidth: 6, axisLineWidth: 6,
axisColor: 'red', axisColor: 'red',
margin: { top: 14, right: 0, bottom: 0, left: 18 }, margin: { top: 14, right: 0, bottom: 0, left: 18 }
}) })
var left = defaults.margin.left * this.dpr var left = defaults.margin.left * this.dpr
var top = defaults.margin.top * this.dpr var top = defaults.margin.top * this.dpr
...@@ -889,20 +889,20 @@ export default { ...@@ -889,20 +889,20 @@ export default {
rightDist: defaults.margin.right * dpr, rightDist: defaults.margin.right * dpr,
waterArea: { waterArea: {
startAngle: data.dissect.sdeg, startAngle: data.dissect.sdeg,
radius: data.dissect.diameter, radius: data.dissect.diameter
}, },
alarm: data.alarm, alarm: data.alarm,
axisLineWidth: opts.axisLineWidth || defaults.axisLineWidth, axisLineWidth: opts.axisLineWidth || defaults.axisLineWidth,
axisColor: opts.axisColor || defaults.axisColor, axisColor: opts.axisColor || defaults.axisColor
} }
this.init() this.init()
} }
cuCharts.prototype = { cuCharts.prototype = {
init: function () { init: function() {
this.setModule() this.setModule()
this.onresize() this.onresize()
}, },
drawAxis: function (color, damHeight) { drawAxis: function(color, damHeight) {
var lw = this.options.axisLineWidth var lw = this.options.axisLineWidth
var wHalf = lw / 2 var wHalf = lw / 2
var initX = this.options.initX var initX = this.options.initX
...@@ -917,7 +917,7 @@ export default { ...@@ -917,7 +917,7 @@ export default {
ex: axisYSX, ex: axisYSX,
ey: axisXEY, ey: axisXEY,
width: lw, width: lw,
color: color, color: color
}) })
var fontY = ~~(this.options.damPxHeight / 2 + this.options.initY) var fontY = ~~(this.options.damPxHeight / 2 + this.options.initY)
var fontSize = 12 var fontSize = 12
...@@ -930,7 +930,7 @@ export default { ...@@ -930,7 +930,7 @@ export default {
text: axisXText, text: axisXText,
color: '#fff', color: '#fff',
align: 'center', align: 'center',
vertical: 'center', vertical: 'center'
}) })
this.drawLiner({ this.drawLiner({
sx: initX, sx: initX,
...@@ -938,10 +938,10 @@ export default { ...@@ -938,10 +938,10 @@ export default {
ex: endX, ex: endX,
ey: axisYEY, ey: axisYEY,
width: lw, width: lw,
color: color, color: color
}) })
}, },
drawSteps: function (ladders) { drawSteps: function(ladders) {
// 初始化边坡线采样点数组 // 初始化边坡线采样点数组
this.bianpoLinePoinArr = [] this.bianpoLinePoinArr = []
...@@ -994,7 +994,7 @@ export default { ...@@ -994,7 +994,7 @@ export default {
ex: fEndX, ex: fEndX,
ey: cumulationY, ey: cumulationY,
width: 2, width: 2,
color: '#8b8b8b', color: '#8b8b8b'
}) })
// 新增:生成10个采样点并添加到边坡线数组(平坡) // 新增:生成10个采样点并添加到边坡线数组(平坡)
const stepPoints1 = this.getSampledPoints(cumulationX, cumulationY, fEndX, cumulationY, 20) const stepPoints1 = this.getSampledPoints(cumulationX, cumulationY, fEndX, cumulationY, 20)
...@@ -1006,7 +1006,7 @@ export default { ...@@ -1006,7 +1006,7 @@ export default {
ex: lEndX, ex: lEndX,
ey: lEndY, ey: lEndY,
width: 2, width: 2,
color: '#8b8b8b', color: '#8b8b8b'
}) })
// 新增:生成10个采样点并添加到边坡线数组(平坡间过渡连接线) // 新增:生成10个采样点并添加到边坡线数组(平坡间过渡连接线)
...@@ -1022,7 +1022,7 @@ export default { ...@@ -1022,7 +1022,7 @@ export default {
slope: slope, slope: slope,
slopeX: lEndX, slopeX: lEndX,
slopeY: lEndY, slopeY: lEndY,
xy: aCoord.xy, xy: aCoord.xy
} }
cumulationX = lEndX cumulationX = lEndX
cumulationY = lEndY cumulationY = lEndY
...@@ -1033,7 +1033,7 @@ export default { ...@@ -1033,7 +1033,7 @@ export default {
ex: damLength, ex: damLength,
ey: damDepth, ey: damDepth,
width: 2, width: 2,
color: '#8b8b8b', color: '#8b8b8b'
}) })
// 新增:生成10个采样点并添加到边坡线数组(最后平坡收尾线) // 新增:生成10个采样点并添加到边坡线数组(最后平坡收尾线)
...@@ -1046,7 +1046,7 @@ export default { ...@@ -1046,7 +1046,7 @@ export default {
var damHeight = (cumulationY - this.options.initY) / pxRetioY var damHeight = (cumulationY - this.options.initY) / pxRetioY
return (maxStepDepth.damHeight = damHeight), maxStepDepth return (maxStepDepth.damHeight = damHeight), maxStepDepth
}, },
drawDevice: function (list) { drawDevice: function(list) {
var lineW = 4 * this.dpr var lineW = 4 * this.dpr
var deviceW = 6 * this.dpr var deviceW = 6 * this.dpr
var deviceH = 3 * this.dpr var deviceH = 3 * this.dpr
...@@ -1069,7 +1069,7 @@ export default { ...@@ -1069,7 +1069,7 @@ export default {
size: fontSize, size: fontSize,
text: depthText, text: depthText,
color: 'red', color: 'red',
align: 'center', align: 'center'
}) })
var holeEndY = ladderSY + holeDistY var holeEndY = ladderSY + holeDistY
holeEndY = holeEndY > endY ? endY : holeEndY holeEndY = holeEndY > endY ? endY : holeEndY
...@@ -1079,7 +1079,7 @@ export default { ...@@ -1079,7 +1079,7 @@ export default {
ex: holeX, ex: holeX,
ey: holeEndY, ey: holeEndY,
width: lineW, width: lineW,
color: 'grey', color: 'grey'
}) })
var deviceLY = ladderSY + deviceY var deviceLY = ladderSY + deviceY
var deviceEY = deviceLY + deviceH / 2 var deviceEY = deviceLY + deviceH / 2
...@@ -1090,12 +1090,12 @@ export default { ...@@ -1090,12 +1090,12 @@ export default {
ex: holeX, ex: holeX,
ey: deviceEY, ey: deviceEY,
width: deviceW, width: deviceW,
color: '#3403CB', color: '#3403CB'
}) })
this.options.deviceCoords.push({ this.options.deviceCoords.push({
x: holeX, x: holeX,
y: deviceLY, y: deviceLY,
stepY: ladderSY, stepY: ladderSY
}) })
var valFont = 11 var valFont = 11
var valueSY = ~~(deviceSY - valFont * this.dpr - 6) var valueSY = ~~(deviceSY - valFont * this.dpr - 6)
...@@ -1106,180 +1106,202 @@ export default { ...@@ -1106,180 +1106,202 @@ export default {
size: valFont, size: valFont,
text: text, text: text,
color: 'white', color: 'white',
align: 'center', align: 'center'
}) })
} }
},
drawAlarmLine: function (alarms, Steps) {
var alarmValues = alarms.value
var alarmLevel = alarms.alarmLevel
var deviceCoords = this.options.deviceCoords || []
var deviceSX = deviceCoords[0].x
var deviceSY = deviceCoords[0].y
var initX = this.options.initX
var initY = this.options.initY
var endY = this.options.endY
var endX = this.options.endX
var alarmLevelNum = ['red', 'orange', 'yellow', 'blue'] || Object.keys(alarmValues)
var alarmLine = {}
// 显示所有报警线,而不是只显示当前级别和相邻级别
for (var i = 0; i < alarmLevelNum.length; i++) {
var levelColor = alarmLevelNum[i]
if (alarmValues[levelColor]) {
alarmLine[levelColor] = alarmValues[levelColor]
}
}
var alarmRealParam = this.getAlarmRealParam(Object.values(alarmLine)) || Steps.ratio
var deviceSlopeRatio = alarmRealParam.ratio
// 定义报警线样式配置
var alarmLineStyles = {
red: { width: 3, dashPattern: [] }, // 实线,较粗
orange: { width: 2, dashPattern: [5, 5] }, // 虚线
yellow: { width: 2, dashPattern: [2, 3] }, // 点线
blue: { width: 2, dashPattern: [8, 3, 2, 3] }, // 点划线
}
console.log('alarmLine对象:', alarmLine)
console.log('alarmValues对象:', alarmValues)
// 清除之前绘制的报警线(如果有的话)
// this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)
for (var key in alarmLine) {
var value = alarmValues[key]
console.log(`处理报警线: ${key}, 值: ${value}`)
if (key && value) {
var ladderSY = this.xPixelToStepsYPixel(deviceSX) - initX + 6
var lineSY = value * this.options.pxRetioY + ladderSY - (deviceSX - initX) * deviceSlopeRatio
var lineEX = (endY - lineSY) / deviceSlopeRatio
// 获取当前报警线的样式配置
var lineStyle = alarmLineStyles[key] || { width: 2, dashPattern: [] }
/**
* 新增逻辑处理绘制警戒线,超过边坡外的则不显示
2025年8月30日14:38:22
*/
const { ctx, alarmLevel, xPixelToStepsYPixel } = this
// 获取边坡线的x坐标数组(确保顺序一致)
const slopeXCoords = this.bianpoLinePoinArr.map(point => point.x)
const pointCount = slopeXCoords.length
// 警戒线的起始和终止坐标(用于分配平均坐标点集合)
const startPoint = { x: initX, y: lineSY + initY }
const endPoint = { x: lineEX, y: endY }
// 清空警戒线数组
this.jingjieLinePointArr = []
// 线性插值计算每个x对应的y值
slopeXCoords.forEach(x => {
// 计算当前x在起始点和终止点之间的比例
const t = (x - startPoint.x) / (endPoint.x - startPoint.x)
// 线性插值计算y值
const y = startPoint.y + t * (endPoint.y - startPoint.y)
// 存入警戒线数组
this.jingjieLinePointArr.push({ x, y })
})
// 获取边坡线的X坐标范围 // 在边坡两个水位值之间连红线
const slopeStartX = this.bianpoLinePoinArr[0].x var deviceCoords = this.options.deviceCoords || []
const slopeEndX = this.bianpoLinePoinArr[this.bianpoLinePoinArr.length - 1].x if (deviceCoords.length >= 2) {
for (var i = 0; i < deviceCoords.length - 1; i++) {
// 报警线的原始坐标 var currentDevice = deviceCoords[i]
const originalStartX = startPoint.x var nextDevice = deviceCoords[i + 1]
const originalEndX = endPoint.x
const originalStartY = startPoint.y
const originalEndY = endPoint.y
// 计算报警线的斜率
const slope = (originalEndY - originalStartY) / (originalEndX - originalStartX)
// 找到报警线与边坡线的所有交点
const allIntersections = []
// 遍历边坡线的每个线段,找到与报警线的交点
for (let i = 0; i < this.bianpoLinePoinArr.length - 1; i++) {
const slopePoint1 = this.bianpoLinePoinArr[i]
const slopePoint2 = this.bianpoLinePoinArr[i + 1]
// 计算报警线与当前边坡线段的交点
const intersection = this.getLineIntersection(
originalStartX,
originalStartY,
originalEndX,
originalEndY, // 报警线
slopePoint1.x,
slopePoint1.y,
slopePoint2.x,
slopePoint2.y // 边坡线段
)
if (intersection) {
allIntersections.push(intersection)
console.log(`${key}报警线找到交点:`, intersection.x, intersection.y, '在边坡线段', i)
}
}
// 使用最左和最右的交点作为截取点
let intersectionStartX = originalStartX
let intersectionStartY = originalStartY
let intersectionEndX = originalEndX
let intersectionEndY = originalEndY
if (allIntersections.length > 0) {
// 按X坐标排序
allIntersections.sort((a, b) => a.x - b.x)
// 使用最左边的交点作为起点
intersectionStartX = allIntersections[0].x
intersectionStartY = allIntersections[0].y
console.log(`${key}报警线新起点:`, intersectionStartX, intersectionStartY)
// 使用最右边的交点作为终点
const lastIntersection = allIntersections[allIntersections.length - 1]
intersectionEndX = lastIntersection.x
intersectionEndY = lastIntersection.y
console.log(`${key}报警线新终点:`, intersectionEndX, intersectionEndY)
} else {
console.log(`${key}报警线未找到交点,使用原始范围`)
}
// 绘制调整后的报警线 // 连接相邻两个设备的水位值位置
this.drawLiner({ this.drawLiner({
sx: intersectionStartX, sx: currentDevice.x,
sy: intersectionStartY, sy: currentDevice.y,
ex: intersectionEndX, ex: nextDevice.x,
ey: intersectionEndY, ey: nextDevice.y,
width: 2, width: 1,
color: key, color: 'blue'
}) })
console.log(`${key}报警线绘制成功 - 交点范围: ${intersectionStartX} to ${intersectionEndX}`)
console.log(`${key}报警线分段绘制完成 - 边坡范围: ${slopeStartX} to ${slopeEndX}`)
console.log(`${key}报警线原始范围: ${originalStartX} to ${originalEndX}`)
console.log('警戒线的值point', JSON.stringify(this.jingjieLinePointArr))
console.log('边坡X范围:', slopeStartX, 'to', slopeEndX)
console.log('报警线X范围:', originalStartX, 'to', originalEndX)
// this.drawLiner({
// sx: initX,
// sy: lineSY + initY,
// ex: lineEX,
// ey: endY,
// width: 2,
// color: key
// });
} }
} }
}, },
getCirHeightDev: function (r, x) { drawAlarmLine: function(alarms, Steps) {
// 隐藏报警线 - 直接返回,不绘制任何报警线
return
// var alarmValues = alarms.value
// var alarmLevel = alarms.alarmLevel
// var deviceCoords = this.options.deviceCoords || []
// var deviceSX = deviceCoords[0].x
// var deviceSY = deviceCoords[0].y
// var initX = this.options.initX
// var initY = this.options.initY
// var endY = this.options.endY
// var endX = this.options.endX
// var alarmLevelNum = ['red', 'orange', 'yellow', 'blue'] || Object.keys(alarmValues)
// var alarmLine = {}
// // 显示所有报警线,而不是只显示当前级别和相邻级别
// for (var i = 0; i < alarmLevelNum.length; i++) {
// var levelColor = alarmLevelNum[i]
// if (alarmValues[levelColor]) {
// alarmLine[levelColor] = alarmValues[levelColor]
// }
// }
// var alarmRealParam = this.getAlarmRealParam(Object.values(alarmLine)) || Steps.ratio
// var deviceSlopeRatio = alarmRealParam.ratio
// // 定义报警线样式配置
// var alarmLineStyles = {
// red: { width: 3, dashPattern: [] }, // 实线,较粗
// orange: { width: 2, dashPattern: [5, 5] }, // 虚线
// yellow: { width: 2, dashPattern: [2, 3] }, // 点线
// blue: { width: 2, dashPattern: [8, 3, 2, 3] } // 点划线
// }
// console.log('alarmLine对象:', alarmLine)
// console.log('alarmValues对象:', alarmValues)
// // 清除之前绘制的报警线(如果有的话)
// // this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)
// for (var key in alarmLine) {
// var value = alarmValues[key]
// console.log(`处理报警线: ${key}, 值: ${value}`)
// if (key && value) {
// var ladderSY = this.xPixelToStepsYPixel(deviceSX) - initX + 6
// var lineSY = value * this.options.pxRetioY + ladderSY - (deviceSX - initX) * deviceSlopeRatio
// var lineEX = (endY - lineSY) / deviceSlopeRatio
// // 获取当前报警线的样式配置
// var lineStyle = alarmLineStyles[key] || { width: 2, dashPattern: [] }
// /**
// * 新增逻辑处理绘制警戒线,超过边坡外的则不显示
// 2025年8月30日14:38:22
// */
// const { ctx, alarmLevel, xPixelToStepsYPixel } = this
// // 获取边坡线的x坐标数组(确保顺序一致)
// const slopeXCoords = this.bianpoLinePoinArr.map(point => point.x)
// const pointCount = slopeXCoords.length
// // 警戒线的起始和终止坐标(用于分配平均坐标点集合)
// const startPoint = { x: initX, y: lineSY + initY }
// const endPoint = { x: lineEX, y: endY }
// // 清空警戒线数组
// this.jingjieLinePointArr = []
// // 线性插值计算每个x对应的y值
// slopeXCoords.forEach(x => {
// // 计算当前x在起始点和终止点之间的比例
// const t = (x - startPoint.x) / (endPoint.x - startPoint.x)
// // 线性插值计算y值
// const y = startPoint.y + t * (endPoint.y - startPoint.y)
// // 存入警戒线数组
// this.jingjieLinePointArr.push({ x, y })
// })
// // 获取边坡线的X坐标范围
// const slopeStartX = this.bianpoLinePoinArr[0].x
// const slopeEndX = this.bianpoLinePoinArr[this.bianpoLinePoinArr.length - 1].x
// // 报警线的原始坐标
// const originalStartX = startPoint.x
// const originalEndX = endPoint.x
// const originalStartY = startPoint.y
// const originalEndY = endPoint.y
// // 计算报警线的斜率
// const slope = (originalEndY - originalStartY) / (originalEndX - originalStartX)
// // 找到报警线与边坡线的所有交点
// const allIntersections = []
// // 遍历边坡线的每个线段,找到与报警线的交点
// for (let i = 0; i < this.bianpoLinePoinArr.length - 1; i++) {
// const slopePoint1 = this.bianpoLinePoinArr[i]
// const slopePoint2 = this.bianpoLinePoinArr[i + 1]
// // 计算报警线与当前边坡线段的交点
// const intersection = this.getLineIntersection(
// originalStartX,
// originalStartY,
// originalEndX,
// originalEndY, // 报警线
// slopePoint1.x,
// slopePoint1.y,
// slopePoint2.x,
// slopePoint2.y // 边坡线段
// )
// if (intersection) {
// allIntersections.push(intersection)
// console.log(`${key}报警线找到交点:`, intersection.x, intersection.y, '在边坡线段', i)
// }
// }
// // 使用最左和最右的交点作为截取点
// let intersectionStartX = originalStartX
// let intersectionStartY = originalStartY
// let intersectionEndX = originalEndX
// let intersectionEndY = originalEndY
// if (allIntersections.length > 0) {
// // 按X坐标排序
// allIntersections.sort((a, b) => a.x - b.x)
// // 使用最左边的交点作为起点
// intersectionStartX = allIntersections[0].x
// intersectionStartY = allIntersections[0].y
// console.log(`${key}报警线新起点:`, intersectionStartX, intersectionStartY)
// // 使用最右边的交点作为终点
// const lastIntersection = allIntersections[allIntersections.length - 1]
// intersectionEndX = lastIntersection.x
// intersectionEndY = lastIntersection.y
// console.log(`${key}报警线新终点:`, intersectionEndX, intersectionEndY)
// } else {
// console.log(`${key}报警线未找到交点,使用原始范围`)
// }
// // 绘制调整后的报警线
// this.drawLiner({
// sx: intersectionStartX,
// sy: intersectionStartY,
// ex: intersectionEndX,
// ey: intersectionEndY,
// width: 2,
// color: key
// })
// console.log(`${key}报警线绘制成功 - 交点范围: ${intersectionStartX} to ${intersectionEndX}`)
// console.log(`${key}报警线分段绘制完成 - 边坡范围: ${slopeStartX} to ${slopeEndX}`)
// console.log(`${key}报警线原始范围: ${originalStartX} to ${originalEndX}`)
// console.log('警戒线的值point', JSON.stringify(this.jingjieLinePointArr))
// console.log('边坡X范围:', slopeStartX, 'to', slopeEndX)
// console.log('报警线X范围:', originalStartX, 'to', originalEndX)
// // this.drawLiner({
// // sx: initX,
// // sy: lineSY + initY,
// // ex: lineEX,
// // ey: endY,
// // width: 2,
// // color: key
// // });
// }
// }
},
getCirHeightDev: function(r, x) {
return r - Math.sqrt(Math.pow(r, 2) - Math.pow(x, 2)) return r - Math.sqrt(Math.pow(r, 2) - Math.pow(x, 2))
}, },
drawWaterArea: function (depth) { drawWaterArea: function(depth) {
depth = 100 depth = 100
var startAngle = this.options.waterArea.startAngle var startAngle = this.options.waterArea.startAngle
var radiusMultiple = this.options.waterArea.radius var radiusMultiple = this.options.waterArea.radius
...@@ -1311,7 +1333,7 @@ export default { ...@@ -1311,7 +1333,7 @@ export default {
ctx.fillStyle = '#00A2E8' ctx.fillStyle = '#00A2E8'
ctx.fill() ctx.fill()
}, },
byAngleAndHeightToCoord: function (angle, height) { byAngleAndHeightToCoord: function(angle, height) {
var devX = Math.tan(angle * 0.017453293) * height var devX = Math.tan(angle * 0.017453293) * height
var xy = height / Math.cos(angle * 0.017453293) var xy = height / Math.cos(angle * 0.017453293)
var devY = height - devX var devY = height - devX
...@@ -1319,9 +1341,9 @@ export default { ...@@ -1319,9 +1341,9 @@ export default {
var x = 0 var x = 0
var y = 0 var y = 0
if (angle > 50) { if (angle > 50) {
;(x = height), (y = devY * yRatio) (x = height), (y = devY * yRatio)
} else { } else {
;(x = devX), (y = 0) (x = devX), (y = 0)
} }
return { x: x, y: y, xy: xy } return { x: x, y: y, xy: xy }
}, },
...@@ -1337,7 +1359,7 @@ export default { ...@@ -1337,7 +1359,7 @@ export default {
var averageHeight = (damHeight - sum) / not var averageHeight = (damHeight - sum) / not
return { averageHeight: averageHeight, damHeight: damHeight } return { averageHeight: averageHeight, damHeight: damHeight }
}, },
setModule: function () { setModule: function() {
this.ctx.clearRect(0, 0, this.SumWidth, this.SumHeight) this.ctx.clearRect(0, 0, this.SumWidth, this.SumHeight)
var canvas = this.canvas var canvas = this.canvas
var SumWidth = (this.SumWidth = this.ctn.clientWidth * this.dpr - this.ctn.clientLeft - 0) var SumWidth = (this.SumWidth = this.ctn.clientWidth * this.dpr - this.ctn.clientLeft - 0)
...@@ -1367,7 +1389,7 @@ export default { ...@@ -1367,7 +1389,7 @@ export default {
this.options['HWRation'] = (endY - top) / (endX - left) this.options['HWRation'] = (endY - top) / (endX - left)
this.drawChart() this.drawChart()
}, },
formatDeviceParam: function (devices) { formatDeviceParam: function(devices) {
var devices = devices || [] var devices = devices || []
var arr = [] var arr = []
for (var item of devices) { for (var item of devices) {
...@@ -1376,12 +1398,12 @@ export default { ...@@ -1376,12 +1398,12 @@ export default {
holeDepth: item.jrx_trepanning, holeDepth: item.jrx_trepanning,
value: item.depth, value: item.depth,
depth: item.jrx_burial, depth: item.jrx_burial,
waterValue: item.stage, waterValue: item.stage
}) })
} }
return arr return arr
}, },
getAlarmRealParam: function (aValues) { getAlarmRealParam: function(aValues) {
var aval = aValues[0] var aval = aValues[0]
var coords = this.options.deviceCoords || [] var coords = this.options.deviceCoords || []
var valY = aval * this.options.pxRetioY var valY = aval * this.options.pxRetioY
...@@ -1396,7 +1418,7 @@ export default { ...@@ -1396,7 +1418,7 @@ export default {
} }
return { ratio: (ey - sy) / (ex - sx), sy: sy, ey: ey } return { ratio: (ey - sy) / (ex - sx), sy: sy, ey: ey }
}, },
drawChart: function () { drawChart: function() {
var Steps = this.drawSteps(this.ladders) var Steps = this.drawSteps(this.ladders)
this.drawAxis(this.options.axisColor, Steps.damHeight) this.drawAxis(this.options.axisColor, Steps.damHeight)
var depth = 55 var depth = 55
...@@ -1404,18 +1426,18 @@ export default { ...@@ -1404,18 +1426,18 @@ export default {
this.drawDevice(this.devices) this.drawDevice(this.devices)
this.drawAlarmLine(this.options.alarm, Steps) this.drawAlarmLine(this.options.alarm, Steps)
}, },
onresize: function () { onresize: function() {
qf.resize(() => { qf.resize(() => {
this.setModule() this.setModule()
}) })
}, },
updateData: function (data) { updateData: function(data) {
data = data || {} data = data || {}
this.stations = data.stations || this.stations this.stations = data.stations || this.stations
this.points = data.points || this.points this.points = data.points || this.points
this.draw(this.cacheX + this.destX, true) this.draw(this.cacheX + this.destX, true)
}, },
drawLiner: function (o) { drawLiner: function(o) {
var ctx = this.ctx var ctx = this.ctx
ctx.beginPath() ctx.beginPath()
ctx.moveTo(o.sx, o.sy) ctx.moveTo(o.sx, o.sy)
...@@ -1425,7 +1447,7 @@ export default { ...@@ -1425,7 +1447,7 @@ export default {
ctx.stroke() ctx.stroke()
}, },
// 计算两条线段的交点 // 计算两条线段的交点
getLineIntersection: function (x1, y1, x2, y2, x3, y3, x4, y4) { getLineIntersection: function(x1, y1, x2, y2, x3, y3, x4, y4) {
const denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4) const denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)
if (Math.abs(denom) < 1e-10) { if (Math.abs(denom) < 1e-10) {
return null // 平行线,无交点 return null // 平行线,无交点
...@@ -1438,13 +1460,13 @@ export default { ...@@ -1438,13 +1460,13 @@ export default {
if (t >= 0 && t <= 1 && u >= 0 && u <= 1) { if (t >= 0 && t <= 1 && u >= 0 && u <= 1) {
return { return {
x: x1 + t * (x2 - x1), x: x1 + t * (x2 - x1),
y: y1 + t * (y2 - y1), y: y1 + t * (y2 - y1)
} }
} }
return null // 无交点 return null // 无交点
}, },
drawText: function (o) { drawText: function(o) {
var ctx = this.ctx var ctx = this.ctx
var fontSize = (o.size || 14) * this.dpr var fontSize = (o.size || 14) * this.dpr
var text = o.text || '' var text = o.text || ''
...@@ -1493,18 +1515,18 @@ export default { ...@@ -1493,18 +1515,18 @@ export default {
ctx.fillText(rows[b], ~~lsx + 0.5, y + ~~lsy + 0.5) ctx.fillText(rows[b], ~~lsx + 0.5, y + ~~lsy + 0.5)
} }
}, },
getTextWidth: function (text, fontSize) { getTextWidth: function(text, fontSize) {
return (this.ctx.measureText(text).width / parseInt(this.ctx.font)) * fontSize return (this.ctx.measureText(text).width / parseInt(this.ctx.font)) * fontSize
}, },
drawImg: function (img, x, y, w, h) { drawImg: function(img, x, y, w, h) {
x = x - w / 2 x = x - w / 2
y = y - h y = y - h
ctx.drawImage(img, x, y, w, h) ctx.drawImage(img, x, y, w, h)
}, },
getRandomColor: function () { getRandomColor: function() {
return '#' + Math.floor(Math.random() * 16777215).toString(16) return '#' + Math.floor(Math.random() * 16777215).toString(16)
}, },
getEventTarget: function (x, y) { getEventTarget: function(x, y) {
if (y > bottomReferY - imgA.height - 1 && y < bottomReferY + 1) { if (y > bottomReferY - imgA.height - 1 && y < bottomReferY + 1) {
var arr = this.points var arr = this.points
var i = arr.length - 1 var i = arr.length - 1
...@@ -1532,7 +1554,7 @@ export default { ...@@ -1532,7 +1554,7 @@ export default {
} }
} }
}, },
xPixelToStepsYPixel: function (x) { xPixelToStepsYPixel: function(x) {
var ladders = this.Cache.ladders || [] var ladders = this.Cache.ladders || []
var ladderSY = 0 var ladderSY = 0
for (var ladder of ladders) { for (var ladder of ladders) {
...@@ -1549,18 +1571,18 @@ export default { ...@@ -1549,18 +1571,18 @@ export default {
return ladderSY return ladderSY
}, },
// 新增:生成线段采样点 // 新增:生成线段采样点
getSampledPoints: function (sx, sy, ex, ey, numPoints) { getSampledPoints: function(sx, sy, ex, ey, numPoints) {
const points = [] const points = []
const segmentCount = numPoints - 1 const segmentCount = numPoints - 1
for (let i = 0; i < numPoints; i++) { for (let i = 0; i < numPoints; i++) {
const t = i / segmentCount const t = i / segmentCount
points.push({ points.push({
x: sx + t * (ex - sx), x: sx + t * (ex - sx),
y: sy + t * (ey - sy), y: sy + t * (ey - sy)
}) })
} }
return points return points
}, }
} }
return new cuCharts(ctn, data, opts) return new cuCharts(ctn, data, opts)
}, },
...@@ -1574,7 +1596,7 @@ export default { ...@@ -1574,7 +1596,7 @@ export default {
className: 'screenAlart', className: 'screenAlart',
closeBtnColor: '#eee', closeBtnColor: '#eee',
html: '<div class="item"><span>解除时长(小时):</span><input data-name="jchours" value=12 placeholder="请输入解除时长"/></div><div class="item"><span>报警原因:</span><input data-name="reason" placeholder="报警原因"/></div><div class="item"><span>解除报警原因:</span><input data-name="jcreason" placeholder="解除报警原因"/></div>', html: '<div class="item"><span>解除时长(小时):</span><input data-name="jchours" value=12 placeholder="请输入解除时长"/></div><div class="item"><span>报警原因:</span><input data-name="reason" placeholder="报警原因"/></div><div class="item"><span>解除报警原因:</span><input data-name="jcreason" placeholder="解除报警原因"/></div>',
confirm: function (el) { confirm: function(el) {
var inputs = el.querySelectorAll('input') var inputs = el.querySelectorAll('input')
for (var el of inputs) { for (var el of inputs) {
var key = el.dataset.name var key = el.dataset.name
...@@ -1593,12 +1615,12 @@ export default { ...@@ -1593,12 +1615,12 @@ export default {
fn && fn() fn && fn()
}) })
}, },
close: function () { close: function() {
close && close() close && close()
}, }
}) })
}, }
}, }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment