Browse Source

config

master
pengjun 2 years ago
parent
commit
0367b59f93
  1. 2
      src/main.js
  2. 130
      src/store/index.js
  3. 4
      src/utlis/istoken.js
  4. 18
      src/views/Home.vue
  5. 35
      src/views/login/Login.vue

2
src/main.js

@ -15,7 +15,7 @@ import "./assets/css/global_font.css";
Vue.use(Contextmenu);
Vue.use(Meta);
Vue.use(ElementUI);
Vue.prototype.$axios = axios
//全局注册外壳的 peisAPI 对象
try {

130
src/store/index.js

@ -1,7 +1,7 @@
import Vue from "vue";
import Vuex from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { arrayReduce } from "@/utlis/proFunc";
// import { getapi, postapi, putapi, deletapi } from "@/api/api";
// import { arrayReduce } from "@/utlis/proFunc";
Vue.use(Vuex);
@ -439,72 +439,72 @@ export default new Vuex.Store({
},
actions: {
//获取体检人员所选组合项目
getPatientRegisterAbs(context, id) {
//console.log(`vuex getPatientRegisterAbs /api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, context.state.dict.asbItemAll)
if (id) {
getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`).then(
(res) => {
console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res)
if (res.code == 1) {
let patientRegisterAbs = []
res.data.forEach(e => {
e.standTotal = e.amount * e.standardPrice
e.total = e.amount * e.chargePrice
patientRegisterAbs.push(e)
});
context.commit("setData", {
key: "patientRegister.patientRegisterAbs",
value: patientRegisterAbs,
});
// //获取体检人员所选组合项目
// getPatientRegisterAbs(context, id) {
// //console.log(`vuex getPatientRegisterAbs /api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, context.state.dict.asbItemAll)
// if (id) {
// getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`).then(
// (res) => {
// console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res)
// if (res.code == 1) {
// let patientRegisterAbs = []
// res.data.forEach(e => {
// e.standTotal = e.amount * e.standardPrice
// e.total = e.amount * e.chargePrice
// patientRegisterAbs.push(e)
// });
// context.commit("setData", {
// key: "patientRegister.patientRegisterAbs",
// value: patientRegisterAbs,
// });
context.commit("setData", {
key: "dict.asbItem",
value: arrayReduce(
[...context.state.dict.asbItem], [...context.state.patientRegister.patientRegisterAbs],
"id=asbitemId"
),
});
context.commit("setData", {
key: "dict.asbItemQuick",
value: arrayReduce([...context.state.dict.asbItemAll], [...context.state.patientRegister.patientRegisterAbs], "id=asbitemId"),
});
//console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItemQuick)
}
}
);
} else {
context.commit("setData", {
key: "patientRegister.patientRegisterAbs",
value: [],
});
// context.commit("setData", {
// key: "dict.asbItem",
// value: arrayReduce(
// [...context.state.dict.asbItem], [...context.state.patientRegister.patientRegisterAbs],
// "id=asbitemId"
// ),
// });
// context.commit("setData", {
// key: "dict.asbItemQuick",
// value: arrayReduce([...context.state.dict.asbItemAll], [...context.state.patientRegister.patientRegisterAbs], "id=asbitemId"),
// });
// //console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItemQuick)
// }
// }
// );
// } else {
// context.commit("setData", {
// key: "patientRegister.patientRegisterAbs",
// value: [],
// });
context.commit("setData", {
key: "dict.asbItem",
value: [...context.state.dict.asbItemAll],
});
context.commit("setData", {
key: "dict.asbItemQuick",
value: [...context.state.dict.asbItemAll],
});
}
},
// context.commit("setData", {
// key: "dict.asbItem",
// value: [...context.state.dict.asbItemAll],
// });
// context.commit("setData", {
// key: "dict.asbItemQuick",
// value: [...context.state.dict.asbItemAll],
// });
// }
// },
//获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
getCustomerOrgGroup(context, customerOrgld) {
console.log(`vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`);
getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`)
.then((res) => {
console.log("vuex getCustomerOrgGroup", res.data);
if (res.code == 1) {
//this.patientRegister.customerOrgGroup = res.data
context.commit("setData", {
key: "patientRegister.customerOrgGroup",
value: res.data,
});
}
});
},
// //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
// getCustomerOrgGroup(context, customerOrgld) {
// console.log(`vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`);
// getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`)
// .then((res) => {
// console.log("vuex getCustomerOrgGroup", res.data);
// if (res.code == 1) {
// //this.patientRegister.customerOrgGroup = res.data
// context.commit("setData", {
// key: "patientRegister.customerOrgGroup",
// value: res.data,
// });
// }
// });
// },
},
modules: {},
});

4
src/utlis/istoken.js

@ -1,13 +1,11 @@
import moment from "moment";
import axios from "axios";
import router from "../router";
const sysConfig = JSON.parse(window.sessionStorage.getItem('sysConfig'))
export const yztoken = async () => {
//console.log("验证");
//let dqtime = parseInt(new Date().getTime() / 1000); // 当前时间的时间戳
//let tokentime = parseInt(window.sessionStorage.getItem("expires_in")); //登录缓存后的时间戳
let sysConfig = JSON.parse(window.sessionStorage.getItem('sysConfig'))
let dqtime = new Date().getTime(); // 当前时间的时间戳
let expires_in = parseInt(window.sessionStorage.getItem("expires_in"))

18
src/views/Home.vue

@ -327,13 +327,23 @@ export default {
this.user = window.sessionStorage.getItem("user");
//
this.getUserAllPriv()
this.getUserMenuPriv()
},
methods: {
//
getUserAllPriv() {
getapi('/api/app/menuinfo/getmymenuinfolist').then(res => {
if (res.code > -1) {
window.sessionStorage.setItem("userPriv", JSON.stringify(res.data));
}
})
},
//
getUserMenuPriv() {
getapi('/api/app/menuinfo/getmymenuinfotreelist').then(res => {
if (res.code != -1) {
if (res.code > -1) {
this.menuPriv = res.data
this.menuPriv = this.menuPriv.filter(e => {
return e.menuType == '0' || e.menuType == '1'
@ -390,9 +400,7 @@ export default {
window.sessionStorage.clear();
this.$router.push({ path: "/login" });
},
aa(aa) {
console.log(aa);
},
//
toggleDevTools() {
if (!this.$peisAPI) {

35
src/views/login/Login.vue

@ -58,13 +58,10 @@
</div>
</template>
<script>
import { lognis } from "@/request/ruquset";
import { yzstr } from "@/utlis/validate.js";
import { writetoken } from "@/utlis/istoken";
import axios from "axios";
import { getapi, postapi } from "@/api/api";
export default {
data() {
return {
@ -161,42 +158,12 @@ export default {
this.$router.push({ path: "/home" });
this.$store.state.changepassword = this.form.Password;
return getapi('/api/app/menuinfo/getmymenuinfolist')
} else {
this.$message.warning(res.message);
}
}).then(res => {
if (res && res.code != -1) {
window.sessionStorage.setItem("userPriv", JSON.stringify(res.data));
}
}).catch(err => {
this.$message.error(err);
})
// postapi(`/api/identity/users/login`, {
// userName: this.form.Username,
// passWord: this.form.Password,
// })
// .then((res) => {
// console.log(`/api/identity/users/login`,res)
// if (res.code != -1 && res.data.code != -1) {
// window.sessionStorage.setItem("peisid", res.data.peisid); //
// writetoken(res.data.expires_in);
// window.sessionStorage.setItem("token", res.data.access_token);
// window.sessionStorage.setItem("refresh_token",res.data.refresh_token);
// window.sessionStorage.setItem("tokentype", res.data.token_type);
// window.sessionStorage.setItem("user", this.form.Username);
// this.$router.push({ path: "/home" });
// this.$store.state.changepassword = this.form.Password;
// } else {
// msgs = res.code != -1 ? res.data.msg:res.message;
// this.$message.warning(res.data.msg);
// }
// //console.log(res, "res");
// })
// .catch((err) => {});
}
});
},

Loading…
Cancel
Save