|
@@ -4,7 +4,7 @@
|
|
|
<div class="mb-20">所有台区</div>
|
|
|
<div class="filter-container mb-10">
|
|
|
<div>
|
|
|
- <div class="filter-item" >
|
|
|
+ <div class="filter-item">
|
|
|
台区:
|
|
|
<el-input
|
|
|
v-model="platformAreaName"
|
|
@@ -13,7 +13,12 @@
|
|
|
></el-input>
|
|
|
</div>
|
|
|
|
|
|
- <el-button type="primary" icon="el-icon-search" class="search-button" @click="SearchData()">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ class="search-button"
|
|
|
+ @click="SearchData()"
|
|
|
+ >
|
|
|
搜索
|
|
|
</el-button>
|
|
|
|
|
@@ -25,13 +30,7 @@
|
|
|
<!-- 筛选end -->
|
|
|
|
|
|
<!-- 表格start -->
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- border
|
|
|
- stripe
|
|
|
- :header-cell-style="headClass"
|
|
|
- :cell-style="cellStyle"
|
|
|
- >
|
|
|
+ <el-table :data="tableData" border stripe :header-cell-style="headClass">
|
|
|
<el-table-column
|
|
|
fixed
|
|
|
prop="platformAreaName"
|
|
@@ -50,14 +49,21 @@
|
|
|
></el-table-column>
|
|
|
<el-table-column prop="siteCount" label="点位数量" width="">
|
|
|
<template #default="scope">
|
|
|
- <span @click="goSiteList">{{ scope.row.siteCount }}</span>
|
|
|
+ <span
|
|
|
+ @click="goSiteList(scope.row)"
|
|
|
+ v-if="scope.row.siteCount"
|
|
|
+ style="cursor: pointer; color: #0284e8"
|
|
|
+ >
|
|
|
+ {{ scope.row.siteCount }}
|
|
|
+ </span>
|
|
|
+ <span v-else>{{ scope.row.siteCount }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="挂载设备数量" width="350">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.deviceCount ? deviceCount : '-' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="deviceCount"
|
|
|
- label="挂载设备数量"
|
|
|
- width="350"
|
|
|
- ></el-table-column>
|
|
|
<el-table-column fixed="right" label="操作" width="250">
|
|
|
<template #default="scope">
|
|
|
<el-button
|
|
@@ -91,22 +97,18 @@
|
|
|
<div class="paginationBlock">
|
|
|
<el-pagination
|
|
|
v-model:currentPage="currentPage"
|
|
|
- :page-sizes="[15, 20, 25, 30]"
|
|
|
- :page-size="pageSize"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="total"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- background
|
|
|
-
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
+ :page-sizes="[15, 20, 25, 30]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ background
|
|
|
+ ></el-pagination>
|
|
|
</div>
|
|
|
|
|
|
<!-- 分页end -->
|
|
|
|
|
|
-
|
|
|
-
|
|
|
<!--弹框组件开始-----------------------start-->
|
|
|
<dialog-component
|
|
|
:dialogTitle="dialogTitle"
|
|
@@ -115,12 +117,22 @@
|
|
|
:flag="showDialog"
|
|
|
></dialog-component>
|
|
|
<!--弹框组件开始-----------------------end-->
|
|
|
+
|
|
|
</div>
|
|
|
- <site-list v-else :pageShow="pageShow" @func="getMsgFormSon"></site-list>
|
|
|
+
|
|
|
+ <!-- 站点设备列表start -->
|
|
|
+ <site-list
|
|
|
+ v-else
|
|
|
+ :pageShow="pageShow"
|
|
|
+ :goSiteListParam="goSiteListParam"
|
|
|
+ @func="getMsgFormSon"
|
|
|
+ ></site-list>
|
|
|
+ <!-- 站点设备列表end -->
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { defineComponent, ref, reactive,onMounted } from 'vue'
|
|
|
+import { defineComponent, ref, reactive, onMounted } from 'vue'
|
|
|
import * as api from '@/api/stationManage/index.js'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
@@ -130,47 +142,19 @@ import siteList from './siteList'
|
|
|
export default defineComponent({
|
|
|
components: { DialogComponent, siteList },
|
|
|
setup(props, context) {
|
|
|
-
|
|
|
const total = ref(0)
|
|
|
const pageSize = ref(10)
|
|
|
const currentPage = ref(1)
|
|
|
-
|
|
|
-
|
|
|
+ const siteCount = ref(0)
|
|
|
+ const deviceCount = ref(0)
|
|
|
+ const goSiteListParam = ref('')
|
|
|
const platformAreaName = ref('')
|
|
|
const pageShow = ref(true)
|
|
|
const showDialog = ref(false)
|
|
|
- const tableData = ref([
|
|
|
- {
|
|
|
- platformAreaName: '台区1',
|
|
|
- platformAreaCode: 'tq02',
|
|
|
- platformAreaAddress: '青浦区徐泾镇',
|
|
|
- siteCount: '8',
|
|
|
- deviceCount: '10',
|
|
|
- },
|
|
|
- {
|
|
|
- platformAreaName: '台区1',
|
|
|
- platformAreaCode: 'tq02',
|
|
|
- platformAreaAddress: '青浦区徐泾镇',
|
|
|
- siteCount: '8',
|
|
|
- deviceCount: '10',
|
|
|
- },
|
|
|
- {
|
|
|
- platformAreaName: '台区1',
|
|
|
- platformAreaCode: 'tq02',
|
|
|
- platformAreaAddress: '青浦区徐泾镇',
|
|
|
- siteCount: '8',
|
|
|
- deviceCount: '10',
|
|
|
- },
|
|
|
- {
|
|
|
- platformAreaName: '台区1',
|
|
|
- platformAreaCode: 'tq02',
|
|
|
- platformAreaAddress: '青浦区徐泾镇',
|
|
|
- siteCount: '8',
|
|
|
- deviceCount: '10',
|
|
|
- },
|
|
|
- ])
|
|
|
+ const tableData = ref([])
|
|
|
|
|
|
- const goSiteList = () => {
|
|
|
+ function goSiteList(params) {
|
|
|
+ goSiteListParam.value = params.id
|
|
|
pageShow.value = !pageShow.value
|
|
|
}
|
|
|
const getMsgFormSon = () => {
|
|
@@ -182,17 +166,7 @@ export default defineComponent({
|
|
|
return 'background:#FAFAFA;'
|
|
|
}
|
|
|
|
|
|
- //自定义列样式
|
|
|
- const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
|
|
|
- row, column, rowIndex
|
|
|
- if (columnIndex === 3) {
|
|
|
- return `color:#0284E8;cursor:pointer`
|
|
|
- } else {
|
|
|
- return ''
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- const handleSizeChange = (val) => {
|
|
|
+ const handleSizeChange = (val) => {
|
|
|
pageSize.value = val
|
|
|
platformList()
|
|
|
}
|
|
@@ -204,29 +178,28 @@ export default defineComponent({
|
|
|
const tableItem = reactive([])
|
|
|
const dialogTitle = ref('')
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//电力监测设备列表
|
|
|
function platformList() {
|
|
|
- api.platformList({
|
|
|
+ api
|
|
|
+ .platformList({
|
|
|
size: pageSize.value,
|
|
|
current: currentPage.value,
|
|
|
- }).then((requset) => {
|
|
|
+ })
|
|
|
+ .then((requset) => {
|
|
|
if (requset.status === 'SUCCESS') {
|
|
|
- console.log(requset.data)
|
|
|
tableData.value = requset.data.records
|
|
|
total.value = requset.data.total
|
|
|
- // store.state.siteList = tableData
|
|
|
} else {
|
|
|
ElMessage.error(requset.msg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- //查询设备列表
|
|
|
+
|
|
|
+ //筛选设备列表
|
|
|
function SearchData() {
|
|
|
- api.platformList({
|
|
|
- "platformAreaName": platformAreaName.value,
|
|
|
+ api
|
|
|
+ .platformList({
|
|
|
+ platformAreaName: platformAreaName.value,
|
|
|
})
|
|
|
.then((requset) => {
|
|
|
if (requset.status === 'SUCCESS') {
|
|
@@ -252,20 +225,33 @@ export default defineComponent({
|
|
|
// 编辑操作
|
|
|
const editRow = (row) => {
|
|
|
console.log(row)
|
|
|
- // tableItem.value = row
|
|
|
- tableItem.value={
|
|
|
- id:row.id,
|
|
|
- platformAreaName:row.platformAreaName,
|
|
|
- platformAreaCode:row.platformAreaCode,
|
|
|
- platformAreaAddress:row.platformAreaAddress,
|
|
|
+ api
|
|
|
+ .platformAreaListOne({
|
|
|
+ id: row.id,
|
|
|
+ })
|
|
|
+ .then((requset) => {
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
+ ;(siteCount.value = requset.data[0].siteCount),
|
|
|
+ (deviceCount.value = requset.data[0].deviceCount)
|
|
|
+ } else {
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
+ tableItem.value = {
|
|
|
+ id: row.id,
|
|
|
+ platformAreaName: row.platformAreaName,
|
|
|
+ platformAreaCode: row.platformAreaCode,
|
|
|
+ platformAreaAddress: row.platformAreaAddress,
|
|
|
+ siteCount: siteCount.value,
|
|
|
+ deviceCount: deviceCount.value,
|
|
|
}
|
|
|
dialogTitle.value = '编辑'
|
|
|
showDialog.value = true
|
|
|
}
|
|
|
// 关闭操作
|
|
|
const closeDialog = () => {
|
|
|
- showDialog.value = false;
|
|
|
+ showDialog.value = false
|
|
|
platformList()
|
|
|
}
|
|
|
|
|
@@ -277,12 +263,13 @@ export default defineComponent({
|
|
|
message: '删除成功',
|
|
|
type: 'success',
|
|
|
})
|
|
|
- platformList()
|
|
|
+ platformList()
|
|
|
} else {
|
|
|
ElMessage.error(requset.msg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
//是否删除 ---- 否
|
|
|
const cancelEvent = () => {
|
|
|
console.log('cancel!')
|
|
@@ -301,22 +288,22 @@ export default defineComponent({
|
|
|
props,
|
|
|
context,
|
|
|
tableItem,
|
|
|
+ siteCount,
|
|
|
+ deviceCount,
|
|
|
+ goSiteListParam,
|
|
|
+ total,
|
|
|
+ pageSize,
|
|
|
+ currentPage,
|
|
|
+
|
|
|
SearchData,
|
|
|
goSiteList,
|
|
|
getMsgFormSon,
|
|
|
headClass,
|
|
|
- cellStyle,
|
|
|
addItem,
|
|
|
editRow,
|
|
|
closeDialog,
|
|
|
handleDelete,
|
|
|
cancelEvent,
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- total,
|
|
|
- pageSize,
|
|
|
- currentPage,
|
|
|
handleSizeChange,
|
|
|
handleCurrentChange,
|
|
|
}
|