From ddc7465294ca88dbd2ec2d5fd6c2e8b772db8079 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Tue, 16 Sep 2025 15:58:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/alarm/setting/car/car-setting.vue | 113 ++++----- src/views/alarm/setting/door/door-setting.vue | 234 +++++++++++------- 2 files changed, 198 insertions(+), 149 deletions(-) diff --git a/src/views/alarm/setting/car/car-setting.vue b/src/views/alarm/setting/car/car-setting.vue index 7c72d90..f54d13f 100644 --- a/src/views/alarm/setting/car/car-setting.vue +++ b/src/views/alarm/setting/car/car-setting.vue @@ -1,56 +1,46 @@ - 人员高频次出入 - + + + 夜晚出入营区 + - 车闸报警频次 - + 夜晚出入时间 + - - 次 - + - 车辆工作时间 - + + + + 考勤配置 + - 车辆工作时间(上午) + 考勤时间(上午) - + - + - 车辆工作时间(下午) + 考勤时间(下午) - - 夜晚报警 - - - - 车辆夜晚报警时间 - - - - - - - - - + @@ -66,21 +56,28 @@ const state = reactive({ // 提交表单数据 const form = reactive({ - // 道闸报警频次 - carRepeatCount: 0, - // 工作时间上午 - carPersonWorkForenoonTime: null, - // 工作时间下午 - carPersonWorkAfternoonTime: null, - // 夜晚报警时间 - carNightAlarmTime: [], + // 车辆晚上出入营区 + carNightCamp: { + alarmTime: [], + cameraChannels: [], + }, + // 车辆考勤配置 + carKq: { + forenoon: [], + afternoon: [], + cameraChannels: [], + deptCodes: [], + }, }) const dataRules = ref({ - carRepeatCount: [{ required: true, message: '车辆报警频次不能为空', trigger: 'blur' }], - carPersonWorkForenoonTime: [{ required: true, message: '车辆工作时间(上午)不能为空', trigger: 'change' }], - carPersonWorkAfternoonTime: [{ required: true, message: '车辆工作时间(下午)不能为空', trigger: 'change' }], - carNightAlarmTime: [{ required: true, message: '车辆报警时间不能为空', trigger: 'change' }], + // 车辆晚上出入营区 + "carNightCamp.alarmTime": [{ + required: true, message: '夜晚出入时间不能为空', trigger: 'blur' + }], + // 车辆考勤配置 + "carKq.forenoon": [{ required: true, message: '考勤时间(上午)不能为空', trigger: 'blur' }], + "carKq.afternoon": [{ required: true, message: '考勤时间(下午)不能为空', trigger: 'blur' }], }) onMounted(() => { @@ -91,16 +88,21 @@ async function getSetting() { state.loading = true try { const { data } = await ComDhSettingApi.getObj() + if (!data.carNightCamp) { + data.carNightCamp = { + alarmTime: [], + cameraChannels: [], + } + } + if (!data.carKq) { + data.carKq = { + forenoon: [], + afternoon: [], + cameraChannels: [], + deptCodes: [], + } + } if (data) { - if (data.carPersonWorkForenoonTime) { - data.carPersonWorkForenoonTime = data.carPersonWorkForenoonTime.split(',') - } - if (data.carPersonWorkAfternoonTime) { - data.carPersonWorkAfternoonTime = data.carPersonWorkAfternoonTime.split(',') - } - if (data.carNightAlarmTime) { - data.carNightAlarmTime = data.carNightAlarmTime.split(',') - } Object.assign(form, data) } } catch (err: any) { @@ -118,15 +120,6 @@ async function onSubmit() { const _form = { ...form, } - if (_form.carPersonWorkForenoonTime && Array.isArray(_form.carPersonWorkForenoonTime)) { - _form.carPersonWorkForenoonTime = _form.carPersonWorkForenoonTime.join(',') - } - if (_form.carPersonWorkAfternoonTime && Array.isArray(_form.carPersonWorkAfternoonTime)) { - _form.carPersonWorkAfternoonTime = _form.carPersonWorkAfternoonTime.join(',') - } - if (_form.carNightAlarmTime && Array.isArray(_form.carNightAlarmTime)) { - _form.carNightAlarmTime = _form.carNightAlarmTime.join(',') - } await ComDhSettingApi.putObj(_form) useMessage().success('修改成功'); } catch (err: any) { diff --git a/src/views/alarm/setting/door/door-setting.vue b/src/views/alarm/setting/door/door-setting.vue index c4d63ae..56ff53a 100644 --- a/src/views/alarm/setting/door/door-setting.vue +++ b/src/views/alarm/setting/door/door-setting.vue @@ -1,77 +1,125 @@ - 人员高频次出入 - + + 夜晚出入营区 + - 道闸报警频次 - - - - - + 夜晚出入时间 - - 次 - + - 人员工作时间 - + - 人员工作时间(上午) + 摄像头 - + - + + + + + 夜晚出入办公楼 + - 人员工作时间(下午) + 夜晚出入时间 - + - 夜晚报警 - + - 人员夜晚报警时间 + 摄像头 - + - 主楼配置 - + + + + 打卡配置 + - 主楼入口摄像头 + 打卡时间(上午) - + + + + + 打卡时间(下午) + + + + + + + + 摄像头 + + + + + + + + 部门 + + + + + + + + 考勤配置 - + - 考勤摄像头 + 考勤时间(上午) - + - + - 考勤部门 + 考勤时间(下午) - + + + + + 摄像头 + + + + + + + + 部门 + + + + + @@ -87,27 +135,43 @@ const state = reactive({ // 提交表单数据 const form = reactive({ - // 道闸报警频次 - doorRepeatCount: 0, - // 工作时间上午 - doorPersonWorkForenoonTime: null, - // 工作时间下午 - doorPersonWorkAfternoonTime: null, - // 夜晚报警时间 - doorNightAlarmTime: [], - // 通道编号 - doorMainFloorChannels: [], - // 考勤摄像头通道 - doorCheckingChannels: [], - // 考勤部门 - doorCheckingDepts: [], + // 人员晚上出入营区 + personNightCamp: { + alarmTime: [], + cameraChannels: [], + }, + // 人员晚上出入办公楼 + personNightOffice: { + alarmTime: [], + cameraChannels: [], + }, + // 人员打卡配置 + personDk: { + forenoon: [], + afternoon: [], + cameraChannels: [], + deptCodes: [], + }, + // 人员考勤配置 + personKq: { + forenoon: [], + afternoon: [], + cameraChannels: [], + deptCodes: [], + }, }) const dataRules = ref({ - doorRepeatCount: [{ required: true, message: '道闸报警频次不能为空', trigger: 'blur' }], - doorPersonWorkForenoonTime: [{ required: true, message: '人员工作时间(上午)不能为空', trigger: 'change' }], - doorPersonWorkAfternoonTime: [{ required: true, message: '人员工作时间(下午)不能为空', trigger: 'change' }], - doorNightAlarmTime: [{ required: true, message: '夜晚报警时间不能为空', trigger: 'change' }], + // 人员晚上出入营区 + "personNightCamp.alarmTime": [{ required: true, message: '夜晚出入时间不能为空', trigger: 'blur' }], + // 人员晚上出入办公楼 + "personNightOffice.alarmTime": [{ required: true, message: '夜晚出入时间不能为空', trigger: 'blur' }], + // 人员打卡配置 + "personDk.forenoon": [{ required: true, message: '打卡时间(上午)不能为空', trigger: 'blur' }], + "personDk.afternoon": [{ required: true, message: '打卡时间(下午)不能为空', trigger: 'blur' }], + // 人员考勤配置 + "personKq.forenoon": [{ required: true, message: '考勤时间(上午)不能为空', trigger: 'blur' }], + "personKq.afternoon": [{ required: true, message: '考勤时间(下午)不能为空', trigger: 'blur' }], }) onMounted(() => { @@ -118,25 +182,35 @@ async function getSetting() { state.loading = true try { const { data } = await ComDhSettingApi.getObj() + if (!data.personNightCamp) { + data.personNightCamp = { + alarmTime: [], + cameraChannels: [], + } + } + if (!data.personNightOffice) { + data.personNightOffice = { + alarmTime: [], + cameraChannels: [], + } + } + if (!data.personDk) { + data.personDk = { + forenoon: [], + afternoon: [], + cameraChannels: [], + deptCodes: [], + } + } + if (!data.personKq) { + data.personKq = { + forenoon: [], + afternoon: [], + cameraChannels: [], + deptCodes: [], + } + } if (data) { - if (data.doorPersonWorkForenoonTime) { - data.doorPersonWorkForenoonTime = data.doorPersonWorkForenoonTime.split(',') - } - if (data.doorPersonWorkAfternoonTime) { - data.doorPersonWorkAfternoonTime = data.doorPersonWorkAfternoonTime.split(',') - } - if (data.doorMainFloorChannels) { - data.doorMainFloorChannels = data.doorMainFloorChannels.split(',') - } - if (data.doorCheckingChannels) { - data.doorCheckingChannels = data.doorCheckingChannels.split(',') - } - if (data.doorNightAlarmTime) { - data.doorNightAlarmTime = data.doorNightAlarmTime.split(',') - } - if (data.doorCheckingDepts) { - data.doorCheckingDepts = data.doorCheckingDepts.split(',') - } Object.assign(form, data) } } catch (err: any) { @@ -154,24 +228,6 @@ async function onSubmit() { const _form = { ...form, } - if (_form.doorPersonWorkForenoonTime && Array.isArray(_form.doorPersonWorkForenoonTime)) { - _form.doorPersonWorkForenoonTime = _form.doorPersonWorkForenoonTime.join(',') - } - if (_form.doorPersonWorkAfternoonTime && Array.isArray(_form.doorPersonWorkAfternoonTime)) { - _form.doorPersonWorkAfternoonTime = _form.doorPersonWorkAfternoonTime.join(',') - } - if (_form.doorMainFloorChannels && Array.isArray(_form.doorMainFloorChannels)) { - _form.doorMainFloorChannels = _form.doorMainFloorChannels.join(',') - } - if (_form.doorCheckingChannels && Array.isArray(_form.doorCheckingChannels)) { - _form.doorCheckingChannels = _form.doorCheckingChannels.join(',') - } - if (_form.doorNightAlarmTime && Array.isArray(_form.doorNightAlarmTime)) { - _form.doorNightAlarmTime = _form.doorNightAlarmTime.join(',') - } - if (_form.doorCheckingDepts && Array.isArray(_form.doorCheckingDepts)) { - _form.doorCheckingDepts = _form.doorCheckingDepts.join(',') - } await ComDhSettingApi.putObj(_form) useMessage().success('修改成功'); } catch (err: any) {