lrf402788946 5 lat temu
rodzic
commit
cde9149f48

+ 1 - 0
package.json

@@ -8,6 +8,7 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
+    "@antv/g2plot": "^1.1.6",
     "@fullcalendar/core": "^4.3.1",
     "@fullcalendar/daygrid": "^4.3.0",
     "@fullcalendar/interaction": "^4.3.0",

+ 6 - 2
src/router/index.js

@@ -6,7 +6,6 @@ import { Notification } from 'element-ui';
 Vue.use(VueRouter);
 
 const system = [
-  // 缺少培训批次
   {
     path: '/train/batch/index',
     name: 'train_batch_index',
@@ -195,7 +194,6 @@ const system = [
   },
 ];
 const newPlan = [
-  //缺少:当前计划日历;班主任全年安排;学校总人数设置;学校发参培时间;培训计划详表
   {
     path: '/plan/index',
     name: 'newPlan_index',
@@ -308,6 +306,12 @@ const train = [
     meta: { title: '通知' },
     component: () => import('@/views/train-plan/remind.vue'),
   },
+  {
+    path: '/train/plan/remind/detail',
+    name: 'train_plan_remind_detail',
+    meta: { title: '通知接收情况' },
+    component: () => import('@/views/train-plan/remind-detail.vue'),
+  },
 
   {
     path: '/student/index',

+ 15 - 16
src/views/statistics/detail.vue

@@ -2,12 +2,9 @@
   <div id="detail">
     <detail-frame :title="pageTitle" returns="./index">
       <el-card>
-        <el-row type="flex" align="middle" justify="center" :gutter="20">
-          <el-col :span="10">
-            <pie></pie>
-          </el-col>
-          <el-col :span="10">
-            <line-bar></line-bar>
+        <el-row type="flex" align="middle" justify="center" style="text-align:center">
+          <el-col :span="16">
+            <charts :data="gender" :axis="axis"></charts>
           </el-col>
         </el-row>
       </el-card>
@@ -17,24 +14,26 @@
 
 <script>
 import _ from 'lodash';
-import pie from './charts/pie.vue';
-import lineBar from './charts/line-bar.vue';
-import echarts from 'echarts/lib/echarts';
-import 'echarts/lib/chart/pie';
-import 'echarts/lib/component/title';
-import 'echarts/lib/component/legend';
-import 'echarts/lib/component/toolbox';
-import 'echarts/lib/component/markPoint';
-import 'echarts/lib/component/tooltip';
+import charts from './g2/quest-chart.vue';
 import detailFrame from '@frame/layout/admin/detail-frame';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'detail',
   props: {},
-  components: { detailFrame, pie, lineBar },
+  components: { detailFrame, charts },
   data: function() {
     return {
       mylb: null,
+      axis: {
+        x: 'answer',
+        xAlias: '答案',
+        y: 'value',
+        yAlias: '数量',
+      },
+      gender: [
+        { answer: '男', value: 2 },
+        { answer: '女', value: 1 },
+      ],
     };
   },
   created() {},

+ 112 - 0
src/views/statistics/g2/bar.vue

@@ -0,0 +1,112 @@
+<template>
+  <div id="bar">
+    <div :id="gid"></div>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import { Bar } from '@antv/g2plot';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'bar',
+  props: {
+    data: { type: [Object, Array], default: () => [] },
+    axis: { type: Object, default: () => {} },
+  },
+  components: {},
+  data: function() {
+    return {
+      gid: `${new Date().getTime()}`,
+      chart: null,
+      list: [],
+    };
+  },
+  created() {},
+  mounted() {
+    this.init();
+  },
+  methods: {
+    async init() {
+      let { x, y, xAlias, yAlias } = this.axis;
+      let meta = {};
+      meta[x] = { alias: xAlias };
+      meta[y] = { alias: yAlias };
+      this.chart = new Bar(this.gid, {
+        pixelRatio: 1,
+        data: this.list,
+        //条形和柱状的x,y轴需要互换
+        xField: y,
+        yField: x,
+        meta: meta,
+        point: {
+          visible: true,
+        },
+        label: {
+          visible: true,
+        },
+        //stackField + legend 一起使用,前者确定以哪个字段作为选项,后者是显示与否,位置
+        stackField: x,
+        legend: {
+          visible: true,
+          position: 'right-top',
+        },
+        xAxis: {
+          nice: true,
+          visible: true,
+          line: {
+            visible: true,
+          },
+          grid: {
+            visible: true,
+          },
+          max: _.max(this.list.map(i => i.value)),
+          min: 0,
+          tickLine: {
+            visible: true,
+          },
+        },
+        yAxis: {
+          nice: true,
+          visible: true,
+          grid: {
+            visible: true,
+          },
+          line: {
+            visible: true,
+          },
+        },
+
+        events: {
+          onColumnClick: e => this.gclick(e),
+        },
+      });
+      this.chart.render();
+    },
+    gclick(data) {
+      console.log('in function:gclick');
+      console.log(data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  watch: {
+    data: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val) this.$set(this, `list`, val);
+      },
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 84 - 0
src/views/statistics/g2/column.vue

@@ -0,0 +1,84 @@
+<template>
+  <div id="column">
+    <div :id="gid"></div>
+  </div>
+</template>
+
+<script>
+import { Column } from '@antv/g2plot';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'column',
+  props: {
+    data: { type: [Object, Array], default: () => [] },
+    axis: { type: Object, default: () => {} },
+  },
+  components: {},
+  data: function() {
+    return {
+      gid: `${new Date().getTime()}`,
+      chart: null,
+      list: [],
+    };
+  },
+  created() {},
+  mounted() {
+    this.init();
+  },
+  methods: {
+    async init() {
+      let { x, y, xAlias, yAlias } = this.axis;
+      let meta = {};
+      meta[x] = { alias: xAlias };
+      meta[y] = { alias: yAlias };
+      this.chart = new Column(this.gid, {
+        pixelRatio: 4,
+        data: this.list,
+        xField: x,
+        yField: y,
+        meta: meta,
+        point: {
+          visible: true,
+        },
+        label: {
+          visible: true,
+        },
+        //stackField + legend 一起使用,前者确定以哪个字段作为选项,后者是显示与否,位置
+        stackField: x,
+        legend: {
+          visible: true,
+          position: 'right-top',
+        },
+        events: {
+          onColumnClick: e => this.gclick(e),
+        },
+      });
+      this.chart.render();
+    },
+    gclick(data) {
+      console.log('in function:gclick');
+      console.log(data);
+    },
+  },
+  watch: {
+    data: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val) this.$set(this, `list`, val);
+      },
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 90 - 0
src/views/statistics/g2/donut.vue

@@ -0,0 +1,90 @@
+<template>
+  <div id="donut">
+    <div :id="gid"></div>
+  </div>
+</template>
+
+<script>
+import { Donut } from '@antv/g2plot';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'donut',
+  props: {
+    data: { type: [Object, Array], default: () => [] },
+    axis: { type: Object, default: () => {} },
+  },
+  components: {},
+  data: function() {
+    return {
+      gid: `${new Date().getTime()}`,
+      chart: null,
+      list: [],
+    };
+  },
+  created() {},
+  mounted() {
+    this.init();
+  },
+  methods: {
+    async init() {
+      let { x, y, xAlias, yAlias } = this.axis;
+      let meta = {};
+      meta[x] = { alias: xAlias };
+      meta[y] = { alias: yAlias };
+      this.chart = new Donut(this.gid, {
+        pixelRatio: 4,
+        data: this.list,
+        colorField: x,
+        angleField: y,
+        // meta: meta,
+        point: {
+          visible: true,
+        },
+        label: {
+          visible: true,
+          type: 'outer-center',
+          formatter: (text, item) => `${item._origin[x]}: ${item._origin[y]}`,
+        },
+        //stackField + legend 一起使用,前者确定以哪个字段作为选项,后者是显示与否,位置
+        stackField: x,
+        legend: {
+          visible: true,
+          position: 'right-top',
+        },
+        //环形中间部分设置
+        statistic: {
+          visible: true,
+        },
+        events: {
+          onPieClick: e => this.gclick(e),
+        },
+      });
+      this.chart.render();
+    },
+    gclick(data) {
+      console.log('in function:gclick');
+      console.log(data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  watch: {
+    data: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val) this.$set(this, `list`, val);
+      },
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 86 - 0
src/views/statistics/g2/pie.vue

@@ -0,0 +1,86 @@
+<template>
+  <div id="pie">
+    <div :id="gid"></div>
+  </div>
+</template>
+
+<script>
+import { Pie } from '@antv/g2plot';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'pie',
+  props: {
+    data: { type: [Object, Array], default: () => [] },
+    axis: { type: Object, default: () => {} },
+  },
+  components: {},
+  data: function() {
+    return {
+      gid: `${new Date().getTime()}`,
+      chart: null,
+      list: [],
+    };
+  },
+  created() {},
+  mounted() {
+    this.init();
+  },
+  methods: {
+    async init() {
+      let { x, y, xAlias, yAlias } = this.axis;
+      let meta = {};
+      meta[x] = { alias: xAlias };
+      meta[y] = { alias: yAlias };
+      this.chart = new Pie(this.gid, {
+        pixelRatio: 4,
+        data: this.list,
+        colorField: x,
+        angleField: y,
+        // meta: meta,
+        point: {
+          visible: true,
+        },
+        label: {
+          visible: true,
+          type: 'outer-center',
+          formatter: (text, item) => `${item._origin[x]}: ${item._origin[y]}`,
+        },
+        //stackField + legend 一起使用,前者确定以哪个字段作为选项,后者是显示与否,位置
+        stackField: x,
+        legend: {
+          visible: true,
+          position: 'right-top',
+        },
+        events: {
+          onPieClick: e => this.gclick(e),
+        },
+      });
+      this.chart.render();
+    },
+    gclick(data) {
+      console.log('in function:gclick');
+      console.log(data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  watch: {
+    data: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val) this.$set(this, `list`, val);
+      },
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 53 - 0
src/views/statistics/g2/progress.vue

@@ -0,0 +1,53 @@
+<template>
+  <div id="progr">
+    <div :id="`progr${ind}`"></div>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import { Progress } from '@antv/g2plot';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'progr',
+  props: {
+    ind: { type: [String, Number] },
+    data: { type: Number, require: true },
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {
+      const pro = new Progress(`progr${this.ind}`, {
+        width: 100,
+        height: 40,
+        percent: this.data,
+        color: e => this.getColor(e),
+      });
+      pro.render();
+    },
+    getColor(percent) {
+      if (percent >= 0.7) return 'red';
+      if (_.inRange(percent, 0.3, 0.7)) return 'blue';
+      if (percent <= 0.3) return 'gray';
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 116 - 0
src/views/statistics/g2/quest-chart.vue

@@ -0,0 +1,116 @@
+<template>
+  <div id="quest-chart">
+    <el-row type="flex" align="middle" justify="center" class="btn_bar">
+      <el-col :span="10">
+        第一题
+      </el-col>
+    </el-row>
+    <el-row type="flex" align="middle" justify="center" v-if="btnModel.table">
+      <el-col :span="16">
+        <el-table :data="data" size="mini" border stripe>
+          <el-table-column align="center" label="选项" prop="answer"></el-table-column>
+          <el-table-column align="center" label="小计" prop="value"></el-table-column>
+          <el-table-column align="center" label="比例">
+            <template v-slot="{ row, $index }">
+              <el-row type="flex" align="middle" justify="center">
+                <el-col :span="18">
+                  <g2progress :ind="$index" :data="getPercent(row.value)"></g2progress>
+                </el-col>
+                <el-col :span="6">
+                  {{ `${getPercent(row.value) * 100}%` }}
+                </el-col>
+              </el-row>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-col>
+    </el-row>
+    <el-row type="flex" align="middle" justify="center" class="btn_bar" :gutter="10">
+      <el-col :span="3" v-for="(i, index) in btnList" :key="index">
+        <el-button :type="btnModel[i.model] ? 'primary' : ''" size="mini" @click="changeModel(i.model)">
+          {{ i.text }}
+        </el-button>
+      </el-col>
+    </el-row>
+    <el-row type="flex" align="middle" justify="center" v-if="btnModel.column">
+      <el-col :span="10">
+        <g2column :data="data" :axis="axis"></g2column>
+      </el-col>
+    </el-row>
+    <el-row type="flex" align="middle" justify="center" v-if="btnModel.pie">
+      <el-col :span="10">
+        <g2pie :data="data" :axis="axis"></g2pie>
+      </el-col>
+    </el-row>
+    <el-row type="flex" align="middle" justify="center" v-if="btnModel.donut">
+      <el-col :span="10">
+        <g2donut :data="data" :axis="axis"></g2donut>
+      </el-col>
+    </el-row>
+    <el-row type="flex" align="middle" justify="center" v-if="btnModel.bar">
+      <el-col :span="10">
+        <g2bar :data="data" :axis="axis"></g2bar>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import g2column from './column.vue';
+import g2pie from './pie.vue';
+import g2donut from './donut.vue';
+import g2bar from './bar.vue';
+import g2progress from './progress.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'quest-chart',
+  props: {
+    data: { type: [Object, Array], default: () => [] },
+    axis: { type: Object, default: () => {} },
+  },
+  components: { g2column, g2progress, g2pie, g2donut, g2bar },
+  data: function() {
+    return {
+      btnModel: {
+        table: false,
+        pie: false,
+        dount: false,
+        column: false,
+        bar: false,
+      },
+      btnList: [
+        { text: '表格', model: 'table' },
+        { text: '饼状图', model: 'pie' },
+        { text: '圆环图', model: 'donut' },
+        { text: '柱状图', model: 'column' },
+        { text: '条形图', model: 'bar' },
+      ],
+    };
+  },
+  created() {},
+  methods: {
+    changeModel(model) {
+      this.btnModel[model] = !this.btnModel[model];
+      this.$forceUpdate();
+    },
+    getPercent(num) {
+      let all = this.data.reduce((prev, next) => prev + next.value * 1, 0);
+      let percent = (num * 1) / all;
+      percent = _.round(percent, 4);
+      return percent;
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 40 - 4
src/views/statistics/index.vue

@@ -1,16 +1,18 @@
 <template>
   <div id="index">
     <list-frame title="问卷列表页" @query="search" :total="total" :filter="filFields" :needAdd="false">
-      <data-table :fields="fields" :data="list" :opera="opera" @data="toData"></data-table>
+      <data-table :fields="fields" :data="list" :opera="opera" @test="test" @data="toData"></data-table>
     </list-frame>
   </div>
 </template>
 
 <script>
+import _ from 'lodash';
 import listFrame from '@frame/layout/admin/list-frame';
 import dataTable from '@frame/components/data-table';
-import { createNamespacedHelpers } from 'vuex';
+import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: questionnaire } = createNamespacedHelpers('questionnaire');
+const { mapActions: completion } = createNamespacedHelpers('completion');
 
 export default {
   name: 'index',
@@ -26,6 +28,11 @@ export default {
         icon: 'el-icon-s-data',
         method: 'data',
       },
+      {
+        label: '测试',
+        icon: 'el-icon-document',
+        method: 'test',
+      },
     ],
     fields: [
       { label: '问卷序号', prop: 'num' },
@@ -37,15 +44,25 @@ export default {
       { label: '问卷序号', model: 'id' },
     ],
     list: [],
+    options: undefined,
     total: 0,
   }),
 
   created() {
-    this.search();
+    // this.search();
+  },
+  computed: {
+    ...mapState(['user', 'defaultOption']),
   },
-  computed: {},
   methods: {
+    ...completion({ getCompletion: 'query' }),
     ...questionnaire(['query', 'delete']),
+    async test({ data }) {
+      let planid = _.get(this.options, 'planid');
+      let termid = _.get(this.options, 'termid');
+      let res = await this.getCompletion({ type: '0', typeid: termid, trainplanid: planid, questionnaireid: data._id });
+      console.log(res);
+    },
     async search({ skip = 0, limit = 10, ...info } = {}) {
       const res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
@@ -62,6 +79,25 @@ export default {
       this.search();
     },
   },
+  watch: {
+    defaultOption: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (!_.get(this, 'options')) {
+          this.$set(this, `options`, _.cloneDeep(val));
+          this.search();
+        } else {
+          let ntermid = _.get(val, 'termid');
+          let otermid = _.get(this.options, 'termid');
+          if (ntermid && !_.isEqual(ntermid, otermid)) {
+            this.$set(this, `options`, _.cloneDeep(val));
+            this.search();
+          }
+        }
+      },
+    },
+  },
 };
 </script>
 

+ 1 - 13
src/views/train-plan/parts/test.vue

@@ -81,9 +81,6 @@ export default {
     print() {
       let data = [];
       this.url = null;
-      // for (let index = 0; index < this.from.num; index++) {
-      //   data.push({ code: this.from.code + (index + 1), name: this.from.name + (index + 1) });
-      // }
       let duplicate = _.cloneDeep(this.list);
       duplicate = duplicate.map(i => {
         i.cernum = `2020${i.termname}${i.classname}`;
@@ -92,21 +89,12 @@ export default {
       this.template.print('expressDelivery1', [duplicate[0]]).then(pdf => {
         if (pdf) {
           this.$message.success('生成成功');
-          this.url = pdf.output('bloburi', { filename: '打印文件' });
+          this.url = pdf.output('bloburi', { filename: '证书' });
         } else {
           this.$message.warring('生成失败');
         }
       });
     },
-    image2Base64(img) {
-      var canvas = document.createElement('canvas');
-      canvas.width = img.width;
-      canvas.height = img.height;
-      var ctx = canvas.getContext('2d');
-      ctx.drawImage(img, 0, 0, img.width, img.height);
-      var dataURL = canvas.toDataURL('image/png');
-      return dataURL;
-    },
   },
   computed: {
     ...mapState(['user']),

+ 42 - 0
src/views/train-plan/remind-detail.vue

@@ -0,0 +1,42 @@
+<template>
+  <div id="remind-detail">
+    <p>remind_detail</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: notice } = createNamespacedHelpers('notice');
+export default {
+  name: 'remind-detail',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...notice({ getNoticeList: 'query' }),
+    async search() {
+      let res = await this.getNoticeList();
+      console.log(res);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+    id() {
+      return this.$route.query.id();
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 25 - 5
src/views/train-plan/remind.vue

@@ -1,12 +1,12 @@
 <template>
   <div id="remind">
     <detail-frame :title="pageTitle">
-      <el-row type="flex" align="middle" justify="end" class="btn_bar">
+      <!-- <el-row type="flex" align="middle" justify="end" class="btn_bar">
         <el-col :span="2">
           <el-button type="primary" size="mini" @click="sendMsg()">发送本期通知</el-button>
         </el-col>
-      </el-row>
-      <data-table :fields="fields" :data="list" :opera="opera" @msg="toSendMsg" :usePage="false"></data-table>
+      </el-row> -->
+      <data-table :fields="fields" :data="list" :opera="opera" @msg="toSendMsg" @view="toView" :usePage="false"></data-table>
     </detail-frame>
     <el-dialog title="通知内容" :visible.sync="dialogSend">
       <send-form :form="form" @resetForm="resetForm" @submitForm="submitForm"></send-form>
@@ -22,6 +22,7 @@ import sendForm from './parts/send-form';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: classes } = createNamespacedHelpers('classes');
 const { mapActions: student } = createNamespacedHelpers('student');
+const { mapActions: util } = createNamespacedHelpers('util');
 const { mapActions: notice } = createNamespacedHelpers('notice');
 export default {
   name: 'remind',
@@ -39,6 +40,11 @@ export default {
           icon: 'el-icon-message-solid',
           method: 'msg',
         },
+        {
+          label: '查看通知情况',
+          icon: 'el-icon-view',
+          method: 'view',
+        },
       ],
       fields: [
         { label: '批次', prop: 'batch' },
@@ -51,7 +57,8 @@ export default {
   },
   created() {},
   methods: {
-    ...classes(['query']),
+    ...classes(['query', 'classNameList']),
+    ...util({ modelFetch: 'fetch' }),
     ...student({ getStudentList: 'query' }),
     ...notice({ noticeCreate: 'create' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
@@ -75,10 +82,20 @@ export default {
     // 通知确定
     async submitForm({ data }) {
       let classid = this.classid;
+      let r = await this.classNameList(classid);
+      let elseList = [];
       let res = await this.getStudentList({ classid });
       var notified = res.data.map(item => ({ notifiedid: item.id }));
+      let rl = await this.modelFetch({ model: 'lesson', classid });
+      if (_.get(rl, `data`)) {
+        let { lessons } = _.get(rl, `data`);
+        elseList = _.uniq(_.compact(lessons.map(i => i.teaid)));
+      }
+      if (_.get(data, 'headteacherid')) elseList.push(_.get(data, 'headteacherid'));
+      if (_.get(data, 'lyteacherid')) elseList.push(_.get(data, 'lyteacherid'));
+      elseList = elseList.map(i => ({ notifiedid: i }));
       data.noticeid = this.user.id;
-      data.notified = notified;
+      data.notified = [...notified, ...elseList];
       const arr = await this.noticeCreate(data);
       if (this.$checkRes(res)) {
         this.$message({
@@ -103,6 +120,9 @@ export default {
       const resNotice = await this.sendNotice({ classids });
       this.$checkRes(resNotice, '发送成功', '发送失败');
     },
+    toView({ data }) {
+      this.$router.push({ path: '/train/plan/remind/detail', query: { id: data._id } });
+    },
   },
   watch: {
     defaultOption: {