JSK
This commit is contained in:
parent
2c44e5738e
commit
fb53a3e7d4
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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`,//
|
||||
|
|
|
|||
Loading…
Reference in New Issue