Commit 16d572bd authored by 朱超's avatar 朱超
parents dd39eb09 1a42eac2
......@@ -108,7 +108,7 @@ function sortMethod({ order, prop }){
direction = 'DESC'
}
if(i === "name"){
sortname = "name";
sortname = "UnitName";
}else if(i === "alarmDate"){
sortname = "alarmDate";
}
......@@ -305,6 +305,7 @@ function gettransfer() {
}
http.post("/api/alarm/" + type.value, AlarmInfo).then((result) => {
console.log(result.data);
console.log(AlarmInfo);
if(result.data !== null){
tableData.value = result.data.dataInfoList;
total.value = result.data.rowCount;
......
This diff is collapsed.
<template>
换热站巡更
</template>
\ No newline at end of file
<!-- 条件筛选卡片 -->
<el-card class="card-contianer">
<div class="div-header">
<el-form-item label="设备:">
<el-cascader :options="options" v-model="AlarmInfo" :props="props" collapse-tags clearable :show-all-levels="false"
placeholder="请选择" style="min-width: 210px;" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button>
</el-form-item>
</div>
</el-card>
<el-card class="moduleCard" :height="tableHeight">
<el-table :data="tableData" :row-class-name="rowClassName" :height="tableHeight" v-loading="loading" :cell-style="setCellStyle" id="out-table"
border highlight-current-row :header-cell-style="setHeaderCellStyle" :header-cell-class-name="handleHeadAddClass" >
<el-table-column prop="index" label="编号" :sortable="false" width="70px" fixed />
<el-table-column prop="transferName" label="换热站" :sortable="false" width="170px" fixed />
<el-table-column prop="realName" label="巡更人" :sortable="false" width="150px" fixed />
<el-table-column prop="times" label="日巡次数" :sortable="false" width="120px" fixed />
<el-table-column prop="patrolStatus" label="巡更记录" :sortable="false" width="400px" fixed >
<template #default="scope">
<p v-html="getImgUrl(scope.row.patrolStatus)"></p>
<!-- <span>{{ getImgUrl(scope.row.patrolStatus) }}</span> -->
<!-- <div class="div-form-img">
<el-image class="img-center" v-if="getImgUrl(scope,scope.column.property)" style="width: 20px; height: 20px"
:src="getImgUrl(scope,scope.column.property)" :fit="'cover'" />
</div> -->
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, onUnmounted } from 'vue';
import http from '../../api/http';
import store from "../../store/index";
const options = reactive([]);
const tableData = ref([]);
const tableHeight = ref(500);
const enterpriseId = ref();
const loading = ref(true);
const sortField = reactive({});
getEnterprise();
function getEnterprise(){
var result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
const props = { multiple: true, emitPath: false }
function setContentHeight() {
tableHeight.value = window.innerHeight - 195;
}
function handleHeadAddClass({ column }) {
if (sortField[column.property]) {
column.order = sortField[column.property]
}
}
const AlarmInfo = ref([])
getSupplys();
getdata();
function getdata() {
gettransfer();
}
//获取换热机组列表
function getSupplys(){
loading.value = true;
tableData.length = 0;
options.length = 0;
AlarmInfo.length = 0;
var result = store.getters.getEnterprise();
if (result) {
console.log(result)
result.forEach(element=>{
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{
let c = [];
center.supplyList.forEach(supply => {
let chi = [];
supply.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName });
});
c.push({ children: chi, label: supply.supplyName});
});
options.push({children: c, label: center.serviceCenterName});
})
}else{
element.supplyList.forEach(element => {
let chi = [];
element.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName });
})
options.push({ children: chi, label: element.supplyName});
})
}
}
});
}
AlarmInfo.value.push(options[0].children[0].children[0].value);
}
//获取数据列表
function gettransfer() {
loading.value = true;
http.post("/api/patrol/GetPatrolTodeyData", AlarmInfo.value).then((result) => {
console.log(result.data);
if(result.data !== null){
tableData.value = result.data;
}
if(result.data === null){
tableData.value = null;
}
loading.value = false;
});
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
let css_color = {};
css_color['padding-left'] = 'px';
css_color['padding-right'] = '0px';
css_color['borderColor'] = '#97d5fd';
css_color['padding'] = '5px';
return css_color;
}
function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
let css_color;
var backcolor = 'd9f1ff';
css_color = { 'background-color': '#' + backcolor, 'padding-left': '0px', 'padding-right': '0px', 'borderColor': '#97d5fd', 'color': '#000', 'text-align': 'center', 'vertical-align': 'top' };
var backcolor = 'd9f1ff';
css_color = { 'background-color': '#' + backcolor, 'padding-left': '0px', 'padding-right': '0px', 'borderColor': '#97d5fd', 'color': '#000', 'text-align': 'center', 'vertical-align': 'top' };
return css_color;
}
function getImgUrl(item) {
item = item.replaceAll("N",'<img style="width: 20px; height: 20px" src="/imgs/status/status_off.png" />')
item = item.replaceAll("N",'<img style="width: 20px; height: 20px" src="/imgs/status/status_run.png" />')
console.log(item)
return item;
}
onMounted(() => {
setContentHeight();
window.addEventListener('resize', setContentHeight);
})
onUnmounted(() => {
window.removeEventListener('resize', setContentHeight);
})
</script>
<style lang="less" scoped>
.moduleCard {
width: auto;
overflow: auto;
padding: 0px;
::v-deep .el-card__body {
padding: 0px;
}
}
.pagination {
padding: 4px;
margin-left: 20px;
height: 30px;
//background-color: #8939cf;
vertical-align: middle;
}
//鼠标所在行的颜色
::v-deep .el-table__body tr:hover>td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
::v-deep .el-table__body tr.current-row>td {
background-color: #92cbf1 !important;
}
.card-contianer {
width: auto;
height: 70px;
.div-header {
width: 100%;
display: flex;
margin: 20px;
}
}
.el-form-item {
margin-top: -20px;
margin-right: 30px;
}
.el-tag--mini {
height: 21px !important
}
.el-cascader .el-input .el-input__inner:focus, .el-cascader .el-input.is-focus .el-input__inner{
height: 33px; //这里高度根据需求自己设定
}
.el-cascader__tags {
display: inline-flex;
margin-right: 10px;
flex-wrap: nowrap;
}
:deep(.div-form-img) {
display: flex;
align-items: center;
justify-content: center;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment