拍照设置
parent
26575849ba
commit
3c04b1a4bc
@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<el-dialog class="addLineDialog" title="时间表设置" :visible.sync="isShow" :close-on-click-modal="false" width="60%" >
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="查询实际时间表" name="1">
|
||||
<div class="flexnr">
|
||||
<div class="w8">通道:</div>
|
||||
<el-select v-model="selaccess" placeholder="请选择" class="mr20">
|
||||
<el-option v-for="item in accesslist" :key="item.id" :label="item.channelName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="inquirebtn()">查询</el-button>
|
||||
</div>
|
||||
<div class="flexno bt30">
|
||||
<div class="w8">时间表:</div>
|
||||
<div class="w80 flexonly">
|
||||
<el-tag class="mr10 mt10" size="mini" v-for="(val,index) in this.shedulenr" :key="index">{{val}}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="设置时间表" name="2">
|
||||
<div class="deviceTable">
|
||||
<el-table ref="multipleTable" :data="deviceTableData" tooltip-effect="dark" style="width: 100%" height="calc(100% - 40px)">
|
||||
<el-table-column label="时间表类型" show-overflow-tooltip>
|
||||
<template>时间表类型</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="开始时间" show-overflow-tooltip ></el-table-column>
|
||||
<el-table-column prop="endTime" label="结束时间" show-overflow-tooltip ></el-table-column>
|
||||
<el-table-column prop="span" label="间隔(分)" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click.native.stop="handleSet(scope.row)">设置</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pageNation">
|
||||
<el-pagination :current-page="page" :page-size="pageSize" layout=" prev, pager, next, jumper,total"
|
||||
@current-change="handleCurrentChange" :total="total" background >
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog class="addLineDialog" title="设置" :visible.sync="isShowset" :close-on-click-modal="false" width="40%" append-to-body>
|
||||
<el-form label-position="left" ref="formInfo" label-width="100px" >
|
||||
<el-form-item label="通道:">
|
||||
<el-tree :data="listnr" show-checkbox :props="defaultProps" ref="tree" node-key="id" ></el-tree>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="getCheckedNodes">获取</el-button>
|
||||
<el-button @click="isShowset = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getChannelListJoggle, getSchedulenr,getScheduleRulelListJoggle, setScheduleRulel,getScheduleRulelAccessList } from "@/utils/api/index";
|
||||
export default {
|
||||
props: {
|
||||
title:String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
isShowset:false,
|
||||
activeName: '1',//选项卡
|
||||
accesslist:[],//通道选择器
|
||||
selaccess:'',//选中的通道
|
||||
shedulenr:[],//查询的时间表
|
||||
deviceTableData: [],//时间表-表格
|
||||
page: 1, // 当前页数
|
||||
pageSize: 10, // 每页数量
|
||||
total: 0, //总条数
|
||||
listnr: [],//通道树结构
|
||||
defaultProps: {
|
||||
children: 'list',
|
||||
label: 'name'
|
||||
},
|
||||
selfacilityId:''//所选设备id
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
//获取单个设备通道
|
||||
getSingleAccess(id){
|
||||
this.selfacilityId=id
|
||||
getChannelListJoggle({ termid: id }).then((res) => {
|
||||
this.accesslist = res.data.list
|
||||
this.selaccess = res.data.list[0].id
|
||||
}).catch((err) => {});
|
||||
},
|
||||
//查询时间表
|
||||
inquirebtn(){
|
||||
getSchedulenr({ channelid: this.selaccess, terminalid: this.selfacilityId }).then((res) => {
|
||||
this.$message.success("查询成功");
|
||||
// this.shedulenr = res.data.list.join("; ")
|
||||
this.shedulenr = res.data.list
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$message.error("查询失败");
|
||||
});
|
||||
},
|
||||
//获取线路列表数据
|
||||
deviceList() {
|
||||
getScheduleRulelListJoggle({ pageindex: this.page, pagesize: this.pageSize }).then((res) => {
|
||||
this.deviceTableData = res.data.list;
|
||||
this.total = res.data.total
|
||||
})
|
||||
.catch((err) => {});
|
||||
},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
this.deviceList();
|
||||
},
|
||||
//设置-获取所有通道
|
||||
handleSet(val){
|
||||
this.isShowset=true
|
||||
getScheduleRulelAccessList({ termid:this.selfacilityId }).then((res) => {
|
||||
this.listnr = res.data.list
|
||||
}).catch((err) => {});
|
||||
},
|
||||
//获取所选值
|
||||
getCheckedNodes() {
|
||||
console.log(this.$refs.tree.getCheckedNodes());
|
||||
},
|
||||
// 保存确定操作
|
||||
submitForm() {
|
||||
this.$refs.formInfo.validate((valid) => {
|
||||
if (valid) {
|
||||
setScheduleRulel({ list: formArr }).then((res) => {
|
||||
this.isShowset = false
|
||||
this.$message.success("添加成功");
|
||||
this.$parent.deviceList()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$message.error("添加失败");
|
||||
});
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
display() {
|
||||
this.isShow = true
|
||||
},
|
||||
hide() {
|
||||
this.isShow = false
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.flexonly{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.flexno{
|
||||
display: flex;
|
||||
margin-top: 25px;
|
||||
}
|
||||
.flexnr{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 25px;
|
||||
}
|
||||
.mt10{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.mr10{
|
||||
margin-right: 10px;
|
||||
}
|
||||
.w8{
|
||||
width: 8%;
|
||||
}
|
||||
.w80{
|
||||
width: 80%;
|
||||
}
|
||||
.mr20{
|
||||
margin-right: 20px;
|
||||
}
|
||||
.bt30{
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.deviceTable {
|
||||
padding: 16px 8px 0 8px;
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue