lrf402788946 há 4 anos atrás
pai
commit
849184187f

+ 1 - 1
src/layout/common/foot.vue

@@ -4,7 +4,7 @@
       <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="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>

+ 4 - 4
src/router/index.js

@@ -12,12 +12,12 @@ const admin = [
   },
   {
     path: '/adminRefute',
-    meta: { title: '文章辟谣', isleftarrow: false },
+    meta: { title: '科研文章', isleftarrow: false },
     component: () => import('../views/adminCenter/adminRefute.vue'),
   },
   {
     path: '/adminRefute/edit',
-    meta: { title: '文章辟谣', isleftarrow: false },
+    meta: { title: '科研文章', isleftarrow: false },
     component: () => import('../views/adminCenter/refute/edit.vue'),
   },
   {
@@ -52,10 +52,10 @@ const routes = [
     meta: { title: '管理登陆', isleftarrow: false },
     component: () => import('../views/login.vue'),
   },
-  // 文章辟谣
+  // 科研文章
   {
     path: '/refute/index',
-    meta: { title: '文章辟谣', isleftarrow: false },
+    meta: { title: '科研文章', isleftarrow: false },
     component: () => import('../views/refute/index.vue'),
   },
   {

+ 1 - 0
src/views/adminCenter/chart/gauge.vue

@@ -63,6 +63,7 @@ export default {
         const e = dup[i];
         e.title = this.tags[i].title;
         e.detail = this.tags[i].detail;
+        e.name = `${e.name}:${e.value}`;
       }
       const max = dup.reduce((p, n) => p + n.value * 1, 0);
       this.chart.setOption({

+ 7 - 3
src/views/adminCenter/chart/lineBar.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="lineBar">
+  <div id="line">
     <div :id="id" style="width: 99%;height:400px;"></div>
   </div>
 </template>
@@ -9,7 +9,7 @@ const _ = require('lodash');
 import * as echarts from 'echarts';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
-  name: 'lineBar',
+  name: 'line',
   props: {
     x: { type: Array, default: () => ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'] },
     data: { type: Array, default: () => [] }, //[5, 20, 36, 10, 10, 20]
@@ -20,7 +20,7 @@ export default {
   components: {},
   data: function() {
     return {
-      id: `lineBar${_.random(100000, 999999)}`,
+      id: `line${_.random(100000, 999999)}`,
       chart: undefined,
     };
   },
@@ -41,10 +41,14 @@ export default {
         this.isInit = true;
       }
       this.chart.setOption({
+        animationDuration: 1000,
         title: {
           text: this.title,
           left: 'center',
         },
+        tooltip: {
+          trigger: 'axis',
+        },
         legend: {
           show: true,
           top: 30,

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

@@ -1,37 +0,0 @@
-<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>

+ 3 - 3
src/views/adminCenter/index.vue

@@ -6,7 +6,7 @@
           <top topType="2" :leftArrow="false"></top>
         </el-col>
         <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }" v-if="display">
-          <lineBar title="发表数" :x="chartsLineX" :data="chartsArticle"></lineBar>
+          <lines title="发表数" :x="chartsLineX" :data="chartsArticle"></lines>
           <gauge title="阅读数" :data="chartsRead"></gauge>
           <!-- <pie title="点赞数"></pie> -->
         </el-col>
@@ -19,7 +19,7 @@
 </template>
 
 <script>
-import lineBar from './chart/lineBar.vue';
+import lines from './chart/line.vue';
 import pie from './chart/pie.vue';
 import gauge from './chart/gauge.vue';
 import top from '@/layout/common/top.vue';
@@ -33,7 +33,7 @@ export default {
   components: {
     top,
     foot,
-    lineBar,
+    lines,
     // pie,
     gauge,
   },

+ 7 - 4
src/views/adminCenter/serve/edit.vue

@@ -38,10 +38,10 @@
               </template>
             </van-field>
             <van-cell title="服务联系人" style="text-align:center" />
-            <van-field v-model="form.contact.name" name="contact.name" label="联系人姓名" placeholder="请输入联系人姓名" />
-            <van-field v-model="form.contact.phone" name="contact.phone" label="联系电话" placeholder="请输入联系电话" />
-            <van-field v-model="form.contact.email" name="contact.email" label="电子邮箱" placeholder="请输入电子邮箱" />
-            <van-field v-model="form.contact.address" name="contact.address" label="联系地址" placeholder="请输入联系地址" />
+            <van-field v-model="form.contact.name" label="联系人姓名" placeholder="请输入联系人姓名" />
+            <van-field v-model="form.contact.phone" label="联系电话" placeholder="请输入联系电话" />
+            <van-field v-model="form.contact.email" label="电子邮箱" placeholder="请输入电子邮箱" />
+            <van-field v-model="form.contact.address" label="联系地址" placeholder="请输入联系地址" />
           </van-form>
         </el-col>
         <el-col :span="24" class="foot">
@@ -83,6 +83,9 @@ export default {
       const res = await this.fetch(this.id);
       if (this.$checkRes(res, null, res.errmsg || '未找到指定数据')) {
         this.$set(this, `form`, res.data);
+        if (!this.form.imgUrl) this.form.imgUrl = [];
+        if (!this.form.fileUrl) this.form.fileUrl = [];
+        if (!this.form.contact) this.form.contact = {};
       }
     },
     async toSubmit() {

+ 1 - 1
vue.config.js

@@ -22,7 +22,7 @@ module.exports = {
         target: 'http://broadcast.waityou24.cn',
       },
       '/api': {
-        target: 'http://192.168.1.19:10010', //http://192.168.1.19:10010
+        target: 'http://broadcast.waityou24.cn', //http://192.168.1.19:10010
         changeOrigin: true,
         ws: true,
       },