From b38ceffbbae86d4082a0c83794ad6863e5dfc47a Mon Sep 17 00:00:00 2001
From: xuhuajiao <13476289682@163.com>
Date: Thu, 11 Dec 2025 10:48:15 +0800
Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=9C=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/static/config.js | 9 +-
src/api/home/alarm/index.js | 15 +-
src/main.js | 27 +
.../caseManage/caseList/index-oldPrint.vue | 523 ++++++++++++++++++
.../caseManage/caseList/index.vue | 68 ++-
.../caseManage/caseList/module/print.vue | 234 ++++++++
src/views/components/WarehouseWarning.vue | 10 +-
src/views/components/echarts/lendAcross.vue | 4 +-
src/views/environmentalScreen/index.vue | 485 +++-------------
.../warehouse3D/archivesStorage/index.vue | 58 +-
10 files changed, 971 insertions(+), 462 deletions(-)
create mode 100644 src/views/archivesManage/caseManage/caseList/index-oldPrint.vue
create mode 100644 src/views/archivesManage/caseManage/caseList/module/print.vue
diff --git a/public/static/config.js b/public/static/config.js
index 09cd1bb..855b965 100644
--- a/public/static/config.js
+++ b/public/static/config.js
@@ -1,6 +1,11 @@
window.g = {
AXIOS_TIMEOUT: 10000,
- ApiUrl: 'http://192.168.99.100:7080', // 配置服务器地址
+ ApiUrl: 'http://192.168.99.72:7080', // 配置服务器地址
ApiWebRtcServerUrl: '127.0.0.1:8000', // 配置监控视频服务器地址
- sDevID:'D003' // 桌面式RFID读写器
+ sDevID:'D003', // 桌面式RFID读写器,
+ ZMINConfig:{ // 标签打印机
+ ip:'127.0.0.1',
+ port:'1808',
+ filePath:'/home/it0/zmin/新标签01.lsf'
+ }
}
\ No newline at end of file
diff --git a/src/api/home/alarm/index.js b/src/api/home/alarm/index.js
index e4511ad..03ac4bf 100644
--- a/src/api/home/alarm/index.js
+++ b/src/api/home/alarm/index.js
@@ -2,9 +2,20 @@ import request from '@/utils/request'
export function info(params) {
return request({
- url: 'api/alarm/info',
+ // url: 'api/alarm/info',
+ url: 'api/alarm/ypGetAlarm',
params,
method: 'get'
})
}
-export default { info }
+
+// getDataForIP
+export function FetchDataForIP(params) {
+ return request({
+ url: 'api/alarm/getDataForIP',
+ params,
+ method: 'get'
+ })
+}
+
+export default { info, FetchDataForIP }
diff --git a/src/main.js b/src/main.js
index 22d0fe4..9ced88d 100644
--- a/src/main.js
+++ b/src/main.js
@@ -34,6 +34,33 @@ import './assets/icons' // icon
import './router/index' // permission control
import 'echarts-gl'
+// 定义补零工具函数
+const padZero = (num) => {
+ // 先转为数字,防止传入字符串,再补零
+ return Number(num).toString().padStart(2, '0')
+}
+
+// 注册全局时间格式化过滤器
+Vue.filter('formatTs', (tsStr) => {
+ // 容错处理:如果TS为空或格式异常,返回原字符串
+ if (!tsStr || typeof tsStr !== 'string') return tsStr
+
+ // 拆分日期和时间部分(按空格分割)
+ const [datePart, timePart] = tsStr.split(' ')
+ if (!datePart || !timePart) return tsStr
+
+ // 处理日期部分:yyyy/MM/dd
+ const [year, month, day] = datePart.split('/')
+ const formattedDate = `${year}/${padZero(month)}/${padZero(day)}`
+
+ // 处理时间部分:HH:mm:ss
+ const [hour, minute, second] = timePart.split(':')
+ const formattedTime = `${padZero(hour)}:${padZero(minute)}:${padZero(second)}`
+
+ // 拼接最终结果
+ return `${formattedDate} ${formattedTime}`
+})
+
// 全局注册过滤 - 时间
import { parseTime } from '@/utils/index.js'
Vue.filter('parseTime', function(time, cFormat) {
diff --git a/src/views/archivesManage/caseManage/caseList/index-oldPrint.vue b/src/views/archivesManage/caseManage/caseList/index-oldPrint.vue
new file mode 100644
index 0000000..4c95613
--- /dev/null
+++ b/src/views/archivesManage/caseManage/caseList/index-oldPrint.vue
@@ -0,0 +1,523 @@
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+ 批量打印条形码
+ 打印目录
+ 拆盒
+ 绑定标签
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.storageType | storageTypeStatus }}
+
+
+
+
+
+
+
+
+ -
+
+ {{ scope.row.folderLocationDetails }}
+
+
+
+
+
+ {{ scope.row.update_time | parseTime }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
归档文件目录
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.create_time, '{y}-{m}-{d}') }}
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/archivesManage/caseManage/caseList/index.vue b/src/views/archivesManage/caseManage/caseList/index.vue
index 4c95613..14c14d5 100644
--- a/src/views/archivesManage/caseManage/caseList/index.vue
+++ b/src/views/archivesManage/caseManage/caseList/index.vue
@@ -17,6 +17,7 @@
+
批量打印条形码
打印目录
拆盒
@@ -93,6 +94,15 @@
当前档案盒已入库,请先出库
+
+
+
+
+
+
+
归档文件目录
@@ -139,6 +149,8 @@ import detailDialog from './module/detailDialog'
import JsBarcode from 'jsbarcode'
import html2canvas from 'html2canvas'
import printJS from 'print-js'
+
+import Print from '../caseList/module/print'
export default {
name: 'CaseList',
filters: {
@@ -156,8 +168,8 @@ export default {
},
creatBarCode(barCodeData, codePrintData, barCodeText) {
// console.log('触发条码生成事件')
- console.log('codePrintData', codePrintData)
- console.log('barCodeText', barCodeText)
+ // console.log('codePrintData', codePrintData)
+ // console.log('barCodeText', barCodeText)
const canvas = document.createElement('canvas')
// 'fantasy', // 设置文本的字体
JsBarcode(canvas, barCodeData, {
@@ -176,7 +188,7 @@ export default {
return canvas.toDataURL('image/png')
}
},
- components: { eForm, crudOperation, rrOperation, pagination, BindingTagDlg, openCaseDlg, detailDialog },
+ components: { eForm, crudOperation, rrOperation, pagination, BindingTagDlg, openCaseDlg, detailDialog, Print },
mixins: [presenter(), crud()],
cruds() {
return CRUD({
@@ -250,7 +262,9 @@ export default {
label: '地址码',
value: 'folderLocation'
}
- ]
+ ],
+ printDialogVisible: false, // 打印弹窗显示状态
+ printLabelList: [] // 传递给打印组件的标签数据
}
},
@@ -260,12 +274,36 @@ export default {
// 打印条码
onPrint(data) {
this.codeLoading = true
- const params = data.map(item => {
- return item.id
- })
+ const params = data.map(item => item.id)
printCaseBarcode(params).then(res => {
if (res && res.length !== 0) {
this.selectedRows = res
+ // 转换数据格式,适配print组件的要求
+ this.printLabelList = res.map(item => {
+ return {
+ lsfFileVarList: [
+ {
+ lsfFileVar: {
+ varname: 'barcode', // 模板中的条形码变量名,需和打印模板一致
+ varvalue: '编号:' + item.barcode
+ }
+ },
+ {
+ lsfFileVar: {
+ varname: 'title',
+ varvalue: '姓名:' + item.title
+ }
+ }
+ ]
+ }
+ })
+
+ // 打开打印弹窗
+ this.printDialogVisible = true
+ // 自动连接打印服务(可选)
+ this.$nextTick(() => {
+ this.$refs.printComponent.connectprinter()
+ })
} else {
this.selectedRows = []
this.$message({
@@ -273,22 +311,6 @@ export default {
type: 'warning'
})
}
- this.$nextTick(() => {
- this.codePrintData.count = this.selectedRows.length
- var printIframe = this.$refs.printIframe
- var html = this.$refs.printDiv.innerHTML
- printIframe.setAttribute('srcdoc', html)
- printIframe.onload = function() {
- console.log(printIframe.contentWindow)
- // 去掉iframe里面的dom的body的padding margin的默认数值
- printIframe.contentWindow.document.body.style.padding = '0px'
- printIframe.contentWindow.document.body.style.margin = '0px'
- // 开始打印
- printIframe.contentWindow.focus()
- printIframe.contentWindow.print()
- }
- })
- this.crud.refresh()
this.codeLoading = false
})
},
diff --git a/src/views/archivesManage/caseManage/caseList/module/print.vue b/src/views/archivesManage/caseManage/caseList/module/print.vue
new file mode 100644
index 0000000..fa485e8
--- /dev/null
+++ b/src/views/archivesManage/caseManage/caseList/module/print.vue
@@ -0,0 +1,234 @@
+
+
+
+
+ 连接打印服务
+
+ 标签预览
+ 打印标签
+
+
+
标签预览(只预览第一张)
+
![标签预览]()
+
+
+
+
+
+
diff --git a/src/views/components/WarehouseWarning.vue b/src/views/components/WarehouseWarning.vue
index 6f03edb..991d0f6 100644
--- a/src/views/components/WarehouseWarning.vue
+++ b/src/views/components/WarehouseWarning.vue
@@ -9,9 +9,13 @@
-
-
-
+
+
+ {{ scope.row.TS | formatTs }}
+
+
+
+
diff --git a/src/views/components/echarts/lendAcross.vue b/src/views/components/echarts/lendAcross.vue
index 0b990ad..d753535 100644
--- a/src/views/components/echarts/lendAcross.vue
+++ b/src/views/components/echarts/lendAcross.vue
@@ -111,13 +111,13 @@ export default {
axisTick: {
show: false
},
- data: ['异常档案', '逾期档案', '待借档案', '已借档案', '在库档案']
+ data: ['逾期档案', '已借档案', '在库档案']
},
series: [
{
name: '数量',
type: 'bar',
- barWidth: 15, // 柱图宽度
+ barWidth: 30, // 柱图宽度
barGap: 25,
showBackground: true,
backgroundStyle: {
diff --git a/src/views/environmentalScreen/index.vue b/src/views/environmentalScreen/index.vue
index ac6e50a..b23bee9 100644
--- a/src/views/environmentalScreen/index.vue
+++ b/src/views/environmentalScreen/index.vue
@@ -8,7 +8,7 @@
档案库空气质量数据
-
+
- -
-
-
-
{{ topDisplayData.XXW_DIV_TOP_003.curValue }}
-
CO2 {{ topDisplayData.XXW_DIV_TOP_003.unit }}
-
-
- -
-
-
-
{{ topDisplayData.XXW_DIV_TOP_004.curValue }}
-
TVOC {{ topDisplayData.XXW_DIV_TOP_004.unit }}
-
-
- -
-
-
-
{{ topDisplayData.XXW_DIV_TOP_005.curValue }}
-
PM2.5 {{ topDisplayData.XXW_DIV_TOP_005.unit }}
-
-
- -
-
-
-
{{ topDisplayData.XXW_DIV_TOP_006.curValue }}
-
PM10 {{ topDisplayData.XXW_DIV_TOP_006.unit }}
-
-
-
- -
-
-
-
{{ topDisplayData.DXW_DIV_TOP_003.curValue }}
-
CO2 {{ topDisplayData.DXW_DIV_TOP_003.unit }}
-
-
- -
-
-
-
{{ topDisplayData.DXW_DIV_TOP_004.curValue }}
-
TVOC {{ topDisplayData.DXW_DIV_TOP_004.unit }}
-
-
- -
-
-
-
{{ topDisplayData.DXW_DIV_TOP_005.curValue }}
-
PM2.5 {{ topDisplayData.DXW_DIV_TOP_005.unit }}
-
-
- -
-
-
-
{{ topDisplayData.DXW_DIV_TOP_006.curValue }}
-
PM10 {{ topDisplayData.DXW_DIV_TOP_006.unit }}
-
-
-
+ -->
-
+
{{ bannerRoomName }}
-
-
-
-
-
-
-
+
+
-
-
-
-
- -
-
-
-
{{ topDisplayData.XXW_DIV_TOP_001.curValue }}
-
温度 {{ topDisplayData.XXW_DIV_TOP_001.unit }}
-
-
- -
-
-
-
{{ topDisplayData.XXW_DIV_TOP_002.curValue }}
-
湿度 {{ topDisplayData.XXW_DIV_TOP_002.unit }}
-
-
-
- -
-
-
-
{{ topDisplayData.DXW_DIV_TOP_001.curValue }}
-
温度 {{ topDisplayData.DXW_DIV_TOP_001.unit }}
-
-
- -
-
-
-
{{ topDisplayData.DXW_DIV_TOP_002.curValue }}
-
湿度 {{ topDisplayData.DXW_DIV_TOP_002.unit }}
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
- -
- 日借阅量
-
-
- - 日归还量
-
-
- - 月借阅量
-
-
- - 月归还量
-
-
-
-
-
+ -->
@@ -324,20 +132,6 @@
-
@@ -347,7 +141,7 @@
@@ -877,7 +546,7 @@ export default {
overflow: hidden;
}
.container-wrap {
- height: calc(100% / 3 - 14px);
+ height: calc(100% / 2 - 14px);
min-height: auto;
}
.env-item {
@@ -1120,15 +789,15 @@ export default {
.env-3d {
position: relative;
width: 100%;
- height: calc(100% - (100% / 4));
- margin-bottom: 20px;
+ height: calc(100%);
+ // margin-bottom: 20px;
background: url("~@/assets/images/largeScreen/bg.png") no-repeat center -130px;
// background-size: 100% 100%;
overflow: hidden;
.iframe_box {
width: 100%;
height: 100%;
- margin-left: -80px;
+ // margin-left: -80px;
}
.screen-env-list {
position: absolute;
diff --git a/src/views/storeManage/warehouse3D/archivesStorage/index.vue b/src/views/storeManage/warehouse3D/archivesStorage/index.vue
index 0177f35..2f8471f 100644
--- a/src/views/storeManage/warehouse3D/archivesStorage/index.vue
+++ b/src/views/storeManage/warehouse3D/archivesStorage/index.vue
@@ -5,7 +5,23 @@
- -
+
+
-
+
+
+
+
{{ item.value }}
+
{{ item.subName }} {{ item.dw }}
+
+
+
+
@@ -78,7 +94,8 @@
import WarehouseWarning from '@/views/components/WarehouseWarning'
import AccessDoor from '@/views/components/AccessDoor'
import displayConfigApi from '@/api/storeManage/displayConfig'
-import thirdApi from '@/api/thirdApi'
+// import thirdApi from '@/api/thirdApi'
+import alarmApi from '@/api/home/alarm'
import hkVideo from '../module/hkVideo.vue'
export default {
@@ -131,18 +148,24 @@ export default {
curstatus: 0
}
},
- open: false
+ open: false,
+ newAlarm: []
}
},
async created() {
window.getIframeLoading = this.getIframeLoading // 把vue实例中的方法引用给window对象
this.allDisplayConfigData = await displayConfigApi.list({ storeroomId: this.roomId })
this.allDisplayConfigData.forEach(element => {
- if (element.isDisplay && element.bindState && element.deviceInfo && (element.divPosition.includes('OAO') || element.divPosition.includes('TOP'))) {
- this.allDeviceIds.push(element.deviceInfo.deviceId)
- if (!this.url) {
- this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
- }
+ // if (element.isDisplay && element.bindState && element.deviceInfo && (element.divPosition.includes('OAO') || element.divPosition.includes('TOP'))) {
+ // this.allDeviceIds.push(element.deviceInfo.deviceId)
+ // if (!this.url) {
+ // this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
+ // }
+ // }
+ console.log('element.deviceInfo', element.deviceInfo)
+ this.allDeviceIds.push(element.deviceInfo.deviceIp)
+ if (!this.url) {
+ this.url = 'http://' + element.deviceInfo.deviceIp + ':' + element.deviceInfo.devicePort
}
})
this.displayConfigData = this.allDisplayConfigData.filter((item) => { return item.isDisplay && item.bindState && item.deviceInfo && (item.divPosition.includes('OAO') || item.divPosition.includes('TOP')) })
@@ -234,18 +257,7 @@ export default {
data: this.oaoMessage
}, '*')
},
- // 点击查看设备状况 / 密集架列号
- // handleMessageDevice(event) {
- // const _this = this
- // if (event.data && event.data.data) {
- // const data = event.data.data
- // if (data.includes('cabinet')) {
- // _this.deviceId = data.slice(data.length - 2)
- // _this.$router.push('/storeManage/deseCabinet')
- // localStorage.setItem('cabinetNum', _this.deviceId)
- // }
- // }
- // },
+
// 设置温湿度
handleAQI() {
this.oaoMessage.forEach(element => {
@@ -272,7 +284,9 @@ export default {
},
getRealTimeData() {
if (this.allDeviceIds.length > 0) {
- thirdApi.getRealTimeData({ ids: this.allDeviceIds, url: this.url }).then((data) => {
+ // 192.1.8.228 this.allDeviceIds[0]
+ alarmApi.FetchDataForIP({ ip: '192.1.8.156:1000' }).then((data) => {
+ this.newAlarm = data
this.oaoMessage.splice(0, this.oaoMessage.length)
this.displayConfigData.forEach(element => {
if (element.divPosition.includes('TOP') && element.deviceSpecParams[0]) {