| | |
| | | // IMG_API: '"http://220.171.99.118:4100/upload/"', |
| | | // BASE_API: '"http://192.168.0.35:8006"', |
| | | // IMG_API: '"http://192.168.0.35:8006/upload/"', |
| | | BASE_API: '"http://222.92.213.21:8006/zhongtai"', |
| | | IMG_API: '"http://222.92.213.21:8006/zhongtai/upload/"', |
| | | // BASE_API: '"http://222.92.213.21:8006/zhongtai"', |
| | | // IMG_API: '"http://222.92.213.21:8006/zhongtai/upload/"', |
| | | BASE_API: '"http://192.168.2.66:8006"', |
| | | IMG_API: '"http://192.168.2.66:8006/upload/"', |
| | | // BASE_API: '"http://220.171.99.118:4101/api"', |
| | | // IMG_API: '"http://220.171.99.118:4101/api/upload/"', |
| | | }; |
对比新文件 |
| | |
| | | import {getToken} from "../utils/auth"; |
| | | import request from '@/utils/request' |
| | | |
| | | export function majorEquipmentList(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipment/page', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentAdd(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipment/add', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentMod(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipment/mod', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentDel(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipment/del', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | export function majorEquipmentErt(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipment/getMajorEquipment', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
对比新文件 |
| | |
| | | import {getToken} from "../utils/auth"; |
| | | import request from '@/utils/request' |
| | | |
| | | export function majorEquipmentList(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipmentAlarm/page', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentAdd(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipmentAlarm/add', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentMod(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipmentAlarm/mod', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentDel(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipmentAlarm/del', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
对比新文件 |
| | |
| | | import {getToken} from "../utils/auth"; |
| | | import request from '@/utils/request' |
| | | |
| | | export function majorEquipmentList(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipmentData/page', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentAdd(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipmentData/add', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentMod(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipmentData/mod', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | export function majorEquipmentDel(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API+'/majorEquipmentData/del', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | |
| | | return roles.some(role => permissionRoles.indexOf(role) >= 0) |
| | | } |
| | | |
| | | const whiteList = ['/login', '/auth-redirect','/agreement','/register'] // no redirect whitelist |
| | | const whiteList = ['/login', '/auth-redirect','/agreement','/register','/productionEquipment','/instrumentData','/equipmentAlarm'] // no redirect whitelist |
| | | |
| | | router.beforeEach((to, from, next) => { |
| | | NProgress.start() // start progress bar |
| | |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: '/productionEquipment', |
| | | // 重大生产设备 |
| | | component: () => import('@/views/productionEquipment'), |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: '/instrumentData', |
| | | // 重大仪表实时数据 |
| | | component: () => import('@/views/instrumentData'), |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: '/equipmentAlarm', |
| | | // 设备报警信息 |
| | | component: () => import('@/views/equipmentAlarm'), |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: '/', |
| | | component: Layout, |
| | | redirect: '/doublePreventAction/doublePreventAction/riskLevelManage/index/doublePreventAction/riskLevelManage/analyseUnit/index', |
| | |
| | | component: () => import('@/views/safetyproduction/reviewXG'), |
| | | meta: { title: '自查清单_修改', icon: '' } |
| | | } |
| | | ] |
| | | ] |
| | | }, |
| | | { |
| | | id: 2, |
| | | parentId: 0, |
| | | path: '/majorHazardSourceMonitoring', |
| | | component: Layout, |
| | | name: '重大危险源监测', |
| | | meta: { title: '重大危险源监测', icon: 'el-icon-dash' }, |
| | | children: [ |
| | | { |
| | | id: 1, |
| | | parentId: 0, |
| | | path: '/productionEquipment', |
| | | name: '生产设备', |
| | | component: () => import('@/views/majorHazardSourceMonitoring/productionEquipment'), |
| | | meta: { title: '生产设备', icon: '' } |
| | | }, |
| | | { |
| | | id: 2, |
| | | parentId: 0, |
| | | path: '/equipmentAlarm', |
| | | name: '设备报警信息', |
| | | component: () => import('@/views/majorHazardSourceMonitoring/equipmentAlarm'), |
| | | meta: { title: '设备报警信息', icon: '' } |
| | | }, |
| | | { |
| | | id: 3, |
| | | parentId: 0, |
| | | path: '/instrumentData', |
| | | name: '仪表实时数据', |
| | | component: () => import('@/views/majorHazardSourceMonitoring/instrumentData'), |
| | | meta: { title: '仪表实时数据', icon: '' } |
| | | }, |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | export default new Router({ |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-row> |
| | | <el-col :span="5"> |
| | | <el-form-item label="设备名称"> |
| | | <el-input v-model="listQuery.filter.equipmentName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="状态"> |
| | | <el-select v-model="listQuery.filter.status" placeholder="请选择状态"> |
| | | <el-option v-for="item in unitIdOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4" style="text-align: center"> |
| | | <el-button type="primary" icon="el-icon-search" @click="find()" class="btns" |
| | | >搜索</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | class="btns" |
| | | @click="handleClick('', '新增')" |
| | | >新增</el-button |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-table :data="list" border style="width: 100%"> |
| | | <el-table-column prop="equipmentName" align="center" label="设备名称"> |
| | | </el-table-column> |
| | | <el-table-column label="状态" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.status == 0">已处理</span> |
| | | <span v-if="scope.row.status == 1">未处理</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="alarmTime" label="报警时间" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="alarmInfo" label="报警信息" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" label="备注" align="center"> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | @click="handleClick(scope.row, '编辑')" |
| | | type="text" |
| | | size="small" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="deleteById(scope.row.id)" |
| | | style="color: red" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div style="text-align:right"> |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="recordTotal" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="dialogVisible" |
| | | width="40%" |
| | | > |
| | | <el-form ref="form" :rules="rules" :model="form" label-width="80px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备名称" prop="equipmentId"> |
| | | <el-select |
| | | v-model="form.equipmentId" |
| | | placeholder="请选择设备名称" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in equipmentName" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select |
| | | v-model="form.status" |
| | | placeholder="请选择设备状态" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in unitIdOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="报警时间" prop="alarmTime"> |
| | | <el-date-picker |
| | | v-model="form.alarmTime" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="选择日期时间" |
| | | style="width: 100%;"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="报警信息" prop="alarmInfo"> |
| | | <el-input v-model="form.alarmInfo" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input type="textarea" v-model="form.remark" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" class="btns" @click="AddelementManagement()" |
| | | >确 定</el-button |
| | | > |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { |
| | | majorEquipmentList, |
| | | majorEquipmentAdd, |
| | | majorEquipmentMod, |
| | | majorEquipmentDel, |
| | | } from "@/api/majorEquipmentAlarm.js"; |
| | | import { majorEquipmentErt } from "@/api/majorEquipment.js"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | title: "", |
| | | form: { |
| | | equipmentId: "", |
| | | status: "", |
| | | alarmTime: "", |
| | | alarmInfo:"", |
| | | remark:"", |
| | | }, |
| | | alarmTime:"", |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | list: [], |
| | | listQuery: { |
| | | filter: { |
| | | equipmentName: "", |
| | | }, |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | }, |
| | | type:'', |
| | | rules: { |
| | | |
| | | }, |
| | | equipmentName:[], |
| | | unitIdOptions:[{label:"已处理",value:0},{label:"未处理",value:1}] |
| | | }; |
| | | }, |
| | | created() { |
| | | this.elementManagementL(); |
| | | }, |
| | | methods: { |
| | | async elementManagementL() { |
| | | var res = await majorEquipmentList(this.listQuery); |
| | | console.log(res); |
| | | if (res.data.code == 200) { |
| | | this.list = res.data.result.records; |
| | | this.recordTotal = res.data.result.total |
| | | this.pageSize=res.data.result.size; |
| | | this.currentPage = res.data.result.current |
| | | } |
| | | }, |
| | | handleClick(value, type) { |
| | | this.dialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs["form"].clearValidate(); |
| | | }); |
| | | majorEquipmentErt().then(res=>{ |
| | | console.log(res) |
| | | this.equipmentName=res.data.result |
| | | }) |
| | | if (type == "新增") { |
| | | this.title = "新增"; |
| | | this.form = { |
| | | equipmentId: "", |
| | | status:'', |
| | | remark:"", |
| | | alarmTime:"", |
| | | alarmInfo:"" |
| | | }; |
| | | } else { |
| | | this.title = "编辑"; |
| | | this.form = value; |
| | | } |
| | | }, |
| | | AddelementManagement() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | if (this.title == "新增") { |
| | | majorEquipmentAdd(this.form).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.dialogVisible = false; |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | type: "success", |
| | | duration: 2000, |
| | | message: "新增成功", |
| | | title: "成功", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res.data.message, |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | majorEquipmentMod(this.form).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.dialogVisible = false; |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | type: "success", |
| | | duration: 2000, |
| | | message: "编辑成功", |
| | | title: "成功", |
| | | }); |
| | | } else { |
| | | his.$message({ |
| | | type: "warning", |
| | | message: res.data.message, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | deleteById(val) { |
| | | majorEquipmentDel({id:val}).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | title: "成功", |
| | | message: "删除成功", |
| | | type: "success", |
| | | duration: 2000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | find(){ |
| | | this.elementManagementL(); |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.listQuery.pageSize = val |
| | | this.elementManagementL(); |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.listQuery.pageIndex = val |
| | | this.elementManagementL(); |
| | | }, |
| | | |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .btns { |
| | | background-color: #034ea2; |
| | | border: 1px solid #034ea2; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-row> |
| | | <el-col :span="5"> |
| | | <el-form-item label="设备名称"> |
| | | <el-input v-model="listQuery.filter.equipmentName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4" style="text-align: center"> |
| | | <el-button type="primary" icon="el-icon-search" @click="find()" class="btns" |
| | | >搜索</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | class="btns" |
| | | @click="handleClick('', '新增')" |
| | | >新增</el-button |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-table :data="list" border style="width: 100%"> |
| | | <el-table-column label="设备编号" align="center" prop="equipmentSerialNumber"> |
| | | </el-table-column> |
| | | <el-table-column prop="equipmentName" label="设备名称" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="rangeLowerLimit" label="仪表量程下限" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="rangeUpperLimit" label="仪表量程上限" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="highHighLiquidAlarm" label="高高液位报警值" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="highLiquidAlarm" label="高液位报警值" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="lowLiquidAlarm" label="低液位报警值" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="lowLowLiquidAlarm" label="低低液位报警值" align="center"> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | @click="handleClick(scope.row, '编辑')" |
| | | type="text" |
| | | size="small" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="deleteById(scope.row.id)" |
| | | style="color: red" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div style="text-align:right"> |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="recordTotal" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="dialogVisible" |
| | | width="40%" |
| | | > |
| | | <el-form ref="form" :rules="rules" :model="form" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备名称" prop="equipmentId"> |
| | | <el-select |
| | | v-model="form.equipmentId" |
| | | placeholder="请选择设备名称" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in equipmentName" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="检测时间" prop="monitoringTime"> |
| | | <el-date-picker |
| | | v-model="form.monitoringTime" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="选择日期时间" |
| | | style="width: 100%;"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="仪表量程下限" prop="rangeLowerLimit"> |
| | | <el-input v-model.number="form.rangeLowerLimit" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="仪表量程上限" prop="rangeLowerLimit"> |
| | | <el-input v-model.number="form.rangeUpperLimit" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="高高液位报警值" prop="rangeUpperLimit"> |
| | | <el-input v-model.number="form.highHighLiquidAlarm" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="高液位报警值" prop="alarmInfo"> |
| | | <el-input v-model.number="form.highLiquidAlarm" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="低液位报警值" prop="alarmInfo"> |
| | | <el-input v-model.number="form.lowLiquidAlarm" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="低低液位报警值" prop="alarmInfo"> |
| | | <el-input v-model.number="form.lowLowLiquidAlarm" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" class="btns" @click="AddelementManagement()" |
| | | >确 定</el-button |
| | | > |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { |
| | | majorEquipmentList, |
| | | majorEquipmentAdd, |
| | | majorEquipmentMod, |
| | | majorEquipmentDel, |
| | | } from "@/api/majorEquipmentData.js"; |
| | | import { majorEquipmentErt } from "@/api/majorEquipment.js"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | title: "", |
| | | form: { |
| | | equipmentId: "", |
| | | monitoringTime:"", |
| | | rangeLowerLimit: "", |
| | | rangeUpperLimit: "", |
| | | highHighLiquidAlarm:"", |
| | | highLiquidAlarm:"", |
| | | lowLiquidAlarm:"", |
| | | lowLowLiquidAlarm:"", |
| | | }, |
| | | alarmTime:"", |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | list: [], |
| | | listQuery: { |
| | | filter: { |
| | | equipmentId: "", |
| | | status:'', |
| | | }, |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | }, |
| | | // type:'', |
| | | rules: { |
| | | rangeLowerLimit:{ type: 'number', message: '仪表量程下限必须为数字值'}, |
| | | rangeUpperLimit:{ type: 'number', message: '仪表量程上限必须为数字值'}, |
| | | highHighLiquidAlarm:{ type: 'number', message: '高高液位报警值必须为数字值'}, |
| | | highLiquidAlarm:{ type: 'number', message: '高液位报警值必须为数字值'}, |
| | | lowLiquidAlarm:{ type: 'number', message: '低液位报警值必须为数字值'}, |
| | | lowLowLiquidAlarm:{ type: 'number', message: '低低液位报警值必须为数字值'}, |
| | | }, |
| | | equipmentName:[], |
| | | unitIdOptions:[{label:"已处理",value:0},{label:"未处理",value:1}] |
| | | }; |
| | | }, |
| | | created() { |
| | | this.elementManagementL(); |
| | | }, |
| | | methods: { |
| | | async elementManagementL() { |
| | | var res = await majorEquipmentList(this.listQuery); |
| | | console.log(res); |
| | | if (res.data.code == 200) { |
| | | this.list = res.data.result.records; |
| | | this.recordTotal = res.data.result.total |
| | | this.pageSize=res.data.result.size; |
| | | this.currentPage = res.data.result.current |
| | | } |
| | | }, |
| | | handleClick(value, type) { |
| | | this.dialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs["form"].clearValidate(); |
| | | }); |
| | | majorEquipmentErt().then(res=>{ |
| | | console.log(res) |
| | | this.equipmentName=res.data.result |
| | | }) |
| | | if (type == "新增") { |
| | | this.title = "新增"; |
| | | this.form = { |
| | | equipmentId: "", |
| | | monitoringTime:"", |
| | | rangeLowerLimit: "", |
| | | rangeUpperLimit: "", |
| | | highHighLiquidAlarm:"", |
| | | highLiquidAlarm:"", |
| | | lowLiquidAlarm:"", |
| | | lowLowLiquidAlarm:"", |
| | | }; |
| | | } else { |
| | | this.title = "编辑"; |
| | | this.form = value; |
| | | } |
| | | }, |
| | | AddelementManagement() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | if (this.title == "新增") { |
| | | majorEquipmentAdd(this.form).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.dialogVisible = false; |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | type: "success", |
| | | duration: 2000, |
| | | message: "新增成功", |
| | | title: "成功", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res.data.message, |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | majorEquipmentMod(this.form).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.dialogVisible = false; |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | type: "success", |
| | | duration: 2000, |
| | | message: "编辑成功", |
| | | title: "成功", |
| | | }); |
| | | } else { |
| | | his.$message({ |
| | | type: "warning", |
| | | message: res.data.message, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | deleteById(val) { |
| | | majorEquipmentDel({id:val}).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | title: "成功", |
| | | message: "删除成功", |
| | | type: "success", |
| | | duration: 2000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | find(){ |
| | | this.elementManagementL(); |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.listQuery.pageSize = val |
| | | this.elementManagementL(); |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.listQuery.pageIndex = val |
| | | this.elementManagementL(); |
| | | }, |
| | | |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .btns { |
| | | background-color: #034ea2; |
| | | border: 1px solid #034ea2; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-row> |
| | | <el-col :span="5"> |
| | | <el-form-item label="设备名称"> |
| | | <el-input v-model="listQuery.filter.name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="设备状态"> |
| | | <el-select v-model="listQuery.filter.status" placeholder="请选择设备状态"> |
| | | <el-option v-for="item in unitIdOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4" style="text-align: center"> |
| | | <el-button type="primary" icon="el-icon-search" @click="find()" class="btns" |
| | | >搜索</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | class="btns" |
| | | @click="handleClick('', '新增')" |
| | | >新增</el-button |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-table :data="list" border style="width: 100%"> |
| | | <el-table-column prop="serialNumber" align="center" label="设备编号"> |
| | | </el-table-column> |
| | | <el-table-column prop="name" align="center" label="设备名称"> |
| | | </el-table-column> |
| | | <el-table-column label="状态" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.status == 0">在用</span> |
| | | <span v-if="scope.row.status == 1">停用</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="volume" label="容积" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="userId" label="负责人" align="center"> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | @click="handleClick(scope.row, '编辑')" |
| | | type="text" |
| | | size="small" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="deleteById(scope.row.id)" |
| | | style="color: red" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div style="text-align:right"> |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="recordTotal" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="dialogVisible" |
| | | width="40%" |
| | | > |
| | | <el-form ref="form" :rules="rules" :model="form" label-width="80px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备编号" prop="serialNumber"> |
| | | <el-input v-model.number="form.serialNumber" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备名称" prop="name"> |
| | | <el-input v-model="form.name" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select |
| | | v-model="form.status" |
| | | placeholder="请选择设备状态" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in unitIdOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="容积" prop="volume"> |
| | | <el-input v-model.number="form.volume" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="负责人" prop="userId"> |
| | | <el-input v-model="form.userId" maxlength="50"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" class="btns" @click="AddelementManagement()" |
| | | >确 定</el-button |
| | | > |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { |
| | | majorEquipmentList, |
| | | majorEquipmentAdd, |
| | | majorEquipmentMod, |
| | | majorEquipmentDel, |
| | | } from "@/api/majorEquipment.js"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | title: "", |
| | | form: { |
| | | name: "", |
| | | status: "", |
| | | volume: "", |
| | | serialNumber:"", |
| | | }, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | list: [], |
| | | listQuery: { |
| | | filter: { |
| | | name: "", |
| | | }, |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | }, |
| | | type:'', |
| | | rules: { |
| | | serialNumber:{ type: 'number', message: '容积必须为数字值'}, |
| | | volume:{ type: 'number', message: '负责人必须为数字值'}, |
| | | name: [ |
| | | { required: true, message: "预案名称不能为空", trigger: "change" }, |
| | | ], |
| | | }, |
| | | unitIdOptions:[{label:"在用",value:0},{label:"停用",value:1}] |
| | | }; |
| | | }, |
| | | created() { |
| | | this.elementManagementL(); |
| | | }, |
| | | methods: { |
| | | async elementManagementL() { |
| | | var res = await majorEquipmentList(this.listQuery); |
| | | console.log(res); |
| | | if (res.data.code == 200) { |
| | | this.list = res.data.result.records; |
| | | this.recordTotal = res.data.result.total |
| | | this.pageSize=res.data.result.size; |
| | | this.currentPage = res.data.result.current |
| | | } |
| | | }, |
| | | handleClick(value, type) { |
| | | this.dialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs["form"].clearValidate(); |
| | | }); |
| | | if (type == "新增") { |
| | | this.title = "新增"; |
| | | this.form = { |
| | | serialNumber:'', |
| | | name: "", |
| | | volume:"", |
| | | userId:"", |
| | | status:"" |
| | | }; |
| | | } else { |
| | | this.title = "编辑"; |
| | | this.form = value; |
| | | } |
| | | }, |
| | | AddelementManagement() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | if (this.title == "新增") { |
| | | majorEquipmentAdd(this.form).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.dialogVisible = false; |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | type: "success", |
| | | duration: 2000, |
| | | message: "新增成功", |
| | | title: "成功", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res.data.message, |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | majorEquipmentMod(this.form).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.dialogVisible = false; |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | type: "success", |
| | | duration: 2000, |
| | | message: "编辑成功", |
| | | title: "成功", |
| | | }); |
| | | } else { |
| | | his.$message({ |
| | | type: "warning", |
| | | message: res.data.message, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | deleteById(val) { |
| | | majorEquipmentDel({id:val}).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | title: "成功", |
| | | message: "删除成功", |
| | | type: "success", |
| | | duration: 2000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | find(){ |
| | | this.elementManagementL(); |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.listQuery.pageSize = val |
| | | this.elementManagementL(); |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.listQuery.pageIndex = val |
| | | this.elementManagementL(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .btns { |
| | | background-color: #034ea2; |
| | | border: 1px solid #034ea2; |
| | | } |
| | | </style> |