jcbranch
fanluyan 1 year ago
parent 3ac5b97d1b
commit a642307d94

@ -9,11 +9,7 @@
>
<div class="topSearch">
<el-form-item label="电压" class="dybox">
<el-select
v-model="formdata.dyId"
@change="getSearchxl"
filterable
>
<el-select v-model="formdata.dyId" @change="getSearchxl" filterable>
<el-option
v-for="item in dyOptions"
:key="item.id"
@ -35,7 +31,6 @@
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
@ -67,7 +62,6 @@
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
@ -222,13 +216,12 @@
</template>
<script>
import {
cmdActlistApi,
getTerminalJoggle,
getActivityApi,
getProtocolList,
getSearchInfo,
exportTerminalApi
exportTerminalApi,
} from "@/utils/api/index";
import tableMain from "./components/tableMain";
export default {
@ -256,9 +249,9 @@ export default {
{ id: 2, name: "未运维" },
], //
formdata: {
dyId:-1,
lineId:-1,
towerId:-1,
dyId: -1,
lineId: -1,
towerId: -1,
isonline: -1,
protocol: -1,
mntn: 1,
@ -271,7 +264,6 @@ export default {
cmaExclude: 0,
version: "",
versionExclude: 0,
},
dataList: [],
@ -287,7 +279,6 @@ export default {
};
},
created() {
this.activityIdLoc =
JSON.parse(localStorage.getItem("activeId")) !== null
? JSON.parse(localStorage.getItem("activeId"))
@ -298,9 +289,9 @@ export default {
JSON.parse(localStorage.getItem("searchParams")) !== null
? JSON.parse(localStorage.getItem("searchParams"))
: {
dyId:-1,
lineId:-1,
towerId:-1,
dyId: -1,
lineId: -1,
towerId: -1,
isonline: -1,
protocol: -1,
mntn: 1,
@ -318,14 +309,15 @@ export default {
mounted() {
this.getSearchdy();
this.getProtocol();
this.getactiveList()
this.getactiveList();
},
watch: {},
methods: {
//
exportTable(){let params = {
pageindex:1,
pagesize:10000,
exportTable() {
let params = {
pageindex: 1,
pagesize: 10000,
};
//
if (this.formdata.dyId !== -1) {
@ -353,7 +345,7 @@ export default {
if (this.formdata.oid !== "") {
params.oid = this.formdata.oid;
}
console.log(this.formdata.oidExclude)
console.log(this.formdata.oidExclude);
if (this.formdata.oidExclude !== 0) {
params.oidExclude = this.formdata.oidExclude;
}
@ -363,7 +355,7 @@ export default {
if (this.formdata.cmaExclude !== 0) {
params.cmaExclude = this.formdata.cmaExclude;
}
if (this.formdata.cmdid !=="") {
if (this.formdata.cmdid !== "") {
params.cmdid = this.formdata.cmdid;
}
if (this.formdata.cmdidExclude !== 0) {
@ -375,17 +367,17 @@ export default {
if (this.formdata.versionExclude !== 0) {
params.versionExclude = this.formdata.versionExclude;
}
console.log(params)
console.log(params);
exportTerminalApi(params)
.then((res) => {
console.log(res)
console.log(res);
const now = this.$moment(new Date());
const formattedTime = now.format("YYYY年MM月DD日HH时mm分"); // "2023-04-01_15_30_00"
const blob = new Blob([res])
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = `运维数据报表_${formattedTime}.xls`
link.click()
const blob = new Blob([res]);
const link = document.createElement("a");
link.href = window.URL.createObjectURL(blob);
link.download = `运维数据报表_${formattedTime}.xls`;
link.click();
})
.catch((err) => {});
},
@ -404,7 +396,7 @@ export default {
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyId })
.then((res) => {
this.xlOptions = [{ id: -1, name: "全部" }]
this.xlOptions = [{ id: -1, name: "全部" }];
this.xlOptions = this.xlOptions.concat(res.data.list);
this.formdata.lineId = this.xlOptions[0].id;
this.getSearchgt();
@ -415,7 +407,7 @@ export default {
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineId })
.then((res) => {
this.gtOptions = [{ id: -1, name: "全部" }]
this.gtOptions = [{ id: -1, name: "全部" }];
this.gtOptions = this.gtOptions.concat(res.data.list);
this.formdata.towerId = this.gtOptions[0].id;
})
@ -432,7 +424,7 @@ export default {
.catch((err) => {});
},
//
getactiveList(){
getactiveList() {
getActivityApi()
.then((res) => {
console.log(res);
@ -470,12 +462,11 @@ export default {
//
this.fetchData();
}, interval);
},
fetchData() {
let params = {
pageindex:1,
pagesize:10000,
pageindex: 1,
pagesize: 10000,
};
//
if (this.formdata.dyId !== -1) {
@ -504,7 +495,7 @@ export default {
if (this.formdata.oid !== "") {
params.oid = this.formdata.oid;
}
console.log(this.formdata.oidExclude)
console.log(this.formdata.oidExclude);
if (Number(this.formdata.oidExclude) !== 0) {
params.oidExclude = this.formdata.oidExclude;
}
@ -514,7 +505,7 @@ export default {
if (Number(this.formdata.cmaExclude) !== 0) {
params.cmaExclude = this.formdata.cmaExclude;
}
if (this.formdata.cmdid !=="") {
if (this.formdata.cmdid !== "") {
params.cmdid = this.formdata.cmdid;
}
if (Number(this.formdata.cmdidExclude) !== 0) {
@ -526,30 +517,35 @@ export default {
if (Number(this.formdata.versionExclude) !== 0) {
params.versionExclude = this.formdata.versionExclude;
}
console.log(params)
console.log(params);
localStorage.setItem("searchParams", JSON.stringify(params));
getTerminalJoggle(params)
.then((res) => {
console.log(res)
console.log(res);
this.dataList = res.data;
this.getCmdList();
this.onlineNum = this.dataList.filter(
(item) => item.onlinestatus ==1
(item) => item.onlinestatus == 1
).length;
this.offlineNum = this.dataList.length - this.onlineNum;
this.tableLoaidng = false;
this.noPicNum = this.dataList.filter(
(item) => item.mntnStatus.reportMap == null ||
(item) =>
item.mntnStatus.reportMap == null ||
item.mntnStatus.reportMap.pic == undefined ||
item.mntnStatus.reportMap.pic == 0 ||
item.mntnStatus.reportMap.pic == -1
).length;
this.freeNum = this.dataList.filter(item => {
this.freeNum = this.dataList.filter((item) => {
// mntnStatusreportMapfreeROMnullundefined
const freeROM = item.mntnStatus?.reportMap?.freeROM;
// freeROM
if (freeROM !== null && freeROM !== undefined && !isNaN(parseInt(freeROM, 10))) {
if (
freeROM !== null &&
freeROM !== undefined &&
!isNaN(parseInt(freeROM, 10))
) {
// 50
return parseInt(freeROM, 10) < 50;
}
@ -557,8 +553,7 @@ export default {
return false;
}).length;
console.log("我已经加载完数据")
console.log("我已经加载完数据");
})
.catch((err) => {});
},
@ -597,9 +592,9 @@ export default {
//
onReset() {
this.formdata = {
dyId:-1,
lineId:-1,
towerId:-1,
dyId: -1,
lineId: -1,
towerId: -1,
isonline: -1,
protocol: -1,
mntn: 1,
@ -664,7 +659,7 @@ export default {
}
}
}
.dybox{
.dybox {
.el-select {
width: 120px;
}

@ -1,16 +1,28 @@
<template>
<div class="logMainClass">
<h3>日志列表
<el-select v-model="logValue" placeholder="请选择" @change="logTypeChange">
<div class="logTitle">
<h3>日志列表</h3>
<el-select
v-model="logValue"
placeholder="请选择"
@change="logTypeChange"
>
<el-option
v-for="item in LogOptions"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</h3>
<el-input
v-model="cmdidVal"
placeholder="请输入装置编号"
clearable
></el-input>
<el-button type="primary" @click="onSubmit"></el-button>
</div>
<div class="boxLogTable">
<el-table
v-loading="logLoading"
@ -24,7 +36,8 @@
</el-table-column>
<!-- <el-table-column prop="id" label="Id" width="80"> </el-table-column> -->
<el-table-column prop="lineName" label="线路"> </el-table-column>
<el-table-column prop="cmdid" label="装置编号" width="160"> </el-table-column>
<el-table-column prop="cmdid" label="装置编号" width="160">
</el-table-column>
<el-table-column label="规约" width="140">
<template slot-scope="scope">
{{ protocolMap[scope.row.protocol] }}
@ -33,9 +46,12 @@
<el-table-column prop="fileName" label="文件名">
<template slot-scope="scope">
<!-- <a :href="'http://61.169.135.146:40085/dl/' + scope.row.path" class="buttonText"></a> -->
<el-button type="text" @click="downFile(scope.row)" class="buttonText">{{
scope.row.fileName
}}</el-button>
<el-button
type="text"
@click="downFile(scope.row)"
class="buttonText"
>{{ scope.row.fileName }}</el-button
>
</template>
</el-table-column>
<el-table-column label="文件大小" width="100">
@ -43,8 +59,9 @@
{{ scope.row.fileSize | changeType }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="上传时间" width="160"> </el-table-column>
<el-table-column label="操作" class-name="editClass" >
<el-table-column prop="createTime" label="上传时间" width="160">
</el-table-column>
<el-table-column label="操作" class-name="editClass">
<template slot-scope="scope">
<el-link
type="danger"
@ -60,20 +77,24 @@
</div>
</template>
<script>
import { logListApi,logDeleteApi} from "@/utils/api/index";
import { logListApi, logDeleteApi } from "@/utils/api/index";
export default {
name: "log",
components: {},
data() {
return {
logValue:0,
LogOptions:[{
logValue: 0,
cmdidVal: "",
LogOptions: [
{
value: 0,
label: '日志'
}, {
label: "日志",
},
{
value: 1,
label: '其它'
}],
label: "其它",
},
],
tableData: [],
logLoading: false,
protocolMap: {
@ -86,8 +107,8 @@ export default {
65285: "河南全景",
65286: "河南郑州",
65290: "河南统一视频v2020",
65298:"宁夏",
2:"南网"
65298: "宁夏",
2: "南网",
},
};
},
@ -104,15 +125,32 @@ export default {
computed: {},
created() {},
mounted() {
this.getLogList(0);
this.getLogList();
},
methods: {
logTypeChange(val){
this.getLogList(val)
logTypeChange(val) {
let params = {
type: val,
};
//
if (this.cmdidVal !== "") {
params.cmdid = this.cmdidVal;
}
this.getLogList(params);
},
onSubmit() {
let params = {
type: this.logValue,
};
//
if (this.cmdidVal !== "") {
params.cmdid = this.cmdidVal;
}
this.getLogList(params);
},
getLogList(val) {
getLogList(params) {
this.logLoading = true;
logListApi({type:val})
logListApi(params)
.then((res) => {
this.tableData = res.data;
this.logLoading = false;
@ -144,13 +182,12 @@ export default {
.catch(() => {});
},
//
downFile(row){
downFile(row) {
// a
const a = document.createElement('a');
const a = document.createElement("a");
// ahrefURL
a.href = '/dl/'+row.path;
console.log(a.href)
a.href = "/dl/" + row.path;
console.log(a.href);
//
a.download = row.fileName; //
@ -160,7 +197,7 @@ export default {
// a
document.body.removeChild(a);
}
},
},
};
</script>
@ -169,15 +206,31 @@ export default {
height: calc(100% - 24px);
width: calc(100% - 24px);
padding: 12px;
h3 {
.logTitle {
display: flex;
align-items: center;
height: 32px;
margin-bottom: 12px;
h3 {
font-size: 16px;
line-height: 24px;
}
.el-select {
margin: 0px 12px;
.el-input {
width: 100px;
}
}
.el-input {
width: 200px;
}
.el-button--small {
margin-left: 12px;
}
}
.boxLogTable {
height: calc(100% - 36px);
background: #fcc;
height: calc(100% - 44px);
.el-table__cell {
text-align: center;
}
@ -190,7 +243,6 @@ export default {
cursor: pointer;
white-space: pre-wrap;
&:hover {
text-decoration: underline;
}
}

Loading…
Cancel
Save