= ref([])
function fetchDev() {
- getDevList('').then(res => {
+ getDevList('').then((res) => {
monitorList.value = res.data
})
// getLineList('', '').then((res) => {
@@ -63,9 +63,9 @@
}
function changeMonitor() {
- showAdd.value = false;
+ showAdd.value = false
listQuery.lineNum = ''
- getLineList('', listQuery.monitorId).then(res => {
+ getLineList('', listQuery.monitorId).then((res) => {
lineList.value = res.data
})
fetchData()
@@ -93,7 +93,7 @@
list.value = res.data.rows
total.value = res.data.total
loading.value = false
- }
+ },
)
}
@@ -105,7 +105,7 @@
}
editDialog.value.initDialog(
'create',
- monitorList.value.filter(item => item.id === listQuery.monitorId)[0]
+ monitorList.value.filter(item => item.id === listQuery.monitorId)[0],
)
}
// 编辑
@@ -128,15 +128,15 @@
ElMessageBox.confirm(`确定要删除${row.serialName}吗?`, '确认删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
- type: 'warning'
+ type: 'warning',
}).then(() => {
const params = {
deviceIp: row.ip,
command: 'presetDel',
- presetIndex: row.id,
+ presetIndex: row.serialNum,
cruiseRoute: row.lineNum,
presetName: row.serialName,
- cruiseName: row.lineName
+ cruiseName: row.lineName,
}
HCPreset(params).then(() => {
ElMessage.success('删除成功')
@@ -149,16 +149,17 @@
function startLine() {
if (listQuery.monitorId === '' || listQuery.lineNum === '') {
ElMessage.warning('请选择巡航路径进行开启!')
- } else {
- let params = {
+ }
+ else {
+ const params = {
deviceIp: monitorList.value.filter(
- item => item.id === listQuery.monitorId
+ item => item.id === listQuery.monitorId,
)[0].ip,
command: 'start',
cruiseRoute: listQuery.lineNum,
- interval: '750'
+ interval: '750',
}
- handleCruise(params).then(res => {
+ handleCruise(params).then((res) => {
console.log(res)
})
}
@@ -168,15 +169,16 @@
function pauseLine() {
if (listQuery.monitorId === '' || listQuery.lineNum === '') {
ElMessage.warning('请选择巡航路径进行暂停!')
- } else {
- let params = {
+ }
+ else {
+ const params = {
deviceIp: monitorList.value.filter(
- item => item.id === listQuery.monitorId
+ item => item.id === listQuery.monitorId,
)[0].ip,
command: 'stop',
- interval: '750'
+ interval: '750',
}
- handleCruise(params).then(res => {
+ handleCruise(params).then((res) => {
console.log(res)
})
}
@@ -184,24 +186,25 @@
// 删除巡航线
function delLine() {
- showAdd.value = false;
+ showAdd.value = false
if (listQuery.monitorId === '' || listQuery.lineNum === '') {
ElMessage.warning('请选择巡航路径进行删除!')
- } else {
+ }
+ else {
ElMessageBox.confirm('确定要删除所选巡航路径吗?', '确认删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
- type: 'warning'
+ type: 'warning',
}).then(() => {
const param = {
deviceIp: monitorList.value.filter(
- item => item.id === listQuery.monitorId
+ item => item.id === listQuery.monitorId,
)[0].ip,
command: 'cruiseDelete',
cruiseValue: listQuery.lineNum,
cruiseName: monitorList.value.filter(
- item => item.id === listQuery.monitorId
- )[0].lineName
+ item => item.id === listQuery.monitorId,
+ )[0].lineName,
}
HCCruiseRoute(param).then(() => {
ElMessage.success('删除成功')
@@ -220,7 +223,7 @@
const width = Number(
getComputedStyle(document.documentElement)
.getPropertyValue('--g-sub-sidebar-width')
- .replace('px', '')
+ .replace('px', ''),
)
addLineDiv.style.left = `${
addLineBtn.getBoundingClientRect().left - width + 40
@@ -231,16 +234,18 @@
function addLine() {
if (listQuery.monitorId === '') {
ElMessage.warning('请选择设备')
- } else if (lineName.value === '') {
+ }
+ else if (lineName.value === '') {
ElMessage.warning('请填写巡航路径名称')
- } else {
+ }
+ else {
const param = {
deviceIp: monitorList.value.filter(
- item => item.id === listQuery.monitorId
+ item => item.id === listQuery.monitorId,
)[0].ip,
command: 'cruiseAdd',
cruiseName: lineName.value,
- cruiseValue: ''
+ cruiseValue: '',
}
HCCruiseRoute(param).then(() => {
ElMessage.success('巡航路径添加成功')
@@ -286,13 +291,11 @@
×
@@ -385,8 +388,8 @@
@click="edit(scope.row)"
/>