拍照时间表设置

master
fanluyan 2 years ago
parent b5b2fcd3d1
commit c32b79ca45

@ -532,3 +532,20 @@ export function getCmaSchelduleUpload(data) {
data,
});
}
//通过Cma获取装置的实际拍照时间调用
export function cmaSchelduleDetials(data) {
return request({
url: "/api/cmaSchelduleDetials",
method: "post",
data,
});
}
//获取Cma调用实际拍照时间的结果
export function getCmaSchelduleDetials(data) {
return request({
url: "/api/getCmaSchelduleDetials",
method: "post",
data,
});
}

@ -6,16 +6,15 @@ const service = axios.create({
// baseURL: '',
// timeout: 5000
baseURL: "api", //把原来的项目地址改成api解决跨域问题
timeout: 30000
timeout: 30000,
});
service.interceptors.request.use((config) => {
if(localStorage.getItem('token')){
config.headers.sessionId = localStorage.getItem('token')
if (localStorage.getItem("token")) {
config.headers.sessionId = localStorage.getItem("token");
}
return config;
});
service.interceptors.response.use(
(response) => {
if (response.status === 200) {

@ -46,18 +46,11 @@
slot-scope="{ data }"
>
<span class="mr10">{{ data.name }}--{{ data.id }}</span>
<el-tag
size="mini"
type="success"
v-if="zzsuccess && termzzid == data.id"
>装置下发成功</el-tag
<!-- <el-tag size="mini" type="success">装置下发成功</el-tag>
<el-tag size="mini" v-if="zzpending"
><i class="el-icon-loading"></i>装置下发中</el-tag
>
<el-tag size="mini" v-if="zzpending && termzzid == data.id"
>装置下发中</el-tag
>
<!--<el-tag size="mini" type="danger" v-if="zzerror"
>装置下发失败</el-tag
> -->
<el-tag size="mini" type="danger">装置下发失败</el-tag> -->
</span>
<span v-else class="custom-tree-node" slot-scope="{ data }">
<span>{{ data.name }}</span>
@ -124,7 +117,8 @@ export default {
allCheckNode: [], //
requestArr: [], //requestid
termzzid: "",
termzzid: [],
flag: false,
};
},
mounted() {},
@ -200,6 +194,11 @@ export default {
console.log(res);
this.requestList = res.data.list;
this.requestTime();
this.timer = window.setInterval(() => {
//console.log(this.requestList);
this.requestTime();
this.i++;
}, 3000);
})
.catch((err) => {
this.$message({
@ -215,13 +214,26 @@ export default {
list: this.requestList,
})
.then((res) => {
console.log(res);
this.requestArr = res.data.list;
for (var i = 0; i < this.requestArr.length; i++) {
console.log(this.requestArr[i].status);
if (this.requestArr[i].status == 1) {
} else {
}
this.requestList = this.requestArr.filter(function (
value,
index,
arr
) {
console.log(value, index, arr);
return value.status !== 1;
});
if (this.requestList.length == 0) {
this.$message.success("下发成功");
clearInterval(this.timer);
this.timer = null;
this.isShow = false;
} else if (this.i > 9) {
this.i = 0;
this.$message.warning("下发失败,请稍后再试!");
clearInterval(this.timer);
this.timer = null;
this.isShow = false;
}
})
.catch((err) => {});
@ -232,6 +244,7 @@ export default {
hide() {
this.isShow = false;
clearTimeout(this.timer);
this.timer = null;
},
},
};

@ -30,13 +30,13 @@
>查询实际时间表</el-button
> -->
</div>
<div class="flexno bt30" v-if="this.shedulenr.length !== 0">
<div class="flexno bt30">
<!-- <div class="timehead">
<label>时间表规则:</label>
<p>ssssssssssss</p>
</div> -->
<div class="timeShow" v-loading="loading">
<div class="leftTime">
<div class="leftTime" v-if="shedulenr.length !== 0">
<div class="w8">时间表:</div>
<div class="w80 flexonly" v-loading="timeloading">
<el-tag
@ -48,21 +48,24 @@
>
</div>
</div>
<!-- <div class="rightTime">
<div class="rightTime" v-if="newshedulenr.length !== 0">
<div class="w8">装置时间表:</div>
<div class="w80 flexonly" v-loading="timeloading">
<el-tag
class="mr10 mt10"
size="mini"
v-for="(val, index) in this.shedulenr"
v-for="(val, index) in this.newshedulenr"
:key="index"
>{{ val }}</el-tag
>
</div>
</div> -->
</div>
<div v-if="shedulenr.length == 0 && newshedulenr.length == 0">
暂无拍照时间表
</div>
</div>
</div>
<div class="flexno bt30" v-else></div>
<el-button class="searchBtn" type="text" @click="inquirebtn()"
>装置时间表对比</el-button
>
@ -187,7 +190,12 @@
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="closebtn"> </el-button>
<el-button type="primary" v-debounce="submitForm"> </el-button>
<el-button
type="primary"
v-debounce="submitForm"
:loading="sureloading"
> </el-button
>
</div>
</el-dialog>
</el-tab-pane>
@ -204,6 +212,9 @@ import {
selectPhotoTimeGetJoggle,
selectPhotoTimeJoggle,
getPhotoTimeJoggle,
cmaSchelduleDetials,
getCmaSchelduleDetials,
getCmaSchelduleUpload,
} from "@/utils/api/index";
export default {
props: {
@ -242,8 +253,16 @@ export default {
newcmdzzid: "",
newrequestId: "",
timer: null, //
timers: null,
timernum: 0,
i: 0,
timeloading: false,
requestId: "",
newshedulenr: [], //
requestList: [],
requestArr: [], //requestid
sureloading: false,
};
},
mounted() {
@ -270,7 +289,7 @@ export default {
terminalid: this.selfacilityId,
})
.then((res) => {
this.$message.success("查询成功");
// this.$message.success("");
// this.shedulenr = res.data.list.join("; ")
this.shedulenr = res.data.list;
this.loading = false;
@ -290,7 +309,7 @@ export default {
terminalid: this.selfacilityId,
})
.then((res) => {
this.$message.success("查询成功");
// this.$message.success("");
// this.shedulenr = res.data.list.join("; ")
this.shedulenr = res.data.list;
this.loading = false;
@ -300,9 +319,57 @@ export default {
});
},
//
inquirebtn() {
console.log(this.selaccess, this.selfacilityId);
cmaSchelduleDetials({
channelid: this.selaccess,
terminalid: this.selfacilityId,
})
.then((res) => {
console.log(res);
this.requestId = res.data.requestId;
this.realNewtime();
this.timer = window.setInterval(() => {
//console.log(this.requestList);
this.realNewtime();
this.timernum++;
}, 3000);
})
.catch((err) => {
this.$message.error("查询失败");
});
},
//
realNewtime() {
getCmaSchelduleDetials({
requestid: this.requestId,
})
.then((res) => {
if (res.code == 200) {
if (res.data.isNew == true) {
// this.shedulenr = res.data.list.join("; ")
this.newshedulenr = res.data.list;
this.timernum = 0;
// this.$message.success("");
clearInterval(this.timer);
this.timer = null;
} else if (this.timernum > 9) {
this.searchloading = false;
this.timernum = 0;
this.$message.warning("暂无时间表!");
clearInterval(this.timer);
this.timer = null;
}
} else {
this.$message.error(res.code.msg);
}
})
.catch((err) => {
clearInterval(this.timer);
this.timer = null;
this.$message.error("查询失败");
});
},
//线
deviceList() {
getScheduleRulelListJoggle({
@ -419,17 +486,14 @@ export default {
],
})
.then((res) => {
this.isShowset = false;
console.log(res);
// // this.$message({
// showClose: true,
// message: '',type: 'success'
// });;
console.log(this.checkList);
// this.$store.commit("SET_CHANNELID", this.checkList); //vuex
// this.$store.commit("SET_TERMID", this.deviceListData.zzid); //vuex
this.handlexfTime(this.deviceListData.zzid, this.checkList);
this.deviceList();
this.requestList = res.data.list;
this.requestTime();
this.timers = window.setInterval(() => {
//console.log(this.requestList);
this.requestTime();
this.i++;
}, 3000);
})
.catch((err) => {
this.$message({
@ -441,19 +505,37 @@ export default {
}
},
//
handlexfTime(termid, channelid) {
console.log("下发时间表");
console.log(termid);
console.log(channelid);
console.log("下发时间表结束");
getPhotoTimeJoggle({
channel: channelid,
termId: termid,
requestTime() {
//
this.sureloading = true;
getCmaSchelduleUpload({
list: this.requestList,
})
.then((res) => {
console.log(res);
if (res.code == 200) {
this.$message.success("拍照时间表设置下发成功");
console.log("aaaaaaaaaaaaaaaaaaaaaaaa");
this.requestArr = res.data.list;
this.requestList = this.requestArr.filter(function (
value,
index,
arr
) {
console.log(value, index, arr);
return value.status !== 1;
});
console.log(this.requestArr);
if (this.requestList.length == 0) {
this.isShowset = false;
this.sureloading = false;
this.$message.success("下发成功");
clearInterval(this.timers);
this.timers = null;
} else if (this.i > 9) {
this.isShowset = false;
this.sureloading = false;
this.i = 0;
this.$message.warning("下发失败,请稍后再试!");
clearInterval(this.timers);
this.timers = null;
}
})
.catch((err) => {});
@ -462,6 +544,8 @@ export default {
this.isShowset = false;
clearInterval(this.timer);
this.deviceList();
clearInterval(this.timers);
this.timers = null;
},
display() {
this.isShow = true;
@ -472,6 +556,8 @@ export default {
handleclose() {
clearInterval(this.timer);
console.log("关闭轮询");
clearInterval(this.timers);
this.timers = null;
},
},
};

Loading…
Cancel
Save