123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <template>
- <!-- 查看系统的对话框 -->
- <div>
- <!-- <el-breadcrumb separator-class="el-icon-arrow-right" v-if="this.$router.currentRoute.path!='/home'">
- <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
- <el-breadcrumb-item>供电系统</el-breadcrumb-item>
- <el-breadcrumb-item >系统数据</el-breadcrumb-item>
- </el-breadcrumb> -->
- <!-- <over-view-of-sub-system :table-data="tableData" :total="total" v-if="overViewFlag"></over-view-of-sub-system> -->
- <!-- <span style="font-size: 10px;">搜索:</span>
- <el-select v-model="currentSubSystemId" placeholder="请选择子系统" @change="selectSubsystem()" style="width: 400px">
- <el-option v-for="item in options" :key="item.id" :label="item.subSystem" :value="item.id">
- </el-option>
- </el-select> -->
- <el-table
- :data="tableData"
- style="min-width: 100%"
- border
- v-loading="dataListLoading"
- >
- <el-table-column
- prop="id"
- label="设备id"
- header-align="center"
- align="center"
- min-width="5%"
- >
- </el-table-column>
- <el-table-column
- prop="name"
- label="设备"
- header-align="center"
- align="center"
- min-width="5%">
- </el-table-column>
- <el-table-column
- prop="subEquipmentCount"
- label="子设备个数"
- header-align="center"
- align="center"
- min-width="10%">
- </el-table-column>
- <!-- <el-table-column prop="measurePointNum" label="测点个数" header-align="center" align="center" width="180">-->
- <!-- </el-table-column>-->
- <el-table-column
- label="操作"
- header-align="center"
- align="center"
- min-width="10%">
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- @click="handleCheck(scope.row)"
- :disabled="scope.row.subEquipmentCount == 0?true:false"
- >查看</el-button> <!-- 这里要改,当子系统个数为0时,查看按钮不可用 -->
- </template>
- </el-table-column>
- <el-table-column
- prop="remark"
- label="备注"
- header-align="center"
- align="center"
- min-width="20%">
- </el-table-column>
- </el-table>
- <!-- 分页区域 -->
- <div style="display: flex;justify-content: flex-end">
- <el-pagination
- background
- @current-change="currentChange"
- @size-change="sizeChange"
- :current-page="page"
- :page-size="size"
- layout="sizes, prev, pager, next, jumper, ->, total, slot"
- :total="total">
- </el-pagination>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: "checkSystem",
- props:['systemId'],
- data() {
- return {
- visible: false,
- options: [],
- tableData: [],
- page:1, //当前第几页
- size:10, //当前每页页数
- total:100, //全部数据量
- currentSystemId: 0,
- currentSubSystemId:'',
- currentsubSystem:'',
- dataListLoading: false,
- overViewFlag: false,
- }
- },
- mounted(){
- this.currentSystemId = this.systemId
- this.getSubsystemOption()
- // this.currentSystemId = window.sessionStorage.getItem("dataList_currentSystemId");
- // this.getSubsystemOption();
- // this.currentsubSystem = this.options[0].subSystem;
- // this.currentSubSystemId = this.options[0].id;//将当前煤矿与id设置为下拉框第一个
- // this.initData();
- },
- methods: {
- selectSubsystem(){
- for (let i in this.options) {
- if (this.options[i].id == this.currentSubSystemId){
- this.currentsubSystem = this.options[i].subSystem;
- break;
- }
- }
- this.initData();
- },
- getSubsystemOption(){
- this.getRequest('/dataList/getSubsystemOptionBySystemId/?systemId=' + this.currentSystemId).then(resp=>{
- if (resp){
- console.log(resp.data)
- this.options = resp.data;
- this.currentsubSystem = this.options[0].subSystem;
- this.currentSubSystemId = this.options[0].id;//将当前煤矿与id设置为下拉框第一个
- this.initData()
- }
- });
- },
- initData(){
- this.dataListLoading = true
- this.getRequest(
- "/equipmentManage/getEquipmentInfoBySubSystemId?subSystemId=" +
- this.currentSubSystemId + "&page=" + this.page + "&size=" + this.size
- ).then((resp) => {
- if (resp.data) {
- this.tableData = resp.data.data;
- this.total = resp.data.total;
- this.overViewFlag = true;
- }
- });
- this.dataListLoading = false
- // this.currentSystemId = parseInt(this.currentSystemId);
- // this.getRequest('/dataList/getEquipmentBySubsystemId/?subsystemId=' + this.currentSubSystemId + '&page=' + this.page + '&size=' + this.size).then(resp=>{
- // if (resp.data){
- // this.tableData = resp.data;
- // this.total = resp.data.size;
- // }
- // });
- /*this.getRequest('/coalSystemManage/getSystemOverview').then(resp =>{
- if (resp.data){
- this.options[0].num = resp.data.datasize + 'G';
- this.options[1].num = resp.data.systemCount + '个';
- this.options[2].num = resp.data.subSystemCount + '个';
- this.options[3].num = resp.data.equipmentCount + '个';
- }
- })*/
- },
- // 监听 pagesize 改变的事件
- currentChange(currentPage){
- this.page=currentPage;
- this.initData();
- },
- sizeChange(currentSize) {
- this.size = currentSize;
- this.initData();
- },
- // init(id) {
- // this.visible = true;
- // }
- handleCheck(equip) {
- window.sessionStorage.setItem("dataList_currentEquipId",equip.id); //存到sessionStorage中,下一个页面获取
- this.$router.push({
- name: 'powersupplyDataDetail',
- query: {
- equipmentId: equip.id,
- systemId: this.systemId
- }
- })
- }
- }
- }
- </script>
- <style scoped>
- </style>
|