拍照时间表设置

master
liuyi 2 years ago
parent 53e6536ad9
commit 3720047ab4

@ -56,6 +56,15 @@ export function getSearchInfo(data){
data data
}) })
} }
//获取实时图片数据
export function getRealtimePhoto(data){
return request({
url: "/test/getPhotoList",
method: "post",
data
})
}
//杆塔信息 //杆塔信息
//1.获取杆塔列表 //1.获取杆塔列表

@ -5,6 +5,7 @@
:visible.sync="isShow" :visible.sync="isShow"
:close-on-click-modal="false" :close-on-click-modal="false"
width="670px" width="670px"
@close="handleclose"
> >
<el-form <el-form
label-position="left" label-position="left"
@ -19,10 +20,10 @@
<div class="addtimeBox" ref="timescrollref"> <div class="addtimeBox" ref="timescrollref">
<div <div
class="timeBoxArr" class="timeBoxArr"
v-for="(item, index) in ruleForm.formList" v-for="(item, index) in ruleForm.list"
:key="index" :key="index"
> >
<el-form-item label="时间" :prop="'formList.' + index + '.time'"> <el-form-item label="时间" :prop="'list.' + index + '.time'" :rules="{ required: true, message:'请选择时间', trigger:'blur' }">
<el-time-picker <el-time-picker
is-range is-range
v-model="item.time" v-model="item.time"
@ -35,9 +36,9 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="间隔(分)" label="间隔(分)"
:prop="'formList.' + index + '.span'" :prop="'list.' + index + '.span'"
> >
<!-- <el-input v-model="formdata.span" autocomplete="off" type="number"></el-input> --> <!-- <el-input v-model="ruleForm.span" autocomplete="off" type="number"></el-input> -->
<el-input-number v-model="item.span" :min="1"></el-input-number> <el-input-number v-model="item.span" :min="1"></el-input-number>
</el-form-item> </el-form-item>
<div class="btngrop"> <div class="btngrop">
@ -51,7 +52,7 @@
icon="el-icon-plus" icon="el-icon-plus"
type="primary" type="primary"
@click="addModule()" @click="addModule()"
v-if="index + 1 == ruleForm.formList.length" v-if="index + 1 == ruleForm.list.length"
></el-button> ></el-button>
</div> </div>
</div> </div>
@ -67,7 +68,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
//import { addScheduleRulel, updateScheduleRulel } from "@/utils/api/index"; import { addScheduleRulel, updateScheduleRulel } from "@/utils/api/index";
export default { export default {
props: { props: {
title: String, title: String,
@ -76,26 +77,35 @@ export default {
return { return {
isShow: false, isShow: false,
rules: { rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }], name: [{ required: true, message: "请输入名称", trigger: "blur" }]
time: [{ required: true, message: "请选择时间", trigger: "blur" }],
span: [{ required: true, message: "请输入间隔", trigger: "blur" }],
}, },
ruleForm: { ruleForm: {},
};
},
methods: {
//
getdataform(val) {
console.log(val);
if (val == null) {
return this.ruleForm = {
name: "", name: "",
formList: [ list: [
{ {
time: "", time: "",
span: "", span: "",
}, },
], ],
remark: "", remark: "",
},
}; };
}
this.ruleForm = val;
this.ruleForm.list.forEach(val => {
this.$set(val, "time", [val.startTime, val.endTime]);
});
}, },
methods: {
addModule() { addModule() {
// //
this.ruleForm.formList.push({ this.ruleForm.list.push({
time: "", time: "",
span: "", span: "",
}); });
@ -112,21 +122,42 @@ export default {
// //
deleteModule(item, index) { deleteModule(item, index) {
console.log(item, index); console.log(item, index);
const itemList = this.ruleForm.formList.indexOf(item); const itemList = this.ruleForm.list.indexOf(item);
if (itemList !== -1) { if (itemList !== -1) {
this.ruleForm.formList.splice(index, 1); this.ruleForm.list.splice(index, 1);
} }
}, },
//
// //
submitForm() { submitForm() {
this.$refs.formInfo.validate((valid) => { this.$refs.formInfo.validate((valid) => {
if (valid) { if (valid) {
console.log(valid); // delete this.ruleForm.time;
this.ruleForm.list.forEach(val => {
this.$set(val, "startTime", val.time[0]);
this.$set(val, "endTime", val.time[1]);
});
if (this.title == "新增") {
addScheduleRulel( this.ruleForm )
.then((res) => {
this.isShow = false;
this.$message.success("添加成功");
this.$parent.deviceList();
})
.catch((err) => {
this.$message.error("添加失败");
});
} else {
updateScheduleRulel(this.ruleForm)
.then((res) => {
this.isShow = false;
this.$message.success("修改成功");
this.$parent.deviceList();
})
.catch((err) => {
this.$message.error("修改失败");
});
}
} else { } else {
console.log("error submit!!");
return false; return false;
} }
}); });
@ -137,6 +168,9 @@ export default {
hide() { hide() {
this.isShow = false; this.isShow = false;
}, },
handleclose(){
this.$parent.deviceList();
}
}, },
mounted() {}, mounted() {},
}; };

@ -31,7 +31,7 @@
</el-table-column> </el-table-column>
<el-table-column label="时间表规则" width="600"> <el-table-column label="时间表规则" width="600">
<template slot-scope="scope"> <template slot-scope="scope">
<ul class="rulesBox" v-for="item in scope.row.list"> <ul class="rulesBox" v-for="(item,value) in scope.row.list" :key="value">
<li><span>开始时间</span>{{ item.startTime }}</li> <li><span>开始时间</span>{{ item.startTime }}</li>
<li><span>结束时间</span>{{ item.endTime }}</li> <li><span>结束时间</span>{{ item.endTime }}</li>
<li> <li>
@ -137,7 +137,6 @@ export default {
.then((res) => { .then((res) => {
this.deviceTableData = res.data.list; this.deviceTableData = res.data.list;
this.total = res.data.total; this.total = res.data.total;
console.log(this.deviceTableData);
this.loading = false; this.loading = false;
}) })
.catch((err) => {}); .catch((err) => {});
@ -155,14 +154,14 @@ export default {
handleAdddevice() { handleAdddevice() {
this.title = "新增"; this.title = "新增";
this.$refs.adddeviceDialogref.display(); this.$refs.adddeviceDialogref.display();
//this.$refs.adddeviceDialogref.getdataform(null); this.$refs.adddeviceDialogref.getdataform(null);
}, },
// //
handleResive(data) { handleResive(data) {
this.title = "修改"; this.title = "修改";
this.$refs.adddeviceDialogref.display(); this.$refs.adddeviceDialogref.display();
//this.$refs.adddeviceDialogref.getdataform(data); this.$refs.adddeviceDialogref.getdataform(data);
}, },
// //

@ -4,22 +4,22 @@
<div class="searchBox"> <div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline"> <el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压名称"> <el-form-item label="电压名称">
<el-select v-model="formdata.dyVal" @change="getSearchxl"> <el-select v-model="formdata.dyid" @change="getSearchxl">
<el-option v-for="item in dyOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in dyOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="线路名称"> <el-form-item label="线路名称">
<el-select v-model="formdata.xlVal" @change="getSearchgt"> <el-select v-model="formdata.lineid" @change="getSearchgt">
<el-option v-for="item in xlOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in xlOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="杆塔名称"> <el-form-item label="杆塔名称">
<el-select v-model="formdata.gtVal" @change="getSearchtd"> <el-select v-model="formdata.towerid" @change="getSearchtd">
<el-option v-for="item in gtOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in gtOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="通道监拍点"> <el-form-item label="通道监拍点">
<el-select v-model="formdata.tdVal"> <el-select v-model="formdata.channelid">
<el-option v-for="item in tdOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in tdOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -74,7 +74,7 @@
</template> </template>
<script> <script>
import { getSearchInfo, getPictureList } from "@/utils/api/index"; import { getSearchInfo, getRealtimePhoto } from "@/utils/api/index";
export default { export default {
data() { data() {
return { return {
@ -83,10 +83,10 @@ export default {
gtOptions: [],// gtOptions: [],//
tdOptions: [],// tdOptions: [],//
formdata: { formdata: {
dyVal:'', dyid:'',
xlVal:'', lineid:'',
gtVal: '', towerid: '',
tdVal: '', channelid: '',
timeVal: '', timeVal: '',
}, },
picList: [], picList: [],
@ -106,31 +106,31 @@ export default {
getSearchdy(){ getSearchdy(){
getSearchInfo({ type:1 }).then((res) => { getSearchInfo({ type:1 }).then((res) => {
this.dyOptions = res.data.list; this.dyOptions = res.data.list;
this.formdata.dyVal = res.data.list[0].id this.formdata.dyid = res.data.list==[] ? '' : res.data.list[0].id
this.getSearchxl() this.getSearchxl()
}).catch((err) => {}); }).catch((err) => {});
}, },
//线 //线
getSearchxl(){ getSearchxl(){
getSearchInfo({ type: 2, id: this.formdata.dyVal }).then((res) => { getSearchInfo({ type: 2, id: this.formdata.dyid }).then((res) => {
this.xlOptions = res.data.list; this.xlOptions = res.data.list;
this.formdata.xlVal = res.data.list[0].id this.formdata.lineid = res.data.list==[] ? '' : res.data.list[0].id
this.getSearchgt() this.getSearchgt()
}).catch((err) => {}); }).catch((err) => {});
}, },
// //
getSearchgt(){ getSearchgt(){
getSearchInfo({ type: 3, id: this.formdata.xlVal }).then((res) => { getSearchInfo({ type: 3, id: this.formdata.lineid }).then((res) => {
this.gtOptions = res.data.list; this.gtOptions = res.data.list;
this.formdata.gtVal = res.data.list[0].id this.formdata.towerid = res.data.list==[] ? '' : res.data.list[0].id
this.getSearchtd() this.getSearchtd()
}).catch((err) => {}); }).catch((err) => {});
}, },
// //
getSearchtd(){ getSearchtd(){
getSearchInfo({ type: 4, id: this.formdata.gtVal }).then((res) => { getSearchInfo({ type: 4, id: this.formdata.towerid }).then((res) => {
this.tdOptions = res.data.list; this.tdOptions = res.data.list;
this.formdata.tdVal = res.data.list[0].id this.formdata.channelid = res.data.list==[] ? '' : res.data.list[0].id
}).catch((err) => {}); }).catch((err) => {});
}, },
// //
@ -138,9 +138,9 @@ export default {
this.loading = true; this.loading = true;
this.$set(this.formdata, "pageindex", this.page); this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize); this.$set(this.formdata, "pagesize", this.pageSize);
this.$set(this.formdata, "startTimeVal", this.formdata.timeVal[0]); this.$set(this.formdata, "starttime", this.formdata.timeVal[0]);
this.$set(this.formdata, "endTimeVal", this.formdata.timeVal[1]); this.$set(this.formdata, "endtime", this.formdata.timeVal[1]);
getPictureList(this.formdata) getRealtimePhoto(this.formdata)
.then((res) => { .then((res) => {
this.picList = res.data.list; this.picList = res.data.list;
this.total = res.data.total; this.total = res.data.total;

Loading…
Cancel
Save