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 39 kB

3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  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.                                 '新增自建项目':false,
  488.                                 '新增派生项目':false,
  489.                                 '新增镜像项目':false,
  490.                                 '累计项目':false
  491.                             }
  492. // orient: 'vertical',
  493. // top:'top',  
  494. },
  495. toolbox: {
  496. show : false,
  497. feature : {
  498. mark : {show: true},
  499. dataView : {show: false, readOnly: false},
  500. magicType : {show: true, type: ['line', 'bar']},
  501. restore : {show: false},
  502. saveAsImage : {show: true}
  503. }
  504. },
  505. calculable : true,
  506. xAxis : [
  507. {
  508. type : 'category',
  509. data : xdata,
  510. axisLine: {
  511. show: false, //x轴线消失
  512. },
  513. axisTick:{
  514. show:false//刻度隐藏
  515. }
  516. }
  517. ],
  518. yAxis : [
  519. {
  520. type : 'value',
  521. axisLine: {
  522. show: false, //y轴线消失
  523. },
  524. axisTick:{
  525. show:false//刻度隐藏
  526. }
  527. }
  528. ],
  529. series : [
  530. { name:"新增项目",
  531. data: ydata_add_pro,
  532. type: 'line',
  533. areaStyle: {},
  534. itemStyle:{
  535. normal:{
  536. lineStyle:{
  537. color:"#3894FF",
  538. },
  539. color:"#3894FF",
  540. }
  541. },
  542. },
  543. {
  544. name:"新增公开项目",
  545. data: ydata_add_public_pro,
  546. type: 'line',
  547. areaStyle: {},
  548. itemStyle:{
  549. normal:{
  550. lineStyle:{
  551. color:"#67B3BB",
  552. },
  553. color:"#67B3BB",
  554. }
  555. },
  556. },
  557. {
  558. name:"新增私有项目",
  559. data: ydata_add_private_pro,
  560. type: 'line',
  561. areaStyle: {},
  562. itemStyle:{
  563. normal:{
  564. lineStyle:{
  565. color:"#58A55C",
  566. },
  567. color:"#58A55C",
  568. }
  569. },
  570. },
  571. {
  572. name:"新增自建项目",
  573. data: ydata_add_self,
  574. type: 'line',
  575. areaStyle: {},
  576. itemStyle:{
  577. normal:{
  578. lineStyle:{
  579. color:"#F2BD42",
  580. },
  581. color:"#F2BD42",
  582. }
  583. },
  584. },
  585. {
  586. name:"新增派生项目",
  587. data: ydata_add_fork,
  588. type: 'line',
  589. areaStyle: {},
  590. itemStyle:{
  591. normal:{
  592. lineStyle:{
  593. color:"#DAA67B",
  594. },
  595. color:"#DAA67B",
  596. }
  597. },
  598. },
  599. {
  600. name:"新增镜像项目",
  601. data: ydata_add_mirror,
  602. type: 'line',
  603. areaStyle: {},
  604. itemStyle:{
  605. normal:{
  606. lineStyle:{
  607. color:"#2E4552",
  608. },
  609. color:"#2E4552",
  610. }
  611. },
  612. },
  613. {
  614. name:"累计项目",
  615. data: ydata_cumulative_pro,
  616. type: 'line',
  617. areaStyle: {},
  618. itemStyle:{
  619. normal:{
  620. lineStyle:{
  621. color:"#4786B4",
  622. },
  623. color:"#4786B4",
  624. }
  625. },
  626. },
  627. ]
  628. };
  629. // this.echartsSelectData.resize()
  630. this.echartsSelectData.setOption(this.option)
  631. // setTimeout(function (){
  632. // window.onresize = function () {
  633. // this.echartsSelectData.resize;
  634. // }
  635. // },200)
  636. // // 使用刚指定的选择项数据显示图表。
  637. // var selectArr = this.echartsSelectData.getOption().legend[0].data;//legend所有值
  638. // var checkboxs=document.getElementsByName('checkboxchart');
  639. // $(".checkboxchart").click(function(){
  640. // var obj = {};
  641. // for(var i=0; i<checkboxs.length; i++){
  642. // if(checkboxs[i].checked){
  643. // obj[selectArr[i]] = true;
  644. // }else{
  645. // obj[selectArr[i]] = false;
  646. // }
  647. // }
  648. // option.legend.selected = obj;
  649. // this.echartsSelectData.setOption(option);
  650. // });
  651. },
  652. clickCheckBox(){
  653. // 使用刚指定的选择项数据显示图表。
  654. var selectArr = this.echartsSelectData.getOption().legend[0].data;//legend所有值
  655. var checkboxs=document.getElementsByName('checkboxchart');
  656. // $(".checkboxchart").click(function(){
  657. var obj = {};
  658. for(var i=0; i<checkboxs.length; i++){
  659. if(checkboxs[i].checked){
  660. obj[selectArr[i]] = true;
  661. }else{
  662. obj[selectArr[i]] = false;
  663. }
  664. }
  665. this.option.legend.selected = obj;
  666. this.echartsSelectData.setOption(this.option);
  667. // });
  668. },
  669. comparedate(date1,date2){
  670. // console.log("date1:"+date1)
  671. // console.log("date1:"+date2)
  672. var oDate1 = new Date(date1);
  673. var oDate2 = new Date(date2);
  674. if(oDate1.getTime() < oDate2.getTime()){
  675. var data = date2.split('-')
  676. return data[0]+''+data[1]+''+data[2]
  677. } else {
  678. var data = date1.split('-')
  679. return data[0]+''+data[1]+''+data[2]
  680. }
  681. },
  682. },
  683. filters:{
  684. },
  685. mounted() {
  686. this.getPeriodProList("monthly",4);
  687. this.getSummaryPro();
  688. document.getElementById('selectData').style.width = document.getElementById('pro_tend').offsetWidth*0.8+'px'
  689. this.echartsSelectData = this.$echarts.init(document.getElementById('selectData'))
  690. },
  691. watch:{
  692. },
  693. created() {
  694. this.getSummaryPro();
  695. this.getPeriodProList("monthly",4);
  696. },
  697. updated(){
  698. if(document.querySelectorAll('img[avatar]').length!==0){
  699. window.LetterAvatar.transform()
  700. }
  701. }
  702. }
  703. </script>
  704. <style scoped>
  705. .item_list_first{
  706. border-right: 1px solid rgba(219,219,219,100);
  707. padding-right: 10px;
  708. }
  709. .item_list{
  710. border-right: 1px solid rgba(219,219,219,100);
  711. padding:0px 10px;
  712. }
  713. .item_list_p{
  714. border-right: 1px solid rgba(219,219,219,100);
  715. padding:0px 10px;
  716. }
  717. .item_h{
  718. line-height: 40px;
  719. text-align: center;
  720. }
  721. .item_title_h{
  722. line-height: 28px;
  723. text-align: center;
  724. }
  725. .num_color{
  726. color: #0366D6;
  727. font-weight: bold;
  728. }
  729. .pro_item{
  730. font-size: 16px;
  731. color: rgba(16, 16, 16, 100);
  732. font-family: SourceHanSansSC-bold;
  733. }
  734. .sta_item{
  735. font-size: 14px;
  736. color: rgb(0 0 0);
  737. font-family: SourceHanSansSC-bold;
  738. }
  739. .update_time{
  740. line-height: 17px;
  741. font-size: 12px;
  742. color:rgba(187, 187, 187, 100);
  743. margin-left: 10px;
  744. }
  745. .btnFirst{
  746. line-height: 1.5;
  747. margin: -3.5px;
  748. border: 1px solid rgba(22, 132, 252, 100);
  749. border-right: none;
  750. background: #FFFF;
  751. color: #1684FC;
  752. width: 60px;
  753. height: 30px;
  754. border-radius:4px 0px 0px 4px;
  755. }
  756. .btn{
  757. line-height: 1.5;
  758. margin: -3.5px;
  759. border: 1px solid rgba(22, 132, 252, 100);
  760. border-right: none;
  761. background: #FFFF;
  762. color: #1684FC;
  763. width: 60px;
  764. height: 30px;
  765. }
  766. .btnLast{
  767. line-height: 1.5;
  768. margin: -3.5px;
  769. border: 1px solid rgba(22, 132, 252, 100);
  770. /* border-right: none; */
  771. background: #FFFF;
  772. color: #1684FC;
  773. width: 60px;
  774. height: 30px;
  775. border-radius:0px 4px 4px 0px;
  776. }
  777. .btnFirst, .btn, .btnLast {
  778. cursor: pointer;
  779. }
  780. /deep/ .el-table tbody tr:hover>td {
  781. background-color:#D3D3D3!important;
  782. opacity:1
  783. }
  784. /deep/ .el-table {
  785. font-size: 12px;
  786. }
  787. /deep/ .el-range-separator{
  788. width: 20% !important;
  789. }
  790. /deep/ .el-pagination {
  791. padding-bottom: 30px;
  792. }
  793. .colorChange {
  794. background-color: #1684FC;
  795. color: #FFFF;
  796. cursor: default;
  797. }
  798. .items{
  799. text-align: center;
  800. border-right:1px solid rgba(219, 219, 219, 100);
  801. }
  802. .item_l{
  803. margin-right: 5px;
  804. border:1px solid rgba(219, 219, 219, 100);
  805. height: 370px;
  806. width: 100%;
  807. }
  808. .item_r{
  809. margin-right:5px;
  810. border:1px solid rgba(219, 219, 219, 100);
  811. height: 370px;
  812. overflow:auto
  813. }
  814. .item_echart{
  815. margin-top: 10px;
  816. margin-right: 5px;
  817. border:1px solid rgba(219, 219, 219, 100);
  818. height: 350px;
  819. width: 100%;
  820. }
  821. .item_content{
  822. color:#0366D6;
  823. margin-top: 10px;
  824. font-weight:bold;
  825. }
  826. </style>