From 404a10cb865a911ed3696313444c49ecfa349950 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Mon, 8 Dec 2025 16:38:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- public/static/config.js | 2 +- src/assets/styles/yxk-admin.scss | 1 + .../RFIDArchives/borrowerManage/index.vue | 6 +- .../borrowerManage/module/addBorrower.vue | 28 +- .../RFIDArchives/components/archiveDetail.vue | 10 +- .../components/lendArchivesList.vue | 2 +- .../RFIDArchives/returnArchives/index.vue | 226 +++++++++++- .../RFIDArchives/toLend/index.vue | 108 ++++-- .../RFIDArchives/toLend/module/lendRecord.vue | 5 +- .../archivesList/archivesAnjuan/index.vue | 26 +- .../archivesList/archivesJuannei/index.vue | 14 +- .../module/archivesInfo/index.vue | 2 +- .../archivesManage/archivesSearch/index.vue | 34 +- .../lendManage/components/archiveDetail.vue | 2 +- .../components/lendArchivesList.vue | 2 +- .../inStorage/module/inDialog.vue | 5 +- src/views/components/BindingTagDlg-olc.vue | 336 ++++++++++++++++++ src/views/components/BindingTagDlg.vue | 180 ++++------ src/views/components/category/PreviewForm.vue | 10 +- src/views/storeManage/deviceManage/index.vue | 24 +- .../warehouse3D/archivesStorage/index.vue | 4 +- .../warehouse3D/collateRoom/index.vue | 2 +- .../warehouse3D/deseCabinet/index.vue | 13 +- src/views/storeManage/warehouse3D/index.vue | 2 +- .../warehouse3D/module/hkVideo.vue | 4 +- .../storeManage/warehouse3DConfig/index.vue | 4 +- 28 files changed, 831 insertions(+), 225 deletions(-) create mode 100644 src/views/components/BindingTagDlg-olc.vue diff --git a/.env.development b/.env.development index ff97d06..106bc12 100644 --- a/.env.development +++ b/.env.development @@ -14,7 +14,7 @@ ENV = 'development' # 许镇-本地服地址 VUE_APP_BASE_API = 'http://192.168.99.72:7080' VUE_APP_WS_API = 'ws://192.168.99.72:7080' -VUE_APP_WEBRTCSTREAMER_API = '192.168.99.100:8000' +VUE_APP_WEBRTCSTREAMER_API = '127.0.0.1:8000' VUE_APP_SDEVID = "D003" # 是否启用 babel-plugin-dynamic-import-node插件 diff --git a/.env.production b/.env.production index 3543e9b..913d857 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ ENV = 'production' # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # VUE_APP_BASE_API = 'https://openapitest.aiyxlib.com' # 火箭军 -VUE_APP_BASE_API = 'http://192.168.1.100:7070' +VUE_APP_BASE_API = 'http://192.168.1.100:7080' # VUE_APP_BASE_API = 'http://192.168.99.107:7070' # 如果接口是 http 形式, wss 需要改为 ws # 火箭军 diff --git a/public/static/config.js b/public/static/config.js index a63fbc0..09cd1bb 100644 --- a/public/static/config.js +++ b/public/static/config.js @@ -1,6 +1,6 @@ window.g = { AXIOS_TIMEOUT: 10000, - ApiUrl: 'http://192.168.1.100:7070', // 配置服务器地址 + ApiUrl: 'http://192.168.99.100:7080', // 配置服务器地址 ApiWebRtcServerUrl: '127.0.0.1:8000', // 配置监控视频服务器地址 sDevID:'D003' // 桌面式RFID读写器 } \ No newline at end of file diff --git a/src/assets/styles/yxk-admin.scss b/src/assets/styles/yxk-admin.scss index 664ca1a..6a50477 100644 --- a/src/assets/styles/yxk-admin.scss +++ b/src/assets/styles/yxk-admin.scss @@ -887,6 +887,7 @@ width: 680px !important; .preview-content{ max-height: calc(100vh - 330px) !important; + min-height: calc(100vh - 620px) !important; overflow: hidden !important; overflow-y: auto !important; border: none !important; diff --git a/src/views/archivesManage/RFIDArchives/borrowerManage/index.vue b/src/views/archivesManage/RFIDArchives/borrowerManage/index.vue index dc8e968..291eeca 100644 --- a/src/views/archivesManage/RFIDArchives/borrowerManage/index.vue +++ b/src/views/archivesManage/RFIDArchives/borrowerManage/index.vue @@ -36,10 +36,10 @@ - - + + - + @@ -184,7 +184,7 @@ export default { }, handleLookVideo() { this.videoTipVisible = false - this.cameraData = this.camConfigData.filter((item) => { return item.divPosition.includes('CAM') }) + this.cameraData = this.camConfigData.filter((item) => { return item.divPosition.toLowerCase().includes('cam') }) this.open = true this.$nextTick(() => { this.$refs.camera.camConfig = this.cameraData[0] diff --git a/src/views/archivesManage/RFIDArchives/components/lendArchivesList.vue b/src/views/archivesManage/RFIDArchives/components/lendArchivesList.vue index f3862d2..ba71c22 100644 --- a/src/views/archivesManage/RFIDArchives/components/lendArchivesList.vue +++ b/src/views/archivesManage/RFIDArchives/components/lendArchivesList.vue @@ -241,7 +241,7 @@ export default { }, handleLookVideo() { this.videoTipVisible = false - this.cameraData = this.camConfigData.filter((item) => { return item.divPosition.includes('CAM') }) + this.cameraData = this.camConfigData.filter((item) => { return item.divPosition.toLowerCase().includes('cam') }) this.open = true this.$nextTick(() => { this.$refs.camera.camConfig = this.cameraData[0] diff --git a/src/views/archivesManage/RFIDArchives/returnArchives/index.vue b/src/views/archivesManage/RFIDArchives/returnArchives/index.vue index e891bd1..4477934 100644 --- a/src/views/archivesManage/RFIDArchives/returnArchives/index.vue +++ b/src/views/archivesManage/RFIDArchives/returnArchives/index.vue @@ -2,7 +2,18 @@
- RFID读取 + 归还 导出
@@ -86,6 +97,8 @@ + + diff --git a/src/views/components/BindingTagDlg.vue b/src/views/components/BindingTagDlg.vue index 40fa9ef..73793ca 100644 --- a/src/views/components/BindingTagDlg.vue +++ b/src/views/components/BindingTagDlg.vue @@ -10,44 +10,37 @@
+
- 1 -
-

第一步连接读写器

-

{{ step1Message }}

- - -
-
-
- 2
-

第二步放入标签

-

{{ step2Message }}

+

第一步放入标签

+

{{ step1Message }}

+
- 3 + 2
-

第三步读取标签

-

{{ step3Message }}

+

第二步读取标签

+

{{ step2Message }}

+
- 4 + 3
-

第四步开始绑定

-

{{ step4Message }}

+

第三步开始绑定

+

{{ step3Message }}

@@ -56,11 +49,12 @@
+
- 5 + 4
-

第五步绑定成功

-

{{ step5Message }}

+

第四步绑定成功

+

{{ step4Message }}

@@ -117,13 +111,13 @@ export default { bindingVisible: false, // 绑定标签对话框是否显示 tidCode: '', coverBindingVisible: false, - step: 1, + step: 1, // 核心修改2:初始步骤改为1(新的第一步:放入标签) errorStep: 0, - step1Message: '连接中', - step2Message: '请放入标签', - step3Message: '放入标签后开始读取标签', - step4Message: '标签读取成功后,开始绑定档案', - step5Message: '当前标签与' + this.bindingTxt + '绑定成功', + // 核心修改3:步骤消息同步重命名(原step2→step1,原step3→step2...) + step1Message: '请放入标签', // 原step2Message + step2Message: '放入标签后开始读取标签', // 原step3Message + step3Message: '标签读取成功后,开始绑定档案', // 原step4Message + step4Message: '当前标签与' + this.bindingTxt + '绑定成功', // 原step5Message readData: {}, timeOut: null, timer: null, @@ -143,95 +137,60 @@ export default { }, methods: { initData() { - this.step = 1 + this.step = 1 // 初始化步骤→新的第一步 this.errorStep = 0 - this.step1Message = '连接中' - this.step2Message = '请放入标签' - this.step3Message = '放入标签后开始读取标签' - this.step4Message = '标签读取成功后,开始绑定档案' - this.step5Message = '当前标签与' + this.bindingTxt + '绑定成功' + // 步骤消息同步初始化(对应新编号) + this.step1Message = '请放入标签' + this.step2Message = '放入标签后开始读取标签' + this.step3Message = '标签读取成功后,开始绑定档案' + this.step4Message = '当前标签与' + this.bindingTxt + '绑定成功' this.isBinding = false this.coverLabel = false this.tidCode = '' }, - async checkStatus(param) { - return RFID.checkStatus(param).then((res) => { - res = JSON.parse(res) - if (res.code && res.code === '0') { - this.step = 2 - this.step1Message = '连接成功' - return true - } else { - this.errorStep = 1 - if (res.code && res.code === '-1') { - this.step1Message = '读写器状态异常(例如读写器USB线未插入)' - } else if (res.code === '-1000') { - this.step1Message = '读写器超时未响应(例如终端读写服务未开启或网络异常)' - } - } - }) - }, + readEpc(param) { return new Promise((resolve, reject) => { RFID.readEpc(param).then(res => { res = JSON.parse(res) if (res.code && res.code === '0') { - this.step = 3 + this.step = 2 // 核心修改4:读取成功→跳至新的第二步(读取标签) this.errorStep = 0 - this.step2Message = '已放入标签' + this.step1Message = '已放入标签' // 对应新第一步的成功提示 if (res.data.length > 1) { - this.errorStep = 3 - this.step3Message = '当前标签存在多个,请取出多余的标签只保留一张!' + this.errorStep = 2 // 错误关联新第二步 + this.step2Message = '当前标签存在多个,请取出多余的标签只保留一张!' clearTimeout(this.timer) this.timer = setTimeout(() => { resolve(this.readEpc(param)) }, 2000) } else if (res.data.length === 1) { this.readData = res.data[0] - this.step3Message = '读取成功!' - this.step = 4 + this.step2Message = '读取成功!' // 新第二步的成功提示 + this.step = 3 // 跳至新的第三步(开始绑定) resolve() } } else if (res.code && res.code === '-2') { - this.errorStep = 2 - this.step2Message = '未读取到标签,请重新放入' - this.step = 2 + this.errorStep = 1 // 错误关联新第一步 + this.step1Message = '未读取到标签,请重新放入' + this.step = 1 // 停留在新第一步 clearTimeout(this.timer) this.timer = setTimeout(() => { resolve(this.readEpc(param)) }, 2000) } else { - this.errorStep = 2 - this.step2Message = '读取标签失败' + this.errorStep = 1 // 错误关联新第一步 + this.step1Message = '读取标签失败' reject() } }) }) }, - async tryConnect(param) { - let res - let err - const MAX_NUM_RETRIES = 3 - for (let i = 0; i < MAX_NUM_RETRIES; i++) { - try { - res = await this.checkStatus(param) - break - } catch (e) { - err = e - this.errorStep = 1 - this.step1Message = '连接失败,请检查网络' - } - } - if (res) return res - // this.timeOut = setTimeout(() => { - // this.$refs.bindingTagDialog.handleClose() - // }, 3000) - throw err - }, + async startBind(isCover) { console.log(isCover) return await new Promise(async(resolve, reject) => { - this.step4Message = '绑定中' + this.step3Message = '绑定中' // 新第三步的绑定中提示 const data = { id: this.bindingId, labelType: this.bindingType, tid: this.readData.tid } if (isCover || this.readData.tid === this.tidCode) { data.coverLabel = true @@ -241,42 +200,36 @@ export default { this.coverBindingVisible = true resolve() } else if (res === 1) { - let writeRes = await RFID.writeEPC({ op: 'RFID_WriteEPC', sDevID: this.devId, EAS: '1', Type: this.bindingType, Code: this.bindingId, Tid: this.readData.tid, ip: this.devIp }) + const sDevID = process.env.NODE_ENV === 'production' ? window.g.sDevID : process.env.VUE_APP_SDEVID + // , ip: this.devIp + let writeRes = await RFID.writeEPC({ op: 'RFID_WriteEPC', sDevID: sDevID, EAS: '1', Type: this.bindingType, Code: this.bindingId, Tid: this.readData.tid }) writeRes = JSON.parse(writeRes) if (writeRes.code === '0') { - this.step = 5 + this.step = 4 + this.handleClose() resolve() } else if (writeRes.code === '-1') { - // this.$message({ - // message: writeRes.message, - // type: 'error', - // duration: 2500 - // }) - this.errorStep = 5 - this.step5Message = writeRes.message + this.errorStep = 4 + this.step4Message = writeRes.message reject() } else if (writeRes.code === '-1000') { - // this.$message({ - // message: '读写器超时未响应', - // type: 'error', - // duration: 2500 - // }) - this.errorStep = 5 - this.step5Message = '读写器超时未响应' + this.errorStep = 4 + this.step4Message = '读写器超时未响应' reject() } } else { - this.step5Message = '绑定失败' - this.errorStep = 5 + this.step4Message = '绑定失败' + this.errorStep = 4 reject() } }) }, + async getDevId() { return await new Promise(async(resolve, reject) => { const mac = await RFID.getDeviceMac() if (!mac || mac === '') { - this.step1Message = '获取mac地址失败' + this.step1Message = '获取mac地址失败,无法读取标签' this.errorStep = 1 reject('获取mac地址失败') } else { @@ -291,22 +244,32 @@ export default { } }) }, + async opened() { if (!this.isBinding) { - const devInfo = await this.getDevId() - this.devId = devInfo.deviceId - this.devIp = devInfo.deviceIp + ':' + devInfo.devicePort - await this.tryConnect({ op: 'RFID_CheckStatus', sDevID: devInfo.deviceId, ip: this.devIp }) - await this.readEpc({ op: 'RFID_ReadEpc', sDevID: devInfo.deviceId, ip: this.devIp }) - await this.startBind() + try { + // const devInfo = await this.getDevId() + // this.devId = devInfo.deviceId + // this.devIp = devInfo.deviceIp + ':' + devInfo.devicePort + // 直接执行新的第一步:读取标签(原第二步逻辑) + const sDevID = process.env.NODE_ENV === 'production' ? window.g.sDevID : process.env.VUE_APP_SDEVID + // ip: this.devIp + await this.readEpc({ op: 'RFID_ReadEpc', sDevID: sDevID }) + await this.startBind() + } catch (err) { + console.error('初始化失败:', err) + } } }, + async nextStep() { this.isBinding = false this.opened() }, + // 关闭 handleClose(done) { + this.bindingVisible = false this.coverBindingVisible = false this.$emit('refresh') done() @@ -315,15 +278,18 @@ export default { clearTimeout(this.timer) } }, + handleCoverBindingClose(done) { done() this.bindingVisible = false this.initData() }, + doCoverBinding() { this.coverBindingVisible = false this.startBind(true) }, + cancel() { this.$refs.coverBindingDialog.handleClose() } diff --git a/src/views/components/category/PreviewForm.vue b/src/views/components/category/PreviewForm.vue index 25fd6ff..8536c00 100644 --- a/src/views/components/category/PreviewForm.vue +++ b/src/views/components/category/PreviewForm.vue @@ -45,13 +45,13 @@ - + @@ -421,6 +421,12 @@ export default { this.setParentsId = parent_id } } + // barcode + console.log(this.addOrUpdateForm['archive_no']) + if (this.addOrUpdateForm['archive_no'] !== '') { + this.$set(this.addOrUpdateForm, 'barcode', this.addOrUpdateForm['archive_no']) + } + delete this.addOrUpdateForm.id this.$refs[formName].validate((valid) => { if (valid) { diff --git a/src/views/storeManage/deviceManage/index.vue b/src/views/storeManage/deviceManage/index.vue index bcf3f8c..7a70822 100644 --- a/src/views/storeManage/deviceManage/index.vue +++ b/src/views/storeManage/deviceManage/index.vue @@ -137,11 +137,33 @@ export default { [CRUD.HOOK.beforeToEdit](crud, form) { form.deviceDetails = null }, + // [CRUD.HOOK.beforeSubmit]() { + // this.crud.form.pid = this.defaultExpandedKeys[0] + // this.crud.form.remark = this.crud.form.name + // console.log(this.crud.form) + // console.log(this.crud.data) + // if (!this.crud.form.sort) { + // this.crud.form.sort = this.crud.data[0].children.reduce((prev, cur) => { return { sort: Math.max(prev.sort, cur.sort) } }).sort + 1 + // } + // }, [CRUD.HOOK.beforeSubmit]() { this.crud.form.pid = this.defaultExpandedKeys[0] this.crud.form.remark = this.crud.form.name + if (!this.crud.form.sort) { - this.crud.form.sort = this.crud.data[0].children.reduce((prev, cur) => { return { sort: Math.max(prev.sort, cur.sort) } }).sort + 1 + let maxSort = 0 // 默认排序值 + + if (this.crud.data && this.crud.data.length > 0) { + const firstItem = this.crud.data[0] + if (firstItem.children && firstItem.children.length > 0) { + maxSort = firstItem.children.reduce((prev, cur) => { + const currentSort = cur.sort || 0 + return { sort: Math.max(prev.sort, currentSort) } + }, { sort: 0 }).sort + } + } + + this.crud.form.sort = maxSort + 1 } }, toDelete(data) { diff --git a/src/views/storeManage/warehouse3D/archivesStorage/index.vue b/src/views/storeManage/warehouse3D/archivesStorage/index.vue index 108b193..0177f35 100644 --- a/src/views/storeManage/warehouse3D/archivesStorage/index.vue +++ b/src/views/storeManage/warehouse3D/archivesStorage/index.vue @@ -86,7 +86,7 @@ export default { components: { WarehouseWarning, AccessDoor, hkVideo }, data() { return { - roomId: 'D6490DA3D4261E8C26D0E3', + roomId: '01A1DC2123C2B75E1A579D', allDisplayConfigData: [], displayConfigData: [], url: '', @@ -191,7 +191,7 @@ export default { if (deviceData.toLowerCase().includes('cam')) { this.open = true this.$nextTick(() => { - this.$refs.camera.getVideoUrl(deviceData) + this.$refs.camera.getVideoUrl(this.roomId, deviceData) }) } } diff --git a/src/views/storeManage/warehouse3D/collateRoom/index.vue b/src/views/storeManage/warehouse3D/collateRoom/index.vue index 5e662c8..8148b2d 100644 --- a/src/views/storeManage/warehouse3D/collateRoom/index.vue +++ b/src/views/storeManage/warehouse3D/collateRoom/index.vue @@ -140,7 +140,7 @@ export default { // if (event.data && event.data.data) { // const data = event.data.data // _this.deviceId = data - // if (_this.deviceId.includes('CAM')) { + // if (_this.deviceId.toLowerCase().includes('cam')) { // _this.$nextTick(() => { // this.$refs.camera.openVideoVisible = true // this.$refs.camera.videoTitle = _this.deviceId diff --git a/src/views/storeManage/warehouse3D/deseCabinet/index.vue b/src/views/storeManage/warehouse3D/deseCabinet/index.vue index b7d7e9e..91d6247 100644 --- a/src/views/storeManage/warehouse3D/deseCabinet/index.vue +++ b/src/views/storeManage/warehouse3D/deseCabinet/index.vue @@ -1,7 +1,8 @@