38 changed files with 1135 additions and 587 deletions
-
40error.md
-
1src/apis/home.ts
-
13src/app.vue
-
6src/components/common/SelectModal/index.vue
-
27src/components/formula/FormulaConfig.vue
-
29src/components/formula/FormulaTable.vue
-
12src/components/home/Environment.vue
-
2src/components/home/HomeFormula.vue
-
18src/components/home/HomeLogLevel.vue
-
96src/components/home/HomeOperation.vue
-
75src/components/home/HomeSetting.vue
-
60src/components/home/LineChart.vue
-
43src/components/home/config.vue
-
66src/components/setting/AddUser.vue
-
37src/components/setting/Device.vue
-
149src/components/setting/ModifyPwd.vue
-
68src/components/setting/SystemDate.vue
-
79src/components/setting/User.vue
-
60src/layouts/default.vue
-
42src/libs/deviceComm.ts
-
3src/libs/socket.ts
-
68src/libs/utils.ts
-
151src/stores/formulaStore.ts
-
146src/stores/homeStore.ts
-
4src/stores/initHomeData.ts
-
2src/stores/liquidStore.ts
-
34src/stores/settingStore.ts
-
8src/types/audit.d.ts
-
4src/types/formula.d.ts
-
19src/types/home.d.ts
-
14src/types/user.d.ts
-
53src/views/audit/index.vue
-
66src/views/debug/index.vue
-
90src/views/home/chart.vue
-
21src/views/home/index.vue
-
92src/views/liquid/index.vue
-
18src/views/seal/index.vue
-
6src/views/setting/index.vue
@ -0,0 +1,40 @@ |
|||||
|
tsucc = 0, |
||||
|
ksucc = 0, |
||||
|
|
||||
|
kappe_begin = 10000, |
||||
|
kappe_code_error = 10001, // 代码错误 |
||||
|
kappe_cmd_not_support = 10003, // 命令不支持 |
||||
|
kappe_parse_json_err = 10004, // 解析json错误 |
||||
|
kappe_std_exception = 10005, // 标准库异常 |
||||
|
kappe_db_operate_error = 10006, // 数据库操作错误 |
||||
|
kappe_missing_param = 10007, // 缺少参数 |
||||
|
kappe_param_num_err = 10008, // 参数个数错误 |
||||
|
kappe_param_value_err = 10009, // 参数值错误 |
||||
|
|
||||
|
kappe_user_not_exist = 10101, // 用户不存在 |
||||
|
kappe_passwd_error = 10102, // 密码错误 |
||||
|
|
||||
|
kappe_disinfectant_insufficient = 10201, // 消毒液不足 |
||||
|
kappe_the_bottom_of_the_device_has_water = 10202, // 设备底部有水 |
||||
|
kappe_the_evaporation_bin_has_water = 10203, // 蒸发仓有水 |
||||
|
kappe_the_sensor_is_preheating = 10204, // 传感器正在预热 |
||||
|
kappe_not_detect_udisk = 10205, // 未检测到U盘 |
||||
|
kappe_udisk_wr_fail = 10206, // U盘读写错误 |
||||
|
kappe_open_file_error = 10207, // 文件操作错误 |
||||
|
kappe_adding_liquid_is_already_in_place = 10208, // 液体已加到位 |
||||
|
kappe_adding_liquid_is_greater_than_the_maximum_capacity_of_the_device = 10209, // 加液大于设备最大容量 |
||||
|
kappe_sensor_is_pre_heating = 10210, // 传感器正在预热 |
||||
|
kappe_state_is_busy = 10211, // 设备忙 |
||||
|
kappe_is_adding_liquid = 10212, // 加液中 |
||||
|
kappe_is_draining_liquid = 10213, // 排液中 |
||||
|
kappe_is_dis infecting = 10214, // 消毒中 |
||||
|
kappe_is_air_leak_detect_testing = 10215, // 气密性测试中 |
||||
|
kappe_setting_id_out_of_range = 10216, // 设置ID超出范围 |
||||
|
kappe_exception_flag_is_setted = 10217, // 异常标志已设置 |
||||
|
kappe_disinfection_state_is_wrong = 10218, // 消毒状态错误 |
||||
|
kappe_component_cfg_not_find = 10219, // 组件配置未找到 |
||||
|
|
||||
|
kappe_liquid_ctrl_reboot = 10300, |
||||
|
kappe_power_control_reboot = 10301, |
||||
|
|
||||
|
kappe_device_checkpoint_check_fail = 20000, // |
@ -0,0 +1,37 @@ |
|||||
|
<script lang="ts" setup> |
||||
|
import { useDeviceStore } from 'stores/deviceStore' |
||||
|
import { ref } from 'vue' |
||||
|
|
||||
|
const deviceStore = useDeviceStore() |
||||
|
const deviceInfo = ref(deviceStore.deviceInfo) |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<div> |
||||
|
<div class="device-ul"> |
||||
|
<div>设备ID:{{ deviceInfo.deviceId }}</div> |
||||
|
</div> |
||||
|
<div class="device-ul"> |
||||
|
<div>设备类型:{{ deviceInfo.deviceType }}</div> |
||||
|
</div> |
||||
|
<div class="device-ul"> |
||||
|
<div>IP地址:{{ deviceInfo.ip }}</div> |
||||
|
</div> |
||||
|
<div class="device-ul"> |
||||
|
<div>初始化状态:{{ deviceInfo.deviceTypeInited ? '已初始化' : '未初始化' }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.device-ul{ |
||||
|
background: #F6FAFE; |
||||
|
height: 4rem; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
width: 100%; |
||||
|
border-radius: 10px; |
||||
|
margin-top: 1rem; |
||||
|
padding-left: 2rem; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,149 @@ |
|||||
|
<script lang="ts" setup> |
||||
|
import type { FormInstance } from 'element-plus' |
||||
|
import { useSettingStore } from '@/stores/settingStore' |
||||
|
import { syncSendCmd } from 'apis/system' |
||||
|
import SoftKeyboard from 'components/common/SoftKeyboard/index.vue' |
||||
|
import { FtMessage } from 'libs/message' |
||||
|
import { ref, watchEffect } from 'vue' |
||||
|
|
||||
|
const emits = defineEmits(['refresh']) |
||||
|
const settingStore = useSettingStore() |
||||
|
const visible = ref(settingStore.modifyPwdVisible) |
||||
|
const modalType = ref(settingStore.userModalState) |
||||
|
const inputValue = ref<string>('') |
||||
|
const keyboardVisible = ref(false) |
||||
|
const keyboardType = ref<'text' | 'number'>('text') |
||||
|
const softKeyboardRef = ref() |
||||
|
const userFormRef = ref() |
||||
|
const focusedInput = ref<string | null>(null) |
||||
|
const modalTitle = ref('修改密码') |
||||
|
const userForm = ref<Record<string, any>>({ |
||||
|
passwd: '', |
||||
|
newpasswd: '', |
||||
|
confirmPasswd: '', |
||||
|
}) |
||||
|
|
||||
|
watchEffect(() => { |
||||
|
modalType.value = settingStore.userModalState |
||||
|
visible.value = settingStore.modifyPwdVisible |
||||
|
if (settingStore.currentEditUser) { |
||||
|
userForm.value = settingStore.currentEditUser |
||||
|
} |
||||
|
if (focusedInput.value) { |
||||
|
userForm.value[focusedInput.value] = inputValue.value |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
const onSave = (formRef: FormInstance | undefined) => { |
||||
|
if (!formRef) { |
||||
|
return |
||||
|
} |
||||
|
formRef.validate((valid) => { |
||||
|
if (valid) { |
||||
|
doSave() |
||||
|
} |
||||
|
else { |
||||
|
console.log('error submit!') |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
const openKeyboard = (e: any) => { |
||||
|
setTimeout(() => { |
||||
|
keyboardVisible.value = true |
||||
|
const labelName = e.target.name |
||||
|
const formValue = userForm.value[labelName as keyof typeof userForm.value] |
||||
|
inputValue.value = formValue ? formValue.toString() : '' |
||||
|
focusedInput.value = e.target.name |
||||
|
}, 100) |
||||
|
} |
||||
|
const doSave = () => { |
||||
|
const passwd = userForm.value.passwd |
||||
|
const newpasswd = userForm.value.newpasswd |
||||
|
const confirmNewPasswd = userForm.value.confirmNewPasswd |
||||
|
if (newpasswd !== confirmNewPasswd) { |
||||
|
FtMessage.error('输入的密码不一致') |
||||
|
return |
||||
|
} |
||||
|
const saveParams = { |
||||
|
className: 'UserMgrService', |
||||
|
fnName: 'chpasswd', |
||||
|
params: { |
||||
|
id: userForm.value.id, |
||||
|
passwd, |
||||
|
newpasswd, |
||||
|
}, |
||||
|
} |
||||
|
syncSendCmd(saveParams).then((res) => { |
||||
|
if (res.ackcode === 0) { |
||||
|
FtMessage.success('密码修改成功') |
||||
|
userForm.value = {} |
||||
|
emits('refresh') |
||||
|
onClose() |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
const onClose = () => { |
||||
|
settingStore.updatePwdVisible(false) |
||||
|
} |
||||
|
const handleConfirm = (value: string) => { |
||||
|
console.log('确认输入:', value) |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<FtDialog v-model="visible" :title="modalTitle" :ok-handle="() => { onSave(userFormRef) }" @cancel="onClose"> |
||||
|
<div> |
||||
|
<el-form ref="userFormRef" :model="userForm" label-width="auto" style="max-width: 400px"> |
||||
|
<div> |
||||
|
<el-form-item |
||||
|
label="旧密码:" |
||||
|
prop="passwd" |
||||
|
:rules="{ |
||||
|
required: true, |
||||
|
message: '输入密码', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}" |
||||
|
> |
||||
|
<el-input v-model="userForm.passwd" v-prevent-keyboard name="passwd" @focus="openKeyboard" type="password" placeholder="密码" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item |
||||
|
label="新密码:" |
||||
|
prop="newpasswd" |
||||
|
:rules="{ |
||||
|
required: true, |
||||
|
message: '输入密码', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}" |
||||
|
> |
||||
|
<el-input v-model="userForm.newpasswd" v-prevent-keyboard name="newpasswd" @focus="openKeyboard" type="password" placeholder="密码" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item |
||||
|
label="确认新密码:" |
||||
|
prop="confirmNewPasswd" |
||||
|
:rules="{ |
||||
|
required: true, |
||||
|
message: '输入密码', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}" |
||||
|
> |
||||
|
<el-input v-model="userForm.confirmNewPasswd" v-prevent-keyboard name="confirmNewPasswd" @focus="openKeyboard" type="password" placeholder="确认密码" /> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
</el-form> |
||||
|
<Teleport to="body"> |
||||
|
<SoftKeyboard |
||||
|
ref="softKeyboardRef" |
||||
|
v-model="inputValue" |
||||
|
:is-visible="keyboardVisible" |
||||
|
:keyboard-type="keyboardType" |
||||
|
@update-keyboard-visible="(visible) => keyboardVisible = visible" |
||||
|
@confirm="handleConfirm" |
||||
|
@close="keyboardVisible = false" |
||||
|
/> |
||||
|
</Teleport> |
||||
|
</div> |
||||
|
</FtDialog> |
||||
|
</template> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
</style> |
@ -0,0 +1,68 @@ |
|||||
|
<script lang="ts" setup> |
||||
|
import { sendCmd } from '@/apis/system' |
||||
|
import { FtMessage } from '@/libs/message' |
||||
|
import { ref } from 'vue' |
||||
|
|
||||
|
const dateVal = ref() |
||||
|
const onChangeDate = async (value: string) => { |
||||
|
if (value) { |
||||
|
const splitDate = value.split(' ') // 先以空格分隔 |
||||
|
const YMD = splitDate[0].split('-') |
||||
|
// 更新年月日 |
||||
|
const year = Number(YMD[0]) |
||||
|
const month = Number(YMD[1]) |
||||
|
const day = Number(YMD[2]) |
||||
|
const dateParams = { |
||||
|
className: 'OsMgrService', |
||||
|
fnName: 'updateDate', |
||||
|
params: { |
||||
|
year, |
||||
|
month, |
||||
|
day, |
||||
|
}, |
||||
|
} |
||||
|
await sendCmd(dateParams) |
||||
|
|
||||
|
const HMS = splitDate[1].split(':') |
||||
|
// 更新时分秒 |
||||
|
const hour = Number(HMS[0]) |
||||
|
const min = Number(HMS[1]) |
||||
|
const second = Number(HMS[2]) |
||||
|
const timeParams = { |
||||
|
className: 'OsMgrService', |
||||
|
fnName: 'updateTime', |
||||
|
params: { |
||||
|
hour, |
||||
|
min, |
||||
|
second, |
||||
|
}, |
||||
|
} |
||||
|
await sendCmd(timeParams) |
||||
|
FtMessage.success('日期设置成功') |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<div> |
||||
|
<div class="date-main"> |
||||
|
<div class="date-com"> |
||||
|
设置日期: |
||||
|
<el-date-picker |
||||
|
v-model="dateVal" |
||||
|
type="datetime" |
||||
|
placeholder="日期:年-月-日 时:分:秒" |
||||
|
format="YYYY-MM-DD HH:mm:ss" |
||||
|
value-format="YYYY-MM-DD HH:mm:ss" |
||||
|
@change="onChangeDate" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.date-main{ |
||||
|
margin: 2rem; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,42 @@ |
|||||
|
import { useHomeStore } from '@/stores/homeStore' |
||||
|
import { useLiquidStore } from '@/stores/liquidStore' |
||||
|
import { useSealStore } from '@/stores/sealStore' |
||||
|
import { ref, watchEffect } from 'vue' |
||||
|
|
||||
|
const homeStore = useHomeStore() |
||||
|
const liquidStore = useLiquidStore() |
||||
|
const sealStore = useSealStore() |
||||
|
const addWorkState = ref(liquidStore.liquidStateData)// 加液状态
|
||||
|
const drainWorkState = ref(liquidStore.liquidStateData)// 排液状态
|
||||
|
const sealInfo = ref(sealStore.sealInfo) |
||||
|
|
||||
|
watchEffect(() => { |
||||
|
addWorkState.value = liquidStore.liquidAddWorkState |
||||
|
drainWorkState.value = liquidStore.liquidDrainWorkState |
||||
|
sealInfo.value = sealStore.sealInfo |
||||
|
}) |
||||
|
|
||||
|
export const getDeviceStatus = () => { |
||||
|
let statusName = '' |
||||
|
if (!homeStore.isDeviceIdle) { |
||||
|
statusName = '正在进行消毒,不可操作' |
||||
|
return statusName |
||||
|
} |
||||
|
// 正在进行加液
|
||||
|
if (addWorkState.value.workState !== 'idle') { |
||||
|
statusName = '正在进行加液操作...' |
||||
|
return statusName |
||||
|
} |
||||
|
// 正在进行排液
|
||||
|
if (drainWorkState.value.workState !== 'idle') { |
||||
|
statusName = '正在进行排液操作...' |
||||
|
return statusName |
||||
|
} |
||||
|
|
||||
|
// 正在密封测试
|
||||
|
if (sealInfo.value.workState !== 'idle') { |
||||
|
statusName = '正在进行排液操作...' |
||||
|
return statusName |
||||
|
} |
||||
|
return statusName |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
declare namespace Audit { |
||||
|
interface AuditItem { |
||||
|
behaviorZH: string |
||||
|
behaviorinfo: string |
||||
|
date: string |
||||
|
userName: string |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue