jcbranch
fanluyan 12 months ago
parent 0713f074ed
commit 6029781add

@ -48,7 +48,19 @@
</el-table-column>
<el-table-column label="电池">
<template slot-scope="scope">
<span>{{ scope.row.reportMap.battery }}</span>
<span
v-if="
scope.row.reportMap !== null &&
scope.row.reportMap.hasOwnProperty('batteryVoltage') &&
scope.row.reportMap.hasOwnProperty('batteryChargingVoltage') &&
scope.row.reportMap.hasOwnProperty('batteryPower')
"
>
{{ scope.row.reportMap.batteryVoltage }}V/{{
scope.row.reportMap.batteryChargingVoltage
}}V/{{ scope.row.reportMap.batteryPower }}
</span>
<span v-else>{{ scope.row.reportMap.battery }}</span>
</template>
</el-table-column>
<el-table-column label="电池温度" width="70">

@ -251,7 +251,21 @@
</u-table-column>
<u-table-column label="电池状态" width="126" key="dc" v-if="dccheck">
<template slot-scope="scope">
<span>{{
<span
v-if="
scope.row.mntnStatus.reportMap !== null &&
scope.row.mntnStatus.reportMap.hasOwnProperty('batteryVoltage') &&
scope.row.mntnStatus.reportMap.hasOwnProperty(
'batteryChargingVoltage'
) &&
scope.row.mntnStatus.reportMap.hasOwnProperty('batteryPower')
"
>
{{ scope.row.mntnStatus.reportMap.batteryVoltage }}V/{{
scope.row.mntnStatus.reportMap.batteryChargingVoltage
}}V/{{ scope.row.mntnStatus.reportMap.batteryPower }}
</span>
<span v-else>{{
scope.row.mntnStatus.reportMap !== null &&
scope.row.mntnStatus.reportMap.hasOwnProperty("battery")
? scope.row.mntnStatus.reportMap.battery
@ -689,7 +703,7 @@
</el-drawer>
<!-- 设置ie服务器 -->
<el-dialog
title="设置ie服务器"
title="设置CMA服务器"
:visible.sync="ieVisible"
width="30%"
:close-on-click-modal="false"
@ -918,12 +932,21 @@
title="删除文件"
:visible.sync="deleteFileVisible"
:close-on-click-modal="false"
width="30%"
width="504px"
class="deleteDialog"
>
<el-form :model="delFileForm" ref="delFileFormref" :rules="delFileRules">
<el-form-item label="删除文件路径:" prop="delFile">
<el-input v-model="delFileForm.delFile"></el-input>
</el-form-item>
<ul>
<li
v-for="(item, index) in pullpathOption"
@click="handleDelPath(item)"
>
{{ item.desc }}{{ item.name }}
</li>
</ul>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="deleteFileVisible = false"> </el-button>
@ -936,7 +959,8 @@
title="拉取文件"
:visible.sync="pullFileVisible"
:close-on-click-modal="false"
width="30%"
width="504px"
class="pullBoxDialog"
>
<el-form
:model="pullFileForm"
@ -946,10 +970,24 @@
<el-form-item label="文件路径:" prop="pullFile">
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
:autosize="{ minRows: 2, maxRows: 8 }"
v-model="pullFileForm.pullFile"
></el-input>
</el-form-item>
<el-checkbox-group
v-model="checkedName"
@change="handleCheckedCitiesChange"
>
<el-checkbox
v-for="(item, index) in pullpathOption"
:label="item.name"
:key="item.name"
>{{ item.desc }}{{ item.name }}</el-checkbox
>
</el-checkbox-group>
<!-- <ul>
<li @click="handlepullPath(item)">{{ item.desc }}{{ item.name }}</li>
</ul> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="pullFileVisible = false"> </el-button>
@ -964,6 +1002,7 @@
:visible.sync="pushFileVisible"
:close-on-click-modal="false"
width="504px"
v-loading="pushLoading"
>
<el-form
:model="pushFileForm"
@ -983,8 +1022,6 @@
class="upload-demo"
ref="upload"
action="#"
:limit="1"
:file-list="fileList"
:before-upload="beforeUpload"
:auto-upload="false"
>
@ -995,7 +1032,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="pullFileVisible = false"> </el-button>
<el-button @click="pushFileVisible = false"> </el-button>
<el-button type="primary" @click="handlePush"> </el-button>
</div>
</el-dialog>
@ -1249,6 +1286,7 @@ export default {
upVal: "",
pathVal: "",
},
bigpathOption: [
{
name: "/sdcard/com.xypower.mpapp/data/recog/rp.dat",
@ -1362,6 +1400,7 @@ export default {
},
],
},
pushLoading: false,
pathOption: [
{
name: "/sdcard/com.xypower.mpapp/data/App.json",
@ -1403,7 +1442,66 @@ export default {
name: "/sdcard/com.xypower.mpapp/data/videoparams/78",
desc: "采样配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/recog/rp.dat",
desc: "AI识别文件",
},
{
name: "/sdcard/com.xypower.mpapp/data/recog/rb.dat",
desc: "AI识别文件",
},
],
pullpathOption: [
{
name: "/sdcard/com.xypower.mpapp/data/App.json",
desc: "MpAPP全局配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/recog.json",
desc: "AI全局配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/bc.json",
desc: "电压电量配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/channels/1.json",
desc: "通道拍照配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/channels/2.json",
desc: "通道拍照配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/imgparams/1",
desc: "图像参数配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/imgparams/2",
desc: "图像参数配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/videoparams/1",
desc: "短视频参数配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/videoparams/2",
desc: "短视频参数配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/videoparams/78",
desc: "采样配置",
},
{
name: "/sdcard/com.xypower.mpapp/data/recog/rp.dat",
desc: "AI识别文件",
},
{
name: "/sdcard/com.xypower.mpapp/data/recog/rb.dat",
desc: "AI识别文件",
},
],
checkedName: [],
//base64
pushFileVisible: false,
fileList: [],
@ -1914,11 +2012,15 @@ export default {
cmdSendApi(params)
.then((res) => {
console.log(res);
this.$refs.ywMultipleTable.clearSelection();
this.idArray = [];
console.log(this.multipleSelection);
console.log("我执行了命令");
this.$parent.fetchData();
if (res.code == 200) {
this.$refs.ywMultipleTable.clearSelection();
this.idArray = [];
console.log(this.multipleSelection);
console.log("我执行了命令");
this.$parent.fetchData();
this.pushLoading = false;
this.pushFileVisible = false;
}
})
.catch((err) => {});
},
@ -2090,13 +2192,26 @@ export default {
});
},
//
handleCheckedCitiesChange(value) {
// 便
this.pullFileForm.pullFile = value
.map((name) => name + "\n") //
.join(""); //
//
if (this.pullFileForm.pullFile.endsWith("\n")) {
this.pullFileForm.pullFile = this.pullFileForm.pullFile.slice(0, -1);
}
},
handlePull() {
console.log(this.$refs.pullFileFormref);
this.$refs.pullFileFormref.validate((valid) => {
if (valid) {
var params = {
action: "pull_files",
path: this.pullFileForm.pullFile,
paths: this.pullFileForm.pullFile
.split(/\r\n|\n|\r/)
.filter(Boolean),
termIds: this.idArray,
};
console.log(params);
@ -2109,10 +2224,13 @@ export default {
console.log(row);
this.pushFileForm.name = row.name;
},
handleDelPath(row) {
this.delFileForm.delFile = row.name;
},
//
beforeUpload(file) {
console.log(file);
return new Promise((resolve, reject) => {
new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = (e) => {
@ -2136,6 +2254,7 @@ export default {
reject(error);
};
});
return false;
},
sendToBackend(base64Data) {
this.$refs.pushFileFormref.validate((valid) => {
@ -2148,11 +2267,12 @@ export default {
};
console.log(params);
this.changeIssue(params);
this.pushFileVisible = false;
// this.pushFileVisible = false;
}
});
},
handlePush() {
this.pushLoading = true;
this.$refs.upload.submit();
},
//
@ -2732,6 +2852,22 @@ export default {
}
}
}
.deleteDialog {
.el-dialog__body {
height: auto;
ul {
li {
list-style: none;
font-size: 13px;
line-height: 22px;
cursor: pointer;
&:hover {
background-color: #b9e2dd;
}
}
}
}
}
.configDialogBox {
ul {
margin-bottom: 12px;

@ -114,12 +114,22 @@ export default {
},
filters: {
changeType(val) {
if (val == "0") return "0B";
if (val === 0) return "0B";
var k = 1024;
var sizes = ["B", "KB", "MB", "GB", "TB"];
let i = 0;
while (val >= k) {
val /= k;
i++;
}
let formattedVal = parseFloat(val.toFixed(2))
.toString()
.replace(/(\.\d*?)(0+)$/, function (m, $1, $2) {
return $2.length > 0 ? $1 : val.toString();
});
let i = Math.floor(Math.log(val) / Math.log(k)); //kB?MB
return (val / Math.pow(k, i)).toPrecision(3) + "" + sizes[i];
return formattedVal + " " + sizes[i];
},
},
computed: {},

@ -434,6 +434,7 @@ export default {
},
beforeDestroy() {
//
console.log("清除report列表的轮巡");
clearInterval(this.cmdtimer);
clearInterval(this.endtimer);
this.cmdtimer = null;

@ -187,12 +187,24 @@ export default {
computed: {},
filters: {
changeType(val) {
if (val == "0") return "0B";
if (val === 0) return "0B";
var k = 1024;
var sizes = ["B", "KB", "MB", "GB", "TB"];
let i = Math.floor(Math.log(val) / Math.log(k)); //kB?MB
return (val / Math.pow(k, i)).toPrecision(3) + "" + sizes[i];
let i = 0;
while (val >= k) {
val /= k;
i++;
}
let formattedVal = parseFloat(val.toFixed(2))
.toString()
.replace(/(\.\d*?)(0+)$/, function (m, $1, $2) {
return $2.length > 0 ? $1 : val.toString();
});
return formattedVal + " " + sizes[i];
},
},
mounted() {

Loading…
Cancel
Save