|
@ -3,21 +3,33 @@ |
|
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
<a-row> |
|
|
<a-row> |
|
|
<a-col :span="24"> |
|
|
<a-col :span="24"> |
|
|
<a-form-item label="模型编号" v-bind="validateInfos.modelCode"> |
|
|
<a-form-item label="监控相机" v-bind="validateInfos.cameraId"> |
|
|
<a-input v-model:value="formData.modelCode" placeholder="请输入模型编号" :disabled="disabled"></a-input> |
|
|
<a-tree-select v-model:value="formData.cameraId" allow-clear :treeData="cameraList" :disabled="disabled" placeholder="请选择监控相机"> |
|
|
|
|
|
</a-tree-select> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
</a-col> |
|
|
</a-col> |
|
|
<a-col :span="24"> |
|
|
<a-col :span="24"> |
|
|
<a-form-item label="模型名称" v-bind="validateInfos.modelName"> |
|
|
<a-form-item label="监控模型" v-bind="validateInfos.modelCode" name="modelCode"> |
|
|
<a-input v-model:value="formData.modelName" placeholder="请输入模型名称" :disabled="disabled"></a-input> |
|
|
<!-- <a-input v-model:value="formData.modelCode" placeholder="请输入模型编号" :disabled="disabled"></a-input> --> |
|
|
|
|
|
<a-select v-model:value="formData.modelCode" placeholder="请选择监控模型" :disabled="disabled"> |
|
|
|
|
|
<template :key="code.modelCode" v-for="code in modelCodeList"> |
|
|
|
|
|
<a-select-option :value="code.modelCode">{{ code.modelName }}</a-select-option> |
|
|
|
|
|
</template> |
|
|
|
|
|
</a-select> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
</a-col> |
|
|
</a-col> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <a-col :span="24"> |
|
|
|
|
|
<a-form-item label="模型名称" v-bind="validateInfos.modelName"> |
|
|
|
|
|
<a-input v-model:value="formData.modelName" placeholder="请输入模型名称 " :disabled="disabled"></a-input> |
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
</a-col> --> |
|
|
<a-col :span="24" v-show="!disabled"> |
|
|
<a-col :span="24" v-show="!disabled"> |
|
|
<a-form-item label="标注区域"> |
|
|
<a-form-item label="标注区域"> |
|
|
<img :src="locationPng" @click="videoShow" class="dwImg" alt="绘制标注数据" /> |
|
|
<img :src="locationPng" @click="videoShow" class="dwImg" alt="绘制标注数据" /> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
</a-col> |
|
|
</a-col> |
|
|
<a-col :span="24"> |
|
|
<!-- <a-col :span="24"> |
|
|
<a-form-item label="rtsp地址" v-bind="validateInfos.rtspUrl"> |
|
|
<a-form-item label="rtsp地址" v-bind="validateInfos.rtspUrl"> |
|
|
<a-tree-select |
|
|
<a-tree-select |
|
|
v-model:value="formData.rtspUrl" |
|
|
v-model:value="formData.rtspUrl" |
|
@ -29,20 +41,8 @@ |
|
|
> |
|
|
> |
|
|
</a-tree-select> |
|
|
</a-tree-select> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
</a-col> |
|
|
</a-col> --> |
|
|
<a-col :span="24"> |
|
|
|
|
|
<a-form-item label="webrtc地址" v-bind="validateInfos.webrtcUrl"> |
|
|
|
|
|
<a-tree-select |
|
|
|
|
|
v-model:value="formData.webrtcUrl" |
|
|
|
|
|
@change="getvideoUrl($event, 'webrtc')" |
|
|
|
|
|
allow-clear |
|
|
|
|
|
:treeData="cameraList" |
|
|
|
|
|
:disabled="disabled" |
|
|
|
|
|
placeholder="请选择webrtc地址" |
|
|
|
|
|
> |
|
|
|
|
|
</a-tree-select> |
|
|
|
|
|
</a-form-item> |
|
|
|
|
|
</a-col> |
|
|
|
|
|
<a-col :span="24"> |
|
|
<a-col :span="24"> |
|
|
<a-form-item label="模型范围数据" v-bind="validateInfos.areaData"> |
|
|
<a-form-item label="模型范围数据" v-bind="validateInfos.areaData"> |
|
|
<a-textarea v-model:value="formData.areaData" rows="4" placeholder="请输入模型范围数据" :disabled="disabled" /> |
|
|
<a-textarea v-model:value="formData.areaData" rows="4" placeholder="请输入模型范围数据" :disabled="disabled" /> |
|
@ -82,12 +82,7 @@ |
|
|
</a-row> |
|
|
</a-row> |
|
|
</a-form> |
|
|
</a-form> |
|
|
</a-spin> |
|
|
</a-spin> |
|
|
<SelectCom |
|
|
<SelectCom v-if="videoVisible" :videoUrl="rtspUrl" v-model:labelData="formData.drawdata" v-model:locationData="formData.areaData"></SelectCom> |
|
|
v-if="videoVisible" |
|
|
|
|
|
:videoUrl="formData.rtspUrl" |
|
|
|
|
|
v-model:labelData="formData.drawdata" |
|
|
|
|
|
v-model:locationData="formData.areaData" |
|
|
|
|
|
></SelectCom> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
@ -103,7 +98,22 @@ |
|
|
|
|
|
|
|
|
// 相机地址列表 |
|
|
// 相机地址列表 |
|
|
const cameraList: any = ref([]); |
|
|
const cameraList: any = ref([]); |
|
|
|
|
|
// rtsp地址 |
|
|
|
|
|
const rtspUrl = ref(''); |
|
|
|
|
|
// 获取单个相机信息 |
|
|
|
|
|
function getCameraInfo() { |
|
|
|
|
|
defHttp.get({ url: '/military/camera/setting/queryById', params: { id: formData.cameraId } }).then((res) => { |
|
|
|
|
|
// 获取rtsp地址 |
|
|
|
|
|
rtspUrl.value = res.preRtsp; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 模型编码 |
|
|
|
|
|
const modelCodeList: any = ref([]); |
|
|
|
|
|
// 获取模型编码 |
|
|
|
|
|
const getmodelCodeList = () => { |
|
|
|
|
|
return defHttp.get({ url: '/military/dtAiModel/list' }, { isTransformResponse: false }); |
|
|
|
|
|
}; |
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
formDisabled: { type: Boolean, default: false }, |
|
|
formDisabled: { type: Boolean, default: false }, |
|
|
formData: { type: Object, default: () => {} }, |
|
|
formData: { type: Object, default: () => {} }, |
|
@ -114,12 +124,12 @@ |
|
|
const emit = defineEmits(['register', 'ok']); |
|
|
const emit = defineEmits(['register', 'ok']); |
|
|
const formData = reactive<Record<string, any>>({ |
|
|
const formData = reactive<Record<string, any>>({ |
|
|
id: '', |
|
|
id: '', |
|
|
modelCode: '', |
|
|
modelCode: undefined, |
|
|
modelName: '', |
|
|
modelName: '', |
|
|
areaData: '', |
|
|
areaData: '', |
|
|
drawdata: '', |
|
|
drawdata: '', |
|
|
rtspUrl: '', |
|
|
// rtspUrl: '', |
|
|
webrtcUrl: '', |
|
|
cameraId: undefined, |
|
|
remark: '', |
|
|
remark: '', |
|
|
field2: '', |
|
|
field2: '', |
|
|
field3: '', |
|
|
field3: '', |
|
@ -135,7 +145,25 @@ |
|
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); |
|
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true }); |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
|
|
|
// 获取相机数据 |
|
|
getCameraList(); |
|
|
getCameraList(); |
|
|
|
|
|
//获取模型编码 |
|
|
|
|
|
getmodelCodeList().then((response) => { |
|
|
|
|
|
if (response.success) { |
|
|
|
|
|
// console.log(response.result.records); |
|
|
|
|
|
let res: any = []; |
|
|
|
|
|
response.result.records.forEach((item) => { |
|
|
|
|
|
let ele = { |
|
|
|
|
|
modelCode: item.modelCode, |
|
|
|
|
|
modelName: item.modelName, |
|
|
|
|
|
}; |
|
|
|
|
|
res.push(ele); |
|
|
|
|
|
}); |
|
|
|
|
|
if (res.length == response.result.records.length) { |
|
|
|
|
|
modelCodeList.value = res; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
// 获取所有相机列表数据 |
|
|
// 获取所有相机列表数据 |
|
|
function getCameraList() { |
|
|
function getCameraList() { |
|
@ -151,6 +179,8 @@ |
|
|
) |
|
|
) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
|
|
|
console.log(res.result); |
|
|
|
|
|
|
|
|
cameraList.value = handleCameraTree(res.result); |
|
|
cameraList.value = handleCameraTree(res.result); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -182,31 +212,33 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 获取rtspUrl - 根据站点id获取信息 |
|
|
// 获取rtspUrl - 根据站点id获取信息 |
|
|
function getvideoUrl(event, urlType) { |
|
|
// function getvideoUrl(event, urlType) { |
|
|
defHttp |
|
|
// defHttp |
|
|
.get( |
|
|
// .get( |
|
|
{ |
|
|
// { |
|
|
url: '/military/camera/setting/queryById', |
|
|
// url: '/military/camera/setting/queryById', |
|
|
params: { id: event }, |
|
|
// params: { id: event }, |
|
|
}, |
|
|
// }, |
|
|
{ isTransformResponse: false } |
|
|
// { isTransformResponse: false } |
|
|
) |
|
|
// ) |
|
|
.then((res) => { |
|
|
// .then((res) => { |
|
|
if (urlType == 'rtsp') { |
|
|
// if (urlType == 'rtsp') { |
|
|
formData.rtspUrl = res.result.preRtsp; |
|
|
// formData.rtspUrl = res.result.preRtsp; |
|
|
formData.webrtcUrl = ''; |
|
|
// formData.webrtcUrl = ''; |
|
|
} else { |
|
|
// } else { |
|
|
formData.webrtcUrl = res.result.webcastAddress; |
|
|
// formData.webrtcUrl = res.result.webcastAddress; |
|
|
formData.rtspUrl = ''; |
|
|
// formData.rtspUrl = ''; |
|
|
} |
|
|
// } |
|
|
}); |
|
|
// }); |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
// 标绘组件显隐 |
|
|
// 标绘组件显隐 |
|
|
const videoVisible = ref(false); |
|
|
const videoVisible = ref(false); |
|
|
// 显示组件 |
|
|
// 显示组件 |
|
|
function videoShow() { |
|
|
function videoShow() { |
|
|
videoVisible.value = true; |
|
|
videoVisible.value = true; |
|
|
|
|
|
// 获取监控相机信息 |
|
|
|
|
|
getCameraInfo(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 表单禁用 |
|
|
// 表单禁用 |
|
|