|  | @@ -428,6 +428,121 @@
 | 
	
		
			
				|  |  |              <div class="echart-item" id="echart5"></div>
 | 
	
		
			
				|  |  |              <div class="echart-item" id="echart6"></div>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  | +          <div class="read-info" v-if="readInfo">
 | 
	
		
			
				|  |  | +            <!-- <span>文章数:{{ readInfo.article_count }}篇</span> -->
 | 
	
		
			
				|  |  | +            <el-button type="primary" size="small" @click="handleExport" :loading="exportLoading"
 | 
	
		
			
				|  |  | +              >导出阅读数据</el-button
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  | +          <el-table
 | 
	
		
			
				|  |  | +            :data="articleList"
 | 
	
		
			
				|  |  | +            v-loading="tableLoading"
 | 
	
		
			
				|  |  | +            stripe
 | 
	
		
			
				|  |  | +            @sort-change="handleSort"
 | 
	
		
			
				|  |  | +            :default-sort="dataSort"
 | 
	
		
			
				|  |  | +          >
 | 
	
		
			
				|  |  | +            <el-table-column
 | 
	
		
			
				|  |  | +              type="index"
 | 
	
		
			
				|  |  | +              label="#"
 | 
	
		
			
				|  |  | +              width="60"
 | 
	
		
			
				|  |  | +              :index="(pageNumber - 1) * pageSize + 1"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +            <el-table-column
 | 
	
		
			
				|  |  | +              prop="person_name"
 | 
	
		
			
				|  |  | +              sortable="custom"
 | 
	
		
			
				|  |  | +              label="人员姓名"
 | 
	
		
			
				|  |  | +              width="100"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +            <el-table-column
 | 
	
		
			
				|  |  | +              prop="article_title"
 | 
	
		
			
				|  |  | +              sortable="custom"
 | 
	
		
			
				|  |  | +              label="文章"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +            <el-table-column
 | 
	
		
			
				|  |  | +              prop="goods_type"
 | 
	
		
			
				|  |  | +              sortable="custom"
 | 
	
		
			
				|  |  | +              width="100"
 | 
	
		
			
				|  |  | +              label="类型"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              <template slot-scope="scope">
 | 
	
		
			
				|  |  | +                <span
 | 
	
		
			
				|  |  | +                  class="items-type"
 | 
	
		
			
				|  |  | +                  :style="{
 | 
	
		
			
				|  |  | +                    background: goodsTypeListCss[scope.row.goods_type]
 | 
	
		
			
				|  |  | +                      ? goodsTypeListCss[scope.row.goods_type].bg
 | 
	
		
			
				|  |  | +                      : '',
 | 
	
		
			
				|  |  | +                    color: goodsTypeListCss[scope.row.goods_type]
 | 
	
		
			
				|  |  | +                      ? goodsTypeListCss[scope.row.goods_type].color
 | 
	
		
			
				|  |  | +                      : '',
 | 
	
		
			
				|  |  | +                  }"
 | 
	
		
			
				|  |  | +                  >{{ goodsTypeListCss[scope.row.goods_type].text }}</span
 | 
	
		
			
				|  |  | +                >
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +            <el-table-column
 | 
	
		
			
				|  |  | +              prop="study_phase_name"
 | 
	
		
			
				|  |  | +              sortable="custom"
 | 
	
		
			
				|  |  | +              label="学段"
 | 
	
		
			
				|  |  | +              width="81"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +            <el-table-column
 | 
	
		
			
				|  |  | +              prop="issue_no_name"
 | 
	
		
			
				|  |  | +              sortable="custom"
 | 
	
		
			
				|  |  | +              label="来源"
 | 
	
		
			
				|  |  | +              width="197"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +            <el-table-column prop="words" label="词数/长度" width="140">
 | 
	
		
			
				|  |  | +              <template slot-scope="scope">
 | 
	
		
			
				|  |  | +                {{
 | 
	
		
			
				|  |  | +                  scope.row.article_diff_word_count +
 | 
	
		
			
				|  |  | +                  "/" +
 | 
	
		
			
				|  |  | +                  scope.row.article_word_count
 | 
	
		
			
				|  |  | +                }}
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +            <el-table-column
 | 
	
		
			
				|  |  | +              prop="duration"
 | 
	
		
			
				|  |  | +              sortable="custom"
 | 
	
		
			
				|  |  | +              label="阅读时长"
 | 
	
		
			
				|  |  | +              width="140"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              <template slot-scope="scope">
 | 
	
		
			
				|  |  | +                {{ formatterDuration(scope.row) }}
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +            <el-table-column
 | 
	
		
			
				|  |  | +              prop="reading_time"
 | 
	
		
			
				|  |  | +              sortable="custom"
 | 
	
		
			
				|  |  | +              label="阅读时间"
 | 
	
		
			
				|  |  | +              width="160"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              <template slot-scope="scope">
 | 
	
		
			
				|  |  | +                {{
 | 
	
		
			
				|  |  | +                  scope.row.reading_time
 | 
	
		
			
				|  |  | +                    ? scope.row.reading_time.substring(0, 16)
 | 
	
		
			
				|  |  | +                    : "-"
 | 
	
		
			
				|  |  | +                }}
 | 
	
		
			
				|  |  | +              </template>
 | 
	
		
			
				|  |  | +            </el-table-column>
 | 
	
		
			
				|  |  | +          </el-table>
 | 
	
		
			
				|  |  | +          <el-pagination
 | 
	
		
			
				|  |  | +            background
 | 
	
		
			
				|  |  | +            @size-change="
 | 
	
		
			
				|  |  | +              (val) => handleSizeChange(val, 'pageSize', 'pageNumber')
 | 
	
		
			
				|  |  | +            "
 | 
	
		
			
				|  |  | +            @current-change="(val) => handleCurrentChange(val, 'pageNumber')"
 | 
	
		
			
				|  |  | +            :current-page="pageNumber"
 | 
	
		
			
				|  |  | +            :page-sizes="[10, 20, 30, 40, 50]"
 | 
	
		
			
				|  |  | +            :page-size="pageSize"
 | 
	
		
			
				|  |  | +            layout="total, prev, pager, next, sizes, jumper"
 | 
	
		
			
				|  |  | +            :total="total_count_a"
 | 
	
		
			
				|  |  | +          >
 | 
	
		
			
				|  |  | +          </el-pagination>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </div>
 | 
	
	
		
			
				|  | @@ -443,6 +558,7 @@ import { getLogin } from "@/api/ajax";
 | 
	
		
			
				|  |  |  import { formatNumber } from "@/utils/defined";
 | 
	
		
			
				|  |  |  import { mapState } from "vuex";
 | 
	
		
			
				|  |  |  import * as echarts from "echarts";
 | 
	
		
			
				|  |  | +import { formatSeconds } from "@/utils/index";
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    //import引入的组件需要注入到对象中才能使用
 | 
	
		
			
				|  |  |    components: { Header, NavMenu },
 | 
	
	
		
			
				|  | @@ -497,6 +613,56 @@ export default {
 | 
	
		
			
				|  |  |          ],
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        props: { multiple: true },
 | 
	
		
			
				|  |  | +      pageSize: 10,
 | 
	
		
			
				|  |  | +      pageNumber: 1,
 | 
	
		
			
				|  |  | +      articleList: [],
 | 
	
		
			
				|  |  | +      tableLoading: false,
 | 
	
		
			
				|  |  | +      total_count_a: 0,
 | 
	
		
			
				|  |  | +      readInfo: null,
 | 
	
		
			
				|  |  | +      dataSort: {},
 | 
	
		
			
				|  |  | +      goodsTypeListCss: {
 | 
	
		
			
				|  |  | +        2: {
 | 
	
		
			
				|  |  | +          text: "报纸",
 | 
	
		
			
				|  |  | +          color: "#165DFF",
 | 
	
		
			
				|  |  | +          bg: "#E8F7FF",
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        21: {
 | 
	
		
			
				|  |  | +          text: "文章",
 | 
	
		
			
				|  |  | +          color: "#165DFF",
 | 
	
		
			
				|  |  | +          bg: "#E8F7FF",
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        3: {
 | 
	
		
			
				|  |  | +          text: "精读",
 | 
	
		
			
				|  |  | +          color: "#0FC6C2",
 | 
	
		
			
				|  |  | +          bg: "#E8FFFB",
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        0: {
 | 
	
		
			
				|  |  | +          text: "课程",
 | 
	
		
			
				|  |  | +          color: "#722ED1",
 | 
	
		
			
				|  |  | +          bg: "#F5E8FF",
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        1: {
 | 
	
		
			
				|  |  | +          text: "课程",
 | 
	
		
			
				|  |  | +          color: "#722ED1",
 | 
	
		
			
				|  |  | +          bg: "#F5E8FF",
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        10: {
 | 
	
		
			
				|  |  | +          text: "课程",
 | 
	
		
			
				|  |  | +          color: "#722ED1",
 | 
	
		
			
				|  |  | +          bg: "#F5E8FF",
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        // '5':{
 | 
	
		
			
				|  |  | +        //     text:'报纸专辑',
 | 
	
		
			
				|  |  | +        //     color:'#165DFF',
 | 
	
		
			
				|  |  | +        //     bg:'#E8F7FF'
 | 
	
		
			
				|  |  | +        // },
 | 
	
		
			
				|  |  | +        4: {
 | 
	
		
			
				|  |  | +          text: "画刊",
 | 
	
		
			
				|  |  | +          color: "#F53F3F",
 | 
	
		
			
				|  |  | +          bg: "#FFECE8",
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      exportLoading: false,
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    //计算属性 类似于data概念
 | 
	
	
		
			
				|  | @@ -1017,6 +1183,126 @@ export default {
 | 
	
		
			
				|  |  |          };
 | 
	
		
			
				|  |  |          option && myChart.setOption(option);
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  | +      this.getReadList();
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    formatterDuration(row) {
 | 
	
		
			
				|  |  | +      let studyCn = "";
 | 
	
		
			
				|  |  | +      if (row.duration) {
 | 
	
		
			
				|  |  | +        studyCn = formatSeconds(row.duration);
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        studyCn = "0";
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      return studyCn;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    handleSizeChange(val, type, page) {
 | 
	
		
			
				|  |  | +      this[type] = val;
 | 
	
		
			
				|  |  | +      this[page] = 1;
 | 
	
		
			
				|  |  | +      this.getReadList();
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    handleCurrentChange(val, type) {
 | 
	
		
			
				|  |  | +      this[type] = val;
 | 
	
		
			
				|  |  | +      this.getReadList();
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    handleSort(value) {
 | 
	
		
			
				|  |  | +      let dataSort = {
 | 
	
		
			
				|  |  | +        prop: value.prop,
 | 
	
		
			
				|  |  | +        order: value.order,
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +      this.dataSort = dataSort;
 | 
	
		
			
				|  |  | +      this.getReadList();
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    getReadList() {
 | 
	
		
			
				|  |  | +      // 阅读数据
 | 
	
		
			
				|  |  | +      let order_column_list = [];
 | 
	
		
			
				|  |  | +      if (this.dataSort != {}) {
 | 
	
		
			
				|  |  | +        if (this.dataSort.order == "descending") {
 | 
	
		
			
				|  |  | +          order_column_list = [this.dataSort.prop + ":desc"];
 | 
	
		
			
				|  |  | +        } else if (this.dataSort.order == "ascending") {
 | 
	
		
			
				|  |  | +          // 升序不传值
 | 
	
		
			
				|  |  | +          order_column_list = [this.dataSort.prop];
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          order_column_list = ["create_time:desc"];
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        order_column_list = ["create_time:desc"];
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      let MethodName9 =
 | 
	
		
			
				|  |  | +        "/ShopServer/Manager/LogManager/PageQueryReadingRecord_Article";
 | 
	
		
			
				|  |  | +      let data2 = {
 | 
	
		
			
				|  |  | +        reading_date_begin:
 | 
	
		
			
				|  |  | +          this.dataValue && this.dataValue[0] ? this.dataValue[0] : "",
 | 
	
		
			
				|  |  | +        reading_date_end:
 | 
	
		
			
				|  |  | +          this.dataValue && this.dataValue[1] ? this.dataValue[1] : "",
 | 
	
		
			
				|  |  | +        page_capacity: this.pageSize,
 | 
	
		
			
				|  |  | +        cur_page: this.pageNumber,
 | 
	
		
			
				|  |  | +        order_column_list: order_column_list,
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      getLogin(MethodName9, data2).then((res) => {
 | 
	
		
			
				|  |  | +        if (res.status === 1) {
 | 
	
		
			
				|  |  | +          this.readInfo = res.sum_info;
 | 
	
		
			
				|  |  | +          this.total_count_a = res.total_count;
 | 
	
		
			
				|  |  | +          this.articleList = res.reading_record_list;
 | 
	
		
			
				|  |  | +          if (res.sum_info.duration < 3600) {
 | 
	
		
			
				|  |  | +            this.readInfo.durationStr = "<1";
 | 
	
		
			
				|  |  | +          } else {
 | 
	
		
			
				|  |  | +            this.readInfo.durationStr = Math.ceil(res.sum_info.duration / 3600);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 导出阅读数据
 | 
	
		
			
				|  |  | +    handleExport() {
 | 
	
		
			
				|  |  | +      let _this = this;
 | 
	
		
			
				|  |  | +      _this.exportLoading = true;
 | 
	
		
			
				|  |  | +      let MethodName =
 | 
	
		
			
				|  |  | +        "/ShopServer/Manager/FileExport/StartCreateArticleReadingRecordExportFile";
 | 
	
		
			
				|  |  | +      let order_column_list = [];
 | 
	
		
			
				|  |  | +      if (this.dataSort != {}) {
 | 
	
		
			
				|  |  | +        if (this.dataSort.order == "descending") {
 | 
	
		
			
				|  |  | +          order_column_list = [this.dataSort.prop + ":desc"];
 | 
	
		
			
				|  |  | +        } else if (this.dataSort.order == "ascending") {
 | 
	
		
			
				|  |  | +          // 升序不传值
 | 
	
		
			
				|  |  | +          order_column_list = [this.dataSort.prop];
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          order_column_list = ["create_time:desc"];
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        order_column_list = ["create_time:desc"];
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      let data2 = {
 | 
	
		
			
				|  |  | +        reading_date_begin:
 | 
	
		
			
				|  |  | +          this.dataValue && this.dataValue[0] ? this.dataValue[0] : "",
 | 
	
		
			
				|  |  | +        reading_date_end:
 | 
	
		
			
				|  |  | +          this.dataValue && this.dataValue[1] ? this.dataValue[1] : "",
 | 
	
		
			
				|  |  | +        page_capacity: this.pageSize,
 | 
	
		
			
				|  |  | +        cur_page: this.pageNumber,
 | 
	
		
			
				|  |  | +        order_column_list: order_column_list,
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +      getLogin(MethodName, data2)
 | 
	
		
			
				|  |  | +        .then((res) => {
 | 
	
		
			
				|  |  | +          let MethodName2 =
 | 
	
		
			
				|  |  | +            "/ShopServer/Manager/FileExport/GetArticleReadingRecordExportFileTaskProgress";
 | 
	
		
			
				|  |  | +          let timer = setTimeout(() => {
 | 
	
		
			
				|  |  | +            getLogin(MethodName2, {
 | 
	
		
			
				|  |  | +              export_file_task_id: res.export_file_task_id,
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +              .then((res) => {
 | 
	
		
			
				|  |  | +                if (res.is_finish === "true") {
 | 
	
		
			
				|  |  | +                  clearTimeout(timer);
 | 
	
		
			
				|  |  | +                  timer = null;
 | 
	
		
			
				|  |  | +                  _this.exportLoading = false;
 | 
	
		
			
				|  |  | +                  location.href = res.export_file_url;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +              })
 | 
	
		
			
				|  |  | +              .catch((res) => {
 | 
	
		
			
				|  |  | +                this.loading = false;
 | 
	
		
			
				|  |  | +              });
 | 
	
		
			
				|  |  | +          }, 1000);
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        .catch((res) => {
 | 
	
		
			
				|  |  | +          this.loading = false;
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    //生命周期 - 创建完成(可以访问当前this实例)
 | 
	
	
		
			
				|  | @@ -1178,4 +1464,26 @@ export default {
 | 
	
		
			
				|  |  |      padding: 24px;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | +.read-info {
 | 
	
		
			
				|  |  | +  margin: 20px 0 10px 0;
 | 
	
		
			
				|  |  | +  display: flex;
 | 
	
		
			
				|  |  | +  column-gap: 15px;
 | 
	
		
			
				|  |  | +  flex-flow: wrap;
 | 
	
		
			
				|  |  | +  align-items: center;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +:deep th.el-table__cell {
 | 
	
		
			
				|  |  | +  border-bottom: 1px solid #e5e6eb;
 | 
	
		
			
				|  |  | +  background: #f2f3f5;
 | 
	
		
			
				|  |  | +  padding: 8px 0px;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +:deep .cell {
 | 
	
		
			
				|  |  | +  word-break: normal;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +.items-type {
 | 
	
		
			
				|  |  | +  padding: 1px 8px;
 | 
	
		
			
				|  |  | +  font-weight: 500;
 | 
	
		
			
				|  |  | +  font-size: 14px;
 | 
	
		
			
				|  |  | +  line-height: 22px;
 | 
	
		
			
				|  |  | +  border-radius: 2px;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  |  </style>
 |