修改提示信息关闭时间

master
fanluyan 2 years ago
parent 75d931899c
commit 685dce7b1c

@ -50,6 +50,7 @@ export default {
break;
case "loginout": //退
this.$message({
duration: 1500,
showClose: true,
message: "退出成功",
type: "success",

@ -1,28 +0,0 @@
//resetMessage.js
/**重置message防止重复点击重复弹出message消息提示 */
import { Message } from "element-ui";
let messageInstance = null;
const resetMessage = (options) => {
if (messageInstance) {
messageInstance.close();
}
Message.closeAll(); //手动关闭所有消息提示实例
messageInstance = Message(options);
// console.log(Message(options));
};
["error", "success", "info", "warning"].forEach((type) => {
resetMessage[type] = (options) => {
if (typeof options === "string") {
options = {
message: options,
};
}
options.type = type;
return resetMessage(options);
};
});
export const message = resetMessage;

@ -4,19 +4,16 @@ import router from "./router";
import store from "./store";
//引入element-ui
import "../src/assets/css/theme/index.css";
import "../src/assets/css/theme/index.css"; //l绿色主题
import ElementUI from "element-ui";
// import "element-ui/lib/theme-chalk/index.css";
import { message } from "./components/message.js";
Vue.prototype.$message = message;
Vue.use(ElementUI, {
size: "small",
});
// 引入Echarts
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
// import * as echarts from "echarts";
// Vue.prototype.$echarts = echarts;
// // 引入 vue-awesome-swiper
// import VueAwesomeSwiper from "vue-awesome-swiper";

@ -40,23 +40,16 @@ service.interceptors.response.use(
// duration: 5 * 1000,
// });
if (res.code === 401) {
Message({ message: res.msg, type: "error", duration: 5 * 1000 });
Message({ message: res.msg, type: "error", duration: 1500 });
router.push("/login");
}
if (res.code === 100) {
Message({
showClose: true,
message: res.msg,
type: "error",
duration: 5 * 1000,
});
}
if (res.code === 500) {
Message({
showClose: true,
message: 服务器错误(500),
type: "error",
duration: 5 * 1000,
duration: 1500,
});
}
return Promise.reject(new Error(res.msg || "Error"));
@ -69,7 +62,7 @@ service.interceptors.response.use(
message: error.message,
showClose: true,
type: "error",
duration: 5 * 1000,
duration: 1500,
});
return Promise.reject(error);
}

@ -111,6 +111,7 @@ export default {
this.$router.push("/realTimeMonitor");
this.$message({
duration: 1500,
showClose: true,
message: "登录成功",
type: "success",

@ -371,6 +371,7 @@ export default {
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
@ -459,6 +460,7 @@ export default {
preset: 255,
}).then((res) => {
this.$message({
duration: 1500,
showClose: true,
message: "手动拍照请求成功!",
type: "success",

@ -90,6 +90,7 @@ export default {
//this.errorMsg = "";
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
@ -103,6 +104,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",

@ -136,6 +136,7 @@ export default {
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
@ -144,6 +145,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",

@ -157,6 +157,7 @@ export default {
this.deviceList(); //
});
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功!",
@ -164,6 +165,7 @@ export default {
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",

@ -142,6 +142,7 @@ export default {
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
@ -150,6 +151,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",

@ -253,6 +253,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",

@ -194,6 +194,7 @@ export default {
this.deviceList(); //
});
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功!",
@ -201,6 +202,7 @@ export default {
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",

@ -245,6 +245,7 @@ export default {
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
@ -253,6 +254,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",

@ -74,6 +74,7 @@ export default {
this.loading = false;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "gps信息已更新",
type: "success",
@ -83,6 +84,7 @@ export default {
this.loading = false;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "暂未获取到GPS信息请稍后再试",
type: "warning",

@ -322,6 +322,7 @@ export default {
console.log("qing");
console.log(res);
this.$message({
duration: 1500,
type: "success",
message: "绘制保存成功",
showClose: true,

@ -222,6 +222,7 @@ export default {
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "查询已更新",
type: "success",
@ -233,6 +234,7 @@ export default {
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "暂无响应,请稍后再试!",
type: "warning",

@ -3,7 +3,9 @@
<div class="photoBox">
<div class="photoGraphicBtnGroup">
<h4>拍照装置管理</h4>
<el-button type="primary" icon="el-icon-plus" @click="handleAddPhoto()" >新增</el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleAddPhoto()"
>新增</el-button
>
</div>
<!-- <div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
@ -184,7 +186,11 @@
min-width="80"
><template slot-scope="scope"
>{{ scope.row.batteryCapacity }} /
{{ scope.row.batteryVoltage.toFixed(1) == 0.0 ? 0 : scope.row.batteryVoltage.toFixed(1)}}V</template
{{
scope.row.batteryVoltage.toFixed(1) == 0.0
? 0
: scope.row.batteryVoltage.toFixed(1)
}}V</template
>
</el-table-column>
<el-table-column
@ -373,7 +379,7 @@ import {
deleteTerminalJoggle,
resetTerminalApi,
setTermGPSJoggle,
getSearchInfo
getSearchInfo,
} from "@/utils/api/index";
import moment from "moment";
import addPhotoDialog from "./components/addPhotoDialog.vue";
@ -398,7 +404,7 @@ export default {
dyId: 0,
lineId: 0,
towerId: 0,
searchnr:''
searchnr: "",
},
roleUser: "",
terminalTableData: [], //
@ -525,12 +531,14 @@ export default {
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "装置已复位",
type: "success",
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.msg,
type: "error",
@ -540,11 +548,12 @@ export default {
.catch((err) => {});
})
.catch(() => {
this.$message({
showClose: true,
type: "info",
message: "已取消删除",
});
// this.$message({
// duration: 1500,
// showClose: true,
// type: "info",
// message: "",
// });
});
},
//GPS
@ -562,12 +571,14 @@ export default {
console.log(res);
if (val == 0) {
this.$message({
duration: 1500,
message: "关闭GPS",
type: "success",
showClose: true,
});
} else {
this.$message({
duration: 1500,
message: "成功开启GPS",
type: "success",
showClose: true,
@ -642,17 +653,19 @@ export default {
this.terminalList(); //
});
this.$message({
duration: 1500,
type: "success",
message: "删除成功!",
showClose: true,
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
showClose: true,
});
// this.$message({
// duration: 1500,
// type: "info",
// message: "",
// showClose: true,
// });
});
},
//
@ -665,7 +678,7 @@ export default {
this.pageSize = val;
this.terminalList();
},
}
},
};
</script>
<style lang="less" scoped>

@ -98,6 +98,7 @@ export default {
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
@ -107,6 +108,7 @@ export default {
.catch((err) => {
console.log(err); //
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
@ -118,6 +120,7 @@ export default {
this.isShow = false;
//this.$message.success("");
this.$message({
duration: 1500,
showClose: true,
message: "修改成功",
type: "success",
@ -126,6 +129,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "修改失败",
type: "error",

@ -87,6 +87,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",

@ -174,17 +174,19 @@ export default {
this.lineList(); //
});
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
showClose: true,
type: "info",
message: "已取消删除",
});
// this.$message({
// duration: 1500,
// showClose: true,
// type: "info",
// message: "",
// });
});
},
//

@ -94,6 +94,7 @@ export default {
.then((res) => {
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
@ -102,6 +103,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
@ -114,6 +116,7 @@ export default {
this.isShow = false;
//this.$message.success("");
this.$message({
duration: 1500,
showClose: true,
message: "修改成功",
type: "success",
@ -123,6 +126,7 @@ export default {
.catch((err) => {
//this.$message.error("");
this.$message({
duration: 1500,
showClose: true,
message: "修改失败",
type: "error",

@ -161,6 +161,7 @@ export default {
this.deviceList(); //
});
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功!",
@ -168,6 +169,7 @@ export default {
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",

@ -536,6 +536,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",

@ -543,12 +543,14 @@ export default {
if (res.code == 200) {
if (val == 1) {
this.$message({
duration: 1500,
showClose: true,
message: "声光报警开启成功",
type: "success",
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: "声光报警关闭成功",
type: "success",
@ -558,6 +560,7 @@ export default {
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "声光报警操作失败",
type: "error",
@ -578,6 +581,7 @@ export default {
handleShowErr() {
this.$message({
duration: 1500,
showClose: true,
message: "该功能暂未开发,敬请期待",
type: "warning",
@ -597,6 +601,7 @@ export default {
})
.then((res) => {
this.$message({
duration: 1500,
showClose: true,
message: "手动拍照请求成功!",
type: "success",
@ -628,6 +633,7 @@ export default {
})
.then((res) => {
this.$message({
duration: 1500,
showClose: true,
message: "手动拍视频请求成功!",
type: "success",
@ -701,6 +707,7 @@ export default {
clearInterval(this.timer);
this.timer = null;
this.$message({
duration: 1500,
showClose: true,
message: "装置暂无响应,请稍后再试!",
type: "warning",

@ -328,6 +328,7 @@ export default {
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",

@ -104,6 +104,7 @@ export default {
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",

@ -102,6 +102,7 @@ export default {
console.log(res);
if (res.code === 200) {
this.$message({
duration: 1500,
showClose: true,
message: "告警可信度设置成功",
type: "success",

@ -149,6 +149,7 @@ export default {
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",

Loading…
Cancel
Save