This commit is contained in:
jiask 2025-10-28 10:07:11 +08:00
parent 2c44e5738e
commit fb53a3e7d4
6 changed files with 1679 additions and 1 deletions

109
src/api/protection/index.js Normal file
View File

@ -0,0 +1,109 @@
import request from '@/utils/request'
// 变电站管理-分页查询设备信息
export function getSubstationListPageApi(data) {
return request({
url: '/protection/protection_manage/substation/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 变电站管理-新增
export function addSubstationApi(data) {
return request({
url: '/protection/protection_manage/substation/add',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 变电站管理-修改信息
export function updateSubstationApi(data) {
return request({
url: '/protection/protection_manage/substation/edit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}editProdectionApi
// 变电站管理-删除信息
export function deleteSubstationApi(data) {
return request({
url: '/protection/protection_manage/substation/del',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 定值单管理-分页查询设备信息
export function getProtectionOrderListPageApi(data) {
return request({
url: '/protection/protection_manage/protectionOrder/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 保护定值单管理-新增/修改信息
export function editProdectionApi(data) {
return request({
url: '/protection/protection_manage/protectionOrder/edit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
// 保护定值单管理-删除信息
export function deleteProtectionApi(data) {
return request({
url: '/protection/protection_manage/protectionOrder/del',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}
export function getProdectionByIdApi(data) {
return request({
url: '/protection/protection_manage/protectionOrder/listById',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
export function getProtectionAnalysisListPageApi(data) {
return request({
url: '/protection/protection_manage/protectionAnalysis/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}

View File

@ -0,0 +1,360 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入"
clearable maxlength="20"
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
size="mini"
@click="handleDelete"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" @selection-change="handleSelectionChange" height="800">
<el-table-column type="selection" align="center" width="55" />
<el-table-column align="center" prop="protectionCode" :show-overflow-tooltip="true" width="120" label="定值单编号" />
<el-table-column align="center" prop="protectionName" :show-overflow-tooltip="true" width="120" label="定值单名称" />
<el-table-column align="center" prop="protectionDate" :show-overflow-tooltip="true" width="120" label="定值单日期" />
<el-table-column align="center" prop="deviceName" :show-overflow-tooltip="true" width="120" label="设备所属" />
<el-table-column align="center" prop="oneDevice" :show-overflow-tooltip="true" width="150" label="一次设备名称" />
<el-table-column align="center" prop="protectionDevice" :show-overflow-tooltip="true" width="120" label="保护装置名称" />
<el-table-column align="center" prop="protectionDeviceModel" :show-overflow-tooltip="true" width="120" label="保护装置型号" />
<el-table-column align="center" prop="protectionDeviceVersion" :show-overflow-tooltip="true" width="120" label="装置版本" />
<el-table-column align="center" prop="remark" :show-overflow-tooltip="true" width="120" label="备注" />
<el-table-column align="center" prop="description" :show-overflow-tooltip="true" width="120" label="说明" />
<el-table-column align="center" prop="analysisDate" :show-overflow-tooltip="true" width="120" label="识别日期" />
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>解析结果查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title+''" :visible.sync="open" width="700px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<!-- 基础设置 -->
<el-tab-pane label="" name="baseSetting" style="height: 400px;">
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="150px">
<el-row>
<el-col :span="24">
<el-form-item label="保护定值单图片" prop="imgUrl">
<el-upload
:http-request="
(obj) => imgUpLoad(obj, 'fileUrl')
"
action="#"
:limit="1"
:file-list="fileList"
:show-file-list="true"
list-type="picture-card"
accept=".png, .jpg, .jpeg"
:on-success="handleAvatarSuccess"
:before-upload="handleBeforeUpload"
:class="{ disabled:uploadDisabled }"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDept,
getDept,
delDept,
addDept,
updateDept,
listDeptExcludeChild,
} from '@/api/system/dept'
import { getProtectionAnalysisListPageApi,editProdectionApi } from "@/api/protection/index";
import base64 from 'base-64';
import { getToken } from '@/utils/auth'
import { imgUpLoadTwo } from '@/api/system/upload'
import { downloadFileByUrl } from '@/utils/download'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: "",
dicts: ["sys_certificate_type"],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
checked: false,
userNameFlage:false,
substationIds:[],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord:null,
},
activeName:"baseSetting",
deviceData:{},
//
baseForm: {
protectionId:""
},
//
baseFormRules: {
substationName: [
{ required: true, message: "变电站名称不能为空", trigger: "blur" }
]
},
fileList: [],//
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
};
},
mounted(){
this.getList();
},
computed: {
//1
uploadDisabled() {
return this.checkUrlList.length > 0
},
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"keyWord":this.queryParams.keyWord
}
console.log("param",param)
// let str = base64.encode(JSON.stringify(param))
// console.log({"content":str})
getProtectionAnalysisListPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.baseForm = {
substationName:"",
runTime:""
};
this.resetForm("baseForm");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
console.log("this.baseForm",this.baseForm);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.baseForm = Object.assign({}, row)
this.fileList=[{url:this.baseForm.imgUrl}]
// this.$set(this,"metadata",row.deviceMetadata)
this.title = "修改";
},
handleTabClick(tab, event) {
console.log(tab, event);
},
/** 提交按钮 */
submitForm: function() {
console.log("this.fileList",this.fileList);
console.log("this.checkUrlList",this.checkUrlList);
console.log("this.checkUrlNameList",this.checkUrlNameList);
console.log("this.baseForm",this.baseForm);
editProdectionApi({checkUrlList:this.checkUrlList,checkUrlNameList:this.checkUrlNameList,protectionId:this.baseForm.protectionId,type:'0'}).then(response => {
console.log("editProdectionApi",response);
this.getList();
this.open = false;
this.$modal.msgSuccess("操作成功");
return;
});
},
/** 删除按钮操作 */
handleDelete(row) {
var substationIdRow="";
if(row!=undefined &&row.substationId!=null&&row.substationId!=undefined){
substationIdRow=row.substationId.split(" ");
}
const substationIds = substationIdRow || this.substationIds;
console.log("substationIds",substationIds);
this.$modal.confirm('是否确认删除数据项?').then(() => {
deleteSubstationApi({substationIds:substationIds}).then(response => {
console.log("deleteSubstationApi",response);
this.getList();
this.$modal.msgSuccess("删除成功");
return;
});
}).catch(() => {});
},
formatDate(date) {
// YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
//
handleSelectionChange(selection) {
this.substationIds = selection.map(item => item.substationId)
},
//
imgUpLoad(param, name, index) {
param.type = 'dishes'
this.btnLoading=true;
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
this.$set(this.baseForm,"imageUrl",res.data.url)
} else {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList=[]
this.$set(this.baseForm,"imgUrl",'')
this.$modal.msgError(res.msg)
}
this.btnLoading=false;
}).catch((error) => {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList=[]
this.btnLoading=false;
this.$modal.msgError(error)
})
},
handleAvatarSuccess(res, file) {
console.log('success')
},
//
handleBeforeUpload(file) {
const isLt = file.size / 1024 / 1024 < 5
if (!isLt) {
this.$modal.msgError(`图片大小不能超过 5 MB`)
return false
}
},
handleRemove(file, fileList) {
let sum = 0
this.checkUrlNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.checkUrlNameList.splice(sum, 1)
this.checkUrlList.splice(sum, 1)
this.$set(this.baseForm,"imageUrl",'')
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
}
};
</script>
<style scoped lang="scss">
.form-title{
display: flex;
align-items: flex-end;
// width: 100%;
// height: 40px;
background: #e7f0fa;
border-left: 3px solid #46a6ff;
margin: 10px 0;
padding: 5px;
}
.form-item{
width: 100%;
font-size: 14px !important;
}
</style>

View File

@ -0,0 +1,414 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入"
clearable maxlength="20"
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
size="mini"
@click="handleDelete"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" @selection-change="handleSelectionChange" height="800">
<el-table-column type="selection" align="center" width="55" />
<el-table-column align="center" prop="protectionCode" :show-overflow-tooltip="true" width="120" label="定值单编号" />
<el-table-column align="center" prop="protectionName" :show-overflow-tooltip="true" width="120" label="定值单名称" />
<el-table-column align="center" prop="protectionDate" :show-overflow-tooltip="true" width="120" label="定值单日期" />
<el-table-column align="center" prop="deviceName" :show-overflow-tooltip="true" width="120" label="设备所属" />
<el-table-column align="center" prop="oneDevice" :show-overflow-tooltip="true" width="150" label="一次设备名称" />
<el-table-column align="center" prop="protectionDevice" :show-overflow-tooltip="true" width="120" label="保护装置名称" />
<el-table-column align="center" prop="protectionDeviceModel" :show-overflow-tooltip="true" width="120" label="保护装置型号" />
<el-table-column align="center" prop="protectionDeviceVersion" :show-overflow-tooltip="true" width="120" label="装置版本" />
<el-table-column align="center" prop="remark" :show-overflow-tooltip="true" width="120" label="备注" />
<el-table-column align="center" prop="description" :show-overflow-tooltip="true" width="120" label="说明" />
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleView(scope.row)"
>解析结果查看</el-button>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
style="color: red;"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title+''" :visible.sync="open" width="700px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<!-- 基础设置 -->
<el-tab-pane label="" name="baseSetting" style="height: 400px;">
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="150px">
<el-row>
<el-col :span="24">
<el-form-item label="保护定值单图片" prop="imgUrl">
<el-upload
:http-request="
(obj) => imgUpLoad(obj, 'fileUrl')
"
action="#"
:limit="1"
:file-list="fileList"
:show-file-list="true"
list-type="picture-card"
accept=".png, .jpg, .jpeg"
:on-success="handleAvatarSuccess"
:before-upload="handleBeforeUpload"
:class="{ disabled:uploadDisabled }"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="titleView+''" :visible.sync="openView" width="700px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<!-- 基础设置 -->
<el-tab-pane label="" name="baseSetting" style="height: 400px;">
<el-form label-width="150px">
<table>
<tr>
<td colspan="5">阜阳电网继电保护装置整定值通知书</td>
</tr>
<tr>
<td>不平衡保护CT一次值</td>
<td>定值区号</td>
<td>被保护设备</td>
<td>不平衡保护CT二次值</td>
<td>PT一次值千伏</td>
</tr>
</table>
</el-form>
</el-tab-pane>
</el-tabs>
</el-dialog>
</div>
</template>
<script>
import {
listDept,
getDept,
delDept,
addDept,
updateDept,
listDeptExcludeChild,
} from '@/api/system/dept'
import { getProtectionOrderListPageApi,editProdectionApi,deleteProtectionApi,getProdectionByIdApi } from "@/api/protection/index";
import base64 from 'base-64';
import { getToken } from '@/utils/auth'
import { imgUpLoadTwo } from '@/api/system/upload'
import { downloadFileByUrl } from '@/utils/download'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: "",
dicts: ["sys_certificate_type"],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
openView:false,
titleView: "",
checked: false,
userNameFlage:false,
protectionIds:[],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord:null,
},
activeName:"baseSetting",
deviceData:{},
//
baseForm: {
protectionId:""
},
//
baseFormRules: {
substationName: [
{ required: true, message: "变电站名称不能为空", trigger: "blur" }
]
},
fileList: [],//
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
};
},
mounted(){
this.getList();
},
computed: {
//1
uploadDisabled() {
return this.checkUrlList.length > 0
},
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"type":'0',
"keyWord":this.queryParams.keyWord
}
console.log("param",param)
// let str = base64.encode(JSON.stringify(param))
// console.log({"content":str})
getProtectionOrderListPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.baseForm = {
substationName:"",
runTime:""
};
this.resetForm("baseForm");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
console.log("this.baseForm",this.baseForm);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.baseForm = Object.assign({}, row)
this.fileList=[{url:this.baseForm.imgUrl}]
this.checkUrlList=[this.baseForm.imgUrl]
this.checkUrlNameList=[this.baseForm.imgName]
// this.$set(this,"metadata",row.deviceMetadata)
this.title = "修改";
},
handleView(row) {
this.reset();
this.openView = true;
const obj = Object.assign({}, row)
this.titleView = "查看";
getProdectionByIdApi({protectionId:obj.protectionId}).then(response => {
console.log("getProdectionByIdApi",response);
});
},
handleTabClick(tab, event) {
console.log(tab, event);
},
/** 提交按钮 */
submitForm: function() {
console.log("this.fileList",this.fileList);
console.log("this.checkUrlList",this.checkUrlList);
console.log("this.checkUrlNameList",this.checkUrlNameList);
console.log("this.baseForm",this.baseForm);
editProdectionApi({checkUrlList:this.checkUrlList,checkUrlNameList:this.checkUrlNameList,protectionId:this.baseForm.protectionId,type:'0'}).then(response => {
console.log("editProdectionApi",response);
this.getList();
this.open = false;
this.$modal.msgSuccess("操作成功");
return;
});
},
/** 删除按钮操作 */
handleDelete(row) {
var protectionIdRow="";
if(row!=undefined &&row.protectionId!=null&&row.protectionId!=undefined){
protectionIdRow=row.protectionId.split(" ");
}
const protectionIds = protectionIdRow || this.protectionIds;
console.log("protectionIds",protectionIds);
this.$modal.confirm('是否确认删除数据项?').then(() => {
deleteProtectionApi({protectionIds:protectionIds}).then(response => {
console.log("deleteProtectionApi",response);
this.getList();
this.$modal.msgSuccess("删除成功");
return;
});
}).catch(() => {});
},
formatDate(date) {
// YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
//
handleSelectionChange(selection) {
this.protectionIds = selection.map(item => item.protectionId)
},
//
imgUpLoad(param, name, index) {
param.type = 'dishes'
this.btnLoading=true;
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
this.$set(this.baseForm,"imageUrl",res.data.url)
} else {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList=[]
this.$set(this.baseForm,"imgUrl",'')
this.$modal.msgError(res.msg)
}
this.btnLoading=false;
}).catch((error) => {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList=[]
this.btnLoading=false;
this.$modal.msgError(error)
})
},
handleAvatarSuccess(res, file) {
console.log('success')
},
//
handleBeforeUpload(file) {
const isLt = file.size / 1024 / 1024 < 5
if (!isLt) {
this.$modal.msgError(`图片大小不能超过 5 MB`)
return false
}
},
handleRemove(file, fileList) {
let sum = 0
this.checkUrlNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.checkUrlNameList.splice(sum, 1)
this.checkUrlList.splice(sum, 1)
this.$set(this.baseForm,"imageUrl",'')
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
}
};
</script>
<style scoped lang="scss">
.form-title{
display: flex;
align-items: flex-end;
// width: 100%;
// height: 40px;
background: #e7f0fa;
border-left: 3px solid #46a6ff;
margin: 10px 0;
padding: 5px;
}
.form-item{
width: 100%;
font-size: 14px !important;
}
table {
border-collapse: collapse; /* 合并表格边框 */
border: 1px solid black; /* 设置边框颜色和宽度 */
}
table tr td{
text-align: center; vertical-align: middle;
border-collapse: collapse; /* 合并表格边框 */
border: 1px solid black; /* 设置边框颜色和宽度 */
}
</style>

View File

@ -0,0 +1,401 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入"
clearable maxlength="20"
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
size="mini"
@click="handleDelete"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" @selection-change="handleSelectionChange" height="800">
<el-table-column type="selection" align="center" width="55" />
<el-table-column align="center" prop="protectionCode" :show-overflow-tooltip="true" width="120" label="定值单编号" />
<el-table-column align="center" prop="protectionName" :show-overflow-tooltip="true" width="120" label="定值单名称" />
<el-table-column align="center" prop="protectionDate" :show-overflow-tooltip="true" width="120" label="定值单日期" />
<el-table-column align="center" prop="deviceName" :show-overflow-tooltip="true" width="120" label="设备所属" />
<el-table-column align="center" prop="oneDevice" :show-overflow-tooltip="true" width="150" label="一次设备名称" />
<el-table-column align="center" prop="protectionDevice" :show-overflow-tooltip="true" width="120" label="保护装置名称" />
<el-table-column align="center" prop="protectionDeviceModel" :show-overflow-tooltip="true" width="120" label="保护装置型号" />
<el-table-column align="center" prop="protectionDeviceVersion" :show-overflow-tooltip="true" width="120" label="装置版本" />
<el-table-column align="center" prop="remark" :show-overflow-tooltip="true" width="120" label="备注" />
<el-table-column align="center" prop="description" :show-overflow-tooltip="true" width="120" label="说明" />
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleView(scope.row)"
>解析结果查看</el-button>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
style="color: red;"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title+''" :visible.sync="open" width="700px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<!-- 基础设置 -->
<el-tab-pane label="" name="baseSetting" style="height: 400px;">
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="150px">
<el-row>
<el-col :span="24">
<el-form-item label="保护定值单图片" prop="imgUrl">
<el-upload
:http-request="
(obj) => imgUpLoad(obj, 'fileUrl')
"
action="#"
:limit="1"
:file-list="fileList"
:show-file-list="true"
list-type="picture-card"
accept=".png, .jpg, .jpeg"
:on-success="handleAvatarSuccess"
:before-upload="handleBeforeUpload"
:class="{ disabled:uploadDisabled }"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="titleView+''" :visible.sync="openView" width="700px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<!-- 基础设置 -->
<el-tab-pane label="" name="baseSetting" style="height: 400px;">
<el-form label-width="150px">
<el-row>
<el-col :span="24">
阜阳电网继电保护装置整定值通知书
</el-col>
</el-row>
<el-row>
<el-col :span="24"></el-col>
<el-col :span="24"></el-col>
<el-col :span="24"></el-col>
<el-col :span="24"></el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
</el-dialog>
</div>
</template>
<script>
import {
listDept,
getDept,
delDept,
addDept,
updateDept,
listDeptExcludeChild,
} from '@/api/system/dept'
import { getProtectionOrderListPageApi,editProdectionApi,deleteProtectionApi } from "@/api/protection/index";
import base64 from 'base-64';
import { getToken } from '@/utils/auth'
import { imgUpLoadTwo } from '@/api/system/upload'
import { downloadFileByUrl } from '@/utils/download'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: "",
dicts: ["sys_certificate_type"],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
openView:false,
titleView: "",
checked: false,
userNameFlage:false,
protectionIds:[],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord:null,
},
activeName:"baseSetting",
deviceData:{},
//
baseForm: {
protectionId:""
},
//
baseFormRules: {
substationName: [
{ required: true, message: "变电站名称不能为空", trigger: "blur" }
]
},
fileList: [],//
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
};
},
mounted(){
this.getList();
},
computed: {
//1
uploadDisabled() {
return this.checkUrlList.length > 0
},
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"type":'1',
"keyWord":this.queryParams.keyWord
}
console.log("param",param)
// let str = base64.encode(JSON.stringify(param))
// console.log({"content":str})
getProtectionOrderListPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.baseForm = {
substationName:"",
runTime:""
};
this.resetForm("baseForm");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
console.log("this.baseForm",this.baseForm);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.baseForm = Object.assign({}, row)
this.fileList=[{url:this.baseForm.imgUrl}]
this.checkUrlList=[this.baseForm.imgUrl]
this.checkUrlNameList=[this.baseForm.imgName]
// this.$set(this,"metadata",row.deviceMetadata)
this.title = "修改";
},
handleView(row) {
this.reset();
this.openView = true;
const obj = Object.assign({}, row)
this.titleView = "查看";
},
handleTabClick(tab, event) {
console.log(tab, event);
},
/** 提交按钮 */
submitForm: function() {
console.log("this.fileList",this.fileList);
console.log("this.checkUrlList",this.checkUrlList);
console.log("this.checkUrlNameList",this.checkUrlNameList);
console.log("this.baseForm",this.baseForm);
editProdectionApi({checkUrlList:this.checkUrlList,checkUrlNameList:this.checkUrlNameList,protectionId:this.baseForm.protectionId,type:'0'}).then(response => {
console.log("editProdectionApi",response);
this.getList();
this.open = false;
this.$modal.msgSuccess("操作成功");
return;
});
},
/** 删除按钮操作 */
handleDelete(row) {
var protectionIdRow="";
if(row!=undefined &&row.protectionId!=null&&row.protectionId!=undefined){
protectionIdRow=row.protectionId.split(" ");
}
const protectionIds = protectionIdRow || this.protectionIds;
console.log("protectionIds",protectionIds);
this.$modal.confirm('是否确认删除数据项?').then(() => {
deleteProtectionApi({protectionIds:protectionIds}).then(response => {
console.log("deleteProtectionApi",response);
this.getList();
this.$modal.msgSuccess("删除成功");
return;
});
}).catch(() => {});
},
formatDate(date) {
// YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
//
handleSelectionChange(selection) {
this.protectionIds = selection.map(item => item.protectionId)
},
//
imgUpLoad(param, name, index) {
param.type = 'dishes'
this.btnLoading=true;
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
this.$set(this.baseForm,"imageUrl",res.data.url)
} else {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList=[]
this.$set(this.baseForm,"imgUrl",'')
this.$modal.msgError(res.msg)
}
this.btnLoading=false;
}).catch((error) => {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList=[]
this.btnLoading=false;
this.$modal.msgError(error)
})
},
handleAvatarSuccess(res, file) {
console.log('success')
},
//
handleBeforeUpload(file) {
const isLt = file.size / 1024 / 1024 < 5
if (!isLt) {
this.$modal.msgError(`图片大小不能超过 5 MB`)
return false
}
},
handleRemove(file, fileList) {
let sum = 0
this.checkUrlNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.checkUrlNameList.splice(sum, 1)
this.checkUrlList.splice(sum, 1)
this.$set(this.baseForm,"imageUrl",'')
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
}
};
</script>
<style scoped lang="scss">
.form-title{
display: flex;
align-items: flex-end;
// width: 100%;
// height: 40px;
background: #e7f0fa;
border-left: 3px solid #46a6ff;
margin: 10px 0;
padding: 5px;
}
.form-item{
width: 100%;
font-size: 14px !important;
}
</style>

View File

@ -0,0 +1,394 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入"
clearable maxlength="20"
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
size="mini"
@click="handleDelete"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:show-file-list="false"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
>
<el-button
type="success"
size="mini"
>导入
</el-button>
</el-upload> -->
<!-- </el-col> -->
<!-- <el-col :span="1.5">
<el-button
size="mini"
@click="importTemplate"
>模板下载
</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" @selection-change="handleSelectionChange" height="800">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="变电站名称" align="center" prop="substationName" :show-overflow-tooltip="true" width="250" fixed="left"/>
<el-table-column label="运行时间" align="center" prop="runTime" :show-overflow-tooltip="true" width="250" fixed="left"/>
<el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true" width="180" fixed="left"/>
<el-table-column label="备注" align="center" width="450" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
style="color: red;"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title+''" :visible.sync="open" width="700px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<!-- 基础设置 -->
<el-tab-pane label="" name="baseSetting" style="height: 400px;">
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="变电站名称" prop="substationName">
<el-input style="width: 220px;" v-model="baseForm.substationName" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="运行时间:" prop="runTime">
<el-date-picker
v-model="baseForm.runTime"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注:" prop="remark">
<el-input type="textarea" :rows="5" style="width: 220px;" v-model="baseForm.remark" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDept,
getDept,
delDept,
addDept,
updateDept,
listDeptExcludeChild,
} from '@/api/system/dept'
import { getSubstationListPageApi,addSubstationApi,updateSubstationApi,deleteSubstationApi } from "@/api/protection/index";
import base64 from 'base-64';
import { getToken } from '@/utils/auth'
import { downloadFileByUrl } from '@/utils/download'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: "",
dicts: ["sys_certificate_type"],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
checked: false,
userNameFlage:false,
substationIds:[],
//
queryParams: {
pageNum: 1,
pageSize: 10,
idNumber:null,//
name:null,//
certificateNo:null,//
},
activeName:"baseSetting",
deviceData:{},
//
baseForm: {
substationId:"",
substationName:"",
runTime:""
},
//
baseFormRules: {
substationName: [
{ required: true, message: "变电站名称不能为空", trigger: "blur" }
]
},
logTableData:[],//
//
dialogTotal: 0,
//
openMenu:false,
//
upload: {
//
isUploading: false,
//
headers: { Authorization: 'Bearer ' + getToken() },
//
url: process.env.VUE_APP_BASE_API + '/certificate/certificate_manage/certificateInfo/import',
},
};
},
mounted(){
this.getList();
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"keyWord":this.queryParams.keyWord
}
console.log("param",param)
// let str = base64.encode(JSON.stringify(param))
// console.log({"content":str})
getSubstationListPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.baseForm = {
substationName:"",
runTime:""
};
this.resetForm("baseForm");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
console.log("this.baseForm",this.baseForm);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.baseForm = Object.assign({}, row)
// this.$set(this,"metadata",row.deviceMetadata)
this.title = "修改";
},
handleTabClick(tab, event) {
console.log(tab, event);
},
/** 提交按钮 */
submitForm: function() {
console.log("this.baseForm",this.baseForm);
this.$refs["baseForm"].validate(valid => {
if (valid) {
if (this.baseForm.substationId != undefined && this.baseForm.substationId != "") {
updateSubstationApi(this.baseForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSubstationApi(this.baseForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
var substationIdRow="";
if(row!=undefined &&row.substationId!=null&&row.substationId!=undefined){
substationIdRow=row.substationId.split(" ");
}
const substationIds = substationIdRow || this.substationIds;
console.log("substationIds",substationIds);
this.$modal.confirm('是否确认删除数据项?').then(() => {
deleteSubstationApi({substationIds:substationIds}).then(response => {
console.log("deleteSubstationApi",response);
this.getList();
this.$modal.msgSuccess("删除成功");
return;
});
}).catch(() => {});
},
formatDate(date) {
// YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
/** 导出按钮操作 */
handleExport() {
this.download('certificate/certificate_manage/certificateInfo/export', {
...this.queryParams
}, `证件信息_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
//
handleFileSuccess(response, file, fileList) {
console.log(response)
this.upload.isUploading = false
this.$refs.upload.clearFiles()
if(response.code==200){
this.$modal.msgSuccess(response.msg);
this.getList();
}else{
this.$modal.msgError(response.msg);
}
},
/** 下载模板操作 */
importTemplate() {
let url = window.location.origin + '/glweb/template/证件信息模板.xlsx';
console.log(url)
downloadFileByUrl(url)
},
/** 批量删除 */
handleBatchDel(){
},
//
handleSelectionChange(selection) {
this.substationIds = selection.map(item => item.substationId)
},
}
};
</script>
<style scoped lang="scss">
.form-title{
display: flex;
align-items: flex-end;
// width: 100%;
// height: 40px;
background: #e7f0fa;
border-left: 3px solid #46a6ff;
margin: 10px 0;
padding: 5px;
}
.form-item{
width: 100%;
font-size: 14px !important;
}
</style>

View File

@ -36,7 +36,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.2.75:48380`,//旭
target: `http://127.0.0.1:48380`,//测试
target: `http://127.0.0.1:38380`,//测试
// target: `http://192.168.2.108:48380`,//测试
// target: `http://192.168.0.34:48380`,//测试
// target: `http://192.168.0.176:48380`,//