优化批量添加shebei

menu1.0
fanluyan 7 months ago
parent 402ebe1f44
commit 1b9e1701e2

@ -107,7 +107,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.maxpullPull != 65535">
{{ scope.row.lastLeadPulls.maxpullPull }}</span
{{
scope.row.lastLeadPulls.maxpullPull.toFixed(2)
}}</span
><span v-else> - </span>
</span>
<span v-else> - </span>
@ -117,7 +119,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.maxpullWind != 65535">
{{ scope.row.lastLeadPulls.maxpullWind }}</span
{{
scope.row.lastLeadPulls.maxpullWind.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -128,7 +132,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.maxpullTilt != 65535">
{{ scope.row.lastLeadPulls.maxpullTilt }}</span
{{
scope.row.lastLeadPulls.maxpullTilt.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -139,7 +145,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.minpullPull != 65535">
{{ scope.row.lastLeadPulls.minpullPull }}</span
{{
scope.row.lastLeadPulls.minpullPull.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -150,7 +158,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.minpullWind != 65535">
{{ scope.row.lastLeadPulls.minpullWind }}</span
{{
scope.row.lastLeadPulls.minpullWind.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -161,7 +171,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.minpullTilt != 65535">
{{ scope.row.lastLeadPulls.minpullTilt }}</span
{{
scope.row.lastLeadPulls.minpullTilt.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -172,7 +184,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.maxwindWind != 65535">
{{ scope.row.lastLeadPulls.maxwindWind }}</span
{{
scope.row.lastLeadPulls.maxwindWind.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -186,7 +200,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.maxwindTilt != 65535">
{{ scope.row.lastLeadPulls.maxwindTilt }}</span
{{
scope.row.lastLeadPulls.maxwindTilt.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -200,7 +216,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.maxwindPull != 65535">
{{ scope.row.lastLeadPulls.maxwindPull }}</span
{{
scope.row.lastLeadPulls.maxwindPull.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -211,7 +229,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.minwindWind != 65535">
{{ scope.row.lastLeadPulls.minwindWind }}</span
{{
scope.row.lastLeadPulls.minwindWind.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -225,7 +245,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.minwindTilt != 65535">
{{ scope.row.lastLeadPulls.minwindTilt }}</span
{{
scope.row.lastLeadPulls.minwindTilt.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -239,7 +261,9 @@
<template slot-scope="scope">
<span v-if="scope.row.lastLeadPulls !== null">
<span v-if="scope.row.lastLeadPulls.minwindPull != 65535">
{{ scope.row.lastLeadPulls.minwindPull }}</span
{{
scope.row.lastLeadPulls.minwindPull.toFixed(2)
}}</span
>
<span v-else> - </span>
</span>
@ -286,7 +310,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.maxpullPull != 65535">
{{ scope.row.maxpullPull }}</span
{{ scope.row.maxpullPull.toFixed(2) }}</span
><span v-else> - </span>
</span>
<span v-else> - </span>
@ -296,7 +320,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.maxpullWind != 65535">
{{ scope.row.maxpullWind }}</span
{{ scope.row.maxpullWind.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -307,7 +331,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.maxpullTilt != 65535">
{{ scope.row.maxpullTilt }}</span
{{ scope.row.maxpullTilt.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -318,7 +342,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.minpullPull != 65535">
{{ scope.row.minpullPull }}</span
{{ scope.row.minpullPull.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -329,7 +353,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.minpullWind != 65535">
{{ scope.row.minpullWind }}</span
{{ scope.row.minpullWind.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -340,7 +364,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.minpullTilt != 65535">
{{ scope.row.minpullTilt }}</span
{{ scope.row.minpullTilt.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -351,7 +375,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.maxwindWind != 65535">
{{ scope.row.maxwindWind }}</span
{{ scope.row.maxwindWind.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -365,7 +389,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.maxwindTilt != 65535">
{{ scope.row.maxwindTilt }}</span
{{ scope.row.maxwindTilt.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -379,7 +403,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.maxwindPull != 65535">
{{ scope.row.maxwindPull }}</span
{{ scope.row.maxwindPull.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -390,7 +414,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.minwindWind != 65535">
{{ scope.row.minwindWind }}</span
{{ scope.row.minwindWind.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -404,7 +428,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.minwindTilt != 65535">
{{ scope.row.minwindTilt }}</span
{{ scope.row.minwindTilt.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -418,7 +442,7 @@
<template slot-scope="scope">
<span v-if="scope.row !== null">
<span v-if="scope.row.minwindPull != 65535">
{{ scope.row.minwindPull }}</span
{{ scope.row.minwindPull.toFixed(2) }}</span
>
<span v-else> - </span>
</span>
@ -914,6 +938,7 @@ export default {
const eTime = Math.floor(this.formdata.endtime / 1000);
if (this.dyFlag) {
let pullParams = {
devType: "2",
dyId: this.paramsData.id,
pageNum: this.page,
pageSize: this.pageSize,
@ -923,6 +948,7 @@ export default {
this.getIcingData(pullParams);
} else if (this.lineFlag) {
let pullParams = {
devType: "2",
lineId: this.paramsData.id,
pageNum: this.page,
pageSize: this.pageSize,

@ -30,7 +30,7 @@
<el-table-column label="温度(℃)">
<template slot-scope="scope">
<span v-if="scope.row.lastWeathers !== null">{{
scope.row.lastWeathers.airTemperature
scope.row.lastWeathers.airTemperature.toFixed(1)
}}</span>
<span v-else> - </span>
</template>
@ -39,7 +39,7 @@
<template slot-scope="scope">
<span v-if="scope.row.lastWeathers !== null"
><span v-if="scope.row.lastWeathers.humidity != 65535">
{{ scope.row.lastWeathers.humidity }}</span
{{ scope.row.lastWeathers.humidity.toFixed(1) }}</span
><span v-else> - </span></span
>
<span v-else> - </span>
@ -48,23 +48,27 @@
<el-table-column prop="maxWindSpeed" label="最大风速(m/s)">
<template slot-scope="scope">
<span v-if="scope.row.lastWeathers !== null">{{
scope.row.lastWeathers.maxWindSpeed
scope.row.lastWeathers.maxWindSpeed.toFixed(1)
}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="windDirection" label="瞬时风向(°)">
<template slot-scope="scope">
<span v-if="scope.row.lastWeathers !== null">{{
scope.row.lastWeathers.windDirection
}}</span>
<span
v-if="
scope.row.lastWeathers !== null &&
scope.row.lastWeathers.windDirection !== null
"
>{{ scope.row.lastWeathers.windDirection.toFixed(1) }}</span
>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="precipitation" label="雨量(mm/hour)">
<template slot-scope="scope">
<span v-if="scope.row.lastWeathers !== null">{{
scope.row.lastWeathers.precipitation
scope.row.lastWeathers.precipitation.toFixed(1)
}}</span>
<span v-else> - </span>
</template>
@ -72,7 +76,7 @@
<el-table-column prop="airPressure" label="气压(hPa(百帕))">
<template slot-scope="scope">
<span v-if="scope.row.lastWeathers !== null">{{
scope.row.lastWeathers.airPressure
scope.row.lastWeathers.airPressure.toFixed(1)
}}</span>
<span v-else> - </span>
</template>
@ -83,7 +87,9 @@
><span
v-if="scope.row.lastWeathers.radiationIntensity != 65535"
>
{{ scope.row.lastWeathers.radiationIntensity }}</span
{{
scope.row.lastWeathers.radiationIntensity.toFixed(0)
}}</span
><span v-else> - </span></span
>
<span v-else> - </span>
@ -197,7 +203,7 @@
<el-table-column prop="humidity" label="湿度(%RH)">
<template slot-scope="scope">
<span v-if="scope.row.humidity != 65535">
{{ scope.row.humidity }}</span
{{ scope.row.humidity.toFixed(1) }}</span
>
<span v-else> - </span>
</template>
@ -222,7 +228,7 @@
<el-table-column prop="radiationIntensity" label="日照(W/m2)">
<template slot-scope="scope">
<span v-if="scope.row.radiationIntensity !== 65535">
{{ scope.row.radiationIntensity }}</span
{{ scope.row.radiationIntensity.toFixed(0) }}</span
>
<span v-else> - </span>
</template>
@ -249,7 +255,7 @@
>
<template slot-scope="scope">
<span v-if="scope.row.avgWindDir10min !== 65535">
{{ scope.row.avgWindDir10min }}</span
{{ scope.row.avgWindDir10min.toFixed(1) }}</span
>
<span v-else> - </span>
</template>

@ -15,7 +15,12 @@
>
<div class="dyxl">
<el-form-item label="电压等级" class="dybox">
<el-select v-model="formdata.dyId" @change="getSearchxl">
<el-select
filterable
allow-create
v-model="formdata.dyId"
@change="handleDyChange"
>
<el-option
v-for="item in dyOptions"
:key="item.id"
@ -25,7 +30,12 @@
</el-select>
</el-form-item>
<el-form-item label="线路名称" class="xlbox">
<el-select v-model="formdata.lineId" filterable>
<el-select
v-model="formdata.lineId"
filterable
allow-create
@change="handleLineChange"
>
<el-option
v-for="item in xlOptions"
:key="item.id"
@ -83,6 +93,8 @@ import {
getSearchInfo,
getProtocolList,
importTermsApi,
addDyJoggle,
addLineJoggle,
} from "@/utils/api/index";
export default {
name: "globalTools",
@ -99,7 +111,6 @@ export default {
dyOptions: [], //
xlOptions: [], //线
protocolOptions: [], //
channelOptions: [
{
id: 1,
@ -130,9 +141,85 @@ export default {
created() {
this.getProtocol();
this.getSearchdy();
console.log(window.location.port);
if (window.location.port == 9911) {
const queryParams = this.$route.query;
// 'cmds'
if (queryParams.cmds) {
//
const cmdArray = queryParams.cmds.split(",");
// formdata.cmdidArr
this.formdata.cmdidArr = cmdArray.join("\n");
//
console.log(this.formdata.cmdidArr);
}
}
},
watch: {},
methods: {
//
handleDyChange(value) {
console.log(value);
this.formdata.lineId = "";
//
const newOption = this.dyOptions.find((option) => option.id === value);
if (!newOption) {
//
addDyJoggle({ name: value, dyValue: "220" })
.then((res) => {
console.log(res);
this.dyOptions.push({
name: res.data.name,
id: res.data.id,
});
this.getSearchdy();
console.log(this.dyOptions);
console.log(this.formdata);
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
console.log(this.formdata);
this.getSearchxl();
}
},
// 线
handleLineChange(value) {
console.log(value);
//
const newOption = this.xlOptions.find((option) => option.id === value);
if (!newOption) {
//
console.log([{ dyLevelId: this.formdata.dyId, name: value }]);
addLineJoggle({
list: [{ dyLevelId: this.formdata.dyId, name: value }],
})
.then((res) => {
console.log(res);
getSearchInfo({ type: 2, id: this.formdata.dyId })
.then((res) => {
this.xlOptions = res.data.list;
})
.catch((err) => {});
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
console.log(this.formdata);
}
},
getProtocol() {
//
getProtocolList()
@ -148,13 +235,22 @@ export default {
getSearchInfo({ type: 1 })
.then((res) => {
this.dyOptions = res.data.list;
this.getSearchxl();
})
.catch((err) => {});
},
//线
getSearchxl() {
console.log(this.formdata);
const newDyid = this.dyOptions.find(
(option) => option.name === this.formdata.dyId
);
if (newDyid) {
this.formdata.dyId = this.dyOptions.find(
(option) => option.name === this.formdata.dyId
).id;
}
console.log(this.formdata.dyId);
getSearchInfo({ type: 2, id: this.formdata.dyId })
.then((res) => {
this.xlOptions = res.data.list;
@ -162,6 +258,21 @@ export default {
.catch((err) => {});
},
submitForm() {
console.log(this.formdata);
console.log(this.xlOptions);
const newLineid = this.xlOptions.find(
(option) => option.name === this.formdata.lineId
);
console.log(newLineid);
if (newLineid) {
this.formdata.lineId = this.xlOptions.find(
(option) => option.name === this.formdata.lineId
).id;
}
console.log(this.formdata.lineId);
console.log(window.location.port);
console.log(window.location.port != 9911);
if (
!this.formdata.dyId ||
!this.formdata.lineId ||
@ -208,6 +319,14 @@ export default {
message: "批量添加装置成功",
type: "success",
});
if (window.location.port != 9911) {
const cmdList = params.cmdidList; // ["xyigq202411120000", "xyigq202411120002", "xyigq202411120003"]
//
const queryString = `${cmdList.join(",")}`;
console.log(queryString);
const url = `http://61.169.135.146:9911/#/globalTools?cmds=${queryString}`;
window.open(url, "_blank");
}
} else {
this.$message({
duration: 1500,

@ -3,12 +3,12 @@ const { defineConfig } = require("@vue/cli-service");
// const webpack = require("webpack");
module.exports = defineConfig({
//打包清除console
chainWebpack(config) {
config.optimization.minimizer("terser").tap((args) => {
args[0].terserOptions.compress.drop_console = true;
return args;
});
},
// chainWebpack(config) {
// config.optimization.minimizer("terser").tap((args) => {
// args[0].terserOptions.compress.drop_console = true;
// return args;
// });
// },
productionSourceMap: false, // 生产环境是否要生成 sourceMap
publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "./", // 部署应用包时的基本 URL
//assetsPublicPath: process.env.NODE_ENV === "production" ? "" : "/",

Loading…
Cancel
Save