Browse Source

Merge branch 'master' of http://git.cc-lotus.info/customer/customer_common

lrf 9 months ago
parent
commit
1576b407fa
3 changed files with 49 additions and 7 deletions
  1. 1 1
      src/components/frame/c-form.vue
  2. 6 6
      src/layout/site.js
  3. 42 0
      src/store/users/customer.js

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

@@ -130,7 +130,7 @@ export default {
     fields: { type: Array, default: () => [{ readonly: false }] },
     form: null,
     rules: { type: Object, default: () => {} },
-    labelWidth: { type: String, default: 'auto' },
+    labelWidth: { type: String, default: '120px' },
     isSave: { type: Boolean, default: true },
     submitText: { type: String, default: '提交保存' },
     reset: { type: Boolean, default: false },

+ 6 - 6
src/layout/site.js

@@ -70,13 +70,13 @@ export const menus = [
     icon: 'el-icon-house',
     name: '系统首页',
     path: '/home',
-    type: '0',
+    type: '1',
   },
   {
     id: 'menus_2',
     icon: 'el-icon-setting',
     name: '系统管理',
-    type: '1',
+    type: '0',
     children: [
       {
         id: 'menus_2_1',
@@ -102,7 +102,7 @@ export const menus = [
     id: 'menus_3',
     icon: 'el-icon-tickets',
     name: '平台设置',
-    type: '1',
+    type: '0',
     children: [
       {
         id: 'menus_3_1',
@@ -122,7 +122,7 @@ export const menus = [
     id: 'menus_4',
     icon: 'el-icon-user',
     name: '用户管理',
-    type: '1',
+    type: '0',
     children: [
       {
         id: 'menus_4_1',
@@ -149,13 +149,13 @@ export const menus = [
     icon: 'el-icon-question',
     name: '题库管理',
     path: '/question',
-    type: '0',
+    type: '1',
   },
   {
     id: 'menus_5',
     icon: 'el-icon-question',
     name: '个人中心',
     path: '/center',
-    type: '0',
+    type: '1',
   },
 ];

+ 42 - 0
src/store/users/customer.js

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