This commit is contained in:
shijing 2022-07-12 13:52:02 +08:00
parent 0231e6ce32
commit 9ce7a254bd
4 changed files with 177 additions and 118 deletions

View File

@ -30,9 +30,6 @@ export default {
); );
} }
}, },
}, },
blt:{ blt:{
list:{ list:{

View File

@ -3,45 +3,78 @@
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-button type="primary" icon="el-icon-search" @click="upsearch">同步</el-button> <el-button type="primary" icon="el-icon-refresh" @click="updateData">同步</el-button>
</div> </div>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe @resetQuery="resetQuery" > <scTable ref="table" :apiObj="apiObj" :params="query" row-key="id" @selection-change="selectionChange" stripe>
<el-table-column type="selection" width="50"></el-table-column> <el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="序号" type="index" width="50"></el-table-column> <el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="喇叭名称" prop="name" min-width="150"></el-table-column> <el-table-column label="id" prop="id" min-width="90"></el-table-column>
<el-table-column label="音量" prop="extra" min-width="100"> <el-table-column label="mac" prop="code" min-width="90"></el-table-column>
<el-table-column label="id" prop="id" min-width="90"></el-table-column>
<el-table-column label="电量" prop="third_info" min-width="90">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.extra&&scope.row.extra.player">{{scope.row.extra.player.EnvVolume}}</span> <span v-if="scope.row.third_info">{{scope.row.third_info.battery}}%</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备sn" prop="sn" min-width="90"></el-table-column> <el-table-column label="状态" prop="third_info" min-width="90">
<el-table-column label="ip" prop="extra" min-width="90">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.extra">{{scope.row.extra.ip}}</span> <span v-if="scope.row.third_info&&scope.row.third_info.workStatus===0">运动</span>
<span v-else-if="scope.row.third_info&&scope.row.third_info.workStatus===2">静止</span>
<span v-else>静止</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="extra" min-width="90"> <el-table-column label="在线" prop="third_info" min-width="90">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.extra">{{scope.row.extra.online}}</span> <span v-if="scope.row.third_info.online">在线</span>
<span v-else>离线</span>
</template> </template>
</el-table-column> </el-table-column>
<!--<el-table-column label="位置" prop="count_people" min-width="90"></el-table-column>-->
<el-table-column label="所在区域" prop="create_time" min-width="180"></el-table-column>
<el-table-column label="覆盖区域" prop="create_time" width="160"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="160"> <el-table-column label="操作" fixed="right" align="center" width="160">
<template #default="scope"> <template #default="scope">
<el-button-group> <el-button-group>
<el-button text type="primary" size="small" @click="handlePosition(scope.row)">标记位置</el-button> <el-button v-if="scope.row.employee!==null" text type="warning" size="small" @click="handleBindBlt(20, scope.row)">解绑</el-button>
<el-button v-else text type="primary" size="small" @click="handleBindBlt(10, scope.row)">绑定</el-button>
</el-button-group> </el-button-group>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<channel-view v-if="dialogSave" ref="saveDialog" :channelType="50" :channelCode="channelCode" :channelName="channelName" @closed="dialogSave=false"></channel-view> <el-Dialog
title="绑定定位卡"
v-model="showBindBlt"
destroy-on-close
@closed="closeDrawer"
>
<el-form
ref="dialogForm"
:model="form"
label-width="120px"
>
<el-form-item label="卡号">
{{form.blt}}
</el-form-item>
<el-form-item label="绑定员工">
<el-select v-model="form.employee" style="width: 100%" :disabled="dis">
<el-option
v-for="item in employeeList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button v-if="form.type===10" type="primary" @click="submitBindBlt">绑定</el-button>
<el-button v-if="form.type===20" type="primary" @click="submitBindBlt">解绑</el-button>
<el-button @click="showBindBlt = false">取消</el-button>
</template>
</el-Dialog>
</template> </template>
<script> <script>
import channelView from './vchannel_view' import channelView from './vchannel_view'
@ -52,36 +85,64 @@
}, },
data() { data() {
return { return {
apiObj: this.$API.third.blt.list, apiObj: this.$API.third.tdevice.list,
dialogSave: false, query: {
limitedVisible: false, type:30,
query: {}, },
selection: [], selection: [],
search: { search: {
keyword: null keyword: null
}, },
channelCode:'', dis: false,
channelName:'', showBindBlt: false,
employeeList: [],
bindBltMac: '',
form: {
type: 10,
blt: '',
employee: '',
},
} }
}, },
methods: { mounted(){
handlePosition(row){ this.getEmployeeList();
this.channelCode = row.sn;
this.channelName = row.name;
this.dialogSave = true;
}, },
methods: {
// //
selectionChange(selection){ selectionChange(selection){
this.selection = selection; this.selection = selection;
}, },
//
// updateData(){
upsearch(){ this.$API.third.tdevice.list.req({});
}, },
getEmployeeList() {
resetQuery(){ let that = this;
this.query = {} that.$API.hrm.employee.list.req({job_state:10,page: 0}).then(res => {
that.tdevice = res;
that.employeeList = res;
})
},
handleBindBlt(type, row) {
this.dis = false;
this.form.blt = row.id;
this.bindBltMac = row.mac;
this.form.type = type;
if(type===20){
this.dis = true;
this.form.employee = row.employee;
} }
this.showBindBlt = true;
},
submitBindBlt() {
let that = this;
that.$API.third.tdevice.bltBind.req(this.form).then(res => {
if(res.err_msg){}else{
that.showBindBlt = false;
that.$refs.table.refresh();
}
})
},
} }
} }
</script> </script>

View File

@ -949,7 +949,7 @@
center: {x: 114.63059258861512, y: 38.81407163905287, z: 1}, center: {x: 114.63059258861512, y: 38.81407163905287, z: 1},
// center: {x:120,y:30,z:10}, // center: {x:120,y:30,z:10},
//m //m
distance: 400, distance: 550,
// ° // °
rotate: 0, rotate: 0,
//° //°
@ -1041,6 +1041,7 @@
otest.appendChild(newEle); otest.appendChild(newEle);
otest.appendChild(newEle2); otest.appendChild(newEle2);
newEle2.onclick = () => { newEle2.onclick = () => {
newEle2.setAttribute("style","width: 327px;height:183px;background:url(/img/rotate_line.png) no-repeat;background-size:60px 60px;background-position:center center;-webkit-animation: rotate 4s linear infinite;animation: rotate 4s linear infinite;");
this.$API.am.video.item.req(this.params).then(res => { this.$API.am.video.item.req(this.params).then(res => {
console.log(res); console.log(res);
this.url = res.url; this.url = res.url;
@ -1052,6 +1053,7 @@
}); });
flvPlayer.attachMediaElement(videoElement); flvPlayer.attachMediaElement(videoElement);
flvPlayer.load(); flvPlayer.load();
newEle2.setAttribute("style","width: 327px;height:183px;background:url(/img/rotate_line.png) no-repeat;background-size:60px 60px;background-position:center center;");
flvPlayer.play(); flvPlayer.play();
} }
}) })
@ -1090,7 +1092,7 @@
this.getDangers();//$$ this.getDangers();//$$
// this.getRisks();//$$ // this.getRisks();//$$
this.getSpeakers();//$$ this.getSpeakers();//$$
this.getAllMen();// // this.getAllMen();//
this.getAllPost();// this.getAllPost();//
setInterval(function () { setInterval(function () {
@ -1103,41 +1105,6 @@
that.areaDetail = true; that.areaDetail = true;
// let points = data.third_info.xx_rail.detail.polygon.points[0]; // let points = data.third_info.xx_rail.detail.polygon.points[0];
window.map.flyToPosition(new jsmap.JSPoint(114.63168864138028, 38.81254802029822, 0),{duration:1000}); window.map.flyToPosition(new jsmap.JSPoint(114.63168864138028, 38.81254802029822, 0),{duration:1000});
/*debugger;
let tool = new jsmap.JSMapCoordTool(map);
let points = data.third_info.xx_rail.detail.polygon.points;
let position = [];*/
/*for(let i=0;i<points.length;i++){
let item = tool.screenToMapCoordinate(points[i]);
// let item = new jsmap.JSPoint(points[i].x, points[i].y, 0);
position.push(item);
}*/
/*window.map.flyToPosition ({x: points[0].x, y: points[0].y, z:0},{
duration:1000,
offset:{
rotate: 45,
tilt: 60,
range: 100
}
}*/
/*that.eareMarker = new jsmap.JSPolygonMarker({
id: data.id,//id
position: [
new jsmap.JSPoint(114.63168864138028, 38.81254802029822, 0),
new jsmap.JSPoint(114.63185023632963, 38.81241816295427, 0),
new jsmap.JSPoint(114.63160294240738, 38.812229296478634,0),
new jsmap.JSPoint(114.63143965827588, 38.81235778393449, 0),
],//
// position:position,//
floorId: 1,//id
color: 'rgba(0,0,255,.44)',//
strokeColor: '#2bff1d',//线
depthTest: false,//
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000), //
});
that.areaMarkerLayer.addMarker(that.eareMarker);*/
}, },
// //
getAllPost() { getAllPost() {
@ -2616,16 +2583,6 @@
background-size: 100% 100%; background-size: 100% 100%;
} }
.item-img4 {
background: url(/public/img/icon_nbcl.png) no-repeat;
background-size: 100% 100%;
}
.item-img5 {
background: url(/public/img/icon_wbcl.png) no-repeat;
background-size: 100% 100%;
}
.item-info { .item-info {
.normal { .normal {
font-size: 12px; font-size: 12px;

View File

@ -1,43 +1,42 @@
<template> <template>
<el-card shadow="hover" header="欢迎"> <el-card shadow="hover" header="今日事件">
<div class="welcome"> <div class="welcome">
<div class="logo"> <el-table :data="eventData.list">
<img src="img/logo.png"> <el-table-column label="类型" prop=""></el-table-column>
<h2>欢迎体验 SCUI</h2> <el-table-column label="区域" prop=""></el-table-column>
</div> <el-table-column label="当事人" prop=""></el-table-column>
<div class="tips"> <el-table-column label="人员类型" prop=""></el-table-column>
<div class="tips-item"> </el-table>
<div class="tips-item-icon"><el-icon><el-icon-menu/></el-icon></div> <el-pagination
<div class="tips-item-message">这里是项目控制台你可以点击右上方的自定义按钮来添加移除或者移动部件</div> :page-size="params.page_size"
</div> :pager-count="5"
<div class="tips-item"> v-model:currentPage="params.page"
<div class="tips-item-icon"><el-icon><el-icon-promotion/></el-icon></div> layout="prev, pager, next"
<div class="tips-item-message">在提高前端算力减少带宽请求和代码执行力上多次优化并且持续着</div> :total="eventData.total"
</div> @current-change="handleCurrentChange"/>
<div class="tips-item">
<div class="tips-item-icon"><el-icon><el-icon-milk-tea/></el-icon></div>
<div class="tips-item-message">项目目的让前端工作更快乐</div>
</div>
</div>
<div class="actions">
<el-button type="primary" icon="el-icon-check" size="large" @click="godoc">文档</el-button>
</div>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
export default { export default {
title: "欢迎", title: "今日事件",
icon: "el-icon-present", icon: "el-icon-present",
description: "项目特色以及文档链接", description: "今日事件",
data() { data() {
return { return {
params: {
page: 1,
page_size: 20,
},
eventData: {
list: [],
total: 0
},
} }
}, },
methods: { methods: {
godoc(){ godoc() {
window.open("https://lolicode.gitee.io/scui-doc/") window.open("https://lolicode.gitee.io/scui-doc/")
} }
} }
@ -45,15 +44,60 @@
</script> </script>
<style scoped> <style scoped>
.welcome {} .welcome {
.welcome .logo {text-align: center;} }
.welcome .logo img {vertical-align: bottom;width: 100px;height: 100px;margin-bottom: 20px;}
.welcome .logo h2 {font-size: 30px;font-weight: normal;display: flex;align-items: center;justify-content: center;}
.tips {margin-top: 20px;padding:0 40px;} .welcome .logo {
.tips-item {display: flex;align-items: center;justify-content: center;padding:7.5px 0;} text-align: center;
.tips-item-icon {width: 40px;height:40px;display: flex;align-items: center;justify-content: center;border-radius: 50%;font-size: 18px;margin-right: 20px;color: var(--el-color-primary);background: rgba(180,180,180,0.1);} }
.tips-item-message {flex: 1;font-size: 14px;}
.actions {text-align: center;margin: 40px 0 20px 0;} .welcome .logo img {
vertical-align: bottom;
width: 100px;
height: 100px;
margin-bottom: 20px;
}
.welcome .logo h2 {
font-size: 30px;
font-weight: normal;
display: flex;
align-items: center;
justify-content: center;
}
.tips {
margin-top: 20px;
padding: 0 40px;
}
.tips-item {
display: flex;
align-items: center;
justify-content: center;
padding: 7.5px 0;
}
.tips-item-icon {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
font-size: 18px;
margin-right: 20px;
color: var(--el-color-primary);
background: rgba(180, 180, 180, 0.1);
}
.tips-item-message {
flex: 1;
font-size: 14px;
}
.actions {
text-align: center;
margin: 40px 0 20px 0;
}
</style> </style>