添加loading

master
fanluyan 2 years ago
parent 868d924ada
commit c088e7b2ef

@ -243,6 +243,7 @@ import {
cmaSchelduleDetials, cmaSchelduleDetials,
getCmaSchelduleDetials, getCmaSchelduleDetials,
getCmaSchelduleUpload, getCmaSchelduleUpload,
getTermStatus,
} from "@/utils/api/index"; } from "@/utils/api/index";
export default { export default {
props: { props: {
@ -514,34 +515,46 @@ export default {
if (this.checkList.length == 0) { if (this.checkList.length == 0) {
this.$message.error("请选择通道"); this.$message.error("请选择通道");
} else { } else {
setScheduleRulel({ getTermStatus({ termId: this.deviceListData.zzid }).then((res) => {
scheduleid: this.scheduleid, console.log(res);
list: [ if (res.data.isonline) {
{ setScheduleRulel({
termid: this.deviceListData.zzid, scheduleid: this.scheduleid,
channelidlist: [this.checkList], list: [
offset: this.setNum, {
}, termid: this.deviceListData.zzid,
], channelidlist: [this.checkList],
}) offset: this.setNum,
.then((res) => { },
console.log(res); ],
this.requestList = res.data.list; })
this.requestTime(); .then((res) => {
this.timers = window.setInterval(() => { console.log(res);
//console.log(this.requestList); this.requestList = res.data.list;
this.requestTime(); this.requestTime();
this.i++; this.timers = window.setInterval(() => {
}, 3000); //console.log(this.requestList);
}) this.requestTime();
.catch((err) => { this.i++;
}, 3000);
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
});
} else {
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
message: "添加失败", message: "装置下线,发送指令失败",
type: "error", type: "error",
}); });
}); }
});
} }
}, },
// //

@ -55,7 +55,7 @@
</div> </div>
<!-- 带参数的中心内容右侧参数区 --> <!-- 带参数的中心内容右侧参数区 -->
<div class="picSetBox"> <div class="picSetBox">
<div class="swiperBox" v-loading="loading"> <div class="swiperBox" v-loading="loadingpic">
<carouselChart <carouselChart
ref="carouselpic" ref="carouselpic"
:terminalPhoto="terminalPhoto" :terminalPhoto="terminalPhoto"
@ -154,19 +154,7 @@
<el-button type="primary" @click.native.stop="handleSetSchedule()" <el-button type="primary" @click.native.stop="handleSetSchedule()"
>拍照时间表</el-button >拍照时间表</el-button
> >
<!-- <el-dropdown
class="dropgps"
trigger="click"
@command="handleCommand"
>
<el-button type="primary">
GPS开关<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
<el-dropdown-item command="open">开启GPS</el-dropdown-item>
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<el-dropdown <el-dropdown
class="dropgps" class="dropgps"
trigger="click" trigger="click"
@ -194,10 +182,6 @@
<el-dropdown-item command="close">关闭</el-dropdown-item> <el-dropdown-item command="close">关闭</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<!-- <el-button type="primary" @click="handlehistoryPic"
>历史图片</el-button
> -->
</div> </div>
</div> </div>
</div> </div>
@ -259,8 +243,8 @@ export default {
totalPic: "", totalPic: "",
dateValue: "", // dateValue: "", //
nopicPath: require("@/assets/img/nopic.jpg"), nopicPath: require("@/assets/img/nopic.jpg"),
loadingBg: true, loadingBg: false,
loading: true, loadingpic: false,
newPicData: "", newPicData: "",
timer: null, timer: null,
treetimer: null, treetimer: null,
@ -453,7 +437,7 @@ export default {
}, },
// //
getTerminalPhotoList(id, date, termId) { getTerminalPhotoList(id, date, termId) {
this.loading = true; this.loadingpic = true;
this.terminalPhoto = []; this.terminalPhoto = [];
console.log(id, date, termId); console.log(id, date, termId);
getTerminalPhotoListJoggle({ getTerminalPhotoListJoggle({
@ -478,7 +462,7 @@ export default {
console.log(this.terminalPhoto.length); console.log(this.terminalPhoto.length);
this.totalPic = res.data.num; this.totalPic = res.data.num;
//this.$refs.a.getphotodata(this.terminalPhoto); //this.$refs.a.getphotodata(this.terminalPhoto);
this.loading = false; this.loadingpic = false;
console.log(this.terminalPhoto); console.log(this.terminalPhoto);
}) })
.catch((err) => { .catch((err) => {
@ -505,25 +489,9 @@ export default {
// //
handleSetSchedule() { handleSetSchedule() {
getTermStatus({ termId: this.newTermId }).then((res) => { this.$refs.setschedule_ref.display();
console.log(res); this.$refs.setschedule_ref.getSingleAccess(this.channelId, this.cmdid);
if (res.data.isonline) { this.$refs.setschedule_ref.deviceList();
this.$refs.setschedule_ref.display();
this.$refs.setschedule_ref.getSingleAccess(
this.channelId,
this.cmdid
);
this.$refs.setschedule_ref.deviceList();
} else {
this.btnpicloading = false;
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
}, },
handleCommandWarn(command) { handleCommandWarn(command) {
switch (command) { switch (command) {
@ -613,6 +581,7 @@ export default {
console.log(res); console.log(res);
if (res.data.isonline) { if (res.data.isonline) {
this.btnpicloading = true; this.btnpicloading = true;
this.loadingpic = true;
getLatestPhotoJoggle({ getLatestPhotoJoggle({
captureType: 0, captureType: 0,
channel: command, channel: command,
@ -642,6 +611,7 @@ export default {
}); });
} else { } else {
this.btnpicloading = false; this.btnpicloading = false;
this.loadingpic = false;
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
@ -659,6 +629,7 @@ export default {
console.log(res); console.log(res);
if (res.data.isonline) { if (res.data.isonline) {
this.btnvideoloading = true; this.btnvideoloading = true;
this.loadingpic = true;
getLatestPhotoJoggle({ getLatestPhotoJoggle({
captureType: 1, captureType: 1,
channel: command, channel: command,
@ -686,6 +657,8 @@ export default {
console.log(err); // console.log(err); //
}); });
} else { } else {
this.btnvideoloading = false;
this.loadingpic = false;
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
@ -730,6 +703,7 @@ export default {
}); });
this.btnpicloading = false; this.btnpicloading = false;
this.btnvideoloading = false; this.btnvideoloading = false;
this.loadingpic = false;
} }
console.log("2222222222222222"); console.log("2222222222222222");
}); });

Loading…
Cancel
Save