Merge branch 'hi-ucs-dev' into release
# Conflicts: # back/public/config/basicConfig.js # front/public/static/config/basicConfig.js # front/src/App.vue
This commit is contained in:
commit
a88baa4eac
|
@ -2,7 +2,7 @@
|
|||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2022-08-25 14:37:49
|
||||
* @LastEditors: Light
|
||||
* @LastEditTime: 2022-10-27 10:52:02
|
||||
* @LastEditTime: 2022-11-24 09:10:10
|
||||
* @Description: 告诉大家这是什么
|
||||
*/
|
||||
var _global = {}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
display: table-cell !important;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
/* .el-button {
|
||||
vertical-align: middle !important;
|
||||
align-items: center !important;
|
||||
display: inline-flex !important;
|
||||
|
@ -25,8 +25,8 @@
|
|||
justify-content: center !important;
|
||||
min-width: 80px !important;
|
||||
border-radius:2px !important;
|
||||
}
|
||||
.el-button--primary {
|
||||
} */
|
||||
/* .el-button--primary {
|
||||
vertical-align: middle !important;
|
||||
align-items: center !important;
|
||||
display: inline-flex !important;
|
||||
|
@ -35,7 +35,7 @@
|
|||
justify-content: center !important;
|
||||
min-width: 80px !important;
|
||||
border-radius:2px !important;
|
||||
}
|
||||
} */
|
||||
</style>
|
||||
<script>
|
||||
import Cookies from 'js-cookie'
|
||||
|
|
|
@ -138,6 +138,28 @@ img {
|
|||
color: $--color-text-secondary;
|
||||
}
|
||||
// 按钮
|
||||
.el-button--primary {
|
||||
border-radius: 2px;
|
||||
// vertical-align: middle !important;
|
||||
// align-items: center !important;
|
||||
// display: inline-flex !important;
|
||||
// height:32px !important;
|
||||
// line-height: 32px !important;
|
||||
// justify-content: center !important;
|
||||
// min-width: 80px !important;
|
||||
// border-radius:2px !important;
|
||||
}
|
||||
// .el-button--primary {
|
||||
// vertical-align: middle !important;
|
||||
// align-items: center !important;
|
||||
// display: inline-flex !important;
|
||||
// height:32px !important;
|
||||
// line-height: 32px !important;
|
||||
// justify-content: center !important;
|
||||
// min-width: 80px !important;
|
||||
// border-radius:2px !important;
|
||||
// }
|
||||
|
||||
.aui-button--dashed {
|
||||
border-style: dashed;
|
||||
&:focus,
|
||||
|
@ -253,6 +275,7 @@ img {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* Navbar
|
||||
------------------------------ */
|
||||
.aui-navbar {
|
||||
|
|
|
@ -157,6 +157,13 @@
|
|||
@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
|
||||
>
|
||||
|
@ -256,6 +263,7 @@ export default {
|
|||
mixins: [mixinViewModule],
|
||||
data () {
|
||||
return {
|
||||
superAdmin: '',
|
||||
required: ['归属部门', '部门联系人', '部门联系人电话', '应用领域', '共享条件', '算法名称', '算法描述', '图层名称', '图层描述', '组件名称', '组件描述', '组件地址', '服务地址', '服务接口', '接口请求方式', '算法类别'],
|
||||
notFilled: [],
|
||||
insertList: [],
|
||||
|
@ -317,6 +325,10 @@ 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)
|
||||
|
@ -671,6 +683,31 @@ 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 = []
|
||||
|
|
|
@ -145,6 +145,13 @@
|
|||
@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
|
||||
>
|
||||
|
@ -234,6 +241,7 @@ export default {
|
|||
mixins: [mixinViewModule],
|
||||
data () {
|
||||
return {
|
||||
superAdmin: '',
|
||||
required: ['归属部门', '部门联系人', '部门联系人电话', '应用领域', '共享条件', '应用名称', '应用描述', '应用类型'],
|
||||
notFilled: [],
|
||||
mixinViewModuleOptions: {
|
||||
|
@ -286,6 +294,10 @@ 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)
|
||||
|
@ -522,6 +534,31 @@ 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 = '基础设施'
|
||||
|
|
|
@ -1,30 +1,19 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="container">
|
||||
|
||||
|
||||
<el-form :inline="true">
|
||||
<!--起始日期 @keyup.enter.native="getDataList()"-->
|
||||
<!--能力上架统计1 能力使用统计 2-->
|
||||
<el-form :inline="true" v-if="this.departmentId === 1 || this.departmentId === 2">
|
||||
<!--日期-->
|
||||
<el-form-item>
|
||||
<span>日期:</span>
|
||||
<el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<!--审核状态-->
|
||||
<el-form-item v-if="this.departmentId === 3 || this.departmentId === 4">
|
||||
<span>审核状态:</span>
|
||||
<el-select v-model="examineStatus" placeholder="请选审核状态" clearable>
|
||||
<el-option label="全部" value="-1"></el-option>
|
||||
<el-option label="审核中" value="0"></el-option>
|
||||
<el-option label="通过" value="1"></el-option>
|
||||
<el-option label="不通过" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!--部门-->
|
||||
|
||||
<!--上架部门-->
|
||||
<el-form-item>
|
||||
<span v-if="this.departmentId === 1 || this.departmentId === 3">上架部门:</span>
|
||||
<span v-if="this.departmentId === 1 ">上架部门:</span>
|
||||
<span v-else>申请部门:</span>
|
||||
<el-select v-model="abilityDepartment" placeholder="请选择部门" filterable clearable>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
|
@ -33,33 +22,9 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!--类型-->
|
||||
<el-form-item v-if="this.departmentId === 3 || this.departmentId === 4">
|
||||
<span>类型:</span>
|
||||
<el-select @change="changeIiem" v-if="this.departmentId === 2 || this.departmentId === 4" v-model="abilityType" placeholder="请选择类型" clearable>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, i) in typeOptions" :key="`${item.name}${i}`" :label="item.name" :value="item.name"
|
||||
v-bind="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select @change="changeIiem" v-else v-model="abilityType" placeholder="请选择类型" clearable>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, i) in typeOptions1" :key="`${item.name}${i}`" :label="item.name" :value="item.name"
|
||||
v-bind="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!--资源名称 仅明细添加-->
|
||||
|
||||
<el-form-item v-if="this.departmentId === 3 || this.departmentId === 4">
|
||||
<span>名称:</span>
|
||||
<!-- <span v-if="this.departmentId === 2 || this.departmentId === 4">资源名称:</span> -->
|
||||
<el-input style="width:80%;" v-model="resourceName" placeholder="请输入资源名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form :inline="true" style="margin-right: 40px;">
|
||||
<!--操作按钮查询-->
|
||||
<!--操作按钮查询-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">{{ $t('query') }}</el-button>
|
||||
</el-form-item>
|
||||
<!--操作按钮重置-->
|
||||
<el-form-item>
|
||||
|
@ -71,16 +36,98 @@
|
|||
<a class='export'
|
||||
:href="exportExcel + exportExcelType + '?' + exportExcelCondition + '&token=' + token">导出全部</a>
|
||||
</el-form>
|
||||
|
||||
<!--能力上架明细3 能力使用明细 4-->
|
||||
<div v-else>
|
||||
<el-form :inline="true" >
|
||||
<!--日期-->
|
||||
<el-form-item>
|
||||
<span>日期:</span>
|
||||
<el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<!--审核状态-->
|
||||
<el-form-item v-if="this.departmentId === 3 || this.departmentId === 4">
|
||||
<span>审核状态:</span>
|
||||
<el-select v-model="examineStatus" placeholder="请选审核状态" clearable>
|
||||
<el-option label="全部" value="-1"></el-option>
|
||||
<el-option label="审核中" value="0"></el-option>
|
||||
<el-option label="通过" value="1"></el-option>
|
||||
<el-option label="不通过" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!--上架部门-->
|
||||
<el-form-item>
|
||||
<span v-if=" this.departmentId === 3">上架部门:</span>
|
||||
<span v-else>申请部门:</span>
|
||||
<el-select v-model="abilityDepartment" placeholder="请选择部门" filterable clearable>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="item in departmentSelects" :key="item.label" :label="item.label" :value="item.value"
|
||||
v-bind="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!--能力使用统计明细--添加提供部门-->
|
||||
|
||||
<el-form-item v-if=" this.departmentId === 4">
|
||||
<span >提供部门:</span>
|
||||
<el-select v-model="provideDepartment" placeholder="请选择部门" filterable clearable>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="item in provideSelects" :key="item.label" :label="item.label" :value="item.value"
|
||||
v-bind="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
|
||||
<el-form :inline="true" >
|
||||
<!--资源类型-->
|
||||
<el-form-item >
|
||||
<span>资源类型:</span>
|
||||
<el-select @change="changeIiem" v-if="this.departmentId === 4" v-model="abilityType" placeholder="请选择资源类型" clearable>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, i) in typeOptions" :key="`${item.name}${i}`" :label="item.name" :value="item.name"
|
||||
v-bind="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select @change="changeIiem" v-else v-model="abilityType" placeholder="请选择资源类型" clearable>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option v-for="(item, i) in typeOptions1" :key="`${item.name}${i}`" :label="item.name" :value="item.name"
|
||||
v-bind="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!--资源名称 仅明细添加-->
|
||||
|
||||
<el-form-item >
|
||||
<span>资源名称:</span>
|
||||
<el-input style="width:70%;" v-model="resourceName" placeholder="请输入资源名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!--操作按钮查询-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">{{ $t('query') }}</el-button>
|
||||
</el-form-item>
|
||||
<!--操作按钮重置-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetDataList()">{{
|
||||
$t('reset')
|
||||
}}</el-button>
|
||||
</el-form-item>
|
||||
<!-- 导出 -->
|
||||
<a class='export'
|
||||
:href="exportExcel + exportExcelType + '?' + exportExcelCondition + '&token=' + token">导出全部</a>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
|
||||
<el-card shadow="never" class="aui-card--fill" v-if="homeIsShow">
|
||||
<div class="mod-demand__bsdemand">
|
||||
<!-- <div class='top-box'>
|
||||
<span class='title'>能力统计</span>
|
||||
<div class='title-list-style'>
|
||||
<div v-for="(item,index) in titleList" :key='index' class='title-single' :class="{'choseStyle':choseId=== index}" @click="choseBtn(index)">
|
||||
<span class='box-style'>{{item.name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="second-title">
|
||||
<span style="margin-right: 30px" :class="[
|
||||
|
@ -220,6 +267,7 @@ export default {
|
|||
data () {
|
||||
return {
|
||||
checked: false,
|
||||
provideSelects:[],
|
||||
departmentSelects: [],
|
||||
exportExcel: CONFIGITEM.configData[CONFIGITEM.version].apiURL + '/census/center/export',
|
||||
exportExcelCondition: '',
|
||||
|
@ -325,7 +373,8 @@ export default {
|
|||
examineStatus: '-1', // 审核状态
|
||||
status: '',
|
||||
value1: [], // 起始时间
|
||||
abilityDepartment: '', // 部门
|
||||
abilityDepartment: '', // 上架部门或申请部门
|
||||
provideDepartment:'',//提供部门
|
||||
abilityType: '', // 能力
|
||||
beginTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
|
@ -353,10 +402,11 @@ export default {
|
|||
},
|
||||
created () {
|
||||
this.$http.get('/sys/dept/all').then(res => {
|
||||
// console.log('获取部门=========>', res)
|
||||
this.departmentSelects = []
|
||||
this.provideSelects = []
|
||||
res.data.data.map(val => {
|
||||
this.departmentSelects.push({ label: val.name, value: val.id })
|
||||
this.provideSelects.push({ label: val.name, value: val.name })
|
||||
})
|
||||
})
|
||||
// 当前设定的日期时间
|
||||
|
@ -668,7 +718,7 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
// 能力使用明细 能力使用统计
|
||||
// 能力使用明细
|
||||
getTwoDetail (page) {
|
||||
var passAndReview = '' // 转变"通过"字段为通过
|
||||
if (this.examineStatus == '-1') {
|
||||
|
@ -682,6 +732,7 @@ export default {
|
|||
} else {
|
||||
this.status = this.examineStatus
|
||||
}
|
||||
|
||||
this.$http
|
||||
.get('/census/center/selectCensusApplyTable', {
|
||||
params: {
|
||||
|
@ -692,7 +743,9 @@ export default {
|
|||
type: this.abilityType,
|
||||
startDate: this.startDate,
|
||||
endDate: this.endDate,
|
||||
resourceName: this.resourceName
|
||||
resourceName: this.resourceName,
|
||||
provideDept:this.provideDepartment
|
||||
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
|
@ -704,7 +757,8 @@ export default {
|
|||
deptId: this.abilityDepartment,
|
||||
startDate: this.startDate,
|
||||
endDate: this.endDate,
|
||||
resourceName: this.resourceName
|
||||
resourceName: this.resourceName,
|
||||
provideDept:this.provideDepartment
|
||||
})
|
||||
})
|
||||
},
|
||||
|
@ -794,18 +848,8 @@ export default {
|
|||
this.choseId = index
|
||||
this.handleChose(1)
|
||||
},
|
||||
// choseBtn(index){
|
||||
// this.choseId=index
|
||||
// if (index===0){
|
||||
// this.homeIsShow=false
|
||||
// this.servicesIsShow=true
|
||||
// } else if(index===1){
|
||||
// this.homeIsShow=false
|
||||
// this.servicesIsShow=false
|
||||
// this.resourcesIsShow=true
|
||||
// }
|
||||
// },
|
||||
// 选择发布or使用表格
|
||||
|
||||
// 根据不同的type查询不同的表格数据
|
||||
handleChose (index) {
|
||||
this.checked = false
|
||||
this.departmentId = index
|
||||
|
@ -819,7 +863,7 @@ export default {
|
|||
this.exportExcelType = 'SelectDeptDetailTypeCountList'
|
||||
this.getFirstTree()
|
||||
} else if (this.choseId === 1) {
|
||||
// this.getReleaseTree()
|
||||
|
||||
}
|
||||
} else if (index === 2) {
|
||||
if (this.choseId === 0) {
|
||||
|
@ -829,7 +873,7 @@ export default {
|
|||
this.exportExcelType = 'SelectApplyDeptDetailTypeCountList'
|
||||
this.getSecondTree()
|
||||
} else {
|
||||
// this.getUsedTree()
|
||||
|
||||
}
|
||||
} else if (index === 3) {
|
||||
this.detailFlag = false
|
||||
|
@ -837,7 +881,7 @@ export default {
|
|||
this.exportExcelType = 'SelectCensusResourceTable'
|
||||
this.getOneDetail()
|
||||
} else {
|
||||
// this.getUsedTree()
|
||||
|
||||
}
|
||||
} else if (index === 4) {
|
||||
this.detailFlag = false
|
||||
|
@ -845,7 +889,7 @@ export default {
|
|||
this.exportExcelType = 'SelectCensusApplyTable'
|
||||
this.getTwoDetail()
|
||||
} else {
|
||||
// this.getUsedTree()
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -942,8 +986,10 @@ export default {
|
|||
this.endDate = ''
|
||||
this.examineStatus = ''
|
||||
this.abilityDepartment = ''
|
||||
this.provideDepartment=''
|
||||
this.abilityType = ''
|
||||
this.approveStatus = ''
|
||||
this.resourceName=''
|
||||
this.exportExcelCondition = qs.stringify({
|
||||
approveStatus: this.status,
|
||||
deptId: this.abilityDepartment,
|
||||
|
@ -951,26 +997,14 @@ export default {
|
|||
endDate: this.endDate,
|
||||
resourceName: this.resourceName
|
||||
})
|
||||
if (this.departmentId === 1) {
|
||||
// if (this.detailFlag) {
|
||||
// this.handleChose(3)
|
||||
// this.detailFlag = !this.detailFlag
|
||||
// } else {
|
||||
if (this.departmentId === 1) {//能力上架统计
|
||||
this.handleChose(1)
|
||||
// this.detailFlag = !this.detailFlag
|
||||
// }
|
||||
// this.departmentId = 1;
|
||||
} else if (this.departmentId === 2) {
|
||||
// if (this.detailFlag) {
|
||||
// this.handleChose(4)
|
||||
// this.detailFlag = !this.detailFlag
|
||||
// } else {
|
||||
} else if (this.departmentId === 2) {//能力使用统计
|
||||
this.handleChose(2)
|
||||
// this.detailFlag = !this.detailFlag
|
||||
// }
|
||||
} else if (this.departmentId === 3) {
|
||||
|
||||
} else if (this.departmentId === 3) {//能力上架明细
|
||||
this.handleChose(3)
|
||||
} else {
|
||||
} else {//能力使用明细
|
||||
this.handleChose(4)
|
||||
}
|
||||
},
|
||||
|
@ -1160,16 +1194,13 @@ input::placeholder {
|
|||
}
|
||||
|
||||
.export {
|
||||
margin-top: 6px;
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
border: 2px solid #dcdfe6;
|
||||
color: #000;
|
||||
color: #fff;
|
||||
background-color: #0058e1;
|
||||
border-color: #0058e1;
|
||||
|
|
|
@ -245,8 +245,10 @@ export default {
|
|||
// 同意与退回
|
||||
agreeOrNot: debounce(
|
||||
function (data, type) {
|
||||
|
||||
this.dataForm.taskId = this.$route.params.taskId
|
||||
if (type === '同意') {
|
||||
debugger
|
||||
// if (this.input !== '') {
|
||||
console.log('this.dataForm', this.dataForm)
|
||||
const params = qs.stringify({
|
||||
|
@ -264,7 +266,7 @@ export default {
|
|||
}
|
||||
return
|
||||
}
|
||||
bus.$emit('AbilityResourcesRemovedInit')
|
||||
bus.$emit('applicationforRequirementsInit')
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
|
@ -299,7 +301,7 @@ export default {
|
|||
}
|
||||
return
|
||||
}
|
||||
bus.$emit('AbilityResourcesRemovedInit')
|
||||
bus.$emit('applicationforRequirementsInit')
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
|
|
|
@ -0,0 +1,366 @@
|
|||
<!--
|
||||
* @Author: hisense.guoyue
|
||||
* @LastEditors: hisense.guoyue
|
||||
* @LastEditTime: 2022-09-27 14:23:29
|
||||
* @Description: 资金报表
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill" style="position: relative">
|
||||
<div>
|
||||
<div
|
||||
style="
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 14px;
|
||||
color:#0058e1;
|
||||
"
|
||||
>
|
||||
累计节省财政资金约{{ saveMoney }}万元
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
|
||||
margin-bottom: 14px;
|
||||
"
|
||||
>
|
||||
注:资源参考价格由部门提供或参考市场价格设定
|
||||
</div>
|
||||
</div>
|
||||
<el-form :inline="true">
|
||||
<!--日期-->
|
||||
<el-form-item>
|
||||
<span>日期:</span>
|
||||
<el-date-picker
|
||||
v-model="dateList"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<!--提供部门 传id-->
|
||||
|
||||
<el-form-item>
|
||||
<span>提供部门:</span>
|
||||
<el-select
|
||||
v-model="dataForm.provideDept"
|
||||
placeholder="请选择提供部门"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
v-for="item in offerDepartSelects"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-bind="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!--申请部门 传汉字-->
|
||||
|
||||
<el-form-item>
|
||||
<span>申请部门:</span>
|
||||
<el-select
|
||||
v-model="dataForm.applyDept"
|
||||
placeholder="请选择申请部门"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
v-for="item in applyDepartSelects"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-bind="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!--资源类型-->
|
||||
<el-form-item>
|
||||
<span>资源类型:</span>
|
||||
<el-select
|
||||
@change="changeIiem"
|
||||
v-model="dataForm.resourceType"
|
||||
placeholder="请选择资源类型"
|
||||
clearable
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
v-for="(item, i) in typeOptions"
|
||||
:key="`${item.name}${i}`"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
v-bind="item"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<el-form :inline="true">
|
||||
<!--审核状态-->
|
||||
<el-form-item>
|
||||
<span>审核状态:</span>
|
||||
<el-select v-model="dataForm.applyResult" placeholder="请选审核状态" clearable>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option label="通过" value="通过"></el-option>
|
||||
<el-option label="审核中" value="审核中"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!--资源名称-->
|
||||
<el-form-item>
|
||||
<span>资源名称:</span>
|
||||
<el-input
|
||||
style="width: 70%"
|
||||
v-model="dataForm.resourceName"
|
||||
placeholder="请输入资源名称"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!--操作按钮查询-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="init()">{{
|
||||
$t("query")
|
||||
}}</el-button>
|
||||
</el-form-item>
|
||||
<!--操作按钮重置-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetDataList()">{{
|
||||
$t("reset")
|
||||
}}</el-button>
|
||||
</el-form-item>
|
||||
<a
|
||||
class="export"
|
||||
:href="
|
||||
exportExcel +
|
||||
'?' +
|
||||
exportExcelCondition +
|
||||
'&token=' +
|
||||
token
|
||||
"
|
||||
>导出全部</a
|
||||
>
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
|
||||
<div class="mod-activiti__process">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:header-cell-style="{ textAlign: 'center', height: '40px' }"
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column width="80px" label="序号" align="center">
|
||||
<template slot-scope="scop">
|
||||
{{scop.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="resourceName"
|
||||
label="资源名称"
|
||||
header-align="center"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="resourceType"
|
||||
label="资源类型"
|
||||
header-align="center"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="applyResult"
|
||||
label="审核状态"
|
||||
header-align="center"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="provideDept"
|
||||
label="提供部门"
|
||||
header-align="center"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="applyDept"
|
||||
label="申请部门"
|
||||
header-align="center"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="applyDate"
|
||||
label="申请时间"
|
||||
header-align="center"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="applyPrice"
|
||||
label="参考价格(元)"
|
||||
header-align="center"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
<div class="block" >
|
||||
<el-pagination
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
:page-size="pageSize"
|
||||
:current-page="currentPage"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import Cookies from 'js-cookie'
|
||||
import qs from 'qs'
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
exportExcelCondition:'',
|
||||
token: Cookies.get('ucsToken'),
|
||||
//导出全部
|
||||
exportExcel: CONFIGITEM.configData[CONFIGITEM.version].apiURL + '/processForm/tabilityapplication/exportFundStatementTable',
|
||||
saveMoney: 0.0,
|
||||
offerDepartSelects: [],
|
||||
applyDepartSelects: [],
|
||||
typeOptions: [
|
||||
{ name: "智能算法", value: 1 },
|
||||
{ name: "图层服务", value: 2 },
|
||||
{ name: "开发组件", value: 3 },
|
||||
{ name: "业务组件", value: 4 },
|
||||
{ name: "应用资源", value: 5 },
|
||||
{ name: "会客厅", value: 6 },
|
||||
], // 类型备选列表
|
||||
tableData: [],
|
||||
dateList: [],//时间
|
||||
dataForm: {
|
||||
// date: '',
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
provideDept: "",
|
||||
applyDept: "",
|
||||
resourceType: "",
|
||||
resourceName: "",
|
||||
applyResult:"通过",
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
},
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
if (this.dateList && this.dateList.length > 0) {
|
||||
this.dataForm.startDate = this.dateList[0];
|
||||
this.dataForm.endDate = this.dateList[1];
|
||||
} else {
|
||||
this.dataForm.startDate = "";
|
||||
this.dataForm.endDate = "";
|
||||
}
|
||||
|
||||
this.dataForm.pageNum=this.currentPage
|
||||
let params = this.dataForm;
|
||||
this.$http
|
||||
.get("/processForm/tabilityapplication/getFundStatement/", {
|
||||
params,
|
||||
})
|
||||
.then((res) => {
|
||||
this.tableData = res.data.data.list;
|
||||
let price=Number(res.data.data.totalPrice);
|
||||
price=price/ 10000;
|
||||
this.saveMoney=price.toFixed(1)
|
||||
this.total=Number(res.data.data.total);
|
||||
this.exportExcelCondition = qs.stringify(this.dataForm)
|
||||
})
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.currentPage = val;
|
||||
this.init();
|
||||
},
|
||||
resetDataList() {
|
||||
this.dateList = [];
|
||||
this.dataForm.startDate = "";
|
||||
this.dataForm.endDate = "";
|
||||
this.dataForm.resourceType = "";
|
||||
this.dataForm.resourceName = "";
|
||||
this.dataForm.applyDept = "";
|
||||
this.dataForm.provideDept = "";
|
||||
this.dataForm.applyResult="";
|
||||
this.currentPage = 1;
|
||||
this.init();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
created() {
|
||||
this.$http.get("/sys/dept/all").then((res) => {
|
||||
this.applyDepartSelects = [];
|
||||
this.offerDepartSelects = [];
|
||||
res.data.data.map((val) => {
|
||||
this.applyDepartSelects.push({ label: val.name, value: val.name });
|
||||
this.offerDepartSelects.push({ label: val.name, value: val.id });
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.demand-text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.area-text {
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.tooltip-box {
|
||||
width: 400px;
|
||||
}
|
||||
.export {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
color: #fff;
|
||||
background-color: #0058e1;
|
||||
border-color: #0058e1;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.export:hover {
|
||||
background: #65a5f9;
|
||||
border-color: #65a5f9;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -128,6 +128,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import bus from '@/views/bus.js'
|
||||
import mixinViewModule from '@/mixins/view-module'
|
||||
import processModule from '@/mixins/process-module'
|
||||
export default {
|
||||
|
@ -153,7 +154,6 @@ export default {
|
|||
methods: {
|
||||
// 处理
|
||||
taskHandle (row) {
|
||||
console.log('row======================>', row, this.forwardHandleUrl)
|
||||
if (!row.businessKey) {
|
||||
return this.$message.error(this.$t('task.businessKeyError'))
|
||||
}
|
||||
|
@ -165,6 +165,13 @@ export default {
|
|||
}
|
||||
this.getProcDefRouteSet(row, this.forwardTaskDetail)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
bus.$off('applicationforRequirementsInit')
|
||||
bus.$on('applicationforRequirementsInit', () => {
|
||||
this.getDataList()
|
||||
bus.$emit('updateTaskNum')
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -415,11 +415,8 @@ export default {
|
|||
// 同意与退回
|
||||
agreeOrNot: debounce(
|
||||
function (data, type) {
|
||||
// console.log('datadata',data);
|
||||
// console.log('tttttt',type);
|
||||
// if (type === '同意') {
|
||||
if (this.input !== '') {
|
||||
console.log('this.dataForm', this.dataForm)
|
||||
if (type === '同意') {
|
||||
|
||||
const params = qs.stringify({
|
||||
taskId: this.dataForm.taskId,
|
||||
comment: this.input || '同意'
|
||||
|
|
|
@ -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>
|
|
@ -1,13 +1,8 @@
|
|||
/*
|
||||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2020-07-07 16:03:23
|
||||
<<<<<<< HEAD
|
||||
* @LastEditors: Light
|
||||
* @LastEditTime: 2022-11-15 10:30:01
|
||||
=======
|
||||
* @LastEditors: Light
|
||||
* @LastEditTime: 2022-11-14 18:00:12
|
||||
>>>>>>> hi-ucs-dev
|
||||
* @LastEditTime: 2022-11-24 09:11:58
|
||||
* @Description: 系统静态参数配置
|
||||
*/
|
||||
var _global = {}
|
||||
|
@ -73,6 +68,8 @@ var CONFIGITEM = {
|
|||
cameraUrl: '192.168.124.236:9537', // 远雄(不挂vpn可直接连)
|
||||
},
|
||||
backUrl: 'http://10.134.135.9:9797',
|
||||
// apiURL: 'http://10.134.135.92:8888/renren-admin',
|
||||
apiURL: 'http://192.168.124.233:8888/ucs-admin',
|
||||
previewUrl: 'http://10.134.135.9:9796/',
|
||||
// websocketURL: '10.134.135.9:8888/ucs-admin', // 正式环境
|
||||
// websocketURL: '10.134.135.92:8888/ucs-admin', // 测试环境
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2020-07-07 16:03:23
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-08-25 11:16:44
|
||||
* @LastEditTime: 2022-11-21 20:41:44
|
||||
* @Description: 地图静态参数配置
|
||||
*/
|
||||
var _mapConfig = {}
|
||||
|
||||
;(function () {
|
||||
var L = window.L || {}
|
||||
// // 定义底图初始化化参数
|
||||
|
@ -21,9 +20,9 @@ var _mapConfig = {}
|
|||
CURRENT_MAP_OPTIONS: {
|
||||
// crs: CRS_4490,
|
||||
center: [36.17, 120.13],
|
||||
maxZoom: 18,
|
||||
maxZoom: 17,
|
||||
minZoom: 0,
|
||||
zoom: 10,
|
||||
zoom: 5,
|
||||
},
|
||||
},
|
||||
qingdao: {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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
|
|
@ -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; //定位后送进来的第一帧不是定位帧所在的I帧(Ni>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;//worker层log开关
|
||||
|
||||
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"); // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
|
||||
|
||||
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
|
@ -0,0 +1,396 @@
|
|||
"use strict";
|
||||
//顶点着色器
|
||||
//attribute修饰符用于声明由浏览器(javascript)传输给顶点着色器的变量值;
|
||||
// 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.
|
@ -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.
|
@ -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.
|
@ -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.
|
@ -0,0 +1,120 @@
|
|||
importScripts('libSystemTransform.js');
|
||||
const RECORDRTP = 0; //录制一份未经过转封装的码流原始数据,用于定位问题
|
||||
let dataType = 1;
|
||||
|
||||
// 转封装库回调函数
|
||||
self.STCallBack = function (fileIndex,indexLen, data, dataLen)
|
||||
{
|
||||
//stFrameInfo的类型见DETAIL_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:码流
|
||||
}
|
||||
}
|
||||
|
||||
//stFrameInfo的类型见DETAIL_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();
|
||||
}
|
||||
};
|
|
@ -1,8 +1,8 @@
|
|||
<!--
|
||||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2022-05-06 11:12:00
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-11-18 19:07:53
|
||||
* @Date: 2022-05-06 11:12:0011-18 19:07:53
|
||||
* @LastEditors: Light
|
||||
* @LastEditTime: 2022-11-24 09:13:27
|
||||
* @Description: 告诉大家这是什么
|
||||
-->
|
||||
<template>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2022-04-20 17:16:35
|
||||
* @LastEditors: hisense.wuhongjian
|
||||
* @LastEditTime: 2022-10-26 17:57:52
|
||||
* @LastEditors: Light
|
||||
* @LastEditTime: 2022-11-21 10:51:25
|
||||
* @Description: 告诉大家这是什么
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
@ -10,126 +10,161 @@ import axios from 'axios'
|
|||
import store from '@/store'
|
||||
|
||||
const config = {
|
||||
headers: {
|
||||
token: store.getters['user/accessToken'],
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
headers: {
|
||||
token: store.getters['user/accessToken'],
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
}
|
||||
const config2 = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset-utf-8',
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset-utf-8',
|
||||
},
|
||||
}
|
||||
export function getDevelopmentFile(params) {
|
||||
return request({
|
||||
url: '/developmentGuide/getDevelopmentFile',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
return request({
|
||||
url: '/developmentGuide/getDevelopmentFile',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
export function updateDevelopmentFile(params) {
|
||||
return axios.post(
|
||||
window.SITE_CONFIG.apiURL + '/developmentGuide/uploadDevelopmentFile',
|
||||
params,
|
||||
config
|
||||
)
|
||||
return axios.post(
|
||||
window.SITE_CONFIG.apiURL + '/developmentGuide/uploadDevelopmentFile',
|
||||
params,
|
||||
config
|
||||
)
|
||||
}
|
||||
export function test() {
|
||||
return axios.post(
|
||||
'http://15.72.158.81/zyjk/ZywMessage.asmx/ZywMessagePort',
|
||||
config2
|
||||
)
|
||||
return axios.post(
|
||||
'http://15.72.158.81/zyjk/ZywMessage.asmx/ZywMessagePort',
|
||||
config2
|
||||
)
|
||||
}
|
||||
export function correct(params) {
|
||||
return axios.post('http://15.72.183.90:7008/correct', params, config2)
|
||||
return axios.post('http://15.72.183.90:7008/correct', params, config2)
|
||||
}
|
||||
export function paddleocr(params) {
|
||||
return axios.post('http://15.72.183.90:7008/paddleocr', params, config2)
|
||||
return axios.post('http://15.72.183.90:7008/paddleocr', params, config2)
|
||||
}
|
||||
// 算法总接口
|
||||
export function algo(params) {
|
||||
return axios.post('http://15.72.184.10:8888/api/algo', params, config2)
|
||||
return axios.post('http://15.72.184.10:8888/api/algo', params, config2)
|
||||
}
|
||||
|
||||
// 能力云图-数据资源
|
||||
export function count() {
|
||||
return axios.post(
|
||||
'http://10.134.135.24:30058/share-portal/platform/index/abilityMarket/count',
|
||||
config2
|
||||
)
|
||||
return axios.post(
|
||||
'http://10.134.135.24:30058/share-portal/platform/index/abilityMarket/count',
|
||||
config2
|
||||
)
|
||||
}
|
||||
export function getVideoList(params) {
|
||||
return axios.get(
|
||||
'http://10.134.135.9:8001/hx-weather-warning/camera/getCameraListByName?name=' +
|
||||
params.name +
|
||||
'&pageNo=' +
|
||||
params.pageNo +
|
||||
'&pageSize=' +
|
||||
params.pageSize,
|
||||
config2
|
||||
)
|
||||
return axios.get(
|
||||
'http://10.134.135.9:8001/hx-weather-warning/camera/getCameraListByName?name=' +
|
||||
params.name +
|
||||
'&pageNo=' +
|
||||
params.pageNo +
|
||||
'&pageSize=' +
|
||||
params.pageSize,
|
||||
config2
|
||||
)
|
||||
}
|
||||
// 能力云图-数据资源-总数据数
|
||||
export function getRecord(params) {
|
||||
return axios.get(
|
||||
'http://10.134.135.24:30090/api/share-portal/platform/catalogue/query?serviceName=' +
|
||||
params.serviceName +
|
||||
'&orderField=' +
|
||||
params.orderField +
|
||||
'&orderType=' +
|
||||
params.orderType +
|
||||
'&pageNum=' +
|
||||
params.pageNum +
|
||||
'&pageSize=' +
|
||||
params.pageSize +
|
||||
'&serviceType=' +
|
||||
params.serviceType,
|
||||
config2
|
||||
)
|
||||
return axios.get(
|
||||
'http://10.134.135.24:30090/api/share-portal/platform/catalogue/query?serviceName=' +
|
||||
params.serviceName +
|
||||
'&orderField=' +
|
||||
params.orderField +
|
||||
'&orderType=' +
|
||||
params.orderType +
|
||||
'&pageNum=' +
|
||||
params.pageNum +
|
||||
'&pageSize=' +
|
||||
params.pageSize +
|
||||
'&serviceType=' +
|
||||
params.serviceType,
|
||||
config2
|
||||
)
|
||||
}
|
||||
|
||||
export function getHls(params) {
|
||||
return axios.get(
|
||||
'http://10.134.135.9:8001/hx-weather-warning/camera/getCameraLiveStreamByCode?cameraCode=' +
|
||||
params.cameraId +
|
||||
'&protocol=' +
|
||||
params.protocol,
|
||||
config2
|
||||
)
|
||||
return axios.get(
|
||||
'http://10.134.135.9:8001/hx-weather-warning/camera/getCameraLiveStreamByCode?cameraCode=' +
|
||||
params.cameraId +
|
||||
'&protocol=' +
|
||||
params.protocol,
|
||||
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
|
||||
)
|
||||
}
|
||||
|
||||
//西海岸 获取左侧标签树
|
||||
export function getPlaceType() {
|
||||
return axios.get(
|
||||
`http://${_cameraUrl}/data_service/placeTypes/getPlaceType`,
|
||||
config2
|
||||
)
|
||||
}
|
||||
|
||||
//西海岸 根据标签树查询视频列表
|
||||
export function CameraConditionPlaceType(params) {
|
||||
return axios.post(
|
||||
`http://${_cameraUrl}/data_service/getCamera/CameraConditionPlaceType'`,
|
||||
params,
|
||||
config2
|
||||
)
|
||||
}
|
||||
|
||||
// 西海岸视频wss流获取
|
||||
export function getCameraLiveStream(params) {
|
||||
return axios.get(
|
||||
`http://${_cameraUrl}/data_service/getCamera/getCameraLiveStream?cameraIndexCode=` +
|
||||
params.channelId +
|
||||
'&protocol=' +
|
||||
'wss' + '&transmode=1&streamType=1',
|
||||
config2
|
||||
)
|
||||
}
|
||||
// 西海岸--获取摄像头列表的后台地址 (测试环境地址:10.134.135.92:9537)
|
||||
let _cameraUrl =
|
||||
(_global &&
|
||||
_global.config &&
|
||||
_global.config.camreaInfo &&
|
||||
_global.config.camreaInfo.cameraUrl) ||
|
||||
'10.134.135.92:9537'
|
||||
//能力集市基础设施-左侧列表
|
||||
(_global &&
|
||||
_global.config &&
|
||||
_global.config.camreaInfo &&
|
||||
_global.config.camreaInfo.cameraUrl) ||
|
||||
'10.134.135.92:9537'
|
||||
//能力集市基础设施-左侧列表
|
||||
export function getCameraInfoByAreaId(params) {
|
||||
return axios.get(
|
||||
`http://${_cameraUrl}/data_service/getCamera/getCameraInfoByAreaId?areaId=${params.areaId}`,
|
||||
config2
|
||||
)
|
||||
return axios.get(
|
||||
`http://${_cameraUrl}/data_service/getCamera/getCameraInfoByAreaId?areaId=${params.areaId}`,
|
||||
config2
|
||||
)
|
||||
}
|
||||
//能力集市基础设施-摄像头
|
||||
export function getCameraByCondition(params) {
|
||||
return axios.post(
|
||||
`http://${_cameraUrl}/data_service/getCamera/getCameraByCondition`,
|
||||
params,
|
||||
config2
|
||||
)
|
||||
return axios.post(
|
||||
`http://${_cameraUrl}/data_service/getCamera/getCameraByCondition`,
|
||||
params,
|
||||
config2
|
||||
)
|
||||
}
|
||||
|
||||
export function initiateMeet(data) {
|
||||
// return request({
|
||||
// url: '/enke/initiateMeet',
|
||||
// method: 'post',
|
||||
// data: data,
|
||||
// })
|
||||
return axios.post(
|
||||
'http://10.134.135.92:8888/renren-admin/enke/initiateMeet',
|
||||
data,
|
||||
config2
|
||||
)
|
||||
}
|
||||
// return request({
|
||||
// url: '/enke/initiateMeet',
|
||||
// method: 'post',
|
||||
// data: data,
|
||||
// })
|
||||
return axios.post(
|
||||
'http://10.134.135.92:8888/renren-admin/enke/initiateMeet',
|
||||
data,
|
||||
config2
|
||||
)
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
* @Author: hisense.wuhongjian
|
||||
* @Date: 2022-04-01 19:19:40
|
||||
* @LastEditors: Light
|
||||
* @LastEditTime: 2022-11-18 14:09:20
|
||||
* @LastEditTime: 2022-11-21 16:35:03
|
||||
* @Description: 告诉大家这是什么
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
@ -533,3 +533,42 @@ export function getPolicyCloudService(data) {
|
|||
data,
|
||||
})
|
||||
}
|
||||
// 西海岸基础设施待申请列表
|
||||
export function willApplyCameraSelect() {
|
||||
return request({
|
||||
url: '/willApplyCamera/select',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 西海岸基础设施待申请列表新增
|
||||
export function willApplyCameraBatchInsert(data) {
|
||||
return request({
|
||||
url: '/willApplyCamera/batchInsert',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 西海岸基础设施待申请列表删除
|
||||
export function willApplyCameraBatchDelete(data) {
|
||||
return request({
|
||||
url: '/willApplyCamera/batchDelete',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 西海岸基础设施已申请列表
|
||||
export function getApplyCameraListXha(data) {
|
||||
return request({
|
||||
url: '/processForm/tabilityapplication/getApplyCameraList',
|
||||
method: 'get',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 西海岸基础设施已申请列表删除
|
||||
export function delApplyCamera(data) {
|
||||
return request({
|
||||
url: '/processForm/tabilityapplication/delApplyCamera',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -1675,11 +1675,11 @@ export function MapFun(mapObj) {
|
|||
// })
|
||||
|
||||
// }
|
||||
//_removeLayerByLayerName(layerName)
|
||||
_removeLayerByLayerName(layerName)
|
||||
let selectedLayerList = [];
|
||||
let layers = null;
|
||||
// 判断是否是聚合图层
|
||||
layers = createMarkerClusterLayer()
|
||||
layers = createMarkerClusterLayer('', map)
|
||||
const icon1 = createDefaultFeatureStyle({
|
||||
img: url,
|
||||
iconSize: [33, 33],
|
||||
|
@ -1696,65 +1696,73 @@ 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 = [];
|
||||
let clickDataList = [];
|
||||
//console.log('点位数据', e)
|
||||
//console.log('点位数据1', e.sourceTarget.resourceData)
|
||||
clickDataList.push(e.sourceTarget.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)
|
||||
}
|
||||
|
|
|
@ -39,7 +39,8 @@ function updateProgressBar(processed, total, elapsed, layersArray) {
|
|||
* @param layerClassName 据此判断是否需要自定义聚合图层的样式
|
||||
* @returns {*}
|
||||
*/
|
||||
function createMarkerClusterLayer(layerClassName) {
|
||||
function createMarkerClusterLayer(layerClassName, mapObj) {
|
||||
let array = [];
|
||||
let markerClusterLayer = null
|
||||
if (layerClassName) {
|
||||
// 如果存在类名,表示需要自定义图标
|
||||
|
@ -65,22 +66,38 @@ function createMarkerClusterLayer(layerClassName) {
|
|||
} else {
|
||||
// 使用默认图标
|
||||
markerClusterLayer = L.markerClusterGroup({
|
||||
iconCreateFunction(cluster) {
|
||||
const markers = cluster.getAllChildMarkers()
|
||||
let n = 0
|
||||
for (let i = 0; i < markers.length; i++) {
|
||||
n += markers[i].number
|
||||
}
|
||||
return L.divIcon({ html: markers.length, className: "topic-marker-cluster-video" })
|
||||
},
|
||||
// iconCreateFunction(cluster) {
|
||||
// const markers = cluster.getAllChildMarkers()
|
||||
// let n = 0
|
||||
// for (let i = 0; i < markers.length; i++) {
|
||||
// n += markers[i].number
|
||||
// }
|
||||
// return L.divIcon({ html: markers.length, className: "topic-marker-cluster-video" })
|
||||
// },
|
||||
// 是否允许指定 PolylineOptions 样式 spider
|
||||
spiderfyOnMaxZoom: true,
|
||||
spiderfyOnMaxZoom: false,
|
||||
// 是否显示标记的边界
|
||||
showCoverageOnHover: false,
|
||||
showCoverageOnHover: true,
|
||||
// 是否点击展开
|
||||
zoomToBoundsOnClick: true,
|
||||
maxClusterRadius: 80,
|
||||
})
|
||||
markerClusterLayer.on('clusterclick', function(a) {
|
||||
let clusterList = [];
|
||||
//console.log('cluster ' + a.layer.getAllChildMarkers());
|
||||
if (a.layer.getAllChildMarkers().length < 50) {
|
||||
for (var i = 0; i < a.layer.getAllChildMarkers().length; i++) {
|
||||
//console.log('yyyyyyyyy', a.layer.getAllChildMarkers()[i].resourceData);
|
||||
//console.log('yyyyyyyyy', a.layer.getAllChildMarkers()[i].fData);
|
||||
clusterList.push(a.layer.getAllChildMarkers()[i].resourceData);
|
||||
}
|
||||
//console.log('clusterList ' + a.layer.getAllChildMarkers(array, true));
|
||||
//console.log('zzzzzzzzz', mapObj.getZoom(), mapObj.getMaxZoom());
|
||||
if (mapObj.getZoom() == mapObj.getMaxZoom()) {
|
||||
mybus.emit('openOperationPopup', clusterList);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return markerClusterLayer
|
||||
}
|
||||
|
@ -1007,4 +1024,4 @@ export {
|
|||
addResourceOnMapWithoutSuper,
|
||||
addResourceOnMapNew,
|
||||
addPointsToMap,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,10 +23,8 @@ let loadingInstance
|
|||
* @param {*} msg
|
||||
*/
|
||||
const handleCode = (code, msg, res) => {
|
||||
// debugger
|
||||
switch (code) {
|
||||
case 401:
|
||||
debugger
|
||||
store.dispatch('user/resetAll').catch(() => {})
|
||||
break
|
||||
case 403:
|
||||
|
@ -66,7 +64,6 @@ const instance = axios.create({
|
|||
*/
|
||||
instance.interceptors.request.use(
|
||||
(config) => {
|
||||
// debugger
|
||||
const token = getAccessToken()
|
||||
if (token) config.headers[tokenName] = token
|
||||
if (
|
||||
|
@ -157,7 +154,6 @@ instance.interceptors.response.use(
|
|||
// }
|
||||
},
|
||||
(error) => {
|
||||
// debugger
|
||||
console.log('接口error', error)
|
||||
if (loadingInstance) loadingInstance.close()
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@
|
|||
|
||||
<style scoped lang="less">
|
||||
.ability-to-apply-for {
|
||||
height: 2.9rem;
|
||||
max-height: 2.9rem;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
|
@ -281,7 +281,7 @@
|
|||
}
|
||||
|
||||
.ability-to-apply-for-content {
|
||||
padding-right: 0.5rem;
|
||||
// padding-right: 0.5rem;
|
||||
position: relative;
|
||||
|
||||
.dep-name {
|
||||
|
|
|
@ -143,6 +143,7 @@
|
|||
show-size-changer
|
||||
show-less-items
|
||||
show-quick-jumper
|
||||
:showTotal="total => `共 ${total} 项`"
|
||||
:total="resourceTotal"
|
||||
:page-size-options="pageSizeOptions"
|
||||
@change="pageChange"
|
||||
|
@ -510,9 +511,9 @@
|
|||
:resourceTotal="resourceTotal"
|
||||
></KnowledgeBase>
|
||||
</div>
|
||||
<div v-if="Cardsname == '基础设施'">
|
||||
<template v-if="Cardsname == '基础设施'">
|
||||
<infrastructureApplication></infrastructureApplication>
|
||||
</div>
|
||||
</template>
|
||||
<div class="talk-monitor" @click="openMonitor">
|
||||
<a-tooltip>
|
||||
<template #title>问答机器人</template>
|
||||
|
@ -1286,21 +1287,27 @@
|
|||
.replace({
|
||||
query: newQuery,
|
||||
})
|
||||
.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()
|
||||
}
|
||||
}
|
||||
.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()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
const getAppResources = (switchIndex) => {
|
||||
if (!globalFlag.value) {
|
||||
|
@ -1959,6 +1966,7 @@
|
|||
infrastructurePageXha,
|
||||
detailsPageInfrastructureTree,
|
||||
detailsPageInfrastructureTreeXha,
|
||||
infrastructureApplication,
|
||||
},
|
||||
beforeUnmount() {
|
||||
mybus.off('getCameraByParentId')
|
||||
|
@ -2058,7 +2066,7 @@
|
|||
background: rgba(245, 243, 243, 0.3);
|
||||
|
||||
.details-pageconetent-left {
|
||||
max-height: 6.9rem;
|
||||
max-height: 8.5rem;
|
||||
position: absolute;
|
||||
width: 2.5rem;
|
||||
top: 0.17rem;
|
||||
|
@ -2313,7 +2321,8 @@
|
|||
}
|
||||
|
||||
.leixingsumfather {
|
||||
width: 8.1rem;
|
||||
margin-left: -13px;
|
||||
width: 9.4rem;
|
||||
display: inline-block;
|
||||
height: 0.3014rem;
|
||||
overflow: hidden;
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
</div>
|
||||
|
||||
<!-- 西海岸--附件上传 -->
|
||||
<div v-if="iskfq && isXiHaiAn">
|
||||
<div v-if="isXiHaiAn">
|
||||
<a-row style="margin-top: 0.4rem">
|
||||
<a-col :span="24">
|
||||
<a-form-item
|
||||
|
@ -237,6 +237,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { willApplyCameraBatchDelete } from '@/api/home'
|
||||
import AbilityToApplyFor from './AbilityToApplyFor.vue'
|
||||
import HomeHeader from '@/views/home/components/header'
|
||||
import { reactive, ref, watch, onBeforeUnmount } from 'vue'
|
||||
|
@ -311,7 +312,6 @@
|
|||
const apiURL = window.SITE_CONFIG.apiURL
|
||||
|
||||
if (!applyAll) {
|
||||
debugger
|
||||
list.value.map((item) => {
|
||||
item.arr.map((val) => {
|
||||
let obj = item.children
|
||||
|
@ -656,6 +656,7 @@
|
|||
if (item.note1 && typeof item.note1 == 'string') {
|
||||
item.note1 = JSON.parse(item.note1)
|
||||
}
|
||||
let delArr = []
|
||||
item.note1 &&
|
||||
item.note1.map((jcss) => {
|
||||
if (!jcss) {
|
||||
|
@ -678,31 +679,39 @@
|
|||
}
|
||||
// 西海岸
|
||||
if (isXiHaiAn.value) {
|
||||
// _itemData.resourceId = jcss.channelId
|
||||
_itemData.managementUnitName = jcss.managementUnitName
|
||||
_itemData.cameraPointTypeName = jcss.cameraPointTypeName
|
||||
delArr.push(jcss.id)
|
||||
}
|
||||
obj.system.push(_itemData)
|
||||
})
|
||||
submitApply(obj).then((res) => {
|
||||
// applySuccess.value = false
|
||||
console.log('摄像头申请================>', res)
|
||||
if (item.id) {
|
||||
sgcDel({ ids: [item.id] }).then((res1) => {
|
||||
if (res1.data.msg === 'success') {
|
||||
if (falgNum == 0 && sxt) {
|
||||
message.success('申请提交成功,请到消息中心查看!')
|
||||
sxt = false
|
||||
}
|
||||
mybus.emit('getSgcNum')
|
||||
if (res.data.msg == 'success') {
|
||||
if (delArr.length > 0) {
|
||||
willApplyCameraBatchDelete(delArr).then((res) => {
|
||||
jumpToDetailsPageconetent()
|
||||
})
|
||||
} else if (item.id) {
|
||||
sgcDel({ ids: [item.id] }).then((res1) => {
|
||||
if (res1.data.msg === 'success') {
|
||||
if (falgNum == 0 && sxt) {
|
||||
message.success('申请提交成功,请到消息中心查看!')
|
||||
sxt = false
|
||||
}
|
||||
mybus.emit('getSgcNum')
|
||||
jumpToDetailsPageconetent()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (res.data.msg === 'success' && falgNum == 0 && sxt) {
|
||||
message.success('申请提交成功,请到消息中心查看!')
|
||||
sxt = false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (res.data.msg === 'success' && falgNum == 0 && sxt) {
|
||||
message.success('申请提交成功,请到消息中心查看!')
|
||||
sxt = false
|
||||
jumpToDetailsPageconetent()
|
||||
}
|
||||
jumpToDetailsPageconetent()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -956,130 +965,130 @@
|
|||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
#apply-container {
|
||||
// background-color: #f5f8fc;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0.8rem auto 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
aside {
|
||||
width: 282px;
|
||||
height: 96%;
|
||||
overflow-y: auto;
|
||||
background-color: #fff;
|
||||
margin: 1% 0 3%;
|
||||
}
|
||||
|
||||
article {
|
||||
width: 1090px;
|
||||
height: 99%;
|
||||
overflow-y: auto;
|
||||
background-color: #fff;
|
||||
margin: 1% auto;
|
||||
}
|
||||
|
||||
.form-container {
|
||||
padding: 20px 20px 30px 20px;
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.base-info {
|
||||
#apply-container {
|
||||
// background-color: #f5f8fc;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0.8rem auto 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.flex-row-start {
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
aside {
|
||||
width: 282px;
|
||||
height: 96%;
|
||||
overflow-y: auto;
|
||||
background-color: #fff;
|
||||
margin: 1% 0 3%;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label) {
|
||||
label {
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
article {
|
||||
width: 1090px;
|
||||
height: 99%;
|
||||
overflow-y: auto;
|
||||
background-color: #fff;
|
||||
margin: 1% auto;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
.form-container {
|
||||
padding: 20px 20px 30px 20px;
|
||||
overflow: hidden;
|
||||
.title {
|
||||
font-size: 20px;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-required) {
|
||||
&::before {
|
||||
font-size: 8px;
|
||||
margin-right: 10px;
|
||||
.base-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.flex-row-start {
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label) {
|
||||
label {
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-required) {
|
||||
&::before {
|
||||
font-size: 8px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-input) {
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.success {
|
||||
div {
|
||||
width: 100px;
|
||||
margin: 80px auto 40px;
|
||||
}
|
||||
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-input) {
|
||||
border: 1px solid #e0e0e0;
|
||||
.applicationScene {
|
||||
:deep(.ant-select-selector) {
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selection-overflow) {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
// position: fixed;
|
||||
}
|
||||
|
||||
.cancel-apply {
|
||||
width: 80px;
|
||||
height: 38px;
|
||||
margin-right: 20px;
|
||||
background: #e1edfa;
|
||||
color: #0087ff;
|
||||
font-size: 14px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.success {
|
||||
div {
|
||||
width: 100px;
|
||||
margin: 80px auto 40px;
|
||||
}
|
||||
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.applicationScene {
|
||||
:deep(.ant-select-selector) {
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
:deep(.ant-select-selection-overflow) {
|
||||
flex-wrap: nowrap;
|
||||
.confirm-apply {
|
||||
width: 80px;
|
||||
height: 38px;
|
||||
background: #0087ff;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
// position: fixed;
|
||||
}
|
||||
|
||||
.cancel-apply {
|
||||
width: 80px;
|
||||
height: 38px;
|
||||
margin-right: 20px;
|
||||
background: #e1edfa;
|
||||
color: #0087ff;
|
||||
font-size: 14px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.confirm-apply {
|
||||
width: 80px;
|
||||
height: 38px;
|
||||
background: #0087ff;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @Author: Light
|
||||
* @Date: 2022-11-16 16:46:16
|
||||
* @LastEditors: Light
|
||||
* @LastEditTime: 2022-11-18 15:35:25
|
||||
* @LastEditTime: 2022-11-21 10:54:23
|
||||
* @Description: 政务云资源列表
|
||||
-->
|
||||
<template>
|
||||
|
|
|
@ -0,0 +1,240 @@
|
|||
<!--
|
||||
海康H5Player
|
||||
-->
|
||||
<template>
|
||||
<div id="player" style="width: 800px; height: 600px; z-index: 9999"></div>
|
||||
</template>
|
||||
<script>
|
||||
const IS_MOVE_DEVICE = document.body.clientWidth < 992 // 是否移动设备
|
||||
const MSE_IS_SUPPORT = !!window.MediaSource // 是否支持mse
|
||||
import { message } from 'ant-design-vue'
|
||||
export default {
|
||||
name: 'H5Player',
|
||||
props: {
|
||||
videoUrl: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
stopFlag: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
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(this.videoUrl, 0)
|
||||
//this.realplay('wss://10.134.135.44:6014/proxy/10.10.20.14:559/openUrl/y3mFfcA',0);
|
||||
},
|
||||
watch: {
|
||||
videoUrl: {
|
||||
// 数据发生变化就会调用这个函数
|
||||
handler(newVal, oldVal) {
|
||||
console.log('oldVal:', oldVal)
|
||||
console.log('newVal:', newVal)
|
||||
if (newVal) {
|
||||
this.realplay(newVal, 0)
|
||||
}
|
||||
},
|
||||
// 立即处理 进入页面就触发
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 海康视频初始化加载
|
||||
init() {
|
||||
// 设置播放容器的宽高并监听窗口大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
this.player.JS_Resize()
|
||||
})
|
||||
},
|
||||
createPlayer() {
|
||||
//console.log('this.index',this.index);
|
||||
this.player = new window.JSPlugin({
|
||||
//szId: 'player'+this.index,
|
||||
szId: 'player',
|
||||
szBasePath: '/util/', //引入静态资源地址,我这里静态资源在public/js文件存放,所以设置为js
|
||||
iMaxSplit: 4,
|
||||
iCurrentSplit: 4,
|
||||
openDebug: true,
|
||||
oStyle: {
|
||||
borderSelect: '#FFCC00',
|
||||
},
|
||||
})
|
||||
let that = this
|
||||
// 事件回调绑定
|
||||
this.player.JS_SetWindowControlCallback({
|
||||
windowEventSelect: function (iWndIndex) {
|
||||
//插件选中窗口回调
|
||||
console.log('windowSelect callback: ', iWndIndex)
|
||||
},
|
||||
pluginErrorHandler: function (iWndIndex, iErrorCode, oError) {
|
||||
//插件错误回调
|
||||
console.log('pluginError callback: ', iWndIndex, iErrorCode, oError)
|
||||
message.error('取流异常,请稍后尝试')
|
||||
},
|
||||
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
|
||||
)
|
||||
// 首帧绘制完成后停止
|
||||
that.pausePlay(iWndIndex)
|
||||
},
|
||||
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
|
||||
console.log('视频播放地址', playURL)
|
||||
// const startTime = {
|
||||
// startTime: ,
|
||||
// }
|
||||
// const endTime = {
|
||||
// endTime: ,
|
||||
// }
|
||||
player
|
||||
.JS_Play(
|
||||
playURL,
|
||||
{ playURL, mode },
|
||||
index1,
|
||||
'2022-11-22T10:00:00Z',
|
||||
'2022-11-22T11:00:00Z'
|
||||
)
|
||||
.then(
|
||||
() => {
|
||||
console.log('realplay success')
|
||||
},
|
||||
(e) => {
|
||||
console.error(e)
|
||||
// message.error('错误代码:' + e)
|
||||
}
|
||||
)
|
||||
},
|
||||
// 关闭所有视频
|
||||
stopAllPlay() {
|
||||
this.player.JS_StopRealPlayAll().then(
|
||||
() => {
|
||||
this.playback.rate = 0
|
||||
console.log('stopAllPlay success')
|
||||
this.closeVideoTree()
|
||||
},
|
||||
(e) => {
|
||||
console.error(e)
|
||||
}
|
||||
)
|
||||
},
|
||||
// 暂停单个视频
|
||||
pausePlay(index) {
|
||||
this.player.JS_Pause(index).then(
|
||||
() => {
|
||||
console.log('暂停成功')
|
||||
},
|
||||
(e) => {
|
||||
console.error(e)
|
||||
}
|
||||
)
|
||||
},
|
||||
},
|
||||
beforeUnmount() {
|
||||
console.log('关闭所有视频')
|
||||
this.stopAllPlay()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.video-player {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
.play-button {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: red;
|
||||
position: absolute;
|
||||
left: 350px;
|
||||
z-index: 9;
|
||||
top: 240px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -40,6 +40,10 @@
|
|||
:pageSize="5"
|
||||
:total="props.resourceTotal"
|
||||
show-less-items
|
||||
show-size-changer
|
||||
show-quick-jumper
|
||||
:page-size-options="pageSizeOptions"
|
||||
:showTotal="total => `共 ${total} 项`"
|
||||
@change="handleCurrentChange"
|
||||
:showSizeChanger="false"
|
||||
/>
|
||||
|
@ -56,6 +60,7 @@
|
|||
resourceList: { type: Array, default: null },
|
||||
resourceTotal: { type: String, default: '' },
|
||||
})
|
||||
const pageSizeOptions = ref(['5', '10', '20', '50'])
|
||||
console.log('props==========>', props)
|
||||
// 知识库
|
||||
const zskState = reactive({
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
:key="item.key"
|
||||
@click="jumpPage(item,'headerClick')"
|
||||
class="nav"
|
||||
:class="[{'select':item.key == select},{'select-inner':(item.key == 'DetailsPageconetent' && item.innerKey == 'algorithmCompare'&& props.targetFlag)}]"
|
||||
:class="[{'select':item.key == select},{'select-inner':(item.key == 'DetailsPageconetent' && item.innerKey && props.targetFlag)}]"
|
||||
>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
|
@ -171,6 +171,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
console.log('3333333------------>', props)
|
||||
// 返回首页
|
||||
const goToHome = () => {
|
||||
// 西海岸
|
||||
|
@ -290,7 +291,7 @@
|
|||
break
|
||||
case '能力集市':
|
||||
router.push({
|
||||
path: '/algorithmCompare',
|
||||
path: targetRouter.value.path,
|
||||
query: {
|
||||
id: targetRouter.value.id,
|
||||
},
|
||||
|
@ -301,41 +302,11 @@
|
|||
path: '/capabilityCloud',
|
||||
})
|
||||
break
|
||||
// case '技术文档':
|
||||
// router.push({
|
||||
// path: '/developmentGuide',
|
||||
// })
|
||||
// break
|
||||
case '新手指南':
|
||||
router.push({
|
||||
path: '/instructionManual',
|
||||
})
|
||||
break
|
||||
case '需求中心':
|
||||
router.push({
|
||||
path: '/demandCenter',
|
||||
})
|
||||
break
|
||||
case '区市站点':
|
||||
router.push({
|
||||
path: '/mapTest',
|
||||
})
|
||||
break
|
||||
case '后台管理':
|
||||
Cookies.remove('JSESSIONID')
|
||||
window.open(window.SITE_CONFIG.backUrl + '/#/workBench-workBench')
|
||||
// window.reload('http://15.2.21.238:9797')
|
||||
break
|
||||
case '赋能案例':
|
||||
router.push({
|
||||
path: '/assignCase',
|
||||
})
|
||||
break
|
||||
case '典型赋能案例':
|
||||
router.push({
|
||||
path: '/assignCase',
|
||||
})
|
||||
break
|
||||
case '融合服务':
|
||||
router.push({
|
||||
path: '/integrationServices',
|
||||
|
@ -431,8 +402,9 @@
|
|||
})
|
||||
|
||||
mybus.on('changeMenuStyle', (data) => {
|
||||
debugger
|
||||
targetRouter.value = data;
|
||||
if(data.path=='/algorithmCompare'){
|
||||
targetRouter.value = data;
|
||||
jumpPage({
|
||||
"name": "能力集市",
|
||||
"key": "DetailsPageconetent",
|
||||
|
@ -440,6 +412,12 @@
|
|||
},'innerClick');
|
||||
} else if(data.path =='/DetailsPageconetent'){
|
||||
jumpPage({ name: '能力集市', key: 'DetailsPageconetent' },'headerClick')
|
||||
} else if(data.path =='/details'){
|
||||
jumpPage({
|
||||
"name": "能力集市",
|
||||
"key": "DetailsPageconetent",
|
||||
"innerKey":"details"
|
||||
},'innerClick');
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -609,12 +609,18 @@
|
|||
}
|
||||
} else {
|
||||
context.emit('saveSearchCodition')
|
||||
router.push({
|
||||
path: '/details',
|
||||
query: {
|
||||
id: item.id,
|
||||
},
|
||||
})
|
||||
// router.push({
|
||||
// path: '/details',
|
||||
// query: {
|
||||
// id: item.id,
|
||||
// },
|
||||
// });
|
||||
//修改顶部菜单的样式
|
||||
let pathData = {
|
||||
path: '/details',
|
||||
id: item.id,
|
||||
};
|
||||
mybus.emit('changeMenuStyle',pathData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -851,8 +857,8 @@
|
|||
</script>
|
||||
<style scoped lang="less">
|
||||
#search-result-list-container {
|
||||
width: 1088px;
|
||||
padding: 0 20px;
|
||||
// width: 1088px;
|
||||
padding: 0 18px;
|
||||
background: #f3f5f9;
|
||||
|
||||
.detail-content {
|
||||
|
@ -865,7 +871,7 @@
|
|||
}
|
||||
|
||||
.shai-xuan {
|
||||
width: 1047px;
|
||||
// width: 1047px;
|
||||
height: 36px;
|
||||
// margin: 11px 0 20px;
|
||||
// background: #e5f2ff;
|
||||
|
@ -898,7 +904,7 @@
|
|||
|
||||
.condition {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
right: 0px;
|
||||
top: 10px;
|
||||
|
||||
ul li {
|
||||
|
@ -935,7 +941,7 @@
|
|||
}
|
||||
|
||||
.result-list {
|
||||
width: 1048px;
|
||||
// width: 1048px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
|
@ -1004,7 +1010,7 @@
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 0 10px 0 0;
|
||||
// margin: 0 10px 0 0;
|
||||
|
||||
.header-right {
|
||||
// display: flex;
|
||||
|
@ -1017,7 +1023,7 @@
|
|||
}
|
||||
|
||||
div {
|
||||
margin-right: 24px;
|
||||
// margin-right: 24px;
|
||||
}
|
||||
|
||||
.label-content {
|
||||
|
@ -1037,7 +1043,7 @@
|
|||
|
||||
.header-right:last-child {
|
||||
div {
|
||||
margin-right: 16px;
|
||||
// margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1101,7 +1107,7 @@
|
|||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin: 0 10px;
|
||||
// margin: 0 10px;
|
||||
align-items: center;
|
||||
|
||||
.shopping {
|
||||
|
@ -1188,7 +1194,8 @@
|
|||
align-items: center;
|
||||
|
||||
& > div {
|
||||
margin: 0 10px;
|
||||
margin-right: 16px;
|
||||
// margin: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1218,7 +1225,7 @@
|
|||
|
||||
.description {
|
||||
max-width: 990px;
|
||||
height: 52px;
|
||||
// height: 52px;
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
display: -webkit-box;
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<template>
|
||||
<div class="detail-back" @click="previousPage" :style="{ color: textColor }">
|
||||
<div>
|
||||
<div class="nav-box">
|
||||
<a-breadcrumb>
|
||||
<a-breadcrumb-item @click="goToDetailsPageconetent" class="bread-crumb-span">能力集市</a-breadcrumb-item>
|
||||
<a-breadcrumb-item>{{detailName}}</a-breadcrumb-item>
|
||||
</a-breadcrumb>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -7,6 +13,7 @@
|
|||
import { reactive, ref, watch, defineProps } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useStore } from 'vuex'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
const router = useRouter()
|
||||
const oldValue1= ref('')
|
||||
const props = defineProps({
|
||||
|
@ -24,20 +31,47 @@ const previousPage = () => {
|
|||
|
||||
}
|
||||
|
||||
const detailName = ref("应用资源")
|
||||
|
||||
const goToDetailsPageconetent = () =>{
|
||||
let pathData = {
|
||||
path: '/DetailsPageconetent',
|
||||
};
|
||||
mybus.emit('changeMenuStyle',pathData);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.detail-back {
|
||||
position: absolute;
|
||||
top: 0.85rem;
|
||||
top: 0.6rem;
|
||||
left: 100px;
|
||||
font-size: 0.18rem;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background-image: url('~@/assets/detailsAll/back.png');
|
||||
//background-image: url('~@/assets/detailsAll/back.png');
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.nav-box {
|
||||
position: absolute;
|
||||
top: 0.6rem;
|
||||
//left: 100px;
|
||||
font-size: 0.18rem;
|
||||
color: #fff;
|
||||
height: 30px;
|
||||
line-height:30px;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(244, 245, 248, 0.8);
|
||||
padding-left: 145px;
|
||||
padding-top: 5px;
|
||||
.bread-crumb-span{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -8,11 +8,12 @@
|
|||
<template>
|
||||
<div>
|
||||
<div id="apply-container">
|
||||
<home-header :showView="showView"></home-header>
|
||||
<home-header :showView="showView" :target-flag = "targetFlag"></home-header>
|
||||
<detail-back></detail-back>
|
||||
<details-view v-if="showView === 'details-view'"></details-view>
|
||||
<div class="detail-content">
|
||||
<details-view v-if="showView === 'details-view'"></details-view>
|
||||
<algorithm-details
|
||||
v-else-if="showView === 'algorithm-details'"
|
||||
v-if="showView === 'algorithm-details'"
|
||||
></algorithm-details>
|
||||
<application-details
|
||||
v-else-if="showView === 'application-details'"
|
||||
|
@ -24,6 +25,7 @@
|
|||
v-else-if="showView === 'business-details'"
|
||||
></business-details>
|
||||
<layer-service v-else-if="showView === 'layer-service'"></layer-service>
|
||||
</div>
|
||||
<home-footer></home-footer>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -95,6 +97,7 @@
|
|||
const id = router.currentRoute.value.query.id
|
||||
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
|
||||
let showView = ref('')
|
||||
const targetFlag= ref(true)
|
||||
const init = () => {
|
||||
if (id) {
|
||||
selectOne(id).then((res) => {
|
||||
|
@ -171,6 +174,7 @@
|
|||
formState,
|
||||
options,
|
||||
showView,
|
||||
targetFlag,
|
||||
init,
|
||||
router,
|
||||
id,
|
||||
|
@ -191,4 +195,7 @@
|
|||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.detail-content{
|
||||
margin-top:90px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -108,13 +108,17 @@
|
|||
<div v-for="(item, index) in biaoqianList">
|
||||
<div class="titleName">{{ item.placeTypeName }}</div>
|
||||
<div class="glgkmk" v-for="(child, index) in item.children">
|
||||
<div
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>{{ child.placeTypeName }}</template>
|
||||
<div
|
||||
class="glgknum"
|
||||
:class="{ active: child.placeTypeCode == chooseId }"
|
||||
@click="tabClick(child.placeTypeCode)"
|
||||
>
|
||||
{{ child.placeTypeName }}
|
||||
</div>
|
||||
</a-tooltip>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -123,7 +127,8 @@
|
|||
<script>
|
||||
import { defineComponent, ref, watch } from 'vue'
|
||||
import { getCameraAllOrgan } from '@/api/videoSurveillance'
|
||||
import { getCameraInfoByAreaId } from '@/api/file'
|
||||
|
||||
import { getCameraInfoByAreaId ,getPlaceType} from '@/api/file'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { UpOutlined, DownOutlined } from '@ant-design/icons-vue'
|
||||
|
@ -135,7 +140,6 @@ export default defineComponent({
|
|||
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('')
|
||||
|
@ -144,10 +148,38 @@ export default defineComponent({
|
|||
//切换tab
|
||||
const btnClick = (index) => {
|
||||
itemIndex.value = index
|
||||
if(index===2){
|
||||
if(chooseId.value !==''){
|
||||
let placeTypeCode =[]
|
||||
placeTypeCode.push(chooseId.value)
|
||||
mybus.emit('CameraConditionPlaceType', placeTypeCode)
|
||||
}else{
|
||||
mybus.emit('clearLeftSelect')
|
||||
}
|
||||
}else{
|
||||
if(selectId.value!==''){
|
||||
mybus.emit('getCameraByParentId', selectId.value)
|
||||
}else{
|
||||
mybus.emit('clearLeftSelect')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
//选择标签内容
|
||||
const tabClick = (id) => {
|
||||
chooseId.value = id
|
||||
if(chooseId.value === id){
|
||||
chooseId.value = ''
|
||||
mybus.emit('clearLeftSelect')
|
||||
}else{
|
||||
|
||||
chooseId.value = id
|
||||
let placeTypeCode =[]
|
||||
placeTypeCode.push(id)
|
||||
mybus.emit('CameraConditionPlaceType', placeTypeCode)
|
||||
}
|
||||
|
||||
}
|
||||
// 初始化
|
||||
const init = async () => {
|
||||
|
@ -159,34 +191,17 @@ export default defineComponent({
|
|||
select = ''
|
||||
}
|
||||
if (select == '基础设施') {
|
||||
|
||||
let res = {}
|
||||
if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) {
|
||||
res = await getCameraAllOrgan({ parentId: 'S4NbecfYB1DBH8HNULGS34' })
|
||||
} else {
|
||||
// 西海岸
|
||||
|
||||
res = await getCameraInfoByAreaId({
|
||||
areaId: '70be8c5b664f4bcf869d82f2e8335051',
|
||||
})
|
||||
}
|
||||
treeData.value = (res.data && res.data.data) || []
|
||||
let tabs={}
|
||||
tabs = await getPlaceType()
|
||||
//获取标签列表=========
|
||||
biaoqianList.value = [
|
||||
{
|
||||
placeTypeName: '政府机构',
|
||||
children: [
|
||||
{ placeTypeName: '行政中心', placeTypeCode: '1' },
|
||||
{ placeTypeName: '行政中心', placeTypeCode: '12' },
|
||||
{ placeTypeName: '行政中心', placeTypeCode: '14' },
|
||||
],
|
||||
},
|
||||
{
|
||||
placeTypeName: '政府机构1',
|
||||
children: [
|
||||
{ placeTypeName: '行政中心', placeTypeCode: '2' },
|
||||
{ placeTypeName: '行政中心', placeTypeCode: '3' },
|
||||
],
|
||||
},
|
||||
]
|
||||
biaoqianList.value =(tabs.data && tabs.data.data) || []
|
||||
// 只有一个,默认展开到二级菜单
|
||||
if (res.data && res.data.data.length == 1) {
|
||||
showBottom(treeData.value[0])
|
||||
|
@ -196,15 +211,14 @@ export default defineComponent({
|
|||
mybus.on('getDeptList', () => {
|
||||
init()
|
||||
})
|
||||
|
||||
mybus.on('clearChoose', () => {
|
||||
selectId.value=''
|
||||
chooseId.value=''
|
||||
})
|
||||
const onSelect = async (item, val, child) => {
|
||||
let res = {}
|
||||
if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) {
|
||||
res = await getCameraAllOrgan({ parentId: val.id })
|
||||
} else {
|
||||
// 西海岸
|
||||
|
||||
let res = {}
|
||||
res = await getCameraInfoByAreaId({ areaId: val.id })
|
||||
}
|
||||
treeData.value.map((treeDataItem, index) => {
|
||||
if (item.id == treeDataItem.id) {
|
||||
treeData.value[index].children.map((childItem, childIndex) => {
|
||||
|
@ -216,27 +230,29 @@ export default defineComponent({
|
|||
}
|
||||
})
|
||||
if (child) {
|
||||
if(selectId.value===child.id){
|
||||
selectId.value=''
|
||||
}else{
|
||||
selectId.value = child.id
|
||||
mybus.emit('getCameraByParentId', val.id)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
watch(selectId, (newVal) => {
|
||||
if (newVal == '') {
|
||||
mybus.emit('getCameraByParentId', '')
|
||||
mybus.emit('getListByParentId', '')
|
||||
if (newVal == '') {
|
||||
mybus.emit('clearLeftSelect')
|
||||
}
|
||||
})
|
||||
|
||||
const showBottom = async (item) => {
|
||||
item.show = !item.show
|
||||
let res = {}
|
||||
if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) {
|
||||
res = await getCameraAllOrgan({ parentId: item.id })
|
||||
} else {
|
||||
// 西海岸
|
||||
res = await getCameraInfoByAreaId({ areaId: item.id })
|
||||
}
|
||||
|
||||
treeData.value.map((treeDataItem, index) => {
|
||||
if (item.id == treeDataItem.id) {
|
||||
treeData.value[index].children = (res.data && res.data.data) || []
|
||||
|
@ -245,14 +261,17 @@ export default defineComponent({
|
|||
})
|
||||
}
|
||||
const showDown = (item, val) => {
|
||||
|
||||
selectId.value = val.id
|
||||
console.log('item---showDown--------->', item)
|
||||
console.log('val----showDown-------->', val)
|
||||
//mybus.emit('getCameraByParentId', val.id)
|
||||
if (item.children) {
|
||||
val.show = !val.show
|
||||
// 取消选中
|
||||
if (!val.show) {
|
||||
selectId.value = ''
|
||||
// mybus.emit('clearLeftSelect')
|
||||
}else{
|
||||
mybus.emit('getCameraByParentId', val.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -274,7 +293,7 @@ export default defineComponent({
|
|||
},
|
||||
beforeUnmount() {
|
||||
mybus.off('getDeptList')
|
||||
console.log('getDeptList销毁~~~~~~~~~~~~~~~~~~~')
|
||||
mybus.off('clearChoose')
|
||||
},
|
||||
components: {
|
||||
UpOutlined,
|
||||
|
@ -285,23 +304,34 @@ export default defineComponent({
|
|||
<style lang="less" scoped>
|
||||
.titleName {
|
||||
font-size: 18px;
|
||||
color: #1e1a1a;
|
||||
margin-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
border-left: 6px solid #1296db;
|
||||
color: #7e7676;
|
||||
margin-bottom: 10px;
|
||||
padding-left: 6px;
|
||||
border-left: 6px solid #1296db;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.glgkmk {
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 30%;
|
||||
width: 45%;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 10px;
|
||||
|
||||
.glgknum {
|
||||
// width: 100px;
|
||||
// color: #000000;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all;
|
||||
}
|
||||
.active {
|
||||
color: #0058e1;
|
||||
}
|
||||
.glgknum {
|
||||
// color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,15 +339,15 @@ export default defineComponent({
|
|||
color: #0058e1;
|
||||
}
|
||||
.nav {
|
||||
margin-bottom: 13px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
justify-content: space-between;
|
||||
margin-right: 20px;
|
||||
align-items: center;
|
||||
font-size: 18px;
|
||||
font-family: 'Alibaba PuHuiTi';
|
||||
color: #000000;
|
||||
line-height: 0.32rem;
|
||||
margin-bottom: 0.1rem;
|
||||
margin-bottom: 24px;
|
||||
|
||||
.photo {
|
||||
display: inline-block;
|
||||
|
|
|
@ -2,11 +2,462 @@
|
|||
* @Author: Light
|
||||
* @Date: 2022-11-18 11:53:43
|
||||
* @LastEditors: Light
|
||||
* @LastEditTime: 2022-11-18 11:54:11
|
||||
* @LastEditTime: 2022-11-23 10:32:10
|
||||
* @Description: 告诉大家这是什么
|
||||
-->
|
||||
<template>
|
||||
<div>基础设施申请</div>
|
||||
<div class="infrastructureApplication" v-if="showFlag">
|
||||
<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-popconfirm
|
||||
:title="'是否移出' + item.channelName + '?'"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="delWillApplyCamera(item.id)"
|
||||
>
|
||||
<a-button type="link" danger style="padding: 0">移出</a-button>
|
||||
</a-popconfirm>
|
||||
</a-list-item>
|
||||
</template>
|
||||
<template #header>
|
||||
<div class="title">待申请列表</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="apply">一键申请</a-button>
|
||||
</template>
|
||||
</a-list>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<a-list size="small" bordered :data-source="dataList.requested">
|
||||
<template #renderItem="{ item }">
|
||||
<a-list-item>
|
||||
<div class="name">
|
||||
<a-tooltip>
|
||||
<template #title>{{ item.cameraInfo.channelName }}</template>
|
||||
{{ item.cameraInfo.channelName }}
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-tag
|
||||
color="cyan"
|
||||
style="margin-right: 0"
|
||||
@click="selectItem(item)"
|
||||
>
|
||||
{{ item.approveStatus == '通过' ? '预览' : item.approveStatus }}
|
||||
</a-tag>
|
||||
<a-popconfirm
|
||||
v-if="item.approveStatus == '通过'"
|
||||
:title="'是否撤销' + item.cameraInfo.channelName + '?'"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="deleteApply(item)"
|
||||
>
|
||||
<a-button type="link" danger style="padding: 0">撤销</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button
|
||||
v-else
|
||||
type="link"
|
||||
danger
|
||||
@click="deleteApply(item)"
|
||||
style="padding: 0"
|
||||
>
|
||||
撤销
|
||||
</a-button>
|
||||
</a-list-item>
|
||||
</template>
|
||||
<template #header>
|
||||
<div class="title">
|
||||
已申请列表
|
||||
<a-button type="link" @click="goToApply">详情</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</a-list>
|
||||
</div>
|
||||
</div>
|
||||
<a-modal
|
||||
:width="800"
|
||||
v-model:visible="visible"
|
||||
title="撤销申请"
|
||||
@ok="handleOk"
|
||||
@cancel="clear"
|
||||
>
|
||||
<p>本次申请的视频监控包含以下{{ showArr.length }}个,是否撤销申请?</p>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="showArr"
|
||||
:pagination="{
|
||||
pageSize: 5,
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, text }">
|
||||
<template v-if="column.dataIndex === 'name'">
|
||||
<a>{{ text }}</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-if="dataList.selectItem.cameraInfo"
|
||||
v-model:visible="showVisible"
|
||||
:title="dataList.selectItem.cameraInfo.channelName"
|
||||
:footer="null"
|
||||
@cancel="clear"
|
||||
>
|
||||
<div style="width: 100%; display: flex; justify-content: center">
|
||||
<div style="width: 100%; height: 100%; position: relative">
|
||||
<div class="waterMark waterMark-left-top">
|
||||
{{ userInfo.usernameShow }}
|
||||
</div>
|
||||
<div class="waterMark waterMark-right-top">
|
||||
{{ userInfo.realNameShow }}
|
||||
</div>
|
||||
<div class="waterMark waterMark-left-bottom">
|
||||
{{ userInfo.usernameShow }}
|
||||
</div>
|
||||
<div class="waterMark waterMark-right-bottom">
|
||||
{{ userInfo.realNameShow }}
|
||||
</div>
|
||||
<h5-player :video-url="videoUrl"></h5-player>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup></script>
|
||||
<style lang="less" scoped></style>
|
||||
<script setup>
|
||||
import {
|
||||
willApplyCameraSelect,
|
||||
willApplyCameraBatchInsert,
|
||||
willApplyCameraBatchDelete,
|
||||
getApplyCameraListXha,
|
||||
delApplyCamera,
|
||||
} from '@/api/home'
|
||||
import { getUserInfo, getRole } from '@/api/user'
|
||||
import { endProcess } from '@/api/personalCenter.js'
|
||||
import { onBeforeUnmount, reactive, ref } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
import { useRouter } from 'vue-router'
|
||||
import H5Player from '@/views/home/components/H5Player.vue'
|
||||
import { getCameraLiveStream } from '@/api/file'
|
||||
const dataList = reactive({ toBeApplied: [], requested: [], selectItem: {} })
|
||||
const showVisible = ref(false)
|
||||
// 待办
|
||||
const addWacFlag = ref(true)
|
||||
const delWacFlag = ref(true)
|
||||
const delApply = ref(true)
|
||||
const visible = ref(false)
|
||||
const instanceId = ref('')
|
||||
const showArr = ref({})
|
||||
const columns = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'channelName',
|
||||
key: 'channelName',
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
dataIndex: 'managementUnitName',
|
||||
key: 'managementUnitName',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'cameraPointTypeName',
|
||||
key: 'cameraPointTypeName',
|
||||
ellipsis: true,
|
||||
},
|
||||
]
|
||||
const router = useRouter()
|
||||
const showFlag = ref(false)
|
||||
getUserInfo().then((res) => {
|
||||
if (res.data.data.superAdmin == '1') {
|
||||
showFlag.value = true
|
||||
} else {
|
||||
res.data.data.roleIdList.map((val) => {
|
||||
getRole(val).then((role) => {
|
||||
if (role.data.data.name === '视频管理员') {
|
||||
showFlag.value = 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 apply = () => {
|
||||
let obj = {
|
||||
arr: [
|
||||
{
|
||||
checked: true,
|
||||
delFlag: 0,
|
||||
id: '1593084734789996545',
|
||||
idtCameraChannel: '790582098133127168',
|
||||
loading: false,
|
||||
note1: '',
|
||||
resourceId: '1522550195055828996',
|
||||
resourceName: '视频监控列表',
|
||||
type: '基础设施',
|
||||
},
|
||||
],
|
||||
deptName: '西海岸新区工业和信息化局',
|
||||
deptId: '732560225344761856',
|
||||
}
|
||||
dataList.toBeApplied.map((val) => {
|
||||
val.type = '基础设施'
|
||||
val.delFlag = 0
|
||||
val.resourceId = val.channelId
|
||||
val.resourceName = val.channelName
|
||||
// obj.arr.push(val)
|
||||
})
|
||||
obj.arr[0].note1 = JSON.stringify(dataList.toBeApplied)
|
||||
if (obj.arr.length > 0) {
|
||||
console.log('一键申请===================>', obj)
|
||||
localStorage.setItem('applyList', JSON.stringify([obj]))
|
||||
router.push({
|
||||
path: '/apply',
|
||||
})
|
||||
}
|
||||
}
|
||||
// 撤销已申请
|
||||
const deleteApply = (item) => {
|
||||
console.log('撤销========>', item)
|
||||
if (delApply.value) {
|
||||
delApply.value = false
|
||||
switch (item.approveStatus) {
|
||||
case '审核中':
|
||||
visible.value = true
|
||||
instanceId.value = item.instanceId
|
||||
showArr.value = []
|
||||
dataList.requested.map((val) => {
|
||||
if (val.instanceId == item.instanceId) {
|
||||
showArr.value.push(val.cameraInfo)
|
||||
}
|
||||
})
|
||||
break
|
||||
case '通过':
|
||||
delApplyCamera([item.id]).then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
message.success('撤销成功')
|
||||
} else {
|
||||
message.warning('撤销失败')
|
||||
}
|
||||
initApply()
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
const goToApply = () => {
|
||||
router.push({
|
||||
path: '/personalCenter',
|
||||
query: {
|
||||
type: 'apply',
|
||||
},
|
||||
})
|
||||
}
|
||||
const selectItem = (item) => {
|
||||
if (item.approveStatus == '通过') {
|
||||
dataList.selectItem = item
|
||||
getVideoUrl(item.cameraInfo)
|
||||
} else {
|
||||
dataList.selectItem = {}
|
||||
showVisible.value = false
|
||||
}
|
||||
}
|
||||
const handleOk = () => {
|
||||
endProcess({ instanceId: instanceId.value }).then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
message.success('撤销成功')
|
||||
} else {
|
||||
message.warning('撤销失败')
|
||||
}
|
||||
initApply()
|
||||
visible.value = false
|
||||
})
|
||||
}
|
||||
const clear = () => {
|
||||
console.log('清空')
|
||||
instanceId.value = ''
|
||||
showArr.value = []
|
||||
visible.value = false
|
||||
delApply.value = true
|
||||
dataList.selectItem = {}
|
||||
showVisible.value = false
|
||||
}
|
||||
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 = []
|
||||
}
|
||||
})
|
||||
}
|
||||
const initApply = () => {
|
||||
getApplyCameraListXha().then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
res.data.data.map((val) => {
|
||||
val.cameraInfo = JSON.parse(val.cameraInfo)
|
||||
})
|
||||
dataList.requested = res.data.data
|
||||
delApply.value = true
|
||||
} else {
|
||||
message.warning('查询失败')
|
||||
dataList.requested = []
|
||||
}
|
||||
})
|
||||
}
|
||||
init()
|
||||
initApply()
|
||||
const videoUrl = ref('')
|
||||
//获取视频控件所需播放地址
|
||||
const getVideoUrl = (data) => {
|
||||
let param = data
|
||||
getCameraLiveStream(param).then((res) => {
|
||||
//console.log('555555rrrrr',res)
|
||||
if (res.data.data) {
|
||||
videoUrl.value = res.data.data.url
|
||||
}
|
||||
showVisible.value = true
|
||||
})
|
||||
}
|
||||
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.cameraInfo.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')
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.infrastructureApplication {
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
right: 0.16rem;
|
||||
margin-top: -3.9rem;
|
||||
.bottom {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.name {
|
||||
width: 1.3rem;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all;
|
||||
}
|
||||
.top .name {
|
||||
width: 1.8rem;
|
||||
}
|
||||
:deep(.ant-list-footer) {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
:deep(.ant-list-items) {
|
||||
width: 2.5rem;
|
||||
height: 3rem;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
:deep(.ant-list-item) {
|
||||
padding: 5px 5px 5px 10px;
|
||||
}
|
||||
:deep(.ant-spin-nested-loading) {
|
||||
width: 2.5rem;
|
||||
height: 3rem;
|
||||
}
|
||||
|
||||
.waterMark {
|
||||
position: absolute;
|
||||
z-index: 99999999;
|
||||
color: #0058e1;
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
opacity: 0.4;
|
||||
transform: rotate(-25deg);
|
||||
width: 470px;
|
||||
}
|
||||
|
||||
// 左上
|
||||
.waterMark-left-top {
|
||||
left: 50px;
|
||||
top: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
// 右上
|
||||
.waterMark-right-top {
|
||||
right: 50px;
|
||||
top: 100px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
// 左下
|
||||
.waterMark-left-bottom {
|
||||
left: 50px;
|
||||
bottom: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
// 右下
|
||||
.waterMark-right-bottom {
|
||||
right: 50px;
|
||||
bottom: 100px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<!-- 选项卡 -->
|
||||
<div class="infrastructrue-tab">
|
||||
<div v-for="(item, index) in tabList" :key="index" class="tabBox">
|
||||
<b class="leftType">{{ item.title }}</b>
|
||||
<b class="leftType" v-if="item.title">{{ item.title }}</b>
|
||||
<el-button
|
||||
@click="nullClick"
|
||||
v-if="item.title == '视频标签'"
|
||||
|
@ -128,16 +128,21 @@
|
|||
预约
|
||||
</a-button>
|
||||
</div>
|
||||
|
||||
<!-- <div class="flex-space" style="justify-content: center;display:flex;height:40px;align-items:center;"> -->
|
||||
<a-pagination
|
||||
v-model:current="roomPage"
|
||||
v-model:pageSize="roomLimit"
|
||||
show-quick-jumper
|
||||
:showTotal="total => `共 ${total} 项`"
|
||||
:total="roomTotal"
|
||||
:page-size-options="pageSizeOptions"
|
||||
@change="onRoomChange"
|
||||
@showSizeChange="onShowSizeChange"
|
||||
show-size-changer
|
||||
/>
|
||||
/>
|
||||
<!-- <el-button @click="onOkChange" class="queding" >确认</el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
<div v-if="roomResult" style="display: grid">
|
||||
<a-table
|
||||
|
@ -261,8 +266,7 @@
|
|||
<a-form
|
||||
:model="formState"
|
||||
name="basic"
|
||||
:label-col="{ span: 8 }"
|
||||
:wrapper-col="{ span: 16 }"
|
||||
|
||||
autocomplete="off"
|
||||
@finish="onFinish"
|
||||
@finishFailed="onFinishFailed"
|
||||
|
@ -1440,10 +1444,14 @@
|
|||
}
|
||||
}
|
||||
//分页
|
||||
const onRoomChange = (pageNumber) => {
|
||||
const onRoomChange = () => {
|
||||
roomPage.value = pageNumber
|
||||
searchData()
|
||||
}
|
||||
const onOkChange = () => {
|
||||
current.value = roomPage.value
|
||||
searchData()
|
||||
}
|
||||
const onShowSizeChange = (current, pageSize) => {
|
||||
roomLimit.value = pageSize
|
||||
searchData()
|
||||
|
@ -1566,6 +1574,15 @@
|
|||
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
|
||||
|
@ -1575,6 +1592,15 @@
|
|||
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
|
||||
|
@ -1594,7 +1620,25 @@
|
|||
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
|
||||
|
@ -1614,6 +1658,15 @@
|
|||
}
|
||||
} 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
|
||||
|
@ -1654,6 +1707,15 @@
|
|||
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
|
||||
|
@ -1686,6 +1748,15 @@
|
|||
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
|
||||
|
@ -1728,6 +1799,15 @@
|
|||
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 = []
|
||||
|
@ -2150,10 +2230,6 @@
|
|||
})
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
getCamera,
|
||||
reSetSearch,
|
||||
})
|
||||
//加入申购车
|
||||
const addShoppingCart = () => {
|
||||
if (selectedList.value.length > 0) {
|
||||
|
@ -2323,10 +2399,11 @@
|
|||
}
|
||||
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: '',
|
||||
name: roomStr || '',
|
||||
type: clickList.value[1].content[0],
|
||||
}).then((res) => {
|
||||
console.log('获取政务云资源======》', res.data.data)
|
||||
|
@ -2394,8 +2471,24 @@
|
|||
message.warning(err)
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
getCamera,
|
||||
reSetSearch,
|
||||
getGovernmentCloud,
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.queding{
|
||||
margin-left: 16px;
|
||||
cursor: pointer;
|
||||
background: #0058e1;
|
||||
color: #ffffff;
|
||||
width: 56px;
|
||||
border-radius: 2px;
|
||||
border: 1px #0058e1 solid;
|
||||
margin-top: 17px;
|
||||
}
|
||||
.infrastructrueBox {
|
||||
padding: 0.2rem;
|
||||
background: #ffffff;
|
||||
|
@ -2434,7 +2527,7 @@
|
|||
.infrastructrue-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0.14rem 0.2rem 0.1rem;
|
||||
padding: 0.01rem 0.2rem 0.1rem;
|
||||
background: #ffffff;
|
||||
|
||||
.contentNum {
|
||||
|
@ -2593,7 +2686,7 @@
|
|||
font-size: 14px;
|
||||
}
|
||||
:deep(.ant-form-item-control) {
|
||||
margin-left: -2.1rem;
|
||||
// margin-left: -2.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2728,13 +2821,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
:deep(.ant-pagination) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination) {
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
// :deep(.ant-pagination) {
|
||||
// text-align: end;
|
||||
// }
|
||||
}
|
||||
:deep(.ant-table-thead > tr > th) {
|
||||
color: #5580f7 !important;
|
||||
|
|
|
@ -406,166 +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-if="!wrjFlag && selectType == '政务云资源'"
|
||||
>
|
||||
<GovernmentCloudResources></GovernmentCloudResources>
|
||||
</div>
|
||||
<!-- 西海岸-无人机、单兵设备 -->
|
||||
<div class="infrastructrue-table" v-else-if="isXiHaiAn && wrjFlag">
|
||||
<a-table
|
||||
|
@ -772,12 +613,48 @@
|
|||
</template>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 地图上点或者聚合图层点击后出现的操作弹窗 -->
|
||||
<a-modal
|
||||
wrapClassName="camera-popup"
|
||||
v-model:visible="operationPopupFlag"
|
||||
:width="1000"
|
||||
:title="'视频监控点选择'"
|
||||
destroyOnClose
|
||||
footer="{null}"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<div style="width: 100%; display: flex; justify-content: center">
|
||||
<div
|
||||
style="width: 100%; height: 100%; position: relative"
|
||||
v-show="isXiHaiAn"
|
||||
>
|
||||
<!-- 西海岸--预览视频--遮罩 todo-->
|
||||
<div class="video-cover-new" @click="videoShowMsg"></div>
|
||||
<div class="waterMark waterMark-left-top">
|
||||
{{ userInfo.usernameShow }}
|
||||
</div>
|
||||
<div class="waterMark waterMark-right-top">
|
||||
{{ userInfo.realNameShow }}
|
||||
</div>
|
||||
<div class="waterMark waterMark-left-bottom">
|
||||
{{ userInfo.usernameShow }}
|
||||
</div>
|
||||
<div class="waterMark waterMark-right-bottom">
|
||||
{{ userInfo.realNameShow }}
|
||||
</div>
|
||||
<!--地图上点击之后弹出的操作弹窗-->
|
||||
<camera-popup-on-map :camera-Data-List="cameraDataList" :reset-flag="resetFlag"></camera-popup-on-map>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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'
|
||||
|
@ -1020,6 +897,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
|
||||
|
@ -1104,6 +984,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([])
|
||||
|
@ -2378,6 +2265,17 @@
|
|||
message.warning(err)
|
||||
})
|
||||
}
|
||||
|
||||
//地图视频操作弹窗
|
||||
const operationPopupFlag = ref(false)//地图操作弹窗显示标志位
|
||||
//关闭地图弹窗重新弹窗数字显示标志位
|
||||
const resetFlag = ref(false)
|
||||
|
||||
//地图弹窗右上角按钮关闭事件
|
||||
const handleCancel = () => {
|
||||
//console.log('是否关');
|
||||
resetFlag.value = true
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.infrastructrueBox {
|
||||
|
@ -2523,8 +2421,8 @@
|
|||
|
||||
.map-contain {
|
||||
// width: 9.46rem;
|
||||
height: 4.1rem;
|
||||
margin-left: 0.16rem;
|
||||
height: 6.9rem;
|
||||
margin-left: 0;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
@ -2713,7 +2611,7 @@
|
|||
}
|
||||
|
||||
:deep(.ant-pagination) {
|
||||
float: right;
|
||||
float: center;
|
||||
}
|
||||
|
||||
:deep(.ant-pagination) {
|
||||
|
@ -2733,6 +2631,17 @@
|
|||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
.camera-popup {
|
||||
.ant-modal-body {
|
||||
height: 720px !important;
|
||||
overflow-y: hidden;
|
||||
overflow-x: hidden;
|
||||
padding: 14px;
|
||||
}
|
||||
.ant-modal-footer {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.modalClass {
|
||||
.ant-modal-body {
|
||||
|
@ -2832,6 +2741,19 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.video-cover-new {
|
||||
width: 798px;
|
||||
height: 600px;
|
||||
position: absolute;
|
||||
left: 85px;
|
||||
top: 15px;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: transparent;
|
||||
z-index: 99999999;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.batch-video-cover {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
|
|
|
@ -0,0 +1,381 @@
|
|||
<!--点击地图上单个点或者聚合点之后出现的操作弹窗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">
|
||||
<!-- <div style="background-color:red">11111111</div> -->
|
||||
<div class="arrow-left" @click="handlePrev()"></div>
|
||||
</div>
|
||||
</template>
|
||||
<template #nextArrow>
|
||||
<div class="custom-slick-arrow" style="right: 10px">
|
||||
<!-- <right-circle-outlined /> -->
|
||||
<div class="arrow-right" @click="handleNext()"></div>
|
||||
</div>
|
||||
</template>
|
||||
<div
|
||||
v-for="url in cameraDataList"
|
||||
:width="800"
|
||||
:height="400"
|
||||
:key="url"
|
||||
>
|
||||
</div>
|
||||
</a-carousel>
|
||||
<div class="operation-content" style="position:ab">
|
||||
<div class="video-content">
|
||||
<h5-player :video-url="videoUrl" :stop-flag="selectedFlag"></h5-player>
|
||||
</div>
|
||||
<div class="text-label">
|
||||
<span>{{defaultIndex+1}}</span>/<span>{{cameraDataList.length}}</span>
|
||||
</div>
|
||||
<div class="footer-button" v-if="showFlag">
|
||||
<a-button type="primary" @click="applyNow(cameraDataList[defaultIndex])">立即申请</a-button>
|
||||
<a-button type="primary" style="margin-left:20px" @click="addIntoCart(cameraDataList[defaultIndex])">加入申购车</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</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 { getUserInfo, getRole } from '@/api/user'
|
||||
// import { useRouter } from 'vue-router'
|
||||
import H5Player from '@/views/home/components/H5Player.vue'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { getStreamByChannelCode } from '@/api/videoSurveillance'
|
||||
import {getCameraLiveStream} from '@/api/file'
|
||||
import {willApplyCameraSelect,
|
||||
getApplyCameraListXha,
|
||||
} from '@/api/home'
|
||||
export default {
|
||||
name: '',
|
||||
components: {
|
||||
// VideoPlay,
|
||||
H5Player,
|
||||
LeftCircleOutlined,
|
||||
RightCircleOutlined
|
||||
},
|
||||
props: {
|
||||
cameraDataList: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
},
|
||||
},
|
||||
resetFlag:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
|
||||
getUserInfo().then((res) => {
|
||||
if (res.data.data.superAdmin == '1') {
|
||||
this.showFlag = true
|
||||
} else {
|
||||
res.data.data.roleIdList.map((val) => {
|
||||
getRole(val).then((role) => {
|
||||
if (role.data.data.name === '视频管理员') {
|
||||
this.showFlag = true
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// directives: {
|
||||
// viewer: viewer({
|
||||
// debug: true,
|
||||
// }),
|
||||
// },
|
||||
watch: {
|
||||
resetFlag: {
|
||||
// 关闭弹窗刷新底部个数显示数值
|
||||
handler(newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.defaultIndex = 0;
|
||||
}
|
||||
},
|
||||
// 立即处理 进入页面就触发
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openVideo: false,
|
||||
videoStream: '',
|
||||
videoUrl:'', //视频预览url
|
||||
defaultIndex:0,//默认显示列表中的对一个
|
||||
selectedFlag:true,
|
||||
showFlag:false
|
||||
// router:useRouter()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openCurrentVideo(channelCode) {
|
||||
bus.$emit('openCurrentVideoSurveillance', channelCode)
|
||||
},
|
||||
show() {
|
||||
const viewer = this.$el.querySelector('.images').$viewer
|
||||
viewer.show()
|
||||
},
|
||||
//立即申请
|
||||
applyNow(item){
|
||||
getApplyCameraListXha().then(res => {
|
||||
let flag = true
|
||||
if (res.data.code == 0) {
|
||||
res.data.data.map((val) => {
|
||||
val.cameraInfo = JSON.parse(val.cameraInfo)
|
||||
console.log('applyNowapplyNow',val.cameraInfo);
|
||||
if(flag && val.cameraInfo.channelId == item.channelId){
|
||||
flag = false
|
||||
}
|
||||
})
|
||||
if(flag){
|
||||
willApplyCameraSelect().then(res => {
|
||||
if (res.data.code == 0) {
|
||||
res.data.data.map(val => {
|
||||
if(item.channelId == val.channelId){
|
||||
item.id = val.id
|
||||
}
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
arr: [
|
||||
{
|
||||
checked: true,
|
||||
delFlag: 0,
|
||||
id: '1593084734789996545',
|
||||
idtCameraChannel: '790582098133127168',
|
||||
loading: false,
|
||||
note1: '',
|
||||
resourceId: '1522550195055828996',
|
||||
resourceName: '摄像头列表',
|
||||
type: '基础设施',
|
||||
},
|
||||
],
|
||||
deptName: '西海岸新区工业和信息化局',
|
||||
deptId: '732560225344761856',
|
||||
}
|
||||
item.type = '基础设施'
|
||||
item.delFlag = 0
|
||||
item.resourceId = item.channelId
|
||||
item.resourceName = item.channelName
|
||||
obj.arr[0].note1 = JSON.stringify([item])
|
||||
if (obj.arr.length > 0) {
|
||||
localStorage.setItem('applyList', JSON.stringify([obj]))
|
||||
console.log('applyNowapplyNowobj',obj);
|
||||
this.$router.push({
|
||||
path: '/apply',
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
message.warning('该摄像头已申请!')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//加入申购车
|
||||
addIntoCart(item){
|
||||
console.log('addIntoCartaddIntoCart',item);
|
||||
mybus.emit('selectCamera', item)
|
||||
},
|
||||
//获取视频控件所需播放地址
|
||||
getVideoUrl(data){
|
||||
let param = data;
|
||||
getCameraLiveStream(param).then((res) => {
|
||||
//console.log('555555rrrrr',res)
|
||||
if(res.data.data){
|
||||
this.videoUrl = res.data.data.url;
|
||||
}
|
||||
//visible.value = true
|
||||
//options.src = res.data.data
|
||||
//options.src ="wss://10.134.135.45:6014/proxy/10.10.20.15:559/openUrl/0kIF7La"
|
||||
})
|
||||
},
|
||||
//查看前一个
|
||||
handlePrev(){
|
||||
let maxLength = this.cameraDataList.length-1;
|
||||
console.log('opopopop',this.cameraDataList[maxLength]);
|
||||
if(this.defaultIndex === 0){
|
||||
this.defaultIndex = maxLength;
|
||||
console.log('opopopop',this.cameraDataList[maxLength]);
|
||||
//根据当前数据的channelId查询视频播放的url传递给H5组件调用接口
|
||||
//this.videoUrl =
|
||||
this.getVideoUrl(this.cameraDataList[maxLength]);
|
||||
} else{
|
||||
this.defaultIndex = this.defaultIndex - 1;
|
||||
console.log('uyutyuyopopopop',this.cameraDataList[this.defaultIndex]);
|
||||
this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
|
||||
}
|
||||
|
||||
},
|
||||
//查看下一个
|
||||
handleNext(){
|
||||
let lastIndex = this.cameraDataList.length-1;
|
||||
if(this.defaultIndex === Number(lastIndex)){
|
||||
this.defaultIndex = 0;
|
||||
console.log('opopopop',this.cameraDataList[0]);
|
||||
this.getVideoUrl(this.cameraDataList[0]);
|
||||
}else{
|
||||
this.defaultIndex = this.defaultIndex + 1;
|
||||
console.log('opopopop',this.cameraDataList[this.defaultIndex]);
|
||||
this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
</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;
|
||||
position: relative;
|
||||
.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;
|
||||
}
|
||||
.operation-content{
|
||||
position: absolute;
|
||||
z-index: 800;
|
||||
top: 0.1rem;
|
||||
//right: 0.1rem;
|
||||
left:0.8rem;
|
||||
.text-label{
|
||||
width:800px;
|
||||
height:30px;
|
||||
margin-top:10px;
|
||||
text-align:center;
|
||||
font-size: 18px;
|
||||
}
|
||||
.video-content{
|
||||
width: 750px;
|
||||
height:600px;
|
||||
text-align: left;
|
||||
padding: 5px;
|
||||
}
|
||||
.footer-button{
|
||||
width: 750px;
|
||||
//height:50px;
|
||||
text-align: center;
|
||||
padding-top:5px;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
.arrow-left{
|
||||
width:48px;
|
||||
height:48px;
|
||||
background-image: url('~@/assets/home/arrow-left.png');
|
||||
}
|
||||
.arrow-right{
|
||||
width:48px;
|
||||
height:48px;
|
||||
background-image: url('~@/assets/home/arrow-right.png');
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
}
|
||||
// .current-video {
|
||||
// width: 320px;
|
||||
// height: 180px;
|
||||
// }
|
||||
</style>
|
|
@ -8,23 +8,7 @@
|
|||
</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"
|
||||
|
@ -46,6 +30,49 @@
|
|||
</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-autocomplete
|
||||
v-if="addressType==1"
|
||||
v-model="address"
|
||||
:fetch-suggestions="querySearch"
|
||||
clearable
|
||||
class="input-with-select"
|
||||
placeholder="请输入关键字"
|
||||
@select="
|
||||
(addressItem) => {
|
||||
selectedAddress(addressItem, i)
|
||||
}
|
||||
"
|
||||
/>
|
||||
<!-- <el-input
|
||||
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"
|
||||
|
@ -77,6 +104,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { HieimpMap } from '@/supermap/map-init'
|
||||
import TiledMap from './components/tiledMap'
|
||||
|
@ -92,7 +120,7 @@
|
|||
selectByLabelName,
|
||||
selectByChannelName,
|
||||
} from '@/api/videoSurveillance'
|
||||
import { getCameraByCondition } from '@/api/file'
|
||||
import { getCameraByCondition,getListForPOI,CameraConditionPlaceType } from '@/api/file'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
import * as turf from '@turf/turf';
|
||||
|
||||
|
@ -118,6 +146,7 @@
|
|||
areaModeFlag: false,
|
||||
addressMatchUrl: '',
|
||||
address: '',
|
||||
addressType:'1',
|
||||
whoShow1: whoShow,
|
||||
mapSearchParam: {
|
||||
// 地图搜索初始化数据
|
||||
|
@ -132,11 +161,12 @@
|
|||
type: 0, //0是无,1画圆,2不规则
|
||||
},
|
||||
pointAllData:[],
|
||||
restaurants:[],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
TiledMap,
|
||||
VideoPlay,
|
||||
VideoPlay
|
||||
},
|
||||
created() {},
|
||||
watch: {
|
||||
|
@ -151,19 +181,23 @@
|
|||
this.hiMap.mapObj,
|
||||
this.hiMapFun
|
||||
)
|
||||
//console.log('this.hiMap.mapObj',this.hiMap.mapObj.map.getZoom());
|
||||
// this.hiMap.mapObj.map.flyTo({ lat: 36.06, lng: 120.3899 }, 16)
|
||||
this.addressMatchUrl = window.SITE_CONFIG.POI_URL
|
||||
// 初始化地址检索服务
|
||||
this.initAddressMatchService()
|
||||
this.getCameraAllLabel()
|
||||
// 初始化展示所有摄像头
|
||||
// this.getCameraAllPage()
|
||||
// 初始化展示所有摄像头,地图上扎点
|
||||
this.getCameraAllPage()
|
||||
// this.getMapPoint()
|
||||
// 根据parentId查询摄像头列表
|
||||
// 点击左侧根据parentId查询摄像头列表
|
||||
mybus.off('getCameraByParentId')
|
||||
mybus.on('getCameraByParentId', (parentId) => {
|
||||
debugger
|
||||
this.mapSearchParam.parentId = parentId
|
||||
this.getCameraByParentId()
|
||||
this.mapSearchParam.type = "1"
|
||||
this.mapSearchParam.pageSize = 10000
|
||||
this.getCameraByParentId('','department')
|
||||
})
|
||||
//表格勾选
|
||||
mybus.off('selectTablePoint')
|
||||
|
@ -179,9 +213,101 @@
|
|||
}
|
||||
//this.addResourceTomap('videoMap', this.pointAllData);
|
||||
})
|
||||
|
||||
//所有摄像头数据上图
|
||||
mybus.off('cameraDataOnMap')
|
||||
mybus.on('cameraDataOnMap', (data) => {
|
||||
this.addResourceTomap('videoMap', data)
|
||||
})
|
||||
//行政区划点击查询摄像头
|
||||
mybus.off('CameraConditionPlaceType')
|
||||
mybus.on('CameraConditionPlaceType', (data) => {
|
||||
this.queryCameraConditionPlace(data)
|
||||
|
||||
})
|
||||
|
||||
//清空地图上所有数据
|
||||
mybus.off('clearLeftSelect')
|
||||
mybus.on('clearLeftSelect', () => {
|
||||
this.hiMapFun.clearAllLayers();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//查询标签视频
|
||||
queryCameraConditionPlace(data) {
|
||||
let params = {
|
||||
placeTypeCode: data,
|
||||
pageNum: "1",
|
||||
pageSize: 40000,
|
||||
}
|
||||
CameraConditionPlaceType(params).then((res) => {
|
||||
this.addResourceTomap('videoMap', res.data.data)
|
||||
})
|
||||
},
|
||||
// 查询
|
||||
querySearch (queryString, cb) {
|
||||
console.log('querySearch',queryString, cb,this.restaurants)
|
||||
if(queryString){
|
||||
getListForPOI({keywords:queryString}).then(res => {
|
||||
if(res.data.data.rows[0]){
|
||||
res.data.data.rows.map( val =>{
|
||||
let arr = val.location.split(',')
|
||||
val.location = {y:arr[1],x:arr[0]}
|
||||
val.value = val.name
|
||||
})
|
||||
const results =res.data.data.rows
|
||||
cb(results)
|
||||
}else{
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: '未查询到兴趣点!',
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
cb([])
|
||||
}
|
||||
// const results = queryString
|
||||
// ? this.restaurants.filter(createFilter(queryString))
|
||||
// : this.restaurants
|
||||
// call callback function to return suggestions
|
||||
},
|
||||
createFilter (queryString) {
|
||||
return (restaurant) => {
|
||||
return (
|
||||
restaurant.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
||||
)
|
||||
}
|
||||
},
|
||||
// 查询
|
||||
handleEnter(queryString, cb){
|
||||
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) {
|
||||
mybus.emit('clearChoose')
|
||||
this.getCameraAllPage()
|
||||
// 跳转到相应经纬度
|
||||
console.log('跳转', item)
|
||||
const latLng = {
|
||||
|
@ -189,6 +315,9 @@
|
|||
lng: item.location.x,
|
||||
}
|
||||
this.hiMapFun.mapFlyTo(latLng)
|
||||
if(this.addressType=='2'){
|
||||
mybus.emit('openOperationPopup', [item]);
|
||||
}
|
||||
},
|
||||
//框选
|
||||
areaSelectResource(){
|
||||
|
@ -270,15 +399,14 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
getCameraByParentId(type) {
|
||||
getCameraByParentId(type,dataName) {
|
||||
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 ||
|
||||
|
@ -307,8 +435,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
if(dataName){
|
||||
params.type='0';
|
||||
}
|
||||
getCameraByCondition(params).then((res) => {
|
||||
console.log('根据parent查询摄像头', res.data.data)
|
||||
//console.log('根据parent查询摄像头44444', res.data.data)
|
||||
if(type=='map'){
|
||||
let params = this.mapSearchParam;
|
||||
params.dataSource = res.data.data||0;
|
||||
|
@ -318,17 +449,19 @@
|
|||
this.pointAllData = res.data.data;
|
||||
if(this.mapSearchParam.type!=0)
|
||||
this.addResourceTomap('videoMap', res.data.data)
|
||||
|
||||
else
|
||||
this.addResourceTomap('videoMap', []) //查询全部时不打点
|
||||
this.addResourceTomap('videoMap', []) //查询全部时不打点}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
// 初始化地址匹配服务
|
||||
initAddressMatchService() {
|
||||
this.L = window.L || {}
|
||||
this.addressMatchService = L.supermap.addressMatchService(
|
||||
this.addressMatchUrl
|
||||
)
|
||||
// this.addressMatchService = L.supermap.addressMatchService(
|
||||
// this.addressMatchUrl
|
||||
// )
|
||||
},
|
||||
areaMode(){
|
||||
// 转换不规则形状模式
|
||||
|
@ -392,40 +525,46 @@
|
|||
},
|
||||
//查询地址建议匹配
|
||||
async searchAddressByKeyWord(queryString, cb, indexX) {
|
||||
this.disasterPointIndex = indexX
|
||||
/* const res = await bdPlaceSearch({ searchKey: queryString });
|
||||
if (res.data) {
|
||||
for(var i=0;i<res.data.length;i++){
|
||||
res.data[i].value = res.data[i].name;
|
||||
}
|
||||
cb(res.data);
|
||||
}*/
|
||||
const match = function (obj) {
|
||||
//console.log('ooooo',obj);
|
||||
obj.result.map((item) => {
|
||||
item.value = item.address
|
||||
console.log('querySearch',queryString, cb,this.restaurants)
|
||||
if(queryString){
|
||||
getCameraByCondition({
|
||||
pageNum: 1,
|
||||
pageSize: 40000,
|
||||
regionId: "70be8c5b664f4bcf869d82f2e8335051",
|
||||
type: "0",
|
||||
name:queryString,
|
||||
}).then(res => {
|
||||
if(res.data.data[0]){
|
||||
res.data.data.map( val =>{
|
||||
val.location = {y:val.gpsY,x:val.gpsX}
|
||||
val.value = val.channelName
|
||||
})
|
||||
const results = res.data.data
|
||||
cb(results)
|
||||
}else{
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: '未查询到点位!',
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
})
|
||||
cb(obj.result)
|
||||
}
|
||||
if (!queryString) {
|
||||
}else{
|
||||
cb([])
|
||||
} else {
|
||||
var geoCodeParam = new SuperMap.GeoCodingParameter({
|
||||
address: queryString,
|
||||
})
|
||||
this.addressMatchService.code(geoCodeParam, match)
|
||||
}
|
||||
},
|
||||
getCameraAllPage(page) {
|
||||
let params = {
|
||||
name: '',
|
||||
page: page,
|
||||
pageSize: 20000,
|
||||
regionId: "70be8c5b664f4bcf869d82f2e8335051",
|
||||
pageNum: "1",
|
||||
pageSize: 40000,
|
||||
type: 0,
|
||||
borderPolygonList: []
|
||||
}
|
||||
getCameraAll(params).then((res) => {
|
||||
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));
|
||||
})
|
||||
|
@ -463,6 +602,7 @@
|
|||
},
|
||||
|
||||
addResourceTomap(type, data) {
|
||||
console.log('datadatadata',data);
|
||||
const dataEvent = []
|
||||
if(data&&data.length>0){
|
||||
data.forEach((item) => {
|
||||
|
@ -481,7 +621,7 @@
|
|||
this.getMapPoint(dataEvent, 'icon_camare.png', type)
|
||||
},
|
||||
getMapPoint(data, img, type) {
|
||||
// this.hiMapFun.clearAllLayers();
|
||||
//this.hiMapFun.clearAllLayers();
|
||||
const features = data
|
||||
// debugger
|
||||
this.hiMapFun.addResourceOnMapWithoutSuperMapCluster(
|
||||
|
@ -501,6 +641,7 @@
|
|||
}
|
||||
},
|
||||
handleSelect(item) {
|
||||
console.log('1111',item)
|
||||
this.hiMapFun.clearAllLayers()
|
||||
//定时器方法
|
||||
let arr = item.detail.location.split(',')
|
||||
|
@ -666,6 +807,14 @@
|
|||
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;
|
||||
|
@ -678,4 +827,13 @@
|
|||
max-width: 2.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.input-with-select{
|
||||
width: 2.4rem;
|
||||
svg{
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -193,7 +193,7 @@
|
|||
v-if="
|
||||
item.approveStatus == '通过' && whoShow1.itShowXiHaiAn
|
||||
"
|
||||
@click.stop="openVideo(val)"
|
||||
@click.stop="getVideoUrl(val)"
|
||||
>
|
||||
视频预览
|
||||
</a-button>
|
||||
|
@ -280,7 +280,7 @@
|
|||
wrapClassName="single-preview-modal"
|
||||
v-model:visible="visible"
|
||||
title="视频预览"
|
||||
:width="960"
|
||||
:width="1000"
|
||||
destroyOnClose
|
||||
>
|
||||
<template #footer></template>
|
||||
|
@ -299,7 +299,8 @@
|
|||
<div class="waterMark waterMark-right-bottom">
|
||||
{{ userInfo.realNameShow }}
|
||||
</div>
|
||||
<vue3VideoPlay v-bind="options" />
|
||||
<!-- <vue3VideoPlay v-bind="options" /> -->
|
||||
<h5-player :video-url="videoUrl"></h5-player>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
|
@ -313,6 +314,8 @@
|
|||
import { useRouter } from 'vue-router'
|
||||
import { getStreamByChannelCode } from '@/api/videoSurveillance'
|
||||
import { getUser } from '@/api/home'
|
||||
import H5Player from '@/views/home/components/H5Player.vue'
|
||||
import {getCameraLiveStream} from '@/api/file'
|
||||
const router = useRouter()
|
||||
const backUrl = ref(window.SITE_CONFIG.apiURL + '/')
|
||||
const props = defineProps({
|
||||
|
@ -511,6 +514,20 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
const videoUrl = ref('')
|
||||
//获取视频控件所需播放地址
|
||||
const getVideoUrl = (data) =>{
|
||||
debugger
|
||||
let param = data;
|
||||
getCameraLiveStream(param).then((res) => {
|
||||
//console.log('555555rrrrr',res)
|
||||
if(res.data.data){
|
||||
videoUrl.value = res.data.data.url;
|
||||
}
|
||||
visible.value = true
|
||||
})
|
||||
}
|
||||
// 视频预览
|
||||
const openVideo = (item) => {
|
||||
console.log('打开视频', item)
|
||||
|
|
Loading…
Reference in New Issue