This commit is contained in:
caoqianming 2022-10-27 14:09:01 +08:00
commit 97f58d2ee4
6 changed files with 11380 additions and 39 deletions

View File

@ -7,8 +7,13 @@ VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
# 接口地址 # 接口地址
#VUE_APP_API_BASEURL = http://1.203.161.103:2800/api #VUE_APP_API_BASEURL = http://1.203.161.103:2800/api
#VUE_APP_WS_API = 'ws://localhost:8000' #VUE_APP_WS_API = 'ws://localhost:8000'
<<<<<<< HEAD
#VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
=======
VUE_APP_API_BASEURL = http://222.222.144.147:6013/api VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
#VUE_APP_API_BASEURL = http://10.99.5.79:20309/api #VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
>>>>>>> 4322fb11086b4b90803c346a57bc2007dd984e5b
#VUE_APP_API_BASEURL = http://127.0.0.1:8000/api #VUE_APP_API_BASEURL = http://127.0.0.1:8000/api
#VUE_APP_BASEURL = http://127.0.0.1:8000 #VUE_APP_BASEURL = http://127.0.0.1:8000

View File

@ -76,7 +76,7 @@ const routes = [
"path": "/ecm", "path": "/ecm",
"meta": { "meta": {
"title": "事件", "title": "事件",
"icon": "el-icon-alarm-clock", "icon": "el-icon-camera-filled",
"type": "menu", "type": "menu",
"perms": ["ecm"] "perms": ["ecm"]
}, },
@ -150,7 +150,7 @@ const routes = [
"name": "opm", "name": "opm",
"path": "/opm", "path": "/opm",
"meta": { "meta": {
"title": "作业", "title": "风控",
"icon": "el-icon-list", "icon": "el-icon-list",
"type": "menu", "type": "menu",
"perms": ["opm"] "perms": ["opm"]
@ -711,7 +711,7 @@ const routes = [
"path": "/ops", "path": "/ops",
"meta": { "meta": {
"title": "运维", "title": "运维",
"icon": "el-icon-wallet-filled", "icon": "el-icon-briefcase",
"type": "menu", "type": "menu",
"perms": ["ops"] "perms": ["ops"]
}, },

11301
src/utils/flv.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,10 @@
<template> <template>
<div style="height: 100%;width: 100%;"> <div style="height: 100%;width: 100%;">
<video id="videoElement" muted="muted" style="object-fit:fill"></video> <div class="video-container">
<video name="videoElement" class="centeredVideo" controls autoplay>
Your browser is too old which doesn't support HTML5 video.
</video>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -13,6 +17,7 @@ export default {
}, },
data() { data() {
return { return {
Player: null,
flvPlayer: null, flvPlayer: null,
params: { params: {
json: { json: {
@ -29,7 +34,8 @@ export default {
created() { created() {
const scriptInfo = document.createElement("script"); const scriptInfo = document.createElement("script");
scriptInfo.setAttribute("data-callType", "callScript"); scriptInfo.setAttribute("data-callType", "callScript");
scriptInfo.src = "https://cdn.bootcdn.net/ajax/libs/flv.js/1.6.2/flv.js"; // scriptInfo.src = "https://cdn.bootcdn.net/ajax/libs/flv.js/1.6.2/flv.js";
scriptInfo.src = "../../utils/flv.js";
document.head.appendChild(scriptInfo); document.head.appendChild(scriptInfo);
}, },
mounted() { mounted() {
@ -37,32 +43,63 @@ export default {
that.params.json.data.channelId = that.channelCode; that.params.json.data.channelId = that.channelCode;
that.$API.am.video.item.req(that.params).then((res) => { that.$API.am.video.item.req(that.params).then((res) => {
that.url = res.url; that.url = res.url;
let URLS = res.url.replace('192.168.10.253',sysConfig.VUE_APP_VIDEOHOST);
debugger; debugger;
console.log(URLS);
if (flvjs.isSupported()) { if (flvjs.isSupported()) {
debugger; var mediaDataSource = {
console.log(sysConfig.VUE_APP_VIDEOHOST); type: 'flv',
debugger; hasAudio:false,
let videoElement = document.getElementById("videoElement"); hasVideo:true,
let URLS = res.url.replace('192.168.10.253',sysConfig.VUE_APP_VIDEOHOST); isLive:false,
debugger; withCredentials:false,
console.log(URLS) url:URLS
that.flvPlayer = flvjs.createPlayer({ };
type: "flv", that.flv_load(mediaDataSource);
url: URLS,
});
that.flvPlayer.attachMediaElement(videoElement);
that.flvPlayer.load();
that.flvPlayer.play();
} }
}); });
}, },
methods:{
flv_load(mediaDataSource) {
debugger;
let that = this;
var element = document.getElementsByName('videoElement')[0];
if (that.player != null) {
that.player.unload();
that.player.detachMediaElement();
that.player.destroy();
that.player = null;
}
that.player = flvjs.createPlayer(mediaDataSource, {
enableWorker: false,
lazyLoadMaxDuration: 3 * 60,
seekType: 'range',
});
that.player.attachMediaElement(element);
that.player.load();
},
flv_start() {
that.player.play();
},
flv_pause() {
that.player.pause();
}
},
beforeUnmount(){ beforeUnmount(){
let that = this; let that = this;
that.flvPlayer.pause(); that.player.pause();
that.flvPlayer.unload(); that.player.unload();
that.flvPlayer.detachMediaElement(); that.player.detachMediaElement();
that.flvPlayer.destroy(); that.player.destroy();
that.flvPlayer = null; that.player = null;
}, },
}; };
</script> </script>
<style>
.centeredVideo{
width: 100%;
height: 60vh;
}
</style>

View File

@ -70,7 +70,7 @@
type="index" type="index"
width="50" width="50"
></el-table-column> --> ></el-table-column> -->
<el-table-column label="许可证" prop="opls" width="160"> <el-table-column label="许可证" prop="opls" width="200" :show-overflow-tooltip="true" fixed="left">
<template #default="scope"> <template #default="scope">
<el-tag <el-tag
v-for="item in scope.row.cates_" v-for="item in scope.row.cates_"
@ -84,26 +84,27 @@
label="作业简介" label="作业简介"
prop="name" prop="name"
width="200" width="200"
:show-overflow-tooltip="true"
></el-table-column> ></el-table-column>
<el-table-column label="作业状态" prop="state"> <el-table-column label="作业状态" prop="state">
<template #default="scope">{{ <template #default="scope">{{
stateoptions[scope.row.state] stateoptions[scope.row.state]
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="生产状态" prop="state_work"></el-table-column> <el-table-column label="创建时间" prop="create_time" width="150"></el-table-column>
<el-table-column label="作业区域" <el-table-column label="作业区域" width="100"
><template #default="scope"> ><template #default="scope">
{{ scope.row.area_.name }} {{ scope.row.area_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预计开始" prop="start_time"></el-table-column> <el-table-column label="预计开始" prop="start_time" width="150"></el-table-column>
<el-table-column label="预计结束" prop="end_time"></el-table-column> <el-table-column label="预计结束" prop="end_time" width="150"></el-table-column>
<el-table-column label="属地部门" prop="dept_ter" <el-table-column label="属地部门" prop="dept_ter" width="100"
><template #default="scope"> ><template #default="scope">
{{ scope.row.dept_ter_.name }} {{ scope.row.dept_ter_.name }}
</template></el-table-column </template></el-table-column
> >
<el-table-column label="业务部门" prop="dept_bus" <el-table-column label="业务部门" prop="dept_bus" width="100"
><template #default="scope"> ><template #default="scope">
{{ scope.row.dept_bus_.name }} {{ scope.row.dept_bus_.name }}
</template></el-table-column </template></el-table-column
@ -113,8 +114,7 @@
{{ scope.row.create_by_.name }} {{ scope.row.create_by_.name }}
</template></el-table-column </template></el-table-column
> >
<el-table-column label="创建时间" prop="create_time"></el-table-column> <el-table-column label="操作" fixed="right" align="left" width="180">
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link

View File

@ -60,7 +60,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预计开始" prop="start_time" width="150"></el-table-column> <el-table-column label="预计开始" prop="start_time" width="150"></el-table-column>
<el-table-column label="作业部门" prop="dept_do"><template #default="scope"> <el-table-column label="作业部门" prop="dept_do" width="150" :show-overflow-tooltip="true"><template #default="scope">
{{ scope.row.dept_do_.name }} {{ scope.row.dept_do_.name }}
</template></el-table-column> </template></el-table-column>
<el-table-column label="作业负责人" prop="charger"><template #default="scope"> <el-table-column label="作业负责人" prop="charger"><template #default="scope">
@ -70,15 +70,13 @@
{{ scope.row.monitor_.name }} {{ scope.row.monitor_.name }}
</template></el-table-column> </template></el-table-column>
<el-table-column label="操作" fixed="right" width="80"> <el-table-column label="操作" fixed="right" width="100">
<template #default="scope"> <template #default="scope">
<el-button-group> <el-button link type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看
<el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看
</el-button> </el-button>
<el-button v-if="operationObj.state === 10" text type="warning" size="small" v-auth="'opl.update'" <el-button v-if="operationObj.state === 10" link type="warning" size="small" v-auth="'opl.update'"
@click="table_edit(scope.row, scope.$index)">编辑 @click="table_edit(scope.row, scope.$index)">编辑
</el-button> </el-button>
</el-button-group>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>