guhongwei 2 سال پیش
والد
کامیت
91480154df

+ 0 - 1
src/components/frame/c-button.vue

@@ -3,7 +3,6 @@
     <el-row>
       <el-col :span="24" class="button">
         <el-button type="primary" size="small" icon="el-icon-plus" @click="toAdd()">新增</el-button>
-        <el-button type="primary" size="small" icon="el-icon-download">导出</el-button>
       </el-col>
     </el-row>
   </div>

+ 13 - 6
src/components/web-frame/web-parts-one/footer-1.vue

@@ -11,20 +11,20 @@
           <el-col :span="24" class="two">
             <el-col :span="8" class="two_1">
               <el-col :span="24" class="two_1_1">联系我们:</el-col>
-              <el-col :span="24" class="two_1_2">{{ contactInfo.mobile }}</el-col>
+              <el-col :span="24" class="two_1_2">{{ siteInfo.mobile }}</el-col>
             </el-col>
             <el-col :span="8" class="two_2">
               <el-col :span="24" class="two_2_1">
                 <span>联系QQ:</span>
-                <span>{{ contactInfo.qq }}</span>
+                <span>{{ siteInfo.qq }}</span>
               </el-col>
               <el-col :span="24" class="two_2_1">
                 <span>手机号码:</span>
-                <span>{{ contactInfo.phone }}</span>
+                <span>{{ siteInfo.phone }}</span>
               </el-col>
               <el-col :span="24" class="two_2_1">
                 <span>联系邮箱:</span>
-                <span>{{ contactInfo.email }}</span>
+                <span>{{ siteInfo.email }}</span>
               </el-col>
             </el-col>
             <el-col :span="8" class="two_3"></el-col>
@@ -39,7 +39,7 @@
 </template>
 
 <script>
-import { siteInfo, contactInfo, webmenus } from '../../../layout/site';
+import { contactInfo, webmenus } from '../../../layout/site';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'footer-1',
@@ -48,11 +48,18 @@ export default {
   data: function () {
     return {
       menus: webmenus,
+      siteInfo: {},
       contactInfo: contactInfo,
     };
   },
-  created() {},
+  created() {
+    this.search();
+  },
   methods: {
+    search() {
+      let companyInfo = sessionStorage.getItem('companyInfo');
+      this.$set(this, `siteInfo`, JSON.parse(companyInfo));
+    },
     toHome(e) {
       this.$router.push({ path: e.path });
       window.scrollTo(0, 1);

+ 10 - 4
src/components/web-frame/web-parts-one/header-1.vue

@@ -5,7 +5,7 @@
         <el-col :span="24" class="one">
           <div class="w_1200">
             <el-col :span="12" class="one_1">
-              <span @click="toHome()">{{ siteInfo.zhTitle }}</span>
+              <span @click="toHome()">{{ siteInfo.name || '暂无名称' }}</span>
             </el-col>
             <el-col :span="12" class="one_2">
               <el-button type="danger" size="small" plain @click="toLogin()">管理登录</el-button>
@@ -36,7 +36,7 @@
 </template>
 
 <script>
-import { siteInfo, webmenus } from '../../../layout/site';
+import { webmenus } from '../../../layout/site';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'header-1',
@@ -44,13 +44,19 @@ export default {
   components: {},
   data: function () {
     return {
-      siteInfo: siteInfo,
+      siteInfo: {},
       input: '',
       items: webmenus,
     };
   },
-  created() {},
+  created() {
+    this.search();
+  },
   methods: {
+    search() {
+      let companyInfo = sessionStorage.getItem('companyInfo');
+      this.$set(this, `siteInfo`, JSON.parse(companyInfo));
+    },
     toHome() {
       this.$router.push({ path: '/' });
     },

+ 55 - 4
src/layout/site.js

@@ -79,11 +79,62 @@ export const menus = [
     type: '0',
   },
   {
-    id: 'menus_2',
+    _id: 'menus_2',
     icon: 'el-icon-user',
-    name: '电视节目管理',
-    path: '/tvadmin',
-    type: '0',
+    name: '网站管理',
+    type: '1',
+    children: [
+      {
+        _id: 'menus_2_1',
+        icon: 'el-icon-user',
+        name: '公司信息',
+        path: '/web/company',
+      },
+      {
+        _id: 'menus_2_2',
+        icon: 'el-icon-user',
+        name: '轮播图',
+        path: '/web/banner',
+      },
+      {
+        _id: 'menus_2_3',
+        icon: 'el-icon-user',
+        name: '新闻资讯',
+        path: '/web/news',
+      },
+      {
+        _id: 'menus_2_4',
+        icon: 'el-icon-user',
+        name: '案例管理',
+        path: '/web/cases',
+      },
+      {
+        _id: 'menus_2_5',
+        icon: 'el-icon-user',
+        name: '留言管理',
+        path: '/web/leavemess',
+      },
+    ],
+  },
+  {
+    _id: 'menus_100',
+    icon: 'el-icon-user',
+    name: '系统管理',
+    type: '1',
+    children: [
+      {
+        _id: 'menus_100_1',
+        icon: 'el-icon-user',
+        name: '字典类型管理',
+        path: '/system/dict',
+      },
+      {
+        _id: 'menus_100_2',
+        icon: 'el-icon-user',
+        name: '字典数据管理',
+        path: '/system/dictdata',
+      },
+    ],
   },
   // {
   //   _id: 'menus_2',

+ 42 - 0
src/store/system/dictdata.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  test: `/projectadmin/api/dictdata`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, 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,
+};

+ 42 - 0
src/store/system/dicttype.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  test: `/projectadmin/api/dicttype`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, 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,
+};

+ 1 - 0
src/store/user/state.js

@@ -1 +1,2 @@
 export const user = {};
+export const test = { id: '11' };

+ 42 - 0
src/store/web/banner.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  test: `/projectadmin/api/banner`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, 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,
+};

+ 42 - 0
src/store/web/cases.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  test: `/projectadmin/api/cases`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, 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,
+};

+ 42 - 0
src/store/web/company.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  test: `/projectadmin/api/company`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, 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,
+};

+ 42 - 0
src/store/web/leavemess.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  test: `/projectadmin/api/leavemess`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, 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,
+};

+ 42 - 0
src/store/web/news.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  test: `/projectadmin/api/news`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, 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,
+};