lrf402788946 4 years ago
parent
commit
f1b96ac1bf
3 changed files with 47 additions and 2 deletions
  1. 2 0
      src/components/adminCommon/frame.vue
  2. 2 2
      src/components/frame/form.vue
  3. 43 0
      src/store/expert.js

+ 2 - 0
src/components/adminCommon/frame.vue

@@ -26,6 +26,8 @@
             <el-menu-item index="/adminCenter/news">新闻管理</el-menu-item>
             <el-menu-item index="/adminCenter/product">科技成果管理</el-menu-item>
             <el-menu-item index="/adminCenter/patent">专利管理</el-menu-item>
+            <el-menu-item index="/adminCenter/roadShow">路演管理</el-menu-item>
+            <el-menu-item index="/adminCenter/expert">专家管理</el-menu-item>
           </el-menu>
         </el-aside>
         <el-main class="main">

+ 2 - 2
src/components/frame/form.vue

@@ -27,8 +27,8 @@
                       v-model="form[item.model]"
                       :type="item.type"
                       placeholder="选择择"
-                      format="yyyy-MM-dd"
-                      value-format="yyyy-MM-dd"
+                      :format="item.type === 'date' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
+                      :value-format="item.type === 'date' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
                       v-bind="item.options"
                     >
                     </el-date-picker>

+ 43 - 0
src/store/expert.js

@@ -0,0 +1,43 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  interface: `/api/m/main/expert`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.interface}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.interface}/update/${id}`, data);
+    return res;
+  },
+
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.interface}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};