|
@@ -68,7 +68,7 @@
|
|
prop="longitude"
|
|
prop="longitude"
|
|
align="center"
|
|
align="center"
|
|
label="经度"
|
|
label="经度"
|
|
- width="200"
|
|
|
|
|
|
+ min-width="200"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
@@ -76,12 +76,17 @@
|
|
prop="latitude"
|
|
prop="latitude"
|
|
align="center"
|
|
align="center"
|
|
label="纬度"
|
|
label="纬度"
|
|
- width="200"
|
|
|
|
|
|
+ min-width="200"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="state" align="center" label="状态" width="100">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="state"
|
|
|
|
+ align="center"
|
|
|
|
+ label="状态"
|
|
|
|
+ min-width="100"
|
|
|
|
+ >
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
- {{ row.state == 1 ? '启用' : '停用' }}
|
|
|
|
|
|
+ {{ row.state == 1 ? "启用" : "停用" }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="createTime" align="center" label="创建时间">
|
|
<el-table-column prop="createTime" align="center" label="创建时间">
|
|
@@ -91,7 +96,7 @@
|
|
align="center"
|
|
align="center"
|
|
fixed="right"
|
|
fixed="right"
|
|
label="操作"
|
|
label="操作"
|
|
- width="200"
|
|
|
|
|
|
+ min-width="200"
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button @click="compile(scope.row)" type="text" size="small"
|
|
<el-button @click="compile(scope.row)" type="text" size="small"
|
|
@@ -180,7 +185,7 @@
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
v-for="(tower, index) in anemometerTowerHeightDtoList || [
|
|
v-for="(tower, index) in anemometerTowerHeightDtoList || [
|
|
- { anemometerHeight: '' }
|
|
|
|
|
|
+ { anemometerHeight: '' },
|
|
]"
|
|
]"
|
|
:key="index"
|
|
:key="index"
|
|
class="condition"
|
|
class="condition"
|
|
@@ -205,7 +210,7 @@
|
|
<p>测风塔编号:{{ hightower.anemometerCode }}</p>
|
|
<p>测风塔编号:{{ hightower.anemometerCode }}</p>
|
|
<p>经度:{{ hightower.longitude }}</p>
|
|
<p>经度:{{ hightower.longitude }}</p>
|
|
<p>维度:{{ hightower.latitude }}</p>
|
|
<p>维度:{{ hightower.latitude }}</p>
|
|
- <p>状态: {{ hightower.state === 1 ? '启用' : '停用' }}</p>
|
|
|
|
|
|
+ <p>状态: {{ hightower.state === 1 ? "启用" : "停用" }}</p>
|
|
<p v-for="(item, index) in cftList" :key="index">
|
|
<p v-for="(item, index) in cftList" :key="index">
|
|
测风塔高度:{{ item.anemometerHeight }}米
|
|
测风塔高度:{{ item.anemometerHeight }}米
|
|
</p>
|
|
</p>
|
|
@@ -220,29 +225,29 @@ import {
|
|
getAnemometerTower,
|
|
getAnemometerTower,
|
|
getAnemometerTowerPage,
|
|
getAnemometerTowerPage,
|
|
updateAnemometerTower,
|
|
updateAnemometerTower,
|
|
- updateAnemometerTowerState
|
|
|
|
-} from '@/api/ledger.js'
|
|
|
|
|
|
+ updateAnemometerTowerState,
|
|
|
|
+} from "@/api/ledger.js";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
tableData: [],
|
|
tableData: [],
|
|
formInline: {
|
|
formInline: {
|
|
- anemometerName: '',
|
|
|
|
|
|
+ anemometerName: "",
|
|
timeQuantum: [],
|
|
timeQuantum: [],
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- totalSize: 0
|
|
|
|
|
|
+ totalSize: 0,
|
|
},
|
|
},
|
|
- startDate: '',
|
|
|
|
- endDate: '',
|
|
|
|
|
|
+ startDate: "",
|
|
|
|
+ endDate: "",
|
|
// 新增测风塔信息
|
|
// 新增测风塔信息
|
|
- anemometerName: '',
|
|
|
|
- latitude: '',
|
|
|
|
- longitude: '',
|
|
|
|
|
|
+ anemometerName: "",
|
|
|
|
+ latitude: "",
|
|
|
|
+ longitude: "",
|
|
anemometerTowerHeightDtoList: [
|
|
anemometerTowerHeightDtoList: [
|
|
{
|
|
{
|
|
- anemometerHeight: ''
|
|
|
|
- }
|
|
|
|
|
|
+ anemometerHeight: "",
|
|
|
|
+ },
|
|
],
|
|
],
|
|
errors: [],
|
|
errors: [],
|
|
hightower: [],
|
|
hightower: [],
|
|
@@ -250,28 +255,28 @@ export default {
|
|
// 新增信息
|
|
// 新增信息
|
|
nuedialog: false,
|
|
nuedialog: false,
|
|
unusualdialog: false,
|
|
unusualdialog: false,
|
|
- title: '',
|
|
|
|
|
|
+ title: "",
|
|
isEdit: false,
|
|
isEdit: false,
|
|
- detail: {}
|
|
|
|
- }
|
|
|
|
|
|
+ detail: {},
|
|
|
|
+ };
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.onSubmit()
|
|
|
|
|
|
+ this.onSubmit();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
rowStyle() {
|
|
rowStyle() {
|
|
- return 'text-align:center'
|
|
|
|
|
|
+ return "text-align:center";
|
|
},
|
|
},
|
|
onDateChange(date) {
|
|
onDateChange(date) {
|
|
if (Array.isArray(date)) {
|
|
if (Array.isArray(date)) {
|
|
- this.startDate = this.$formatDate(date[0])
|
|
|
|
- this.endDate = this.$formatDate(date[1])
|
|
|
|
|
|
+ this.startDate = this.$formatDate(date[0]);
|
|
|
|
+ this.endDate = this.$formatDate(date[1]);
|
|
if (this.endDate < this.startDate) {
|
|
if (this.endDate < this.startDate) {
|
|
- this.endDate = this.startDate
|
|
|
|
|
|
+ this.endDate = this.startDate;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- this.startDate = null
|
|
|
|
- this.endDate = null
|
|
|
|
|
|
+ this.startDate = null;
|
|
|
|
+ this.endDate = null;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -282,194 +287,196 @@ export default {
|
|
beginTime: this.startDate || undefined,
|
|
beginTime: this.startDate || undefined,
|
|
endTime: this.endDate || undefined,
|
|
endTime: this.endDate || undefined,
|
|
pageNum: this.formInline.pageNum,
|
|
pageNum: this.formInline.pageNum,
|
|
- pageSize: this.formInline.pageSize
|
|
|
|
- }
|
|
|
|
|
|
+ pageSize: this.formInline.pageSize,
|
|
|
|
+ };
|
|
getAnemometerTowerPage(paramsData).then((res) => {
|
|
getAnemometerTowerPage(paramsData).then((res) => {
|
|
- this.tableData = res.data.list
|
|
|
|
- this.formInline.totalSize = res.data.totalSize
|
|
|
|
- })
|
|
|
|
|
|
+ this.tableData = res.data.list;
|
|
|
|
+ this.formInline.totalSize = res.data.totalSize;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
reset() {
|
|
reset() {
|
|
- this.formInline.anemometerName = ''
|
|
|
|
- this.formInline.timeQuantum = []
|
|
|
|
- this.endDate = ''
|
|
|
|
- this.startDate = ''
|
|
|
|
|
|
+ this.formInline.anemometerName = "";
|
|
|
|
+ this.formInline.timeQuantum = [];
|
|
|
|
+ this.endDate = "";
|
|
|
|
+ this.startDate = "";
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetForm() {
|
|
resetForm() {
|
|
- this.anemometerName = ''
|
|
|
|
- this.latitude = ''
|
|
|
|
- this.longitude = ''
|
|
|
|
|
|
+ this.anemometerName = "";
|
|
|
|
+ this.latitude = "";
|
|
|
|
+ this.longitude = "";
|
|
this.anemometerTowerHeightDtoList = [
|
|
this.anemometerTowerHeightDtoList = [
|
|
{
|
|
{
|
|
- anemometerHeight: ''
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ anemometerHeight: "",
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
},
|
|
},
|
|
//打开新增
|
|
//打开新增
|
|
newnuedialog() {
|
|
newnuedialog() {
|
|
- this.nuedialog = true
|
|
|
|
- this.title = '新增'
|
|
|
|
|
|
+ this.nuedialog = true;
|
|
|
|
+ this.title = "新增";
|
|
},
|
|
},
|
|
// 新增提交
|
|
// 新增提交
|
|
newly() {
|
|
newly() {
|
|
const isEmptyAnemometerHeight = this.anemometerTowerHeightDtoList.some(
|
|
const isEmptyAnemometerHeight = this.anemometerTowerHeightDtoList.some(
|
|
(tower) =>
|
|
(tower) =>
|
|
!tower.anemometerHeight || !tower.anemometerHeight.toString().trim()
|
|
!tower.anemometerHeight || !tower.anemometerHeight.toString().trim()
|
|
- )
|
|
|
|
|
|
+ );
|
|
|
|
|
|
if (isEmptyAnemometerHeight) {
|
|
if (isEmptyAnemometerHeight) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '测风塔高度不能为空',
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
|
|
+ message: "测风塔高度不能为空",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
// Other validation checks
|
|
// Other validation checks
|
|
if (!this.anemometerName) {
|
|
if (!this.anemometerName) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '请填写测风塔名称',
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
|
|
+ message: "请填写测风塔名称",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if (!this.latitude) {
|
|
if (!this.latitude) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '请填写纬度',
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
|
|
+ message: "请填写纬度",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if (!this.longitude) {
|
|
if (!this.longitude) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '请填写经度',
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
|
|
+ message: "请填写经度",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
let paramsData = {
|
|
let paramsData = {
|
|
anemometerName: this.anemometerName,
|
|
anemometerName: this.anemometerName,
|
|
latitude: this.latitude,
|
|
latitude: this.latitude,
|
|
longitude: this.longitude,
|
|
longitude: this.longitude,
|
|
- }
|
|
|
|
|
|
+ };
|
|
if (!this.isEdit) {
|
|
if (!this.isEdit) {
|
|
- paramsData.anemometerTowerHeightDtoList=this.anemometerTowerHeightDtoList
|
|
|
|
|
|
+ paramsData.anemometerTowerHeightDtoList =
|
|
|
|
+ this.anemometerTowerHeightDtoList;
|
|
createAnemometerTower(paramsData).then((res) => {
|
|
createAnemometerTower(paramsData).then((res) => {
|
|
- this.nuedialog = false
|
|
|
|
- this.$message.success('新增成功')
|
|
|
|
- this.onSubmit()
|
|
|
|
- })
|
|
|
|
|
|
+ this.nuedialog = false;
|
|
|
|
+ this.$message.success("新增成功");
|
|
|
|
+ this.onSubmit();
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- paramsData.anemometerTowerHeightListDtos=this.anemometerTowerHeightDtoList
|
|
|
|
- paramsData.anemometerCode = this.detail.anemometerCode
|
|
|
|
|
|
+ paramsData.anemometerTowerHeightListDtos =
|
|
|
|
+ this.anemometerTowerHeightDtoList;
|
|
|
|
+ paramsData.anemometerCode = this.detail.anemometerCode;
|
|
// delete objectval.parentCode
|
|
// delete objectval.parentCode
|
|
updateAnemometerTower(paramsData).then((res) => {
|
|
updateAnemometerTower(paramsData).then((res) => {
|
|
- this.isEdit = false
|
|
|
|
- this.nuedialog = false
|
|
|
|
- this.onSubmit()
|
|
|
|
- this.$message.success('编辑成功')
|
|
|
|
- })
|
|
|
|
|
|
+ this.isEdit = false;
|
|
|
|
+ this.nuedialog = false;
|
|
|
|
+ this.onSubmit();
|
|
|
|
+ this.$message.success("编辑成功");
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- this.resetForm()
|
|
|
|
|
|
+ this.resetForm();
|
|
},
|
|
},
|
|
|
|
|
|
// 查看详情
|
|
// 查看详情
|
|
particulars(row) {
|
|
particulars(row) {
|
|
getAnemometerTower({ anemometerCode: row.anemometerCode }).then((res) => {
|
|
getAnemometerTower({ anemometerCode: row.anemometerCode }).then((res) => {
|
|
- this.hightower = res.data
|
|
|
|
- this.cftList = res.data.list
|
|
|
|
- })
|
|
|
|
- this.unusualdialog = true
|
|
|
|
|
|
+ this.hightower = res.data;
|
|
|
|
+ this.cftList = res.data.list;
|
|
|
|
+ });
|
|
|
|
+ this.unusualdialog = true;
|
|
},
|
|
},
|
|
// 启用/停用
|
|
// 启用/停用
|
|
start(row, type) {
|
|
start(row, type) {
|
|
let objectval = {
|
|
let objectval = {
|
|
anemometerCode: row.anemometerCode,
|
|
anemometerCode: row.anemometerCode,
|
|
- state: type === 0 ? 0 : 1
|
|
|
|
- }
|
|
|
|
|
|
+ state: type === 0 ? 0 : 1,
|
|
|
|
+ };
|
|
updateAnemometerTowerState(objectval).then((res) => {
|
|
updateAnemometerTowerState(objectval).then((res) => {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '状态已更新成功',
|
|
|
|
- type: 'success'
|
|
|
|
- })
|
|
|
|
|
|
+ message: "状态已更新成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
// this.$message(`${type === 1 ? '状态已更新成功' : '状态已更新成功'}`);
|
|
// this.$message(`${type === 1 ? '状态已更新成功' : '状态已更新成功'}`);
|
|
- row.state = type === 1 ? 0 : 1
|
|
|
|
- this.onSubmit()
|
|
|
|
- })
|
|
|
|
|
|
+ row.state = type === 1 ? 0 : 1;
|
|
|
|
+ this.onSubmit();
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 删除
|
|
// 删除
|
|
deleted(row) {
|
|
deleted(row) {
|
|
- console.log(row, 'row')
|
|
|
|
- if (row.state == '1') {
|
|
|
|
|
|
+ console.log(row, "row");
|
|
|
|
+ if (row.state == "1") {
|
|
this.$message({
|
|
this.$message({
|
|
- type: 'error',
|
|
|
|
- message: '该项处于启用状态,无法删除!'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "该项处于启用状态,无法删除!",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- this.$confirm('此操作将永久删除该文件,是否继续?', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
|
|
+ this.$confirm("此操作将永久删除该文件,是否继续?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
delAnemometerTower({ anemometerCode: row.anemometerCode }).then(
|
|
delAnemometerTower({ anemometerCode: row.anemometerCode }).then(
|
|
(res) => {
|
|
(res) => {
|
|
- this.onSubmit()
|
|
|
|
|
|
+ this.onSubmit();
|
|
// 执行删除操作
|
|
// 执行删除操作
|
|
this.$message({
|
|
this.$message({
|
|
- type: 'success',
|
|
|
|
- message: '删除成功!'
|
|
|
|
- })
|
|
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "删除成功!",
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- )
|
|
|
|
|
|
+ );
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|
|
// 取消删除
|
|
// 取消删除
|
|
this.$message({
|
|
this.$message({
|
|
- type: 'info',
|
|
|
|
- message: '已取消删除'
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ type: "info",
|
|
|
|
+ message: "已取消删除",
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 编辑
|
|
// 编辑
|
|
compile(row) {
|
|
compile(row) {
|
|
- this.title = '编辑'
|
|
|
|
- this.isEdit = true
|
|
|
|
|
|
+ this.title = "编辑";
|
|
|
|
+ this.isEdit = true;
|
|
getAnemometerTower({ anemometerCode: row.anemometerCode }).then((res) => {
|
|
getAnemometerTower({ anemometerCode: row.anemometerCode }).then((res) => {
|
|
- this.hightower = res.data
|
|
|
|
- this.cftList = res.data.list
|
|
|
|
- const item = JSON.parse(JSON.stringify(res.data))
|
|
|
|
- this.detail = item
|
|
|
|
- this.anemometerName = item.anemometerName
|
|
|
|
- this.latitude = item.latitude
|
|
|
|
- this.longitude = item.longitude
|
|
|
|
- this.anemometerTowerHeightDtoList = this.cftList
|
|
|
|
- this.nuedialog = true
|
|
|
|
- })
|
|
|
|
|
|
+ this.hightower = res.data;
|
|
|
|
+ this.cftList = res.data.list;
|
|
|
|
+ const item = JSON.parse(JSON.stringify(res.data));
|
|
|
|
+ this.detail = item;
|
|
|
|
+ this.anemometerName = item.anemometerName;
|
|
|
|
+ this.latitude = item.latitude;
|
|
|
|
+ this.longitude = item.longitude;
|
|
|
|
+ this.anemometerTowerHeightDtoList = this.cftList;
|
|
|
|
+ this.nuedialog = true;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
//分页数据切换
|
|
//分页数据切换
|
|
handleCurrentChange(val) {
|
|
handleCurrentChange(val) {
|
|
- this.formInline.pageNum = val
|
|
|
|
- this.onSubmit()
|
|
|
|
|
|
+ this.formInline.pageNum = val;
|
|
|
|
+ this.onSubmit();
|
|
},
|
|
},
|
|
|
|
|
|
// 测风塔高度
|
|
// 测风塔高度
|
|
addition() {
|
|
addition() {
|
|
- this.anemometerTowerHeightDtoList.push({ anemometerHeight: '' })
|
|
|
|
|
|
+ this.anemometerTowerHeightDtoList.push({ anemometerHeight: "" });
|
|
},
|
|
},
|
|
subtraction() {
|
|
subtraction() {
|
|
if (this.anemometerTowerHeightDtoList.length > 1) {
|
|
if (this.anemometerTowerHeightDtoList.length > 1) {
|
|
// Ensure at least one input remains
|
|
// Ensure at least one input remains
|
|
- this.anemometerTowerHeightDtoList.pop()
|
|
|
|
|
|
+ this.anemometerTowerHeightDtoList.pop();
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|