From 7ae9751fd6efd3ec3d252e8de4198ca5fd08a57c Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Fri, 18 Aug 2023 15:15:21 +0800 Subject: [PATCH] elec --- .../patientRegister/PatientRegisterList.vue | 43 +++++++++++++------ src/main.js | 8 ++++ src/router/index.js | 2 + src/views/login/Login.vue | 4 +- 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index ba3dc8d..aac9133 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -168,9 +168,6 @@
打指引单
-
- electron -
@@ -230,19 +227,37 @@ export default { ...mapState(["window", "dict", "patientRegister", "customerOrg"]), }, methods: { - ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]), - + ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]), + + // 打印指引单 async guidePrint(){ - console.log('点击指引单按钮') - this.dialogGuide = true; - try{ - console.log('window.electronApI',window.electronApI) - this.guideMsg = await window.electronApI.printPre("print parameters"); - }catch(err){ - console.log('点击指引单按钮错误:',err) - } - }, + let token = localStorage.getItem('token'); + let user = localStorage.getItem('user'); + let toOutShell = ''; + let msg =''; + + //http://140.143.162.39:9529/api/app/print-report/patient-register-guide-report/3a0c7f6e-3ff1-fef6-c568-6f541aabe87a + getapi(`/api/app/print-report/patient-register-guide-report/${msg}`) + .then((res) => { + if (res.code != -1) { + res.data; + + return this.$electronAPI.printPre('web 传入参数'); + } + }) + .then(res => { + msg = res; + }); + + console.log(msg); + + + + + + }, + handleSelectionChange(val) { this.multipleSelection = val; //console.log('this.multipleSelection',this.multipleSelection) diff --git a/src/main.js b/src/main.js index 714f28c..0960d93 100644 --- a/src/main.js +++ b/src/main.js @@ -17,6 +17,14 @@ Vue.use(ElementUI); console.log('vue',Vue.prototype) Vue.prototype.$axios = axios; +//全局注册 electronAPI 对象 +try { + Vue.prototype.$electronAPI = window.electronAPI; +} catch (error) { + Vue.prototype.$electronAPI = null; +} + + Vue.use(Print); Vue.component("downloadExcel", JsonExcel); Vue.config.productionTip = false; diff --git a/src/router/index.js b/src/router/index.js index 4cd205f..d872d96 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -259,6 +259,8 @@ const routes = [ ]; const router = new VueRouter({ + //mode: "history", + //base: process.env.BASE_URL, routes, }); diff --git a/src/views/login/Login.vue b/src/views/login/Login.vue index 39dd25d..4e59599 100644 --- a/src/views/login/Login.vue +++ b/src/views/login/Login.vue @@ -29,9 +29,6 @@ 用户登录 - @@ -65,6 +62,7 @@ export default { }; }, methods: { + onSubmit() { this.$refs.form.validate((valid) => { if (valid) {