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

@ -16,50 +16,45 @@
@selection-change="handleSelection" @selection-change="handleSelection"
@row-dblclick="rowDoubleClick" @row-dblclick="rowDoubleClick"
> >
<el-table-column <el-table-column type="index" width="35" />
type="index" <el-table-column type="selection" width="45" />
width="35"
/>
<el-table-column
type="selection"
width="45"
/>
<el-table-column <el-table-column prop="sensorCode" label="传感器编号" sortable>
prop="sensorCode"
label="传感器编号"
sortable
>
<template slot-scope="scope"> <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
<span v-else>{{scope.row.sensorCode}}</span> 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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="sensorName" label="传感器名称" sortable>
prop="sensorName"
label="传感器名称"
sortable
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.sensorName" v-model="scope.row.sensorName"
placeholder="请输入传感器名称" placeholder="请输入传感器名称"
@keyup.enter.native="saveFun($event, scope.row)" @keyup.enter.native="saveFun($event, scope.row)"
v-if="scope.row.isEdit" maxlength="100"> 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"
label="标牌"
sortable
>
<template slot-scope="scope"> <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
<span v-else>{{scope.row.sensorBrand}}</span> 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> </template>
</el-table-column> </el-table-column>
@ -70,15 +65,21 @@
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
v-model="scope.row.position"
placeholder="请选择位安装位置"
v-if="scope.row.isEdit"
@keyup.enter.native="saveFun($event, scope.row)"
>
<el-option <el-option
v-for="item in positionList" v-for="item in positionList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
<span v-else>{{positionName(scope.row.position)}}</span> <span v-else>{{ positionName(scope.row.position) }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -89,8 +90,14 @@
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"
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> </template>
</el-table-column> </el-table-column>
@ -98,11 +105,17 @@
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"
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> </template>
</el-table-column> </el-table-column>
@ -110,22 +123,29 @@
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"
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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="manufactor" label="生产厂家" sortable>
prop="manufactor"
label="生产厂家"
sortable
>
<template slot-scope="scope"> <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
<span v-else>{{scope.row.manufactor}}</span> 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> </template>
</el-table-column> </el-table-column>
@ -133,36 +153,35 @@
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-if="scope.row.isEdit"
v-model="scope.row.productionDate" v-model="scope.row.productionDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="设备生产时间" placeholder="设备生产时间"
width=150 width="150"
> >
</el-date-picker> </el-date-picker>
<span v-else>{{scope.row.productionDate}}</span> <span v-else>{{ scope.row.productionDate }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="useDate" label="设备投运时间" sortable>
prop="useDate"
label="设备投运时间"
sortable
>
<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-if="scope.row.isEdit"
v-model="scope.row.useDate" v-model="scope.row.useDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="设备投运时间"> placeholder="设备投运时间"
>
</el-date-picker> </el-date-picker>
<span v-else>{{scope.row.useDate}}</span> <span v-else>{{ scope.row.useDate }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -179,137 +198,185 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="关联变压器" name="1"> <el-tab-pane label="关联变压器" name="1">
<div class="btnStyle moduleTable"> <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> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </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: '3',
label: 'C相进线'
}, {
value: '4',
label: 'A相出线'
}, {
value: '5',
label: 'B相出线'
}, {
value: '6',
label: 'C相出线'
}, {
value: '7',
label: '柜内'
}, {
value: '8',
label: '柜外监测点'
}]
}
}, },
mounted() { {
value: "2",
label: "B相进线",
},
{
value: "3",
label: "C相进线",
},
{
value: "4",
label: "A相出线",
},
{
value: "5",
label: "B相出线",
},
{
value: "6",
label: "C相出线",
}, },
created(){ {
this.queryPage() 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();
}, },
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(
(res) => {
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
this.getTransformeData = res.data this.getTransformeData = res.data;
} }
}) }
);
// getCurrentTransformerInfo(this.$route.params.id).then(res=>{ // getCurrentTransformerInfo(this.$route.params.id).then(res=>{
// if (res.code === 0 && res.data) { // if (res.code === 0 && res.data) {
// this.getCurrentTransformerData = res.data // this.getCurrentTransformerData = res.data
@ -317,103 +384,105 @@ export default {
// }) // })
}, },
// //
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(() => {
let 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("请选择一条记录");
} }
}, },
// //
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){
@ -428,55 +497,55 @@ 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,
this.$route.params.id
).then((res) => {
if (res.data) { if (res.data) {
this.busiKggData = res.data this.busiKggData = res.data;
if (this.busiKggData.factoryTime) { if (this.busiKggData.factoryTime) {
this.busiKggData.factoryTime = this.busiKggData.factoryTime =
this.busiKggData.factoryTime.substring(0, 10) 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