lrf пре 3 година
родитељ
комит
2c3ebf9ff7
5 измењених фајлова са 29 додато и 90 уклоњено
  1. 4 20
      src/App.vue
  2. 1 1
      src/plugins/axios.js
  3. 2 57
      src/store/index.js
  4. 19 12
      src/views/scientific/laboratory/index.vue
  5. 3 0
      vue.config.js

+ 4 - 20
src/App.vue

@@ -1,33 +1,17 @@
 <template>
   <div id="app">
-    <router-view v-if="finished" />
+    <router-view />
   </div>
 </template>
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions } = createNamespacedHelpers('login');
 export default {
   data() {
-    return {
-      finished: false,
-    };
-  },
-  async created() {
-    await this.toLogin();
-  },
-  methods: {
-    ...mapActions(['login']),
-    async toLogin() {
-      const obj = { username: 'wxyk', password: 'wxyk' };
-      const res = await this.login(obj);
-      if (res.code === 200) {
-        const token = res.token;
-        sessionStorage.setItem('token', token);
-        this.finished = true;
-      }
-    },
+    return {};
   },
+  async created() {},
+  methods: {},
 };
 </script>
 

+ 1 - 1
src/plugins/axios.js

@@ -16,4 +16,4 @@ const Plugin = {
   },
 };
 
-Vue.use(Plugin, { baseUrl: process.env.VUE_APP_BASE_API });
+Vue.use(Plugin, { baseUrl: '' });

+ 2 - 57
src/store/index.js

@@ -3,44 +3,7 @@ import Vuex from 'vuex';
 import * as ustate from '@common/src/store/user/state';
 import * as umutations from '@common/src/store/user/mutations';
 import test from '@common/src/store/test';
-import login from '@common/src/store/login';
-// 重点实验室
-import laboratory from '@common/src/store/laboratory';
-// 研究方向
-import direction from '@common/src/store/direction';
-// 重要成果
-import achievement from '@common/src/store/achievement';
-// 承担项目明星
-import task from '@common/src/store/task';
-// 博硕培养情况
-import doctor from '@common/src/store/doctor';
-// 职称晋升
-import title from '@common/src/store/title';
-// 人才称号
-import personnelname from '@common/src/store/personnelname';
-// 设备
-import equipment from '@common/src/store/equipment';
-// 社会服务活动
-import socialservices from '@common/src/store/socialservices';
-// 技术服务活动
-import technicalservice from '@common/src/store/technicalservice';
-// 科普活动
-import scienceactivities from '@common/src/store/scienceactivities';
-// 提交报告
-import report from '@common/src/store/report';
-// 主任及科研助理
-import assistant from '@common/src/store/assistant';
-// 学术委员会
-import committee from '@common/src/store/committee';
-// 平台活动时间段
-import times from '@common/src/store/times';
-// 其他成果
-import other from '@common/src/store/other';
-// 论文发表
-import paper from '@common/src/store/paper';
-// 获奖情况
-import patent from '@common/src/store/patent';
-
+import usual from '@common/src/store/usual';
 Vue.use(Vuex);
 
 export default new Vuex.Store({
@@ -49,24 +12,6 @@ export default new Vuex.Store({
   actions: {},
   modules: {
     test,
-    login,
-    laboratory,
-    direction,
-    doctor,
-    title,
-    personnelname,
-    equipment,
-    socialservices,
-    technicalservice,
-    scienceactivities,
-    report,
-    assistant,
-    committee,
-    times,
-    achievement,
-    task,
-    other,
-    paper,
-    patent,
+    usual,
   },
 });

+ 19 - 12
src/views/scientific/laboratory/index.vue

@@ -8,28 +8,35 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('usual');
 export default {
   name: 'index',
   props: {},
   components: {},
   data: function () {
-    return {};
+    return {
+      list: [],
+      total: 0,
+    };
   },
-  created() {},
-  methods: {},
-  computed: {
-    ...mapState(['user']),
+  created() {
+    console.log('in function:');
+    this.init();
   },
+  methods: {
+    ...mapActions(['query', 'fetch']),
+    async init() {
+      const res = await this.query({ table: 'BasicInformation', skip: 0, limit: 10 });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'list', res.data);
+        this.$set(this, 'total', res.total);
+      }
+    },
+  },
+
   metaInfo() {
     return { title: this.$route.meta.title };
   },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
 };
 </script>
 

+ 3 - 0
vue.config.js

@@ -22,6 +22,9 @@ module.exports = {
       '/files': {
         target: 'http://broadcast.kqyjy.com',
       },
+      '/api/label': {
+        target: 'http://192.168.1.197:4200',
+      },
       [process.env.VUE_APP_BASE_API]: {
         target: 'http://broadcast.kqyjy.com',
         changeOrigin: true,