Commit 1fcb2f54 authored by wanli's avatar wanli

🐞 fix(资源监视器前端): 修复前端显示当前页面图片列表问题

parent 1d83faad
...@@ -48,6 +48,14 @@ ...@@ -48,6 +48,14 @@
<el-form-item label="资源监控报告"> <el-form-item label="资源监控报告">
<el-button size="mini" @click="getReport">导出报告</el-button> <el-button size="mini" @click="getReport">导出报告</el-button>
</el-form-item> </el-form-item>
<el-form-item label="页面图片显示设置">
<el-switch
v-model="pngShowMode"
active-text="自动显示当前页面"
inactive-text="手动选择页面"
>
</el-switch>
</el-form-item>
</el-form> </el-form>
</div> </div>
</grid-item> </grid-item>
...@@ -508,6 +516,7 @@ export default { ...@@ -508,6 +516,7 @@ export default {
lvglList: [], lvglList: [],
image: {}, image: {},
imageList: [], imageList: [],
pngShowMode: true,
currentPngList: [], currentPngList: [],
socket: null, socket: null,
form: { form: {
...@@ -546,7 +555,8 @@ export default { ...@@ -546,7 +555,8 @@ export default {
}, },
methods: { methods: {
onTableRowClick(row) { onTableRowClick(row) {
this.pngList = this.currentPngList[row.uri] this.pngShowMode = false;
this.pngList = this.currentPngList[row.uri];
}, },
getTemplate() { getTemplate() {
getTemplate() getTemplate()
...@@ -804,7 +814,7 @@ export default { ...@@ -804,7 +814,7 @@ export default {
this.$store.dispatch("user/removeRole"); this.$store.dispatch("user/removeRole");
this.$store.dispatch("user/removeToken"); this.$store.dispatch("user/removeToken");
// this.$router.push("/login?action=refresh"); // this.$router.push("/login?action=refresh");
wsNotify.$emit("reconnect") wsNotify.$emit("reconnect");
} }
if (msg.type !== "report" || !msg.imei) return null; if (msg.type !== "report" || !msg.imei) return null;
...@@ -833,13 +843,13 @@ export default { ...@@ -833,13 +843,13 @@ export default {
} }
this.globalData = msg; this.globalData = msg;
deepClone(msg).image.forEach(item => { deepClone(msg).image.forEach((item) => {
if (item.png_detail && item.png_detail.length) { if (item.png_detail && item.png_detail.length) {
this.currentPngList[item.uri] = item.png_detail this.currentPngList[item.uri] = item.png_detail;
} else { } else {
this.currentPngList[item.uri] = [] this.currentPngList[item.uri] = [];
} }
}) });
this.resetData(m); this.resetData(m);
}, },
processData(msg) { processData(msg) {
...@@ -917,9 +927,6 @@ export default { ...@@ -917,9 +927,6 @@ export default {
item.highlight = false; item.highlight = false;
} }
if (item.png_detail && item.png_detail.length)
this.pngList = item.png_detail;
const target = this.imageList.find((img) => img.uri === item.uri); const target = this.imageList.find((img) => img.uri === item.uri);
if (target) { if (target) {
target.length = item.length; target.length = item.length;
...@@ -931,6 +938,7 @@ export default { ...@@ -931,6 +938,7 @@ export default {
) { ) {
target.highlight = true; target.highlight = true;
target.png_uncompressed_size = item.png_uncompressed_size; target.png_uncompressed_size = item.png_uncompressed_size;
if (this.pngShowMode) this.pngList = item.png_detail || [];
} }
if ( if (
item.png_file_size && item.png_file_size &&
......
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