From bdd50a498b451c6135519227ab64402eb9cff1b0 Mon Sep 17 00:00:00 2001 From: Lxq <19852720163@163.com> Date: Sun, 4 Jan 2026 17:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E5=87=86=E6=B5=81=E7=A8=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86+=E6=B5=81=E7=A8=8B=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rc_autoplc_front/src/api/tb/flowinfo.ts | 39 + rc_autoplc_front/src/api/tb/stepinfo.ts | 39 + rc_autoplc_front/src/router/index.ts | 10 + rc_autoplc_front/src/views/Layout.vue | 34 +- rc_autoplc_front/src/views/devinfo/index.vue | 30 +- rc_autoplc_front/src/views/flowinfo/index.vue | 581 ++++++++ .../src/views/islandInfo/index.vue | 42 +- rc_autoplc_front/src/views/stepinfo/index.vue | 1188 +++++++++++++++++ rc_autoplc_front/tsconfig.app.json | 1 - 9 files changed, 1936 insertions(+), 28 deletions(-) create mode 100644 rc_autoplc_front/src/api/tb/flowinfo.ts create mode 100644 rc_autoplc_front/src/api/tb/stepinfo.ts create mode 100644 rc_autoplc_front/src/views/flowinfo/index.vue create mode 100644 rc_autoplc_front/src/views/stepinfo/index.vue diff --git a/rc_autoplc_front/src/api/tb/flowinfo.ts b/rc_autoplc_front/src/api/tb/flowinfo.ts new file mode 100644 index 0000000..859448c --- /dev/null +++ b/rc_autoplc_front/src/api/tb/flowinfo.ts @@ -0,0 +1,39 @@ +import request from '@/utils/request' + +export function flowInfoadd(data: any) { + return request({ + url: '/flowInfo/add', + method: 'post', + data, + }) +} + +export function flowInfodel(id: string | number) { + return request({ + url: `/flowInfo/del/${id}`, + method: 'delete', + }) +} + +export function flowInfoupd(data: any) { + return request({ + url: '/flowInfo/update', + method: 'put', + data, + }) +} + +export function flowInfolist(data: any) { + return request({ + url: '/flowInfo/listPage', + method: 'get', + params: data, + }) +} + +export function flowInfobyid(id: string | number) { + return request({ + url: `/flowInfo/getById/${id}`, + method: 'get', + }) +} \ No newline at end of file diff --git a/rc_autoplc_front/src/api/tb/stepinfo.ts b/rc_autoplc_front/src/api/tb/stepinfo.ts new file mode 100644 index 0000000..9af5c8a --- /dev/null +++ b/rc_autoplc_front/src/api/tb/stepinfo.ts @@ -0,0 +1,39 @@ +import request from '@/utils/request' + +export function stepInfoadd(data: any) { + return request({ + url: '/stepInfo/add', + method: 'post', + data, + }) +} + +export function stepInfodel(id: string | number) { + return request({ + url: `/stepInfo/del/${id}`, + method: 'delete', + }) +} + +export function stepInfoupd(data: any) { + return request({ + url: '/stepInfo/update', + method: 'put', + data, + }) +} + +export function stepInfolist(data: any) { + return request({ + url: '/stepInfo/listPage', + method: 'get', + params: data, + }) +} + +export function stepInfobyid(id: string | number) { + return request({ + url: `/stepInfo/getById/${id}`, + method: 'get', + }) +} \ No newline at end of file diff --git a/rc_autoplc_front/src/router/index.ts b/rc_autoplc_front/src/router/index.ts index 3604ca3..b74f227 100644 --- a/rc_autoplc_front/src/router/index.ts +++ b/rc_autoplc_front/src/router/index.ts @@ -52,6 +52,16 @@ const router = createRouter({ name: 'plc-devinfo', component: () => import('../views/devinfo/plc.vue'), }, + { + path: '/flow-info', + name: 'flow-info', + component: () => import('../views/flowinfo/index.vue'), + }, + { + path: '/step-info', + name: 'step-info', + component: () => import('../views/stepinfo/index.vue'), + }, ], }, ], diff --git a/rc_autoplc_front/src/views/Layout.vue b/rc_autoplc_front/src/views/Layout.vue index 44daf7b..61c5cc3 100644 --- a/rc_autoplc_front/src/views/Layout.vue +++ b/rc_autoplc_front/src/views/Layout.vue @@ -79,6 +79,20 @@ PLC设备管理 + + + + + 标准流程管理 + + + + 流程创建 + + @@ -94,7 +108,7 @@ import { ref, computed } from 'vue' import { useRouter, useRoute } from 'vue-router' import { ElMessage, ElMessageBox } from 'element-plus' -import { User, Setting, Avatar, OfficeBuilding, Briefcase, Document, CaretBottom, UserFilled, Grid, Monitor, Connection, Plus } from '@element-plus/icons-vue' +import { User, Setting, Avatar, OfficeBuilding, Briefcase, Document, CaretBottom, UserFilled, Grid, Monitor, Connection, List, EditPen, Files, Tickets, Management, FolderOpened } from '@element-plus/icons-vue' import { useAuthStore } from '@/stores/auth' const router = useRouter() @@ -111,6 +125,24 @@ const activeMenu = computed(() => { return route.path }) +// 根据菜单名称获取图标 +const getMenuIcon = (menuName: string) => { + const iconMap: Record = { + '标准流程管理': Files, // 文件图标,适合标准流程管理 + '流程创建': EditPen, + '用户管理': User, + '角色管理': Avatar, + '部门管理': OfficeBuilding, + '职位管理': Briefcase, + '操作日志管理': Document, + '用户角色管理': UserFilled, + '功能岛管理': Setting, + '设备管理': Monitor, + 'PLC设备管理': Connection, + } + return iconMap[menuName] || EditPen +} + // 处理下拉菜单命令 const handleCommand = (command: string) => { if (command === 'logout') { diff --git a/rc_autoplc_front/src/views/devinfo/index.vue b/rc_autoplc_front/src/views/devinfo/index.vue index d68f9d6..53e1e35 100644 --- a/rc_autoplc_front/src/views/devinfo/index.vue +++ b/rc_autoplc_front/src/views/devinfo/index.vue @@ -754,22 +754,14 @@ const paramTypeOptions = [ { label: '整数', value: 'integer' }, { label: '浮点数', value: 'float' }, { label: '布尔值', value: 'boolean' }, - { label: '日期', value: 'date' }, - { label: '时间', value: 'datetime' }, - { label: 'JSON', value: 'json' }, ] // 表单控件选项(常用表单控件) const formTypeOptions = [ - { label: '输入框', value: 'input' }, - { label: '文本域', value: 'textarea' }, + { label: '文本输入框', value: 'input' }, { label: '数字输入框', value: 'number' }, - { label: '下拉选择', value: 'select' }, - { label: '单选按钮', value: 'radio' }, - { label: '复选框', value: 'checkbox' }, - { label: '日期选择器', value: 'datepicker' }, - { label: '时间选择器', value: 'timepicker' }, - { label: '开关', value: 'switch' }, + { label: '下拉框', value: 'select' }, + { label: '文本域', value: 'textarea' }, ] // 获取参数序号 @@ -816,6 +808,20 @@ const getParamList = async () => { ? data : [] + // 按主键id升序排列(没有id的排在最后) + records.sort((a: any, b: any) => { + const idA = a.id ?? 0 + const idB = b.id ?? 0 + // 如果都没有id,保持原顺序 + if (idA === 0 && idB === 0) return 0 + // 如果a没有id,a排在后面 + if (idA === 0) return 1 + // 如果b没有id,b排在后面 + if (idB === 0) return -1 + // 都有id,按id升序 + return idA - idB + }) + const totalValue = data.total ?? data.count ?? data.totalCount ?? records.length ?? 0 @@ -864,7 +870,7 @@ const handleAddParamRow = () => { isEditing: true, isNew: true, // 标记为新添加的行 } - paramList.value.unshift(newRow) + paramList.value.push(newRow) paramTotal.value += 1 } diff --git a/rc_autoplc_front/src/views/flowinfo/index.vue b/rc_autoplc_front/src/views/flowinfo/index.vue new file mode 100644 index 0000000..73875e2 --- /dev/null +++ b/rc_autoplc_front/src/views/flowinfo/index.vue @@ -0,0 +1,581 @@ + + + + + diff --git a/rc_autoplc_front/src/views/islandInfo/index.vue b/rc_autoplc_front/src/views/islandInfo/index.vue index 3d55250..9a97563 100644 --- a/rc_autoplc_front/src/views/islandInfo/index.vue +++ b/rc_autoplc_front/src/views/islandInfo/index.vue @@ -696,21 +696,35 @@ const handleBindDevice = async () => { if (Array.isArray(allDevices)) { if (isEdit.value && formData.id) { - // 编辑模式:显示未绑定的设备 + 已绑定该功能岛的设备 - deviceListForBind.value = allDevices.filter((device: any) => - !device.islandId || - device.islandId === formData.id || - device.islandId === String(formData.id) || - device.islandId === 0 || - device.islandId === '0' - ) + // 编辑模式:显示未绑定的设备 + 已绑定该功能岛的设备,排除设备型号为PLC的设备 + deviceListForBind.value = allDevices.filter((device: any) => { + // 排除设备型号为PLC的设备 + if (device.devModel && String(device.devModel).toUpperCase() === 'PLC') { + return false + } + // 筛选条件:islandId为0或空的设备,或者已绑定该功能岛的设备 + return ( + !device.islandId || + device.islandId === formData.id || + device.islandId === String(formData.id) || + device.islandId === 0 || + device.islandId === '0' + ) + }) } else { - // 新增模式:只显示未绑定的设备 - deviceListForBind.value = allDevices.filter((device: any) => - !device.islandId || - device.islandId === 0 || - device.islandId === '0' - ) + // 新增模式:只显示未绑定的设备,排除设备型号为PLC的设备 + deviceListForBind.value = allDevices.filter((device: any) => { + // 排除设备型号为PLC的设备 + if (device.devModel && String(device.devModel).toUpperCase() === 'PLC') { + return false + } + // 筛选条件:islandId为0或空的设备 + return ( + !device.islandId || + device.islandId === 0 || + device.islandId === '0' + ) + }) } } else { deviceListForBind.value = [] diff --git a/rc_autoplc_front/src/views/stepinfo/index.vue b/rc_autoplc_front/src/views/stepinfo/index.vue new file mode 100644 index 0000000..6e97eb8 --- /dev/null +++ b/rc_autoplc_front/src/views/stepinfo/index.vue @@ -0,0 +1,1188 @@ + + + + + + diff --git a/rc_autoplc_front/tsconfig.app.json b/rc_autoplc_front/tsconfig.app.json index ba6658c..913b8f2 100644 --- a/rc_autoplc_front/tsconfig.app.json +++ b/rc_autoplc_front/tsconfig.app.json @@ -1,5 +1,4 @@ { - "extends": "@vue/tsconfig/tsconfig.dom.json", "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/*"],