From c9794cb70b42aa8b7c3b264bca585fe69b56c911 Mon Sep 17 00:00:00 2001
From: LiLongLong <13717757313@163.com>
Date: Fri, 27 Jun 2025 20:25:45 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/images/wifi-conn.svg | 1 +
src/assets/images/wifi-unconn.svg | 1 +
src/assets/styles/common.scss | 1 +
src/components/common/BTButton/index.vue | 5 +
.../common/CascadingSelectModal/index.vue | 17 +-
src/components/common/SoftKeyboard/index.vue | 48 ++-
.../common/SoftKeyboard/moveKeyboard.vue | 354 +++++++++++++++++++++
src/components/formula/FormulaConfig.vue | 246 ++++++++------
src/components/formula/FormulaTable.vue | 4 +-
src/components/home/HomeFormula.vue | 5 +-
src/components/home/HomeLogLevel.vue | 3 +-
src/components/home/HomeOperation.vue | 2 +
src/components/home/HomeSetting.vue | 9 +-
src/components/home/config.vue | 6 +
src/components/setting/AddUser.vue | 24 +-
src/components/setting/History.vue | 1 -
src/components/setting/HistoryDetail.vue | 1 +
src/components/setting/User.vue | 71 +++--
src/components/system/NetReconnection.vue | 1 -
src/layouts/default.vue | 19 +-
src/main.ts | 4 +-
src/router/index.ts | 5 +-
src/stores/deviceStore.ts | 19 ++
src/stores/formulaStore.ts | 13 +
src/stores/homeStore.ts | 9 +-
src/stores/systemStore.ts | 1 +
src/types/user.d.ts | 6 +
src/views/audit/index.vue | 58 ++--
src/views/formula/index.vue | 15 +-
src/views/home/chart.vue | 2 +-
src/views/liquid/index.vue | 32 +-
src/views/login/index.vue | 15 +
src/views/seal/index.vue | 22 +-
33 files changed, 810 insertions(+), 210 deletions(-)
create mode 100644 src/assets/images/wifi-conn.svg
create mode 100644 src/assets/images/wifi-unconn.svg
create mode 100644 src/components/common/SoftKeyboard/moveKeyboard.vue
diff --git a/src/assets/images/wifi-conn.svg b/src/assets/images/wifi-conn.svg
new file mode 100644
index 0000000..93a5d22
--- /dev/null
+++ b/src/assets/images/wifi-conn.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/images/wifi-unconn.svg b/src/assets/images/wifi-unconn.svg
new file mode 100644
index 0000000..175e5da
--- /dev/null
+++ b/src/assets/images/wifi-unconn.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/styles/common.scss b/src/assets/styles/common.scss
index d5fa3df..3e0fb16 100644
--- a/src/assets/styles/common.scss
+++ b/src/assets/styles/common.scss
@@ -6,6 +6,7 @@ html {
}
html, body {
overflow: hidden;
+ user-select: none;
}
html,
body,
diff --git a/src/components/common/BTButton/index.vue b/src/components/common/BTButton/index.vue
index 0dd4c16..ebedd53 100644
--- a/src/components/common/BTButton/index.vue
+++ b/src/components/common/BTButton/index.vue
@@ -67,6 +67,10 @@ const props = defineProps({
type: String,
default: '.714vw 1.339vw',
},
+ minHeight: {
+ type: String,
+ default: '',
+ },
})
const emits = defineEmits(['click'])
@@ -95,6 +99,7 @@ const handleClick = (event: MouseEvent) => {
borderRadius,
fontSize: textSize,
padding,
+ minHeight,
}"
@click="handleClick"
>
diff --git a/src/components/common/CascadingSelectModal/index.vue b/src/components/common/CascadingSelectModal/index.vue
index d54ac65..da73bf3 100644
--- a/src/components/common/CascadingSelectModal/index.vue
+++ b/src/components/common/CascadingSelectModal/index.vue
@@ -1,4 +1,5 @@
@@ -123,7 +128,7 @@ watchEffect(() => {
diff --git a/src/components/common/SoftKeyboard/index.vue b/src/components/common/SoftKeyboard/index.vue
index 2091c71..27875f1 100644
--- a/src/components/common/SoftKeyboard/index.vue
+++ b/src/components/common/SoftKeyboard/index.vue
@@ -1,6 +1,7 @@
+
+
+
+
+
+
+
+
拼音:{{ pinyinValue }}
+
+
{ e.stopPropagation(); handleKeyCn(cnName) }">
+ {{ cnName }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/formula/FormulaConfig.vue b/src/components/formula/FormulaConfig.vue
index bdbdd6c..b6aacf6 100644
--- a/src/components/formula/FormulaConfig.vue
+++ b/src/components/formula/FormulaConfig.vue
@@ -20,8 +20,13 @@ const props = defineProps<{
type: string
}>()
+const nameLength = 10
+
const formulaStore = useFormulaStore()
+const targetInputRef = ref(null)
+
+const isFlip = ref(true)
/**
* 当前表单数据
* 不同模式下有不同的初始值:
@@ -123,7 +128,8 @@ watchEffect(() => {
else {
formData.value = cloneDeep(formulaStore.currentSelectedFormulaInfo) || cloneDeep(formulaStore.defaultFormulaInfo)
}
- // 后端给的数据类型是字符串型,前端需要的是int型,后端开发说后端不好转换,由前端进行转换
+ isFlip.value = formulaStore.flip
+ // 后端给的数据类型是字符串型,前端需要的是int型,后端开发说(赵贺)后端不好转换,由前端进行转换.
formData.value = convertValuesToInt(formData.value)
})
@@ -132,18 +138,29 @@ watchEffect(() => {
* @param {string | number} newVal - 新的输入值
*/
watch(inputValue, (newVal: string | number) => {
+ console.log('inputValue-----------', inputValue)
if (focusedInput.value) {
if (focusedInput.value !== 'name') {
newVal = Number(newVal)
+ if (currentFormulaItem.value && newVal > currentFormulaItem.value.val_upper_limit) {
+ newVal = currentFormulaItem.value.val_upper_limit
+ }
+ formData.value[focusedInput.value] = newVal
}
- console.log('currentFormulaItem.value--', currentFormulaItem.value)
- if (currentFormulaItem.value && newVal > currentFormulaItem.value.val_upper_limit) {
- newVal = currentFormulaItem.value.val_upper_limit
+ else {
+ if (formData.value.name && formData.value.name.length > nameLength) {
+ inputValue.value = formData.value.name
+ }
}
- formData.value[focusedInput.value] = newVal
}
})
+// watch(formData, (newVal) => {
+// if (newVal && newVal.length > nameLength) {
+// formData.value.name = newVal.name.slice(0, nameLength)
+// }
+// }, { deep: true })
+
/**
* 获取当前表单数据,将值转换为字符串格式
* @returns {Record} 转换后的表单数据
@@ -287,6 +304,9 @@ const openKeyboard = (e: any, item: Formula.FormulaItem) => {
inputValue.value = formValue.toString()
focusedInput.value = e.target.name
currentFormulaItem.value = item
+
+ const inputDom = e.target as HTMLInputElement
+ targetInputRef.value = inputDom
}, 100)
}
@@ -343,95 +363,105 @@ const openKeyboardType = (labelName: string) => {
-
+
diff --git a/src/components/formula/FormulaTable.vue b/src/components/formula/FormulaTable.vue
index a514d38..841fc3c 100644
--- a/src/components/formula/FormulaTable.vue
+++ b/src/components/formula/FormulaTable.vue
@@ -17,9 +17,7 @@ onMounted(() => {
})
watchEffect(() => {
- if (formulaStore.formulaList && formulaStore.formulaList.length) {
- recipes.value = formulaStore.formulaList as Formula.FormulaItem[]
- }
+ recipes.value = formulaStore.formulaList as Formula.FormulaItem[]
})
const initFormulaList = () => {
diff --git a/src/components/home/HomeFormula.vue b/src/components/home/HomeFormula.vue
index 416db52..f757fbd 100644
--- a/src/components/home/HomeFormula.vue
+++ b/src/components/home/HomeFormula.vue
@@ -31,13 +31,14 @@ watchEffect(() => {
.home-right-title{
display: grid;
grid-template-columns: 1fr 1fr;
+ font-size: 1.5rem;
.title-formula{
display: flex;
justify-self: start;
align-items: center;
gap: 5px;
padding: 10px;
- font-size: 16px;
+ font-size: 1.5rem;
}
.title-spend{
justify-self: end;
@@ -45,7 +46,7 @@ watchEffect(() => {
align-items: center;
gap: 5px;
padding: 10px;
- font-size: 16px;
+ font-size: 1.5rem;
}
}
diff --git a/src/components/home/HomeLogLevel.vue b/src/components/home/HomeLogLevel.vue
index 7b36751..b775321 100644
--- a/src/components/home/HomeLogLevel.vue
+++ b/src/components/home/HomeLogLevel.vue
@@ -37,6 +37,7 @@ const handleCancel = () => {
class="input"
placeholder="请选择"
style="height: 4rem"
+ readonly
@focus="openModal"
>
@@ -66,7 +67,7 @@ $input-height: 3rem;
display: flex;
align-items: center;
justify-content: center;
- margin-top: 26vh;
+ margin-top: 24vh;
font-family: Source Han Sans;
font-size: 24px;
.input{
diff --git a/src/components/home/HomeOperation.vue b/src/components/home/HomeOperation.vue
index 7b4b8b2..253597d 100644
--- a/src/components/home/HomeOperation.vue
+++ b/src/components/home/HomeOperation.vue
@@ -163,6 +163,7 @@ const operationState = computed(() => {
:height="btnStyle.height"
:text-size="btnStyle.textSize"
:border-radius="btnStyle.borderRadius"
+ min-height="4rem"
@click="onStartDisinfect"
>
@@ -178,6 +179,7 @@ const operationState = computed(() => {
:height="btnStyle.height"
:text-size="btnStyle.textSize"
:border-radius="btnStyle.borderRadius"
+ min-height="4rem"
@click="onFinishDisinfect"
>
diff --git a/src/components/home/HomeSetting.vue b/src/components/home/HomeSetting.vue
index 381aeb6..8614ba4 100644
--- a/src/components/home/HomeSetting.vue
+++ b/src/components/home/HomeSetting.vue
@@ -179,6 +179,7 @@ const onSetPressure = () => {
if (res.ackcode === 0) {
defaultIntensityValue.value = res.rely.intensity
homeStore.updateDefaultIntensityValue(res.rely.intensity)
+ homeStore.updateDefaultIntensityTypeValue(res.rely.type)
isModalOpen.value = true
}
})
@@ -268,22 +269,20 @@ const onClose = () => {
{
* @description 关闭模态框,更新选中配方并转换数值类型
*/
const handleConfirm = (value: any) => {
+ if (!value) {
+ FtMessage.error('请选择配方')
+ return
+ }
+ console.log('value---', value)
isModalOpen.value = false
let selectedFormula = {}
formulaStore.formulaList.forEach((item: Formula.FormulaItem) => {
diff --git a/src/components/setting/AddUser.vue b/src/components/setting/AddUser.vue
index a194ed1..331c12e 100644
--- a/src/components/setting/AddUser.vue
+++ b/src/components/setting/AddUser.vue
@@ -28,9 +28,9 @@ watchEffect(() => {
modalType.value = settingStore.userModalState
if (settingStore.userModalState === 'edit') {
modalTitle.value = '修改密码'
- }
- if (settingStore.currentEditUser) {
- userForm.value = settingStore.currentEditUser
+ if (settingStore.currentEditUser) {
+ userForm.value = settingStore.currentEditUser
+ }
}
else {
modalTitle.value = '新增用户'
@@ -58,13 +58,12 @@ const onSave = (formRef: FormInstance | undefined) => {
console.log('error submit!')
}
})
- onClose()
}
const openKeyboard = (e: any) => {
setTimeout(() => {
keyboardVisible.value = true
const labelName = e.target.name
- const formValue = userForm.value[labelName as keyof typeof userForm.value]
+ const formValue = userForm.value[labelName]
inputValue.value = formValue ? formValue.toString() : ''
focusedInput.value = e.target.name
}, 100)
@@ -94,10 +93,21 @@ const doSave = () => {
if (res.ackcode === 0) {
FtMessage.success('成功')
emits('refresh')
+ onClose()
}
})
}
const onClose = () => {
+ const defaultForm = {
+ id: 0,
+ name: '',
+ passwd: '',
+ confirmPasswd: '',
+ roleType: '',
+ }
+ userForm.value = defaultForm
+ settingStore.updateCurrentEditUser(defaultForm)
+ focusedInput.value = null
settingStore.updateVisible(false)
}
const handleConfirm = (value: string) => {
@@ -106,7 +116,7 @@ const handleConfirm = (value: string) => {
-
+
{
trigger: ['blur', 'change'],
}"
>
-
+
{
@click="onExportHistory"
/>
diff --git a/src/components/setting/HistoryDetail.vue b/src/components/setting/HistoryDetail.vue
index de4f8ee..ae1551a 100644
--- a/src/components/setting/HistoryDetail.vue
+++ b/src/components/setting/HistoryDetail.vue
@@ -54,6 +54,7 @@ const tableColumns = computed(() => {
:key="column.prop"
:prop="column.prop"
:label="column.label"
+ width="150"
:min-width="column.minWidth"
/>
diff --git a/src/components/setting/User.vue b/src/components/setting/User.vue
index 255c530..b6c23b6 100644
--- a/src/components/setting/User.vue
+++ b/src/components/setting/User.vue
@@ -10,6 +10,8 @@ import ModifyPwd from './ModifyPwd.vue'
const settingStore = useSettingStore()
const tableData = ref(settingStore.userList)
const selectedUserList = ref([])
+const userData = localStorage.getItem('user')
+const userInfo = userData ? JSON.parse(userData) : {}
onMounted(() => {
queryUserList()
@@ -27,6 +29,11 @@ const queryUserList = () => {
})
}
const updatePwd = (userItem: User.UserItem) => {
+ // 判断登录是否管理员,非管理员不可修改密码
+ if (userInfo.roleType !== 'admin' && userInfo.id !== userItem.id) {
+ FtMessage.error('无权限修改密码')
+ return
+ }
settingStore.updateCurrentEditUser(userItem)
settingStore.updatePwdVisible(true)
}
@@ -35,13 +42,17 @@ const onAddUser = () => {
settingStore.updateUserModalState('add')
settingStore.updateVisible(true)
}
-const onDelUser = () => {
- if (selectedUserList.value.length !== 1) {
- FtMessage.warning('选择一条数据进行删除')
+const onDelUser = (user: User.UserItem) => {
+ // if (selectedUserList.value.length !== 1) {
+ // FtMessage.warning('选择一条数据进行删除')
+ // return
+ // }
+ // 自己不是管理员,要删除管理账号,不允许
+ if (user.id === userInfo.id) {
+ FtMessage.warning('自己不可删除自己')
return
}
- const user = selectedUserList.value[0]
- if (user.roleType === 'admin') {
+ if (user.roleType === 'admin' && userInfo.roleType !== 'admin') {
FtMessage.warning('不可删除管理员用户')
return
}
@@ -67,46 +78,56 @@ const handleSelectionChange = (users: User.UserItem[]) => {
-
-
+
+
-
-
+
-
-
+
-
- 修改密码
-
+
+
+ 修改密码
+
+
+ 删 除
+
+
-
+
+
diff --git a/src/components/system/NetReconnection.vue b/src/components/system/NetReconnection.vue
index 4ad2a8d..e1d09c1 100644
--- a/src/components/system/NetReconnection.vue
+++ b/src/components/system/NetReconnection.vue
@@ -20,7 +20,6 @@ const countdownToReconnection = () => {
}
watchEffect(() => {
- console.log('systemStore.websocketConnected---', systemStore.websocketConnected)
websocketConnected.value = systemStore.websocketConnected
if (!systemStore.websocketConnected) {
countdownToReconnection()
diff --git a/src/layouts/default.vue b/src/layouts/default.vue
index 98af9e1..2692a1b 100644
--- a/src/layouts/default.vue
+++ b/src/layouts/default.vue
@@ -6,6 +6,8 @@ import { useLiquidStore } from '@/stores/liquidStore'
import { useSealStore } from '@/stores/sealStore'
import { useSystemStore } from '@/stores/systemStore'
import HomeAlarmSvg from 'assets/images/home/home-alarm.svg'
+import WifiConnSvg from 'assets/images/wifi-conn.svg'
+import WifiUnconnSvg from 'assets/images/wifi-unconn.svg'
import ErrorEventsModal from 'components/system/ErrorEventsModal.vue'
import NetReconnection from 'components/system/NetReconnection.vue'
// import ErrorBox from 'libs/modalUtil'
@@ -39,6 +41,7 @@ const sealInfo = ref(sealStore.sealInfo)
const websocketConnected = ref(systemStore.websocketConnected)
let touchStartTime = 0
let touchCount = 0
+const deviceType = ref()
onMounted(() => {
// 连续3次点击任意地方,全屏显示
@@ -96,6 +99,7 @@ watchEffect(() => {
// 密封测试状态
sealInfo.value = sealStore.sealInfo
showDeviceStateName()
+ deviceType.value = deviceStore.deviceType
})
onUnmounted(() => {
@@ -149,7 +153,11 @@ const toggleLanguage = () => {
-
+
+
+
+
+
{{ language.name }}
@@ -166,7 +174,7 @@ const toggleLanguage = () => {
-
+
@@ -250,6 +258,10 @@ const toggleLanguage = () => {
width: 20vw;
text-align: right;
right: 5px;
+ display: flex;
+ align-items: center;
+ gap: 25px;
+ padding-left: 10px;
.select-language {
width: 100px;
border-radius: 5px;
@@ -401,11 +413,12 @@ const toggleLanguage = () => {
.alarm-info {
font-size: 1.5rem;
width: 53vw;
- padding-left: 1.3vw;
+ //padding-left: 1.3vw;
background: #F5F5F5;
height: 5vh;
display: flex;
align-items: center;
+ justify-content: center;
gap: 5px;
.alarm-workState{
margin-left: 5px;
diff --git a/src/main.ts b/src/main.ts
index 71c7f9b..0745db1 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -4,6 +4,7 @@ import BTButton from 'components/common/BTButton/index.vue'
import FtButton from 'components/common/FTButton/index.vue'
import FtDialog from 'components/common/FTDialog/index.vue'
import FtTable from 'components/common/FTTable/index.vue'
+
import ElementPlus from 'element-plus'
import locale from 'element-plus/es/locale/lang/zh-cn'
import ErrorBox from 'libs/modalUtil'
@@ -36,8 +37,9 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
}
app.directive('prevent-keyboard', {
mounted(el) {
+ console.log('el---', el)
// 阻止输入框自动聚焦
- el.querySelector('input').setAttribute('readonly', 'readonly')
+ // el.querySelector('input').setAttribute('readonly', 'readonly')
},
})
app.config.warnHandler = () => null
diff --git a/src/router/index.ts b/src/router/index.ts
index 4693f6c..42d68c6 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -1,15 +1,18 @@
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
import { getToken } from '@/libs/token'
+import { createWebSocket } from 'libs/socket'
import { createRouter, createWebHashHistory } from 'vue-router'
import routes from './routes'
+const wsClient = createWebSocket()
+
const router = createRouter({
history: createWebHashHistory(),
routes,
})
router.beforeEach((to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
- if (getToken()) {
+ if (getToken() && wsClient.isConnected) {
next()
}
else {
diff --git a/src/stores/deviceStore.ts b/src/stores/deviceStore.ts
index 0c7f256..3edfb1a 100644
--- a/src/stores/deviceStore.ts
+++ b/src/stores/deviceStore.ts
@@ -22,12 +22,29 @@ const initState = {
state: DEVICE_STATES.IDLE,
}
+const deviceTypeMap = {
+ LargeSpaceDM: 'DT600N', // 大空间
+ SmallSpaceDM: 'DT300N', // 小空间
+ PipeDM: 'DT300W', // 管道式
+ DrawBarDM: 'DT100N', // 拉杆箱
+ LargeSpaceDM_B: 'DT600B', // 大空间标准
+}
+
export const useDeviceStore = defineStore('device', () => {
const deviceInfo = ref(initDeviceInfo)
+ // 使用deviceType区分是什么消毒机。低成本消毒机部署在移动pad,不显示软件键盘的开关。 拉杆消毒机是上位机显示软键盘
+ // 暂时使用 deviceType : ture 表示 为低成本。
+ const deviceType = ref(true)
const deviceStete = ref(initState) // 设备状态
const updateDeviceInfo = (info: Device.DeviceInfo) => {
deviceInfo.value = info
+ if (info.projectType === 'SmallSpaceDM') {
+ deviceType.value = true
+ }
+ else {
+ deviceType.value = false
+ }
}
/**
@@ -48,7 +65,9 @@ export const useDeviceStore = defineStore('device', () => {
}
return {
+ deviceTypeMap,
deviceInfo,
+ deviceType,
deviceStete,
updateDeviceInfo,
setDeviceState,
diff --git a/src/stores/formulaStore.ts b/src/stores/formulaStore.ts
index 0dec9ac..47ab8e1 100644
--- a/src/stores/formulaStore.ts
+++ b/src/stores/formulaStore.ts
@@ -44,6 +44,7 @@ export const useFormulaStore = defineStore('formula', () => {
const formulaConfigList = ref([])
const formulaList = ref([])
const loglevel = ref('1')
+ const flip = ref(true)
watch(defaultFormulaInfo, (newVal) => {
currentSelectedFormulaInfo.value = cloneDeep(newVal)
@@ -158,6 +159,12 @@ export const useFormulaStore = defineStore('formula', () => {
const res = await syncSendCmd(params)
if (res.rely) {
formulaList.value = res.rely
+ if (res.rely.length) {
+ currentSelectedFormulaInfo.value = res.rely[res.rely.length - 1]
+ }
+ }
+ else {
+ formulaList.value = []
}
}
catch (error) {
@@ -205,6 +212,10 @@ export const useFormulaStore = defineStore('formula', () => {
}
}
+ const updateFlip = (data: boolean) => {
+ flip.value = data
+ }
+
return {
// 属性
logEnums,
@@ -218,6 +229,7 @@ export const useFormulaStore = defineStore('formula', () => {
selectedFormulaInfo,
defaultFormulaInfo,
isDefaultFormula,
+ flip,
// 方法
updatePressurList,
updateSelectedFormulaData,
@@ -229,5 +241,6 @@ export const useFormulaStore = defineStore('formula', () => {
updateLogLevel,
resetToDefaultFormula,
getFormualDefaultData,
+ updateFlip,
}
})
diff --git a/src/stores/homeStore.ts b/src/stores/homeStore.ts
index f4f9b89..b651d5e 100644
--- a/src/stores/homeStore.ts
+++ b/src/stores/homeStore.ts
@@ -38,6 +38,7 @@ export const useHomeStore = defineStore('home', () => {
const disinfectionState = ref(initDisinfectState) // 当前设备消毒状态
let renderTimer: any
const defaultIntensityValue = ref(0)
+ const defaultIntensityTypeValue = ref()
/**
* @function updateHomeData
@@ -73,7 +74,6 @@ export const useHomeStore = defineStore('home', () => {
params: { type },
}
syncSendCmd(pressureTypeParams)
-
// 正压或负压时保存设置的压力值
if (type === 'positivePressure' || type === 'negativePressure') {
const intensity = pressureData[1]
@@ -125,6 +125,10 @@ export const useHomeStore = defineStore('home', () => {
defaultIntensityValue.value = value
}
+ const updateDefaultIntensityTypeValue = (value: number) => {
+ defaultIntensityTypeValue.value = value
+ }
+
return {
isDeviceIdle,
@@ -143,5 +147,8 @@ export const useHomeStore = defineStore('home', () => {
defaultIntensityValue,
updateDefaultIntensityValue,
+
+ defaultIntensityTypeValue,
+ updateDefaultIntensityTypeValue,
}
})
diff --git a/src/stores/systemStore.ts b/src/stores/systemStore.ts
index 4627689..f234d2a 100644
--- a/src/stores/systemStore.ts
+++ b/src/stores/systemStore.ts
@@ -100,6 +100,7 @@ export const useSystemStore = defineStore('system', () => {
systemList,
loading,
websocketConnected,
+
updateLoading,
updateConnected,
subscribeDisinfectEvent,
diff --git a/src/types/user.d.ts b/src/types/user.d.ts
index 28988b8..80b3912 100644
--- a/src/types/user.d.ts
+++ b/src/types/user.d.ts
@@ -44,4 +44,10 @@ declare namespace User {
newpasswd: string
confirmNewpasswd?: string
}
+
+ interface UsrRole {
+ account: string
+ usrRole: string
+ id: number
+ }
}
diff --git a/src/views/audit/index.vue b/src/views/audit/index.vue
index fd2ce96..4d2e3de 100644
--- a/src/views/audit/index.vue
+++ b/src/views/audit/index.vue
@@ -54,18 +54,19 @@ const getAuditList = async () => {
* @desc 导出单条审计记录,需先选择一条记录
*/
const onExportRecord = () => {
- if (selectedUserList.value.length !== 1) {
- FtMessage.warning('请选择一条数据进行导出')
- return
- }
+ // if (selectedUserList.value.length !== 1) {
+ // FtMessage.warning('请选择一条数据进行导出')
+ // return
+ // }
const params = {
className: 'AuditMgrService',
fnName: 'exportData',
- params: {},
}
syncSendCmd(params)
- .then(() => {
- FtMessage.success('导出成功')
+ .then((res) => {
+ if (res.ackcode === 0) {
+ FtMessage.success('导出成功')
+ }
})
.catch((error) => {
console.error('导出审计记录失败:', error)
@@ -95,23 +96,23 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
-
-
-
-
-
+
+
+
+
+
-
+
-
+
+
@@ -124,16 +125,21 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
background: $gradient-color;
box-shadow: 0px 1px 5px 0px rgba(9, 39, 62, 0.15);
.audit-export{
- margin: 2vw;
- }
- .audit-pagination{
- bottom: 1rem;
- position: absolute;
- right: 2rem;
+ padding: 2vw;
+ display: flex;
+ align-items: center;
+ height: 12%;
}
.audit-table{
max-height: 67vh;
overflow: auto;
+ height: 76%;
+ }
+ .audit-pagination{
+ height: 12%;
+ display: flex;
+ justify-content: end;
+ align-items: center;
}
}
diff --git a/src/views/formula/index.vue b/src/views/formula/index.vue
index d0f4a86..1e97ea8 100644
--- a/src/views/formula/index.vue
+++ b/src/views/formula/index.vue
@@ -3,16 +3,21 @@ import { useFormulaStore } from '@/stores/formulaStore'
import { syncSendCmd } from 'apis/system'
import FormulaConfig from 'components/formula/FormulaConfig.vue'
import FormulaTable from 'components/formula/FormulaTable.vue'
+import { FtMessage } from 'libs/message'
const formulaStore = useFormulaStore()
const onAddFormula = () => {
const params = {
className: 'SettingMgrService',
fnName: 'addNewFormula',
- params: {},
}
- syncSendCmd(params).then(() => {
- formulaStore.initFormulaList()
+ formulaStore.updateFlip(false)
+ syncSendCmd(params).then((res) => {
+ if (res.ackcode === 0) {
+ FtMessage.success('新增成功')
+ formulaStore.initFormulaList()
+ formulaStore.updateFlip(true)
+ }
})
}
@@ -69,8 +74,8 @@ const onAddFormula = () => {
.formula-list{
display: flex;
justify-content: center;
- height: 75vh;
- max-height: 75vh;
+ height: 74vh;
+ max-height: 74vh;
}
}
.formula-right{
diff --git a/src/views/home/chart.vue b/src/views/home/chart.vue
index e5a53a1..2cd25fd 100644
--- a/src/views/home/chart.vue
+++ b/src/views/home/chart.vue
@@ -180,7 +180,7 @@ const onClose = () => {
background: $gradient-color;
height: $main-container-height;
.line-chart-formula{
- width: 25vw;
+ width: 30vw;
background: #E0F0FF;
height: 3.5rem;
display: flex;
diff --git a/src/views/liquid/index.vue b/src/views/liquid/index.vue
index 2654df2..c6747ad 100644
--- a/src/views/liquid/index.vue
+++ b/src/views/liquid/index.vue
@@ -12,8 +12,8 @@ import homeStart from 'assets/images/home/home-start.svg'
import SoftKeyboard from 'components/common/SoftKeyboard/index.vue'
import LiquidLevel from 'components/liquid/LiquidLevel.vue'
import { ElMessage } from 'element-plus'
-import { roundNumber } from 'libs/utils'
-import { computed, onMounted, ref, watchEffect } from 'vue'
+// import { roundNumber } from 'libs/utils'
+import { onMounted, ref, watch, watchEffect } from 'vue'
const liquidStore = useLiquidStore()
const homeStore = useHomeStore()
@@ -46,7 +46,6 @@ onMounted(() => {
})
watchEffect(() => {
- stopatg.value = inputValue.value
addWorkState.value = liquidStore.liquidAddWorkState
drainWorkState.value = liquidStore.liquidDrainWorkState
liquidTotoal.value = liquidStore.liquidTotal
@@ -56,6 +55,10 @@ watchEffect(() => {
loading.value = systemStore.loading
})
+watch(inputValue, (newVal: string | number) => {
+ stopatg.value = newVal
+})
+
const subScribeLiquid = () => { // 事件订阅
subscribeEvent('stateUpdate', (data: Socket.WebSocketResponse) => {
if (data.fromClass === 'AddLiquidService') {
@@ -72,9 +75,9 @@ const openKeyboard = () => {
keyboardVisible.value = true
}
-const nowLiquid = computed(() => {
- return roundNumber(liquidStateData.value.nowLiquid, 0)
-})
+// const nowLiquid = computed(() => {
+// return roundNumber(liquidStateData.value.nowLiquid, 0)
+// })
const handleConfirm = (value: string) => {
console.log('确认输入:', value)
@@ -124,6 +127,7 @@ const onStartDrainLiquid = async () => {
FtMessageBox.error(statusName)
return
}
+ inputValue.value = ''
const params = {
className: 'DrainLiquidService',
fnName: 'start',
@@ -159,10 +163,7 @@ const onStopDrainLiquid = async () => {
-
当前液位:
-
- {{ nowLiquid }}g
-
+
目标液位:
@@ -181,6 +182,7 @@ const onStopDrainLiquid = async () => {
type="primary"
:button-text="`${liquidTotoal}g`"
bg-color="#2892F3"
+ border-radius="0"
text-color="#ffffff"
height="4rem"
text-size="24px"
@@ -202,6 +204,8 @@ const onStopDrainLiquid = async () => {
:height="btnStyle.height"
:text-size="btnStyle.textSize"
:border-radius="btnStyle.borderRadius"
+ :disabled="drainWorkState.workState !== 'idle'"
+ min-height="4rem"
@click="onStartAddLiquid"
>
@@ -218,6 +222,7 @@ const onStopDrainLiquid = async () => {
:text-size="btnStyle.textSize"
:border-radius="btnStyle.borderRadius"
:disabled="addWorkState.workState === 'emptyLineLiquid'"
+ min-height="4rem"
@click="onStopAddLiquid"
>
@@ -235,6 +240,8 @@ const onStopDrainLiquid = async () => {
:height="btnStyle.height"
:text-size="btnStyle.textSize"
:border-radius="btnStyle.borderRadius"
+ :disabled="addWorkState.workState !== 'idle'"
+ min-height="4rem"
@click="onStartDrainLiquid"
>
@@ -250,6 +257,7 @@ const onStopDrainLiquid = async () => {
:height="btnStyle.height"
:text-size="btnStyle.textSize"
:border-radius="btnStyle.borderRadius"
+ min-height="4rem"
@click="onStopDrainLiquid"
>
@@ -296,7 +304,7 @@ const onStopDrainLiquid = async () => {
width: 100%;
background: $gradient-color;
.liquid-surplus-title{
- height: 10vh;
+ height: 13vh;
display: flex;
padding-left: 2.5rem;
align-items: center;
@@ -320,7 +328,7 @@ const onStopDrainLiquid = async () => {
.liquid-opt{
display: flex;
justify-content: center;
- margin-top: 5vh;
+ margin-top: 4vh;
}
.liquid-add-btn{
width: 25vw;
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 362eca5..928db81 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -1,11 +1,13 @@