xjc před 4 roky
rodič
revize
9dc92d1ae6
4 změnil soubory, kde provedl 667 přidání a 69 odebrání
  1. 549 0
      src/components/CASCI.vue
  2. 6 1
      src/views/Home.vue
  3. 111 68
      src/views/Index.vue
  4. 1 0
      src/views/system/Role.vue

+ 549 - 0
src/components/CASCI.vue

@@ -0,0 +1,549 @@
+<style lang="scss" scoped>
+.tbl {
+  // border:1px solid #ccc;
+}
+.tbl tr {
+  height: 31px;
+}
+.tbl td {
+  padding: 5px;
+  border: 1px solid #ccc;
+}
+.title {
+  h3 {
+    margin: 20px 60px 0px 0px;
+    border-left: 3px solid rgb(21, 116, 224);
+    padding-left: 10px;
+    display: inline-block;
+  }
+}
+.journalAnalyse {
+  .countItem:last-child {
+    border: none;
+  }
+  .countItem {
+    position: relative;
+    margin: 40px 0px 40px 0px;
+    padding: 0px 40px 0px 20px;
+    border-right: 1px solid #ccc;
+    .red {
+      background: #f56262;
+    }
+    .hui {
+      background: #7ea1bb;
+    }
+    .blue {
+      background: #62b5f5;
+    }
+    .yellow {
+      background: #ffaf54;
+    }
+    .zi {
+      background: #9c76bf;
+    }
+    .llv {
+      background: #31d1d6;
+    }
+    .green {
+      background: #6ed495;
+    }
+    .hlv {
+      background: #66cccc;
+    }
+    .countCircle {
+      width: 100px;
+      border-radius: 100px;
+      height: 100px;
+      line-height: 100px;
+      text-align: center;
+      color: #fff;
+      font-size: 14px;
+      float: left;
+    }
+    h4 {
+      position: absolute;
+      top: 30px;
+      right: 20px;
+    }
+  }
+}
+// 图表
+.chartItem {
+  .content {
+    padding: 20px;
+  }
+}
+</style>
+<template>
+  <section>
+    <!-- <p><span @click="$router.go(-1)">中科院全刊 > </span>期刊详情</p> -->
+    <div class="content">
+      <div class="jDetail">
+        <img
+          :src="form.img"
+          alt=""
+          width="159"
+          height="210"
+          style="float: left"
+        />
+        <table
+          class="tbl"
+          cellpadding="0"
+          cellspacing="0"
+          width="80%"
+          style="float: left; margin-left: 45px"
+        >
+          <tr>
+            <td width="119" align="right">名称:</td>
+            <td>{{ form.name }}</td>
+          </tr>
+          <tr>
+            <td align="right">微信号:</td>
+            <td>{{ form.wxcode }}</td>
+          </tr>
+          <tr>
+            <td align="right">主办单位:</td>
+            <td>{{ form.organizer_name }}</td>
+          </tr>
+          <tr>
+            <td align="right">所属学科:</td>
+            <td>{{ form.subject_name }}</td>
+          </tr>
+          <tr>
+            <td align="right">简介:</td>
+            <td>{{ form.desc }}</td>
+          </tr>
+        </table>
+        <div style="clear: both; height: 0; content: ''"></div>
+      </div>
+      <!-- 期刊数据 -->
+      <div class="journalAnalyse">
+        <div class="title">
+          <h3>期刊数据</h3>
+          <el-date-picker
+            size="mini"
+            v-model="params.timerange"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          >
+          </el-date-picker>
+        </div>
+        <el-row>
+          <el-col :span="4" class="countItem">
+            <div class="countCircle red">总阅读量</div>
+            <h4>{{ form1.read_num }}</h4>
+          </el-col>
+          <el-col :span="4" class="countItem">
+            <div class="countCircle hui">公众号阅读量</div>
+            <h4>{{ form1.read_num_mp }}</h4>
+          </el-col>
+          <el-col :span="4" class="countItem">
+            <div class="countCircle blue">小程序阅读量</div>
+            <h4>{{ form1.read_num_xcx }}</h4> </el-col
+          ><el-col :span="4" class="countItem">
+            <div class="countCircle yellow">转发量</div>
+            <h4>{{ form1.zhuanfa_num }}</h4>
+          </el-col>
+          <el-col :span="4" class="countItem">
+            <div class="countCircle zi">公众号转发量</div>
+            <h4>{{ form1.zhuanfa_num_mp }}</h4>
+          </el-col>
+          <el-col :span="4" class="countItem">
+            <div class="countCircle zi">小程序转发量</div>
+            <h4>{{ form1.zhuanfa_num_xcx }}</h4>
+          </el-col>
+          <el-col :span="4" class="countItem">
+            <div class="countCircle llv">平均阅读量</div>
+            <h4>{{ form1.rd }}</h4>
+          </el-col>
+          <el-col :span="4" class="countItem">
+            <div class="countCircle llv">平均转发量</div>
+            <h4>{{ form1.zd }}</h4>
+          </el-col>
+          <el-col :span="4" class="countItem">
+            <div class="countCircle green">CASCI</div>
+            <h4>{{ form1.casci }}</h4> </el-col
+          ><el-col :span="4" class="countItem">
+            <div class="countCircle hlv">排名</div>
+            <h4>{{ form1.rank }}</h4>
+          </el-col>
+        </el-row>
+      </div>
+      <!-- 近7日期刊数据趋势图 -->
+      <div class="chartItem top7JournalAnalyse">
+        <div class="title">
+          <h3>近7日期刊数据趋势图</h3>
+        </div>
+        <div class="content">
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-tabs v-model="activeName" @tab-click="handleClick">
+                <el-tab-pane label="总阅读数" name="read_num"></el-tab-pane>
+                <el-tab-pane
+                  label="公众号阅读量"
+                  name="read_num_mp"
+                ></el-tab-pane>
+                <el-tab-pane
+                  label="小程序阅读量"
+                  name="read_num_xcx"
+                ></el-tab-pane>
+                <el-tab-pane label="转发数" name="zhuanfa_num"></el-tab-pane>
+                <el-tab-pane
+                  label="公众号转发数"
+                  name="zhuanfa_num_mp"
+                ></el-tab-pane>
+                <el-tab-pane
+                  label="小程序转发数"
+                  name="zhuanfa_num_xcx"
+                ></el-tab-pane>
+              </el-tabs>
+              <div
+                class="chart1"
+                ref="chart1"
+                style="width: 100%; height: 250px"
+              ></div>
+            </el-col>
+            <el-col :span="12">
+              <el-tabs v-model="activeName1" @tab-click="handleClick1">
+                <el-tab-pane label="总排名" name="rank"></el-tab-pane>
+                <el-tab-pane label="CASCI" name="casci"></el-tab-pane>
+              </el-tabs>
+              <div
+                class="chart2"
+                ref="chart2"
+                style="width: 100%; height: 250px"
+              ></div>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <!-- 近30日期刊数据发布 -->
+      <div class="top30JournalAnalyse">
+        <div class="title">
+          <h3>近30日期刊数据发布</h3>
+        </div>
+        <div class="content">
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <h4>24小时发布习惯</h4>
+              <div
+                class="chart3"
+                ref="chart3"
+                style="width: 100%; height: 250px"
+              ></div>
+            </el-col>
+            <el-col :span="12">
+              <h4>工作日发布习惯</h4>
+              <div
+                class="chart4"
+                ref="chart4"
+                style="width: 100%; height: 250px"
+              ></div>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <!-- 近30日发布资源TOP10 -->
+      <div class="top30JournalAnalyse">
+        <div class="title">
+          <h3>近30日发布资源TOP10</h3>
+        </div>
+      </div>
+      <div class="content">
+        <el-table :data="days30Publish" style="width: 100%">
+          <el-table-column prop="article_name" label="名称" width="width">
+          </el-table-column>
+          <el-table-column prop="read_num" label="阅读量" width="width">
+          </el-table-column>
+          <el-table-column
+            prop="read_num_mp"
+            label="公众号阅读量"
+            width="width"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="read_num_xcx"
+            label="小程序阅读量"
+            width="width"
+          >
+          </el-table-column>
+          <el-table-column prop="zhuanfa_num" label="转发量" width="width">
+          </el-table-column>
+          <el-table-column
+            prop="zhuanfa_num_mp"
+            label="公众号转发量"
+            width="width"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="zhuanfa_num_xcx"
+            label="小程序转发量"
+            width="width"
+          >
+          </el-table-column>
+          <el-table-column prop="name" label="操作" width="width">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="primary"
+                @click="getDays30PublishArticle(scope.row)"
+                >查看</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+    <!-- 文章/时间统计量 -->
+    <el-dialog
+      class="fu-dialog"
+      :title="dialogTitle"
+      width="80%"
+      :close-on-click-modal="true"
+      :visible.sync="dialogVisible1"
+    >
+      <el-table :data="days30PublishArticle" style="width: 100%">
+        <el-table-column prop="article_name" label="名称" width="width">
+        </el-table-column>
+        <el-table-column prop="read_num" label="阅读量" width="width">
+        </el-table-column>
+        <el-table-column prop="read_num_mp" label="公众号阅读量" width="width">
+        </el-table-column>
+        <el-table-column prop="read_num_xcx" label="小程序阅读量" width="width">
+        </el-table-column>
+        <el-table-column prop="zhuanfa_num" label="转发量" width="width">
+        </el-table-column>
+        <el-table-column
+          prop="zhuanfa_num_mp"
+          label="公众号转发量"
+          width="width"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="zhuanfa_num_xcx"
+          label="小程序转发量"
+          width="width"
+        >
+        </el-table-column>
+        <el-table-column prop="date" label="日期" width="width">
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+  </section>
+</template>
+<script>
+export default {
+  name: "CASCI",
+  data() {
+    return {
+      form: {},
+      form1: {},
+      params: {
+        timerange: [
+          new Date(new Date() - 1000 * 60 * 60 * 24)
+            .toLocaleDateString()
+            .split("/")
+            .join("-"),
+          new Date(new Date() - 1000 * 60 * 60 * 24)
+            .toLocaleDateString()
+            .split("/")
+            .join("-"),
+        ],
+      },
+      activeName: "read_num",
+      activeName1: "rank",
+      activeName2: "read_num",
+      activeName3: "read_num",
+      nealyTop30Data: [],
+      days7range: [],
+      days7data: [],
+      days7rank: [],
+      days7casci: [],
+      days30range: [],
+      days30data: [],
+      hours24: [],
+      hours24_data: [],
+      weeks: [],
+      weeks_data: [],
+      days30Publish: [],
+      days30PublishArticle: [],
+      dialogTitle: "",
+      dialogVisible1: false,
+      journal_id: 0,
+    };
+  },
+  methods: {
+    handleClick() {
+      this.getDays7Analyse(this.activeName);
+    },
+    handleClick1() {
+      this.getDays7Analyse(this.activeName1);
+    },
+    handleClick2() {
+      this.getDays7Analyse(this.activeName2);
+    },
+    handleClick3() {
+      this.getDays7Analyse(this.activeName3);
+    },
+    preview() {},
+    getData() {
+      this.loading = true;
+      // 期刊详情
+      let id = this.journal_id;
+      if (id) {
+        this.$api.showJournal({ id: id }).then((res) => {
+          this.form = res.data.data;
+          this.oldActivityList = res.data.data.old_activity;
+          this.newActivityList = res.data.data.new_activity;
+          this.goodArticleList = res.data.data.good_article;
+        });
+      }
+    },
+    getCASCIDetail() {
+      var parm = { ...this.params };
+      parm.timerange = parm.timerange.join(",");
+      parm.journal_id = this.journal_id;
+      this.loading = true;
+      this.$api.getCASCIDetail(parm).then((res) => {
+        this.form1 = res.data.data;
+        this.loading = false;
+      });
+    },
+    getDays7Analyse(name) {
+      var parm = { ...this.params };
+      parm.journal_id = this.journal_id;
+      parm.name = name;
+      this.loading = true;
+      this.$api.getDays7Analyse(parm).then((res) => {
+        this.days7range = res.data.data.daysrange;
+        if (["rank", "casci"].indexOf(name) != -1) {
+          this.days7rank = res.data.data.values;
+        } else {
+          this.days7data = res.data.data.values;
+        }
+        this.loading = false;
+        this.initCharts();
+      });
+    },
+    getDays30Habit() {
+      var parm = { ...this.params };
+      parm.journal_id = this.journal_id;
+      this.$api.getDays30Habit(parm).then((res) => {
+        this.hours24 = res.data.data.hours24;
+        this.hours24_data = res.data.data.hours24_data;
+        this.weeks = res.data.data.weeks;
+        this.weeks_data = res.data.data.weeks_data;
+        console.log(this.we);
+      });
+    },
+    getDays30Publish() {
+      var parm = { ...this.params };
+      parm.journal_id = this.journal_id;
+      this.$api.getDays30Publish(parm).then((res) => {
+        console.log(res);
+        this.days30Publish = res.data.data;
+      });
+    },
+    getDays30PublishArticle(row) {
+      var parm = { ...this.params };
+      parm.journal_id = this.journal_id;
+      parm.article_name = row.article_name;
+      this.$api.getDays30PublishArticle(parm).then((res) => {
+        this.days30PublishArticle = res.data.data;
+        this.dialogTitle = row.article_name;
+        this.dialogVisible1 = true;
+      });
+    },
+    // 初始化图表
+    initCharts() {
+      let option1 = {
+        xAxis: {
+          type: "category",
+          data: this.days7range,
+        },
+        yAxis: {
+          type: "value",
+        },
+        series: [
+          {
+            data: this.days7data,
+            type: "line",
+          },
+        ],
+      };
+      //
+      let option2 = {
+        xAxis: {
+          type: "category",
+          data: this.days7range,
+        },
+        yAxis: {
+          type: "value",
+        },
+        series: [
+          {
+            data: this.days7rank,
+            type: "line",
+          },
+        ],
+      };
+      //
+      let option3 = {
+        xAxis: {
+          type: "category",
+          data: this.hours24,
+        },
+        yAxis: {
+          type: "value",
+        },
+        series: [
+          {
+            data: this.hours24_data,
+            type: "line",
+          },
+        ],
+      };
+      //
+      let option4 = {
+        xAxis: {
+          type: "category",
+          data: this.weeks,
+        },
+        yAxis: {
+          type: "value",
+        },
+        series: [
+          {
+            data: this.weeks_data,
+            type: "bar",
+          },
+        ],
+      };
+
+      var chart1 = this.$echarts.init(this.$refs.chart1);
+      var chart2 = this.$echarts.init(this.$refs.chart2);
+      var chart3 = this.$echarts.init(this.$refs.chart3);
+      var chart4 = this.$echarts.init(this.$refs.chart4);
+      chart1.setOption(option1);
+      chart2.setOption(option2);
+      chart3.setOption(option3);
+      chart4.setOption(option4);
+    },
+  },
+  beforeCreate(){},
+  created() {
+    this.$api.getAccountInfo().then((res) => {
+      this.journal_id = res.data.data.journal_id;
+      this.getData();
+      this.getCASCIDetail();
+      this.getDays7Analyse("read_num");
+      this.getDays7Analyse("rank");
+      this.getDays30Habit();
+      this.getDays30Publish();
+    });
+  },
+  mounted() {},
+};
+</script>

+ 6 - 1
src/views/Home.vue

@@ -125,6 +125,7 @@ export default {
 			})
 		},
 		active(i){
+			this.initNav()
 			let that = this;
 			that.inDate.forEach( (item,index,arr) => {
 				if(i != index) return item.act = false;
@@ -146,7 +147,11 @@ export default {
 				if(element.path.indexOf(mod)==-1){
 					element.show = 0
 				}else{
-					element.show = 1
+					if(this.permission(element.name)){
+						element.show = 1
+					}else{
+						element.show = 0
+					}
 				}
 				// if(this.permission(element.name)){
 				// 	element.show = 1

+ 111 - 68
src/views/Index.vue

@@ -1,5 +1,5 @@
 <template>
-  <section class="index-content">
+  <section  v-if="this.role_id==1" class="index-content">
     <div class="index_header">
       <div class="header-item">
         <div class="item-img">
@@ -41,16 +41,21 @@
           </div>
         </div>
       </div>
-      <div class="header-item" style="position:relative;">
-        <span style="position:absolute;top:0;left:5px;color:#666;">搜索热词</span>
-         <wordcloud  v-if='form.search_hot_word'
-          style="width:80%;height:100px;margin-left:20%;"
-          :data="form.search_hot_word"  
-          nameKey="name"  :fontSize='[10,24]'
-          valueKey="value" 
+      <div class="header-item" style="position: relative">
+        <span style="position: absolute; top: 0; left: 5px; color: #666"
+          >搜索热词</span
+        >
+        <wordcloud
+          v-if="form.search_hot_word"
+          style="width: 80%; height: 100px; margin-left: 20%"
+          :data="form.search_hot_word"
+          nameKey="name"
+          :fontSize="[10, 24]"
+          valueKey="value"
           :color="myColors"
-          :showTooltip="false">
-          </wordcloud>
+          :showTooltip="false"
+        >
+        </wordcloud>
       </div>
     </div>
     <div class="index-main">
@@ -95,7 +100,11 @@
               <span>文章标题</span>
               <span>阅读次数</span>
             </div>
-            <div class="con2" v-for="(item, index) in form.article_readnum_top5" :key="index">
+            <div
+              class="con2"
+              v-for="(item, index) in form.article_readnum_top5"
+              :key="index"
+            >
               <span>{{ index + 1 }}</span>
               <span class="a_title">{{ item.name }}</span>
               <span>{{ item.read_num }}</span>
@@ -122,10 +131,15 @@
       </div>
     </div>
   </section>
+  <!-- 期刊管理员首页 -->
+  <section v-else>
+    <CASCI></CASCI>
+  </section>
 </template>
 <script>
 import echarts from "echarts";
-import wordcloud from 'vue-wordcloud'
+import wordcloud from "vue-wordcloud";
+import CASCI from '../components/CASCI'
 export default {
   data() {
     return {
@@ -138,14 +152,15 @@ export default {
         { article_header: "中国生态效率时空演化研究", count: "132" },
         { article_header: "中国生态效率时空演化研究", count: "132" },
       ],
-      myColors: ['#1f77b4', '#629fc9', '#94bedb', '#c9e0ef'],
+      myColors: ["#1f77b4", "#629fc9", "#94bedb", "#c9e0ef"],
+      role_id:1
     };
   },
   components: {
-    wordcloud
-  },
-  computed: {
+    wordcloud,
+    CASCI
   },
+  computed: {},
   methods: {
     getEcharts() {
       var myChart = this.$echarts.init(this.$refs.subject);
@@ -197,7 +212,9 @@ export default {
             // ].sort(function (a, b) {
             //   return a.value - b.value;
             // }),
-            data: this.form.subject_journal.sort(function(a,b){return a.value-b.value}),
+            data: this.form.subject_journal.sort(function (a, b) {
+              return a.value - b.value;
+            }),
             roseType: "radius",
             label: {
               color: "rgba(102, 102, 102,1)",
@@ -353,7 +370,7 @@ export default {
           axisLine: {
             show: false,
           },
-        //   data: ["应用物理", "应用物理", "应用物理", "应用物理", "应用物理"],
+          //   data: ["应用物理", "应用物理", "应用物理", "应用物理", "应用物理"],
           data: this.form.journal_article_x,
         },
         series: [
@@ -439,7 +456,7 @@ export default {
             //   return a.value - b.value;
             // }),
             // data:this.form.journal_article.sort(function(a,b){return a.value-b.value}),
-            data:this.form.journal_article,
+            data: this.form.journal_article,
             roseType: "radius",
             label: {
               color: "rgba(102, 102, 102,1)",
@@ -487,12 +504,12 @@ export default {
               // type:'dotted',
             },
           },
-        //   data: ["1", "2", "3", "", "", "", ""],
+          //   data: ["1", "2", "3", "", "", "", ""],
           data: this.form.pubtime_article_x,
           axisLabel: {
             formatter: function (val) {
-            //   return "中国科学院成都生物研究所  中国科学院成都生物研究所"; //对每个标签处理后的结果(通过js字符串方法处理)
-            return val
+              //   return "中国科学院成都生物研究所  中国科学院成都生物研究所"; //对每个标签处理后的结果(通过js字符串方法处理)
+              return val;
             },
             // x轴字体颜色
             textStyle: {
@@ -663,7 +680,7 @@ export default {
               // type:'dotted',
             },
           },
-        //   data: ["1", "1", "1", "1", "1", "1", "1"],
+          //   data: ["1", "1", "1", "1", "1", "1", "1"],
           data: this.form.pubtime_conference_x,
           axisLabel: {
             formatter: function (val) {
@@ -737,7 +754,9 @@ export default {
     getData() {
       this.$api.getIndexData({}).then((res) => {
         this.form = res.data.data;
-        this.form.search_hot_word=this.form.search_hot_word.concat(this.form.search_hot_word)
+        this.form.search_hot_word = this.form.search_hot_word.concat(
+          this.form.search_hot_word
+        );
         let organizer_journal_x = [];
         let organizer_journal_y = [];
         let journal_article_x = [];
@@ -748,54 +767,78 @@ export default {
         let organizer_conference_y = [];
         let pubtime_conference_x = [];
         let pubtime_conference_y = [];
-        this.form.organizer_journal.forEach((item,index)=>{
-            organizer_journal_x.push(item.name)
-            organizer_journal_y.push(item.value)
-        })
-        this.form.journal_article_top5.forEach((item,index)=>{
-            journal_article_x.push(item.journal_name)
-            journal_article_y.push(item.count)
-        })
-        this.form.pubtime_article.forEach((item,index)=>{
-            pubtime_article_x.push(item.publish_time)
-            pubtime_article_y.push(item.count)
-        })
-        this.form.organizer_conference.forEach((item,index)=>{
-            organizer_conference_x.push(item.organizer_name)
-            organizer_conference_y.push(item.count)
-        })
-        this.form.pubtime_conference.forEach((item,index)=>{
-            pubtime_conference_x.push(item.publish_time)
-            pubtime_conference_y.push(item.count)
-        })
-        this.form.organizer_journal_x = organizer_journal_x
-        this.form.organizer_journal_y = organizer_journal_y
-        this.form.journal_article_x = journal_article_x.reverse()
-        this.form.journal_article_y = journal_article_y.reverse()
-        this.form.pubtime_article_x = pubtime_article_x
-        this.form.pubtime_article_y = pubtime_article_y
-        this.form.organizer_conference_x = organizer_journal_x
-        this.form.organizer_conference_y = organizer_journal_y
-        this.form.pubtime_conference_x = pubtime_conference_x
-        this.form.pubtime_conference_y = pubtime_conference_y
+        this.form.organizer_journal.forEach((item, index) => {
+          organizer_journal_x.push(item.name);
+          organizer_journal_y.push(item.value);
+        });
+        this.form.journal_article_top5.forEach((item, index) => {
+          journal_article_x.push(item.journal_name);
+          journal_article_y.push(item.count);
+        });
+        this.form.pubtime_article.forEach((item, index) => {
+          pubtime_article_x.push(item.publish_time);
+          pubtime_article_y.push(item.count);
+        });
+        this.form.organizer_conference.forEach((item, index) => {
+          organizer_conference_x.push(item.organizer_name);
+          organizer_conference_y.push(item.count);
+        });
+        this.form.pubtime_conference.forEach((item, index) => {
+          pubtime_conference_x.push(item.publish_time);
+          pubtime_conference_y.push(item.count);
+        });
+        this.form.organizer_journal_x = organizer_journal_x;
+        this.form.organizer_journal_y = organizer_journal_y;
+        this.form.journal_article_x = journal_article_x.reverse();
+        this.form.journal_article_y = journal_article_y.reverse();
+        this.form.pubtime_article_x = pubtime_article_x;
+        this.form.pubtime_article_y = pubtime_article_y;
+        this.form.organizer_conference_x = organizer_journal_x;
+        this.form.organizer_conference_y = organizer_journal_y;
+        this.form.pubtime_conference_x = pubtime_conference_x;
+        this.form.pubtime_conference_y = pubtime_conference_y;
         this.getEcharts();
       });
     },
   },
-  mounted() {
+  mounted() {},
+  beforeCreate(){
+    this.$api.getAccountInfo().then((res) => {
+      this.role_id = res.data.data.role_id;
+      // this.getData();
+      // var color = [];
+      // for (let i = 0; i < 5; i++) {
+      //   let c =
+      //     "rgb(" +
+      //     [
+      //       Math.round(Math.random() * 160),
+      //       Math.round(Math.random() * 160),
+      //       Math.round(Math.random() * 160),
+      //     ].join(",") +
+      //     ")";
+      //   color.push(c);
+      // }
+      // this.myColors = color;
+    });
   },
-  created(){
-    this.getData();
-    var color=[]
-    for(let i=0;i<5;i++){
-        let c='rgb(' + [
-                    Math.round(Math.random() * 160),
-                    Math.round(Math.random() * 160),
-                    Math.round(Math.random() * 160)
-                ].join(',') + ')';
-        color.push(c)
-    }
-    this.myColors=color
+  created() {
+    this.$api.getAccountInfo().then((res) => {
+      this.role_id = res.data.data.role_id;
+      this.getData();
+      var color = [];
+      for (let i = 0; i < 5; i++) {
+        let c =
+          "rgb(" +
+          [
+            Math.round(Math.random() * 160),
+            Math.round(Math.random() * 160),
+            Math.round(Math.random() * 160),
+          ].join(",") +
+          ")";
+        color.push(c);
+      }
+      this.myColors = color;
+    });
   },
 };
 </script>
@@ -920,7 +963,7 @@ section {
           span:last-child {
             float: right;
           }
-          .a_title{
+          .a_title {
             white-space: nowrap;
             text-overflow: ellipsis;
             overflow: hidden;

+ 1 - 0
src/views/system/Role.vue

@@ -72,6 +72,7 @@
                     show-checkbox
                     node-key="id" default-expand-all
                     :props="defaultProps"
+                    :check-strictly="true"
                     @check-change="handleCheckChange">
                     </el-tree>
                 </el-form-item>