From 67d39e23b34fd367e19cecf5753530d110dfbb9d Mon Sep 17 00:00:00 2001 From: andy <1042025947@qq.com> Date: Mon, 27 Jul 2026 11:53:00 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/NCcode/index.vue | 194 +++++++++++++++++++++++-------------- 1 file changed, 123 insertions(+), 71 deletions(-) diff --git a/src/views/NCcode/index.vue b/src/views/NCcode/index.vue index f649d24..78b38ac 100644 --- a/src/views/NCcode/index.vue +++ b/src/views/NCcode/index.vue @@ -35,7 +35,7 @@ - + 删除 --> - + \ No newline at end of file diff --git a/src/views/biz/device/DeviceOperationLog.vue b/src/views/biz/device/DeviceOperationLog.vue index 262cf66..0f05717 100644 --- a/src/views/biz/device/DeviceOperationLog.vue +++ b/src/views/biz/device/DeviceOperationLog.vue @@ -108,18 +108,54 @@ const columns = [ }, { title: '操作类型', - key: 'operationType' + key: 'operationTypeName' }, { title: '操作人员', - key: 'nickname' + key: 'userName' }, { title: '操作时间', key: 'createTime' + }, + { + title: '数据来源', + key: 'source', + render(row) { + var opt = row.source + if(opt == 1) return '终端' + if(opt == 2) return '后台' + return '-' + } } ] +const handleSearch = () => { + load() +} + +const handleReset = () => { + searchForm.value.createTime = null + searchForm.value.operationType = null + searchForm.value.userId = null + pagination.page = 1 + pagination.pageSize = 10 + load() +} + + +// 分页 +function handlePageChange(page: number) { + pagination.page = page + load() +} + +function handlePageSizeChange(pageSize: number) { + pagination.pageSize = pageSize + pagination.page = 1 + load() +} + onMounted(()=>{ getDeviceList() @@ -149,17 +185,17 @@ onMounted(()=>{ type="date" /> - - - - - + + + + + + + + + + + { + +
+ + + +
diff --git a/src/views/biz/device/index.vue b/src/views/biz/device/index.vue index 1d4dda1..99bf58c 100644 --- a/src/views/biz/device/index.vue +++ b/src/views/biz/device/index.vue @@ -131,10 +131,10 @@
@@ -202,10 +202,10 @@ - + + + + + + + + + + @@ -256,7 +271,8 @@ import {SysUser, userApi} from '@/api/system' import {DeviceAbnormalRecord, deviceAbnormalRecordApi} from "@/api/deviceAbnormalRecord.ts"; import DeviceAbnormalRecordPage from '@/views/biz/device/DeviceAbnomarlRecord.vue' import DeviceOperationLogPage from "@/views/biz/device/DeviceOperationLog.vue"; -import { issueRecordApi } from '@/api/issuerecord' + +import DeviceDispatchLogPage from "@/views/biz/device/DeviceDispatchLog.vue"; const message = useMessage() const dialog = useDialog() const router = useRouter() @@ -276,6 +292,7 @@ const title = ref('') //设备下发记录 const deviceIssueRecordList = ref<[]>([]) +const deviceDispatchLogDrawerVisible = ref(false) //操作日志抽屉 const deviceOperationLogDrawerVisible = ref(false) @@ -318,7 +335,9 @@ const defaultFormData: Device = { status: 0, deviceFlag: 'mes_equipment', synEquipId: null as number | null, - deviceManagerList: null as any | null + deviceManagerList: null as any | null, + deviceManagers: null as [string] | null, + deviceManager: null as String | null } const formData = reactive({...defaultFormData}) @@ -481,16 +500,23 @@ function goRealtimeBoard() { // 编辑 function handleEdit(row: Device) { - + Object.assign(formData, defaultFormData) modalTitle.value = '编辑设备表' Object.assign(formData, row) - console.log(formData); - + const userIdList = [] + if (row.deviceManager) { + let manager = row.deviceManager.split(','); + manager.forEach(item => { + userIdList.push(Number(item)) + }) + } + formData.deviceManagers = userIdList modalVisible.value = true } // 提交 async function handleSubmit() { + await formRef.value?.validate() try { const submitData = {...formData} as Device @@ -647,23 +673,29 @@ async function loadSection() { //加载人员 async function handleUser() { - const res = await userApi.getEquipmentManager() - deviceManagerList.value = res + const res = await userApi.getPathList() + deviceManagerList.value = res.map((n:any)=>{ + return { + label:n.username, + value:n.id + } + }) } //查看设备异常记录 async function handleDeviceErrorLog(row: Device) { + deviceId.value = row.id deviceAbnormalRecordDrawerVisible.value = true title.value = row.deviceName+"异常记录" - deviceErrorLogList.value = row.abnormalRecordList } async function handleDeviceDispatchLog(row: Device) { - const deviceId = row.id - deviceIssueRecordList.value = await issueRecordApi.getDeviceDispatchLogList(deviceId) + deviceId.value = row.id + deviceDispatchLogDrawerVisible.value = true + title.value = row.deviceName+"设备下发记录" } async function deviceOperationLog(row: Device) { @@ -676,6 +708,7 @@ async function deviceOperationLog(row: Device) { function doShowInner() { deviceAbnormalRecordDrawerVisible.value = false deviceOperationLogDrawerVisible.value = false + deviceDispatchLogDrawerVisible.value = false } onMounted(() => {