main
fanluyan 2 months ago
parent 1678ca805a
commit 2427ffb570

@ -1,18 +1,25 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <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"> <meta
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> 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><%= webpackConfig.name %></title> -->
<title>状态检修管理平台</title> <title>状态检修管理平台</title>
<!-- <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script> --> <!-- <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> </head>
<body> <body>
<noscript> <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> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->

File diff suppressed because it is too large Load Diff

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

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

Loading…
Cancel
Save