上图数量

jcbranch
fanluyan 10 months ago
parent a215eaca12
commit 5038971aec

@ -245,3 +245,12 @@ export function picRportApi(data) {
params: data,
});
}
//获取所有线路信息
export function getLineListJoggle(data) {
return request({
url: "/xymanager/line/listFull",
method: "post",
data,
});
}

@ -53,6 +53,22 @@
{{ scope.row.termCount }}
</template>
</el-table-column>
<el-table-column prop="lostCount" label="掉线数量">
<template slot-scope="scope">
{{ scope.row.lostCount }}
</template>
</el-table-column>
<el-table-column prop="lostCount" label="在线率">
<template slot-scope="scope">
{{
(
((scope.row.termCount - scope.row.lostCount) /
scope.row.termCount) *
100
).toFixed(2)
}}%
</template>
</el-table-column>
<!-- <el-table-column prop="path" label="文件路径"> </el-table-column> -->
<el-table-column label="操作" width="300" class-name="editClass">
<template slot-scope="scope">
@ -130,7 +146,12 @@
</div>
</template>
<script>
import { getActivityApi,addActiveApi,updActiveApi,delActiveApi } from "@/utils/api/index";
import {
getActivityApi,
addActiveApi,
updActiveApi,
delActiveApi,
} from "@/utils/api/index";
import htmlToExcel from "@/utils/htmlToExcel";
import { saveAs } from "file-saver";
import XLSX from "xlsx";
@ -163,15 +184,15 @@ export default {
65285: "河南全景",
65286: "河南郑州",
65290: "河南统一视频v2020",
65298:"宁夏",
2:"南网"
65298: "宁夏",
2: "南网",
},
ActibityId: "", //
};
},
computed: {},
watch: {
'activityForm.cmdidArr': {
"activityForm.cmdidArr": {
handler(newVal) {
// activityForm.cmdidArr convertToCmdObjects
this.cmdObjects = this.convertToCmdObjects(newVal);
@ -188,7 +209,7 @@ export default {
//
const cmdids = text.trim().split(/\r?\n/);
// cmdid
return cmdids.map(cmdid => ({ cmdid }));
return cmdids.map((cmdid) => ({ cmdid }));
},
async handleHeaderClick(column) {
console.log(column);
@ -245,13 +266,12 @@ export default {
//
handleLookClick(row) {
console.log(row)
console.log(row);
this.termsShow = true;
this.termsLoading = true;
this.termsData = row.terms;
this.activityNameTitle = row.title;
this.activityName =
row.title + "(" + row.terms.length + ")";
this.activityName = row.title + "(" + row.terms.length + ")";
this.termsData = row.terms;
},
//
@ -262,7 +282,7 @@ export default {
})
.then((res) => {
console.log(res);
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
this.$confirm("此操作将永久删除该活动, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@ -271,7 +291,7 @@ export default {
this.$message({
duration: 1500,
showClose: true,
message: "文件删除成功",
message: "活动删除成功",
type: "success",
});
this.getactivityList();

@ -0,0 +1,91 @@
<template>
<div class="lineBtn">
<el-button type="primary" @click="dialogVisible = true">选择线路</el-button>
<el-dialog title="提示" :visible.sync="dialogVisible" width="1050px">
<div class="lineList">
<el-checkbox-group v-model="checkList">
<el-checkbox
v-for="item in lineListData"
:label="item.id"
:key="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
<!-- {{ lineListData }} -->
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="saveCheck"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getLineListJoggle } from "@/utils/api/index";
export default {
data() {
return {
dialogVisible: false,
checkList: [],
lineListData: [],
total: 0,
};
},
mounted() {
this.lineList();
const storedArray = localStorage.getItem("checkListLocal");
if (storedArray) {
// JSON
this.checkList = JSON.parse(storedArray).map((item) => item.id);
}
},
methods: {
lineList() {
getLineListJoggle({
pageindex: 1,
pagesize: 100,
})
.then((res) => {
this.lineListData = res.data.list;
this.total = res.data.total;
})
.catch((err) => {});
},
saveCheck() {
console.log(this.checkList);
const filteredItems = this.lineListData.filter((item) =>
this.checkList.includes(item.id)
);
const combinedItems = filteredItems.map((item) => ({
photoCount: item.photoCount,
photoRate: item.photoRate,
id: item.id,
dyLevelName: item.dyLevelName,
name: item.name,
}));
// combinedItemsdata
console.log(combinedItems);
const arrayAsString = JSON.stringify(combinedItems);
localStorage.setItem("checkListLocal", arrayAsString);
this.dialogVisible = false;
this.$parent.getTablefun();
},
},
};
</script>
<style lang="less">
.lineBtn {
.el-dialog__body {
padding: 10px;
}
.lineList {
.el-checkbox-group {
.el-checkbox {
width: 220px;
height: 32px;
line-height: 32px;
}
}
}
}
</style>

@ -0,0 +1,395 @@
<template>
<div class="picReportClass">
<div class="logTitle">
<!-- <h3>装置图片报表</h3> -->
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压" class="dybox">
<el-select v-model="formdata.dyId" @change="getSearchxl" filterable>
<el-option
v-for="item in dyOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="线路" class="xlbox">
<el-select v-model="formdata.lineId" filterable @change="getlineNum">
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="应上图数量" class="pambox">
<el-input v-model="formdata.picNum" clearable></el-input>
</el-form-item>
<el-form-item label="正常上图率" class="pambox">
<el-input v-model="formdata.norGraphRate" clearable></el-input>
</el-form-item>
<el-form-item label="开始日期" class="dateclass">
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期" class="dateclass">
<el-date-picker
v-model="formdata.endtime"
type="datetime"
placeholder="结束日期"
value-format="timestamp"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
</el-form>
<el-button type="primary" @click="onSubmit"></el-button>
<selectLine></selectLine>
</div>
<div class="boxLogTable">
<el-table
v-loading="picLoading"
:data="tableData"
border
stripe
style="width: 100%"
height="100%"
>
<el-table-column type="index" width="50" label="序号">
</el-table-column>
<el-table-column label="电压">
<template slot-scope="scope">
{{ scope.row.termList[0].dyName }}
</template>
</el-table-column>
<el-table-column label="线路" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.termList[0].lineName }}
</template>
</el-table-column>
<el-table-column prop="day" label="日期">
<template slot-scope="scope">
{{ scope.row.dayList[0].day }}
</template>
</el-table-column>
<el-table-column label="装置总数">
<template slot-scope="scope">
{{ scope.row.termList.length }}
</template>
</el-table-column>
<el-table-column label="运维上线数量">
<template slot-scope="scope">
{{ scope.row.dayList[0].termList.length }}
</template>
</el-table-column>
<el-table-column label="运维上线率">
<template slot-scope="scope">
{{
(
(scope.row.dayList[0].termList.length /
scope.row.termList.length) *
100
).toFixed(2) + "%"
}}
</template>
</el-table-column>
<el-table-column label="上图设备数量">
<template slot-scope="scope">
{{
scope.row.dayList[0].termList.filter(
(term) => parseInt(term.uploads, 10) > 0
).length
}}
</template>
</el-table-column>
<el-table-column prop="cmdid" label="上图率">
<template slot-scope="scope">
{{
(
(scope.row.dayList[0].termList.filter(
(term) => parseInt(term.uploads, 10) > 0
).length /
termTotalNum) *
100
).toFixed(2) + "%"
}}
</template>
</el-table-column>
<el-table-column label="正常上图设备数量">
<template slot-scope="scope">
{{
scope.row.dayList[0].termList.filter(
(term) =>
parseInt(term.uploads, 10) >=
(parseInt(formdata.picNum, 10) *
parseInt(formdata.norGraphRate.replace("%", ""), 10)) /
100
).length
}}
</template>
</el-table-column>
<el-table-column label="正常上图率">
<template slot-scope="scope">
{{
(
(scope.row.termList.filter(
(term) =>
parseInt(term.uploads, 10) >=
(parseInt(formdata.picNum, 10) *
parseInt(formdata.norGraphRate.replace("%", ""), 10)) /
100
).length /
termTotalNum) *
100
).toFixed(2) + "%"
}}
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import { getSearchInfo, picRportApi } from "@/utils/api/index";
import selectLine from "./components/selectLine";
export default {
name: "picReport",
components: { selectLine },
data() {
return {
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now(); //
},
},
dyOptions: [], //
xlOptions: [], //线
formdata: {
dyId: null,
lineId: null,
picNum: "",
norGraphRate: "",
starttime: new Date(new Date().setHours(0, 0, 0, 0)).getTime(),
endtime: new Date(new Date().setHours(23, 59, 59, 0)).getTime(), // 23:59:59
},
tableData: [],
picLoading: false,
termTotalNum: 0,
dyName: "",
xlName: "",
//线
localSelectLine: [],
};
},
watch: {},
filters: {},
computed: {},
created() {},
mounted() {
this.getSearchdy();
this.localSelectLine = JSON.parse(localStorage.getItem("checkListLocal"));
console.log(this.localSelectLine);
},
methods: {
//
getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
this.dyOptions = this.dyOptions.concat(res.data.list);
console.log(this.dyOptions);
this.formdata.dyId = this.dyOptions[0].id;
this.getSearchxl();
})
.catch((err) => {});
},
//线
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyId })
.then((res) => {
this.xlOptions = res.data.list;
this.formdata.lineId = this.xlOptions[0].id;
this.getlineNum(this.xlOptions[0].id);
})
.catch((err) => {});
},
getlineNum(val) {
console.log(val);
const lineObj = this.xlOptions.find((item) => item.id == val);
console.log(lineObj);
this.formdata.picNum =
lineObj.photoCount == null ? "0" : lineObj.photoCount;
this.formdata.norGraphRate =
lineObj.photoRate == null ? "0%" : lineObj.photoRate;
},
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
}
let params = {
start: this.formdata.starttime / 1000,
end: this.formdata.endtime / 1000,
};
//
if (this.formdata.dyId !== -1) {
params.dyId = this.formdata.dyId;
}
if (this.formdata.lineId !== -1) {
params.lineId = this.formdata.lineId;
}
//
this.getpicList(params);
},
getpicList(params) {
setTimeout(() => {
this.picLoading = true;
picRportApi(params)
.then((res) => {
this.picLoading = false;
if (res.data.termList.length !== 0) {
console.log(res.data);
this.tableData = res.data.dayList;
this.termTotalNum = res.data.termList.length;
this.dyName = res.data.termList[0].dyName;
this.xlName = res.data.termList[0].lineName;
} else {
this.tableData = [];
}
})
.catch((err) => {});
}, 100);
},
//线
getTablefun() {
console.log("我是点击了确定");
console.log(this.localSelectLine);
// let arrlist = [];
// arrlist = this.localSelectLine.map((item) => item.id);
// console.log(arrlist);
this.fetchAllPicLists();
},
async fetchPicListForLine(lineId, startTime, endTime) {
try {
let params = {
start: startTime,
end: endTime,
lineId: lineId,
};
const res = await picRportApi(params); // picRportApiPromise
return res.data; //
} catch (error) {
console.error("Error fetching pic list:", error);
return null; //
}
},
async fetchAllPicLists() {
this.tableDatas = []; // tableData
for (let item of this.localSelectLine) {
const startTime = this.formdata.starttime / 1000;
const endTime = this.formdata.endtime / 1000;
const picList = await this.fetchPicListForLine(
item.id,
startTime,
endTime
);
console.log(picList);
// picListtableData
// picList
if (Array.isArray(picList)) {
this.tableDatas.push(...picList); // 使
} else if (picList) {
// picListtableData
this.tableDatas.push(picList);
}
}
// this.tableData
console.log(this.tableDatas);
this.tableData = this.tableDatas;
},
},
};
</script>
<style lang="less">
.picReportClass {
height: calc(100% - 24px);
width: calc(100% - 24px);
padding: 12px;
.logTitle {
display: flex;
align-items: center;
height: 32px;
margin-bottom: 12px;
h3 {
margin-right: 24px;
}
.el-form-item--small.el-form-item {
margin-bottom: 0px;
}
.dybox {
.el-select {
width: 120px;
}
}
.xlbox {
.el-select {
width: 180px;
}
}
.pambox {
.el-input {
width: 70px;
}
.el-input--suffix .el-input__inner {
padding: 8px;
}
}
.dateclass {
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 190px;
}
}
}
.boxLogTable {
height: calc(100% - 44px);
.el-table__cell {
text-align: center;
}
.el-table thead {
th.el-table__cell {
background: #fafafa;
}
}
.buttonText {
cursor: pointer;
white-space: pre-wrap;
&:hover {
text-decoration: underline;
}
}
}
}
</style>
Loading…
Cancel
Save