123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <template>
- <div class="app-container">
- <!-- 返回start -->
- <div class="siteTitle">
- <el-button class="goBack" @click="goBack">返回</el-button>
- 台区1-站点列表
- </div>
- <!-- 返回end -->
- <!-- 表格start -->
- <el-table
- :data="tableData"
- border
- stripe
- :header-cell-style="headClass"
- :cell-style="cellStyle"
- >
- <el-table-column
- fixed
- prop="siteName"
- label="站点名称"
- width=""
- ></el-table-column>
- <el-table-column prop="stationStatus" label="状态" width="">
- <template #default="scope">
- <el-avatar class="status" :class="[scope.row.deviceStatusr=='离线'? 'offline':'online']"></el-avatar>
- </template>
- </el-table-column>
- <el-table-column
- prop="deviceName"
- label="设备名称"
- width=""
- ></el-table-column>
- <el-table-column prop="monitoringEquipmentNo" label="监控设备编号" width="">
- <template #default="scope">
- <span>{{scope.row.monitoringEquipmentNo?scope.row.monitoringEquipmentNo:'--'}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="ratedVoltage" label="额定电压" width=""></el-table-column>
- <el-table-column prop="ratedCurrent" label="额定电流" width=""></el-table-column>
- <el-table-column
- prop="currentLoadRate"
- label="电流负载率门限"
- width=""
- ></el-table-column>
- <el-table-column fixed="right" label="操作" width="250">
- <template #default="scope">
- <el-button @click="handleClick(scope.row)" type="text" size="small">
- 查看
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 表格end -->
- </div>
- </template>
- <script>
- import { defineComponent, ref,onMounted } from 'vue'
- import * as api from '@/api/stationManage/index.js'
- import { ElMessage } from 'element-plus'
- export default defineComponent({
- name: 'SiteList',
- props: ['pageShow', 'goSiteListParam'],
- setup(props, context) {
- const showDialog = ref(false)
- const input = ref('请输入台区名称')
- const tableData = ref([])
- const goBack = () => {
- context.emit('func')
- }
- // 表头样式设置
- const headClass = () => {
- return 'background:#FAFAFA;'
- }
- //自定义列样式
- const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
- row, column, rowIndex
- if (columnIndex === 1) {
- return `color:#04F21C`
- } else {
- return ''
- }
- }
- //查看
- const handleClick = (row) => {
- alert('查看对应站点(页面跳转)')
- console.log(row)
- }
- //站点设备列表
- function siteDeviceList() {
- api
- .siteDeviceList({"stationAreaId":props.goSiteListParam})
- .then((requset) => {
- if (requset.status === 'SUCCESS') {
- // console.log(requset.data)
- tableData.value = requset.data
- } else {
- ElMessage.error(requset.msg)
- }
- })
- }
-
- onMounted(() => {
- siteDeviceList()
- })
- return {
- tableData,
- input,
- showDialog,
- headClass,
- cellStyle,
- goBack,
- handleClick,
- }
- },
- })
- </script>
- <style lang='scss' scoped>
- </style>
|