diff --git a/.env.dev b/.env.dev index cade296..b6a3c8a 100644 --- a/.env.dev +++ b/.env.dev @@ -4,7 +4,7 @@ NODE_ENV=production VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://192.168.0.10:48080' +VITE_BASE_URL='http://192.168.2.162:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server @@ -33,4 +33,4 @@ VITE_OUT_DIR=dist VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' # 验证码的开关 -VITE_APP_CAPTCHA_ENABLE=true +VITE_APP_CAPTCHA_ENABLE=false diff --git a/.env.prod b/.env.prod index a988f53..e7326b1 100644 --- a/.env.prod +++ b/.env.prod @@ -4,7 +4,7 @@ NODE_ENV=production VITE_DEV=false # 请求路径 -VITE_BASE_URL='http://192.168.0.10:48080' +VITE_BASE_URL='http://192.168.0.162:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server @@ -31,3 +31,6 @@ VITE_OUT_DIR=dist-prod # 商城H5会员端域名 VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=false \ No newline at end of file diff --git a/.env.stage b/.env.stage index 3b8ba22..1bd48a0 100644 --- a/.env.stage +++ b/.env.stage @@ -4,7 +4,7 @@ NODE_ENV=production VITE_DEV=false # 请求路径 -VITE_BASE_URL='http://192.168.0.10:48080' +VITE_BASE_URL='http://192.168.0.162:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server diff --git a/.env.test b/.env.test index a3969d0..99f433c 100644 --- a/.env.test +++ b/.env.test @@ -4,7 +4,7 @@ NODE_ENV=production VITE_DEV=false # 请求路径 -VITE_BASE_URL='http://192.168.0.10:48080' +VITE_BASE_URL='http://192.168.0.162:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server diff --git a/package-lock.zip b/package-lock.zip deleted file mode 100644 index ed2fbde..0000000 Binary files a/package-lock.zip and /dev/null differ diff --git a/public/logo.gif b/public/logo.gif deleted file mode 100644 index 569fca6..0000000 Binary files a/public/logo.gif and /dev/null differ diff --git a/public/pic01.png b/public/pic01.png new file mode 100644 index 0000000..da4fa97 Binary files /dev/null and b/public/pic01.png differ diff --git a/public/pic02.jpg b/public/pic02.jpg new file mode 100644 index 0000000..92cfe7c Binary files /dev/null and b/public/pic02.jpg differ diff --git a/src/api/logistics/camera/index.ts b/src/api/logistics/camera/index.ts index 08df25a..e743afd 100644 --- a/src/api/logistics/camera/index.ts +++ b/src/api/logistics/camera/index.ts @@ -41,8 +41,8 @@ export const CameraApi = { return request.get({ url: `/logistics/camera/list` }) }, // 查询相机详情 - getCamera: async (id: number) => { - return await request.get({ url: `/logistics/camera/get?id=` + id }) + getCamera: (id: number) => { + return request.get({ url: `/logistics/camera/get?id=` + id }) }, // 新增相机 diff --git a/src/api/logistics/stock/index.ts b/src/api/logistics/stock/index.ts index 87d5956..7fedbc2 100644 --- a/src/api/logistics/stock/index.ts +++ b/src/api/logistics/stock/index.ts @@ -80,5 +80,10 @@ export const StockApi = { //请求卡片信息接口 getStockStatus: async (data: any) => { return await request.post({ url: `/logistics/stock/getStockStatus`, data }) + }, + + //请求卡片信息接口 + artificial: async (data: any) => { + return await request.post({ url: `/logistics/stock/artificial`, data }) } } diff --git a/src/api/system/dict/dict.data.ts b/src/api/system/dict/dict.data.ts index f428648..d6e6640 100644 --- a/src/api/system/dict/dict.data.ts +++ b/src/api/system/dict/dict.data.ts @@ -18,6 +18,9 @@ export const getSimpleDictDataList = () => { return request.get({ url: '/system/dict-data/simple-list' }) } +export const getTypeList = (type: string) => { + return request.get({ url: '/system/dict-data/type?type='+type }) +} // 查询字典数据列表 export const getDictDataPage = (params: PageParam) => { return request.get({ url: '/system/dict-data/page', params }) diff --git a/src/components/Echart/src/Echart.vue b/src/components/Echart/src/Echart.vue index fd3342d..7508edd 100644 --- a/src/components/Echart/src/Echart.vue +++ b/src/components/Echart/src/Echart.vue @@ -22,11 +22,12 @@ const props = defineProps({ type: Object as PropType, required: true }, + dark: propTypes.bool.def(false), width: propTypes.oneOfType([Number, String]).def(''), height: propTypes.oneOfType([Number, String]).def('500px') }) -const isDark = computed(() => appStore.getIsDark) +const isDark = computed(() => props.dark|| appStore.getIsDark) const theme = computed(() => { const echartTheme: boolean | string = unref(isDark) ? true : 'auto' @@ -58,7 +59,7 @@ const styles = computed(() => { const initChart = () => { if (unref(elRef) && props.options) { - echartRef = echarts.init(unref(elRef) as HTMLElement) + echartRef = echarts.init(unref(elRef) as HTMLElement, props.dark?'dark':'') echartRef?.setOption(unref(options)) } } diff --git a/src/components/camera/camera.vue b/src/components/camera/camera.vue index 1fd68b3..0ed2a73 100644 --- a/src/components/camera/camera.vue +++ b/src/components/camera/camera.vue @@ -46,7 +46,7 @@ export default { setup(props) { - console.log(props.ptzShow) + // console.log(props.ptzShow) const video = ref(null) const selfVideo = ref(null) const url = ref(null) @@ -59,27 +59,37 @@ export default { const msgrecv = ref(null) // const streamUrl = ref(document.location.protocol + "//" + window.location.host + "/index/api/webrtc?app=live&stream=test&type=play"); - const streamUrl = ref( - document.location.protocol + - '//' + - window.location.host + - ':8096/index/api/webrtc?app=live&stream=camera' + - props.cameraId + - '&type=play' - ) + const player = ref(null) const recvOnly = ref(true) const resolutions = ref([]) const resolution = ref('') // 监听 cameraId 的变化 watch(() => props.cameraId, (newCameraId, oldCameraId) => { - console.log(newCameraId); + // console.log(newCameraId); if (newCameraId !== oldCameraId) { + + ZLMRTCClient.GetAllScanResolution().forEach((r, i) => { + let text = r.label + '(' + r.width + 'x' + r.height + ')' + resolutions.value.push({ + text: text, + value: r + }) + }) + + resolution.value = resolutions.value[0].text + stopVideo() + startVideo() + // console.log(newCameraId); // 释放资源 - console.log(newCameraId+"54651561"); + // console.log(newCameraId+"54651561"); } }), + onMounted(() => { + + // formData.value = CameraApi.getCamera(props.cameraId) + // console.log(formData.value); ZLMRTCClient.GetAllScanResolution().forEach((r, i) => { let text = r.label + '(' + r.width + 'x' + r.height + ')' resolutions.value.push({ @@ -89,32 +99,48 @@ export default { }) resolution.value = resolutions.value[0].text - formData.value = CameraApi.getCamera(props.cameraId) + stopVideo() startVideo() }) + + // 卸载事件 onUnmounted(() => { stopVideo() }) - const radioChange = (value) => { - let urlObj = new URL(streamUrl.value) - urlObj.searchParams.set('type', value) - streamUrl.value = urlObj.href - if (value == 'play') { - recvOnly.value = true - } else if (value == 'echo') { - recvOnly.value = false - } else { - recvOnly.value = false - } - } + // const radioChange = (value) => { + // let urlObj = new URL(streamUrl.value) + // urlObj.searchParams.set('type', value) + // streamUrl.value = urlObj.href + // if (value == 'play') { + // recvOnly.value = true + // } else if (value == 'echo') { + // recvOnly.value = false + // } else { + // recvOnly.value = false + // } + // } const changeResolution = (e) => { resolution.value = e.target.options[e.target.selectedIndex].text } - const start_play = () => { + const start_play =async () => { + // const urlIp = ref("") + const resCamera = await CameraApi.getCamera(props.cameraId) + const urlIp = resCamera + + console.log(urlIp); + const streamUrl = ref( + document.location.protocol + + '//' + + urlIp.rtcServer + + ':'+urlIp.rtcServerPort+'/index/api/webrtc?app=live&stream=camera' + + props.cameraId + + '&type=play' + ) + console.log(streamUrl.value); let res = resolution.value.match(/\d+/g) let h = parseInt(res.pop()) let w = parseInt(res.pop()) @@ -137,15 +163,15 @@ export default { }) player.value.on(ZLMRTCClient.Events.WEBRTC_ICE_CANDIDATE_ERROR, function (e) { - console.log('ICE 协商出错') + // console.log('ICE 协商出错') }) player.value.on(ZLMRTCClient.Events.WEBRTC_ON_REMOTE_STREAMS, function (e) { - console.log('播放成功', e.streams) + // console.log('播放成功', e.streams) }) player.value.on(ZLMRTCClient.Events.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, function (e) { - console.log('offer anwser 交换失败', e) + // console.log('offer anwser 交换失败', e) stopVideo() }) @@ -155,42 +181,42 @@ export default { }) player.value.on(ZLMRTCClient.Events.CAPTURE_STREAM_FAILED, function (s) { - console.log('获取本地流失败') + // console.log('获取本地流失败') }) player.value.on(ZLMRTCClient.Events.WEBRTC_ON_CONNECTION_STATE_CHANGE, function (state) { - console.log('当前状态==>', state) + // console.log('当前状态==>', state) }) player.value.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_OPEN, function (event) { - console.log('rtc datachannel 打开 :', event) + // // console.log('rtc datachannel 打开 :', event) }) player.value.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_MSG, function (event) { - console.log('rtc datachannel 消息 :', event.data) + // console.log('rtc datachannel 消息 :', event.data) msgrecv.value.value = event.data }) player.value.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_ERR, function (event) { - console.log('rtc datachannel 错误 :', event) + // console.log('rtc datachannel 错误 :', event) }) player.value.on(ZLMRTCClient.Events.WEBRTC_ON_DATA_CHANNEL_CLOSE, function (event) { - console.log('rtc datachannel 关闭 :', event) + // console.log('rtc datachannel 关闭 :', event) }) } const startVideo = () => { - console.log('开始') + // console.log('开始') stopVideo() let res = resolution.value.match(/\d+/g) let h = '50%' let w = '50%' - console.log(h, w) - console.log(video.value) + // console.log(h, w) + // console.log(video.value) start_play() } const stopVideo = () => { - console.log('停止') + // console.log('停止') if (player.value) { player.value.close() player.value = null @@ -221,12 +247,12 @@ export default { datachannel, msgsend, msgrecv, - streamUrl, + // streamUrl, player, recvOnly, resolutions, resolution, - radioChange, + // radioChange, changeResolution, startVideo, stopVideo, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 7af1818..0f8ad74 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -105,6 +105,7 @@ export enum DICT_TYPE { SHELVES_TYPE = 'shelves_type', LIGHT_TYPE = 'light_type', CAMERA_TYPE = 'camera_type', + CAMERA_CONF = 'camera_conf', CHECK_STATUS = 'check_status', ORDER_STATUS = 'order_status',//camera_type SIDE = 'side', @@ -112,7 +113,8 @@ export enum DICT_TYPE { TCP_CLIENT_STATUS = 'tcp_client_status',//tcp连接状态 TCP_PROCESSOR = 'tcp_processor',//tcp处理器类型 -TCP_LOG_STATUS= 'tcp_log_status',//tcp日志类型 + SCANGUN_TYPE = 'scangun_type', + TCP_LOG_STATUS= 'tcp_log_status',//tcp日志类型 TERMINAL = 'terminal', // 终端 DATE_INTERVAL = 'date_interval', // 数据间隔 diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index d53510a..90dd536 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -1,43 +1,39 @@