告警--手动拍照

master
13703816893 2 years ago
parent 88ebbe3714
commit a2ebeb025d

@ -52,16 +52,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="可信度" class="gjbox">
<el-select v-model="formdata.prob">
<el-option
v-for="item in kxdOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit"></el-button> <el-button type="primary" @click="onSubmit"></el-button>
</el-form-item> </el-form-item>
@ -170,7 +160,7 @@
<div class="alarmPic"> <div class="alarmPic">
<div class="imgshow"><img :src="photoPic" /></div> <div class="imgshow"><img :src="photoPic" /></div>
<div class="editorBtn"> <div class="editorBtn">
<el-button type="primary">主动拍照</el-button> <!-- <el-button type="primary" :loading="btnpicloading" @click="handleCommandpic"></el-button> -->
<el-button type="primary">历史图片</el-button> <el-button type="primary">历史图片</el-button>
</div> </div>
</div> </div>
@ -180,7 +170,7 @@
</template> </template>
<script> <script>
import { getSearchInfo, getAlarmList } from "@/utils/api/index"; import { getSearchInfo, getAlarmList, getLatestPhotoJoggle, getReturnedPhotoJoggle } from "@/utils/api/index";
import moment from "moment"; import moment from "moment";
export default { export default {
data() { data() {
@ -189,19 +179,12 @@ export default {
xlOptions: [{ id: 0, name: "全部" }], //线 xlOptions: [{ id: 0, name: "全部" }], //线
gtOptions: [{ id: 0, name: "全部" }], // gtOptions: [{ id: 0, name: "全部" }], //
gjOptions: [{ id: 0, name: "全部" }], // gjOptions: [{ id: 0, name: "全部" }], //
kxdOptions: [
{ id: 80, name: "80" },
{ id: 60, name: "60" },
{ id: 40, name: "40" },
{ id: 20, name: "20" }
], //
formdata: { formdata: {
dyId: "", dyId: "",
lineId: "", lineId: "",
towerId: "", towerId: "",
warnCause: "", warnCause: "",
timeVal: "", timeVal: "",
prob: ""
}, },
photoPic: "", photoPic: "",
tableData: [], tableData: [],
@ -210,6 +193,9 @@ export default {
pageSize: 20, // pageSize: 20, //
total: 0, // total: 0, //
loading: false, loading: false,
btnpicloading: false,
timer: null,
i:0
}; };
}, },
mounted() { mounted() {
@ -217,7 +203,6 @@ export default {
new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime(),
new Date().getTime(), new Date().getTime(),
]); ]);
this.$set(this.formdata, "prob", 80);
this.getTableList(); this.getTableList();
this.getSearchdy(); this.getSearchdy();
this.getSearchgj(); this.getSearchgj();
@ -305,6 +290,44 @@ export default {
this.photoPic = row.path; this.photoPic = row.path;
// //
}, },
//
handleCommandpic() {
this.btnpicloading = true;
getLatestPhotoJoggle({})
.then((res) => {
this.$message({
showClose: true,
message: "手动拍照请求成功!",
type: "success",
});
this.timer = window.setInterval(() => {
this.newPicApi();
this.i++;
}, 5000);
})
},
//
newPicApi() {
getReturnedPhotoJoggle({}).then((res) => {
if (res.data == true && this.i < 10) {
clearInterval(this.timer);
this.timer = null;
this.i = 0;
this.btnpicloading = false;
console.log("返回最新图片");
} else if (res.data == false && this.i > 10) {
clearInterval(this.timer);
this.timer = null;
this.i = 0;
this.btnpicloading = false;
this.$message({
showClose: true,
message: "装置暂无响应,请稍后再试!",
type: "warning",
});
}
});
},
dateFormat(row, column) { dateFormat(row, column) {
var date = row[column.property]; var date = row[column.property];
if (date == undefined) { if (date == undefined) {

@ -28,11 +28,11 @@ module.exports = defineConfig({
proxy: { proxy: {
"/api": { "/api": {
//表示拦截以/api开头的请求路径 //表示拦截以/api开头的请求路径
//target: "http://47.96.238.157:8093", //阿里云服务器环境 target: "http://47.96.238.157:8093", //阿里云服务器环境
target: "http://180.166.218.222:40080", //dell // target: "http://180.166.218.222:40080", //dell
changOrigin: true, //是否开启跨域 changOrigin: true, //是否开启跨域
pathRewrite: { pathRewrite: {
"^/api": "/api", //重写api把api变成空字符因为我们真正请求的路径是没有api的 "^/api": "", //重写api把api变成空字符因为我们真正请求的路径是没有api的
}, },
}, },
}, },

Loading…
Cancel
Save