You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProTrend.vue 40 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. <template>
  2. <div class="el-col el-col-21" style="padding-right:10px ">
  3. <div id='pro_tend' >
  4. <div style="margin-top: 10px;">
  5. <b class="pro_item">增长趋势分析</b> <span class="update_time">数据更新时间:</span> <span style="font-size: 12px;">{{lastUpdatedTime}}&nbsp/&nbsp从{{recordBeginTime}}开始统计</span>
  6. </div>
  7. <div style="margin-top:20px">
  8. <el-row>
  9. <el-col :span='1' class ='item_list_first'>
  10. <el-row class="item_title_h">
  11. &nbsp;
  12. </el-row>
  13. <el-row class="item_h">
  14. 昨天
  15. </el-row>
  16. <el-row class="item_h">
  17. 累计
  18. </el-row>
  19. </el-col>
  20. <el-col span='23' >
  21. <el-col :span='3' class ='item_list'>
  22. <el-row class="item_title_h">
  23. 项目
  24. </el-row>
  25. <el-row class="item_h num_color">
  26. {{tableDataSummary.numReposAdd}}
  27. </el-row>
  28. <el-row class="item_h">
  29. {{ tableDataSummary.numRepos}}
  30. </el-row>
  31. </el-col>
  32. <el-col :span='3' >
  33. <el-row class ='item_list_p item_title_h'>
  34. 公开
  35. </el-row>
  36. <el-row class="item_h num_color">
  37. {{tableDataSummary.numRepoPublicAdd}}
  38. </el-row >
  39. <el-row class="item_h">
  40. {{tableDataSummary.numRepoPublic}}
  41. </el-row>
  42. </el-col>
  43. <el-col :span='3' class ='item_list'>
  44. <el-row class="item_title_h">
  45. 私有
  46. </el-row>
  47. <el-row class="item_h num_color">
  48. {{tableDataSummary.numRepoPrivateAdd}}
  49. </el-row>
  50. <el-row class="item_h">
  51. {{tableDataSummary.numRepoPrivate}}
  52. </el-row>
  53. </el-col>
  54. <el-col :span='3'>
  55. <el-row class ='item_list_p item_title_h'>
  56. 自建
  57. </el-row>
  58. <el-row class="item_h num_color">
  59. {{tableDataSummary.numRepoSelfAdd}}
  60. </el-row >
  61. <el-row class="item_h">
  62. {{tableDataSummary.numRepoSelf}}
  63. </el-row>
  64. </el-col>
  65. <el-col :span='3' >
  66. <el-row class ='item_list_p item_title_h'>
  67. 派生
  68. </el-row>
  69. <el-row class="item_h num_color">
  70. {{tableDataSummary.numRepoForkAdd}}
  71. </el-row >
  72. <el-row class="item_h">
  73. {{tableDataSummary.numRepoFork}}
  74. </el-row>
  75. </el-col>
  76. <el-col :span='3' class ='item_list '>
  77. <el-row class="item_title_h">
  78. 镜像
  79. </el-row>
  80. <el-row class="item_h num_color">
  81. {{tableDataSummary.numRepoMirrorAdd}}
  82. </el-row>
  83. <el-row class="item_h">
  84. {{tableDataSummary.numRepoMirror}}
  85. </el-row>
  86. </el-col>
  87. <el-col :span='3'>
  88. <el-row class ='item_list_p item_title_h'>
  89. 组织
  90. </el-row>
  91. <el-row class="item_h num_color">
  92. {{tableDataSummary.numRepoOrgAdd}}
  93. </el-row>
  94. <el-row class="item_h">
  95. {{tableDataSummary.numRepoOrg}}
  96. </el-row>
  97. </el-col>
  98. <el-col :span='2'>
  99. <el-row class="item_title_h">
  100. 个人
  101. </el-row>
  102. <el-row class="item_h num_color">
  103. {{tableDataSummary.numRepoNotOrgAdd}}
  104. </el-row>
  105. <el-row class="item_h">
  106. {{tableDataSummary.numRepoNotOrg}}
  107. </el-row>
  108. </el-col>
  109. </el-col>
  110. </el-row>
  111. </div>
  112. <div style="margin-top: 20px;">
  113. <span class="sta_iterm">统计周期:</span>
  114. <!-- <button type="button" class='btnFirst' id ="yesterday" v-bind:class="{colorChange:1==dynamic}" @click="resetPage(),getPeriodProList('yesterday',1)">昨天</button> -->
  115. <button type="button" class='btn' id = "current_week" v-bind:class="{colorChange:1==dynamic}" @click="resetPage(),getPeriodProList('current_week',1)">本周</button>
  116. <button type="button" class='btn' id = "current_month" v-bind:class="{colorChange:2==dynamic}" @click="resetPage(),getPeriodProList('current_month',2)">本月</button>
  117. <button type="button" class='btn' id = "last_month" v-bind:class="{colorChange:3==dynamic}" @click="resetPage(),getPeriodProList('last_month',3)">上月</button>
  118. <button type="button" class='btn' id = "monthly" v-bind:class="{colorChange:4==dynamic}" @click="resetPage(),getPeriodProList('monthly',4)">近30天</button>
  119. <button type="button" class='btn' id = "current_year" v-bind:class="{colorChange:5==dynamic}" @click="resetPage(),getPeriodProList('current_year',5)">今年</button>
  120. <button type="button" class='btnLast' id = "all" v-bind:class="{colorChange:6==dynamic}" @click="resetPage(),getPeriodProList('all',6)">所有</button>
  121. <span style="margin-left: 20px;">
  122. <el-date-picker
  123. v-model="value_time"
  124. prefix-icon="el-icon-time"
  125. @change="resetPage(),getPeriodProList('',0)"
  126. type="daterange"
  127. size='small'
  128. range-separator="至"
  129. start-placeholder="开始日期"
  130. end-placeholder="结束日期">
  131. </el-date-picker>
  132. </span>
  133. <span style="float:right; margin-right: 20px;">
  134. <div style="display:inline-block;margin-left: 20px; ">
  135. <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>
  136. <i class="el-icon-download" v-else="tableData=''" href="#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'></i>
  137. <!-- <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> -->
  138. <span >
  139. <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>
  140. <a id = "download_file" v-else="tableData=''" href= "#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'>下载报告</a>
  141. </span>
  142. </div>
  143. </span>
  144. </div>
  145. <div class="item_echart" id ='linecharts'>
  146. <div style="margin: 15px 10px 30px;">
  147. <label for="label" @change='clickCheckBox'>
  148. <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="新增项目"/> 新增项目
  149. <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="新增公开项目"/>新增公开项目
  150. <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="新增私有项目"/>新增私有项目
  151. <input type="checkbox" class="checkboxchart" name="checkboxchart" value="新增自建项目"/>新增自建项目
  152. <input type="checkbox" class="checkboxchart" name="checkboxchart" value="新增派生项目"/>新增派生项目
  153. <input type="checkbox" class="checkboxchart" name="checkboxchart" value="新增镜像项目"/>新增镜像项目
  154. <input type="checkbox" class="checkboxchart" name="checkboxchart" value="累计项目"/>累计项目
  155. </label>
  156. </div>
  157. <div id ="selectData" style="height: 300px;">
  158. </div>
  159. </div>
  160. <div style="margin-top: 30px;">
  161. <el-table
  162. :data="tableData.slice((page-1)*pageSize,page*pageSize)"
  163. style="width: 100%"
  164. :header-cell-style="tableHeaderStyle"
  165. :cell-style='cellStyle'>
  166. <el-table-column
  167. label="日期"
  168. align="left"
  169. prop="creatTime"
  170. >
  171. </el-table-column>
  172. <el-table-column
  173. label="新增项目"
  174. align="center"
  175. prop="numReposAdd"
  176. >
  177. </el-table-column>
  178. <el-table-column
  179. label="累计项目"
  180. align="center"
  181. prop="numRepos"
  182. >
  183. </el-table-column>
  184. <el-table-column
  185. prop="numRepoPublicAdd"
  186. label="新增公开项目"
  187. align="center">
  188. </el-table-column>
  189. <el-table-column
  190. prop="numRepoPrivateAdd"
  191. label="新增私有项目"
  192. align="center">
  193. </el-table-column>
  194. <el-table-column
  195. prop="numRepoSelfAdd"
  196. label="新增自建项目"
  197. align="center">
  198. </el-table-column>
  199. <el-table-column
  200. prop="numRepoForkAdd"
  201. label="新增派生项目"
  202. align="center">
  203. </el-table-column>
  204. <el-table-column
  205. prop="numRepoMirrorAdd"
  206. label="新增镜像项目"
  207. align="center">
  208. </el-table-column>
  209. </el-table>
  210. </div>
  211. <div style="margin-top:50px;text-align:center">
  212. <el-pagination
  213. background
  214. @size-change="handleSizeChange"
  215. @current-change="handleCurrentChange"
  216. :current-page="page"
  217. :page-size="pageSize"
  218. :page-sizes="[5,10,20]"
  219. layout="total, sizes,prev, pager, next,jumper"
  220. :total="tableData.length">
  221. </el-pagination>
  222. </div>
  223. </div>
  224. </div>
  225. </template>
  226. <script>
  227. // import barLabel from './basic/barLabel.vue';
  228. const {AppSubUrl, StaticUrlPrefix, csrf} = window.config;
  229. import { export2Excel } from '../excel/util.js'
  230. export default{
  231. name:'ProAnalysis',
  232. components: {
  233. // barLabel,
  234. },
  235. data() {
  236. return {
  237. recordBeginTime:'',
  238. lastUpdatedTime:'',
  239. page:1,
  240. pageSize:10,
  241. params:{type:'monthly',page:1,pagesize:10,beginTime:'',endTime:''},
  242. tableData: [],
  243. tableDataSummary:{},
  244. totalPage:0,
  245. totalNum:0,
  246. pickerOptions: {
  247. },
  248. value_time: '',
  249. dynamic:4,
  250. echartsSelectData:'',
  251. option:'',
  252. };
  253. },
  254. methods: {
  255. // download_file(){
  256. // this.params.type='all'
  257. // },
  258. popMark(){
  259. alert("数据为空时,不能下载!")
  260. },
  261. exportData(){
  262. // this.getOneProList(this.pro_id,'all',true,7)
  263. // this.getOneProList(this.pro_id,'all',false,7)
  264. // this.fileName()
  265. if (this.tableData!=''){
  266. this.page=1
  267. var saveFileName = this.getFileName()
  268. export2Excel(this.columns,this.tableData,saveFileName)
  269. }else{
  270. alert("数据为空时,不能下载!")
  271. }
  272. },
  273. getFileName(){
  274. var now = new Date(); // 当前日期
  275. var nowDayOfWeek = now.getDay(); // 今天本周的第几天
  276. var nowDay = now.getDate(); // 当前日
  277. var nowMonth = now.getMonth(); // 当前月
  278. var nowYear = now.getFullYear(); // 当前年
  279. var today = this.saveFormatDate(nowYear,nowMonth+1,nowDay);
  280. var tmp = new Date(now.setTime(now.getTime()-24*60*60*1000));
  281. var yesterday = this.saveFormatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate());
  282. var yesterday_tmp = this.formatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate())
  283. var startDate=''
  284. var endDate=''
  285. var saveFileName = ''
  286. if (typeof this.paramsID.type=="undefined" || this.paramsID.type=="null" || this.paramsID.type==""){
  287. // startDate= this.saveFormatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate());
  288. endDate = this.saveFormatDate(this.create_time_pro[1].getFullYear(),this.create_time_pro[1].getMonth() + 1,this.create_time_pro[1].getDate());
  289. var tmp = this.formatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate())
  290. startDate = this.comparedate(tmp,this.recordBeginTime)
  291. console.log("comparedate:"+startDate)
  292. saveFileName = this.alias+"_"+startDate+'_'+endDate
  293. }else{
  294. switch(this.paramsID.type){
  295. case "yesterday":{
  296. startDate = this.comparedate(yesterday_tmp,this.recordBeginTime)
  297. endDate = startDate
  298. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  299. break
  300. }
  301. case "current_week":{
  302. var now = new Date(); // 当前日期
  303. var nowDayOfWeek = now.getDay(); // 今天本周的第几天
  304. var day = nowDayOfWeek || 7;
  305. startDate = this.formatDate(now.getFullYear(), nowMonth+1, nowDay + 1 - day);
  306. startDate = this.comparedate(startDate,this.recordBeginTime)
  307. endDate = yesterday
  308. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  309. break
  310. }
  311. case "current_month":{
  312. startDate = this.formatDate(nowYear,nowMonth+1,1);
  313. startDate = this.comparedate(startDate,this.recordBeginTime)
  314. endDate = yesterday
  315. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  316. break
  317. }
  318. case "last_month":{
  319. let lastMonthDate = new Date(); // 上月日期
  320. lastMonthDate.setDate(1);
  321. lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
  322. let lastYear = lastMonthDate.getFullYear();
  323. let lastMonth = lastMonthDate.getMonth();
  324. startDate=this.formatDate(lastYear, lastMonth+1, 1);
  325. startDate = this.comparedate(startDate,this.recordBeginTime)
  326. var monthStartDate = new Date(lastYear, lastMonth, 1);
  327. var monthEndDate = new Date(lastYear, lastMonth+1, 1);
  328. var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24)
  329. endDate=this.saveFormatDate(lastYear, lastMonth+1, days); //月份从0开始,所以+1保存月份
  330. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  331. break
  332. }
  333. case "monthly":{
  334. var temp=new Date(now - 1000 * 60 * 60 * 24 * 30)
  335. startDate = this.formatDate(temp.getFullYear(),temp.getMonth()+1,temp.getDate());
  336. startDate = this.comparedate(startDate,this.recordBeginTime)
  337. endDate = yesterday
  338. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  339. break
  340. }
  341. case "current_year":{
  342. startDate = this.formatDate(now.getFullYear(), 1, 1);
  343. startDate = this.comparedate(startDate,this.recordBeginTime)
  344. endDate = yesterday
  345. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  346. break
  347. }
  348. case "all":{
  349. console.log("e:"+today)
  350. startDate = 'all'
  351. endDate = yesterday
  352. saveFileName = this.alias+'_所有'
  353. break
  354. }
  355. }
  356. }
  357. return saveFileName
  358. },
  359. resetPage(){
  360. this.page=1
  361. this.params.page = 1
  362. },
  363. resetCurrentPage(){
  364. this.page=1
  365. },
  366. handleSizeChange(val){
  367. this.pageSize = val
  368. },
  369. handleCurrentChange(val){
  370. this.page = val;
  371. },
  372. saveFormatDate(myyear,mymonth,myweekday) {
  373. // var myyear = this.date.getFullYear();
  374. // var mymonth = this.date.getMonth() + 1;
  375. // var myweekday = this.date.getDate();
  376. if (mymonth < 10) {
  377. mymonth = "0" + mymonth;
  378. }
  379. if (myweekday < 10) {
  380. myweekday = "0" + myweekday;
  381. }
  382. console.log((myyear +''+ mymonth +''+ myweekday))
  383. return (myyear +''+ mymonth +''+ myweekday);
  384. },
  385. formatDate(myyear,mymonth,myweekday) {
  386. // var myyear = this.date.getFullYear();
  387. // var mymonth = this.date.getMonth() + 1;
  388. // var myweekday = this.date.getDate();
  389. if (mymonth < 10) {
  390. mymonth = "0" + mymonth;
  391. }
  392. if (myweekday < 10) {
  393. myweekday = "0" + myweekday;
  394. }
  395. return (myyear +'-'+ mymonth +'-'+ myweekday);
  396. },
  397. //获得某月的天数
  398. getPeriodProList(type_val,index){
  399. // console.log("类型:"+type_val)
  400. this.dynamic = index
  401. if (typeof type_val=="undefined" || type_val=="null" || type_val==""){
  402. this.params.type=''
  403. this.params.beginTime=this.formatDate(this.value_time[0].getFullYear(),this.value_time[0].getMonth() + 1,this.value_time[0].getDate())
  404. this.params.endTime=this.formatDate(this.value_time[1].getFullYear(),this.value_time[1].getMonth() + 1,this.value_time[1].getDate())
  405. }else{
  406. this.params.type=type_val
  407. this.params.beginTime=''
  408. this.params.endTime=''
  409. this.value_time=[]
  410. }
  411. // console.log("params:",this.params)
  412. this.$axios.get('../../api/v1/projectboard/summary/period',{
  413. params:this.params
  414. }).then((res)=>{
  415. this.recordBeginTime=res.data.recordBeginTime
  416. // this.lastUpdatedTime=res.data.creatTime
  417. this.tableData = res.data.pageRecords
  418. this.totalPage=res.data.totalPage
  419. // this.totalNum = res.data.totalCount//this.totalPage*this.params.pagesize
  420. // console.log("res.data:"+res.data)
  421. this.drawSelectData()
  422. })
  423. },
  424. getSummaryPro(){
  425. this.$axios.get('../../api/v1/projectboard/summary',{
  426. }).then((res)=>{
  427. this.tableDataSummary = res.data
  428. this.lastUpdatedTime = res.data.creatTime
  429. })
  430. },
  431. tableHeaderStyle({row,column,rowIndex,columnIndex}){
  432. if(rowIndex===0){
  433. return 'background:#f5f5f6;color:#606266'
  434. }
  435. },
  436. cellStyle({row,column,rowIndex,columnIndex}){
  437. if(rowIndex%2 === 1){
  438. return 'background:#f5f5f6;color:#606266'
  439. }
  440. },
  441. drawSelectData(){
  442. // $("#selectData").removeAttr("selectData").empty();
  443. var xdata=[]
  444. var ydata_add_pro=[]
  445. var ydata_add_public_pro=[]
  446. var ydata_add_private_pro=[]
  447. var ydata_add_self=[]
  448. var ydata_add_fork=[]
  449. var ydata_add_mirror=[]
  450. var ydata_cumulative_pro=[]
  451. // if ()
  452. for(var i =0;i<this.tableData.length;i++){
  453. xdata.push(this.tableData[this.tableData.length-1-i].creatTime);
  454. ydata_add_pro.push(this.tableData[this.tableData.length-1-i].numReposAdd)
  455. ydata_add_public_pro.push(this.tableData[this.tableData.length-1-i].numRepoPublicAdd)
  456. ydata_add_private_pro.push(this.tableData[this.tableData.length-1-i].numRepoPrivateAdd)
  457. ydata_add_self.push(this.tableData[this.tableData.length-1-i].numRepoSelfAdd)
  458. ydata_add_fork.push(this.tableData[this.tableData.length-1-i].numRepoForkAdd)
  459. ydata_add_mirror.push(this.tableData[this.tableData.length-1-i].numRepoMirrorAdd)
  460. ydata_cumulative_pro.push(this.tableData[this.tableData.length-1-i].numRepos)
  461. }
  462. // console.log("ydata_openI:"+ydata_add_pro)
  463. // console.log(xdata)
  464. this.option = {
  465. title : {
  466. text: '',
  467. textStyle: {
  468.                 fontSize: 12,
  469.             },
  470. left:'center',
  471. top:'bottom',
  472. subtext: '',
  473. },
  474. tooltip : {
  475. trigger: 'axis',
  476. backgroundColor:'rgba(255,255,255,0.8)',
  477. color:'black',
  478. borderWidth:'1',
  479. borderColor:'gray',
  480. textStyle:{
  481. color:'black'
  482. },
  483. },
  484. legend: {
  485. data:['新增项目','新增公开项目','新增私有项目','新增自建项目','新增派生项目','新增镜像项目','累计项目'],
  486. selected:{
  487. // '新增项目':true,
  488. // '新增公开项目':true,
  489. // '新增私有项目':true,
  490. //                                 '新增自建项目':false,
  491. //                                 '新增派生项目':false,
  492. //                                 '新增镜像项目':false,
  493. //                                 '累计项目':false
  494.                             }
  495. // orient: 'vertical',
  496. // top:'top',  
  497. },
  498. toolbox: {
  499. show : false,
  500. feature : {
  501. mark : {show: true},
  502. dataView : {show: false, readOnly: false},
  503. magicType : {show: true, type: ['line', 'bar']},
  504. restore : {show: false},
  505. saveAsImage : {show: true}
  506. }
  507. },
  508. calculable : true,
  509. xAxis : [
  510. {
  511. type : 'category',
  512. data : xdata,
  513. axisLine: {
  514. show: false, //x轴线消失
  515. },
  516. axisTick:{
  517. show:false//刻度隐藏
  518. }
  519. }
  520. ],
  521. yAxis : [
  522. {
  523. type : 'value',
  524. axisLine: {
  525. show: false, //y轴线消失
  526. },
  527. axisTick:{
  528. show:false//刻度隐藏
  529. }
  530. }
  531. ],
  532. series : [
  533. { name:"新增项目",
  534. data: ydata_add_pro,
  535. type: 'line',
  536. areaStyle: {},
  537. itemStyle:{
  538. normal:{
  539. lineStyle:{
  540. color:"#3894FF",
  541. },
  542. color:"#3894FF",
  543. }
  544. },
  545. },
  546. {
  547. name:"新增公开项目",
  548. data: ydata_add_public_pro,
  549. type: 'line',
  550. areaStyle: {},
  551. itemStyle:{
  552. normal:{
  553. lineStyle:{
  554. color:"#67B3BB",
  555. },
  556. color:"#67B3BB",
  557. }
  558. },
  559. },
  560. {
  561. name:"新增私有项目",
  562. data: ydata_add_private_pro,
  563. type: 'line',
  564. areaStyle: {},
  565. itemStyle:{
  566. normal:{
  567. lineStyle:{
  568. color:"#58A55C",
  569. },
  570. color:"#58A55C",
  571. }
  572. },
  573. },
  574. {
  575. name:"新增自建项目",
  576. data: ydata_add_self,
  577. type: 'line',
  578. areaStyle: {},
  579. itemStyle:{
  580. normal:{
  581. lineStyle:{
  582. color:"#F2BD42",
  583. },
  584. color:"#F2BD42",
  585. }
  586. },
  587. },
  588. {
  589. name:"新增派生项目",
  590. data: ydata_add_fork,
  591. type: 'line',
  592. areaStyle: {},
  593. itemStyle:{
  594. normal:{
  595. lineStyle:{
  596. color:"#DAA67B",
  597. },
  598. color:"#DAA67B",
  599. }
  600. },
  601. },
  602. {
  603. name:"新增镜像项目",
  604. data: ydata_add_mirror,
  605. type: 'line',
  606. areaStyle: {},
  607. itemStyle:{
  608. normal:{
  609. lineStyle:{
  610. color:"#2E4552",
  611. },
  612. color:"#2E4552",
  613. }
  614. },
  615. },
  616. {
  617. name:"累计项目",
  618. data: ydata_cumulative_pro,
  619. type: 'line',
  620. areaStyle: {},
  621. itemStyle:{
  622. normal:{
  623. lineStyle:{
  624. color:"#4786B4",
  625. },
  626. color:"#4786B4",
  627. }
  628. },
  629. },
  630. ]
  631. };
  632. // this.echartsSelectData.resize()
  633. var checkboxs=document.getElementsByName('checkboxchart');
  634. for(var i=0; i<checkboxs.length; i++){
  635. // console.log("selectArr[i]:",this.option.legend.data[i])
  636. if(checkboxs[i].checked){
  637. this.option.legend.selected[this.option.legend.data[i]]=true;
  638. }else{
  639. this.option.legend.selected[this.option.legend.data[i]]=false;
  640. }
  641. }
  642. this.echartsSelectData.setOption(this.option)
  643. // setTimeout(function (){
  644. // window.onresize = function () {
  645. // this.echartsSelectData.resize;
  646. // }
  647. // },200)
  648. // // 使用刚指定的选择项数据显示图表。
  649. // var selectArr = this.echartsSelectData.getOption().legend[0].data;//legend所有值
  650. // var checkboxs=document.getElementsByName('checkboxchart');
  651. // $(".checkboxchart").click(function(){
  652. // var obj = {};
  653. // for(var i=0; i<checkboxs.length; i++){
  654. // if(checkboxs[i].checked){
  655. // obj[selectArr[i]] = true;
  656. // }else{
  657. // obj[selectArr[i]] = false;
  658. // }
  659. // }
  660. // option.legend.selected = obj;
  661. // this.echartsSelectData.setOption(option);
  662. // });
  663. },
  664. clickCheckBox(){
  665. // 使用刚指定的选择项数据显示图表。
  666. var selectArr = this.echartsSelectData.getOption().legend[0].data;//legend所有值
  667. var checkboxs=document.getElementsByName('checkboxchart');
  668. // $(".checkboxchart").click(function(){
  669. var obj = {};
  670. for(var i=0; i<checkboxs.length; i++){
  671. if(checkboxs[i].checked){
  672. obj[selectArr[i]] = true;
  673. }else{
  674. obj[selectArr[i]] = false;
  675. }
  676. }
  677. this.option.legend.selected = obj;
  678. this.echartsSelectData.setOption(this.option);
  679. // });
  680. },
  681. comparedate(date1,date2){
  682. // console.log("date1:"+date1)
  683. // console.log("date1:"+date2)
  684. var oDate1 = new Date(date1);
  685. var oDate2 = new Date(date2);
  686. if(oDate1.getTime() < oDate2.getTime()){
  687. var data = date2.split('-')
  688. return data[0]+''+data[1]+''+data[2]
  689. } else {
  690. var data = date1.split('-')
  691. return data[0]+''+data[1]+''+data[2]
  692. }
  693. },
  694. },
  695. filters:{
  696. },
  697. mounted() {
  698. this.getPeriodProList("monthly",4);
  699. this.getSummaryPro();
  700. document.getElementById('selectData').style.width = document.getElementById('pro_tend').offsetWidth*0.8+'px'
  701. this.echartsSelectData = this.$echarts.init(document.getElementById('selectData'))
  702. },
  703. watch:{
  704. },
  705. created() {
  706. this.getSummaryPro();
  707. this.getPeriodProList("monthly",4);
  708. },
  709. updated(){
  710. if(document.querySelectorAll('img[avatar]').length!==0){
  711. window.LetterAvatar.transform()
  712. }
  713. }
  714. }
  715. </script>
  716. <style scoped>
  717. .item_list_first{
  718. border-right: 1px solid rgba(219,219,219,100);
  719. padding-right: 10px;
  720. }
  721. .item_list{
  722. border-right: 1px solid rgba(219,219,219,100);
  723. padding:0px 10px;
  724. }
  725. .item_list_p{
  726. border-right: 1px solid rgba(219,219,219,100);
  727. padding:0px 10px;
  728. }
  729. .item_h{
  730. line-height: 40px;
  731. text-align: center;
  732. }
  733. .item_title_h{
  734. line-height: 28px;
  735. text-align: center;
  736. }
  737. .num_color{
  738. color: #0366D6;
  739. font-weight: bold;
  740. }
  741. .pro_item{
  742. font-size: 16px;
  743. color: rgba(16, 16, 16, 100);
  744. font-family: SourceHanSansSC-bold;
  745. }
  746. .sta_item{
  747. font-size: 14px;
  748. color: rgb(0 0 0);
  749. font-family: SourceHanSansSC-bold;
  750. }
  751. .update_time{
  752. line-height: 17px;
  753. font-size: 12px;
  754. color:rgba(187, 187, 187, 100);
  755. margin-left: 10px;
  756. }
  757. .btnFirst{
  758. line-height: 1.5;
  759. margin: -3.5px;
  760. border: 1px solid rgba(22, 132, 252, 100);
  761. border-right: none;
  762. background: #FFFF;
  763. color: #1684FC;
  764. width: 60px;
  765. height: 30px;
  766. border-radius:4px 0px 0px 4px;
  767. }
  768. .btn{
  769. line-height: 1.5;
  770. margin: -3.5px;
  771. border: 1px solid rgba(22, 132, 252, 100);
  772. border-right: none;
  773. background: #FFFF;
  774. color: #1684FC;
  775. width: 60px;
  776. height: 30px;
  777. }
  778. .btnLast{
  779. line-height: 1.5;
  780. margin: -3.5px;
  781. border: 1px solid rgba(22, 132, 252, 100);
  782. /* border-right: none; */
  783. background: #FFFF;
  784. color: #1684FC;
  785. width: 60px;
  786. height: 30px;
  787. border-radius:0px 4px 4px 0px;
  788. }
  789. .btnFirst, .btn, .btnLast {
  790. cursor: pointer;
  791. }
  792. /deep/ .el-table tbody tr:hover>td {
  793. background-color:#D3D3D3!important;
  794. opacity:1
  795. }
  796. /deep/ .el-table {
  797. font-size: 12px;
  798. }
  799. /deep/ .el-range-separator{
  800. width: 20% !important;
  801. }
  802. /deep/ .el-pagination {
  803. padding-bottom: 30px;
  804. }
  805. .colorChange {
  806. background-color: #1684FC;
  807. color: #FFFF;
  808. cursor: default;
  809. }
  810. .items{
  811. text-align: center;
  812. border-right:1px solid rgba(219, 219, 219, 100);
  813. }
  814. .item_l{
  815. margin-right: 5px;
  816. border:1px solid rgba(219, 219, 219, 100);
  817. height: 370px;
  818. width: 100%;
  819. }
  820. .item_r{
  821. margin-right:5px;
  822. border:1px solid rgba(219, 219, 219, 100);
  823. height: 370px;
  824. overflow:auto
  825. }
  826. .item_echart{
  827. margin-top: 10px;
  828. margin-right: 5px;
  829. border:1px solid rgba(219, 219, 219, 100);
  830. height: 350px;
  831. width: 100%;
  832. }
  833. .item_content{
  834. color:#0366D6;
  835. margin-top: 10px;
  836. font-weight:bold;
  837. }
  838. </style>