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 @@ + + + + + diff --git a/yarn.lock b/yarn.lock index 595d1836..3fc53f6e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1373,6 +1373,11 @@ resolved "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.3.2.tgz" integrity sha512-OzIuTaIfC8QXEPmJvB4Y4kw34rSXdCJzxcD1kFStBvr8bK6X1zQAYDo0CNMjojnfTqRQCJ0I7prlErcoRiET2A== +"@epic-web/invariant@^1.0.0": + version "1.0.0" + resolved "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz" + integrity sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA== + "@esbuild/win32-x64@0.19.12": version "0.19.12" resolved "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz" @@ -4002,6 +4007,14 @@ cropperjs@^1.6.1: resolved "https://registry.npmmirror.com/cropperjs/-/cropperjs-1.6.2.tgz" integrity sha512-nhymn9GdnV3CqiEHJVai54TULFAE3VshJTXSqSJKa8yXAKyBKDWdhHarnlIPrshJ0WMFTGuFvG02YjLXfPiuOA== +cross-env@^10.1.0: + version "10.1.0" + resolved "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz" + integrity sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw== + dependencies: + "@epic-web/invariant" "^1.0.0" + cross-spawn "^7.0.6" + cross-fetch@^3.1.5: version "3.1.8" resolved "https://registry.npmmirror.com/cross-fetch/-/cross-fetch-3.1.8.tgz" @@ -4009,10 +4022,10 @@ cross-fetch@^3.1.5: dependencies: node-fetch "^2.6.12" -cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3, cross-spawn@^7.0.6: + version "7.0.6" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0"