添加设备台账管理
parent
f5475266ad
commit
8071152134
@ -1 +1 @@
|
|||||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>cacfrontend</title><script defer="defer" src="static/js/chunk-vendors.ff5c292b.js"></script><script defer="defer" src="static/js/app.6a623dc1.js"></script><link href="static/css/app.c8924e65.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but cacfrontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>cacfrontend</title><script defer="defer" src="static/js/chunk-vendors.ff5c292b.js"></script><script defer="defer" src="static/js/app.588219af.js"></script><link href="static/css/app.c8924e65.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but cacfrontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
Binary file not shown.
Before Width: | Height: | Size: 59 KiB |
Binary file not shown.
Before Width: | Height: | Size: 77 KiB |
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
Binary file not shown.
After Width: | Height: | Size: 200 KiB |
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
@ -0,0 +1,128 @@
|
|||||||
|
<template>
|
||||||
|
<div class="bdzAddBox">
|
||||||
|
<el-dialog
|
||||||
|
class="bdzAddDialogBox"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="bdzDialogshow"
|
||||||
|
width="520px"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
label-position="left"
|
||||||
|
ref="formInfo"
|
||||||
|
label-width="104px"
|
||||||
|
:rules="rules"
|
||||||
|
:model="formInfo"
|
||||||
|
>
|
||||||
|
<el-form-item label="名称:" prop="mc">
|
||||||
|
<el-input v-model="formInfo.mc"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="坐标:" prop="coordinate">
|
||||||
|
<el-input v-model="formInfo.coordinate"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电压等级:" prop="voltagegrade">
|
||||||
|
<el-input v-model="formInfo.voltagegrade"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规模:" prop="scale">
|
||||||
|
<el-input v-model="formInfo.scale"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="描述:" prop="note">
|
||||||
|
<el-input v-model="formInfo.note"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="hide">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { bdzAddApi, bdzUpdateApi } from "@/utils/api/index";
|
||||||
|
export default {
|
||||||
|
props: ["title"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
bdzDialogshow: false,
|
||||||
|
formInfo: {},
|
||||||
|
rules: {
|
||||||
|
mc: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//判断
|
||||||
|
getdataform(val) {
|
||||||
|
console.log(val);
|
||||||
|
|
||||||
|
this.formInfo = JSON.parse(JSON.stringify(val));
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.formInfo.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.title == "添加电站") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
bdzAddApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "添加成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getbdzAllList(); //刷新
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
} else {
|
||||||
|
bdzUpdateApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "修改成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getbdzAllList(); //刷新
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("error submit!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
display() {
|
||||||
|
this.bdzDialogshow = true;
|
||||||
|
},
|
||||||
|
hide() {
|
||||||
|
this.bdzDialogshow = false;
|
||||||
|
this.$refs.formInfo.resetFields(); // 重置表单字段值
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.bdzAddBox {
|
||||||
|
.bdzAddDialogBox {
|
||||||
|
.el-input-number--small {
|
||||||
|
width: 374px;
|
||||||
|
.el-input__inner {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-input-number.is-controls-right[class*="small"] [class*="decrease"],
|
||||||
|
.el-input-number.is-controls-right[class*="small"] [class*="increase"] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<div class="bdzBox">
|
||||||
|
<div class="reportHead">
|
||||||
|
<h3>变电站管理</h3>
|
||||||
|
</div>
|
||||||
|
<div class="page-body">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddClick"
|
||||||
|
>添加电站</el-button
|
||||||
|
>
|
||||||
|
<div class="bdzTableBox">
|
||||||
|
<el-table
|
||||||
|
v-loading="bdzLoading"
|
||||||
|
:data="bdzTableData"
|
||||||
|
stripe
|
||||||
|
border
|
||||||
|
style="width: 100%"
|
||||||
|
height="calc(100% - 0px)"
|
||||||
|
>
|
||||||
|
<el-table-column prop="id" label="ID"> </el-table-column>
|
||||||
|
<el-table-column prop="mc" label="名称"> </el-table-column>
|
||||||
|
<el-table-column prop="coordinate" label="坐标"></el-table-column>
|
||||||
|
<el-table-column prop="voltagegrade" label="电压等级">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="scale" label="规模"> </el-table-column>
|
||||||
|
<el-table-column prop="note" label="描述"> </el-table-column>
|
||||||
|
<el-table-column label="操作" width="200" class-name="editClass">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="handleEditClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-document"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDeleteClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<addbdzDialog ref="bdzAddRef" :title="title"></addbdzDialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { bdzDeleteApi, bdzListAllApi } from "@/utils/api/index";
|
||||||
|
import addbdzDialog from "./components/addbdzDialog";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
addbdzDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
bdzLoading: false,
|
||||||
|
bdzTableData: [],
|
||||||
|
title: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
this.getbdzAllList();
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
getbdzAllList() {
|
||||||
|
this.bdzLoading = true;
|
||||||
|
bdzListAllApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.bdzTableData = res.data;
|
||||||
|
this.bdzLoading = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//新增
|
||||||
|
handleAddClick() {
|
||||||
|
this.title = "添加电站";
|
||||||
|
this.$refs.bdzAddRef.display();
|
||||||
|
//this.$refs.bdzAddRef.getdataform(null);
|
||||||
|
},
|
||||||
|
//修改
|
||||||
|
handleEditClick(data) {
|
||||||
|
this.title = "编辑";
|
||||||
|
this.$refs.bdzAddRef.display();
|
||||||
|
this.$refs.bdzAddRef.getdataform(data);
|
||||||
|
},
|
||||||
|
//删除数据
|
||||||
|
handleDeleteClick(data) {
|
||||||
|
this.$confirm("确定要删除记录吗?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
bdzDeleteApi({ id: data.id }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
this.getbdzAllList(); //刷新
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.bdzBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.page-body {
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
height: calc(100% - 74px);
|
||||||
|
padding: 12px;
|
||||||
|
background: #eee;
|
||||||
|
.bdzTableBox {
|
||||||
|
margin-top: 8px;
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,150 @@
|
|||||||
|
<template>
|
||||||
|
<div class="modevtypeAddBox">
|
||||||
|
<el-dialog
|
||||||
|
class="modevtypeAddDialogBox"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="modevtypeDialogshow"
|
||||||
|
width="520px"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
label-position="left"
|
||||||
|
ref="formInfo"
|
||||||
|
label-width="104px"
|
||||||
|
:rules="rules"
|
||||||
|
:model="formInfo"
|
||||||
|
>
|
||||||
|
<el-form-item label="设备名称:" prop="mc">
|
||||||
|
<el-input v-model="formInfo.mc"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="选择表名:">
|
||||||
|
<el-select v-model="formInfo.tablename">
|
||||||
|
<el-option
|
||||||
|
v-for="item in tableOptions"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="hide">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
modevtypeAddApi,
|
||||||
|
modevtypeUpdateApi,
|
||||||
|
tableListApi,
|
||||||
|
} from "@/utils/api/index";
|
||||||
|
export default {
|
||||||
|
props: ["title"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
modevtypeDialogshow: false,
|
||||||
|
formInfo: {},
|
||||||
|
rules: {
|
||||||
|
mc: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
tableOptions: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//判断
|
||||||
|
getdataform(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.formInfo = JSON.parse(JSON.stringify(val));
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.formInfo.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.title == "添加监测类型") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
modevtypeAddApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "添加成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getmodevtypeAllList(); //刷新
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: res.errorMsg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
} else {
|
||||||
|
modevtypeUpdateApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "修改成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getmodevtypeAllList(); //刷新
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: res.errorMsg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("error submit!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取table表名
|
||||||
|
gettableList() {
|
||||||
|
tableListApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.tableOptions = res.data;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
display() {
|
||||||
|
this.modevtypeDialogshow = true;
|
||||||
|
this.gettableList();
|
||||||
|
},
|
||||||
|
hide() {
|
||||||
|
this.modevtypeDialogshow = false;
|
||||||
|
this.$refs.formInfo.resetFields(); // 重置表单字段值
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.modevtypeAddBox {
|
||||||
|
.modevtypeAddDialogBox {
|
||||||
|
.el-select {
|
||||||
|
width: 376px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<div class="modevtypeBox">
|
||||||
|
<div class="reportHead">
|
||||||
|
<h3>监测设备类型管理</h3>
|
||||||
|
</div>
|
||||||
|
<div class="page-body">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddClick"
|
||||||
|
>添加监测类型</el-button
|
||||||
|
>
|
||||||
|
<div class="modevtypeTableBox">
|
||||||
|
<el-table
|
||||||
|
v-loading="modevtypeLoading"
|
||||||
|
:data="modevtypeTableData"
|
||||||
|
stripe
|
||||||
|
border
|
||||||
|
style="width: 100%"
|
||||||
|
height="calc(100% - 0px)"
|
||||||
|
>
|
||||||
|
<el-table-column prop="id" label="ID"> </el-table-column>
|
||||||
|
<el-table-column prop="mc" label="设备名称"> </el-table-column>
|
||||||
|
<el-table-column prop="tablename" label="表名"> </el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" width="200" class-name="editClass">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="handleEditClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-document"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDeleteClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<addmodevtypeDialog
|
||||||
|
ref="modevtypeAddRef"
|
||||||
|
:title="title"
|
||||||
|
></addmodevtypeDialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { modevtypeDeleteApi, modevtypeListAllApi } from "@/utils/api/index";
|
||||||
|
import addmodevtypeDialog from "./components/addmodevtypeDialog";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
addmodevtypeDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
modevtypeLoading: false,
|
||||||
|
modevtypeTableData: [],
|
||||||
|
title: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
this.getmodevtypeAllList();
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//获取所有区间间隔
|
||||||
|
getmodevtypeAllList() {
|
||||||
|
this.modevtypeLoading = true;
|
||||||
|
modevtypeListAllApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.modevtypeTableData = res.data;
|
||||||
|
this.modevtypeLoading = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//新增
|
||||||
|
handleAddClick() {
|
||||||
|
this.title = "添加监测类型";
|
||||||
|
this.$refs.modevtypeAddRef.display();
|
||||||
|
},
|
||||||
|
//修改
|
||||||
|
handleEditClick(data) {
|
||||||
|
this.title = "编辑";
|
||||||
|
this.$refs.modevtypeAddRef.display();
|
||||||
|
this.$refs.modevtypeAddRef.getdataform(data);
|
||||||
|
},
|
||||||
|
//删除数据
|
||||||
|
handleDeleteClick(data) {
|
||||||
|
this.$confirm("确定要删除记录吗?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
modevtypeDeleteApi({ id: data.id }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
this.getmodevtypeAllList(); //刷新
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.modevtypeBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.page-body {
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
height: calc(100% - 74px);
|
||||||
|
padding: 12px;
|
||||||
|
background: #eee;
|
||||||
|
.modevtypeTableBox {
|
||||||
|
margin-top: 8px;
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,139 @@
|
|||||||
|
<template>
|
||||||
|
<div class="qyjgAddBox">
|
||||||
|
<el-dialog
|
||||||
|
class="qyjgAddDialogBox"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="qyjgDialogshow"
|
||||||
|
width="520px"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
label-position="left"
|
||||||
|
ref="formInfo"
|
||||||
|
label-width="104px"
|
||||||
|
:rules="rules"
|
||||||
|
:model="formInfo"
|
||||||
|
>
|
||||||
|
<el-form-item label="名称:" prop="mc">
|
||||||
|
<el-input v-model="formInfo.mc"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属电站:">
|
||||||
|
<el-select v-model="formInfo.bdzid">
|
||||||
|
<el-option
|
||||||
|
v-for="item in bdzOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.mc"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="hide">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { areaAddApi, areaUpdateApi, bdzListAllApi } from "@/utils/api/index";
|
||||||
|
export default {
|
||||||
|
props: ["title"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
qyjgDialogshow: false,
|
||||||
|
formInfo: {
|
||||||
|
bdzid: "",
|
||||||
|
mc: "",
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
mc: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
bdzOptions: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//判断
|
||||||
|
getdataform(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.formInfo = JSON.parse(JSON.stringify(val));
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.formInfo.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.title == "添加区域") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
areaAddApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "添加成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getAreaAllList(); //刷新
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
} else {
|
||||||
|
areaUpdateApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "修改成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getAreaAllList(); //刷新
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("error submit!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取所有电站列表
|
||||||
|
getbdzListAll() {
|
||||||
|
bdzListAllApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.bdzOptions = res.data;
|
||||||
|
console.log(this.title);
|
||||||
|
if (this.title == "添加区域") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
this.formInfo.bdzid = this.bdzOptions[0].id;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
display() {
|
||||||
|
this.qyjgDialogshow = true;
|
||||||
|
this.getbdzListAll();
|
||||||
|
},
|
||||||
|
hide() {
|
||||||
|
this.qyjgDialogshow = false;
|
||||||
|
this.$refs.formInfo.resetFields(); // 重置表单字段值
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.qyjgAddBox {
|
||||||
|
.qyjgAddDialogBox {
|
||||||
|
.el-select {
|
||||||
|
width: 376px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,134 @@
|
|||||||
|
<template>
|
||||||
|
<div class="qyjgBox">
|
||||||
|
<div class="reportHead">
|
||||||
|
<h3>区域管理</h3>
|
||||||
|
</div>
|
||||||
|
<div class="page-body">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddClick"
|
||||||
|
>添加区域</el-button
|
||||||
|
>
|
||||||
|
<div class="qyjgTableBox">
|
||||||
|
<el-table
|
||||||
|
v-loading="qyjgLoading"
|
||||||
|
:data="qyjgTableData"
|
||||||
|
stripe
|
||||||
|
border
|
||||||
|
style="width: 100%"
|
||||||
|
height="calc(100% - 0px)"
|
||||||
|
>
|
||||||
|
<el-table-column prop="id" label="ID"> </el-table-column>
|
||||||
|
<el-table-column prop="mc" label="区域名称"> </el-table-column>
|
||||||
|
<el-table-column prop="bdzName" label="所属电站"> </el-table-column>
|
||||||
|
<el-table-column label="操作" width="200" class-name="editClass">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="handleEditClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-document"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDeleteClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<addqyjgDialog ref="qyjgAddRef" :title="title"></addqyjgDialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { areaDeleteApi, areaListAllApi } from "@/utils/api/index";
|
||||||
|
import addqyjgDialog from "./components/addqyjgDialog";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
addqyjgDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
qyjgLoading: false,
|
||||||
|
qyjgTableData: [],
|
||||||
|
title: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
this.getAreaAllList();
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//获取所有区间间隔
|
||||||
|
getAreaAllList() {
|
||||||
|
this.qyjgLoading = true;
|
||||||
|
areaListAllApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.qyjgTableData = res.data;
|
||||||
|
this.qyjgLoading = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//新增
|
||||||
|
handleAddClick() {
|
||||||
|
this.title = "添加区域";
|
||||||
|
this.$refs.qyjgAddRef.display();
|
||||||
|
//this.$refs.qyjgAddRef.getdataform(null);
|
||||||
|
},
|
||||||
|
//修改
|
||||||
|
handleEditClick(data) {
|
||||||
|
this.title = "编辑";
|
||||||
|
this.$refs.qyjgAddRef.display();
|
||||||
|
this.$refs.qyjgAddRef.getdataform(data);
|
||||||
|
},
|
||||||
|
//删除数据
|
||||||
|
handleDeleteClick(data) {
|
||||||
|
this.$confirm("确定要删除记录吗?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
areaDeleteApi({ id: data.id }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
this.getAreaAllList(); //刷新
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.qyjgBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.page-body {
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
height: calc(100% - 74px);
|
||||||
|
padding: 12px;
|
||||||
|
background: #eee;
|
||||||
|
.qyjgTableBox {
|
||||||
|
margin-top: 8px;
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,109 @@
|
|||||||
|
<template>
|
||||||
|
<div class="sblxAddBox">
|
||||||
|
<el-dialog
|
||||||
|
class="sblxAddDialogBox"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="sblxDialogshow"
|
||||||
|
width="520px"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
label-position="left"
|
||||||
|
ref="formInfo"
|
||||||
|
label-width="104px"
|
||||||
|
:rules="rules"
|
||||||
|
:model="formInfo"
|
||||||
|
>
|
||||||
|
<el-form-item label="名称:" prop="mc">
|
||||||
|
<el-input v-model="formInfo.mc"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="hide">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { sblxAddApi, sblxUpdateApi } from "@/utils/api/index";
|
||||||
|
export default {
|
||||||
|
props: ["title"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sblxDialogshow: false,
|
||||||
|
formInfo: {},
|
||||||
|
rules: {
|
||||||
|
mc: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
bdzOptions: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//判断
|
||||||
|
getdataform(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.formInfo = JSON.parse(JSON.stringify(val));
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.formInfo.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.title == "添加设备类型") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
sblxAddApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "添加成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getsblxAllList(); //刷新
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
} else {
|
||||||
|
sblxUpdateApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "修改成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getsblxAllList(); //刷新
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("error submit!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
display() {
|
||||||
|
this.sblxDialogshow = true;
|
||||||
|
},
|
||||||
|
hide() {
|
||||||
|
this.sblxDialogshow = false;
|
||||||
|
this.$refs.formInfo.resetFields(); // 重置表单字段值
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.sblxAddBox {
|
||||||
|
.sblxAddDialogBox {
|
||||||
|
.el-select {
|
||||||
|
width: 376px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,133 @@
|
|||||||
|
<template>
|
||||||
|
<div class="sblxBox">
|
||||||
|
<div class="reportHead">
|
||||||
|
<h3>设备类型管理</h3>
|
||||||
|
</div>
|
||||||
|
<div class="page-body">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddClick"
|
||||||
|
>添加设备类型</el-button
|
||||||
|
>
|
||||||
|
<div class="sblxTableBox">
|
||||||
|
<el-table
|
||||||
|
v-loading="sblxLoading"
|
||||||
|
:data="sblxTableData"
|
||||||
|
stripe
|
||||||
|
border
|
||||||
|
style="width: 100%"
|
||||||
|
height="calc(100% - 0px)"
|
||||||
|
>
|
||||||
|
<el-table-column prop="id" label="ID"> </el-table-column>
|
||||||
|
<el-table-column prop="mc" label="设备名称"> </el-table-column>
|
||||||
|
<el-table-column label="操作" width="200" class-name="editClass">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="handleEditClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-document"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDeleteClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<addsblxDialog ref="sblxAddRef" :title="title"></addsblxDialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { sblxDeleteApi, sblxListAllApi } from "@/utils/api/index";
|
||||||
|
import addsblxDialog from "./components/addsblxDialog";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
addsblxDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sblxLoading: false,
|
||||||
|
sblxTableData: [],
|
||||||
|
title: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
this.getsblxAllList();
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//获取所有区间间隔
|
||||||
|
getsblxAllList() {
|
||||||
|
this.sblxLoading = true;
|
||||||
|
sblxListAllApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.sblxTableData = res.data;
|
||||||
|
this.sblxLoading = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//新增
|
||||||
|
handleAddClick() {
|
||||||
|
this.title = "添加设备类型";
|
||||||
|
this.$refs.sblxAddRef.display();
|
||||||
|
//this.$refs.sblxAddRef.getdataform(null);
|
||||||
|
},
|
||||||
|
//修改
|
||||||
|
handleEditClick(data) {
|
||||||
|
this.title = "编辑";
|
||||||
|
this.$refs.sblxAddRef.display();
|
||||||
|
this.$refs.sblxAddRef.getdataform(data);
|
||||||
|
},
|
||||||
|
//删除数据
|
||||||
|
handleDeleteClick(data) {
|
||||||
|
this.$confirm("确定要删除记录吗?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
sblxDeleteApi({ id: data.id }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
this.getsblxAllList(); //刷新
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.sblxBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.page-body {
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
height: calc(100% - 74px);
|
||||||
|
padding: 12px;
|
||||||
|
background: #eee;
|
||||||
|
.sblxTableBox {
|
||||||
|
margin-top: 8px;
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,211 @@
|
|||||||
|
<template>
|
||||||
|
<div class="zsbAddBox">
|
||||||
|
<el-dialog
|
||||||
|
class="zsbAddDialogBox"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="zsbDialogshow"
|
||||||
|
width="520px"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
label-position="left"
|
||||||
|
ref="formInfo"
|
||||||
|
label-width="104px"
|
||||||
|
:rules="rules"
|
||||||
|
:model="formInfo"
|
||||||
|
>
|
||||||
|
<el-form-item label="所属电站:">
|
||||||
|
<el-select v-model="formInfo.bdzid" @change="changeJg">
|
||||||
|
<el-option
|
||||||
|
v-for="item in bdzOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.mc"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属区域:">
|
||||||
|
<el-select v-model="formInfo.jgid">
|
||||||
|
<el-option
|
||||||
|
v-for="item in jgOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.mc"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备类型:">
|
||||||
|
<el-select v-model="formInfo.lxid">
|
||||||
|
<el-option
|
||||||
|
v-for="item in sblxOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.mc"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备名称:" prop="mc">
|
||||||
|
<el-input v-model="formInfo.mc"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="hide">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
zsbAddApi,
|
||||||
|
zsbUpdateApi,
|
||||||
|
bdzListAllApi,
|
||||||
|
areaListAllApi,
|
||||||
|
sblxListAllApi,
|
||||||
|
} from "@/utils/api/index";
|
||||||
|
export default {
|
||||||
|
props: ["title"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
zsbDialogshow: false,
|
||||||
|
formInfo: {
|
||||||
|
bdzid: "",
|
||||||
|
jgid: "",
|
||||||
|
mc: "",
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
mc: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
bdzOptions: [],
|
||||||
|
jgOptions: [],
|
||||||
|
sblxOptions: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//判断
|
||||||
|
getdataform(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.formInfo = JSON.parse(JSON.stringify(val));
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.formInfo.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.title == "添加主设备") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
zsbAddApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "添加成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getzsbAllList(); //刷新
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
} else {
|
||||||
|
zsbUpdateApi(this.formInfo)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
message: "修改成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.hide();
|
||||||
|
this.$parent.getzsbAllList(); //刷新
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("error submit!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取所有电站列表
|
||||||
|
getbdzListAll() {
|
||||||
|
bdzListAllApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.bdzOptions = res.data;
|
||||||
|
console.log(this.title);
|
||||||
|
if (this.title == "添加主设备") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
this.formInfo.bdzid = this.bdzOptions[0].id;
|
||||||
|
}
|
||||||
|
this.getareaListAll();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//选中电站展示区域
|
||||||
|
changeJg(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.formInfo.bdzid = val;
|
||||||
|
this.getareaListAll();
|
||||||
|
this.formInfo.jgid = "";
|
||||||
|
},
|
||||||
|
//获取所有区域
|
||||||
|
getareaListAll() {
|
||||||
|
areaListAllApi({ bdzid: this.formInfo.bdzid })
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.jgOptions = res.data;
|
||||||
|
console.log(this.title);
|
||||||
|
if (this.title == "添加主设备") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
this.formInfo.jgid = this.jgOptions[0].id;
|
||||||
|
this.formInfo.mc = "";
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取所有的设备类型管理
|
||||||
|
getsblxListAll() {
|
||||||
|
sblxListAllApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.sblxOptions = res.data;
|
||||||
|
console.log(this.title);
|
||||||
|
if (this.title == "添加主设备") {
|
||||||
|
console.log(this.formInfo);
|
||||||
|
this.formInfo.lxid = this.sblxOptions[0].id;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
display() {
|
||||||
|
this.zsbDialogshow = true;
|
||||||
|
this.getbdzListAll();
|
||||||
|
this.getsblxListAll();
|
||||||
|
},
|
||||||
|
hide() {
|
||||||
|
this.zsbDialogshow = false;
|
||||||
|
this.$refs.formInfo.resetFields(); // 重置表单字段值
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.zsbAddBox {
|
||||||
|
.zsbAddDialogBox {
|
||||||
|
.el-select {
|
||||||
|
width: 376px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,136 @@
|
|||||||
|
<template>
|
||||||
|
<div class="zsbBox">
|
||||||
|
<div class="reportHead">
|
||||||
|
<h3>主设备管理</h3>
|
||||||
|
</div>
|
||||||
|
<div class="page-body">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddClick"
|
||||||
|
>添加主设备</el-button
|
||||||
|
>
|
||||||
|
<div class="zsbTableBox">
|
||||||
|
<el-table
|
||||||
|
v-loading="zsbLoading"
|
||||||
|
:data="zsbTableData"
|
||||||
|
stripe
|
||||||
|
border
|
||||||
|
style="width: 100%"
|
||||||
|
height="calc(100% - 0px)"
|
||||||
|
>
|
||||||
|
<el-table-column prop="id" label="ID"> </el-table-column>
|
||||||
|
<el-table-column prop="bdzName" label="所属电站"> </el-table-column>
|
||||||
|
<el-table-column prop="lxName" label="设备类型"> </el-table-column>
|
||||||
|
<el-table-column prop="jgName" label="所属间隔"> </el-table-column>
|
||||||
|
<el-table-column prop="mc" label="设备名称"> </el-table-column>
|
||||||
|
<el-table-column label="操作" width="200" class-name="editClass">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
@click="handleEditClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-document"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDeleteClick(scope.row)"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<addzsbDialog ref="zsbAddRef" :title="title"></addzsbDialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { zsbDeleteApi, zsbListAllApi } from "@/utils/api/index";
|
||||||
|
import addzsbDialog from "./components/addzsbDialog";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
addzsbDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
zsbLoading: false,
|
||||||
|
zsbTableData: [],
|
||||||
|
title: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
this.getzsbAllList();
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
methods: {
|
||||||
|
//获取所有区间间隔
|
||||||
|
getzsbAllList() {
|
||||||
|
this.zsbLoading = true;
|
||||||
|
zsbListAllApi()
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.zsbTableData = res.data;
|
||||||
|
this.zsbLoading = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err); //代码错误、请求失败捕获
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//新增
|
||||||
|
handleAddClick() {
|
||||||
|
this.title = "添加主设备";
|
||||||
|
this.$refs.zsbAddRef.display();
|
||||||
|
//this.$refs.zsbAddRef.getdataform(null);
|
||||||
|
},
|
||||||
|
//修改
|
||||||
|
handleEditClick(data) {
|
||||||
|
this.title = "编辑";
|
||||||
|
this.$refs.zsbAddRef.display();
|
||||||
|
this.$refs.zsbAddRef.getdataform(data);
|
||||||
|
},
|
||||||
|
//删除数据
|
||||||
|
handleDeleteClick(data) {
|
||||||
|
this.$confirm("确定要删除记录吗?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
zsbDeleteApi({ id: data.id }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
duration: 1500,
|
||||||
|
showClose: true,
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功",
|
||||||
|
});
|
||||||
|
this.getzsbAllList(); //刷新
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.zsbBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.page-body {
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
height: calc(100% - 74px);
|
||||||
|
padding: 12px;
|
||||||
|
background: #eee;
|
||||||
|
.zsbTableBox {
|
||||||
|
margin-top: 8px;
|
||||||
|
height: calc(100% - 38px);
|
||||||
|
box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,63 @@
|
|||||||
|
<template>
|
||||||
|
<div class="oilChromatographyBox">
|
||||||
|
<div class="tendencyChartText" @click="tendencyChartChange()">趋势图</div>
|
||||||
|
<h3>{{ pageCardTitle }}</h3>
|
||||||
|
<div class="cardContent">我是内容</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "oil",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageCardTitle: "油色谱",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.oilChromatographyBox {
|
||||||
|
background: url(../../../assets/cardBg.png) no-repeat center;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
position: relative;
|
||||||
|
height: 280px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
h3 {
|
||||||
|
height: 50px;
|
||||||
|
line-height: 50px;
|
||||||
|
padding: 0px 60px 0px 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #03bcff;
|
||||||
|
font-weight: normal;
|
||||||
|
text-align: left;
|
||||||
|
display: flex;
|
||||||
|
font-size: 16px;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.tendencyChartText {
|
||||||
|
writing-mode: vertical-lr;
|
||||||
|
position: absolute;
|
||||||
|
right: 8px;
|
||||||
|
top: 15px;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 14px;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
text-align: left;
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover {
|
||||||
|
color: #03bcff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.cardContent {
|
||||||
|
padding: 10px 40px 9px 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue