jcbranch
fanluyan 1 year ago
parent 3ac5b97d1b
commit a642307d94

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

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

Loading…
Cancel
Save