diff --git a/index.html b/index.html index e9f058bc..fd79e48e 100644 --- a/index.html +++ b/index.html @@ -1,8 +1,9 @@ - +
+ + + diff --git a/package.json b/package.json index 0fc159af..20da841e 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "i": "pnpm install", "dev": "vite --mode env.local", + "dev:local": "cross-env VITE_BASE_URL=http://localhost:48081 vite --mode env.local", "pro": "vite --mode env.prod", "dev-server": "vite --mode dev", "ts:check": "vue-tsc --noEmit", @@ -102,6 +103,7 @@ "bpmn-js": "^17.9.2", "bpmn-js-properties-panel": "5.23.0", "consola": "^3.2.3", + "cross-env": "^10.1.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-define-config": "^2.1.0", diff --git a/src/api/mes/printconfig/index.ts b/src/api/mes/printconfig/index.ts new file mode 100644 index 00000000..06314d8b --- /dev/null +++ b/src/api/mes/printconfig/index.ts @@ -0,0 +1,46 @@ +import request from '@/config/axios' + +// 打印机配置 VO +export interface ConfigVO { + id: number // 主键ID + hostName: string // 主机名(如PACKING-PC-01),不可修改 + systemPrinterName: string // 系统打印机名称,关联下拉选项 + isDefault: boolean // 是否默认:0-否,1-是 + isEnabled: boolean // 是否启用:0-禁用,1-启用 + remark: string // 备注,记录打印机用途说明,用户不可修改 + createdAt: Date // 创建时间 + updatedAt: Date // 更新时间 +} + +// 打印机配置 API +export const ConfigApi = { + // 查询打印机配置分页 + getConfigPage: async (params: any) => { + return await request.get({ url: `/printer/config/page`, params }) + }, + + // 查询打印机配置详情 + getConfig: async (id: number) => { + return await request.get({ url: `/printer/config/get?id=` + id }) + }, + + // 新增打印机配置 + createConfig: async (data: ConfigVO) => { + return await request.post({ url: `/printer/config/create`, data }) + }, + + // 修改打印机配置 + updateConfig: async (data: ConfigVO) => { + return await request.put({ url: `/printer/config/update`, data }) + }, + + // 删除打印机配置 + deleteConfig: async (id: number) => { + return await request.delete({ url: `/printer/config/delete?id=` + id }) + }, + + // 导出打印机配置 Excel + exportConfig: async (params) => { + return await request.download({ url: `/printer/config/export-excel`, params }) + }, +} \ No newline at end of file diff --git a/src/locales/en.ts b/src/locales/en.ts index d047ed49..7a322e7a 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -3309,6 +3309,24 @@ export default { validatorTypeRequired: 'Template type can not be empty', design: 'Design', designTitle: 'Template Design' + }, + PrintConfig: { + moduleName: 'Printer Config', + currentHostName: 'Current Host Name', + unknownHostName: 'Not detected', + currentHostTip: 'This page only displays and manages printer configurations for the current host.', + hostName: 'Host Name', + systemPrinterName: 'Printer Name', + defaultStatus: 'Is Default', + isEnable: 'Is Enabled', + remark: 'remark', + createTime: 'Create Time', + updateTime: 'Update Time', + operate: 'Operate', + placeholderHostName: 'Please input host name', + placeholderSystemPrinterName: 'Please input printer name', + placeholderRemark: 'Please input printer remark', + testPrint:'Test Print' } }, QualityManagement: { diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 47b9738c..2d4610b0 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -2795,6 +2795,31 @@ export default { validatorTypeRequired: '模板类型不能为空', design: '配置', designTitle: '模板配置' + }, + PrintConfig: { + moduleName: '打印机配置', + currentHostName: '当前主机名', + unknownHostName: '未获取到', + currentHostTip: '当前页面仅展示和管理当前主机的打印机配置。', + hostName: '主机名', + systemPrinterName: '打印机名称', + defaultStatus: '是否默认', + isEnable: '是否启用', + remark: '备注', + createTime: '创建时间', + updateTime: '更新时间', + operate: '操作', + placeholderHostName: '请输入主机名', + placeholderSystemPrinterName: '请输入系统打印机名称', + placeholderTemplateType: '请选择模板类型', + placeholderTemplateJson: '请输入模板JSON内容', + placeholderRemark: '请输入备注', + validatorCodeRequired: '模板编码不能为空', + validatorNameRequired: '模板名称不能为空', + validatorTypeRequired: '模板类型不能为空', + design: '配置', + designTitle: '模板配置', + testPrint:'测试打印' } }, QualityManagement: { diff --git a/src/views/mes/printconfig/ConfigForm.vue b/src/views/mes/printconfig/ConfigForm.vue new file mode 100644 index 00000000..67ee35ed --- /dev/null +++ b/src/views/mes/printconfig/ConfigForm.vue @@ -0,0 +1,265 @@ + + + + diff --git a/src/views/mes/printconfig/index.vue b/src/views/mes/printconfig/index.vue new file mode 100644 index 00000000..6d75b28a --- /dev/null +++ b/src/views/mes/printconfig/index.vue @@ -0,0 +1,501 @@ + +