lrf402788946 %!s(int64=4) %!d(string=hai) anos
pai
achega
2dbfbdecee
Modificáronse 3 ficheiros con 45 adicións e 1 borrados
  1. 1 0
      src/components/adminCommon/frame.vue
  2. 1 1
      src/components/frame/form.vue
  3. 43 0
      src/store/patent.js

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

@@ -16,6 +16,7 @@
             <el-menu-item index="/adminCenter/homeIndex">首页</el-menu-item>
             <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>
         </el-aside>
         <el-main class="main">

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

@@ -11,7 +11,7 @@
       :style="styles"
       :inline="inline"
     >
-      <el-row type="flex" justify="end" align="middle" v-if="returns">
+      <el-row type="flex" justify="end" align="middle" v-if="returns" style="padding:10px">
         <el-col :span="2">
           <el-button size="mini" @click="toReturn">返回</el-button>
         </el-col>

+ 43 - 0
src/store/patent.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/patent`,
+};
+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,
+};