清除所有命令

master
fanluyan 2 years ago
parent f25447d691
commit 92ccd9e0f8

@ -28,6 +28,30 @@ export function getqueryTermsApi(data) {
},
});
}
//获取规约
export function getqueryProtocolApi(data) {
return request({
url: "api/queryProtocol.php",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//获取活动列表
export function getqueryActivityApi(data) {
return request({
url: "api/queryActivity.php",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//运维,快心跳
export function getdoActionApi(data) {
return request({

@ -25,6 +25,12 @@
multipleSelection.length
}}</el-tag></span
>
<span
>运维<el-tag type="primary">{{ ywNumber }}</el-tag></span
>
<span
>快心跳<el-tag type="primary">{{ kxtNumber }}</el-tag></span
>
<span
>在线<el-tag type="success">{{ onlineNum }}</el-tag></span
>
@ -89,7 +95,15 @@
<el-tag type="danger" v-else>线</el-tag>
</template>
</el-table-column>
<el-table-column label="运维" prop="in_maintain" width="70" sortable>
<el-table-column label="运维" prop="in_maintain" width="120" sortable>
<template slot="header" slot-scope="scope">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAllYW"
@change="handlecheckAllYW"
>运维</el-checkbox
>
</template>
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.in_maintain"
@ -99,7 +113,15 @@
></el-checkbox>
</template>
</el-table-column>
<el-table-column label="快心跳" prop="quick_hb" width="88" sortable>
<el-table-column label="快心跳" prop="quick_hb" width="128" sortable>
<template slot="header" slot-scope="scope">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAllKXT"
@change="handlecheckAllKXT"
>快心跳</el-checkbox
>
</template>
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.quick_hb"
@ -264,7 +286,7 @@
</template>
</el-table-column>
</el-table-column>
<el-table-column label="CMA服务器" v-if="cmacheck" min-width="160">
<el-table-column label="CMA服务器" v-if="cmacheck" width="160">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -610,6 +632,12 @@ export default {
65290: "河南统一视频v2020",
},
multipleSelection: [],
isIndeterminate: false,
checkAllYW: false,
checkAllKXT: false,
ywNumber: 0,
kxtNumber: 0,
nowTime: new Date().getTime() / 1000,
gycheck: false,
@ -771,18 +799,34 @@ export default {
},
mounted() {
this.loadLocalStorage();
// this.$nextTick(() => {
// this.getNumber();
// });
},
watch: {
tableData: {
handler(newVal) {
//
console.log("数据已更新:", newVal);
this.getNumber();
},
deep: true,
},
},
methods: {
//
getNumber() {
console.log(this.tableData);
this.ywNumber = this.tableData.filter(
(item) => item.in_maintain == 1
).length;
this.kxtNumber = this.tableData.filter(
(item) => item.quick_hb == 1
).length;
console.log(this.ywNumber, this.kxtNumber);
},
//
handleExport() {
htmlToExcel.getExcel("#ywTable", "设备运维信息");
@ -806,7 +850,50 @@ export default {
console.log(val);
this.$refs.rowMsgDialogref.display(val);
},
handlecheckAllYW(val) {
let totalCount = this.tableData.length;
let someStatusCount = 0;
console.log(val);
if (val) {
console.log("选中");
this.tableData.forEach((item) => {
item.in_maintain = 1;
console.log(item);
getdoActionApi({
act: "mntn",
termId: item.id,
mntn: 1,
})
.then((res) => {
console.log(res);
})
.catch((err) => {});
});
} else {
console.log("取消选中");
this.tableData.forEach((item) => {
item.in_maintain = 0;
someStatusCount = 0;
console.log(item);
getdoActionApi({
act: "mntn",
termId: item.id,
mntn: 0,
})
.then((res) => {
console.log(res);
})
.catch((err) => {});
});
}
localStorage.setItem("checkAllYW", this.checkAllYW);
this.checkAllYW = totalCount === this.ywNumber ? true : false;
this.isIndeterminate = this.ywNumber > 0 && this.ywNumber < totalCount;
// this.isIndeterminate = false;
},
//
UpdateMaintainMode(val, row) {
console.log("运维");
@ -821,6 +908,51 @@ export default {
.catch((err) => {});
},
//
handlecheckAllKXT(val) {
let totalCount = this.tableData.length;
let someStatusCount = 0;
console.log(val);
if (val) {
console.log("选中");
this.tableData.forEach((item) => {
item.quick_hb = 1;
someStatusCount++;
console.log(item);
getdoActionApi({
act: "quickhb",
termId: item.id,
quickhb: 1,
})
.then((res) => {
console.log(res);
})
.catch((err) => {});
});
} else {
console.log("取消选中");
this.tableData.forEach((item) => {
item.quick_hb = 0;
someStatusCount = 0;
console.log(item);
getdoActionApi({
act: "quickhb",
termId: item.id,
quickhb: 0,
})
.then((res) => {
console.log(res);
})
.catch((err) => {});
});
}
localStorage.setItem("checkAllKXT", this.checkAllKXT);
this.checkAllKXT = totalCount === this.kxtNumber ? true : false;
this.isIndeterminate = this.kxtNumber > 0 && this.kxtNumber < totalCount;
// this.isIndeterminate = false;
},
//
UpdateQuickHbMode(val, row) {
console.log("快心跳");
getdoActionApi({
@ -888,7 +1020,7 @@ export default {
console.log("上传日志");
var params = {
act: "upload-logs",
url: "http://180.166.218.222:40102/upload/",
url: "http://180.166.218.222:40101/upload/",
termIds: this.idArray.join("-"),
};
this.changeIssue(params);
@ -1062,6 +1194,12 @@ export default {
localStorage.setItem("bbcheck", this.bbcheck);
},
loadLocalStorage() {
this.checkAllKXT = localStorage.getItem("checkAllKXT", this.checkAllKXT)
? JSON.parse(localStorage.getItem("checkAllKXT"))
: false;
this.checkAllYW = localStorage.getItem("checkAllYW", this.checkAllYW)
? JSON.parse(localStorage.getItem("checkAllYW"))
: false;
this.gycheck = localStorage.getItem("gycheck")
? JSON.parse(localStorage.getItem("gycheck"))
: false;
@ -1141,6 +1279,9 @@ export default {
.el-table__cell {
text-align: center;
.cell {
padding: 0px;
}
}
.bbStyle {
text-align: left;

@ -44,6 +44,36 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否运维" class="ismntClass">
<el-select v-model="formdata.ismntend">
<el-option
v-for="item in mntendOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="规约" class="gybox">
<el-select v-model="formdata.protocolId" filterable>
<el-option
v-for="item in protocolOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="活动" class="activitybox">
<el-select v-model="formdata.activityId" filterable>
<el-option
v-for="item in activityOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<div class="bottomSearch">
<el-form-item label="出厂ID" class="oidbox">
@ -153,7 +183,7 @@
</div>
<div
class="tableBox"
:style="{ height: showDiv ? 'calc(100% - 102px)' : 'calc(100% - 2px)' }"
:style="{ height: showDiv ? 'calc(100% - 82px)' : 'calc(100% - 2px)' }"
>
<tableMain
:tableData="dataList"
@ -166,7 +196,12 @@
</div>
</template>
<script>
import { getqueryLineApi, getqueryTermsApi } from "@/utils/api/index";
import {
getqueryLineApi,
getqueryTermsApi,
getqueryProtocolApi,
getqueryActivityApi,
} from "@/utils/api/index";
import tableMain from "./components/tableMain";
export default {
name: "home",
@ -188,6 +223,9 @@ export default {
lineId: 0,
towerId: 0,
isonline: -1,
protocolId: 0,
activityId: 0,
ismntend: 1,
oidInput: "",
oidCheck: 0,
cmdidInput: "",
@ -197,11 +235,19 @@ export default {
versionInput: "",
versionCheck: 0,
},
protocolOptions: [{ id: 0, name: "全部" }], //
activityOptions: [{ id: 0, name: "全部" }], //
mntendOptions: [
{ id: 0, name: "全部" },
{ id: 1, name: "运维" },
{ id: 2, name: "未运维" },
], //
dataList: [],
tableLoaidng: false,
tableLoaidng: true,
onlineNum: "", //线
offlineNum: "", //线
noPicNum: "", //
intervalId: null, // ID
};
},
created() {
@ -213,11 +259,12 @@ export default {
}
};
//this.fetchData(); //
setInterval(this.fetchData, 60000); // 10
//setInterval(this.fetchData, 60000); // 10
},
mounted() {
this.getLineList();
this.onSubmit();
this.getprotocolList();
this.getActivityList();
},
watch: {},
methods: {
@ -242,26 +289,111 @@ export default {
})
.catch((err) => {});
},
//linelist 线
getprotocolList() {
getqueryProtocolApi()
.then((res) => {
console.log(res);
this.protocolOptions = [{ id: 0, name: "全部" }];
this.protocolOptions = this.protocolOptions.concat(res.data);
this.formdata.protocolId = this.protocolOptions[0].id;
})
.catch((err) => {});
},
//
getActivityList() {
getqueryActivityApi({
act: "list",
})
.then((res) => {
console.log(res);
console.log("222222222222222");
this.activityOptions = [{ id: 0, name: "全部" }];
let activeArr = res.data.map((item) => ({
id: item.id,
name: item.title,
}));
this.activityOptions = this.activityOptions.concat(activeArr);
this.formdata.activityId = this.activityOptions[0].id;
this.onSubmit();
})
.catch((err) => {});
},
onSubmit() {
this.tableLoaidng = true;
getqueryTermsApi({
this.dataList = [];
let params = {
lineId: this.formdata.lineId,
towerId: this.formdata.towerId,
isonLine: this.formdata.isonline,
fc: 4,
fn1: "oid",
fv1: this.formdata.oidInput,
frev1: this.formdata.oidCheck,
fn2: "cmdid",
fv2: this.formdata.cmdidInput,
frev2: this.formdata.cmdidCheck,
fn3: "cma",
fv3: this.formdata.cmaInput,
frev3: this.formdata.cmaCheck,
fn4: "version",
fv4: this.formdata.versionInput,
frev4: this.formdata.versionCheck,
})
};
var nonmntnedObj = {
name: "mntned",
value: this.formdata.ismntend,
invertVal: "",
};
var protocolObj = {
name: "protocol",
value: this.formdata.protocolId,
invertVal: 0,
};
var activityObj = {
name: "activity",
value: this.formdata.activityId,
invertVal: 0,
};
var oidObj = {
name: "oid",
value: this.formdata.oidInput,
invertVal: this.formdata.oidCheck,
};
var cmdidObj = {
name: "cmdid",
value: this.formdata.cmdidInput,
invertVal: this.formdata.cmdidCheck,
};
var cmaObj = {
name: "cma",
value: this.formdata.cmaInput,
invertVal: this.formdata.cmaCheck,
};
var versionObj = {
name: "version",
value: this.formdata.versionInput,
invertVal: this.formdata.versionCheck,
};
let arrayOfObjects = [nonmntnedObj, protocolObj, activityObj];
if (oidObj.value !== "") {
arrayOfObjects.push(oidObj);
}
if (cmaObj.value !== "") {
arrayOfObjects.push(cmaObj);
}
if (cmdidObj.value !== "") {
arrayOfObjects.push(cmdidObj);
}
if (versionObj.value !== "") {
arrayOfObjects.push(versionObj);
}
console.log(arrayOfObjects);
for (var k = 0; k < arrayOfObjects.length; k++) {
params["fc"] = arrayOfObjects.length;
params["fn" + (k + 1)] = arrayOfObjects[k].name;
params["fv" + (k + 1)] = arrayOfObjects[k].value;
params["frev" + (k + 1)] = arrayOfObjects[k].invertVal;
}
console.log(params);
//
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = null;
}
const interval = 60000; // 60000
this.intervalId = setInterval(() => {
//
this.fetchData();
}, interval);
getqueryTermsApi(params)
.then((res) => {
res.data = res.data.map((item) => {
if (!item.raw_report.pic) {
@ -300,24 +432,68 @@ export default {
.catch((err) => {});
},
fetchData() {
getqueryTermsApi({
let params = {
lineId: this.formdata.lineId,
towerId: this.formdata.towerId,
isonLine: this.formdata.isonline,
fc: 4,
fn1: "oid",
fv1: this.formdata.oidInput,
frev1: this.formdata.oidCheck,
fn2: "cmdid",
fv2: this.formdata.cmdidInput,
frev2: this.formdata.cmdidCheck,
fn3: "cma",
fv3: this.formdata.cmaInput,
frev3: this.formdata.cmaCheck,
fn4: "version",
fv4: this.formdata.versionInput,
frev4: this.formdata.versionCheck,
})
};
var nonmntnedObj = {
name: "mntned",
value: this.formdata.ismntend,
invertVal: "",
};
var protocolObj = {
name: "protocol",
value: this.formdata.protocolId,
invertVal: 0,
};
var activityObj = {
name: "activity",
value: this.formdata.activityId,
invertVal: 0,
};
var oidObj = {
name: "oid",
value: this.formdata.oidInput,
invertVal: this.formdata.oidCheck,
};
var cmdidObj = {
name: "cmdid",
value: this.formdata.cmdidInput,
invertVal: this.formdata.cmdidCheck,
};
var cmaObj = {
name: "cma",
value: this.formdata.cmaInput,
invertVal: this.formdata.cmaCheck,
};
var versionObj = {
name: "version",
value: this.formdata.versionInput,
invertVal: this.formdata.versionCheck,
};
let arrayOfObjects = [nonmntnedObj, protocolObj, activityObj];
if (oidObj.value !== "") {
arrayOfObjects.push(oidObj);
}
if (cmaObj.value !== "") {
arrayOfObjects.push(cmaObj);
}
if (cmdidObj.value !== "") {
arrayOfObjects.push(cmdidObj);
}
if (versionObj.value !== "") {
arrayOfObjects.push(versionObj);
}
console.log(arrayOfObjects);
for (var k = 0; k < arrayOfObjects.length; k++) {
params["fc"] = arrayOfObjects.length;
params["fn" + (k + 1)] = arrayOfObjects[k].name;
params["fv" + (k + 1)] = arrayOfObjects[k].value;
params["frev" + (k + 1)] = arrayOfObjects[k].invertVal;
}
console.log(params);
getqueryTermsApi(params)
.then((res) => {
console.log(res);
res.data = res.data.map((item) => {
@ -360,6 +536,8 @@ export default {
lineId: 0,
towerId: 0,
isonline: -1,
protocolId: 0,
activityId: 0,
oidInput: "",
oidCheck: 0,
cmdidInput: "",
@ -385,11 +563,21 @@ export default {
padding: 12px;
.filterBox {
position: relative;
font-size: 12px;
.el-form-item__label {
font-size: 12px;
}
.el-input__inner {
font-size: 12px;
}
.el-form {
display: flex;
// align-items: center;
// flex-wrap: wrap;
flex-direction: column;
.el-form-item {
margin-bottom: 8px;
}
.topSearch {
display: flex;
}
@ -407,11 +595,21 @@ export default {
}
}
}
.ismntClass {
.el-select {
width: 100px;
}
}
.isonLineClass {
.el-select {
width: 80px;
}
}
.gybox {
.el-select {
width: 160px;
}
}
.oidbox,
.cmdibox,
.cmabox,

@ -22,11 +22,18 @@
placeholder="请输入设备ID查询"
@change="leftInputChange"
></el-input>
<span class="mlspan">命令:{{ leftCommand.length }}</span>
<span class="time"
>更新时间{{
$moment(updateTime).format("YYYY-MM-DD HH:mm:ss")
}}</span
>
<el-button
class="deletebtn"
type="danger"
icon="el-icon-delete"
@click="deleteml"
></el-button>
</div>
<div
class="commandList"
@ -73,11 +80,18 @@
placeholder="请输入设备ID查询"
@change="rightInputChange"
></el-input>
<span class="mlspan">命令:{{ rightCommand.length }}</span>
<span class="time"
>更新时间{{
$moment(updateTime).format("YYYY-MM-DD HH:mm:ss")
}}</span
>
<el-button
class="deletebtn"
type="danger"
icon="el-icon-delete"
@click="deletehis"
></el-button>
</div>
<div class="commandList" v-if="rightCommand.length != 0">
<p class="comLi" v-for="(item, index) in rightCommand" :key="index">
@ -191,7 +205,7 @@ export default {
methods: {
getCmdList() {
//this.leftComLoading = true;
getqueryCmdsApi({ p: 1, ps: 200 })
getqueryCmdsApi({ p: 1, ps: 10000 })
.then((res) => {
console.log(res);
this.runCommand = res.data;
@ -241,7 +255,7 @@ export default {
//
getEndList() {
getqueryCmdsApi({ qt: "his", p: 1, ps: 200 })
getqueryCmdsApi({ qt: "his", p: 1, ps: 10000 })
.then((res) => {
console.log(res);
//this.endCommand = res.data;
@ -382,6 +396,62 @@ export default {
item.cmdid.includes(value)
);
},
deleteml() {
getdoActionApi({
act: "clear",
})
.then((res) => {
console.log(res);
this.$confirm("确定清除所有命令?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$message({
duration: 1500,
showClose: true,
message: "命令已清除",
type: "success",
});
this.commandShow = false;
this.getCmdList();
this.getEndList();
})
.catch(() => {
this.commandShow = false;
});
})
.catch((err) => {});
},
deletehis() {
getdoActionApi({
act: "clearHis",
})
.then((res) => {
console.log(res);
this.$confirm("确定清除所有命令?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$message({
duration: 1500,
showClose: true,
message: "命令已清除",
type: "success",
});
this.getCmdList();
this.getEndList();
})
.catch(() => {});
})
.catch((err) => {});
},
},
beforeDestroy() {
//
@ -423,10 +493,18 @@ export default {
.cmdidClass {
width: 180px;
}
.mlspan {
font-size: 14px;
margin-left: 8px;
}
.time {
font-size: 12px;
margin-left: 8px;
}
.deletebtn {
margin-left: auto;
padding: 4px;
}
}
.commandList {
width: 100%;

@ -20,7 +20,7 @@ module.exports = defineConfig({
proxy: {
"/api": {
//表示拦截以/api开头的请求路径
target: "http://180.166.218.222:40102/", //
target: "http://180.166.218.222:40101/", //
changOrigin: true, //是否开启跨域
pathRewrite: {
"^/api": "/api", //重写api把api变成空字符因为我们真正请求的路径是没有api的

Loading…
Cancel
Save