diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 215abc5..972994b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -14,6 +14,7 @@ "vue-router": "^5.0.7" }, "devDependencies": { + "@types/node": "^25.9.3", "@vitejs/plugin-vue": "^5.2.1", "sass-embedded": "^1.99.0", "typescript": "^5.7.3", @@ -1366,6 +1367,16 @@ "@types/lodash": "*" } }, + "node_modules/@types/node": { + "version": "25.9.3", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-25.9.3.tgz", + "integrity": "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, "node_modules/@types/web-bluetooth": { "version": "0.0.21", "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz", @@ -3133,6 +3144,13 @@ "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", "license": "MIT" }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "dev": true, + "license": "MIT" + }, "node_modules/unplugin": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-3.0.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index f4f23f9..5d7804a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,6 +15,7 @@ "vue-router": "^5.0.7" }, "devDependencies": { + "@types/node": "^25.9.3", "@vitejs/plugin-vue": "^5.2.1", "sass-embedded": "^1.99.0", "typescript": "^5.7.3", diff --git a/frontend/src/assets/images/menuicon/jpdel.png b/frontend/src/assets/images/menuicon/jpdel.png new file mode 100644 index 0000000..26b617a Binary files /dev/null and b/frontend/src/assets/images/menuicon/jpdel.png differ diff --git a/frontend/src/components/NumericKeyboard.vue b/frontend/src/components/NumericKeyboard.vue new file mode 100644 index 0000000..a3f7293 --- /dev/null +++ b/frontend/src/components/NumericKeyboard.vue @@ -0,0 +1,210 @@ + + + + + + + {{ displayValue }} + + + + + {{ key }} + + + + 取消 + 确定 + + + + + + diff --git a/frontend/src/types/platform.ts b/frontend/src/types/platform.ts index c6db150..57fd1fe 100644 --- a/frontend/src/types/platform.ts +++ b/frontend/src/types/platform.ts @@ -115,20 +115,24 @@ export interface ChannelConfigPayload { } export interface AlarmRule { - category?: string - limit?: number - delay?: number - output_node?: string - enabled?: boolean + category: string + limit: number + delay: number + output_node: string + enabled: boolean + value?: number + [key: string]: any +} +export interface AlarmRules { + category: string value?: number [key: string]: any } - export interface LineAlarmSettingPayload { line_no: number over_limit_alarm: AlarmRule[] fault_alarm: AlarmRule[], - transformer_change: AlarmRule[] + transformer_change: AlarmRules[] } export interface AiAlarmSettingItem { diff --git a/frontend/src/views/aiAlarmSetting/index.vue b/frontend/src/views/aiAlarmSetting/index.vue index ebf8cf5..1751471 100644 --- a/frontend/src/views/aiAlarmSetting/index.vue +++ b/frontend/src/views/aiAlarmSetting/index.vue @@ -2,8 +2,20 @@ import { ref, onMounted } from 'vue' import { fetchAiAlarmSetting, saveAiAlarmSetting, verifyAccessPassword } from '@/api/platform' import { ElMessage, ElMessageBox } from 'element-plus' +import NumericKeyboard from '@/components/NumericKeyboard.vue' -const channelList = ref([ +interface ChannelItem { + channel_no: number + singal_type: string + output_node: string + limit_low: number + limit_high: number + delay: number + enabled: boolean + [key: string]: any +} + +const channelList = ref([ { channel_no: 1, singal_type: '4~20mA', output_node: '', limit_low: 0, limit_high: 8, delay: 8, enabled: false }, { channel_no: 2, singal_type: '1~5V', output_node: '', limit_low: 0, limit_high: 8, delay: 8, enabled: false }, { channel_no: 3, singal_type: '4~20mA', output_node: '', limit_low: 0, limit_high: 8, delay: 8, enabled: false }, @@ -21,6 +33,24 @@ const channelList = ref([ const nodeOptions = ref(['开出一', '开出二', '开出三', '开出四', '开出五', '开出六', '开出七', '开出八', '开出九', '开出十', '开出十一', '开出十二']) const isswitch = ref(false) const dialogVisible = ref(false) +const keyboardVisible = ref(false) +const currentInputValue = ref('') +const currentInputIndex = ref(-1) +const currentInputType = ref('') +const openKeyboard = (index: number, value: any, type: string) => { + currentInputType.value = type + currentInputIndex.value = index + currentInputValue.value = value + keyboardVisible.value = true +} + +const handleKeyboardConfirm = (value: any) => { + if (currentInputIndex.value >= 0) { + channelList.value[currentInputIndex.value][currentInputType.value] = value + } + keyboardVisible.value = false +} + const handleSave = () => { ElMessageBox.prompt('请输入密码', '保存', { confirmButtonText: '确定', @@ -54,7 +84,6 @@ const handleSave = () => { const init = () => { fetchAiAlarmSetting().then(res => { - console.log(res, 989) res.forEach(item => { channelList.value.forEach((channel: any) => { if (channel.channel_no === item.channel_no) { @@ -89,16 +118,21 @@ onMounted(() => { {{ item.channel_no }} - + - + - + - + @@ -120,6 +154,12 @@ onMounted(() => { 确定 + + @@ -249,4 +289,8 @@ onMounted(() => { :deep(.el-input__inner) { text-align: center !important; } +:deep(.el-input.is-disabled .el-input__inner) { + color: #606266; + -webkit-text-fill-color: #606266; +} \ No newline at end of file diff --git a/frontend/src/views/aiChannelSetting/index.vue b/frontend/src/views/aiChannelSetting/index.vue index d90642b..d78eea3 100644 --- a/frontend/src/views/aiChannelSetting/index.vue +++ b/frontend/src/views/aiChannelSetting/index.vue @@ -2,7 +2,8 @@ import { ref, onMounted } from 'vue' import { fetchChannelConfig, saveChannelConfig, verifyAccessPassword } from '@/api/platform' import { ElMessage, ElMessageBox } from 'element-plus' -const channelList: any = ref([ +import NumericKeyboard from '@/components/NumericKeyboard.vue' +const channelList = ref([ { ch: 1, singal_type: '4~20mA', line_no: 1, type: 'UA', limit_low: 1, limit_high: 8 }, { ch: 2, singal_type: '1~5V', line_no: 1, type: 'UA', limit_low: 1, limit_high: 8 }, { ch: 3, singal_type: '4~20mA', line_no: 1, type: 'UA', limit_low: 1, limit_high: 8 }, @@ -22,6 +23,44 @@ const categoryOptions = ref(['UA', 'UB', 'UC']) const categoryOptions2 = ref(['IA', 'IB', 'IC']) const dialogVisible = ref(false) const isswitch = ref(false) +const keyboardVisible = ref(false) +const currentInputValue = ref(0) +const currentInputIndex = ref(-1) +interface ChannelItem { + ch: number + singal_type: string + line_no: number + type: string + limit_low: number + limit_high: number +} +const currentInputType = ref('') +const openKeyboard = (index: number, value: number, type: string) => { + currentInputType.value = type + currentInputIndex.value = index + currentInputValue.value = value + keyboardVisible.value = true +} + +const handleKeyboardConfirm = (value: string) => { + if (currentInputIndex.value >= 0) { + const channel = channelList.value[currentInputIndex.value] + const numValue = Number(value) + + switch (currentInputType.value) { + case 'limit_low': + channel.limit_low = numValue + break + case 'limit_high': + channel.limit_high = numValue + break + default: + break + } + } + keyboardVisible.value = false +} + const handleSave = () => { ElMessageBox.prompt('请输入密码', '保存', { confirmButtonText: '确定', @@ -91,10 +130,10 @@ onMounted(() => { 低端值 高端值 - + {{ item.ch }} - + @@ -104,31 +143,35 @@ onMounted(() => { - + - + - + - 保存 - 原密码验证错误! - - - - + 原密码验证错误! + + + + + @@ -260,4 +303,8 @@ onMounted(() => { font-size: 14px !important; } +:deep(.el-input.is-disabled .el-input__inner) { + color: #606266; + -webkit-text-fill-color: #606266; +} \ No newline at end of file diff --git a/frontend/src/views/aoChannelSetting/index.vue b/frontend/src/views/aoChannelSetting/index.vue index 249507a..3280caa 100644 --- a/frontend/src/views/aoChannelSetting/index.vue +++ b/frontend/src/views/aoChannelSetting/index.vue @@ -2,7 +2,16 @@ import { ref, onMounted } from 'vue' import { fetchChannelConfig, saveChannelConfig, verifyAccessPassword } from '@/api/platform' import { ElMessage, ElMessageBox } from 'element-plus' -const channelList: any = ref([ +import NumericKeyboard from '@/components/NumericKeyboard.vue' +interface ChannelItem { + ch: number + singal_type: string + line_no: number + type: string + limit_low: number + limit_high: number +} +const channelList = ref([ { ch: 1, singal_type: '4~20mA', line_no: 1, type: 'UA', limit_low: 1, limit_high: 8 }, { ch: 2, singal_type: '1~5V', line_no: 1, type: 'UA', limit_low: 1, limit_high: 8 }, { ch: 3, singal_type: '4~20mA', line_no: 1, type: 'UA', limit_low: 1, limit_high: 8 }, @@ -21,6 +30,35 @@ const categoryOptions = ref(['UA', 'UB', 'UC']) const categoryOptions2 = ref(['IA', 'IB', 'IC']) const dialogVisible = ref(false) const aiChannelList = ref([]) +const currentInputType = ref('') +const currentInputIndex = ref(-1) +const currentInputValue = ref() +const keyboardVisible = ref(false) +const openKeyboard = (index: number, value: number, type: string) => { + currentInputType.value = type + currentInputIndex.value = index + currentInputValue.value = value + keyboardVisible.value = true +} + +const handleKeyboardConfirm = (value: string) => { + if (currentInputIndex.value >= 0) { + const channel = channelList.value[currentInputIndex.value] + const numValue = Number(value) + + switch (currentInputType.value) { + case 'limit_low': + channel.limit_low = numValue + break + case 'limit_high': + channel.limit_high = numValue + break + default: + break + } + } + keyboardVisible.value = false +} function init() { fetchChannelConfig().then((res: any) => { aiChannelList.value = res.ao_channel @@ -93,7 +131,7 @@ onMounted(() => { {{ item.ch }} - + @@ -108,10 +146,10 @@ onMounted(() => { - + - + @@ -129,6 +167,8 @@ onMounted(() => { + @@ -258,4 +298,8 @@ onMounted(() => { :deep(.el-input__inner) { text-align: center !important; } +:deep(.el-input.is-disabled .el-input__inner) { + color: #606266; + -webkit-text-fill-color: #606266; +} \ No newline at end of file diff --git a/frontend/src/views/communicationSetting/index.vue b/frontend/src/views/communicationSetting/index.vue index 257310e..3b5490e 100644 --- a/frontend/src/views/communicationSetting/index.vue +++ b/frontend/src/views/communicationSetting/index.vue @@ -2,6 +2,8 @@ import { ref, onMounted } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import { fetchDeviceNet, fetchDevicePort, saveDeviceNetConfig, saveDevicePortConfig, verifyAccessPassword, fetchChannelConfig } from '@/api/platform' +import NumericKeyboard from '@/components/NumericKeyboard.vue' + // 表单数据 const formData: any = ref({ nic: '', @@ -65,6 +67,23 @@ const rtuProtocolOptions = [ ] const isswitch = ref(false) const dialogVisible = ref(false) +const keyboardVisible = ref(false) +const currentInputValue = ref('') +const currentInputKey = ref('') +const currentInputIndex = ref(0) +const currentInputType = ref('') +const infoList = ref({}) +const openKeyboard = (value: number, key: string, type: string) => { + currentInputType.value = type + currentInputValue.value = value.toString() + currentInputKey.value = key + keyboardVisible.value = true +} + +const handleKeyboardConfirm = (value: string) => { + formData.value[currentInputKey.value] = value + keyboardVisible.value = false +} // 保存 const handleSave = () => { ElMessageBox.prompt('请输入密码', '保存', { @@ -161,15 +180,17 @@ onMounted(() => { - + - + - + @@ -242,6 +263,9 @@ onMounted(() => { 确定 + + @@ -325,6 +349,7 @@ onMounted(() => { :deep(.el-select__wrapper) { min-height: 40px; } + :deep(.el-form-item__label) { height: 40px; line-height: 40px; diff --git a/frontend/src/views/lightSetting/index.vue b/frontend/src/views/lightSetting/index.vue index 800cc54..4a97192 100644 --- a/frontend/src/views/lightSetting/index.vue +++ b/frontend/src/views/lightSetting/index.vue @@ -3,7 +3,7 @@ import { ref, reactive, onMounted } from 'vue' import type { FormInstance } from 'element-plus' import { fetchSystemConfig, saveSystemConfig } from '@/api/platform' import { ElMessage } from 'element-plus' - +import NumericKeyboard from '@/components/NumericKeyboard.vue' const formRef = ref() // 表单数据 @@ -13,6 +13,19 @@ const form = ref({ time_sync: '' }) const isswitch = ref(false) +const currentInputType = ref('') +const currentInputIndex = ref(-1) +const currentInputValue = ref() +const keyboardVisible = ref(false) +const openKeyboard = (value: number, type: string) => { + currentInputType.value = type + currentInputValue.value = value + keyboardVisible.value = true +} + +const handleKeyboardConfirm = (value: string) => { + form.value.screen_saver = Number(value) +} // 提交保存 const handleSave = async () => { if(isswitch.value){ @@ -49,7 +62,7 @@ const init = () => { - + 秒 @@ -67,6 +80,8 @@ const init = () => { 保存 + diff --git a/frontend/src/views/lineSetting/index.vue b/frontend/src/views/lineSetting/index.vue index 023e073..bd001fa 100644 --- a/frontend/src/views/lineSetting/index.vue +++ b/frontend/src/views/lineSetting/index.vue @@ -2,6 +2,7 @@ import { ref, onMounted } from 'vue' import { fetchLineAlarmSetting, saveLineAlarmSetting, verifyAccessPassword } from '@/api/platform' import { ElMessage, ElMessageBox } from 'element-plus' +import NumericKeyboard from '@/components/NumericKeyboard.vue' const lineTabs = ref([ { label: '线路一定值', @@ -25,7 +26,40 @@ const lineTabs = ref([ } ]) const activeTab = ref('1') -const infoList = ref({ +interface FaultAlarmItem { + category: string + delay: number + enabled: boolean + output_node: string + limit: number +} + +interface OverLimitAlarmItem { + category: string + delay: number + enabled: boolean + output_node: string + limit: number +} + +interface TransformerItem { + category: string + value: number +} + +interface InfoListType { + line_no: number + fault_alarm: FaultAlarmItem[] + over_limit_alarm: OverLimitAlarmItem[] + transformer_change: TransformerItem[] +} + +type InfoFirstKey = 'fault_alarm' | 'over_limit_alarm' | 'transformer_change' +type FaultKey = 'delay' | 'limit' +type OverLimitKey = 'delay' | 'limit' +type TransKey = 'value' + +const infoList = ref({ line_no: 1, fault_alarm: [ { category: 'PT断线', delay: 0, enabled: false, output_node: '', limit: 0 }, @@ -39,11 +73,40 @@ const infoList = ref({ { category: '频率', delay: 0, enabled: false, output_node: '', limit: 0 }, ], transformer_change: [ - { category: 'PT变比',value: 0,}, - { category: 'CT变比',value: 0,}, + { category: 'PT变比', value: 0 }, + { category: 'CT变比', value: 0 }, ] - }) + +const currentInputType = ref('') +const currentInputIndex = ref(-1) +const currentInputKey = ref('fault_alarm') +const currentInputValue = ref(0) +const keyboardVisible = ref(false) + +const openKeyboard = (index: number, value: number, key: InfoFirstKey, type: string) => { + currentInputType.value = type + currentInputValue.value = value + currentInputIndex.value = index + currentInputKey.value = key + keyboardVisible.value = true +} + +const handleKeyboardConfirm = (value: string) => { + const key1 = currentInputKey.value + const idx = currentInputIndex.value + const key2 = currentInputType.value + const val = Number(value) + + if (key1 === 'fault_alarm') { + (infoList.value[key1][idx] as FaultAlarmItem)[key2 as FaultKey] = val + } else if (key1 === 'over_limit_alarm') { + (infoList.value[key1][idx] as OverLimitAlarmItem)[key2 as OverLimitKey] = val + } else if (key1 === 'transformer_change') { + (infoList.value[key1][idx] as TransformerItem)[key2 as TransKey] = val + } + keyboardVisible.value = false +} const options = ref([ { label: '开出1', @@ -219,23 +282,23 @@ const handleSave = () => { 限值 - - - - - @@ -245,38 +308,38 @@ const handleSave = () => { - 延时(s) - - - - - - - @@ -328,7 +391,7 @@ const handleSave = () => { - @@ -368,6 +431,8 @@ const handleSave = () => { 确定 + @@ -483,4 +548,4 @@ const handleSave = () => { :deep(.el-input__inner) { text-align: center !important; } - \ No newline at end of file + diff --git a/frontend/src/views/passwordSetting/index.vue b/frontend/src/views/passwordSetting/index.vue index e8964d6..b4f13c7 100644 --- a/frontend/src/views/passwordSetting/index.vue +++ b/frontend/src/views/passwordSetting/index.vue @@ -3,6 +3,7 @@ import { ref, reactive, onMounted } from 'vue' import type { FormInstance, FormRules } from 'element-plus' import { verifyAccessPassword, saveDeviceConfig, fetchDeviceConfig, saveDevicePassword } from '@/api/platform' import { ElMessage } from 'element-plus' +import NumericKeyboard from '@/components/NumericKeyboard.vue' const formRef = ref() // 表单数据 @@ -50,6 +51,27 @@ const dialogVisible = ref(false) const handleClose = () => { dialogVisible.value = false } +const currentInputValue = ref() +const keyboardVisible = ref(false) +const currentInputType = ref('') + +const openKeyboard = (value: string, type: string) => { + currentInputType.value = type + currentInputValue.value = value + keyboardVisible.value = true +} +const handleKeyboardConfirm = (value: string) => { + if (currentInputType.value === 'oldPassword') { + form.oldPassword = value + } else if (currentInputType.value === 'newPassword') { + form.newPassword = value + } else if (currentInputType.value === 'confirmPassword') { + form.confirmPassword = value + } + keyboardVisible.value = false + formRef.value?.clearValidate() +} + // 提交保存 const handleSubmit = async () => { if (!formRef.value) return @@ -102,15 +124,15 @@ onMounted(() => { - + - + - + @@ -131,6 +153,8 @@ onMounted(() => { +