添加装置

master
fanluyan 2 years ago
commit 82bf4d9d81

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

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

@ -31,7 +31,7 @@
</el-table-column>
<el-table-column label="时间表规则" width="600">
<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.endTime }}</li>
<li>
@ -137,7 +137,6 @@ export default {
.then((res) => {
this.deviceTableData = res.data.list;
this.total = res.data.total;
console.log(this.deviceTableData);
this.loading = false;
})
.catch((err) => {});
@ -155,14 +154,14 @@ export default {
handleAdddevice() {
this.title = "新增";
this.$refs.adddeviceDialogref.display();
//this.$refs.adddeviceDialogref.getdataform(null);
this.$refs.adddeviceDialogref.getdataform(null);
},
//
handleResive(data) {
this.title = "修改";
this.$refs.adddeviceDialogref.display();
//this.$refs.adddeviceDialogref.getdataform(data);
this.$refs.adddeviceDialogref.getdataform(data);
},
//

@ -4,7 +4,7 @@
<div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<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"
@ -14,7 +14,7 @@
</el-select>
</el-form-item>
<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"
@ -24,7 +24,7 @@
</el-select>
</el-form-item>
<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"
@ -34,7 +34,7 @@
</el-select>
</el-form-item>
<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"
@ -57,7 +57,7 @@
</el-form-item>
</el-form>
</div>
<div class="pictureBox" v-loading="loading" ref="picture_ref">
<div class="pictureBox" v-loading="loading">
<el-card
class="box-card imgList"
v-for="(item, index) in picList"
@ -66,11 +66,6 @@
<viewer class="bigpic">
<img :src="item.path" />
<!-- <el-image :src="item.path" lazy></el-image> -->
<!-- <el-image :src="item.path" lazy :scroll-container="scrollContainer">
<div slot="placeholder" class="image-slot">
加载中<span class="dot">...</span>
</div>
</el-image> -->
<div class="caption">
<p class="infoTop">
{{ item.channelId }}-{{ item.termId }}-{{ item.fileSize }}
@ -104,7 +99,7 @@
</template>
<script>
import { getSearchInfo, getPictureList } from "@/utils/api/index";
import { getSearchInfo, getRealtimePhoto } from "@/utils/api/index";
export default {
data() {
return {
@ -113,10 +108,10 @@ export default {
gtOptions: [], //
tdOptions: [], //
formdata: {
dyVal: "",
xlVal: "",
gtVal: "",
tdVal: "",
dyid: "",
lineid: "",
towerid: "",
channelid: "",
timeVal: "",
},
picList: [],
@ -133,57 +128,60 @@ export default {
]);
this.getSearchdy();
this.getPicData();
this.scrollContainer = this.$refs.picture_ref.warp;
},
methods: {
//
getSearchdy() {
async getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
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();
})
.catch((err) => {});
},
//线
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyVal })
async getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyid })
.then((res) => {
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();
})
.catch((err) => {});
},
//
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.xlVal })
async getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineid })
.then((res) => {
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();
})
.catch((err) => {});
},
//
getSearchtd() {
getSearchInfo({ type: 4, id: this.formdata.gtVal })
async getSearchtd() {
getSearchInfo({ type: 4, id: this.formdata.towerid })
.then((res) => {
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) => {});
},
//
getPicData() {
console.log(this.formdata);
this.loading = true;
this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize);
this.$set(this.formdata, "startTimeVal", this.formdata.timeVal[0]);
this.$set(this.formdata, "endTimeVal", this.formdata.timeVal[1]);
getPictureList(this.formdata)
this.$set(this.formdata, "starttime", this.formdata.timeVal[0]);
this.$set(this.formdata, "endtime", this.formdata.timeVal[1]);
getRealtimePhoto(this.formdata)
.then((res) => {
console.log(res);
this.picList = res.data.list;
this.total = res.data.total;
this.loading = false;

Loading…
Cancel
Save