|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903 |
- <template>
- <div class="el-col el-col-21" style="padding-right:10px ">
- <div id='pro_tend' >
- <div style="margin-top: 10px;">
- <b class="pro_item">增长趋势分析</b> <span class="update_time">数据更新时间:</span> <span style="font-size: 12px;">{{lastUpdatedTime}} / 从{{recordBeginTime}}开始统计</span>
- </div>
- <div style="margin-top:20px">
- <el-row>
- <el-col :span='1' class ='item_list_first'>
- <el-row class="item_title_h">
-
- </el-row>
- <el-row class="item_h">
- 昨天
- </el-row>
- <el-row class="item_h">
- 累计
- </el-row>
- </el-col>
- <el-col span='23' >
- <el-col :span='3' class ='item_list'>
- <el-row class="item_title_h">
- 项目
- </el-row>
- <el-row class="item_h num_color">
- {{tableDataSummary.numReposAdd}}
- </el-row>
- <el-row class="item_h">
- {{ tableDataSummary.numRepos}}
- </el-row>
- </el-col>
- <el-col :span='3' >
- <el-row class ='item_list_p item_title_h'>
- 公开
- </el-row>
- <el-row class="item_h num_color">
- {{tableDataSummary.numRepoPublicAdd}}
- </el-row >
- <el-row class="item_h">
- {{tableDataSummary.numRepoPublic}}
- </el-row>
-
- </el-col>
- <el-col :span='3' class ='item_list'>
- <el-row class="item_title_h">
- 私有
- </el-row>
- <el-row class="item_h num_color">
- {{tableDataSummary.numRepoPrivateAdd}}
- </el-row>
- <el-row class="item_h">
- {{tableDataSummary.numRepoPrivate}}
- </el-row>
- </el-col>
- <el-col :span='3'>
- <el-row class ='item_list_p item_title_h'>
- 自建
- </el-row>
- <el-row class="item_h num_color">
- {{tableDataSummary.numRepoSelfAdd}}
- </el-row >
- <el-row class="item_h">
- {{tableDataSummary.numRepoSelf}}
- </el-row>
-
- </el-col>
- <el-col :span='3' >
- <el-row class ='item_list_p item_title_h'>
- 派生
- </el-row>
- <el-row class="item_h num_color">
- {{tableDataSummary.numRepoForkAdd}}
- </el-row >
- <el-row class="item_h">
- {{tableDataSummary.numRepoFork}}
- </el-row>
- </el-col>
- <el-col :span='3' class ='item_list '>
- <el-row class="item_title_h">
- 镜像
- </el-row>
- <el-row class="item_h num_color">
- {{tableDataSummary.numRepoMirrorAdd}}
- </el-row>
- <el-row class="item_h">
- {{tableDataSummary.numRepoMirror}}
- </el-row>
-
- </el-col>
- <el-col :span='3'>
- <el-row class ='item_list_p item_title_h'>
- 组织
- </el-row>
- <el-row class="item_h num_color">
- {{tableDataSummary.numRepoOrgAdd}}
- </el-row>
- <el-row class="item_h">
- {{tableDataSummary.numRepoOrg}}
- </el-row>
- </el-col>
- <el-col :span='2'>
- <el-row class="item_title_h">
- 个人
- </el-row>
- <el-row class="item_h num_color">
- {{tableDataSummary.numRepoNotOrgAdd}}
- </el-row>
- <el-row class="item_h">
- {{tableDataSummary.numRepoNotOrg}}
- </el-row>
-
- </el-col>
- </el-col>
- </el-row>
- </div>
- <div style="margin-top: 20px;">
- <span class="sta_iterm">统计周期:</span>
- <!-- <button type="button" class='btnFirst' id ="yesterday" v-bind:class="{colorChange:1==dynamic}" @click="resetPage(),getPeriodProList('yesterday',1)">昨天</button> -->
- <button type="button" class='btn' id = "current_week" v-bind:class="{colorChange:1==dynamic}" @click="resetPage(),getPeriodProList('current_week',1)">本周</button>
- <button type="button" class='btn' id = "current_month" v-bind:class="{colorChange:2==dynamic}" @click="resetPage(),getPeriodProList('current_month',2)">本月</button>
- <button type="button" class='btn' id = "last_month" v-bind:class="{colorChange:3==dynamic}" @click="resetPage(),getPeriodProList('last_month',3)">上月</button>
- <button type="button" class='btn' id = "monthly" v-bind:class="{colorChange:4==dynamic}" @click="resetPage(),getPeriodProList('monthly',4)">近30天</button>
- <button type="button" class='btn' id = "current_year" v-bind:class="{colorChange:5==dynamic}" @click="resetPage(),getPeriodProList('current_year',5)">今年</button>
- <button type="button" class='btnLast' id = "all" v-bind:class="{colorChange:6==dynamic}" @click="resetPage(),getPeriodProList('all',6)">所有</button>
- <span style="margin-left: 20px;">
- <el-date-picker
- v-model="value_time"
- prefix-icon="el-icon-time"
- @change="resetPage(),getPeriodProList('',0)"
- type="daterange"
- size='small'
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </span>
- <span style="float:right; margin-right: 20px;">
- <div style="display:inline-block;margin-left: 20px; ">
- <a class="el-icon-download" v-if="tableData!=''" :href= "'../../api/v1/projectboard/downloadAll/?type='+this.params.type+'&beginTime='+this.params.beginTime+'&endTime='+this.params.endTime+'&q='+this.params.q+'&sort=openi'" ></a>
- <i class="el-icon-download" v-else="tableData=''" href="#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'></i>
- <!-- <span ><a id = "download_file" :href= "'../api/v1/projectboard/downloadAll/?type='+this.params.type+'&beginTime='+this.params.beginTime+'&endTime='+this.params.endTime+'&q='+this.params.q+'&sort=openi'" >下载报告</a> </span> -->
- <span >
- <a id = "download_file" v-if="tableData!=''" :href= "'../../api/v1/projectboard/summary/download?type='+this.params.type+'&beginTime='+this.params.beginTime+'&endTime='+this.params.endTime">下载报告</a>
- <a id = "download_file" v-else="tableData=''" href= "#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'>下载报告</a>
- </span>
- </div>
- </span>
- </div>
- <div class="item_echart" id ='linecharts'>
- <div style="margin: 15px 10px 30px;">
- <label for="label" @change='clickCheckBox'>
- <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="新增项目"/> 新增项目
- <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="新增公开项目"/>新增公开项目
- <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="新增私有项目"/>新增私有项目
- <input type="checkbox" class="checkboxchart" name="checkboxchart" value="新增自建项目"/>新增自建项目
- <input type="checkbox" class="checkboxchart" name="checkboxchart" value="新增派生项目"/>新增派生项目
- <input type="checkbox" class="checkboxchart" name="checkboxchart" value="新增镜像项目"/>新增镜像项目
- <input type="checkbox" class="checkboxchart" name="checkboxchart" value="累计项目"/>累计项目
- </label>
- </div>
- <div id ="selectData" style="height: 300px;">
-
- </div>
-
- </div>
- <div style="margin-top: 30px;">
- <el-table
- :data="tableData.slice((page-1)*pageSize,page*pageSize)"
- style="width: 100%"
- :header-cell-style="tableHeaderStyle"
- :cell-style='cellStyle'>
- <el-table-column
- label="日期"
- align="left"
- prop="creatTime"
- >
- </el-table-column>
- <el-table-column
- label="新增项目"
- align="center"
- prop="numReposAdd"
- >
- </el-table-column>
- <el-table-column
- label="累计项目"
- align="center"
- prop="numRepos"
- >
- </el-table-column>
- <el-table-column
- prop="numRepoPublicAdd"
- label="新增公开项目"
- align="center">
- </el-table-column>
- <el-table-column
- prop="numRepoPrivateAdd"
- label="新增私有项目"
- align="center">
- </el-table-column>
- <el-table-column
- prop="numRepoSelfAdd"
- label="新增自建项目"
- align="center">
- </el-table-column>
- <el-table-column
- prop="numRepoForkAdd"
- label="新增派生项目"
- align="center">
- </el-table-column>
- <el-table-column
- prop="numRepoMirrorAdd"
- label="新增镜像项目"
- align="center">
- </el-table-column>
-
- </el-table>
- </div>
- <div style="margin-top:50px;text-align:center">
- <el-pagination
- background
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="page"
- :page-size="pageSize"
- :page-sizes="[5,10,20]"
- layout="total, sizes,prev, pager, next,jumper"
- :total="tableData.length">
- </el-pagination>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- // import barLabel from './basic/barLabel.vue';
- const {AppSubUrl, StaticUrlPrefix, csrf} = window.config;
-
- import { export2Excel } from '../excel/util.js'
- export default{
- name:'ProAnalysis',
- components: {
- // barLabel,
- },
- data() {
- return {
- recordBeginTime:'',
- lastUpdatedTime:'',
- page:1,
- pageSize:10,
- params:{type:'monthly',page:1,pagesize:10,beginTime:'',endTime:''},
- tableData: [],
- tableDataSummary:{},
- totalPage:0,
- totalNum:0,
- pickerOptions: {
- },
- value_time: '',
- dynamic:4,
- echartsSelectData:'',
- option:'',
- };
- },
- methods: {
- // download_file(){
- // this.params.type='all'
- // },
- popMark(){
- alert("数据为空时,不能下载!")
- },
- exportData(){
-
- // this.getOneProList(this.pro_id,'all',true,7)
- // this.getOneProList(this.pro_id,'all',false,7)
- // this.fileName()
- if (this.tableData!=''){
- this.page=1
- var saveFileName = this.getFileName()
- export2Excel(this.columns,this.tableData,saveFileName)
- }else{
- alert("数据为空时,不能下载!")
- }
-
- },
- getFileName(){
-
- var now = new Date(); // 当前日期
- var nowDayOfWeek = now.getDay(); // 今天本周的第几天
- var nowDay = now.getDate(); // 当前日
- var nowMonth = now.getMonth(); // 当前月
- var nowYear = now.getFullYear(); // 当前年
- var today = this.saveFormatDate(nowYear,nowMonth+1,nowDay);
- var tmp = new Date(now.setTime(now.getTime()-24*60*60*1000));
- var yesterday = this.saveFormatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate());
- var yesterday_tmp = this.formatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate())
-
-
- var startDate=''
- var endDate=''
- var saveFileName = ''
-
- if (typeof this.paramsID.type=="undefined" || this.paramsID.type=="null" || this.paramsID.type==""){
-
- // startDate= this.saveFormatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate());
- endDate = this.saveFormatDate(this.create_time_pro[1].getFullYear(),this.create_time_pro[1].getMonth() + 1,this.create_time_pro[1].getDate());
-
- var tmp = this.formatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate())
- startDate = this.comparedate(tmp,this.recordBeginTime)
-
- console.log("comparedate:"+startDate)
- saveFileName = this.alias+"_"+startDate+'_'+endDate
- }else{
- switch(this.paramsID.type){
- case "yesterday":{
-
- startDate = this.comparedate(yesterday_tmp,this.recordBeginTime)
- endDate = startDate
-
- saveFileName = this.alias+"_"+startDate+'_'+ endDate
- break
- }
- case "current_week":{
- var now = new Date(); // 当前日期
- var nowDayOfWeek = now.getDay(); // 今天本周的第几天
- var day = nowDayOfWeek || 7;
- startDate = this.formatDate(now.getFullYear(), nowMonth+1, nowDay + 1 - day);
- startDate = this.comparedate(startDate,this.recordBeginTime)
-
-
- endDate = yesterday
- saveFileName = this.alias+"_"+startDate+'_'+ endDate
- break
- }
- case "current_month":{
-
- startDate = this.formatDate(nowYear,nowMonth+1,1);
- startDate = this.comparedate(startDate,this.recordBeginTime)
-
- endDate = yesterday
-
- saveFileName = this.alias+"_"+startDate+'_'+ endDate
- break
- }
- case "last_month":{
-
- let lastMonthDate = new Date(); // 上月日期
- lastMonthDate.setDate(1);
- lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
- let lastYear = lastMonthDate.getFullYear();
- let lastMonth = lastMonthDate.getMonth();
-
- startDate=this.formatDate(lastYear, lastMonth+1, 1);
- startDate = this.comparedate(startDate,this.recordBeginTime)
-
-
- var monthStartDate = new Date(lastYear, lastMonth, 1);
- var monthEndDate = new Date(lastYear, lastMonth+1, 1);
- var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24)
-
- endDate=this.saveFormatDate(lastYear, lastMonth+1, days); //月份从0开始,所以+1保存月份
- saveFileName = this.alias+"_"+startDate+'_'+ endDate
- break
- }
- case "monthly":{
- var temp=new Date(now - 1000 * 60 * 60 * 24 * 30)
- startDate = this.formatDate(temp.getFullYear(),temp.getMonth()+1,temp.getDate());
- startDate = this.comparedate(startDate,this.recordBeginTime)
-
- endDate = yesterday
- saveFileName = this.alias+"_"+startDate+'_'+ endDate
- break
- }
- case "current_year":{
- startDate = this.formatDate(now.getFullYear(), 1, 1);
- startDate = this.comparedate(startDate,this.recordBeginTime)
-
- endDate = yesterday
- saveFileName = this.alias+"_"+startDate+'_'+ endDate
- break
- }
- case "all":{
- console.log("e:"+today)
- startDate = 'all'
- endDate = yesterday
- saveFileName = this.alias+'_所有'
- break
- }
- }
- }
- return saveFileName
-
- },
- resetPage(){
- this.page=1
- this.params.page = 1
- },
- resetCurrentPage(){
- this.page=1
- },
- handleSizeChange(val){
- this.pageSize = val
- },
- handleCurrentChange(val){
- this.page = val;
- },
- saveFormatDate(myyear,mymonth,myweekday) {
- // var myyear = this.date.getFullYear();
- // var mymonth = this.date.getMonth() + 1;
- // var myweekday = this.date.getDate();
-
- if (mymonth < 10) {
- mymonth = "0" + mymonth;
- }
- if (myweekday < 10) {
- myweekday = "0" + myweekday;
- }
- console.log((myyear +''+ mymonth +''+ myweekday))
- return (myyear +''+ mymonth +''+ myweekday);
- },
- formatDate(myyear,mymonth,myweekday) {
- // var myyear = this.date.getFullYear();
- // var mymonth = this.date.getMonth() + 1;
- // var myweekday = this.date.getDate();
-
- if (mymonth < 10) {
- mymonth = "0" + mymonth;
- }
- if (myweekday < 10) {
- myweekday = "0" + myweekday;
- }
- return (myyear +'-'+ mymonth +'-'+ myweekday);
- },
- //获得某月的天数
-
- getPeriodProList(type_val,index){
- // console.log("类型:"+type_val)
- this.dynamic = index
- if (typeof type_val=="undefined" || type_val=="null" || type_val==""){
- this.params.type=''
- this.params.beginTime=this.formatDate(this.value_time[0].getFullYear(),this.value_time[0].getMonth() + 1,this.value_time[0].getDate())
- this.params.endTime=this.formatDate(this.value_time[1].getFullYear(),this.value_time[1].getMonth() + 1,this.value_time[1].getDate())
- }else{
- this.params.type=type_val
- this.params.beginTime=''
- this.params.endTime=''
- this.value_time=[]
- }
- // console.log("params:",this.params)
- this.$axios.get('../../api/v1/projectboard/summary/period',{
- params:this.params
- }).then((res)=>{
- this.recordBeginTime=res.data.recordBeginTime
- // this.lastUpdatedTime=res.data.creatTime
- this.tableData = res.data.pageRecords
- this.totalPage=res.data.totalPage
- // this.totalNum = res.data.totalCount//this.totalPage*this.params.pagesize
- // console.log("res.data:"+res.data)
- this.drawSelectData()
-
- })
- },
- getSummaryPro(){
- this.$axios.get('../../api/v1/projectboard/summary',{
- }).then((res)=>{
- this.tableDataSummary = res.data
- this.lastUpdatedTime = res.data.creatTime
- })
- },
- tableHeaderStyle({row,column,rowIndex,columnIndex}){
-
- if(rowIndex===0){
- return 'background:#f5f5f6;color:#606266'
- }
- },
- cellStyle({row,column,rowIndex,columnIndex}){
-
- if(rowIndex%2 === 1){
- return 'background:#f5f5f6;color:#606266'
- }
- },
- drawSelectData(){
-
- // $("#selectData").removeAttr("selectData").empty();
- var xdata=[]
- var ydata_add_pro=[]
- var ydata_add_public_pro=[]
- var ydata_add_private_pro=[]
- var ydata_add_self=[]
- var ydata_add_fork=[]
- var ydata_add_mirror=[]
- var ydata_cumulative_pro=[]
-
- // if ()
- for(var i =0;i<this.tableData.length;i++){
- xdata.push(this.tableData[this.tableData.length-1-i].creatTime);
- ydata_add_pro.push(this.tableData[this.tableData.length-1-i].numReposAdd)
- ydata_add_public_pro.push(this.tableData[this.tableData.length-1-i].numRepoPublicAdd)
- ydata_add_private_pro.push(this.tableData[this.tableData.length-1-i].numRepoPrivateAdd)
- ydata_add_self.push(this.tableData[this.tableData.length-1-i].numRepoSelfAdd)
- ydata_add_fork.push(this.tableData[this.tableData.length-1-i].numRepoForkAdd)
- ydata_add_mirror.push(this.tableData[this.tableData.length-1-i].numRepoMirrorAdd)
- ydata_cumulative_pro.push(this.tableData[this.tableData.length-1-i].numRepos)
- }
- // console.log("ydata_openI:"+ydata_add_pro)
- // console.log(xdata)
- this.option = {
- title : {
- text: '',
-
-
- textStyle: {
- fontSize: 12,
- },
- left:'center',
- top:'bottom',
-
- subtext: '',
-
- },
- tooltip : {
- trigger: 'axis',
- backgroundColor:'rgba(255,255,255,0.8)',
- color:'black',
- borderWidth:'1',
- borderColor:'gray',
- textStyle:{
- color:'black'
- },
-
- },
- legend: {
- data:['新增项目','新增公开项目','新增私有项目','新增自建项目','新增派生项目','新增镜像项目','累计项目'],
- selected:{
- // '新增项目':true,
- // '新增公开项目':true,
- // '新增私有项目':true,
- // '新增自建项目':false,
- // '新增派生项目':false,
- // '新增镜像项目':false,
- // '累计项目':false
- }
- // orient: 'vertical',
- // top:'top',
- },
- toolbox: {
- show : false,
- feature : {
- mark : {show: true},
- dataView : {show: false, readOnly: false},
- magicType : {show: true, type: ['line', 'bar']},
- restore : {show: false},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- data : xdata,
- axisLine: {
- show: false, //x轴线消失
- },
- axisTick:{
- show:false//刻度隐藏
- }
-
- }
- ],
- yAxis : [
- {
- type : 'value',
- axisLine: {
- show: false, //y轴线消失
- },
- axisTick:{
- show:false//刻度隐藏
- }
- }
- ],
- series : [
- { name:"新增项目",
- data: ydata_add_pro,
- type: 'line',
- areaStyle: {},
- itemStyle:{
- normal:{
- lineStyle:{
- color:"#3894FF",
- },
- color:"#3894FF",
- }
- },
- },
- {
- name:"新增公开项目",
- data: ydata_add_public_pro,
- type: 'line',
- areaStyle: {},
- itemStyle:{
- normal:{
- lineStyle:{
- color:"#67B3BB",
- },
- color:"#67B3BB",
- }
- },
- },
- {
- name:"新增私有项目",
- data: ydata_add_private_pro,
- type: 'line',
- areaStyle: {},
- itemStyle:{
- normal:{
- lineStyle:{
- color:"#58A55C",
- },
- color:"#58A55C",
- }
- },
- },
- {
- name:"新增自建项目",
- data: ydata_add_self,
- type: 'line',
- areaStyle: {},
- itemStyle:{
- normal:{
- lineStyle:{
- color:"#F2BD42",
- },
- color:"#F2BD42",
- }
- },
- },
- {
- name:"新增派生项目",
- data: ydata_add_fork,
- type: 'line',
- areaStyle: {},
- itemStyle:{
- normal:{
- lineStyle:{
- color:"#DAA67B",
- },
- color:"#DAA67B",
- }
- },
- },
- {
- name:"新增镜像项目",
- data: ydata_add_mirror,
- type: 'line',
- areaStyle: {},
- itemStyle:{
- normal:{
- lineStyle:{
- color:"#2E4552",
- },
- color:"#2E4552",
- }
- },
- },
- {
- name:"累计项目",
- data: ydata_cumulative_pro,
- type: 'line',
- areaStyle: {},
- itemStyle:{
- normal:{
- lineStyle:{
- color:"#4786B4",
- },
- color:"#4786B4",
- }
- },
- },
-
- ]
- };
- // this.echartsSelectData.resize()
- var checkboxs=document.getElementsByName('checkboxchart');
- for(var i=0; i<checkboxs.length; i++){
- // console.log("selectArr[i]:",this.option.legend.data[i])
- if(checkboxs[i].checked){
- this.option.legend.selected[this.option.legend.data[i]]=true;
- }else{
- this.option.legend.selected[this.option.legend.data[i]]=false;
- }
- }
- this.echartsSelectData.setOption(this.option)
- // setTimeout(function (){
- // window.onresize = function () {
- // this.echartsSelectData.resize;
- // }
- // },200)
-
- // // 使用刚指定的选择项数据显示图表。
- // var selectArr = this.echartsSelectData.getOption().legend[0].data;//legend所有值
- // var checkboxs=document.getElementsByName('checkboxchart');
- // $(".checkboxchart").click(function(){
- // var obj = {};
- // for(var i=0; i<checkboxs.length; i++){
- // if(checkboxs[i].checked){
- // obj[selectArr[i]] = true;
- // }else{
- // obj[selectArr[i]] = false;
- // }
- // }
- // option.legend.selected = obj;
- // this.echartsSelectData.setOption(option);
- // });
-
-
-
- },
- clickCheckBox(){
- // 使用刚指定的选择项数据显示图表。
- var selectArr = this.echartsSelectData.getOption().legend[0].data;//legend所有值
- var checkboxs=document.getElementsByName('checkboxchart');
- // $(".checkboxchart").click(function(){
- var obj = {};
- for(var i=0; i<checkboxs.length; i++){
- if(checkboxs[i].checked){
- obj[selectArr[i]] = true;
- }else{
- obj[selectArr[i]] = false;
- }
- }
- this.option.legend.selected = obj;
- this.echartsSelectData.setOption(this.option);
- // });
-
- },
- comparedate(date1,date2){
- // console.log("date1:"+date1)
- // console.log("date1:"+date2)
- var oDate1 = new Date(date1);
- var oDate2 = new Date(date2);
- if(oDate1.getTime() < oDate2.getTime()){
- var data = date2.split('-')
- return data[0]+''+data[1]+''+data[2]
- } else {
- var data = date1.split('-')
- return data[0]+''+data[1]+''+data[2]
- }
- },
-
- },
- filters:{
-
- },
-
-
- mounted() {
-
- this.getPeriodProList("monthly",4);
- this.getSummaryPro();
- document.getElementById('selectData').style.width = document.getElementById('pro_tend').offsetWidth*0.8+'px'
- this.echartsSelectData = this.$echarts.init(document.getElementById('selectData'))
- },
-
- watch:{
- },
-
- created() {
- this.getSummaryPro();
- this.getPeriodProList("monthly",4);
- },
- updated(){
- if(document.querySelectorAll('img[avatar]').length!==0){
- window.LetterAvatar.transform()
- }
- }
- }
- </script>
-
- <style scoped>
- .item_list_first{
- border-right: 1px solid rgba(219,219,219,100);
- padding-right: 10px;
- }
-
- .item_list{
- border-right: 1px solid rgba(219,219,219,100);
- padding:0px 10px;
- }
- .item_list_p{
- border-right: 1px solid rgba(219,219,219,100);
- padding:0px 10px;
- }
- .item_h{
- line-height: 40px;
- text-align: center;
- }
- .item_title_h{
- line-height: 28px;
- text-align: center;
- }
- .num_color{
- color: #0366D6;
- font-weight: bold;
- }
-
- .pro_item{
- font-size: 16px;
- color: rgba(16, 16, 16, 100);
- font-family: SourceHanSansSC-bold;
- }
- .sta_item{
- font-size: 14px;
- color: rgb(0 0 0);
- font-family: SourceHanSansSC-bold;
- }
- .update_time{
- line-height: 17px;
- font-size: 12px;
- color:rgba(187, 187, 187, 100);
- margin-left: 10px;
- }
- .btnFirst{
- line-height: 1.5;
- margin: -3.5px;
- border: 1px solid rgba(22, 132, 252, 100);
- border-right: none;
- background: #FFFF;
- color: #1684FC;
- width: 60px;
- height: 30px;
- border-radius:4px 0px 0px 4px;
- }
- .btn{
- line-height: 1.5;
- margin: -3.5px;
- border: 1px solid rgba(22, 132, 252, 100);
- border-right: none;
- background: #FFFF;
- color: #1684FC;
- width: 60px;
- height: 30px;
- }
- .btnLast{
- line-height: 1.5;
- margin: -3.5px;
- border: 1px solid rgba(22, 132, 252, 100);
- /* border-right: none; */
- background: #FFFF;
- color: #1684FC;
- width: 60px;
- height: 30px;
- border-radius:0px 4px 4px 0px;
- }
- .btnFirst, .btn, .btnLast {
- cursor: pointer;
- }
-
- /deep/ .el-table tbody tr:hover>td {
- background-color:#D3D3D3!important;
- opacity:1
- }
- /deep/ .el-table {
- font-size: 12px;
- }
-
- /deep/ .el-range-separator{
- width: 20% !important;
- }
- /deep/ .el-pagination {
- padding-bottom: 30px;
- }
- .colorChange {
- background-color: #1684FC;
- color: #FFFF;
- cursor: default;
- }
- .items{
- text-align: center;
- border-right:1px solid rgba(219, 219, 219, 100);
- }
- .item_l{
- margin-right: 5px;
- border:1px solid rgba(219, 219, 219, 100);
- height: 370px;
- width: 100%;
- }
- .item_r{
- margin-right:5px;
- border:1px solid rgba(219, 219, 219, 100);
- height: 370px;
- overflow:auto
- }
- .item_echart{
- margin-top: 10px;
- margin-right: 5px;
- border:1px solid rgba(219, 219, 219, 100);
- height: 350px;
- width: 100%;
- }
- .item_content{
- color:#0366D6;
- margin-top: 10px;
- font-weight:bold;
- }
- </style>
|