master
fanluyan 2 years ago
parent c1e662b471
commit 54d963551d

@ -1,5 +1,20 @@
import request from "../request";
//获取登录
export function loginJoggle(data) {
return request({
url: "/api/login",
method: "post",
data,
});
}
//声光报警
export function alarmMarkJoggle(data) {
return request({
url: "/api/alarmMark",
method: "post",
data,
});
}
//实时监控页面
//获取线路树状结构
export function getdyTreeListJoggle(data) {

@ -34,7 +34,7 @@
<el-button slot="prepend" icon="el-icon-lock"></el-button>
</el-input>
</el-form-item>
<el-form-item prop="verificationCode" class="verifyItem">
<!-- <el-form-item prop="verificationCode" class="verifyItem">
<el-input
v-model="userInfo.verificationCode"
placeholder="请输入验证码"
@ -43,10 +43,10 @@
</el-input>
<div @click="refreshCode" class="verifyBox">
<!--验证码组件-->
<s-identify :identifyCode="identifyCode"></s-identify>
</div>
</el-form-item>
</el-form-item> -->
<div class="login-btn">
<el-button type="primary" @click="submitForm()"></el-button>
@ -61,36 +61,34 @@
<script>
import { mapMutations } from "vuex";
import { login } from "@/utils/api/index";
import SIdentify from "./components/SIdentify";
import { loginJoggle } from "@/utils/api/index";
//import SIdentify from "./components/SIdentify";
export default {
components: {
SIdentify,
//SIdentify,
},
data: function () {
return {
userInfo: {
username: "xytest",
password: "123456",
verificationCode: "",
username: "",
password: "",
//verificationCode: "",
},
rules: {
username: [
{ required: true, message: "请输入用户名", trigger: "blur" },
],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
verificationCode: [
{ required: true, message: "验证码不能为空", trigger: "blur" },
],
// verificationCode: [
// { required: true, message: "", trigger: "blur" },
// ],
},
token: "",
identifyCode: "",
identifyCodes: "1234567890abcdefjhijklinopqrsduvwxyz",
// identifyCode: "",
// identifyCodes: "1234567890abcdefjhijklinopqrsduvwxyz",
};
},
computed: {
...mapMutations(["setColorTheme"]),
},
computed: {},
methods: {
submitForm() {
this.$refs.loginForm.validate((valid) => {
@ -112,25 +110,25 @@ export default {
},
getLogin() {},
//
refreshCode() {
this.identifyCode = "";
this.makeCode(this.identifyCodes, 4);
},
makeCode(o, l) {
for (let i = 0; i < l; i++) {
this.identifyCode +=
this.identifyCodes[this.randomNum(0, this.identifyCodes.length)];
}
},
randomNum(min, max) {
return Math.floor(Math.random() * (max - min) + min);
},
// refreshCode() {
// this.identifyCode = "";
// this.makeCode(this.identifyCodes, 4);
// },
// makeCode(o, l) {
// for (let i = 0; i < l; i++) {
// this.identifyCode +=
// this.identifyCodes[this.randomNum(0, this.identifyCodes.length)];
// }
// },
// randomNum(min, max) {
// return Math.floor(Math.random() * (max - min) + min);
// },
},
created() {},
mounted() {
//
this.identifyCode = "";
this.makeCode(this.identifyCodes, 4);
// this.identifyCode = "";
// this.makeCode(this.identifyCodes, 4);
},
};
</script>

@ -38,6 +38,7 @@
ref="tree"
node-key="id"
:default-expand-all="true"
@check="getCheckedNodes"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ data.name }}</span>
@ -79,6 +80,7 @@ export default {
children: "list",
label: "name",
},
termidArr: [],
ruleid: "",
parmsList: [], //
multipleSelection: [],
@ -90,6 +92,8 @@ export default {
//
checkAll: true,
isIndeterminate: true, //
timer: null,
termidArrNum: -1,
};
},
mounted() {},
@ -106,7 +110,6 @@ export default {
getScheduleRulelAccessList({})
.then((res) => {
this.listnr = res.data.list;
this.aisleList = res.data.channellist;
})
.catch((err) => {});
@ -132,42 +135,36 @@ export default {
handleCheckBox() {
console.log(this.zzListCheck);
},
//
eachTreeData(data, callback, childKey) {
if (!childKey) childKey = "children";
data.forEach((d) => {
if (callback(d) !== false && d[childKey])
this.eachTreeData(d[childKey], callback, childKey);
});
},
// keykey
addKeyToList(data) {
let key = 0;
this.eachTreeData(data, (d) => {
d.key = key++;
});
},
//
getCheckedNodes() {
this.parmsList = [];
const checkedNodes = this.$refs.tree.getCheckedNodes(false, true); //
//const checkedParam = []; //
let index = -1;
// console.log(checkedNodes);
console.log(checkedNodes);
if (checkedNodes.length !== 0) {
checkedNodes.forEach((item) => {
// list
if (item.list !== undefined) {
index++;
this.parmsList[index] = {
//name: item.name,
termid: item.id,
channelidlist: [],
};
} else {
//list id push channelidlist
this.parmsList[index].channelidlist.push(item.id);
if (item.list == undefined) {
console.log("1111111111111");
console.log(item);
this.termidArr.push(item.id);
}
// list
// if (item.list !== undefined) {
// index++;
// this.parmsList[index] = {
// //name: item.name,
// termid: item.id,
// channelidlist: [],
// };
// console.log(item);
// } else {
// console.log("aaaaaaaaaaaaaa");
// //list id push channelidlist
// this.parmsList[index].channelidlist.push(item.id);
// }
//bsManufacturer 线 线id
// if (item.bsManufacturer !== undefined) {
// this.ruleid = item.id;
@ -181,60 +178,57 @@ export default {
.filter((item) => item.channelidlist.length !== 0)
.map((item) => {
return {
termid: item.termid,
channelidlist: item.channelidlist,
termid: this.termidArr[0],
channelidlist: [this.checkedAisle],
};
});
this.termidArr = Array.from(new Set(this.termidArr));
console.log(this.termidArr);
console.log(this.parmsList);
return this.parmsList;
},
//
submitForm() {
console.log(this.zzListCheck);
console.log(this.checkedAisle);
let checkzzList = [];
for (let i = 0; i < this.zzListCheck.length; i++) {
console.log(this.zzListCheck[i]);
checkzzList.push({
termid: this.zzListCheck[i],
channelidlist: [this.checkedAisle],
});
}
console.log(checkzzList);
if (this.zzListCheck.length == 0) {
this.$message.error("请选择通道");
} else {
setScheduleRulel({
scheduleid: this.selid,
list: checkzzList,
console.log(this.termidArr);
this.timer = window.setInterval(() => {
this.termidArrNum++;
console.log(this.termidArrNum);
if (this.termidArrNum < this.termidArr.length) {
this.sureSum();
} else {
this.$message.success("添加成功");
this.isShow = false;
this.$parent.deviceList();
clearTimeout(this.timer);
}
}, 1000);
},
//
sureSum() {
setScheduleRulel({
list: [
{
termid: this.termidArr[this.termidArrNum],
channelidlist: [this.checkedAisle],
},
],
scheduleid: this.selid,
})
.then((res) => {
// this.$message.success("");
})
.then((res) => {
this.isShow = false;
this.$message.success("添加成功");
this.$parent.deviceList();
})
.catch((err) => {
this.$message.error("添加失败");
});
}
// if (this.parmsList.length == 0)
// return this.$message.error("");
// setScheduleRulel({ list: this.parmsList, ruleid: this.selid })
// .then((res) => {
// this.isShow = false;
// this.$message.success("");
// this.$parent.deviceList();
// })
// .catch((err) => {
// this.$message.error("");
// });
.catch((err) => {
this.$message.error("添加失败");
});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
clearTimeout(this.timer);
},
},
};

@ -31,11 +31,11 @@
> -->
</div>
<div class="flexno bt30" v-if="this.shedulenr.length !== 0">
<div class="timehead">
<!-- <div class="timehead">
<label>时间表规则:</label>
<p>ssssssssssss</p>
</div>
<div class="timeShow">
</div> -->
<div class="timeShow" v-loading="loading">
<div class="leftTime">
<div class="w8">时间表:</div>
<div class="w80 flexonly" v-loading="timeloading">
@ -48,7 +48,7 @@
>
</div>
</div>
<div class="rightTime">
<!-- <div class="rightTime">
<div class="w8">装置时间表:</div>
<div class="w80 flexonly" v-loading="timeloading">
<el-tag
@ -59,7 +59,7 @@
>{{ val }}</el-tag
>
</div>
</div>
</div> -->
</div>
</div>
<div class="flexno bt30" v-else></div>
@ -246,7 +246,9 @@ export default {
timeloading: false,
};
},
mounted() {},
mounted() {
console.log(this.selaccess);
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
@ -260,7 +262,22 @@ export default {
this.accesslist = res.data.list;
console.log(this.accesslist);
this.selaccess = res.data.list[0].channelid;
this.inquireRealbtn();
//this.inquireRealbtn();
console.log(this.selaccess);
this.loading = true;
getSchedulenr({
channelid: this.selaccess,
terminalid: this.selfacilityId,
})
.then((res) => {
this.$message.success("查询成功");
// this.shedulenr = res.data.list.join("; ")
this.shedulenr = res.data.list;
this.loading = false;
})
.catch((err) => {
this.$message.error("查询失败");
});
})
.catch((err) => {});
},
@ -285,56 +302,6 @@ export default {
//
//
inquirebtn() {
console.log(this.selaccess, this.selfacilityId, this.newcmdzzid);
this.timeloading = true;
selectPhotoTimeGetJoggle({
channel: this.selaccess,
termId: this.selfacilityId,
cmdId: this.newcmdzzid,
})
.then((res) => {
this.$message.success("查询成功");
console.log(this.shedulenr);
this.newrequestId = res.data.requestId;
this.searchRealtime();
})
.catch((err) => {
this.$message.error("查询失败");
});
},
searchRealtime() {
selectPhotoTimeJoggle({
channel: this.selaccess,
termId: this.selfacilityId,
cmdId: this.newcmdzzid,
requestId: this.newrequestId,
}).then((res) => {
console.log(res);
if (res.data.isNew == true && this.timernum < 10) {
clearInterval(this.timer);
this.timer = null;
this.inquirebtn();
this.timernum = 0;
} else if (res.data.isNew == false && this.timernum > 10) {
this.i = 0;
clearInterval(this.timer);
this.timer = null;
this.$message({
message: "时间表查询无响应,请稍后再试!",
type: "warning",
});
}
// if (res.data.isNew == true) {
// this.shedulenr = res.data.list;
// this.$message({
// message: "",
// type: "success",
// });
// clearInterval(this.timer);
// }
});
},
//线
deviceList() {

@ -152,7 +152,7 @@
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<el-button type="primary" v-debounce="handleShowErr"
<el-button type="primary" @click.native.stop="handleWarn()"
>声光报警</el-button
>
<!-- <el-button type="primary" @click="handlehistoryPic"
@ -175,6 +175,7 @@ import {
getTerminalPhotoListJoggle,
getLatestPhotoJoggle,
getReturnedPhotoJoggle,
alarmMarkJoggle,
} from "@/utils/api/index";
import { mapState } from "vuex";
import carouselChart from "../components/carouselChart.vue";
@ -433,7 +434,26 @@ export default {
this.$refs.setschedule_ref.getSingleAccess(this.channelId, this.cmdid);
this.$refs.setschedule_ref.deviceList();
},
handleWarn() {
console.log("声光报警");
console.log(this.newTermId);
alarmMarkJoggle({ termid: this.newTermId })
.then((res) => {
console.log(res);
if (res.code == 200) {
this.$message({
message: "声光报警操作成功",
type: "success",
});
}
})
.catch((err) => {
this.$message({
message: "声光报警操作失败",
type: "error",
});
});
},
handleShowErr() {
this.$message({
message: "该功能暂未开发,敬请期待",

Loading…
Cancel
Save