Compare commits

..

2 Commits

Author SHA1 Message Date
unknown fc1e1714a9 地图点击视频监控出现弹窗 2022-11-20 17:55:55 +08:00
unknown c6798ff28e 西海岸基础设施视频监控页面地图修改1 2022-11-20 14:08:35 +08:00
36 changed files with 32076 additions and 1062 deletions

View File

@ -157,13 +157,6 @@
@click="deleteHandle2(scope.row.id)"
>{{ $t('delete') }}</el-button
>
<el-button
v-if="superAdmin == 1"
type="text"
size="small"
@click="deleteCompletely(scope.row)"
>完全删除</el-button
>
<el-button type="text" size="small" @click="showDetail(scope.row)"
>详情</el-button
>
@ -263,7 +256,6 @@ export default {
mixins: [mixinViewModule],
data () {
return {
superAdmin: '',
required: ['归属部门', '部门联系人', '部门联系人电话', '应用领域', '共享条件', '算法名称', '算法描述', '图层名称', '图层描述', '组件名称', '组件描述', '组件地址', '服务地址', '服务接口', '接口请求方式', '算法类别'],
notFilled: [],
insertList: [],
@ -325,10 +317,6 @@ export default {
created () {
this.dataForm.name = ''
this.dataForm.type = '组件服务'
this.$http.get('/sys/user/info').then(res => {
console.log('res', res.data.data)
this.superAdmin = res.data.data.superAdmin
})
},
mounted () {
// window.addEventListener('resize', this.a)
@ -683,31 +671,6 @@ export default {
arr.push('常见问题')
this.$refs.putOnTheShelf.submit(arr)
},
//
deleteCompletely (row) {
console.log('完全删除===', row)
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.post('/resource/delResBySuAd?id=' + row.id).then(res => {
console.log('删除结果', res.data)
if (res.data.code == 0) {
this.$message({
type: 'success',
message: '删除成功!'
})
}
this.getDataList()
})
}).catch(() => {
// this.$message({
// type: 'info',
// message: ''
// });
})
},
submitData () {
console.log('提交11111111111===============>', this.putOnTheShelfList, this.submitFrom)
const arr = []

View File

@ -145,13 +145,6 @@
@click="deleteHandle2(scope.row.id)"
>{{ $t("delete") }}</el-button
>
<el-button
v-if="superAdmin == 1"
type="text"
size="small"
@click="deleteCompletely(scope.row)"
>完全删除</el-button
>
<el-button type="text" size="small" @click="showDetail(scope.row)"
>详情</el-button
>
@ -241,7 +234,6 @@ export default {
mixins: [mixinViewModule],
data () {
return {
superAdmin: '',
required: ['归属部门', '部门联系人', '部门联系人电话', '应用领域', '共享条件', '应用名称', '应用描述', '应用类型'],
notFilled: [],
mixinViewModuleOptions: {
@ -294,10 +286,6 @@ export default {
created () {
this.dataForm.name = ''
this.dataForm.type = '应用资源'
this.$http.get('/sys/user/info').then(res => {
console.log('res', res.data.data)
this.superAdmin = res.data.data.superAdmin
})
},
mounted () {
// window.addEventListener('resize', this.a)
@ -534,31 +522,6 @@ export default {
//
})
},
//
deleteCompletely (row) {
console.log('完全删除===', row)
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.post('/resource/delResBySuAd?id=' + row.id).then(res => {
console.log('删除结果', res.data)
if (res.data.code == 0) {
this.$message({
type: 'success',
message: '删除成功!'
})
}
this.getDataList()
})
}).catch(() => {
// this.$message({
// type: 'info',
// message: ''
// });
})
},
//
applyAndInfrastructure (val) {
const type = '基础设施'

View File

@ -64,6 +64,8 @@
<!-- 大华平台相关包 -->
<script type="text/javascript" src="./static/js/encrypt.js"></script>
<script type="text/javascript" src="./static/js/DHWs.js"></script>
<!-- h5player -->
<script src="./util/h5player.min.js"></script>
<!-- 站点配置 -->
<script>
window.SITE_CONFIG = {}
@ -102,4 +104,4 @@
<!-- built files will be auto injected -->
</body>
</html>
</html>

View File

@ -7,132 +7,122 @@
*/
var _mapConfig = {}
;(function () {
var L = window.L || {}
// //
// **********************************************
// eslint-disable-next-line no-undef
var CONFIGKEY = CONFIGITEM.version === 'xihaian' ? 'xihaian' : 'qingdao'
// var CONFIGKEY = 'dev';
// ***********************************************
var BASECONFIGITEM = {
xihaian: {
base: 'xihaian',
CURRENT_MAP_OPTIONS: {
// crs: CRS_4490,
center: [36.17, 120.13],
maxZoom: 18,
minZoom: 0,
zoom: 10,
},
},
qingdao: {
DATABASE_TYPE: 'Highgo',
POI_TYPE: 'Supermap', // POI 'Supermap''Amap''Survey_Institute'
ISERVER_URL: '15.2.21.238:8090',
WORKPLACE_NAME: 'HIMAP-HIGHGO',
MAP_NAME: 'QDMAP',
DATASOURCE_NAME: 'HISENSE_map',
ATMOSPHERE_URL: 'http://15.2.21.151:9015/service-main',
CURRENT_MAP_OPTIONS: {
// crs: CRS_4490,
center: [36.17, 120.13],
maxZoom: 18,
minZoom: 0,
zoom: 10,
},
BDMAP_CONFIG: {
location: 'qingdao',
_initpos: {
point: [120.392795, 36.072854],
zoom: 2,
;
(function() {
var L = window.L || {}
// //
// **********************************************
// eslint-disable-next-line no-undef
var CONFIGKEY = CONFIGITEM.version === 'xihaian' ? 'xihaian' : 'qingdao'
// var CONFIGKEY = 'dev';
// ***********************************************
var BASECONFIGITEM = {
xihaian: {
base: 'xihaian',
CURRENT_MAP_OPTIONS: {
// crs: CRS_4490,
center: [35.96, 120.19],
maxZoom: 13,
minZoom: 0,
zoom: 5,
},
},
_keyframes: [
[121.6011191295479, 36.73422934263509],
[119.83371870221472, 36.082854],
[120.25937000453506, 36.34563716789656],
qingdao: {
DATABASE_TYPE: 'Highgo',
POI_TYPE: 'Supermap', // POI 'Supermap''Amap''Survey_Institute'
ISERVER_URL: '15.2.21.238:8090',
WORKPLACE_NAME: 'HIMAP-HIGHGO',
MAP_NAME: 'QDMAP',
DATASOURCE_NAME: 'HISENSE_map',
ATMOSPHERE_URL: 'http://15.2.21.151:9015/service-main',
CURRENT_MAP_OPTIONS: {
// crs: CRS_4490,
center: [36.17, 120.13],
maxZoom: 18,
minZoom: 0,
zoom: 10,
},
BDMAP_CONFIG: {
location: 'qingdao',
_initpos: {
point: [120.392795, 36.072854],
zoom: 2,
},
_keyframes: [
[121.6011191295479, 36.73422934263509],
[119.83371870221472, 36.082854],
[120.25937000453506, 36.34563716789656],
],
},
MAP_VENDOR: 'Supermap', // Supermap bdmap 3dbdmap
TITLE_LAYER: {
mapUrl: 'http://15.72.177.174:8195/portalproxy/TileServer/arcgis/rest/services/normal2021/MapServer?key=iOgQotfgfyLvhj6WgfDTpq7F',
type: 'tiled',
name: '矢量',
icon: 'vector_map.png',
},
TITLE_LAYER_REMOTE: {
mapUrl: 'http://q3d.qd.gov.cn:8195/portalproxy/vw6bffpy/TileServer/arcgis/rest/services/normal_2021_4490Arcgis/MapServer?key=iOgQotfgfyLvhj6WgfDTpq7F',
type: 'tiled',
name: '矢量',
icon: 'vector_map.png',
},
// TITLE_LAYER_REMOTE: { mapUrl: 'http://15.72.177.174:8195/portalproxy/TileServer/arcgis/rest/services/normal2021/MapServer?key=iOgQotfgfyLvhj6WgfDTpq7F', type: 'tiled', name: '', icon: 'vector_map.png' },
// TITLE_LAYER_REMOTE: { mapUrl: 'http://15.2.21.238:8090/iserver/services/map-ugcv5-QingdaoRemoteImageMap/rest/maps/QingdaoRemoteImageMap', type: 'remote', name: '', icon: 'satellite_map.png' },
TITLE_LAYER_DARK: {
mapUrl: 'http://15.2.21.238:8090/iserver/services/map-ugcv5-shandong/rest/maps/shandong',
type: 'dark',
name: '其他',
icon: 'other_map.png',
},
},
}
var MAPCONFIGMIXTRE = {
CURRENT_SERVER_NAME: CONFIGKEY,
BUFFER_URL: 'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/spatialAnalysis-' +
BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME +
'/restjsr/spatialanalyst',
QUERY_URL: 'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/map-HIMAP_HIGHGO/rest/maps/' +
BASECONFIGITEM[CONFIGKEY].MAP_NAME,
// QUERY_URL: 'http://' + BASECONFIGITEM[CONFIGKEY].ISERVER_URL + '/iserver/services/data-HIMAP_HIGHGO/rest/data/datasources/HISENSE_himap',
DYNAMIC_ROAD_URL: 'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/spatialAnalysis-' +
BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME +
'/restjsr/spatialanalyst',
DYNMIC_URL: 'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/map-' +
BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME +
'/rest/maps/' +
BASECONFIGITEM[CONFIGKEY].MAP_NAME,
//
// NETWORK_URL: 'http://' + BASECONFIGITEM[CONFIGKEY].ISERVER_URL + '/iserver/services/transportationAnalyst-' + BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME + '/rest/networkanalyst/BuildNetwork_2@' + BASECONFIGITEM[CONFIGKEY].DATASOURCE_NAME,
//
NETWORK_URL: 'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/transportationAnalyst-road/rest/networkanalyst/BuildNetwork_2@road',
PLOTTING_URL: 'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/plot-JY/rest/plot/',
POI_URL: 'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/addressmatch-qingdaoPOI181015/restjsr/v1/address',
EDITORDATA_URL: 'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/data-' +
BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME +
'/rest/data',
ADDRESS_MATCH_URL: `http://${BASECONFIGITEM[CONFIGKEY].ISERVER_URL}/iserver/services/addressmatch-Address/restjsr/v1/address`,
TITLE_LAYER_ARRAY: BASECONFIGITEM[CONFIGKEY].TITLE_LAYER_ARRAY || [
BASECONFIGITEM[CONFIGKEY].TITLE_LAYER,
BASECONFIGITEM[CONFIGKEY].TITLE_LAYER_REMOTE,
BASECONFIGITEM[CONFIGKEY].TITLE_LAYER_DARK,
],
},
MAP_VENDOR: 'Supermap', // Supermap bdmap 3dbdmap
TITLE_LAYER: {
mapUrl:
'http://15.72.177.174:8195/portalproxy/TileServer/arcgis/rest/services/normal2021/MapServer?key=iOgQotfgfyLvhj6WgfDTpq7F',
type: 'tiled',
name: '矢量',
icon: 'vector_map.png',
},
TITLE_LAYER_REMOTE: {
mapUrl:
'http://q3d.qd.gov.cn:8195/portalproxy/vw6bffpy/TileServer/arcgis/rest/services/normal_2021_4490Arcgis/MapServer?key=iOgQotfgfyLvhj6WgfDTpq7F',
type: 'tiled',
name: '矢量',
icon: 'vector_map.png',
},
// TITLE_LAYER_REMOTE: { mapUrl: 'http://15.72.177.174:8195/portalproxy/TileServer/arcgis/rest/services/normal2021/MapServer?key=iOgQotfgfyLvhj6WgfDTpq7F', type: 'tiled', name: '', icon: 'vector_map.png' },
// TITLE_LAYER_REMOTE: { mapUrl: 'http://15.2.21.238:8090/iserver/services/map-ugcv5-QingdaoRemoteImageMap/rest/maps/QingdaoRemoteImageMap', type: 'remote', name: '', icon: 'satellite_map.png' },
TITLE_LAYER_DARK: {
mapUrl:
'http://15.2.21.238:8090/iserver/services/map-ugcv5-shandong/rest/maps/shandong',
type: 'dark',
name: '其他',
icon: 'other_map.png',
},
},
}
var MAPCONFIGMIXTRE = {
CURRENT_SERVER_NAME: CONFIGKEY,
BUFFER_URL:
'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/spatialAnalysis-' +
BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME +
'/restjsr/spatialanalyst',
QUERY_URL:
'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/map-HIMAP_HIGHGO/rest/maps/' +
BASECONFIGITEM[CONFIGKEY].MAP_NAME,
// QUERY_URL: 'http://' + BASECONFIGITEM[CONFIGKEY].ISERVER_URL + '/iserver/services/data-HIMAP_HIGHGO/rest/data/datasources/HISENSE_himap',
DYNAMIC_ROAD_URL:
'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/spatialAnalysis-' +
BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME +
'/restjsr/spatialanalyst',
DYNMIC_URL:
'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/map-' +
BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME +
'/rest/maps/' +
BASECONFIGITEM[CONFIGKEY].MAP_NAME,
//
// NETWORK_URL: 'http://' + BASECONFIGITEM[CONFIGKEY].ISERVER_URL + '/iserver/services/transportationAnalyst-' + BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME + '/rest/networkanalyst/BuildNetwork_2@' + BASECONFIGITEM[CONFIGKEY].DATASOURCE_NAME,
//
NETWORK_URL:
'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/transportationAnalyst-road/rest/networkanalyst/BuildNetwork_2@road',
PLOTTING_URL:
'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/plot-JY/rest/plot/',
POI_URL:
'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/addressmatch-qingdaoPOI181015/restjsr/v1/address',
EDITORDATA_URL:
'http://' +
BASECONFIGITEM[CONFIGKEY].ISERVER_URL +
'/iserver/services/data-' +
BASECONFIGITEM[CONFIGKEY].WORKPLACE_NAME +
'/rest/data',
ADDRESS_MATCH_URL: `http://${BASECONFIGITEM[CONFIGKEY].ISERVER_URL}/iserver/services/addressmatch-Address/restjsr/v1/address`,
TITLE_LAYER_ARRAY: BASECONFIGITEM[CONFIGKEY].TITLE_LAYER_ARRAY || [
BASECONFIGITEM[CONFIGKEY].TITLE_LAYER,
BASECONFIGITEM[CONFIGKEY].TITLE_LAYER_REMOTE,
BASECONFIGITEM[CONFIGKEY].TITLE_LAYER_DARK,
],
}
_mapConfig.config = Object.assign(BASECONFIGITEM[CONFIGKEY], MAPCONFIGMIXTRE)
})()
}
_mapConfig.config = Object.assign(BASECONFIGITEM[CONFIGKEY], MAPCONFIGMIXTRE)
})()

311
front/public/util/h5player.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,225 @@
/**
* Created by wangweijie5 on 2016/12/16.
*/
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var __instance = function () {
var instance = void 0;
return function (newInstance) {
if (newInstance) instance = newInstance;
return instance;
};
}();
var AudioRenderer = function () {
function AudioRenderer() {
_classCallCheck(this, AudioRenderer);
if (__instance()) return __instance();
//
if (AudioRenderer.unique !== undefined) {
return AudioRenderer.unique;
}
AudioRenderer.unique = this;
this.oAudioContext = null;
this.currentVolume = 0.8; //
this.bSetVolume = false;
this.gainNode = null;
this.iWndNum = -1; //
this.mVolumes = new Map(); //
// Init AudioContext
var AudioContext = window.AudioContext || window.webkitAudioContext;
this.oAudioContext = new AudioContext();
this.writeString = function (view, offset, string) {
for (var i = 0; i < string.length; i++) {
view.setUint8(offset + i, string.charCodeAt(i));
}
};
this.setBufferToDataview = function (output, offset, input) {
for (var i = 0; i < input.length; i++, offset++) {
output.setUint8(offset, input[i]);
}
};
__instance(this);
}
/**
* @synopsis 音频播放
*
* @param dataBuf [IN] 音频缓存
* @param dataLen [IN] 缓存长度
* @param audioInfo [IN] 音频参数
*
* @returns 状态码
*/
_createClass(AudioRenderer, [{
key: 'Play',
value: function Play(dataBuf, dataLen, audioInfo) {
var bufferData = new ArrayBuffer(44 + dataLen);
var viewTalk = new DataView(bufferData);
var sampleRates = audioInfo.samplesPerSec;
var channels = audioInfo.channels;
var bitsPerSample = audioInfo.bitsPerSample;
//console.log("audiorender sampleRates"+sampleRates+"channels:"+channels+"bitsPerSample:"+bitsPerSample);
/* RIFF identifier */
this.writeString(viewTalk, 0, 'RIFF');
/* file length */
viewTalk.setUint32(4, 32 + dataLen * 2, true);
/* RIFF type */
this.writeString(viewTalk, 8, 'WAVE');
/* format chunk identifier */
this.writeString(viewTalk, 12, 'fmt ');
/* format chunk length */
viewTalk.setUint32(16, 16, true);
/* sample format (raw) */
viewTalk.setUint16(20, 1, true);
/* channel count */
viewTalk.setUint16(22, channels, true);
/* sample rate */
viewTalk.setUint32(24, sampleRates, true);
/* byte rate (sample rate * block align) */
viewTalk.setUint32(28, sampleRates * 2, true);
/* block align (channel count * bytes per sample)/8 */
viewTalk.setUint16(32, channels * bitsPerSample / 8, true);
/* bits per sample */
viewTalk.setUint16(34, bitsPerSample, true);
/* data chunk identifier */
this.writeString(viewTalk, 36, 'data');
/* data chunk length */
viewTalk.setUint32(40, dataLen, true);
this.setBufferToDataview(viewTalk, 44, dataBuf);
var self = this;
this.oAudioContext.decodeAudioData(viewTalk.buffer, function (buffer) {
var bufferSource = self.oAudioContext.createBufferSource();
if (bufferSource == null) {
return -1;
}
bufferSource.buffer = buffer;
bufferSource.start(0);
if (self.gainNode == null || self.bSetVolume) {
self.gainNode = self.oAudioContext.createGain();
// self.gainNode.gain.value = self.currentVolume;
// // self.currentVolume = self.gainNode.gain.value;
// self.gainNode.connect(self.oAudioContext.destination);
self.bSetVolume = false;
}
self.gainNode.gain.value = self.currentVolume;
// self.currentVolume = self.gainNode.gain.value;
self.gainNode.connect(self.oAudioContext.destination);
bufferSource.connect(self.gainNode);
}, function (e) {
console.log("decode error");
return -1;
});
return 0;
}
/**
* @synopsis 停止播放
*
* @returns 返回音量
*/
}, {
key: 'Stop',
value: function Stop() {
if (this.gainNode != null) {
this.gainNode.disconnect();
this.gainNode = null;
}
// this.oAudioContext.close();
// AudioRenderer.unique = undefined;
// __instance() = null;
return true;
}
/**
* @synopsis 设置音量
*
* @param iVolume [IN] 音量
*
* @returns 状态码
*/
}, {
key: 'SetVolume',
value: function SetVolume(iVolume) {
this.bSetVolume = true;
this.currentVolume = iVolume;
//
this.mVolumes.set(this.iWndNum, iVolume);
return true;
}
/**
* @synopsis 设置窗口号
*
* @param iWndNum [IN] 窗口号
*
* @returns 状态码
*/
}, {
key: 'SetWndNum',
value: function SetWndNum(iWndNum) {
this.iWndNum = iWndNum;
//
var iVolume = this.mVolumes.get(iWndNum);
if (iVolume == undefined) {
iVolume = 0.8; //
}
this.currentVolume = iVolume;
return true;
}
/**
* @synopsis 获取音量
*
* @returns 返回音量
*/
}, {
key: 'GetVolume',
value: function GetVolume() {
//
var iVolume = this.mVolumes.get(this.iWndNum);
if (iVolume == undefined) {
iVolume = 0.8; //
}
return iVolume;
}
}]);
return AudioRenderer;
}();
//# sourceMappingURL=AudioRenderer.js.map

View File

@ -0,0 +1,711 @@
/**
* Created by wangweijie5 on 2016/12/5.
*/
(function (event) {
const AUDIO_TYPE = 0; //
const VIDEO_TYPE = 1; //
const PRIVT_TYPE = 2; //
const PLAYM4_AUDIO_FRAME = 100; //
const PLAYM4_VIDEO_FRAME = 101; //
const PLAYM4_OK = 1;
const PLAYM4_DECODE_ERROR = 44 //
const PLAYM4_NOT_KEYFRAME = 48; //
const PLAYM4_NEED_MORE_DATA = 31; //
const PLAYM4_SYS_NOT_SUPPORT = 16; //
const PLAYM4_PARA_ENCODER_ERROR = 71; //
const PLAYM4_PRECONDITION_ENCODER_ERROR = 72; //
const PLAYM4_ENCODER_ERROR = 73; //
const PLAYM4_CREATE_ENCODER_ERROR = 74; //
const PLAYM4_NOSUPPORT_ENCODER_ERROR = 75; //
const PLAYM4_ALLOC_MEMORY_ENCODER_ERROR = 76; //
const PLAYM4_BUF_OVER_ENCODER_ERROR = 77; //buffer
const PLAYM4_NEED_MORE_DATA_ENCODER_ERROR = 78; //
const PLAYM4_CALL_ORDER_ENCODER_ERROR = 79; //
const PLAYM4_ITYPE_DECODE_ERROR =100; //I
const PLAYM4_FIRST_FRAME_NOT_ICURRENT =101; //INi>Mp
importScripts('Decoder.js');
Module.addOnPostRun(function () {
postMessage({'function': "loaded"});
});
var iStreamMode = 0; //
var bOpenMode = false;
var bOpenStream = false;
var funGetFrameData = null;
var funGetAudFrameData = null;
var bWorkerPrintLog=false;//workerlog
onmessage = function (event)
{
var eventData = event.data;
var res = 0;
switch (eventData.command)
{
case "printLog":
let downloadFlag=eventData.data;
if(downloadFlag===true)
{
bWorkerPrintLog=true;
res = Module._SetPrintLogFlag(downloadFlag);
}
else
{
bWorkerPrintLog=false;
res = Module._SetPrintLogFlag(downloadFlag);
}
if (res !== PLAYM4_OK)
{
console.log("DecodeWorker.js: PlayerSDK print log failed,res"+res);
postMessage({'function': "printLog", 'errorCode': res});
}
break;
case "SetPlayPosition":
let nFrameNumOrTime=eventData.data;
let enPosType=eventData.type;
res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
if (res !== PLAYM4_OK)
{
postMessage({'function': "SetPlayPosition", 'errorCode': res});
return;
}
//buffer
break;
case "SetStreamOpenMode":
iStreamMode = eventData.data;
res = Module._SetStreamOpenMode(iStreamMode);
if (res !== PLAYM4_OK)
{
postMessage({'function': "SetStreamOpenMode", 'errorCode': res});
return;
}
bOpenMode = true;
break;
case "OpenStream":
//
var iHeadLen = eventData.dataSize;
var pHead = Module._malloc(iHeadLen + 4);
if (pHead === null)
{
return;
}
var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
aHead.set(eventData.data);
res = Module._OpenStream(pHead, iHeadLen, eventData.bufPoolSize);
postMessage({'function': "OpenStream", 'errorCode': res});
if (res !== PLAYM4_OK)
{
//
Module._free(pHead);
pHead = null;
return;
}
bOpenStream = true;
// 4
var a32 = new Uint32Array([iHeadLen]);
var a8 = new Uint8Array(a32.buffer);
var tempBuf = new Uint8Array(iHeadLen + 4);
tempBuf.set(a8, 0);
tempBuf.set(eventData.data, 4);
a32 = null;
a8 = null;
aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen + 4);
aHead.set(tempBuf);
tempBuf = null;
res = Module._InputData(pHead, iHeadLen + 4);
if (res !== PLAYM4_OK)
{
postMessage({'function': "InputData", 'errorCode': res});
Module._free(pHead);
pHead = null;
return;
}
//
Module._free(pHead);
pHead = null;
if (funGetFrameData === null) {
funGetFrameData = Module.cwrap('GetFrameData', 'number');
}
if (iStreamMode === 0) {
// Module._GetFrameData();
funGetFrameData();
}
break;
case "InputData":
//
var iLen = eventData.dataSize;
if(bWorkerPrintLog)
{
console.log("<<<Worker: DecodeWorker-InputData iLen:"+iLen);
}
if (iLen > 0)
{
var pInputData = Module._malloc(iLen);
if (pInputData === null)
{
return;
}
var inputData = new Uint8Array(eventData.data);
// var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
// aInputData.set(inputData);
Module.writeArrayToMemory(inputData, pInputData);
inputData = null;
res = Module._InputData(pInputData, iLen);
//console.log("DecodeWorker-InputData-ret:%d", res);
if(bWorkerPrintLog)
{
console.log("<<<Worker:InputData result:"+ +res);
}
if (res !== PLAYM4_OK)
{
if (res === 98)
{
res = 1;
}
postMessage({'function': "InputData", 'errorCode': res});
}
Module._free(pInputData);
pInputData = null;
}
/////////////////////
if (funGetFrameData === null)
{
funGetFrameData = Module.cwrap('GetFrameData', 'number');
}
while (bOpenMode && bOpenStream)
{
var ret = getFrameData(funGetFrameData);
//
if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret)
{
break;
}
}
break;
case "SetSecretKey":
var keyLen = eventData.nKeyLen;
var pKeyData = Module._malloc(keyLen);
if (pKeyData === null) {
return;
}
var nKeySize = eventData.data.length
var bufData = stringToBytes (eventData.data);
var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
aKeyData.set(new Uint8Array(bufData));
res = Module._SetSecretKey(eventData.nKeyType, pKeyData, keyLen, nKeySize);
if (res !== PLAYM4_OK) {
postMessage({'function': "SetSecretKey", 'errorCode': res});
Module._free(pKeyData);
pKeyData = null;
return;
}
Module._free(pKeyData);
pKeyData = null;
break;
case "GetBMP":
var nBMPWidth = eventData.width;
var nBMPHeight = eventData.height;
var pYUVData = eventData.data;
var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
var oBMPCropRect = eventData.rect;
var pDataYUV = Module._malloc(nYUVSize);
if (pDataYUV === null) {
return;
}
Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
// BMP
var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
var pBmpData = Module._malloc(nBmpSize);
var pBmpSize = Module._malloc(4);
if (pBmpData === null || pBmpSize === null) {
Module._free(pDataYUV);
pDataYUV = null;
if (pBmpData != null) {
Module._free(pBmpData);
pBmpData = null;
}
if (pBmpSize != null) {
Module._free(pBmpSize);
pBmpSize = null;
}
return;
}
//Module._memset(pBmpSize, nBmpSize, 4); // bmp
Module.setValue(pBmpSize, nBmpSize, "i32");
res = Module._GetBMP(pDataYUV, nYUVSize, pBmpData, pBmpSize,
oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
if (res !== PLAYM4_OK) {
postMessage({'function': "GetBMP", 'errorCode': res});
Module._free(pDataYUV);
pDataYUV = null;
Module._free(pBmpData);
pBmpData = null;
Module._free(pBmpSize);
pBmpSize = null;
return;
}
// BMP
var nBmpDataSize = Module.getValue(pBmpSize, "i32");
// BMP
var aBmpData = new Uint8Array(nBmpDataSize);
aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
postMessage({'function': "GetBMP", 'data': aBmpData, 'errorCode': res}, [aBmpData.buffer]);
aBmpData=null;
if (pDataYUV != null) {
Module._free(pDataYUV);
pDataYUV = null;
}
if (pBmpData != null) {
Module._free(pBmpData);
pBmpData = null;
}
if (pBmpSize != null) {
Module._free(pBmpSize);
pBmpSize = null;
}
break;
case "GetJPEG":
var nJpegWidth = eventData.width;
var nJpegHeight = eventData.height;
var pYUVData1 = eventData.data;
var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
var oJpegCropRect = eventData.rect;
var pDataYUV1 = Module._malloc(nYUVSize1);
if (pDataYUV1 === null) {
return;
}
Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
// JPEG
var pJpegData = Module._malloc(nYUVSize1);
var pJpegSize = Module._malloc(4);
if (pJpegData === null || pJpegSize === null) {
if (pJpegData != null) {
Module._free(pJpegData);
pJpegData = null;
}
if (pJpegSize != null) {
Module._free(pJpegSize);
pJpegSize = null;
}
if (pDataYUV1 != null) {
Module._free(pDataYUV1);
pDataYUV1 = null;
}
return;
}
Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32"); // JPEGYUV
res = Module._GetJPEG(pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
if (res !== PLAYM4_OK) {
postMessage({'function': "GetJPEG", 'errorCode': res});
if (pJpegData != null) {
Module._free(pJpegData);
pJpegData = null;
}
if (pJpegSize != null) {
Module._free(pJpegSize);
pJpegSize = null;
}
if (pDataYUV1 != null) {
Module._free(pDataYUV1);
pDataYUV1 = null;
}
return;
}
// JPEG
var nJpegSize = Module.getValue(pJpegSize, "i32");
// JPEG
var aJpegData = new Uint8Array(nJpegSize);
aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
postMessage({'function': "GetJPEG", 'data': aJpegData, 'errorCode': res}, [aJpegData.buffer]);
nJpegSize = null;
aJpegData = null;
if (pDataYUV1 != null) {
Module._free(pDataYUV1);
pDataYUV1 = null;
}
if (pJpegData != null) {
Module._free(pJpegData);
pJpegData = null;
}
if (pJpegSize != null) {
Module._free(pJpegSize);
pJpegSize = null;
}
break;
case "SetDecodeFrameType":
var nFrameType = eventData.data;
res = Module._SetDecodeFrameType(nFrameType);
if (res !== PLAYM4_OK) {
postMessage({'function': "SetDecodeFrameType", 'errorCode': res});
return;
}
break;
case "DisplayRegion":
var nRegionNum = eventData.nRegionNum;
var srcRect = eventData.srcRect;
var hDestWnd = eventData.hDestWnd;
var bEnable = eventData.bEnable;
res = Module._SetDisplayRegion(nRegionNum, srcRect, hDestWnd, bEnable);
if (res !== PLAYM4_OK) {
postMessage({'function': "DisplayRegion", 'errorCode': res});
return;
}
break;
case "CloseStream":
res = Module._CloseStream();
if (res !== PLAYM4_OK) {
postMessage({'function': "CloseStream", 'errorCode': res});
return;
}
break;
case "SetIFrameDecInterval":
Module._SetIFrameDecInterval(eventData.data);
break;
case "SetLostFrameMode":
Module._SetLostFrameMode(eventData.data);
break;
/*******************************************worker音频编码相关接口实现**********************************************************/
case "CreateAudEncode":
res = Module._CreateAudEncode(eventData.encodertype);
postMessage({'function':"CreateAudEncode",'errorCode':res});
break;
case "SetAudEncodeParam":
res = Module._SetAudEncodeParam(eventData.samplerate, eventData.channel, eventData.bitrate, eventData.bitwidth);
postMessage({'function':"SetAudEncodeParam",'errorCode':res});
break;
case "DestroyAudEncode":
res = Module._DestroyAudEncode();
postMessage({'function':"DestroyAudEncode",'errorCode':res});
break;
case "InputAudEncodeData":
if(bWorkerPrintLog)
{
console.log("<<<Worker: 20200113 DecodeWorker-InputAudEncodeData 1");
}
var iLen = eventData.dataSize;
if(iLen > 0)
{
var pAudInputData = Module._malloc(iLen);
if (pAudInputData === null)
{
return;
}
var audinputData = new Uint8Array(eventData.data);
Module.writeArrayToMemory(audinputData, pAudInputData);
audinputData = null;
res = Module._InputAudEncodeData(pAudInputData, iLen);
if(bWorkerPrintLog)
{
console.log("<<<Worker: 20200113 DecodeWorker-InputAudEncodeData 2 res:"+res);
}
if(res == PLAYM4_OK) //
{
if (funGetAudFrameData === null)
{
funGetAudFrameData = Module.cwrap('GetAudFrameData', 'number');
}
if(bWorkerPrintLog)
{
console.log("<<<Worker: 20200113 DecodeWorker-InputAudEncodeData 2-1 succ");
}
//C++ GetAudFrameData
var ret = getAudFrameData(funGetAudFrameData);
}
Module._free(pAudInputData);
pAudInputData = null;
}
break;
default:
break;
}
};
function getOSDTime(oFrameInfo) {
var iYear = oFrameInfo.year;
var iMonth = oFrameInfo.month;
var iDay = oFrameInfo.day;
var iHour = oFrameInfo.hour;
var iMinute = oFrameInfo.minute;
var iSecond = oFrameInfo.second;
if (iMonth < 10) {
iMonth = "0" + iMonth;
}
if (iDay < 10) {
iDay = "0" + iDay;
}
if (iHour < 10) {
iHour = "0" + iHour;
}
if (iMinute < 10) {
iMinute = "0" + iMinute;
}
if (iSecond < 10) {
iSecond = "0" + iSecond;
}
return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
}
function getAudFrameData(fun)
{
if(bWorkerPrintLog)
{
console.log("<<<Worker: DecodeWorker-getAudFrameData 1");
}
var res = fun(); // C++GetAudFrameData
if(res === PLAYM4_OK)
{
var oFrameInfo = Module._GetAudFrameInfo();
var iSize = oFrameInfo.frameSize;
if (0 === iSize)
{
return null;
}
var pEncodeAud = Module._GetAudFrameBuffer();
if(pEncodeAud == null)
{
return null;
}
var aEncodeAudData = new Uint8Array(iSize);
aEncodeAudData.set(Module.HEAPU8.subarray(pEncodeAud, pEncodeAud + iSize));
if(bWorkerPrintLog)
{
console.log("<<<Worker: DecodeWorker-getAudFrameData 2");
}
//worker
postMessage({'function':"GetAudEncodeData",'data':aEncodeAudData.buffer,'dataSize':iSize, 'errorCode': res});
}
else
{
postMessage({'function':"GetAudEncodeData",'data':null,'dataSize':-1, 'errorCode': res});
}
oFrameInfo=null;
pEncodeAud=null;
aEncodeAudData=null;
return res;
}
//
function getFrameData(fun)
{
// function getFrameData() {
//
// var res = Module._GetFrameData();
var res = fun();
if(bWorkerPrintLog)
{
console.log("<<<Worker: getFrameData Result:"+res);
}
if (res === PLAYM4_OK)
{
var oFrameInfo = Module._GetFrameInfo();
switch (oFrameInfo.frameType)
{
case AUDIO_TYPE:
var iSize = oFrameInfo.frameSize;
if (0 === iSize)
{
return -1;
}
var pPCM = Module._GetFrameBuffer();
// var audioBuf = new ArrayBuffer(iSize);
var aPCMData = new Uint8Array(iSize);
aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
if(bWorkerPrintLog)
{
console.log("<<<Worker: audio media Info: nSise:"+ oFrameInfo.frameSize+",nSampleRate:"+oFrameInfo.samplesPerSec+',channel:'+oFrameInfo.channels+',bitsPerSample:'+oFrameInfo.bitsPerSample);
}
postMessage({
'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
'frameInfo': oFrameInfo, 'errorCode': res
}, [aPCMData.buffer]);
oFrameInfo = null;
pPCM = null;
aPCMData = null;
return PLAYM4_AUDIO_FRAME;
case VIDEO_TYPE:
var szOSDTime = getOSDTime(oFrameInfo);
var iWidth = oFrameInfo.width;
var iHeight = oFrameInfo.height;
var iYUVSize = iWidth * iHeight * 3 / 2;
if (0 === iYUVSize)
{
return -1;
}
var pYUV = Module._GetFrameBuffer();
//
var aYUVData = new Uint8Array(iYUVSize);
aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
if(bWorkerPrintLog)
{
console.log("<<<Worker: InputData-getFrameData Video: Width:"+ oFrameInfo.width+",Height:"+oFrameInfo.height+",timeStamp:"+oFrameInfo.timeStamp);
}
postMessage({
'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
'dataLen': aYUVData.length,'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
}, [aYUVData.buffer]);
oFrameInfo = null;
pYUV = null;
aYUVData = null;
return PLAYM4_VIDEO_FRAME;
case PRIVT_TYPE:
postMessage({
'function': "GetFrameData", 'type': "", 'data': null,
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
});
return PLAYM4_SYS_NOT_SUPPORT;
default:
postMessage({
'function': "GetFrameData", 'type': "", 'data': null,
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
});
return PLAYM4_SYS_NOT_SUPPORT;
}
}
else {
//
if(PLAYM4_DECODE_ERROR===res)
{
var rawInfo=Module._GetRawDataInfo();
var pRawData = Module._GetRawDataBuffer();
var aRawData = new Uint8Array(rawInfo.isize);
aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
postMessage({
'function': "GetRawData", 'type': "", 'data':aRawData.buffer,
'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': res
});
rawInfo=null;
pRawData=null;
aRawData=null;
}
//
if(PLAYM4_FIRST_FRAME_NOT_ICURRENT===res|| PLAYM4_ITYPE_DECODE_ERROR===res)
{
postMessage({
'function': "GetFrameData", 'type': "", 'data': null,
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': res
});
}
//
if (PLAYM4_NEED_MORE_DATA === res || PLAYM4_SYS_NOT_SUPPORT === res || PLAYM4_NOT_KEYFRAME === res){
postMessage({
'function': "GetFrameData", 'type': "", 'data': null,
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': res
});
}
return res;
}
}
//
function startTime() {
return new Date().getTime();
}
//
function endTime() {
return new Date().getTime();
}
// byte
function stringToBytes ( str ) {
var ch, st, re = [];
for (var i = 0; i < str.length; i++ ) {
ch = str.charCodeAt(i); // get char
st = []; // set up "stack"
do {
st.push( ch & 0xFF ); // push byte to stack
ch = ch >> 8; // shift value down by 1 byte
}
while ( ch );
// add stack contents to result
// done because chars have "wrong" endianness
re = re.concat( st.reverse() );
}
// return an array of bytes
return re;
}
})();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,396 @@
"use strict";
//
//attributejavascript
// vertexPos
// gl_Position
var vertexYUVShader = [
'attribute vec4 vertexPos;',
'attribute vec2 texturePos;',
'varying vec2 textureCoord;',
'void main()',
'{',
'gl_Position = vertexPos;',
'textureCoord = texturePos;',
'}'
].join('\n');
//(yuv->rgb)
var fragmentYUVShader = [
'precision highp float;',
'varying highp vec2 textureCoord;',
'uniform sampler2D ySampler;',
'uniform sampler2D uSampler;',
'uniform sampler2D vSampler;',
'const mat4 YUV2RGB = mat4',
'(',
'1.1643828125, 0, 1.59602734375, -.87078515625,',
'1.1643828125, -.39176171875, -.81296875, .52959375,',
'1.1643828125, 2.017234375, 0, -1.081390625,',
'0, 0, 0, 1',
');',
'void main(void) {',
'highp float y = texture2D(ySampler, textureCoord).r;',
'highp float u = texture2D(uSampler, textureCoord).r;',
'highp float v = texture2D(vSampler, textureCoord).r;',
'gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;',
'}'
].join('\n');
(function (root, factory) {
root.SuperRender = factory();
}(this, function () {
function RenderManager(canvas) {
this.canvasElement = document.getElementById(canvas);
this.initContextGL();
if(this.contextGL) {
this.YUVProgram = this.initProgram(vertexYUVShader, fragmentYUVShader);
this.initBuffers();
this.initTextures();
}
};
/**
* 初始化WebGL上下文
*/
RenderManager.prototype.initContextGL = function() {
var canvas = this.canvasElement;
var gl = null;
try {
gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
} catch (e) {
gl = null;
}
if(!gl || typeof gl.getParameter !== "function") {
gl = null;
}
this.contextGL = gl;
console.log("WebGL1.0");
};
/**
* 初始化着色器程序
* @param vertexShaderScript 顶点着色器脚本
* @param fragmentShaderScript 片段着色器脚本
*/
RenderManager.prototype.initProgram = function(vertexShaderScript, fragmentShaderScript) {
var gl = this.contextGL;
var vertexShader = gl.createShader(gl.VERTEX_SHADER); //
gl.shaderSource(vertexShader, vertexShaderScript);
gl.compileShader(vertexShader);
if(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
console.log('Vertex shader failed to compile: ' + gl.getShaderInfoLog(vertexShader));
}
var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(fragmentShader, fragmentShaderScript);
gl.compileShader(fragmentShader);
if(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
console.log('Fragment shader failed to compile: ' + gl.getShaderInfoLog(fragmentShader));
}
var program = gl.createProgram();
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);
gl.linkProgram(program);
if(!gl.getProgramParameter(program, gl.LINK_STATUS)) {
console.log('Program failed to compile: ' + gl.getProgramInfoLog(program));
}
gl.deleteShader(vertexShader);
gl.deleteShader(fragmentShader);
return program;
};
/**
* 初始化数据缓存
*/
RenderManager.prototype.initBuffers = function() {
var gl = this.contextGL;
var vertexPosBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
var texturePosBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]), gl.DYNAMIC_DRAW);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
this.vertexPosBuffer = vertexPosBuffer;
this.texturePosBuffer = texturePosBuffer;
};
/**
* 创建纹理
*/
RenderManager.prototype.initTexture = function() {
var gl = this.contextGL;
var textureRef = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, textureRef);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.bindTexture(gl.TEXTURE_2D, null);
return textureRef;
};
/**
* 初始化YUV纹理
*/
RenderManager.prototype.initTextures = function() {
var gl = this.contextGL;
var program = this.YUVProgram;
gl.useProgram(program);
var yTextureRef = this.initTexture();
var ySamplerRef = gl.getUniformLocation(program, 'ySampler');
gl.uniform1i(ySamplerRef, 0);
this.yTextureRef = yTextureRef;
var uTextureRef = this.initTexture();
var uSamplerRef = gl.getUniformLocation(program, 'uSampler');
gl.uniform1i(uSamplerRef, 1);
this.uTextureRef = uTextureRef;
var vTextureRef = this.initTexture();
var vSamplerRef = gl.getUniformLocation(program, 'vSampler');
gl.uniform1i(vSamplerRef, 2);
this.vTextureRef = vTextureRef;
gl.useProgram(null);
};
/**
* 显示帧数据
* @param nWidth 宽度
* @param nHeight 高度
* @param nHeight 帧数据
*/
RenderManager.prototype.SR_DisplayFrameData = function(nWidth, nHeight, pData,dWidth,dHeight) {
if(nWidth <= 0 || nHeight <= 0)
{
return;
}
var gl = this.contextGL;
if(null == pData)
{
gl.clearColor(0.0, 0.0, 0.0, 0.0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
return;
}
var canvas = this.canvasElement;
this.nWindowWidth = canvas.width;
this.nWindowHeight = canvas.height;
var nWindowWidth = this.nWindowWidth;
var nWindowHeight = this.nWindowHeight;
gl.clearColor(0.8, 0.8, 1.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.viewport(0, 0, nWindowWidth, nWindowHeight);
this.updateFrameData(nWidth, nHeight, pData,dWidth,dHeight);
var program = this.YUVProgram;
gl.useProgram(program);
var vertexPosBuffer = this.vertexPosBuffer;
gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);
var vertexPosRef = gl.getAttribLocation(program, 'vertexPos');
gl.enableVertexAttribArray(vertexPosRef);
gl.vertexAttribPointer(vertexPosRef, 2, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
var texturePosBuffer = this.texturePosBuffer;
gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
var texturePosRef = gl.getAttribLocation(program, 'texturePos');
gl.enableVertexAttribArray(texturePosRef);
gl.vertexAttribPointer(texturePosRef, 2, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
gl.disableVertexAttribArray(vertexPosRef);
gl.disableVertexAttribArray(texturePosRef);
gl.useProgram(null);
};
/**
* 上传YUV数据到纹理
* @param nWidth 宽度
* @param nHeight 高度
* @param nHeight 帧数据
*/
RenderManager.prototype.updateFrameData = function(width, height, data,dWidth,dHeight) {
var gl = this.contextGL;
var yTextureRef = this.yTextureRef;
var uTextureRef = this.uTextureRef;
var vTextureRef = this.vTextureRef;
var i420Data = data;
// debugger;
if(width == dWidth && height == dHeight)
{
var yDataLength = width * height;
var yData = i420Data.subarray(0, yDataLength);
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, yTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width, height, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, yData);
var cbDataLength = width/2 * height/2;
var cbData = i420Data.subarray(width*height, width*height + cbDataLength);
gl.activeTexture(gl.TEXTURE1);
gl.bindTexture(gl.TEXTURE_2D, uTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width/2, height/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, cbData);
var crDataLength = cbDataLength;
var crData = i420Data.subarray(width*height + width*height/4, width*height + width*height/4 + crDataLength);
gl.activeTexture(gl.TEXTURE2);
gl.bindTexture(gl.TEXTURE_2D, vTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, width/2, height/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, crData);
}
else
{
// //
var yDataLength = dWidth * dHeight;
var yData=new Uint8Array(yDataLength) ;
for(var i=0;i<dHeight;i++)
{
//var ySonData=new Uint8Array(dWidth) ;
var ySonData = i420Data.subarray(i*width, i*width+dWidth);
for (var j = 0; j < dWidth; j++) {
yData[i*dWidth + j] = ySonData[j];
}
}
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, yTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth, dHeight, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, yData);
yData=null;
ySonData=null;
var cbDataLength = dWidth/2 * dHeight/2;
var cbData =new Uint8Array(cbDataLength);
//var cbSonData=new Uint8Array(dWidth/2) ;
for(var i=0;i<dHeight/2;i++)
{
var cbSonData = i420Data.subarray(width*height+i*width/2, width*height+i*width/2+dWidth/2);
for (var j = 0; j < dWidth/2; j++) {
cbData[i*dWidth/2 + j] = cbSonData[j];
}
}
gl.activeTexture(gl.TEXTURE1);
gl.bindTexture(gl.TEXTURE_2D, uTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth/2, dHeight/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, cbData);
cbData=null;
cbSonData=null;
var crDataLength = cbDataLength;
var crData = new Uint8Array(crDataLength);
for(var i=0;i<dHeight/2;i++)
{
var crSonData = i420Data.subarray(width*height*5/4+i*width/2, width*height*5/4+i*width/2+dWidth/2);
for (var j = 0; j < dWidth/2; j++) {
crData[i*dWidth/2 + j] = crSonData[j];
}
}
gl.activeTexture(gl.TEXTURE2);
gl.bindTexture(gl.TEXTURE_2D, vTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth/2, dHeight/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, crData);
crData=null;
crSonData=null;
}
};
/**
* 设置显示区域
* @param stDisplayRect 显示区域
*/
RenderManager.prototype.SR_SetDisplayRect = function(stDisplayRect) {
var gl = this.contextGL;
var nWindowWidth = this.nWindowWidth;
var nWindowHeight = this.nWindowHeight;
var texturePosValues = null;
if(stDisplayRect && nWindowWidth > 0 && nWindowHeight > 0) {
var fLeft = stDisplayRect.left / nWindowWidth;
var fTop = stDisplayRect.top / nWindowHeight;
var fRight = stDisplayRect.right / nWindowWidth;
var fBottom = stDisplayRect.bottom / nWindowHeight;
texturePosValues = new Float32Array([fRight, fTop, fLeft, fTop, fRight, fBottom, fLeft, fBottom]);
}
else {
texturePosValues = new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]);
}
var texturePosBuffer = this.texturePosBuffer;
gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
gl.bufferSubData(gl.ARRAY_BUFFER, 0, texturePosValues);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
};
/**
* 释放显示资源
*/
RenderManager.prototype.SR_Destroy = function() {
var gl = this.contextGL;
var YUVProgram = this.YUVProgram;
gl.deleteProgram(YUVProgram);
var vertexPosBuffer = this.vertexPosBuffer;
var texturePosBuffer = this.texturePosBuffer;
gl.deleteBuffer(vertexPosBuffer);
gl.deleteBuffer(texturePosBuffer);
var yTextureRef = this.yTextureRef;
var uTextureRef = this.uTextureRef;
var vTextureRef = this.vTextureRef;
gl.deleteTexture(yTextureRef);
gl.deleteTexture(uTextureRef);
gl.deleteTexture(vTextureRef);
//gl.getExtension('WEBGL_lose_context').loseContext();
};
return RenderManager;
}));

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1 @@
"use strict";var Module={};var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}JSPlayerModule(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{Module["__emscripten_thread_exit"](-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1 @@
"use strict";var Module={};var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}JSPlayerModule(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{Module["__emscripten_thread_exit"](-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,234 @@
/**
* @license
* Copyright 2015 The Emscripten Authors
* SPDX-License-Identifier: MIT
*/
// Pthread Web Worker startup routine:
// This is the entry point file that is loaded first by each Web Worker
// that executes pthreads on the Emscripten application.
// Thread-local:
var initializedJS = false; // Guard variable for one-time init of the JS state (currently only embind types registration)
var Module = {};
function assert(condition, text) {
if (!condition) abort('Assertion failed: ' + text);
}
function threadPrintErr() {
var text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
}
function threadAlert() {
var text = Array.prototype.slice.call(arguments).join(' ');
postMessage({cmd: 'alert', text: text, threadId: Module['_pthread_self']()});
}
// We don't need out() for now, but may need to add it if we want to use it
// here. Or, if this code all moves into the main JS, that problem will go
// away. (For now, adding it here increases code size for no benefit.)
var out = function() {
throw 'out() is not defined in worker.js.';
}
var err = threadPrintErr;
this.alert = threadAlert;
Module['instantiateWasm'] = function(info, receiveInstance) {
// Instantiate from the module posted from the main thread.
// We can just use sync instantiation in the worker.
var instance = new WebAssembly.Instance(Module['wasmModule'], info);
// TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193,
// the above line no longer optimizes out down to the following line.
// When the regression is fixed, we can remove this if/else.
receiveInstance(instance);
// We don't need the module anymore; new threads will be spawned from the main thread.
Module['wasmModule'] = null;
return instance.exports;
};
function moduleLoaded() {
}
this.onmessage = function(e) {
try {
if (e.data.cmd === 'load') { // Preload command that is called once per worker to parse and load the Emscripten code.
// Module and memory were sent from main thread
Module['wasmModule'] = e.data.wasmModule;
Module['wasmMemory'] = e.data.wasmMemory;
Module['buffer'] = Module['wasmMemory'].buffer;
Module['ENVIRONMENT_IS_PTHREAD'] = true;
if (typeof e.data.urlOrBlob === 'string') {
importScripts(e.data.urlOrBlob);
} else {
var objectUrl = URL.createObjectURL(e.data.urlOrBlob);
importScripts(objectUrl);
URL.revokeObjectURL(objectUrl);
}
JSAudioInterComModule(Module).then(function (instance) {
Module = instance;
moduleLoaded();
});
} else if (e.data.cmd === 'objectTransfer') {
Module['PThread'].receiveObjectTransfer(e.data);
} else if (e.data.cmd === 'run') {
// This worker was idle, and now should start executing its pthread entry
// point.
// performance.now() is specced to return a wallclock time in msecs since
// that Web Worker/main thread launched. However for pthreads this can
// cause subtle problems in emscripten_get_now() as this essentially
// would measure time from pthread_create(), meaning that the clocks
// between each threads would be wildly out of sync. Therefore sync all
// pthreads to the clock on the main browser thread, so that different
// threads see a somewhat coherent clock across each of them
// (+/- 0.1msecs in testing).
Module['__performance_now_clock_drift'] = performance.now() - e.data.time;
// Pass the thread address inside the asm.js scope to store it for fast access that avoids the need for a FFI out.
Module['__emscripten_thread_init'](e.data.threadInfoStruct, /*isMainBrowserThread=*/0, /*isMainRuntimeThread=*/0);
// Establish the stack frame for this thread in global scope
// The stack grows downwards
var max = e.data.stackBase;
var top = e.data.stackBase + e.data.stackSize;
assert(e.data.threadInfoStruct);
assert(top != 0);
assert(max != 0);
assert(top > max);
// Also call inside JS module to set up the stack frame for this pthread in JS module scope
Module['establishStackSpace'](top, max);
Module['PThread'].receiveObjectTransfer(e.data);
Module['PThread'].threadInit();
// Embind must initialize itself on all threads, as it generates support JS.
// We only do this once per worker since they get reused
if (!initializedJS) {
Module['___embind_register_native_and_builtin_types']();
initializedJS = true;
}
try {
// pthread entry points are always of signature 'void *ThreadMain(void *arg)'
// Native codebases sometimes spawn threads with other thread entry point signatures,
// such as void ThreadMain(void *arg), void *ThreadMain(), or void ThreadMain().
// That is not acceptable per C/C++ specification, but x86 compiler ABI extensions
// enable that to work. If you find the following line to crash, either change the signature
// to "proper" void *ThreadMain(void *arg) form, or try linking with the Emscripten linker
// flag -s EMULATE_FUNCTION_POINTER_CASTS=1 to add in emulation for this x86 ABI extension.
var result = Module['invokeEntryPoint'](e.data.start_routine, e.data.arg);
Module['checkStackCookie']();
if (Module['keepRuntimeAlive']()) {
Module['PThread'].setExitStatus(result);
} else {
Module['PThread'].threadExit(result);
}
} catch(ex) {
if (ex === 'Canceled!') {
Module['PThread'].threadCancel();
} else if (ex != 'unwind') {
// FIXME(sbc): Figure out if this is still needed or useful. Its not
// clear to me how this check could ever fail. In order to get into
// this try/catch block at all we have already called bunch of
// functions on `Module`.. why is this one special?
if (typeof(Module['_emscripten_futex_wake']) !== "function") {
err("Thread Initialisation failed.");
throw ex;
}
// ExitStatus not present in MINIMAL_RUNTIME
if (ex instanceof Module['ExitStatus']) {
if (Module['keepRuntimeAlive']()) {
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' called exit(), staying alive due to noExitRuntime.');
} else {
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' called exit(), calling threadExit.');
Module['PThread'].threadExit(ex.status);
}
}
else
{
Module['PThread'].threadExit(-2);
throw ex;
}
} else {
// else e == 'unwind', and we should fall through here and keep the pthread alive for asynchronous events.
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.');
}
}
} else if (e.data.cmd === 'cancel') { // Main thread is asking for a pthread_cancel() on this thread.
if (Module['_pthread_self']()) {
Module['PThread'].threadCancel();
}
} else if (e.data.target === 'setimmediate') {
// no-op
} else if (e.data.cmd === 'processThreadQueue') {
if (Module['_pthread_self']()) { // If this thread is actually running?
Module['_emscripten_current_thread_process_queued_calls']();
}
} else {
err('worker.js received unknown command ' + e.data.cmd);
err(e.data);
}
} catch(ex) {
err('worker.js onmessage() captured an uncaught exception: ' + ex);
if (ex && ex.stack) err(ex.stack);
throw ex;
}
};
// Node.js support
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
// Create as web-worker-like an environment as we can.
self = {
location: {
href: __filename
}
};
var onmessage = this.onmessage;
var nodeWorkerThreads = require('worker_threads');
global.Worker = nodeWorkerThreads.Worker;
var parentPort = nodeWorkerThreads.parentPort;
parentPort.on('message', function(data) {
onmessage({ data: data });
});
var nodeFS = require('fs');
var nodeRead = function(filename) {
return nodeFS.readFileSync(filename, 'utf8');
};
function globalEval(x) {
global.require = require;
global.Module = Module;
eval.call(null, x);
}
importScripts = function(f) {
globalEval(nodeRead(f));
};
postMessage = function(msg) {
parentPort.postMessage(msg);
};
if (typeof performance === 'undefined') {
performance = {
now: function() {
return Date.now();
}
};
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,120 @@
importScripts('libSystemTransform.js');
const RECORDRTP = 0; //
let dataType = 1;
//
self.STCallBack = function (fileIndex,indexLen, data, dataLen)
{
//stFrameInfoDETAIL_FRAME_INFO
let stFrameInfo = Module._GetDetialFrameInfo();
let nIsMp4Index = stFrameInfo.nIsMp4Index;
//console.log("FrameType is " , stFrameInfo);
//console.log("nIsMp4Index is " + nIsMp4Index);
//debugger
var pData = null;
pData = new Uint8Array(dataLen);
pData.set(Module.HEAPU8.subarray(data, data + dataLen));
if (dataType === 1) {
if (pData[0] == 0x49 && pData[1] == 0x4d && pData[2] == 0x4b && pData[3] == 0x48) {//
return;
}
postMessage({type: "outputData", buf: pData, dType: 1});
dataType = 2;
} else {
if (nIsMp4Index) {
postMessage({type: "outputData", buf: pData, dType: 6}); //6
} else {
postMessage({type: "outputData", buf: pData, dType: 2}); //2:
}
}
//stFrameInfoDETAIL_FRAME_INFO
//let stFrameInfo = Module._GetDetialFrameInfo();
//let stFrameType = stFrameInfo.nFrameType;
//let nFrameNum = stFrameInfo.nFrameNum;
//let nTimeStamp = stFrameInfo.nTimeStamp;
//let nIsMp4Index = stFrameInfo.nIsMp4Index;
//console.log("FrameType is " + stFrameType);
//console.log("nIsMp4Index is " + nIsMp4Index);
}
// self.Module = { memoryInitializerRequest: loadMemInitFile(), TOTAL_MEMORY: 128*1024*1024 };
// importScripts('SystemTransform.js');
self.Module['onRuntimeInitialized'] = function (){
postMessage({type: "loaded"});
}
onmessage = function (e) {
var data = e.data;
if ("create" === data.type) {
if (RECORDRTP) {
postMessage({type: "created"});
postMessage({type: "outputData", buf: data.buf, dType: 1});
} else {
var iHeadLen = data.len;
var pHead = Module._malloc(iHeadLen);
self.writeArrayToMemory(new Uint8Array(data.buf), pHead);
var iTransType = data.packType;//
var iRet = Module._CreatHandle(pHead, iTransType, 4096);
if (iRet != 0) {
console.log("_CreatHandle failed!" + iRet);
} else {
iRet = Module._SysTransRegisterDataCallBack();
if(iRet != 0)
{
console.log("_SysTransRegisterDataCallBack Failed:" + iRet);
}
iRet = Module._SysTransStart(null, null);
if(iRet != 0)
{
console.log("_SysTransStart Failed:" + iRet);
}
postMessage({type: "created"});
}
}
} else if ("inputData" === data.type) {
if (RECORDRTP) {
var aFileData = new Uint8Array(data.buf); //
var iBufferLen = aFileData.length;
var szBufferLen = iBufferLen.toString(16);
if (szBufferLen.length === 1) {
szBufferLen = "000" + szBufferLen;
} else if (szBufferLen.length === 2) {
szBufferLen = "00" + szBufferLen;
} else if (szBufferLen.length === 3) {
szBufferLen = "0" + szBufferLen;
}
var aData = [0, 0, parseInt(szBufferLen.substring(0, 2), 16), parseInt(szBufferLen.substring(2, 4), 16)];
for(var iIndex = 0, iDataLength = aFileData.length; iIndex < iDataLength; iIndex++) {
aData[iIndex + 4] = aFileData[iIndex]
}
var dataUint8 = new Uint8Array(aData);
postMessage({type: "outputData", buf: dataUint8.buffer, dType: 2});
} else {
let pInputDataBuf = Module._malloc(data.len);
var idataLen = data.len;
self.writeArrayToMemory(new Uint8Array(data.buf), pInputDataBuf);
// 2m
let pp = Module._SysTransInputData(0, pInputDataBuf, idataLen);
if(pp != 0) {
//console.log("InputData Failed:" + pp);
}
Module._free(pInputDataBuf);
}
} else if ("release" === data.type) {
var iRet = Module._SysTransStop();
if (iRet != 0) {
console.log("_SysTransStop Failed:", iRet);
}
Module._SysTransRelease();
if (iRet != 0) {
console.log("_SysTransRelease Failed:", iRet);
}
close();
}
};

View File

@ -1,8 +1,8 @@
/*
* @Author: hisense.wuhongjian
* @Date: 2022-04-20 17:16:35
* @LastEditors: Light
* @LastEditTime: 2022-11-18 17:52:05
* @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-10-26 17:57:52
* @Description: 告诉大家这是什么
*/
import request from '@/utils/request'
@ -97,14 +97,6 @@ export function getHls(params) {
config2
)
}
// 西 POI
export function getListForPOI(params) {
return axios.get(
'http://10.134.135.3:21009/service/lbs/coder/geocoding2?appKey=675d95594136456bb7b1434dda31953f&city=青岛&keywords=' +
params.keywords,
config2
)
}
// 西-- (10.134.135.92:9537)
let _cameraUrl =

View File

@ -1678,6 +1678,7 @@ export function MapFun(mapObj) {
//_removeLayerByLayerName(layerName)
let selectedLayerList = [];
let layers = null;
let clickDataList = [];
//
layers = createMarkerClusterLayer()
const icon1 = createDefaultFeatureStyle({
@ -1696,65 +1697,71 @@ export function MapFun(mapObj) {
let icon = icon1;
restoreIconObj.restoreIcon = icon;
const marker = L.marker(feature.latLng, { icon })
if (createPopupFun !== null) {
marker.uuid = feature.uuid || ''
marker.resId = feature.resId || ''
marker.on('click', async(e) => {
if (feature.resourceName === 'video') {
const params = [feature.indexCode]
DS.openVideo(params)
} else {
const elementHtml = createPopupFun(feature)
if (elementHtml) {
console.log(
'L._addReMapWithter===============>',
feature.latLng,
elementHtml,
map
)
if (feature.type == 'videoSurveillance') {
L.popup({ className: 'detail-dialog', offset: [168, 240] })
.setLatLng(feature.latLng)
.setContent(elementHtml)
.openOn(map)
map.flyTo(feature.latLng)
} else {
L.popup({ className: 'detail-dialog' })
.setLatLng(feature.latLng)
.setContent(elementHtml)
.openOn(map)
}
}
}
})
}
marker.uuid = feature.uuid || ''
marker.resId = feature.resId || ''
marker.resourceData = feature.data || {}
// if (createPopupFun !== null) {
// marker.uuid = feature.uuid || ''
// marker.resId = feature.resId || ''
// marker.resourceData = feature.data || {}
// marker.on('click', async(e) => {
// if (feature.resourceName === 'video') {
// const params = [feature.indexCode]
// DS.openVideo(params)
// } else {
// const elementHtml = createPopupFun(feature)
// if (elementHtml) {
// console.log(
// 'L._addReMapWithter===============>',
// feature.latLng,
// elementHtml,
// map
// )
// if (feature.type == 'videoSurveillance') {
// L.popup({ className: 'detail-dialog', offset: [168, 240] })
// .setLatLng(feature.latLng)
// .setContent(elementHtml)
// .openOn(map)
// map.flyTo(feature.latLng)
// } else {
// L.popup({ className: 'detail-dialog' })
// .setLatLng(feature.latLng)
// .setContent(elementHtml)
// .openOn(map)
// }
// }
// }
// })
// }
marker.on('click', e => {
console.log('点位数据', e) //
// marker
//const layers = layerGroup.get(layerName).getLayers()
// layers.forEach((layer) => {
// layer.setIcon(icon)
// })
restoreIconObj.layerId = e.sourceTarget._leaflet_id
const currentLayer = layerGroup
.get(layerName)
.getLayer(restoreIconObj.layerId)
restoreIconObj.currentLayer = currentLayer;
if (currentLayer._icon.src != icon.options.iconUrl) {
currentLayer.setIcon(icon);
} else {
selectedLayerList.push(currentLayer);
//,//
if (selectedLayerList.length > 0) {
selectedLayerList.forEach((item) => {
item.setIcon(
L.icon({ iconUrl: require('./image/' + url2), iconSize: [33, 33] })
)
});
}
}
mybus.emit('pointMarkerClick', feature);
selectedLayerList = [];
console.log('点位数据', e)
clickDataList.push(e.resourceData);
// marker
//const layers = layerGroup.get(layerName).getLayers()
// layers.forEach((layer) => {
// layer.setIcon(icon)
// })
// restoreIconObj.layerId = e.sourceTarget._leaflet_id
// const currentLayer = layerGroup
// .get(layerName)
// .getLayer(restoreIconObj.layerId)
// restoreIconObj.currentLayer = currentLayer;
// if (currentLayer._icon.src != icon.options.iconUrl) {
// currentLayer.setIcon(icon);
// } else {
// selectedLayerList.push(currentLayer);
// //,//
// if (selectedLayerList.length > 0) {
// selectedLayerList.forEach((item) => {
// item.setIcon(
// L.icon({ iconUrl: require('./image/' + url2), iconSize: [33, 33] })
// )
// });
// }
// }
//mybus.emit('pointMarkerClick', feature);
//selectedLayerList = [];
mybus.emit('openOperationPopup', clickDataList);
})
layers.addLayer(marker)
}

View File

@ -40,6 +40,7 @@ function updateProgressBar(processed, total, elapsed, layersArray) {
* @returns {*}
*/
function createMarkerClusterLayer(layerClassName) {
let array = [];
let markerClusterLayer = null
if (layerClassName) {
//
@ -74,13 +75,23 @@ function createMarkerClusterLayer(layerClassName) {
return L.divIcon({ html: markers.length, className: "topic-marker-cluster-video" })
},
// PolylineOptions spider
spiderfyOnMaxZoom: true,
spiderfyOnMaxZoom: false,
//
showCoverageOnHover: false,
//
zoomToBoundsOnClick: true,
zoomToBoundsOnClick: false,
maxClusterRadius: 80,
})
markerClusterLayer.on('clusterclick', function(a) {
//console.log('cluster ' + a.layer.getAllChildMarkers());
let clusterList = [];
for (var i = 0; i < a.layer.getAllChildMarkers().length; i++) {
//console.log('yyyyyyyyy', a.layer.getAllChildMarkers()[i].resourceData);
clusterList.push(a.layer.getAllChildMarkers()[i].resourceData);
}
//console.log('clusterList ' + a.layer.getAllChildMarkers(array, true));
mybus.emit('openOperationPopup', clusterList);
});
}
return markerClusterLayer
}

View File

@ -230,7 +230,7 @@
>
<button class="buzhou">提交</button>
</a-popconfirm>
<button class="buzhou" v-else-if="showView === '部署与使用'" @click="submit()">
<button class="buzhou" v-else-if="服务商联系电话 === '部署与使用'" @click="submit()">
提交
</button>
<button class="quxiao" @click="close()">取消</button>

View File

@ -1,4 +1,5 @@
<template>
itShowQingDao
<!-- 青岛 -->
<div class="details-pageconetent" v-if="whoShow1 && whoShow1.itShowQingDao">
<home-header></home-header>
@ -304,7 +305,7 @@
<div class="details-pageconetent-left" v-if="Cardsname != '基础设施'">
<detailsPageconetentTree />
</div>
<div class="details-pageconetent-left" style="left: 0.16rem" v-else>
<div class="details-pageconetent-left" style="left:0.16rem" v-else>
<detailsPageInfrastructureTreeXha />
</div>
<div class="top" v-if="Cardsname != '知识库' && Cardsname != '基础设施'">
@ -435,11 +436,7 @@
<a-empty />
</div>
</div>
<div
class="top"
style="width: 13.5rem; margin-left: 0"
v-else-if="Cardsname === '基础设施'"
>
<div class="top" style="width: 13.5rem;margin-left:0" v-else-if="Cardsname === '基础设施'">
<div class="top-title">
<div
v-for="item in titleName"
@ -510,9 +507,6 @@
:resourceTotal="resourceTotal"
></KnowledgeBase>
</div>
<template v-if="Cardsname == '基础设施'">
<infrastructureApplication></infrastructureApplication>
</template>
<div class="talk-monitor" @click="openMonitor">
<a-tooltip>
<template #title>问答机器人</template>
@ -784,7 +778,6 @@
import infrastructurePageXha from '@/views/home/infrastructurePageXha.vue'
import detailsPageInfrastructureTree from '@/views/home/detailsPageInfrastructureTree.vue'
import detailsPageInfrastructureTreeXha from '@/views/home/detailsPageInfrastructureTreeXha.vue'
import infrastructureApplication from '@/views/home/infrastructureApplication.vue'
import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js'
import { useStore } from 'vuex'
import { message } from 'ant-design-vue'
@ -810,7 +803,7 @@
const handleAdd = (value) => {
flag.value = value
}
const titleName = ref([])
    const titleName=ref([])
const openMonitor = () => {
window.open('http://www.qingdao.gov.cn:8083/ghwd/znwdqd/index.html')
}
@ -911,14 +904,15 @@
name: '',
})
// 西
const setTitle = () => {
let title = titleNameArray
let whoShow1 = ref(whoShow)
if (whoShow1 && whoShow1.value.itShowXiHaiAn) {
title[0] = title.splice(2, 1, title[0])[0]
}
titleName.value = title
}
 const setTitle = () => {
        let  title = titleNameArray
        let whoShow1 = ref(whoShow)
      if( whoShow1 && whoShow1.value.itShowXiHaiAn){
        title[0] = title.splice(2, 1, title[0])[0];
     
      }
      titleName.value=title
      }
//
const onSearch = () => {
loading.value = true
@ -1286,27 +1280,21 @@
.replace({
query: newQuery,
})
.then(() => {
mybus.emit('changeRoomInput', searchValue.value)
if (
whoShow1.value.itShowQingDao &&
paramsGetResources.type == '基础设施'
) {
console.log('camera2', camera)
let selectType = router.currentRoute.value.query.selectType
if (selectType == '政务云资源') {
camera.value.getGovernmentCloud()
} else {
camera.value.getCamera(true, searchValue.value)
}
} else {
if (storageSearchInfo) {
getAppResources('分页查询')
} else {
getAppResources()
}
}
})
.then(() => {})
mybus.emit('changeRoomInput', searchValue.value)
if (
whoShow1.value.itShowQingDao &&
paramsGetResources.type == '基础设施'
) {
console.log('camera2', camera)
camera.value.getCamera(true, searchValue.value)
} else {
if (storageSearchInfo) {
getAppResources('分页查询')
} else {
getAppResources()
}
}
}
const getAppResources = (switchIndex) => {
if (!globalFlag.value) {
@ -1763,7 +1751,7 @@
onMounted(() => {
//
//西
setTitle()
setTitle();
handleSetSearchData()
listKey2.value++
//
@ -1965,7 +1953,6 @@
infrastructurePageXha,
detailsPageInfrastructureTree,
detailsPageInfrastructureTreeXha,
infrastructureApplication,
},
beforeUnmount() {
mybus.off('getCameraByParentId')

View File

@ -2,59 +2,36 @@
* @Author: Light
* @Date: 2022-11-16 16:46:16
* @LastEditors: Light
* @LastEditTime: 2022-11-18 15:35:25
* @LastEditTime: 2022-11-17 09:46:45
* @Description: 政务云资源列表
-->
<template>
<div class="top">
<div>检索结果{{ props.governmentCloud.total }}</div>
<div>检索结果60</div>
<div>
使用声明:
附加增值服务委办局单位可以根据自身需求按需采购由采购单位付费
</div>
</div>
<div
class="bottom"
v-for="(item, index) in props.governmentCloud.data"
:key="item.service_item_tier1 + index"
>
<div class="bottom">
<div class="left"></div>
<div class="right">
<div class="title">
<div>
<div class="name">{{ item.service_item_tier1 }}</div>
<div class="type">{{ item.service_type }}</div>
<div class="name">云主机</div>
<div class="type">基础服务</div>
</div>
<div>年份{{ item.year }}</div>
<div>年份2022</div>
</div>
<div class="text">{{ item.service_description }}</div>
<div class="text">云主机配置</div>
<div class="info">
<div>一级条目{{ item.service_item_tier2 }}</div>
<div>规格{{ item.specification }}</div>
<div>一级条目主机服务</div>
<div>规格1H2G</div>
</div>
</div>
</div>
<a-pagination
v-model:current="current"
:pageSize="5"
:total="props.governmentCloud.total"
:showSizeChanger="false"
@change="changeCurrent"
show-less-items
/>
</template>
<script setup>
import { ref, defineProps, defineEmits } from 'vue'
const props = defineProps({
governmentCloud: { type: Object, default: null },
})
const emit = defineEmits(['getGovernmentCloud'])
const current = ref(props.governmentCloud.current)
const changeCurrent = (current) => {
console.log(current)
emit('getGovernmentCloud', current)
}
</script>
<script setup></script>
<style lang="less" scoped>
.top {
display: flex;

View File

@ -0,0 +1,160 @@
<!--
海康H5Player
-->
<template>
<div id='player' style="width:950px;height:600px"></div>
</template>
<script>
const IS_MOVE_DEVICE = document.body.clientWidth < 992 //
const MSE_IS_SUPPORT = !!window.MediaSource // mse
export default {
name: 'H5Player',
props: {
videoUrl:{
type: String,
default: '',
}
},
data() {
return {
player: null,
splitNum: 1,
mseSupport: MSE_IS_SUPPORT,
// tabActive: MSE_IS_SUPPORT ? 'mse' : 'decoder',
tabActive: 'decoder',
urls: {
realplay: 'ws://10.19.147.22:559/EUrl/q2jQie4',
talk: 'wss://10.41.163.126:6014/proxy/10.41.163.126:559/EUrl/6gFx47S',
playback: 'wss://10.41.163.126:6014/proxy/10.41.163.126:559/EUrl/6gFx47S'
},
playback: {
startTime: '2021-07-26T00:00:00',
endTime: '2021-07-26T23:59:59',
valueFormat: '',
seekStart: '2021-07-26T12:00:00',
rate: ''
},
muted: true,
volume: 50,
volumeOnSvg: {
template: '<svg t="1624453273744" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1421" width="200" height="200"><path d="M597.994667 138.005333q130.005333 28.010667 213.994667 132.992t84.010667 241.002667-84.010667 241.002667-213.994667 132.992l0-88q93.994667-28.010667 153.002667-106.005333t59.008-180.010667-59.008-180.010667-153.002667-106.005333l0-88zM704 512q0 120-106.005333 172.010667l0-344q106.005333 52.010667 106.005333 172.010667zM128 384l170.005333 0 213.994667-213.994667 0 684.010667-213.994667-213.994667-170.005333 0 0-256z" p-id="1422"></path></svg>'
},
volumeOffSvg: {
template: '<svg t="1624453193279" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9147" width="200" height="200"><path d="M512 170.005333l0 180.010667-90.005333-90.005333zM181.994667 128l714.005333 714.005333-53.994667 53.994667-88-88q-74.005333 58.005333-156.010667 77.994667l0-88q50.005333-13.994667 96-50.005333l-181.994667-181.994667 0 288-213.994667-213.994667-170.005333 0 0-256 202.005333 0-202.005333-202.005333zM810.005333 512q0-101.994667-59.008-180.010667t-153.002667-106.005333l0-88q130.005333 28.010667 213.994667 132.992t84.010667 241.002667q0 96-44.010667 178.005333l-64-66.005333q21.994667-53.994667 21.994667-112zM704 512q0 18.005333-2.005333 26.005333l-104-104 0-93.994667q106.005333 52.010667 106.005333 172.010667z" p-id="9148"></path></svg>'
},
recordStartState: 0,
recordStartText: '录像'
}
},
created(){
},
mounted() {
this.init()
this.createPlayer()
this.arrangeWindow()
//videoUrl this.realplay(this.videoUrl,0);//index
this.realplay('wss://10.134.135.44:6014/proxy/10.10.20.14:559/openUrl/y3mFfcA',0);
},
methods: {
//
init () {
//
window.addEventListener('resize', () => {
this.player.JS_Resize()
})
},
createPlayer () {
this.player = new window.JSPlugin({
szId: 'player',
szBasePath: "/util/", //public/jsjs
iMaxSplit: 4,
iCurrentSplit: 4,
openDebug: true,
oStyle: {
borderSelect: '#FFCC00',
}
})
//
this.player.JS_SetWindowControlCallback({
windowEventSelect: function (iWndIndex) { //
console.log('windowSelect callback: ', iWndIndex);
},
pluginErrorHandler: function (iWndIndex, iErrorCode, oError) { //
console.log('pluginError callback: ', iWndIndex, iErrorCode, oError);
},
windowEventOver: function (iWndIndex) { //
//console.log(iWndIndex);
},
windowEventOut: function (iWndIndex) { //
//console.log(iWndIndex);
},
windowEventUp: function (iWndIndex) { //mouseup
//console.log(iWndIndex);
},
windowFullCcreenChange: function (bFull) { //
console.log('fullScreen callback: ', bFull);
},
firstFrameDisplay: function (iWndIndex, iWidth, iHeight) { //
console.log('firstFrame loaded callback: ', iWndIndex, iWidth, iHeight);
},
performanceLack: function () { //
console.log('performanceLack callback: ');
}
});
},
arrangeWindow () {
const splitNum = this.splitNum
this.player.JS_ArrangeWindow(splitNum).then(
() => { console.log(`arrangeWindow to ${splitNum}x${splitNum} success`) },
e => { console.error(e) }
)
},
//
//
realplay (playURL, index1) {
this.mode = 1 //0 1
const { player, mode, urls } = this,
index = player.currentWindowIndex
// playURL = this.realplay
player.JS_Play(playURL, { playURL, mode }, index1).then(
() => {
console.log('realplay success')
},
e => { console.error(e) }
)
},
//
stopAllPlay () {
this.player.JS_StopRealPlayAll().then(
() => {
this.playback.rate = 0
console.log('stopAllPlay success')
this.closeVideoTree()
},
e => { console.error(e) }
)
},
//
stopPlay () {
this.player.JS_Stop().then(
() => {
this.playback.rate = 0
console.log('stop realplay success')
// this.closeVideoTree()
const index = this.player.currentWindowIndex
this.selectAisle(this.videoList[index], index)
},
e => { console.error(e) }
)
},
},
}
</script>
<style lang="less">
.tiled-map {
position: relative;
width: 100%;
height: 100%;
}
</style>

View File

@ -1,34 +1,8 @@
<template>
<div class="wrapper">
<div class="nav">
<div :class="{ active: itemIndex == 1 }" @click="btnClick(1)">
<span
class="photo"
:style="{
backgroundImage: `url(${bumenImg}) `,
backgroundSize: 'cover',
}"
></span>
<span>部门</span>
</div>
<div :class="{ active: itemIndex == 2 }" @click="btnClick(2)">
<span
class="photo"
:style="{
backgroundImage: `url(${biaoqianImg}) `,
backgroundSize: 'cover',
}"
></span>
<span>标签</span>
</div>
</div>
<div v-if="itemIndex == 1" class="wrapper-title-left-tree" :key="showKey">
<div class="wrapper-title-left-tree" :key="showKey">
<div v-for="item in treeData" :key="item.id" class="primaryNode">
<div
class="top"
@click="showBottom(item)"
:class="item.show ? 'topSelect' : ''"
>
<div class="top" @click="showBottom(item)" :class="item.show ? 'topSelect' : ''">
{{ item.name }}
({{ item.channelCount }})
<DownOutlined v-show="!item.show" />
@ -36,28 +10,13 @@
</div>
<div class="bottom" v-show="item.show">
<div v-for="val in item.children" :key="val.id" class="item">
<div
class="up"
:class="selectId == val.id ? 'select' : ''"
@click="showDown(item, val), onSelect(item, val)"
>
<div class="up" :class="selectId == val.id ? 'select' : ''"
@click="showDown(item, val), onSelect(item, val)">
<div>
<svg
t="1654068878091"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2156"
width="0.25rem"
height="0.25rem"
v-show="selectId == val.id"
>
<path
d="M512 624a112 112 0 1 0 0-224 112 112 0 0 0 0 224z"
p-id="2157"
fill="#0058e1"
></path>
<svg t="1654068878091" class="icon" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="2156" width="0.25rem" height="0.25rem"
v-show="selectId == val.id">
<path d="M512 624a112 112 0 1 0 0-224 112 112 0 0 0 0 224z" p-id="2157" fill="#0058e1"></path>
</svg>
<span class="name">{{ val.name }}({{ val.channelCount }})</span>
</div>
@ -68,30 +27,13 @@
</span>
</div>
<div class="down" v-show="val.show">
<div
v-for="child in val.children"
:key="child.id"
class="child"
:class="selectId == child.id ? 'select2' : ''"
@click="onSelect(item, child, child)"
>
<div v-for="child in val.children" :key="child.id" class="child"
:class="selectId == child.id ? 'select2' : ''" @click="onSelect(item, child, child)">
<div>
<svg
t="1654068878091"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2156"
width="0.25rem"
height="0.25rem"
v-show="selectId == child.id"
>
<path
d="M512 624a112 112 0 1 0 0-224 112 112 0 0 0 0 224z"
p-id="2157"
fill="#0058e1"
></path>
<svg t="1654068878091" class="icon" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="2156" width="0.25rem" height="0.25rem"
v-show="selectId == child.id">
<path d="M512 624a112 112 0 1 0 0-224 112 112 0 0 0 0 224z" p-id="2157" fill="#0058e1"></path>
</svg>
<span class="name">
{{ child.name }}
@ -104,20 +46,6 @@
</div>
</div>
</div>
<div v-if="itemIndex == 2" class="wrapper-title-left-tree">
<div v-for="(item, index) in biaoqianList">
<div class="titleName">{{ item.placeTypeName }}</div>
<div class="glgkmk" v-for="(child, index) in item.children">
<div
class="glgknum"
:class="{ active: child.placeTypeCode == chooseId }"
@click="tabClick(child.placeTypeCode)"
>
{{ child.placeTypeName }}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
@ -131,35 +59,29 @@ import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js'
export default defineComponent({
setup() {
const biaoqianList = ref([])
const bumenImg = require('@/assets/newHome/bumen.png')
const biaoqianImg = require('@/assets/newHome/biaoqian.png')
const router = useRouter()
const whoShow1 = ref(whoShow)
const showKey = ref(0)
const treeData = ref([])
const selectId = ref('')
let itemIndex = ref(1)
let chooseId = ref('')
//tab
const btnClick = (index) => {
itemIndex.value = index
}
//
const tabClick = (id) => {
chooseId.value = id
}
//
const init = async () => {
treeData.value = []
let select =
router.currentRoute.value.query.select ||
DETAIL_PAGE_CONTENT_DEFAULT_TAB
console.log(
'router.currentRoute.value.query.select',
router.currentRoute.value.query.select
)
let select = router.currentRoute.value.query.select || DETAIL_PAGE_CONTENT_DEFAULT_TAB
if (select === '123') {
select = ''
}
console.log(
'获取url中的select=====================>',
router.currentRoute.value.query.select
)
if (select == '基础设施') {
let res = {}
let res = {};
if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) {
res = await getCameraAllOrgan({ parentId: 'S4NbecfYB1DBH8HNULGS34' })
} else {
@ -168,27 +90,9 @@ export default defineComponent({
areaId: '70be8c5b664f4bcf869d82f2e8335051',
})
}
treeData.value = (res.data && res.data.data) || []
//=========
biaoqianList.value = [
{
placeTypeName: '政府机构',
children: [
{ placeTypeName: '行政中心', placeTypeCode: '1' },
{ placeTypeName: '行政中心', placeTypeCode: '12' },
{ placeTypeName: '行政中心', placeTypeCode: '14' },
],
},
{
placeTypeName: '政府机构1',
children: [
{ placeTypeName: '行政中心', placeTypeCode: '2' },
{ placeTypeName: '行政中心', placeTypeCode: '3' },
],
},
]
treeData.value = res.data && res.data.data || []
//
if (res.data && res.data.data.length == 1) {
if(res.data && res.data.data.length == 1) {
showBottom(treeData.value[0])
}
}
@ -198,6 +102,11 @@ export default defineComponent({
})
const onSelect = async (item, val, child) => {
console.log('item--------onSelect---->', item);
console.log('val------onSelect------>', val);
console.log('child-----onSelect------->', child);
mybus.emit('getCameraByParentId', val.id)
mybus.emit('getListByParentId', val.id)
let res = {}
if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) {
res = await getCameraAllOrgan({ parentId: val.id })
@ -228,8 +137,8 @@ export default defineComponent({
})
const showBottom = async (item) => {
item.show = !item.show
let res = {}
item.show = !item.show;
let res = {};
if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) {
res = await getCameraAllOrgan({ parentId: item.id })
} else {
@ -239,17 +148,17 @@ export default defineComponent({
treeData.value.map((treeDataItem, index) => {
if (item.id == treeDataItem.id) {
treeData.value[index].children = (res.data && res.data.data) || []
treeData.value[index].children = res.data && res.data.data || []
console.log('treeData.value.[index]', treeData.value[index])
}
})
}
const showDown = (item, val) => {
selectId.value = val.id
console.log('item---showDown--------->', item)
console.log('val----showDown-------->', val)
console.log('item---showDown--------->', item);
console.log('val----showDown-------->', val);
if (item.children) {
val.show = !val.show
val.show = !val.show;
//
if (!val.show) {
selectId.value = ''
@ -257,19 +166,12 @@ export default defineComponent({
}
}
return {
btnClick,
tabClick,
treeData,
showKey,
onSelect,
showBottom,
showDown,
selectId,
itemIndex,
bumenImg,
biaoqianImg,
biaoqianList,
chooseId,
}
},
beforeUnmount() {
@ -283,67 +185,6 @@ export default defineComponent({
})
</script>
<style lang="less" scoped>
.titleName {
font-size: 18px;
color: #1e1a1a;
margin-bottom: 10px;
padding-left: 10px;
border-left: 6px solid #1296db;
}
.glgkmk {
cursor: pointer;
text-align: center;
position: relative;
display: inline-block;
width: 30%;
margin-bottom: 10px;
.active {
color: #0058e1;
}
.glgknum {
// color: #000000;
}
}
.glgkmk :hover {
color: #0058e1;
}
.nav {
margin-bottom: 13px;
display: flex;
justify-content: space-around;
align-items: center;
font-size: 18px;
font-family: 'Alibaba PuHuiTi';
color: #000000;
line-height: 0.32rem;
margin-bottom: 0.1rem;
.photo {
display: inline-block;
height: 0.3rem;
width: 0.3rem;
margin-right: 0.1rem;
}
div {
padding: 0 0.1rem;
cursor: pointer;
display: flex;
align-items: center;
}
div:hover {
color: #1296db;
}
.active {
font-weight: 600;
color: #1296db;
border-bottom: 0.02rem solid #1296db;
}
}
.primaryNode {
.top {
width: 100%;
@ -391,7 +232,7 @@ export default defineComponent({
border-top: 0.01rem solid #ccc;
padding: 0 0.1rem;
& > div {
&>div {
display: flex;
justify-content: flex-start;
}
@ -448,7 +289,7 @@ export default defineComponent({
align-items: center;
padding: 0 0.1rem;
& > div {
&>div {
display: flex;
justify-content: flex-start;
}

View File

@ -1,178 +0,0 @@
<!--
* @Author: Light
* @Date: 2022-11-18 11:53:43
* @LastEditors: Light
* @LastEditTime: 2022-11-19 17:15:15
* @Description: 告诉大家这是什么
-->
<template>
<div class="infrastructureApplication">
<div class="top">
<a-list size="small" bordered :data-source="dataList.toBeApplied">
<template #renderItem="{ item }">
<a-list-item>
<div class="name">
<a-tooltip>
<template #title>{{ item.channelName }}</template>
{{ item.channelName }}
</a-tooltip>
</div>
<a-button type="link" danger @click="delWillApplyCamera(item.id)">
移出
</a-button>
</a-list-item>
</template>
<template #header>
<div class="title">待申请列表</div>
</template>
<template #footer>
<a-button type="primary">一键申请</a-button>
</template>
</a-list>
</div>
<div class="bottom">
<a-list size="small" bordered :data-source="data">
<template #renderItem="{ item }">
<a-list-item>
<div class="name">
<a-tooltip>
<template #title>{{ item }}</template>
{{ item }}
</a-tooltip>
</div>
<a-button type="link" danger>删除</a-button>
</a-list-item>
</template>
<template #header>
<div class="title">已申请列表</div>
</template>
</a-list>
</div>
</div>
</template>
<script setup>
import {
willApplyCameraSelect,
willApplyCameraBatchInsert,
willApplyCameraBatchDelete,
} from '@/api/home'
import { onBeforeUnmount, reactive, ref } from 'vue'
import { message } from 'ant-design-vue'
import mybus from '@/myplugins/mybus'
const dataList = reactive({ toBeApplied: [], requested: [] })
//
const addWacFlag = ref(true)
const delWacFlag = ref(true)
const delWillApplyCamera = (id) => {
console.log('删除===>', id)
if (delWacFlag.value) {
delWacFlag.value = false
willApplyCameraBatchDelete([id]).then((res) => {
if (res.data.code == 0) {
message.success('移出成功')
} else {
message.warning('移出失败')
}
init()
})
}
}
const init = () => {
willApplyCameraSelect().then((res) => {
if (res.data.code == 0) {
dataList.toBeApplied = res.data.data
delWacFlag.value = true
addWacFlag.value = true
} else {
message.warning('查询失败')
dataList.toBeApplied = []
}
})
}
init()
mybus.on('selectCamera', (obj) => {
// 10
if (dataList.toBeApplied.length + dataList.requested.length > 10) {
message.warning('最多只能申请10个摄像头')
return
}
//
let addFlag = true
dataList.toBeApplied.map((val) => {
if (addFlag && val.channelId == obj.channelId) {
addFlag = false
}
})
dataList.requested.map((val) => {
if (addFlag && val.channelId == obj.channelId) {
addFlag = false
}
})
if (addWacFlag.value) {
if (addFlag) {
addWacFlag.value = false
willApplyCameraBatchInsert([obj]).then((res) => {
if (res.data.code == 0) {
message.success('移入成功')
} else {
message.warning('移入失败')
}
init()
})
} else {
message.warning('已申请该摄像头!')
}
}
})
onBeforeUnmount(() => {
mybus.off('selectCamera')
})
const data = [
'Racing car sprays burning fuel into crowd.',
'Japanese princess to wed commoner.',
'Australian walks 100km after outback crash.',
'Man charged over missing wedding girl.',
'Los Angeles battles huge wildfires.',
'Racing car sprays burning fuel into crowd.',
'Japanese princess to wed commoner.',
'Australian walks 100km after outback crash.',
'Man charged over missing wedding girl.',
'Los Angeles battles huge wildfires.',
]
</script>
<style lang="less" scoped>
.infrastructureApplication {
background: #fff;
position: fixed;
top: 50%;
right: 0.16rem;
margin-top: -3.5rem;
.bottom {
margin-top: 32px;
}
.title {
font-size: 16px;
font-weight: 600;
}
.name {
width: 150px;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
:deep(.ant-list-footer) {
display: flex;
justify-content: flex-end;
}
:deep(.ant-list-items) {
height: 2.45rem;
overflow-y: scroll;
}
:deep(.ant-spin-nested-loading) {
height: 2.45rem;
}
}
</style>

View File

@ -562,13 +562,9 @@
</div>
<div
class="infrastructrue-table"
:key="showKey"
v-if="!wrjFlag && selectType == '政务云资源'"
>
<GovernmentCloudResources
:governmentCloud="governmentCloud"
@getGovernmentCloud="getGovernmentCloud"
></GovernmentCloudResources>
<GovernmentCloudResources></GovernmentCloudResources>
</div>
<!-- 西海岸-无人机单兵设备 -->
<div class="infrastructrue-table" v-else-if="isXiHaiAn && wrjFlag">
@ -1557,7 +1553,6 @@
}
const emits = defineEmits(['add'])
const selectType = ref('政务云资源')
const showKey = ref(0)
//
let tableHeight = ref('600')
//tab
@ -1566,15 +1561,6 @@
selectedList.value = []
if (clickList.value[indexFather].content.indexOf(name) != -1) {
if (name == '视频资源') {
let newQuery = JSON.parse(
JSON.stringify(router.currentRoute.value.query)
)
newQuery.selectType = name
router
.replace({
query: newQuery,
})
.then(() => {})
room.value = true
tableHeight.value = 330
showMap.value = true
@ -1584,15 +1570,6 @@
selectType.value = '视频资源'
console.log('444------------>', 444)
} else if (name == '政务云资源') {
let newQuery = JSON.parse(
JSON.stringify(router.currentRoute.value.query)
)
newQuery.selectType = name
router
.replace({
query: newQuery,
})
.then(() => {})
room.value = true
tableHeight.value = 600
showMap.value = false
@ -1612,25 +1589,7 @@
pagination.value.total = 0
selectType.value = '感知资源'
} else if (name == '城市云脑会客厅') {
let newQuery = JSON.parse(
JSON.stringify(router.currentRoute.value.query)
)
newQuery.selectType = name
router
.replace({
query: newQuery,
})
.then(() => {})
} else if (name == '视频会议') {
let newQuery = JSON.parse(
JSON.stringify(router.currentRoute.value.query)
)
newQuery.selectType = name
router
.replace({
query: newQuery,
})
.then(() => {})
room.value = true
tableHeight.value = 600
showMap.value = false
@ -1650,15 +1609,6 @@
}
} else {
if (name == '视频资源') {
let newQuery = JSON.parse(
JSON.stringify(router.currentRoute.value.query)
)
newQuery.selectType = name
router
.replace({
query: newQuery,
})
.then(() => {})
selectType.value = '视频资源'
wrjFlag.value = false
tableHeight.value = 330
@ -1699,15 +1649,6 @@
emits('add', 1)
getCamera()
} else if (name == '政务云资源') {
let newQuery = JSON.parse(
JSON.stringify(router.currentRoute.value.query)
)
newQuery.selectType = name
router
.replace({
query: newQuery,
})
.then(() => {})
selectType.value = '政务云资源'
tableHeight.value = 600
showMap.value = false
@ -1726,7 +1667,6 @@
'PaaS服务',
'安全服务',
'大数据服务',
'运营服务',
'附加增值服务',
]
} else {
@ -1740,15 +1680,6 @@
wrjFlag.value = false
emits('add', 2)
} else if (name == '视频会议') {
let newQuery = JSON.parse(
JSON.stringify(router.currentRoute.value.query)
)
newQuery.selectType = name
router
.replace({
query: newQuery,
})
.then(() => {})
selectType.value = '视频会议'
tableHeight.value = 600
showMap.value = false
@ -1791,15 +1722,6 @@
pagination.value.current = 1
getSoldierData(indexFather, name)
} else if (name == '城市云脑会客厅') {
let newQuery = JSON.parse(
JSON.stringify(router.currentRoute.value.query)
)
newQuery.selectType = name
router
.replace({
query: newQuery,
})
.then(() => {})
showMap.value = false
dataSource.value = []
dataSource2.value = []
@ -1861,9 +1783,7 @@
clickList.value[indexFather].content = [name]
}
if (!isXiHaiAn) {
getGovernmentCloud(1)
governmentCloud.current = 1
showKey.value++
getGovernmentCloud()
}
}
// labelCode
@ -2222,6 +2142,10 @@
})
}
}
defineExpose({
getCamera,
reSetSearch,
})
//
const addShoppingCart = () => {
if (selectedList.value.length > 0) {
@ -2389,18 +2313,9 @@
} else {
}
}
const governmentCloud = reactive({ data: [], total: 0, current: 1 })
const getGovernmentCloud = (page) => {
let roomStr = router.currentRoute.value.query.str
getPolicyCloudService({
limit: 5,
page: page || 1,
name: roomStr || '',
type: clickList.value[1].content[0],
}).then((res) => {
const getGovernmentCloud = () => {
getPolicyCloudService().then((res) => {
console.log('获取政务云资源======》', res.data.data)
governmentCloud.data = res.data.data.list
governmentCloud.total = res.data.data.total
})
}
// tab
@ -2463,12 +2378,6 @@
message.warning(err)
})
}
defineExpose({
getCamera,
reSetSearch,
getGovernmentCloud,
})
</script>
<style lang="less" scoped>
.infrastructrueBox {

View File

@ -406,160 +406,7 @@
<div class="map-contain" v-if="showMap">
<video-surveillance></video-surveillance>
</div>
<!-- 功能行 -->
<div class="infrastructrue-content" v-if="!wrjFlag">
<!-- 表格数据统计 -->
<div class="contentNum">
<p v-if="selectType !== '视频会议' && isXiHaiAn">
备选
<span>{{ pagination.total || 0 }}</span>
</p>
<p v-if="selectType !== '视频会议' && isXiHaiAn">
已选
<span>{{ selectedRowKeys.length }}</span>
</p>
</div>
<!-- 右侧 -->
<div class="contentRight">
<div class="searchInput" v-if="isXiHaiAn">
<a-input-search
v-model:value="mapSearchParam.cameraName"
placeholder="请输入关键词"
enter-button="搜索"
size="large"
@change="(e) => getCamera(true, e.target.value)"
/>
<a-button
type="primary"
style="width: 0.8rem; height: 0.36rem; margin-left: 0.7rem"
@click="clean"
>
重置
</a-button>
</div>
<i></i>
<!-- 批量预览 -->
<a-button
type="primary"
@click="batchPreview"
class="buttonAdd"
v-if="isXiHaiAn"
>
批量预览
</a-button>
<!-- 添加至申购车 -->
<a-button
v-if="isXiHaiAn"
type="primary"
@click="addShoppingCart"
class="buttonAdd"
>
添加至申购车
</a-button>
<a
style="
display: inline-block;
width: 100px;
height: 36px;
line-height: 36px;
text-align: center;
background: #0558e1;
border-radius: 5px;
font-size: 14px;
color: #fff;
"
v-if="selectType == '视频会议'"
href="/static/download/金宏视频会议系统参会终端(10.1.101.504)_20200211.rar"
>
客户端下载
</a>
<!-- 一键申请 -->
<a-button
v-if="isXiHaiAn"
type="primary"
@click="apply"
class="buttonAdd"
>
一键申请
</a-button>
<a-button v-else type="primary" @click="goToWeb" class="buttonAdd">
<template v-if="selectType == '视频会议'">一键组会</template>
<template v-else>我要申请{{ selectType }}</template>
</a-button>
</div>
</div>
<!-- 表格 -->
<div
class="infrastructrue-table"
v-if="!wrjFlag && selectType !== '视频会议' && isXiHaiAn"
>
<a-table
class="ant-table-striped"
:dataSource="dataSource"
:columns="columns"
:scroll="{ y: tableHeight }"
rowKey="channelId"
:rowClassName="
(record, index) => (index % 2 === 1 ? 'table-striped' : null)
"
:pagination="pagination"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onSelect: onSelectChange,
onSelectAll: onSelectAll,
}"
:loading="loadingCamera"
>
<template #bodyCell="{ column, record }">
<template v-if="isXiHaiAn && column.dataIndex === 'status'">
<span>{{ statusText[record.status] || '' }}</span>
</template>
<template v-if="column.dataIndex === 'operation'">
<!-- 离线 -->
<a v-if="record.status != 1" class="disabled-text">预览</a>
<a-tooltip v-else placement="top">
<template #title>请申请后在我的申请中观看视频!</template>
<a
@click="
openVideo(
record.channelCode ||
record.channelId ||
record.channelCode.channelId,
record
)
"
>
预览
</a>
</a-tooltip>
</template>
</template>
</a-table>
</div>
<div
class="infrastructrue-table"
v-if="!wrjFlag && selectType == '视频会议'"
>
<a-table
class="ant-table-striped"
:dataSource="meetingList"
:columns="meetingColumns"
:scroll="{ y: tableHeight }"
rowKey="key"
:rowClassName="
(record, index) => (index % 2 === 1 ? 'table-striped' : null)
"
:pagination="meetingPagination"
:row-selection="{
selectedRowKeys: meetingSelect.data,
onChange: meetingOnSelectChange,
}"
@change="handleMeeting"
></a-table>
</div>
<!-- 西海岸-无人机单兵设备 -->
<div class="infrastructrue-table" v-else-if="isXiHaiAn && wrjFlag">
<a-table
@ -766,12 +613,24 @@
</template>
</div>
</a-modal>
<!-- 地图上点或者聚合图层点击后出现的操作弹窗 -->
<a-modal
wrapClassName="camera-popup"
v-model:visible="operationPopupFlag"
:width="1000"
:title="'视频监控点选择'"
footer={null}
>
<!--地图上点击之后弹出的操作弹窗-->
<camera-popup-on-map :camera-Data-List="cameraDataList"></camera-popup-on-map>
</a-modal>
</div>
</div>
</template>
<script setup>
import VideoSurveillance from '@/views/home/videoSurveillance'
import GovernmentCloudResources from './components/GovernmentCloudResources'
import CameraPopupOnMap from '@/views/home/videoSurveillance/components/CameraPopupOnMap.vue'
import { useRouter } from 'vue-router'
import { message } from 'ant-design-vue'
import { ref, reactive, onMounted, defineProps, defineExpose } from 'vue'
@ -1014,6 +873,9 @@
let zwy = router.currentRoute.value.query.zwy || ''
// --
let facilitiesType = router.currentRoute.value.query.facilitiesType || ''
//
const cameraDataList = ref([])
onMounted(() => {
console.log('基础设施初始化')
let roomStr = router.currentRoute.value.query.str
@ -1098,6 +960,13 @@
let pointData = new Proxy(point.data, point)
onSelectChange(pointData, !check, '', '', 'proxy')
})
//openOperationPopup
mybus.off('openOperationPopup')
mybus.on('openOperationPopup', (data) => {
//console.log('pppppppppppppp',data);
cameraDataList.value = data;
operationPopupFlag.value = true;
})
})
const selectedList = ref([])
const selectedRowKeys = ref([])
@ -2372,6 +2241,9 @@
message.warning(err)
})
}
//
const operationPopupFlag = ref(false)//
</script>
<style lang="less" scoped>
.infrastructrueBox {
@ -2517,8 +2389,8 @@
.map-contain {
// width: 9.46rem;
height: 4.1rem;
margin-left: 0.16rem;
height: 6.9rem;
margin-left:0;
position: relative;
}
}
@ -2727,6 +2599,16 @@
overflow-y: auto;
}
}
.camera-popup{
.ant-modal-body {
height: 700px !important;
overflow-y: auto;
padding:14px;
}
.ant-modal-footer{
display: none;
}
}
.modalClass {
.ant-modal-body {

View File

@ -0,0 +1,219 @@
<!--点击地图上单个点或者聚合点之后出现的操作弹窗autoplay -->
<template>
<div class="pop-box">
<div class="List-camera-pop">
<a-carousel arrows>
<template #prevArrow>
<div class="custom-slick-arrow" style="left: 10px; z-index: 1">
<left-circle-outlined />
</div>
</template>
<template #nextArrow>
<div class="custom-slick-arrow" style="right: 10px">
<right-circle-outlined />
</div>
</template>
<div
v-for="url in cameraDataList"
:width="800"
:height="400"
:key="url"
:src="url"
>
<!-- <div class="video-content" style=" z-index: 1">
<h5-player :video-url = "videoUrl"></h5-player>
</div> -->
<div style="color:#000000">
<h5-player :video-url = "videoUrl"></h5-player>
</div>
<div>
<a-button type="primary" @click="applyNow(url)">立即申请</a-button>
<a-button type="primary" style="margin-left:20px" @click="addIntoCart(url)">加入申购车</a-button>
</div>
<!-- <div class="footer-button">
<a-button type="primary">立即申请</a-button>
<a-button type="primary" style="margin-left:20px">加入申购车</a-button>
</div> -->
</div>
</a-carousel>
<!-- -->
</div>
</div>
</template>
<script>
// import VideoPlay from '@/views/videoPlay/index.vue'
// import 'viewerjs/dist/viewer.css'
// import { directive as viewer } from "v-viewer"
import {
LeftCircleOutlined,
RightCircleOutlined,
} from '@ant-design/icons-vue'
import H5Player from '@/views/home/components/H5Player.vue'
import mybus from '@/myplugins/mybus'
import { getStreamByChannelCode } from '@/api/videoSurveillance'
export default {
name: '',
components: {
// VideoPlay,
H5Player,
LeftCircleOutlined,
RightCircleOutlined
},
props: {
cameraDataList: {
type: Object,
default: () => {
return {}
},
},
},
mounted() {},
// directives: {
// viewer: viewer({
// debug: true,
// }),
// },
data() {
return {
openVideo: false,
videoStream: '',
videoUrl:'' //url
}
},
methods: {
openCurrentVideo(channelCode) {
bus.$emit('openCurrentVideoSurveillance', channelCode)
},
show() {
const viewer = this.$el.querySelector('.images').$viewer
viewer.show()
},
//
applyNow(item){
console.log('applyNowapplyNow',item);
mybus.emit('selectCamera', item)
},
//
addIntoCart(item){
console.log('addIntoCartaddIntoCart',item);
mybus.emit('selectCamera', item)
}
},
}
</script>
<style lang="less" scoped>
.List-camera-pop {
// width: 640px;
// height: 320px;
//background-color: #193059;
font-size: 16px;
padding-bottom: 20px;
display: flex;
flex-direction: column;
.content {
// width: 280px;
min-height: 100px;
padding: 20px;
display: flex;
flex-wrap: wrap;
.green-cicle {
width: 18px;
height: 18px;
background-color: rgba(0, 218, 128, 0.4);
border-radius: 50%;
position: relative;
div {
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #00da80;
position: absolute;
left: 50%;
top: 50%;
margin-left: -5px;
margin-top: -5px;
}
}
b {
color: #fff;
}
p {
color: #1eacd6;
}
}
.images {
width: 290px;
height: 160px;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
.button {
width: 80px;
height: 28px;
line-height: 28px;
text-align: center;
background-color: #2fe2ed;
border-radius: 4px;
margin: 8px auto 0;
cursor: pointer;
}
.ant-carousel {
width: 960px;
//height: 700px;
margin-left: 8px;
}
.ant-carousel :deep(.slick-slide) {
text-align: center;
height: 650px;
line-height: 200px;
//background: #ccc;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.ant-carousel :deep(.slick-arrow.custom-slick-arrow) {
width: 50px;
height: 50px;
font-size: 50px;
color: #fff;
background-color: rgba(31, 45, 61, 0.11);
opacity: 0.8;
z-index: 1;
}
.ant-carousel :deep(.custom-slick-arrow:before) {
display: none;
}
.ant-carousel :deep(.custom-slick-arrow:hover) {
opacity: 1;
}
.ant-carousel :deep(.slick-slide h3) {
color: #fff;
}
.ant-carousel :deep(.slick-dots) {
display: none !important;
}
.video-content{
width: 950px;
height:600px;
text-align: left;
padding: 5px;
}
.footer-button{
width: 950px;
height:50px;
text-align: center;
padding-top:20px;
}
}
// .current-video {
// width: 320px;
// height: 180px;
// }
</style>

View File

@ -8,7 +8,23 @@
</div>
<div class="searchPoint">
<!-- 第一版 -->
<el-autocomplete
v-model="address"
placeholder="请输入地址"
:fetch-suggestions="
(queryString, cb) => {
searchAddressByKeyWord(queryString, cb, i)
}
"
:trigger-on-focus="false"
:popper-append-to-body="false"
class="address-auto-complete-input"
@select="
(addressItem) => {
selectedAddress(addressItem, i)
}
"
/>
<!-- <el-autocomplete
class="inline-input"
prefix-icon="Search"
@ -30,37 +46,6 @@
</template>
<template v-slot:append>搜索</template>
</el-autocomplete> -->
<!-- 第二版 -->
<el-select class="input-with-select" v-model="addressType" style="width: 115px" @change="address=''">
<el-option label="兴趣点" value="1" />
<el-option label="点位" value="2" />
</el-select>
<el-input
v-if="addressType==1"
v-model="address"
placeholder="请输入关键词"
class="input-with-select"
@keyup.enter="handleEnter"
>
</el-input>
<el-autocomplete
v-else-if="addressType==2"
v-model="address"
placeholder="请输入地址"
:fetch-suggestions="
(queryString, cb) => {
searchAddressByKeyWord(queryString, cb, i)
}
"
:trigger-on-focus="false"
:popper-append-to-body="false"
class="address-auto-complete-input"
@select="
(addressItem) => {
selectedAddress(addressItem, i)
}
"
/>
</div>
<svg
t="1656319660834"
@ -92,7 +77,6 @@
</template>
<script>
import { ElMessage } from 'element-plus'
import { message } from 'ant-design-vue'
import { HieimpMap } from '@/supermap/map-init'
import TiledMap from './components/tiledMap'
@ -108,7 +92,7 @@ import { ElMessage } from 'element-plus'
selectByLabelName,
selectByChannelName,
} from '@/api/videoSurveillance'
import { getCameraByCondition,getListForPOI } from '@/api/file'
import { getCameraByCondition } from '@/api/file'
import mybus from '@/myplugins/mybus'
import * as turf from '@turf/turf';
@ -134,7 +118,6 @@ import { ElMessage } from 'element-plus'
areaModeFlag: false,
addressMatchUrl: '',
address: '',
addressType:'1',
whoShow1: whoShow,
mapSearchParam: {
//
@ -173,13 +156,15 @@ import { ElMessage } from 'element-plus'
//
this.initAddressMatchService()
this.getCameraAllLabel()
//
// this.getCameraAllPage()
// ,
this.getCameraAllPage()
// this.getMapPoint()
// parentId
// parentId
mybus.off('getCameraByParentId')
mybus.on('getCameraByParentId', (parentId) => {
this.mapSearchParam.parentId = parentId
this.mapSearchParam.type = "1"
this.mapSearchParam.pageSize = 10000
this.getCameraByParentId()
})
//
@ -196,33 +181,14 @@ import { ElMessage } from 'element-plus'
}
//this.addResourceTomap('videoMap', this.pointAllData);
})
//
mybus.off('cameraDataOnMap')
mybus.on('cameraDataOnMap', (data) => {
this.addResourceTomap('videoMap', data)
})
},
methods: {
//
handleEnter(){
console.log('查询',this.address,this.addressType)
if(this.address){
getListForPOI({keywords:this.address}).then(res => {
console.log('POI=========>',res.data.data)
if(res.data.data.rows[0]){
let arr = res.data.data.rows[0].location.split(',')
this.selectedAddress({location:{y:arr[1],x:arr[0]}})
}else{
ElMessage({
showClose: true,
message: '未查询到兴趣点!',
type: 'warning',
})
}
})
}else{
ElMessage({
showClose: true,
message: '请输入兴趣点!',
type: 'warning',
})
}
},
selectedAddress(item, index) {
//
console.log('跳转', item)
@ -313,14 +279,14 @@ import { ElMessage } from 'element-plus'
})
},
getCameraByParentId(type) {
debugger
if (!this.whoShow1.itShowXiHaiAn) {
debugger
getCameraByParentId(this.mapSearchParam).then((res) => {
debugger
console.log('根据parent查询摄像头', res.data.data)
this.addResourceTomap('videoMap', res.data.data)
})
} else {
console.log('根据parent查询摄像头111111',this.mapSearchParam)
let params = {
regionId:
this.mapSearchParam.parentId ||
@ -349,8 +315,9 @@ import { ElMessage } from 'element-plus'
}
}
}
params.type='0';
getCameraByCondition(params).then((res) => {
console.log('根据parent查询摄像头', res.data.data)
//console.log('parent44444', res.data.data)
if(type=='map'){
let params = this.mapSearchParam;
params.dataSource = res.data.data||0;
@ -358,10 +325,12 @@ import { ElMessage } from 'element-plus'
mybus.emit('getListByMap', params);
}
this.pointAllData = res.data.data;
if(this.mapSearchParam.type!=0)
if(this.mapSearchParam.type!=0){
this.addResourceTomap('videoMap', res.data.data)
}
else
this.addResourceTomap('videoMap', []) //
{this.addResourceTomap('videoMap', []) } //}
})
}
},
@ -460,14 +429,16 @@ import { ElMessage } from 'element-plus'
},
getCameraAllPage(page) {
let params = {
name: '',
page: page,
pageSize: 20000,
}
getCameraAll(params).then((res) => {
regionId: "70be8c5b664f4bcf869d82f2e8335051",
pageNum: "1",
pageSize: 30000,
type: 0,
borderPolygonList: []
}
getCameraByCondition(params).then((res) => {
// let t1 = new Date().getTime();
// this.cameraAllData = res.data.data
this.addResourceTomap('videoMap', res.data)
this.addResourceTomap('videoMap', res.data.data)
// let t2 = new Date().getTime();
// console.log("#############" + (t2 - t1));
})
@ -505,6 +476,7 @@ import { ElMessage } from 'element-plus'
},
addResourceTomap(type, data) {
console.log('datadatadata',data);
const dataEvent = []
if(data&&data.length>0){
data.forEach((item) => {
@ -523,7 +495,7 @@ import { ElMessage } from 'element-plus'
this.getMapPoint(dataEvent, 'icon_camare.png', type)
},
getMapPoint(data, img, type) {
// this.hiMapFun.clearAllLayers();
this.hiMapFun.clearAllLayers();
const features = data
// debugger
this.hiMapFun.addResourceOnMapWithoutSuperMapCluster(
@ -708,14 +680,6 @@ import { ElMessage } from 'element-plus'
z-index: 988;
cursor: pointer;
}
.input-with-select{
width: 2.4rem;
svg{
position: relative;
bottom: 0;
right: 0;
}
}
.icon-poylon {
width: 0.46rem;
bottom: 0.6rem;