| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <div id="app">
- <router-view />
- </div>
- </template>
- <script>
- import { getLogin } from "@/api/ajax";
- import { getToken } from "@/utils/auth";
- export default {
- name: "App",
- data() {
- return {};
- },
- created() {
- this.fn();
- document.addEventListener("contextmenu", (event) => event.preventDefault());
- },
- methods: {
- async fn() {
- let userInfor = getToken();
- if (userInfor) {
- let MethodNames = "/OrgServer/DictManager/GetOrgTypeList";
- let typeListAlls = [
- {
- type: -1,
- type_name: "全部",
- },
- ];
- let typeLists = [];
- await getLogin(MethodNames, {})
- .then((res) => {
- if (res.status === 1) {
- typeListAlls = typeListAlls.concat(res.type_list);
- typeLists = res.type_list;
- }
- })
- .catch(() => {});
- this.$store.commit("setOrgTypeAll", typeListAlls);
- this.$store.commit("setOrgType", typeLists);
- let searchStatusList = [
- {
- status: -1,
- status_name: "全部",
- },
- ];
- await getLogin("/OrgServer/DictManager/GetSysUserStatusList", {})
- .then((res) => {
- if (res.status === 1) {
- searchStatusList = searchStatusList.concat(res.status_list);
- }
- })
- .catch(() => {
- this.loading = false;
- });
- this.$store.commit("setSearchStatusList", searchStatusList);
- }
- let MethodName = "/OrgServer/DictManager/GetStudyPhaseList";
- let typeListAll = [
- {
- study_phase: -1,
- study_phase_name: "全部",
- },
- ];
- let typeList = [];
- await getLogin(MethodName, {})
- .then((res) => {
- if (res.status === 1) {
- typeListAll = typeListAll.concat(res.study_phase_list);
- typeList = res.study_phase_list;
- }
- })
- .catch(() => {});
- this.$store.commit("setStudyTypeAll", typeListAll);
- this.$store.commit("setStudyType", typeList);
- let provinceCityListAll = [
- {
- label: "全部",
- value: "0",
- leaf: true,
- },
- ];
- let provinceCityList = [];
- await getLogin("/OrgServer/DictManager/GetAllProvinceCityList", {})
- .then((res) => {
- if (res.status === 1) {
- res.province_list.forEach((item) => {
- let obj = {
- label: item.name,
- value: item.id,
- children: [],
- };
- item.city_list.forEach((items) => {
- let objs = {
- label: items.name,
- value: items.id,
- leaf: true,
- };
- obj.children.push(objs);
- });
- provinceCityList.push(obj);
- provinceCityListAll.push(obj);
- });
- }
- })
- .catch(() => {});
- this.$store.commit("setProviceCity", provinceCityList);
- this.$store.commit("setProviceCityAll", provinceCityListAll);
- await getLogin(
- "/OrgServer/Client/SysConfigQuery/GetSysConfig_Preview",
- {}
- )
- .then((res) => {
- if (res.status === 1) {
- this.$store.commit("setPreviewUrl", res.preview_server_url);
- }
- })
- .catch(() => {
- this.loading = false;
- });
- },
- },
- mounted() {},
- };
- </script>
- <style lang="scss" scoped>
- #app {
- background: #f2f3f5;
- // min-width: 1440px;
- min-height: 100%;
- padding-top: 64px;
- }
- </style>
|