diff --git a/public/config/config.json b/public/config/config.json index 2ecfbfe..a1d00a8 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,8 +4,6 @@ "deployPathDec": "****************注意:这个/alarm的alarm一定要改成部署的文件夹的名字***************************", "deployPath": "/safe", "mediaBaseUrl": "http://192.168.83.42:8099", - "lat-bd": "39.91459528", - "lng-bd": "116.26499505", "lat": "39.90", "lng": "116.39", "minZoom": "1", diff --git a/public/config/config.json b/public/config/config.json index 2ecfbfe..a1d00a8 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,8 +4,6 @@ "deployPathDec": "****************注意:这个/alarm的alarm一定要改成部署的文件夹的名字***************************", "deployPath": "/safe", "mediaBaseUrl": "http://192.168.83.42:8099", - "lat-bd": "39.91459528", - "lng-bd": "116.26499505", "lat": "39.90", "lng": "116.39", "minZoom": "1", diff --git a/src/api/indexGm.ts b/src/api/indexGm.ts index 7f0fa35..1547d32 100644 --- a/src/api/indexGm.ts +++ b/src/api/indexGm.ts @@ -139,31 +139,7 @@ }, (error) => { // 处理文件下载的错误提示 - if (error.response && error.response.data instanceof Blob) { - const reader = new FileReader() - reader.onload = (e) => { - let errMsg = '发生错误!' - if (e && e.target!.result) { - errMsg = JSON.parse(e.target!.result as string) - } - ElMessage.warning(errMsg) - } - } - else if (error.response && error.response.data) { - // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) - if (needLogin > -1) { - toLogin() - } - else { - const message: string = error.response.data.message - ElMessage({ - message, - type: 'warning', - }) - } - } - else if (error.message) { + if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' @@ -174,10 +150,11 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - ElMessage({ - message, - type: 'warning', - }) + // ElMessage({ + // message, + // type: 'warning', + // }) + console.log(message) } return Promise.reject(error) }, diff --git a/public/config/config.json b/public/config/config.json index 2ecfbfe..a1d00a8 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,8 +4,6 @@ "deployPathDec": "****************注意:这个/alarm的alarm一定要改成部署的文件夹的名字***************************", "deployPath": "/safe", "mediaBaseUrl": "http://192.168.83.42:8099", - "lat-bd": "39.91459528", - "lng-bd": "116.26499505", "lat": "39.90", "lng": "116.39", "minZoom": "1", diff --git a/src/api/indexGm.ts b/src/api/indexGm.ts index 7f0fa35..1547d32 100644 --- a/src/api/indexGm.ts +++ b/src/api/indexGm.ts @@ -139,31 +139,7 @@ }, (error) => { // 处理文件下载的错误提示 - if (error.response && error.response.data instanceof Blob) { - const reader = new FileReader() - reader.onload = (e) => { - let errMsg = '发生错误!' - if (e && e.target!.result) { - errMsg = JSON.parse(e.target!.result as string) - } - ElMessage.warning(errMsg) - } - } - else if (error.response && error.response.data) { - // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) - if (needLogin > -1) { - toLogin() - } - else { - const message: string = error.response.data.message - ElMessage({ - message, - type: 'warning', - }) - } - } - else if (error.message) { + if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' @@ -174,10 +150,11 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - ElMessage({ - message, - type: 'warning', - }) + // ElMessage({ + // message, + // type: 'warning', + // }) + console.log(message) } return Promise.reject(error) }, diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index e9eb79d..bc3af96 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -6,6 +6,7 @@ const route = useRoute() const router = useRouter() const settingsStore = useSettingsStore() +const systemType = ref('') const enableSubMenuCollapseButton = computed(() => { return settingsStore.mode === 'mobile' || ( @@ -30,6 +31,7 @@ const scrollTop = ref(0) onMounted(() => { + systemType.value = window.localStorage.getItem('systemType') as string window.addEventListener('scroll', onScroll) }) onUnmounted(() => { @@ -72,7 +74,7 @@ - {{ item.title }} + {{ item.title }} - 内部 diff --git a/public/config/config.json b/public/config/config.json index 2ecfbfe..a1d00a8 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,8 +4,6 @@ "deployPathDec": "****************注意:这个/alarm的alarm一定要改成部署的文件夹的名字***************************", "deployPath": "/safe", "mediaBaseUrl": "http://192.168.83.42:8099", - "lat-bd": "39.91459528", - "lng-bd": "116.26499505", "lat": "39.90", "lng": "116.39", "minZoom": "1", diff --git a/src/api/indexGm.ts b/src/api/indexGm.ts index 7f0fa35..1547d32 100644 --- a/src/api/indexGm.ts +++ b/src/api/indexGm.ts @@ -139,31 +139,7 @@ }, (error) => { // 处理文件下载的错误提示 - if (error.response && error.response.data instanceof Blob) { - const reader = new FileReader() - reader.onload = (e) => { - let errMsg = '发生错误!' - if (e && e.target!.result) { - errMsg = JSON.parse(e.target!.result as string) - } - ElMessage.warning(errMsg) - } - } - else if (error.response && error.response.data) { - // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) - if (needLogin > -1) { - toLogin() - } - else { - const message: string = error.response.data.message - ElMessage({ - message, - type: 'warning', - }) - } - } - else if (error.message) { + if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' @@ -174,10 +150,11 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - ElMessage({ - message, - type: 'warning', - }) + // ElMessage({ + // message, + // type: 'warning', + // }) + console.log(message) } return Promise.reject(error) }, diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index e9eb79d..bc3af96 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -6,6 +6,7 @@ const route = useRoute() const router = useRouter() const settingsStore = useSettingsStore() +const systemType = ref('') const enableSubMenuCollapseButton = computed(() => { return settingsStore.mode === 'mobile' || ( @@ -30,6 +31,7 @@ const scrollTop = ref(0) onMounted(() => { + systemType.value = window.localStorage.getItem('systemType') as string window.addEventListener('scroll', onScroll) }) onUnmounted(() => { @@ -72,7 +74,7 @@ - {{ item.title }} + {{ item.title }} - 内部 diff --git a/src/utils/download.ts b/src/utils/download.ts index 2c7964f..2254411 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -133,7 +133,8 @@ ) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - name = `【${response.data[index].name}】${name}` + // name = `【${response.data[index].name}】${name}` + name = `【内部】${name}` } } } diff --git a/public/config/config.json b/public/config/config.json index 2ecfbfe..a1d00a8 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,8 +4,6 @@ "deployPathDec": "****************注意:这个/alarm的alarm一定要改成部署的文件夹的名字***************************", "deployPath": "/safe", "mediaBaseUrl": "http://192.168.83.42:8099", - "lat-bd": "39.91459528", - "lng-bd": "116.26499505", "lat": "39.90", "lng": "116.39", "minZoom": "1", diff --git a/src/api/indexGm.ts b/src/api/indexGm.ts index 7f0fa35..1547d32 100644 --- a/src/api/indexGm.ts +++ b/src/api/indexGm.ts @@ -139,31 +139,7 @@ }, (error) => { // 处理文件下载的错误提示 - if (error.response && error.response.data instanceof Blob) { - const reader = new FileReader() - reader.onload = (e) => { - let errMsg = '发生错误!' - if (e && e.target!.result) { - errMsg = JSON.parse(e.target!.result as string) - } - ElMessage.warning(errMsg) - } - } - else if (error.response && error.response.data) { - // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) - if (needLogin > -1) { - toLogin() - } - else { - const message: string = error.response.data.message - ElMessage({ - message, - type: 'warning', - }) - } - } - else if (error.message) { + if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' @@ -174,10 +150,11 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - ElMessage({ - message, - type: 'warning', - }) + // ElMessage({ + // message, + // type: 'warning', + // }) + console.log(message) } return Promise.reject(error) }, diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index e9eb79d..bc3af96 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -6,6 +6,7 @@ const route = useRoute() const router = useRouter() const settingsStore = useSettingsStore() +const systemType = ref('') const enableSubMenuCollapseButton = computed(() => { return settingsStore.mode === 'mobile' || ( @@ -30,6 +31,7 @@ const scrollTop = ref(0) onMounted(() => { + systemType.value = window.localStorage.getItem('systemType') as string window.addEventListener('scroll', onScroll) }) onUnmounted(() => { @@ -72,7 +74,7 @@ - {{ item.title }} + {{ item.title }} - 内部 diff --git a/src/utils/download.ts b/src/utils/download.ts index 2c7964f..2254411 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -133,7 +133,8 @@ ) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - name = `【${response.data[index].name}】${name}` + // name = `【${response.data[index].name}】${name}` + name = `【内部】${name}` } } } diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts index a58eaf5..6503713 100644 --- a/src/utils/exportUtils.ts +++ b/src/utils/exportUtils.ts @@ -14,7 +14,8 @@ const index = response.data.findIndex((item: { value: string | null }) => item.value === level) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - fileName = `【${response.data[index].name}】${fileName}` + // fileName = `【${response.data[index].name}】${fileName}` + fileName = `【内部】${fileName}` } } } diff --git a/public/config/config.json b/public/config/config.json index 2ecfbfe..a1d00a8 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,8 +4,6 @@ "deployPathDec": "****************注意:这个/alarm的alarm一定要改成部署的文件夹的名字***************************", "deployPath": "/safe", "mediaBaseUrl": "http://192.168.83.42:8099", - "lat-bd": "39.91459528", - "lng-bd": "116.26499505", "lat": "39.90", "lng": "116.39", "minZoom": "1", diff --git a/src/api/indexGm.ts b/src/api/indexGm.ts index 7f0fa35..1547d32 100644 --- a/src/api/indexGm.ts +++ b/src/api/indexGm.ts @@ -139,31 +139,7 @@ }, (error) => { // 处理文件下载的错误提示 - if (error.response && error.response.data instanceof Blob) { - const reader = new FileReader() - reader.onload = (e) => { - let errMsg = '发生错误!' - if (e && e.target!.result) { - errMsg = JSON.parse(e.target!.result as string) - } - ElMessage.warning(errMsg) - } - } - else if (error.response && error.response.data) { - // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) - if (needLogin > -1) { - toLogin() - } - else { - const message: string = error.response.data.message - ElMessage({ - message, - type: 'warning', - }) - } - } - else if (error.message) { + if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' @@ -174,10 +150,11 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - ElMessage({ - message, - type: 'warning', - }) + // ElMessage({ + // message, + // type: 'warning', + // }) + console.log(message) } return Promise.reject(error) }, diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index e9eb79d..bc3af96 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -6,6 +6,7 @@ const route = useRoute() const router = useRouter() const settingsStore = useSettingsStore() +const systemType = ref('') const enableSubMenuCollapseButton = computed(() => { return settingsStore.mode === 'mobile' || ( @@ -30,6 +31,7 @@ const scrollTop = ref(0) onMounted(() => { + systemType.value = window.localStorage.getItem('systemType') as string window.addEventListener('scroll', onScroll) }) onUnmounted(() => { @@ -72,7 +74,7 @@ - {{ item.title }} + {{ item.title }} - 内部 diff --git a/src/utils/download.ts b/src/utils/download.ts index 2c7964f..2254411 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -133,7 +133,8 @@ ) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - name = `【${response.data[index].name}】${name}` + // name = `【${response.data[index].name}】${name}` + name = `【内部】${name}` } } } diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts index a58eaf5..6503713 100644 --- a/src/utils/exportUtils.ts +++ b/src/utils/exportUtils.ts @@ -14,7 +14,8 @@ const index = response.data.findIndex((item: { value: string | null }) => item.value === level) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - fileName = `【${response.data[index].name}】${fileName}` + // fileName = `【${response.data[index].name}】${fileName}` + fileName = `【内部】${fileName}` } } } diff --git a/src/views/alarm/policyConfig/monitorPoint/editDialog.vue b/src/views/alarm/policyConfig/monitorPoint/editDialog.vue index 5d0c31b..d9522f3 100644 --- a/src/views/alarm/policyConfig/monitorPoint/editDialog.vue +++ b/src/views/alarm/policyConfig/monitorPoint/editDialog.vue @@ -67,8 +67,8 @@ recognitionInterval: [{ required: true, message: '识别间隔必填', trigger: ['blur', 'change'] }], alarmInterval: [{ required: true, message: '告警间隔必填', trigger: ['blur', 'change'] }], type: [{ required: true, message: '场景模式必选', trigger: ['blur', 'change'] }], - sceneId: [{ required: true, message: '业务场景必选', trigger: ['blur', 'change'] }], - algoModelId: [{ required: true, message: '算法名称必选', trigger: ['blur', 'change'] }], + // sceneId: [{ required: true, message: '业务场景必选', trigger: ['blur', 'change'] }], + // algoModelId: [{ required: true, message: '算法名称必选', trigger: ['blur', 'change'] }], recognitionUrl: [{ required: true, message: '识别流地址必填', trigger: ['blur', 'change'] }], rtspUrl: [{ required: true, message: 'rtsp地址必填', trigger: ['blur', 'change'] }], mediaServerId: [{ required: true, message: '流媒体必选', trigger: ['blur', 'change'] }], @@ -139,10 +139,10 @@ function submitForm() { console.log('-------表单提交算法校验---------', recognitionList.value) if (`${formData.value.type}` === '0') { // 算法关联 - if (!selectModelList.value.length) { - ElMessage.warning('请选择报警对象') - return false - } + // if (!selectModelList.value.length) { + // ElMessage.warning('请选择报警对象') + // return false + // } // const checkList = [] as any // selectModelList.value.forEach((item: { recognitionTypeId: string }) => { // const index = recognitionList.value.findIndex((i: { recognitionTypeId: string }) => i.recognitionTypeId === item.recognitionTypeId) @@ -205,16 +205,18 @@ } else if (formData.value.type === 1) { // 业务场景 let tempBoundary = [] - tempBoundary = points.value[0].boundary.map((e: any) => { - return { - ...e, - // x: (e.x / videoWidth.value).toFixed(4), - // y: (e.y / videoHeight.value).toFixed(4), - x: Number(useCalc(Number(e.x), Number(videoWidth.value), '/')).toFixed(2), - y: Number(useCalc(Number(e.y), Number(videoHeight.value), '/')).toFixed(2), - } - }) - if (currentDrawButton.value === '1') { // 固定是矩形 + if (points.value && points.value.length) { + tempBoundary = points.value[0].boundary.map((e: any) => { + return { + ...e, + // x: (e.x / videoWidth.value).toFixed(4), + // y: (e.y / videoHeight.value).toFixed(4), + x: Number(useCalc(Number(e.x), Number(videoWidth.value), '/')).toFixed(2), + y: Number(useCalc(Number(e.y), Number(videoHeight.value), '/')).toFixed(2), + } + }) + } + if (currentDrawButton.value === '1' && tempBoundary.length) { // 固定是矩形 tempBoundary[1].y = tempBoundary[0].y tempBoundary[3].y = tempBoundary[2].y tempBoundary[3].x = tempBoundary[0].x @@ -564,6 +566,9 @@ }, ] } + else { + points.value = [] + } } // 监听到场景模式变化,清除区域绘制 diff --git a/public/config/config.json b/public/config/config.json index 2ecfbfe..a1d00a8 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,8 +4,6 @@ "deployPathDec": "****************注意:这个/alarm的alarm一定要改成部署的文件夹的名字***************************", "deployPath": "/safe", "mediaBaseUrl": "http://192.168.83.42:8099", - "lat-bd": "39.91459528", - "lng-bd": "116.26499505", "lat": "39.90", "lng": "116.39", "minZoom": "1", diff --git a/src/api/indexGm.ts b/src/api/indexGm.ts index 7f0fa35..1547d32 100644 --- a/src/api/indexGm.ts +++ b/src/api/indexGm.ts @@ -139,31 +139,7 @@ }, (error) => { // 处理文件下载的错误提示 - if (error.response && error.response.data instanceof Blob) { - const reader = new FileReader() - reader.onload = (e) => { - let errMsg = '发生错误!' - if (e && e.target!.result) { - errMsg = JSON.parse(e.target!.result as string) - } - ElMessage.warning(errMsg) - } - } - else if (error.response && error.response.data) { - // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) - if (needLogin > -1) { - toLogin() - } - else { - const message: string = error.response.data.message - ElMessage({ - message, - type: 'warning', - }) - } - } - else if (error.message) { + if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' @@ -174,10 +150,11 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - ElMessage({ - message, - type: 'warning', - }) + // ElMessage({ + // message, + // type: 'warning', + // }) + console.log(message) } return Promise.reject(error) }, diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index e9eb79d..bc3af96 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -6,6 +6,7 @@ const route = useRoute() const router = useRouter() const settingsStore = useSettingsStore() +const systemType = ref('') const enableSubMenuCollapseButton = computed(() => { return settingsStore.mode === 'mobile' || ( @@ -30,6 +31,7 @@ const scrollTop = ref(0) onMounted(() => { + systemType.value = window.localStorage.getItem('systemType') as string window.addEventListener('scroll', onScroll) }) onUnmounted(() => { @@ -72,7 +74,7 @@ - {{ item.title }} + {{ item.title }} - 内部 diff --git a/src/utils/download.ts b/src/utils/download.ts index 2c7964f..2254411 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -133,7 +133,8 @@ ) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - name = `【${response.data[index].name}】${name}` + // name = `【${response.data[index].name}】${name}` + name = `【内部】${name}` } } } diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts index a58eaf5..6503713 100644 --- a/src/utils/exportUtils.ts +++ b/src/utils/exportUtils.ts @@ -14,7 +14,8 @@ const index = response.data.findIndex((item: { value: string | null }) => item.value === level) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - fileName = `【${response.data[index].name}】${fileName}` + // fileName = `【${response.data[index].name}】${fileName}` + fileName = `【内部】${fileName}` } } } diff --git a/src/views/alarm/policyConfig/monitorPoint/editDialog.vue b/src/views/alarm/policyConfig/monitorPoint/editDialog.vue index 5d0c31b..d9522f3 100644 --- a/src/views/alarm/policyConfig/monitorPoint/editDialog.vue +++ b/src/views/alarm/policyConfig/monitorPoint/editDialog.vue @@ -67,8 +67,8 @@ recognitionInterval: [{ required: true, message: '识别间隔必填', trigger: ['blur', 'change'] }], alarmInterval: [{ required: true, message: '告警间隔必填', trigger: ['blur', 'change'] }], type: [{ required: true, message: '场景模式必选', trigger: ['blur', 'change'] }], - sceneId: [{ required: true, message: '业务场景必选', trigger: ['blur', 'change'] }], - algoModelId: [{ required: true, message: '算法名称必选', trigger: ['blur', 'change'] }], + // sceneId: [{ required: true, message: '业务场景必选', trigger: ['blur', 'change'] }], + // algoModelId: [{ required: true, message: '算法名称必选', trigger: ['blur', 'change'] }], recognitionUrl: [{ required: true, message: '识别流地址必填', trigger: ['blur', 'change'] }], rtspUrl: [{ required: true, message: 'rtsp地址必填', trigger: ['blur', 'change'] }], mediaServerId: [{ required: true, message: '流媒体必选', trigger: ['blur', 'change'] }], @@ -139,10 +139,10 @@ function submitForm() { console.log('-------表单提交算法校验---------', recognitionList.value) if (`${formData.value.type}` === '0') { // 算法关联 - if (!selectModelList.value.length) { - ElMessage.warning('请选择报警对象') - return false - } + // if (!selectModelList.value.length) { + // ElMessage.warning('请选择报警对象') + // return false + // } // const checkList = [] as any // selectModelList.value.forEach((item: { recognitionTypeId: string }) => { // const index = recognitionList.value.findIndex((i: { recognitionTypeId: string }) => i.recognitionTypeId === item.recognitionTypeId) @@ -205,16 +205,18 @@ } else if (formData.value.type === 1) { // 业务场景 let tempBoundary = [] - tempBoundary = points.value[0].boundary.map((e: any) => { - return { - ...e, - // x: (e.x / videoWidth.value).toFixed(4), - // y: (e.y / videoHeight.value).toFixed(4), - x: Number(useCalc(Number(e.x), Number(videoWidth.value), '/')).toFixed(2), - y: Number(useCalc(Number(e.y), Number(videoHeight.value), '/')).toFixed(2), - } - }) - if (currentDrawButton.value === '1') { // 固定是矩形 + if (points.value && points.value.length) { + tempBoundary = points.value[0].boundary.map((e: any) => { + return { + ...e, + // x: (e.x / videoWidth.value).toFixed(4), + // y: (e.y / videoHeight.value).toFixed(4), + x: Number(useCalc(Number(e.x), Number(videoWidth.value), '/')).toFixed(2), + y: Number(useCalc(Number(e.y), Number(videoHeight.value), '/')).toFixed(2), + } + }) + } + if (currentDrawButton.value === '1' && tempBoundary.length) { // 固定是矩形 tempBoundary[1].y = tempBoundary[0].y tempBoundary[3].y = tempBoundary[2].y tempBoundary[3].x = tempBoundary[0].x @@ -564,6 +566,9 @@ }, ] } + else { + points.value = [] + } } // 监听到场景模式变化,清除区域绘制 diff --git a/src/views/monitor/realTime/index-new-gm-plugin.vue b/src/views/monitor/realTime/index-new-gm-plugin.vue index 87e2140..760f95c 100644 --- a/src/views/monitor/realTime/index-new-gm-plugin.vue +++ b/src/views/monitor/realTime/index-new-gm-plugin.vue @@ -196,6 +196,18 @@ } console.log('currentIndex', currentIndex) + + // -------------------------------区域绘制--------------------------------------------- + // if (currentData.value[currentIndex] && currentData.value[currentIndex].deviceBoundaryDTOS && currentData.value[currentIndex].deviceBoundaryDTOS.length) { + // draw(currentData.value[currentIndex].deviceBoundaryDTOS.filter((item: { boundary: string }) => item.boundary)) + if (data.device && data.device.deviceBoundaryDTOS && data.device.deviceBoundaryDTOS.length) { + draw(data.device.deviceBoundaryDTOS.filter((item: { boundary: string }) => item.boundary)) + } + else { + points.value = [] + drawPoints.value = [] + } + // 获取视频流接口 fetchStream(data.device.cameraIndexCode).then(async (res: any) => { leafLoading.value = false @@ -213,15 +225,6 @@ currentData.value[currentIndex] = data.device // 记录正在播的流的国标号 currentStreamId.value[currentIndex] = createStreamResponseId - - // -------------------------------区域绘制--------------------------------------------- - if (currentData.value[currentIndex] && currentData.value[currentIndex].deviceBoundaryDTOS && currentData.value[currentIndex].deviceBoundaryDTOS.length) { - draw(currentData.value[currentIndex].deviceBoundaryDTOS.filter((item: { boundary: string }) => item.boundary)) - } - else { - points.value = [] - drawPoints.value = [] - } // ------------------------------------------------------------------------------------ // 发送心跳 timers.value[currentIndex] = setInterval(() => { @@ -270,7 +273,7 @@ } } else { - // ElMessage.warning('创建流失败!') + // ElMessage.warning('创建流失败!') } } @@ -507,8 +510,9 @@
-
+ style="font-size: 16px;font-weight: 600;margin-bottom: 10px;" + > +
{{ item }} @@ -554,8 +558,8 @@
- - + +
{{ item }} diff --git a/public/config/config.json b/public/config/config.json index 2ecfbfe..a1d00a8 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -4,8 +4,6 @@ "deployPathDec": "****************注意:这个/alarm的alarm一定要改成部署的文件夹的名字***************************", "deployPath": "/safe", "mediaBaseUrl": "http://192.168.83.42:8099", - "lat-bd": "39.91459528", - "lng-bd": "116.26499505", "lat": "39.90", "lng": "116.39", "minZoom": "1", diff --git a/src/api/indexGm.ts b/src/api/indexGm.ts index 7f0fa35..1547d32 100644 --- a/src/api/indexGm.ts +++ b/src/api/indexGm.ts @@ -139,31 +139,7 @@ }, (error) => { // 处理文件下载的错误提示 - if (error.response && error.response.data instanceof Blob) { - const reader = new FileReader() - reader.onload = (e) => { - let errMsg = '发生错误!' - if (e && e.target!.result) { - errMsg = JSON.parse(e.target!.result as string) - } - ElMessage.warning(errMsg) - } - } - else if (error.response && error.response.data) { - // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) - if (needLogin > -1) { - toLogin() - } - else { - const message: string = error.response.data.message - ElMessage({ - message, - type: 'warning', - }) - } - } - else if (error.message) { + if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' @@ -174,10 +150,11 @@ else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } - ElMessage({ - message, - type: 'warning', - }) + // ElMessage({ + // message, + // type: 'warning', + // }) + console.log(message) } return Promise.reject(error) }, diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index e9eb79d..bc3af96 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -6,6 +6,7 @@ const route = useRoute() const router = useRouter() const settingsStore = useSettingsStore() +const systemType = ref('') const enableSubMenuCollapseButton = computed(() => { return settingsStore.mode === 'mobile' || ( @@ -30,6 +31,7 @@ const scrollTop = ref(0) onMounted(() => { + systemType.value = window.localStorage.getItem('systemType') as string window.addEventListener('scroll', onScroll) }) onUnmounted(() => { @@ -72,7 +74,7 @@ - {{ item.title }} + {{ item.title }} - 内部 diff --git a/src/utils/download.ts b/src/utils/download.ts index 2c7964f..2254411 100644 --- a/src/utils/download.ts +++ b/src/utils/download.ts @@ -133,7 +133,8 @@ ) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - name = `【${response.data[index].name}】${name}` + // name = `【${response.data[index].name}】${name}` + name = `【内部】${name}` } } } diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts index a58eaf5..6503713 100644 --- a/src/utils/exportUtils.ts +++ b/src/utils/exportUtils.ts @@ -14,7 +14,8 @@ const index = response.data.findIndex((item: { value: string | null }) => item.value === level) const systemType = window.localStorage.getItem('systemType') as string if (index !== -1 && systemType === 'gm') { - fileName = `【${response.data[index].name}】${fileName}` + // fileName = `【${response.data[index].name}】${fileName}` + fileName = `【内部】${fileName}` } } } diff --git a/src/views/alarm/policyConfig/monitorPoint/editDialog.vue b/src/views/alarm/policyConfig/monitorPoint/editDialog.vue index 5d0c31b..d9522f3 100644 --- a/src/views/alarm/policyConfig/monitorPoint/editDialog.vue +++ b/src/views/alarm/policyConfig/monitorPoint/editDialog.vue @@ -67,8 +67,8 @@ recognitionInterval: [{ required: true, message: '识别间隔必填', trigger: ['blur', 'change'] }], alarmInterval: [{ required: true, message: '告警间隔必填', trigger: ['blur', 'change'] }], type: [{ required: true, message: '场景模式必选', trigger: ['blur', 'change'] }], - sceneId: [{ required: true, message: '业务场景必选', trigger: ['blur', 'change'] }], - algoModelId: [{ required: true, message: '算法名称必选', trigger: ['blur', 'change'] }], + // sceneId: [{ required: true, message: '业务场景必选', trigger: ['blur', 'change'] }], + // algoModelId: [{ required: true, message: '算法名称必选', trigger: ['blur', 'change'] }], recognitionUrl: [{ required: true, message: '识别流地址必填', trigger: ['blur', 'change'] }], rtspUrl: [{ required: true, message: 'rtsp地址必填', trigger: ['blur', 'change'] }], mediaServerId: [{ required: true, message: '流媒体必选', trigger: ['blur', 'change'] }], @@ -139,10 +139,10 @@ function submitForm() { console.log('-------表单提交算法校验---------', recognitionList.value) if (`${formData.value.type}` === '0') { // 算法关联 - if (!selectModelList.value.length) { - ElMessage.warning('请选择报警对象') - return false - } + // if (!selectModelList.value.length) { + // ElMessage.warning('请选择报警对象') + // return false + // } // const checkList = [] as any // selectModelList.value.forEach((item: { recognitionTypeId: string }) => { // const index = recognitionList.value.findIndex((i: { recognitionTypeId: string }) => i.recognitionTypeId === item.recognitionTypeId) @@ -205,16 +205,18 @@ } else if (formData.value.type === 1) { // 业务场景 let tempBoundary = [] - tempBoundary = points.value[0].boundary.map((e: any) => { - return { - ...e, - // x: (e.x / videoWidth.value).toFixed(4), - // y: (e.y / videoHeight.value).toFixed(4), - x: Number(useCalc(Number(e.x), Number(videoWidth.value), '/')).toFixed(2), - y: Number(useCalc(Number(e.y), Number(videoHeight.value), '/')).toFixed(2), - } - }) - if (currentDrawButton.value === '1') { // 固定是矩形 + if (points.value && points.value.length) { + tempBoundary = points.value[0].boundary.map((e: any) => { + return { + ...e, + // x: (e.x / videoWidth.value).toFixed(4), + // y: (e.y / videoHeight.value).toFixed(4), + x: Number(useCalc(Number(e.x), Number(videoWidth.value), '/')).toFixed(2), + y: Number(useCalc(Number(e.y), Number(videoHeight.value), '/')).toFixed(2), + } + }) + } + if (currentDrawButton.value === '1' && tempBoundary.length) { // 固定是矩形 tempBoundary[1].y = tempBoundary[0].y tempBoundary[3].y = tempBoundary[2].y tempBoundary[3].x = tempBoundary[0].x @@ -564,6 +566,9 @@ }, ] } + else { + points.value = [] + } } // 监听到场景模式变化,清除区域绘制 diff --git a/src/views/monitor/realTime/index-new-gm-plugin.vue b/src/views/monitor/realTime/index-new-gm-plugin.vue index 87e2140..760f95c 100644 --- a/src/views/monitor/realTime/index-new-gm-plugin.vue +++ b/src/views/monitor/realTime/index-new-gm-plugin.vue @@ -196,6 +196,18 @@ } console.log('currentIndex', currentIndex) + + // -------------------------------区域绘制--------------------------------------------- + // if (currentData.value[currentIndex] && currentData.value[currentIndex].deviceBoundaryDTOS && currentData.value[currentIndex].deviceBoundaryDTOS.length) { + // draw(currentData.value[currentIndex].deviceBoundaryDTOS.filter((item: { boundary: string }) => item.boundary)) + if (data.device && data.device.deviceBoundaryDTOS && data.device.deviceBoundaryDTOS.length) { + draw(data.device.deviceBoundaryDTOS.filter((item: { boundary: string }) => item.boundary)) + } + else { + points.value = [] + drawPoints.value = [] + } + // 获取视频流接口 fetchStream(data.device.cameraIndexCode).then(async (res: any) => { leafLoading.value = false @@ -213,15 +225,6 @@ currentData.value[currentIndex] = data.device // 记录正在播的流的国标号 currentStreamId.value[currentIndex] = createStreamResponseId - - // -------------------------------区域绘制--------------------------------------------- - if (currentData.value[currentIndex] && currentData.value[currentIndex].deviceBoundaryDTOS && currentData.value[currentIndex].deviceBoundaryDTOS.length) { - draw(currentData.value[currentIndex].deviceBoundaryDTOS.filter((item: { boundary: string }) => item.boundary)) - } - else { - points.value = [] - drawPoints.value = [] - } // ------------------------------------------------------------------------------------ // 发送心跳 timers.value[currentIndex] = setInterval(() => { @@ -270,7 +273,7 @@ } } else { - // ElMessage.warning('创建流失败!') + // ElMessage.warning('创建流失败!') } } @@ -507,8 +510,9 @@
-
+ style="font-size: 16px;font-weight: 600;margin-bottom: 10px;" + > +
{{ item }} @@ -554,8 +558,8 @@
- - + +
{{ item }} diff --git a/src/views/monitor/statistics/statistics.vue b/src/views/monitor/statistics/statistics.vue index ad51242..4ee46e1 100644 --- a/src/views/monitor/statistics/statistics.vue +++ b/src/views/monitor/statistics/statistics.vue @@ -169,7 +169,8 @@
- 设备总数-{{ secretLevelUserName }} + 设备总数 +
{{ list.devTotal }} @@ -180,7 +181,8 @@
- 设备在线数-{{ secretLevelUserName }} + 设备在线数 +
{{ list.onlineNum }} @@ -191,7 +193,8 @@
- 设备在线率-{{ secretLevelUserName }} + 设备在线率 +
{{ list.onlineRate }}% @@ -202,11 +205,10 @@
- + - + - +