main
fanluyan 2 months ago
parent 1678ca805a
commit 2427ffb570

@ -1,18 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
/>
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<!-- <title><%= webpackConfig.name %></title> -->
<title>状态检修管理平台</title>
<!-- <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script> -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script> 原来cdn 改成本地-->
<script src="<%= BASE_URL %>jquery.min2.js"></script>
</head>
<body>
<noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong
>We're sorry but <%= webpackConfig.name %> doesn't work properly without
JavaScript enabled. Please enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->

File diff suppressed because it is too large Load Diff

@ -16,49 +16,44 @@
@selection-change="handleSelection"
@row-dblclick="rowDoubleClick"
>
<el-table-column
type="index"
width="35"
/>
<el-table-column
type="selection"
width="45"
/>
<el-table-column type="index" width="35" />
<el-table-column type="selection" width="45" />
<el-table-column
prop="sensorCode"
label="传感器编号"
sortable
>
<el-table-column prop="sensorCode" label="传感器编号" sortable>
<template slot-scope="scope">
<el-input v-model="scope.row.sensorCode" placeholder="请输入传感器编号" @keyup.enter.native="saveFun($event, scope.row)" v-if="scope.row.isEdit" ></el-input>
<el-input
v-model="scope.row.sensorCode"
placeholder="请输入传感器编号"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit"
></el-input>
<span v-else>{{ scope.row.sensorCode }}</span>
</template>
</el-table-column>
<el-table-column
prop="sensorName"
label="传感器名称"
sortable
>
<el-table-column prop="sensorName" label="传感器名称" sortable>
<template slot-scope="scope">
<el-input
v-model="scope.row.sensorName"
placeholder="请输入传感器名称"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit" maxlength="100">
v-if="scope.row.isEdit"
maxlength="100"
>
</el-input>
<span v-else>{{ scope.row.sensorName }}</span>
</template>
</el-table-column>
<el-table-column
prop="sensorBrand"
label="标牌"
sortable
>
<el-table-column prop="sensorBrand" label="标牌" sortable>
<template slot-scope="scope">
<el-input v-model="scope.row.sensorBrand" placeholder="请输入标牌" @keyup.enter.native="saveFun($event, scope.row)" v-if="scope.row.isEdit" maxlength="50"></el-input>
<el-input
v-model="scope.row.sensorBrand"
placeholder="请输入标牌"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit"
maxlength="50"
></el-input>
<span v-else>{{ scope.row.sensorBrand }}</span>
</template>
</el-table-column>
@ -70,12 +65,18 @@
show-overflow-tooltip
>
<template slot-scope="scope">
<el-select v-model="scope.row.position" placeholder="请选择位安装位置" v-if="scope.row.isEdit" @keyup.enter.native="saveFun($event, scope.row)" >
<el-select
v-model="scope.row.position"
placeholder="请选择位安装位置"
v-if="scope.row.isEdit"
@keyup.enter.native="saveFun($event, scope.row)"
>
<el-option
v-for="item in positionList"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
<span v-else>{{ positionName(scope.row.position) }}</span>
@ -89,7 +90,13 @@
show-overflow-tooltip
>
<template slot-scope="scope">
<el-input v-model="scope.row.positionDes" placeholder="请输位置描述" @keyup.enter.native="saveFun($event, scope.row)" v-if="scope.row.isEdit" maxlength="100"></el-input>
<el-input
v-model="scope.row.positionDes"
placeholder="请输位置描述"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit"
maxlength="100"
></el-input>
<span v-else>{{ scope.row.positionDes }}</span>
</template>
</el-table-column>
@ -98,10 +105,16 @@
prop="growRate"
label="增长率(%)阈值"
sortable
width=150
width="150"
>
<template slot-scope="scope">
<el-input v-model="scope.row.growRate" placeholder="请输入增长率阈值" @keyup.enter.native="saveFun($event, scope.row)" v-if="scope.row.isEdit" maxlength="20"></el-input>
<el-input
v-model="scope.row.growRate"
placeholder="请输入增长率阈值"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit"
maxlength="20"
></el-input>
<span v-else>{{ scope.row.growRate }}</span>
</template>
</el-table-column>
@ -110,21 +123,28 @@
prop="warningValue"
label="预警值(℃)"
sortable
width=130
width="130"
>
<template slot-scope="scope">
<el-input v-model="scope.row.warningValue" placeholder="请输入预警值" @keyup.enter.native="saveFun($event, scope.row)" v-if="scope.row.isEdit" maxlength="10"></el-input>
<el-input
v-model="scope.row.warningValue"
placeholder="请输入预警值"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit"
maxlength="10"
></el-input>
<span v-else>{{ scope.row.warningValue }}</span>
</template>
</el-table-column>
<el-table-column
prop="manufactor"
label="生产厂家"
sortable
>
<el-table-column prop="manufactor" label="生产厂家" sortable>
<template slot-scope="scope">
<el-input v-model="scope.row.manufactor" placeholder="请输入生产厂家" @keyup.enter.native="saveFun($event, scope.row)" v-if="scope.row.isEdit"></el-input>
<el-input
v-model="scope.row.manufactor"
placeholder="请输入生产厂家"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit"
></el-input>
<span v-else>{{ scope.row.manufactor }}</span>
</template>
</el-table-column>
@ -133,34 +153,33 @@
prop="productionDate"
label="设备生产时间"
sortable
width=150
width="150"
>
<template slot-scope="scope">
<el-date-picker
@keyup.enter.native="saveFun($event, scope.row)" v-if="scope.row.isEdit"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit"
v-model="scope.row.productionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="设备生产时间"
width=150
width="150"
>
</el-date-picker>
<span v-else>{{ scope.row.productionDate }}</span>
</template>
</el-table-column>
<el-table-column
prop="useDate"
label="设备投运时间"
sortable
>
<el-table-column prop="useDate" label="设备投运时间" sortable>
<template slot-scope="scope">
<el-date-picker
@keyup.enter.native="saveFun($event, scope.row)" v-if="scope.row.isEdit"
@keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit"
v-model="scope.row.useDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="设备投运时间">
placeholder="设备投运时间"
>
</el-date-picker>
<span v-else>{{ scope.row.useDate }}</span>
</template>
@ -179,137 +198,185 @@
</el-tab-pane>
<el-tab-pane label="关联变压器" name="1">
<div class="btnStyle moduleTable">
<bindingIsUnbound :getTransformeData="getTransformeData" :getCurrentTransformerData="getCurrentTransformerData" @bindingClick="bindingClick" @unbundleClick="unbundleClick"></bindingIsUnbound>
<bindingIsUnbound
:getTransformeData="getTransformeData"
:getCurrentTransformerData="getCurrentTransformerData"
@bindingClick="bindingClick"
@unbundleClick="unbundleClick"
></bindingIsUnbound>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { PAGE_CONFIG } from '@/commons/constant'
import bindingIsUnbound from '../components/bindingIsUnbound'
import { busiTemperPointQueryList, addBusiTemperPoint, deleteBusiTemperPoint, updateBusiTemperPoint,saveRelationship,
getTransformerList,getCurrentTransformerInfo,cancelRelationship} from '@/api/user'
import { PAGE_CONFIG } from "@/commons/constant";
import bindingIsUnbound from "../components/bindingIsUnbound";
import {
busiTemperPointQueryList,
addBusiTemperPoint,
deleteBusiTemperPoint,
updateBusiTemperPoint,
saveRelationship,
getTransformerList,
getCurrentTransformerInfo,
cancelRelationship,
} from "@/api/user";
export default {
name: 'MeasuringTemperatureList',
name: "MeasuringTemperatureList",
components: {
bindingIsUnbound
bindingIsUnbound,
},
data() {
return {
getTransformeData: [],
getCurrentTransformerData: {},
activeName:'0',
activeName: "0",
searchParam: {
...PAGE_CONFIG
...PAGE_CONFIG,
},
tableParam: {
multipleSelection: [],
count: 0,
data: [],
isLoading: false
isLoading: false,
},
selectionStart: [],
// dialogVisible: false,
// 1: A线 2: B线 3: C线 4: A线 5: B线 6: C线 7 8
positionList: [{
value: '1',
label: 'A相进线'
}, {
value: '2',
label: 'B相进线'
}, {
value: '3',
label: 'C相进线'
}, {
value: '4',
label: 'A相出线'
}, {
value: '5',
label: 'B相出线'
}, {
value: '6',
label: 'C相出线'
}, {
value: '7',
label: '柜内'
}, {
value: '8',
label: '柜外监测点'
}]
}
positionList: [
{
value: "1",
label: "A相进线",
},
mounted() {
{
value: "2",
label: "B相进线",
},
{
value: "3",
label: "C相进线",
},
{
value: "4",
label: "A相出线",
},
{
value: "5",
label: "B相出线",
},
{
value: "6",
label: "C相出线",
},
{
value: "7",
label: "位置1",
},
{
value: "8",
label: "位置2",
},
{
value: "9",
label: "位置3",
},
{
value: "10",
label: "位置4",
},
{
value: "11",
label: "位置5",
},
{
value: "12",
label: "位置6",
},
{
value: "13",
label: "柜内",
},
{
value: "14",
label: "柜外监测点",
},
],
};
},
mounted() {},
created() {
this.queryPage()
this.queryPage();
},
methods: {
handleClick(tab) {
if(tab.label === '测温开关柜'){
this.queryPage()
}else if(tab.label === '关联变压器'){
this.refreshTable()
if (tab.label === "测温开关柜") {
this.queryPage();
} else if (tab.label === "关联变压器") {
this.refreshTable();
}
},
//
bindingClick(row) {
this.$confirm('是否要绑定当前变压器, 是否继续?', '绑定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$confirm("是否要绑定当前变压器, 是否继续?", "绑定", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
const params = {
equipmentId: this.$route.params.id,
transformerId: row.transformerId
}
saveRelationship(params).then(res=>{
transformerId: row.transformerId,
};
saveRelationship(params).then((res) => {
if (res.code === 0) {
this.$message.success('绑定成功')
this.refreshTable()
this.$message.success("绑定成功");
this.refreshTable();
}
});
})
}).catch(() => {
.catch(() => {
this.$message({
type: 'info',
message: '已取消绑定'
type: "info",
message: "已取消绑定",
});
});
},
unbundleClick(row) {
this.$confirm('是否要取消绑定当前变压器, 是否继续?', '取消绑定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$confirm("是否要取消绑定当前变压器, 是否继续?", "取消绑定", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
const params = {
equipmentId: this.$route.params.id,
transformerId: row.transformerId
}
cancelRelationship(params).then(res=>{
transformerId: row.transformerId,
};
cancelRelationship(params).then((res) => {
if (res.code === 0) {
this.$message.success('取消绑定成功')
this.refreshTable()
this.$message.success("取消绑定成功");
this.refreshTable();
}
});
})
}).catch(() => {
.catch(() => {
this.$message({
type: 'info',
message: '已取消绑定'
type: "info",
message: "已取消绑定",
});
});
},
refreshTable() {
getTransformerList(this.$route.params.siteId,this.$route.params.id).then(res=>{
getTransformerList(this.$route.params.siteId, this.$route.params.id).then(
(res) => {
if (res.code === 0 && res.data) {
this.getTransformeData = res.data
this.getTransformeData = res.data;
}
})
}
);
// getCurrentTransformerInfo(this.$route.params.id).then(res=>{
// if (res.code === 0 && res.data) {
// this.getCurrentTransformerData = res.data
@ -318,102 +385,104 @@ export default {
},
//
async queryPage(page) {
page && (this.searchParam.page = page)
this.searchParam.siteId = this.$route.params.siteId
this.searchParam.equipmentId = this.$route.params.id
this.tableParam.isLoading = true
let res = {}
page && (this.searchParam.page = page);
this.searchParam.siteId = this.$route.params.siteId;
this.searchParam.equipmentId = this.$route.params.id;
this.tableParam.isLoading = true;
let res = {};
try {
res = await busiTemperPointQueryList(this.searchParam)
res = await busiTemperPointQueryList(this.searchParam);
} finally {
this.tableParam.isLoading = false
this.tableParam.isLoading = false;
}
this.tableParam = { ...this.tableParam, ...res }
this.tableParam = { ...this.tableParam, ...res };
},
//
async addFun() {
this.tableParam.isLoading = true
let res = {}
this.tableParam.isLoading = true;
let res = {};
try {
res = await addBusiTemperPoint({
siteId: this.$route.params.siteId,
equipmentId: this.$route.params.id
})
this.queryPage(1)
equipmentId: this.$route.params.id,
});
this.queryPage(1);
} finally {
this.tableParam.isLoading = false
this.tableParam.isLoading = false;
}
},
// checkbox
handleSelection(selection) {
this.selectionStart = selection
this.$emit('selectionEmit', selection)
this.selectionStart = selection;
this.$emit("selectionEmit", selection);
},
//
async saveFun(event, item) {
this.tableParam.isLoading = true
this.tableParam.isLoading = true;
try {
await updateBusiTemperPoint(item).then(() => {
this.$message.success('保存成功')
await updateBusiTemperPoint(item)
.then(() => {
this.$message.success("保存成功");
this.queryPage();
item.isEdit = false;
}).catch((e) => {})
})
.catch((e) => {});
} finally {
this.tableParam.isLoading = false
this.tableParam.isLoading = false;
}
},
//
deleteFun() {
if (this.selectionStart.length) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let ids = []
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let ids = [];
this.selectionStart.forEach((e, index) => {
ids[index] = e.id
ids[index] = e.id;
});
deleteBusiTemperPoint(ids).then(() => this.queryPage());
})
deleteBusiTemperPoint(ids).then(() => this.queryPage())
}).catch(() => {
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
type: "info",
message: "已取消删除",
});
});
} else {
this.$message.error('请选择一条记录')
this.$message.error("请选择一条记录");
}
},
//
handleSizeChange(val) {
console.log(`每页 ${val}`)
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.searchParam.page = val
this.queryPage()
this.searchParam.page = val;
this.queryPage();
},
//
handleClose(done) {
done()
done();
},
dialogVisibleFun() {
console.log(this.selectionStart, 852)
console.log(this.selectionStart, 852);
for (let i = 0; i < this.selectionStart.length; i++) {
this.selectionStart.forEach((item, index) => {
this.tableData.forEach((v, i) => {
if (item.id === v.id) {
this.tableData.splice(i, 1)
this.tableData.splice(i, 1);
}
})
})
});
});
}
this.dialogVisible = false
this.dialogVisible = false;
},
// //
// rowDoubleClick(row, column, event){
@ -428,49 +497,49 @@ export default {
//
rowDoubleClick(row, column, event) {
//
let unSaveData = this.getUnSaveData()
let unSaveData = this.getUnSaveData();
if (!unSaveData) {
row.isEdit = true;
(this.tableParam.data || []).forEach((e, index) => {
if (row.id != e.id) {
e.isEdit = false
e.isEdit = false;
}
})
return
});
return;
}
this.saveDataTip(event, unSaveData)
this.saveDataTip(event, unSaveData);
},
saveDataTip(event, unSaveData) {
this.$confirm('表格中存在未保存的数据,是否现在保存?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}).then(() => {
this.saveFun(event, unSaveData)
}).catch(() => {
});
this.$confirm("表格中存在未保存的数据,是否现在保存?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
})
.then(() => {
this.saveFun(event, unSaveData);
})
.catch(() => {});
},
getUnSaveData() {
for (let index in this.tableParam.data) {
let itemData = this.tableParam.data[index]
let itemData = this.tableParam.data[index];
if (itemData.isEdit) {
return itemData
return itemData;
}
}
return null
return null;
},
positionName(position) {
let label;
this.positionList.forEach(e => {
this.positionList.forEach((e) => {
if (e.value == position) {
label = e.label;
}
});
return label;
}
}
}
},
},
};
</script>
<style lang="scss" scoped>
.measuringTemperatureList {

@ -1,7 +1,7 @@
<template>
<div class="equipmentTab">
<div class="equipmentTabSize">
<img src="@/assets/image/Kgg.jpg" alt="">
<img src="@/assets/image/Kgg.jpg" alt="" />
<div class="one1">
<p>开关柜名称{{ busiKggData.switchgearName }}</p>
<p>站点设备编号{{ busiKggData.siteCode }}</p>
@ -237,9 +237,9 @@
</template>
<script>
import { PAGE_CONFIG } from '@/commons/constant'
import SwitchgearScutcheon from '../components/SwitchgearScutcheon'
import bindingIsUnbound from '../components/bindingIsUnbound'
import { PAGE_CONFIG } from "@/commons/constant";
import SwitchgearScutcheon from "../components/SwitchgearScutcheon";
import bindingIsUnbound from "../components/bindingIsUnbound";
import {
getSwitchgearBrandInfo,
saveSwitchgearBrandInfo,
@ -249,309 +249,334 @@ import {
busiTemperPointQueryList,
addBusiTemperPoint,
deleteBusiTemperPoint,
updateBusiTemperPoint
} from '@/api/user'
updateBusiTemperPoint,
} from "@/api/user";
export default {
name: 'SwitchgearTab',
name: "SwitchgearTab",
components: {
SwitchgearScutcheon,
bindingIsUnbound
bindingIsUnbound,
},
data() {
return {
busiKggData: {},
limit: 5,
page: 1,
activeName: 'first',
tableChangeKgg: '',
activeName: "first",
tableChangeKgg: "",
SwitchgearData: {},
SwitchgearDataPop: {},
getTransformeData: [],
getCurrentTransformerData: {},
selectionStart: [],
searchParam: {
...PAGE_CONFIG
...PAGE_CONFIG,
},
tableParam: {
multipleSelection: [],
count: 0,
data: [],
isLoading: false
isLoading: false,
},
positionList: [
{
value: '1',
label: 'A相进线'
value: "1",
label: "A相进线",
},
{
value: '2',
label: 'B相进线'
value: "2",
label: "B相进线",
},
{
value: '3',
label: 'C相进线'
value: "3",
label: "C相进线",
},
{
value: '4',
label: 'A相出线'
value: "4",
label: "A相出线",
},
{
value: '5',
label: 'B相出线'
value: "5",
label: "B相出线",
},
{
value: '6',
label: 'C相出线'
value: "6",
label: "C相出线",
},
{
value: '7',
label: '柜内'
value: "7",
label: "位置1",
},
{
value: '8',
label: '柜外监测点'
}
]
}
value: "8",
label: "位置2",
},
{
value: "9",
label: "位置3",
},
{
value: "10",
label: "位置4",
},
{
value: "11",
label: "位置5",
},
{
value: "12",
label: "位置6",
},
{
value: "13",
label: "柜内",
},
{
value: "14",
label: "柜外监测点",
},
],
};
},
computed: {
auth: function () {
return this.$$hasAuth(this.atoms.GISanalysisParameter.GIStab, false)
}
return this.$$hasAuth(this.atoms.GISanalysisParameter.GIStab, false);
},
},
watch: {
$route() {
this.init()
this.init();
},
SwitchgearData(val) {
this.SwitchgearDataPop = val
}
this.SwitchgearDataPop = val;
},
},
created() {
this.init()
this.swithcgearBrandInfo()
this.init();
this.swithcgearBrandInfo();
},
methods: {
bindingClick(row) {
this.$confirm('是否要绑定当前变压器, 是否继续?', '绑定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
this.$confirm("是否要绑定当前变压器, 是否继续?", "绑定", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
const params = {
equipmentId: this.$route.params.id,
transformerId: row.transformerId
}
transformerId: row.transformerId,
};
saveRelationship(params).then((res) => {
if (res.code === 0) {
this.$message.success('绑定成功')
this.refreshTable()
this.$message.success("绑定成功");
this.refreshTable();
}
})
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消绑定'
})
})
type: "info",
message: "已取消绑定",
});
});
},
unbundleClick(row) {
this.$confirm('是否要取消绑定当前变压器, 是否继续?', '取消绑定', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
this.$confirm("是否要取消绑定当前变压器, 是否继续?", "取消绑定", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
const params = {
equipmentId: this.$route.params.id,
transformerId: row.transformerId
}
transformerId: row.transformerId,
};
cancelRelationship(params).then((res) => {
if (res.code === 0) {
this.$message.success('取消绑定成功')
this.refreshTable()
this.$message.success("取消绑定成功");
this.refreshTable();
}
})
});
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消绑定'
})
})
type: "info",
message: "已取消绑定",
});
});
},
init() {
this.swithcgearBrandInfo()
this.activeName = 'first'
this.swithcgearBrandInfo();
this.activeName = "first";
},
//
swithcgearBrandInfo() {
getSwitchgearBrandInfo(this.$route.params.siteId, this.$route.params.id).then(
(res) => {
getSwitchgearBrandInfo(
this.$route.params.siteId,
this.$route.params.id
).then((res) => {
if (res.data) {
this.busiKggData = res.data
this.busiKggData = res.data;
if (this.busiKggData.factoryTime) {
this.busiKggData.factoryTime =
this.busiKggData.factoryTime.substring(0, 10)
this.busiKggData.factoryTime.substring(0, 10);
}
}
}
)
});
},
// --
submitForm(kggFormData) {
kggFormData.mainEquipmentId = this.$route.params.id
kggFormData.siteId = this.$route.params.siteId
kggFormData.mainEquipmentId = this.$route.params.id;
kggFormData.siteId = this.$route.params.siteId;
saveSwitchgearBrandInfo(kggFormData).then((res) => {
if (res.code === 0) {
this.$message.success('保存成功')
this.$message.success("保存成功");
}
})
});
},
//
handleClick(tab, event) {
this.tableChangeKgg = tab.label
if (this.tableChangeKgg === '测温开关柜') {
this.queryPage()
} else if (this.tableChangeKgg === '关联变压器') {
this.refreshTable()
this.tableChangeKgg = tab.label;
if (this.tableChangeKgg === "测温开关柜") {
this.queryPage();
} else if (this.tableChangeKgg === "关联变压器") {
this.refreshTable();
}
},
refreshTable() {
getTransformerList(this.$route.params.siteId, this.$route.params.id).then(
(res) => {
if (res.code === 0 && res.data) {
this.getTransformeData = res.data
this.getTransformeData = res.data;
}
}
)
);
},
//
async saveFun(event, item) {
this.tableParam.isLoading = true
this.tableParam.isLoading = true;
try {
await updateBusiTemperPoint(item)
.then(() => {
this.$message.success('保存成功')
this.queryPage()
item.isEdit = false
this.$message.success("保存成功");
this.queryPage();
item.isEdit = false;
})
.catch((e) => {})
.catch((e) => {});
} finally {
this.tableParam.isLoading = false
this.tableParam.isLoading = false;
}
},
//
async addFun() {
console.log('============', this.$route.params.id)
this.tableParam.isLoading = true
let res = {}
console.log("============", this.$route.params.id);
this.tableParam.isLoading = true;
let res = {};
try {
res = await addBusiTemperPoint({
siteId: this.$route.params.siteId,
equipmentId: this.$route.params.id
})
this.queryPage(1)
equipmentId: this.$route.params.id,
});
this.queryPage(1);
} finally {
this.tableParam.isLoading = false
this.tableParam.isLoading = false;
}
},
//
async queryPage(page) {
page && (this.searchParam.page = page)
this.searchParam.siteId = this.$route.params.siteId
this.searchParam.equipmentId = this.$route.params.id
this.tableParam.isLoading = true
let res = {}
page && (this.searchParam.page = page);
this.searchParam.siteId = this.$route.params.siteId;
this.searchParam.equipmentId = this.$route.params.id;
this.tableParam.isLoading = true;
let res = {};
try {
res = await busiTemperPointQueryList(this.searchParam)
res = await busiTemperPointQueryList(this.searchParam);
} finally {
this.tableParam.isLoading = false
this.tableParam.isLoading = false;
}
this.tableParam = { ...this.tableParam, ...res }
this.tableParam = { ...this.tableParam, ...res };
},
//
deleteFun() {
if (this.selectionStart.length) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
const ids = []
const ids = [];
this.selectionStart.forEach((e, index) => {
ids[index] = e.id
})
deleteBusiTemperPoint(ids).then(() => this.queryPage())
ids[index] = e.id;
});
deleteBusiTemperPoint(ids).then(() => this.queryPage());
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
type: "info",
message: "已取消删除",
});
});
} else {
this.$message.error('请选择一条记录')
this.$message.error("请选择一条记录");
}
},
// checkbox
handleSelection(selection) {
this.selectionStart = selection
this.$emit('selectionEmit', selection)
this.selectionStart = selection;
this.$emit("selectionEmit", selection);
},
//
rowDoubleClick(row, column, event) {
//
const unSaveData = this.getUnSaveData()
const unSaveData = this.getUnSaveData();
if (!unSaveData) {
row.isEdit = true;
(this.tableParam.data || []).forEach((e, index) => {
if (row.id != e.id) {
e.isEdit = false
e.isEdit = false;
}
})
return
});
return;
}
this.saveDataTip(event, unSaveData)
this.saveDataTip(event, unSaveData);
},
saveDataTip(event, unSaveData) {
this.$confirm('表格中存在未保存的数据,是否现在保存?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
this.$confirm("表格中存在未保存的数据,是否现在保存?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
})
.then(() => {
this.saveFun(event, unSaveData)
this.saveFun(event, unSaveData);
})
.catch(() => {})
.catch(() => {});
},
getUnSaveData() {
for (const index in this.tableParam.data) {
const itemData = this.tableParam.data[index]
const itemData = this.tableParam.data[index];
if (itemData.isEdit) {
return itemData
return itemData;
}
}
return null
return null;
},
positionName(position) {
let label
let label;
this.positionList.forEach((e) => {
if (e.value == position) {
label = e.label
label = e.label;
}
})
return label
});
return label;
},
handleCurrentChange(val) {
this.searchParam.page = val
this.queryPage()
}
}
}
this.searchParam.page = val;
this.queryPage();
},
},
};
</script>
<style lang="scss" scoped>
.equipmentTab {
@ -630,4 +655,3 @@ export default {
}
}
</style>

Loading…
Cancel
Save