Selaa lähdekoodia

Merge branch 'master' of http://git.cc-lotus.info/article-system/article-mobile

lrf402788946 4 vuotta sitten
vanhempi
commit
2362e83a5b

+ 43 - 0
src/layout/common/foot.vue

@@ -0,0 +1,43 @@
+<template>
+  <div id="foot">
+    <el-row>
+      <el-col :span="24" class="main">
+        <van-tabbar route>
+          <van-tabbar-item icon="home-o" to="/admin/index">统计报表</van-tabbar-item>
+          <van-tabbar-item icon="notes-o" to="/adminRefute">文章辟谣</van-tabbar-item>
+          <van-tabbar-item icon="comment-o" to="/adminCommunity">社区话题</van-tabbar-item>
+          <van-tabbar-item icon="question-o" to="/adminServe">咨询服务</van-tabbar-item>
+        </van-tabbar>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'foot',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 7 - 1
src/layout/common/top.vue

@@ -6,7 +6,11 @@
           <van-search v-model="searchName" placeholder="请输入信息标题" @search="search" />
         </el-col>
         <el-col :span="24" class="two" v-else-if="topType == '2'">
-          <van-nav-bar :title="this.$route.meta.title" left-text="返回" left-arrow @click-left="upBack" />
+          <van-nav-bar :title="this.$route.meta.title" :left-arrow="leftArrow" @click-left="upBack">
+            <template #left>
+              <span v-if="leftArrow"><van-icon name="arrow-left" /><span style="color:#409eff">返回</span> </span></template
+            >
+          </van-nav-bar>
         </el-col>
         <el-col :span="24" class="thr" v-else-if="topType == '3'">
           <el-col :span="4" class="back" @click.native="upBack"> <van-icon name="arrow-left" />返回 </el-col>
@@ -25,6 +29,8 @@ export default {
   name: 'top',
   props: {
     topType: { type: String, default: () => '1' },
+    // 只有类型为2时,有用
+    leftArrow: { type: Boolean, default: () => true },
   },
   components: {},
   data: function() {

+ 19 - 4
src/router/index.js

@@ -7,13 +7,28 @@ Vue.use(VueRouter);
 const admin = [
   {
     path: '/admin/index',
-    meta: { title: '管理首页', isleftarrow: false },
+    meta: { title: '统计报表', isleftarrow: false },
     component: () => import('../views/adminCenter/index.vue'),
   },
   {
-    path: '/admin/refute/index',
-    meta: { title: '文字/辟谣管理' },
-    component: () => import('../views/adminCenter/refute/index.vue'),
+    path: '/adminRefute',
+    meta: { title: '文章辟谣', isleftarrow: false },
+    component: () => import('../views/adminCenter/adminRefute.vue'),
+  },
+  {
+    path: '/adminRefute/edit',
+    meta: { title: '文章辟谣', isleftarrow: false },
+    component: () => import('../views/adminCenter/refute/edit.vue'),
+  },
+  {
+    path: '/adminCommunity',
+    meta: { title: '社区话题', isleftarrow: false },
+    component: () => import('../views/adminCenter/adminCommunity.vue'),
+  },
+  {
+    path: '/adminServe',
+    meta: { title: '咨询服务', isleftarrow: false },
+    component: () => import('../views/adminCenter/adminServe.vue'),
   },
 ];
 const routes = [

+ 68 - 0
src/views/adminCenter/adminCommunity.vue

@@ -0,0 +1,68 @@
+<template>
+  <div id="adminCommunity">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="top">
+          <top topType="2" :leftArrow="false"></top>
+        </el-col>
+        <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
+          社区话题
+        </el-col>
+        <el-col :span="24" class="foot">
+          <foot></foot>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import top from '@/layout/common/top.vue';
+import foot from '@/layout/common/foot.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'adminCommunity',
+  props: {},
+  components: {
+    top,
+    foot,
+  },
+  data: function() {
+    return {
+      clientHeight: '',
+    };
+  },
+  created() {},
+  mounted() {
+    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 90;
+    this.$set(this, `clientHeight`, clientHeight);
+  },
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .top {
+    height: 40px;
+    overflow: hidden;
+    border-bottom: 1px solid #f1f1f1;
+  }
+  .info {
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+  .foot {
+    height: 50px;
+    overflow: hidden;
+    border-top: 1px solid #f1f1f1;
+  }
+}
+</style>

+ 68 - 0
src/views/adminCenter/adminRefute.vue

@@ -0,0 +1,68 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="top">
+          <top topType="2" :leftArrow="false"></top>
+        </el-col>
+        <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
+          文章辟谣
+        </el-col>
+        <el-col :span="24" class="foot">
+          <foot></foot>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import top from '@/layout/common/top.vue';
+import foot from '@/layout/common/foot.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    top,
+    foot,
+  },
+  data: function() {
+    return {
+      clientHeight: '',
+    };
+  },
+  created() {},
+  mounted() {
+    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 90;
+    this.$set(this, `clientHeight`, clientHeight);
+  },
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .top {
+    height: 40px;
+    overflow: hidden;
+    border-bottom: 1px solid #f1f1f1;
+  }
+  .info {
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+  .foot {
+    height: 50px;
+    overflow: hidden;
+    border-top: 1px solid #f1f1f1;
+  }
+}
+</style>

+ 68 - 0
src/views/adminCenter/adminServe.vue

@@ -0,0 +1,68 @@
+<template>
+  <div id="adminServe">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="top">
+          <top topType="2" :leftArrow="false"></top>
+        </el-col>
+        <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
+          咨询服务
+        </el-col>
+        <el-col :span="24" class="foot">
+          <foot></foot>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import top from '@/layout/common/top.vue';
+import foot from '@/layout/common/foot.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'adminServe',
+  props: {},
+  components: {
+    top,
+    foot,
+  },
+  data: function() {
+    return {
+      clientHeight: '',
+    };
+  },
+  created() {},
+  mounted() {
+    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 90;
+    this.$set(this, `clientHeight`, clientHeight);
+  },
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .top {
+    height: 40px;
+    overflow: hidden;
+    border-bottom: 1px solid #f1f1f1;
+  }
+  .info {
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+  .foot {
+    height: 50px;
+    overflow: hidden;
+    border-top: 1px solid #f1f1f1;
+  }
+}
+</style>

+ 37 - 0
src/views/adminCenter/index copy.vue

@@ -0,0 +1,37 @@
+<template>
+  <div id="index">
+    <top topType="2" :leftArrow="false"></top>
+    <lineBar title="发表数"></lineBar>
+    <gauge title="阅读数"></gauge>
+    <pie title="点赞数"></pie>
+  </div>
+</template>
+
+<script>
+import top from '@/layout/common/top.vue';
+import lineBar from './chart/lineBar.vue';
+import pie from './chart/pie.vue';
+import gauge from './chart/gauge.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: { lineBar, pie, gauge, top },
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user', 'menuParams']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 52 - 12
src/views/adminCenter/index.vue

@@ -1,37 +1,77 @@
 <template>
   <div id="index">
-    <top topType="2"></top>
-    <lineBar title="发表数"></lineBar>
-    <gauge title="阅读数"></gauge>
-    <pie title="点赞数"></pie>
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="top">
+          <top topType="2" :leftArrow="false"></top>
+        </el-col>
+        <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
+          <lineBar title="发表数"></lineBar>
+          <gauge title="阅读数"></gauge>
+          <pie title="点赞数"></pie>
+        </el-col>
+        <el-col :span="24" class="foot">
+          <foot></foot>
+        </el-col>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
 <script>
-import top from '@/layout/common/top.vue';
 import lineBar from './chart/lineBar.vue';
 import pie from './chart/pie.vue';
 import gauge from './chart/gauge.vue';
+import top from '@/layout/common/top.vue';
+import foot from '@/layout/common/foot.vue';
+
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'index',
   props: {},
-  components: { lineBar, pie, gauge, top },
+  components: {
+    top,
+    foot,
+    lineBar,
+    pie,
+    gauge,
+  },
   data: function() {
-    return {};
+    return {
+      clientHeight: '',
+    };
   },
   created() {},
+  mounted() {
+    let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 90;
+    this.$set(this, `clientHeight`, clientHeight);
+  },
   methods: {},
   computed: {
-    ...mapState(['user', 'menuParams']),
-    pageTitle() {
-      return `${this.$route.meta.title}`;
-    },
+    ...mapState(['user']),
   },
   metaInfo() {
     return { title: this.$route.meta.title };
   },
+  watch: {},
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.main {
+  .top {
+    height: 40px;
+    overflow: hidden;
+    border-bottom: 1px solid #f1f1f1;
+  }
+  .info {
+    overflow-x: hidden;
+    overflow-y: auto;
+  }
+  .foot {
+    height: 50px;
+    overflow: hidden;
+    border-top: 1px solid #f1f1f1;
+  }
+}
+</style>