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.

ProAnalysis.vue 65 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
3 years ago
3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379
  1. <template>
  2. <div class="el-col el-col-21" style="padding-right:10px " >
  3. <div id = "pro_main">
  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. <bar-label :width="'95%'" :height="'500px'"></bar-label>
  8. <div style="margin-top: 20px;">
  9. <span class="sta_iterm">统计周期:</span>
  10. <button type="button" class='btnFirst' id ="yesterday" v-bind:class="{colorChange:1==dynamic}" @click="resetPage(),getAllProList('yesterday',1)">昨天</button>
  11. <button type="button" class='btn' id = "current_week" v-bind:class="{colorChange:2==dynamic}" @click="resetPage(),getAllProList('current_week',2)">本周</button>
  12. <button type="button" class='btn' id = "current_month" v-bind:class="{colorChange:3==dynamic}" @click="resetPage(),getAllProList('current_month',3)">本月</button>
  13. <button type="button" class='btn' id = "last_month" v-bind:class="{colorChange:4==dynamic}" @click="resetPage(),getAllProList('last_month',4)">上月</button>
  14. <button type="button" class='btn' id = "monthly" v-bind:class="{colorChange:5==dynamic}" @click="resetPage(),getAllProList('monthly',5)">近30天</button>
  15. <button type="button" class='btn' id = "current_year" v-bind:class="{colorChange:6==dynamic}" @click="resetPage(),getAllProList('current_year',6)">今年</button>
  16. <button type="button" class='btnLast' id = "all" v-bind:class="{colorChange:7==dynamic}" @click="resetPage(),getAllProList('all',7)">所有</button>
  17. <span style="margin-left: 20px;">
  18. <el-date-picker
  19. v-model="value_time"
  20. prefix-icon="el-icon-time"
  21. @change="resetPage(),getAllProList('',0)"
  22. type="daterange"
  23. size='small'
  24. range-separator="至"
  25. start-placeholder="开始日期"
  26. end-placeholder="结束日期">
  27. </el-date-picker>
  28. </span>
  29. <span style="float:right; margin-right: 20px;">
  30. <div style="display:inline-block;margin-left: 20px; ">
  31. <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>
  32. <i class="el-icon-download" v-else="tableData=''" href="#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'></i>
  33. <!-- <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> -->
  34. <span >
  35. <a id = "download_file" 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>
  36. <a id = "download_file" v-else="tableData=''" href= "#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'>下载报告</a>
  37. </span>
  38. </div>
  39. <span style="display:inline-block;margin-left: 20px; ">
  40. <el-input size="small" placeholder="输入项目关键字搜索" v-model="search" class="input-with-select" @keyup.enter.native="searchName() "><i slot="suffix" class="el-input__icon el-icon-search" @click="searchName() "></i>
  41. </el-input>
  42. </span>
  43. </span>
  44. </div>
  45. <div style="margin-top: 30px;">
  46. <el-table
  47. :data="tableData"
  48. style="width: 100%"
  49. :header-cell-style="tableHeaderStyle"
  50. :cell-style='cellStyle'>
  51. <el-table-column
  52. label="ID"
  53. align="left"
  54. prop="repo_id"
  55. stripe
  56. >
  57. </el-table-column>
  58. <el-table-column
  59. fixed
  60. label="项目名称中文"
  61. align="left"
  62. prop="name"
  63. v-if='0'
  64. >
  65. </el-table-column>
  66. <el-table-column
  67. label="项目名称"
  68. width="125px"
  69. align="left"
  70. prop="alias"
  71. style="color:#0366D6;font-family: Roboto"
  72. >
  73. <template slot-scope="scope">
  74. <a @click=goToDetailPage(scope.row.repo_id,scope.row.name,scope.row.ownerName,scope.row.alias)>{{scope.row.alias}} </a>
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. label="拥有者"
  79. align="center"
  80. prop="ownerName"
  81. stripe
  82. >
  83. </el-table-column>
  84. <el-table-column
  85. prop="isPrivate"
  86. label="私有"
  87. align="center">
  88. <template slot-scope="scope">
  89. {{scope.row.isPrivate|changeType}}
  90. </template>
  91. </el-table-column>
  92. <el-table-column
  93. prop="openi"
  94. label="OpenI指数"
  95. align="center">
  96. <template slot-scope="scope">
  97. {{scope.row.openi | rounding}}
  98. </template>
  99. </el-table-column>
  100. <el-table-column
  101. prop="view"
  102. label="浏览量"
  103. align="center">
  104. </el-table-column>
  105. <el-table-column
  106. prop="download"
  107. label="代码下载量"
  108. align="center">
  109. </el-table-column>
  110. <el-table-column
  111. prop="pr"
  112. label="PR"
  113. align="center">
  114. </el-table-column>
  115. <el-table-column
  116. prop="commit"
  117. label="Commit数"
  118. align="center">
  119. </el-table-column>
  120. <el-table-column
  121. prop="watch"
  122. label="关注数"
  123. align="center">
  124. </el-table-column>
  125. <el-table-column
  126. prop="star"
  127. label="点赞数"
  128. align="center">
  129. </el-table-column>
  130. <el-table-column
  131. prop="fork"
  132. label="派生数"
  133. align="center">
  134. </el-table-column>
  135. <el-table-column
  136. prop="issue"
  137. label="任务数"
  138. align="center">
  139. </el-table-column>
  140. <el-table-column
  141. prop="issueClosed"
  142. label="已解决任务"
  143. align="center">
  144. </el-table-column>
  145. <el-table-column
  146. prop="contributor"
  147. label="贡献者数"
  148. align="center">
  149. </el-table-column>
  150. <el-table-column
  151. prop="isFork"
  152. label="派生"
  153. align="center">
  154. <template slot-scope="scope">
  155. {{scope.row.isFork|changeType}}
  156. </template>
  157. </el-table-column>
  158. <el-table-column
  159. prop="isMirror"
  160. label="镜像"
  161. align="center">
  162. <template slot-scope="scope">
  163. {{scope.row.isMirror|changeType}}
  164. </template>
  165. </el-table-column>
  166. <el-table-column
  167. prop="createUnix"
  168. label="项目创建时间"
  169. width="120px"
  170. align="center">
  171. <template slot-scope="scope">
  172. {{scope.row.createUnix|transformTimestamp}}
  173. </template>
  174. </el-table-column>
  175. </el-table>
  176. </div>
  177. <div style="margin-top:50px;text-align:center">
  178. <el-pagination
  179. background
  180. @size-change="handleSizeChange"
  181. @current-change="handleCurrentChange"
  182. :current-page="page"
  183. :page-size="pageSize"
  184. :page-sizes="[5,10,20]"
  185. layout="total, sizes,prev, pager, next,jumper"
  186. :total="totalNum">
  187. </el-pagination>
  188. </div>
  189. </div>
  190. <div id ="pro_detail" style="display:none;width: 100%;">
  191. <div style="margin-top: 10px;">
  192. <a class="pro_item" :href="'../../../'+this.ownerName+'/'+this.pro_name">{{this.ownerName}}&nbsp/&nbsp{{this.alias}}</a> <span class="update_time">数据更新时间:</span><span style="font-size: 12px;">{{tableDataIDTotal.lastUpdatedTime}}&nbsp/&nbsp从{{tableDataIDTotal.recordBeginTime}}开始统计</span>
  193. </div>
  194. <div style="margin-top: 10px;">
  195. 项目描述:{{tableDataIDTotal.description | discriptionFun}}
  196. </div>
  197. <div style="margin-top:20px">
  198. <el-row >
  199. <el-col :span='4' class="items">
  200. <el-row>项目创建时间 </el-row>
  201. <el-row class="item_content">{{tableDataIDTotal.creatTime}}</el-row>
  202. </el-col>
  203. <el-col :span='4' class="items">
  204. <el-row>OpenI指数</el-row>
  205. <el-row class="item_content">{{tableDataIDTotal.openi | rounding}}</el-row>
  206. </el-col>
  207. <el-col :span='4' class="items">
  208. <el-row>评论数 </el-row>
  209. <el-row class="item_content">{{tableDataIDTotal.comment}}</el-row>
  210. </el-col>
  211. <el-col :span='4' class="items">
  212. <el-row>浏览量 </el-row>
  213. <el-row class="item_content">{{tableDataIDTotal.view}}</el-row>
  214. </el-col>
  215. <el-col :span='4' class="items">
  216. <el-row>代码下载量</el-row>
  217. <el-row class="item_content">{{tableDataIDTotal.download}}</el-row>
  218. </el-col>
  219. <el-col :span='4' style="text-align: center;">
  220. <el-row>任务完成比例</el-row>
  221. <el-row class="item_content">{{Math.round(tableDataIDTotal.issueClosedRatio * 100) }}%</el-row>
  222. </el-col>
  223. </el-row>
  224. </div>
  225. <div style="margin-top:30px;">
  226. <el-row :gutter="20">
  227. <el-col :span=18 >
  228. <div class="item_l" id="charts">
  229. <div style="font-size:14px;color:#0366D6;margin:20px 5px;">OpenI指数:{{tableDataIDTotal.openi | rounding}}</div>
  230. <div >
  231. <el-col :span='8' id="radar_openi" :style="{ height: '300px'}"></el-col>
  232. <el-col :span='16' id="line_openi" :style="{ height: '300px',float:'right'}"></el-col>
  233. </div>
  234. </div>
  235. </el-col>
  236. <el-col :span=6 >
  237. <div class="item_r">
  238. <div style="margin:0 5px;">
  239. <div style="font-size:14px;color:rgb(0,0,0);margin:10px 5px">贡献者TOP10</div>
  240. <div>
  241. <el-table
  242. :data="tableDataContTop10"
  243. style="width: 100%"
  244. stripe
  245. :header-cell-style="tableHeaderStyle"
  246. >
  247. <el-table-column
  248. label="用户名"
  249. align="left"
  250. prop="user">
  251. <template slot-scope="scope">
  252. <a v-if="scope.row.relAvatarLink!=''" :href="AppSubUrl +'../../../'+ scope.row.user"><img class="ui avatar s16 image js-popover-card" :src="scope.row.relAvatarLink">{{scope.row.user}} </a>
  253. <a v-else :href="'mailto:'+ scope.row.email "> <img class="ui avatar s16 image js-popover-card" :avatar="scope.row.email"> {{scope.row.user}}</a>
  254. </template>
  255. </el-table-column>
  256. <el-table-column
  257. label="身份"
  258. align="center"
  259. prop="mode"
  260. v-if='0'>
  261. <template slot-scope="scope">
  262. {{scope.row.mode | showMode}}
  263. </template>
  264. </el-table-column>
  265. <el-table-column
  266. prop="pr"
  267. label="PR"
  268. width="50px"
  269. align="center">
  270. </el-table-column>
  271. <el-table-column
  272. prop="commit"
  273. label="commit"
  274. align="center">
  275. </el-table-column>
  276. </el-table>
  277. </div>
  278. </div>
  279. </div>
  280. </el-col>
  281. </el-row>
  282. </div>
  283. <div style="margin-top: 20px;">
  284. <span class="sta_iterm">统计周期:</span>
  285. <button type="button" class='btnFirst' id ="yesterday_pro" v-bind:class="{colorChange:1==dynamic_pro}" @click="resetCurrentPage(),getOneProList(pro_id,'yesterday',false,1)">昨天</button>
  286. <button type="button" class='btn' id = "current_week_pro" v-bind:class="{colorChange:2==dynamic_pro}" @click="resetCurrentPage(),getOneProList(pro_id,'current_week',false,2)">本周</button>
  287. <button type="button" class='btn' id = "current_month_pro" v-bind:class="{colorChange:3==dynamic_pro}" @click="resetCurrentPage(),getOneProList(pro_id,'current_month',false,3)">本月</button>
  288. <button type="button" class='btn' id = "last_month_pro" v-bind:class="{colorChange:4==dynamic_pro}" @click="resetCurrentPage(),getOneProList(pro_id,'last_month',false,4)">上月</button>
  289. <button type="button" class='btn' id = "monthly_pro" v-bind:class="{colorChange:5==dynamic_pro}" @click="resetCurrentPage(),getOneProList(pro_id,'monthly',false,5)">近30天</button>
  290. <button type="button" class='btn' id = "current_year_pro" v-bind:class="{colorChange:6==dynamic_pro}" @click="resetCurrentPage(),getOneProList(pro_id,'current_year',false,6)">今年</button>
  291. <button type="button" class='btnLast' id = "all_pro" v-bind:class="{colorChange:7==dynamic_pro}" @click="resetCurrentPage(),getOneProList(pro_id,'all',false,7)">所有</button>
  292. <span style="margin-left: 20px;">
  293. <el-date-picker
  294. v-model="create_time_pro"
  295. prefix-icon="el-icon-time"
  296. @change="resetCurrentPage(),getOneProList(pro_id,'',false,0),clickCheckBox"
  297. type="daterange"
  298. size='small'
  299. range-separator="至"
  300. start-placeholder="开始日期"
  301. end-placeholder="结束日期">
  302. </el-date-picker>
  303. </span>
  304. <span style="float:right; margin-right: 20px;">
  305. <div style="display:inline-block;margin-left: 20px;">
  306. <a v-if="tableDataID!=''" @click="exportData()" class="el-icon-download"></a>
  307. <a v-else="tableDataID=''" @click="exportData()" style="color:rgba(187, 187, 187, 100);" class="el-icon-download"></a>
  308. <span >
  309. <a v-if="tableDataID!=''" @click="exportData()">下载报告</a>
  310. <a v-else="tableDataID=''" @click="exportData()" style="color:rgba(187, 187, 187, 100);">下载报告</a>
  311. </span>
  312. </div>
  313. </span>
  314. </div>
  315. <div class="item_echart" id ='linecharts'>
  316. <div style="margin-top:10px;margin-left: 5px;">
  317. <label for="label" @change='clickCheckBox'>
  318. <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="浏览量"/>浏览量
  319. <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="下载量"/>下载量
  320. <input type="checkbox" class="checkboxchart" name="checkboxchart" checked="checked" value="commit"/>commit
  321. </label>
  322. </div>
  323. <div id ="selectData" style="height: 300px;">
  324. </div>
  325. </div>
  326. <div style="margin-top: 30px;">
  327. <el-table
  328. :data="tableDataID.slice((currentPage-1)*pageSize1,currentPage*pageSize1)"
  329. style="width: 100%"
  330. :header-cell-style="tableHeaderStyle"
  331. :cell-style='cellStyle'>
  332. <el-table-column
  333. label="日期"
  334. align="center"
  335. prop="date"
  336. stripe
  337. >
  338. </el-table-column>
  339. <el-table-column
  340. label="浏览量"
  341. align="center"
  342. prop="view">
  343. </el-table-column>
  344. <el-table-column
  345. prop="download"
  346. label="下载量"
  347. align="center">
  348. </el-table-column>
  349. <el-table-column
  350. prop="commit"
  351. label="commit"
  352. align="center">
  353. </el-table-column>
  354. </el-table>
  355. </div>
  356. <div style="margin-top:50px;text-align:center">
  357. <el-pagination
  358. background
  359. @size-change="handleSizeChangeID"
  360. @current-change="handleCurrentChangeID"
  361. :current-page="currentPage"
  362. :page-size="pageSize1"
  363. :page-sizes="[5,10,20]"
  364. layout="total, sizes,prev, pager, next,jumper"
  365. :total="tableDataID.length">
  366. </el-pagination>
  367. </div>
  368. </div>
  369. </div>
  370. </template>
  371. <script>
  372. // import barLabel from './basic/barLabel.vue';
  373. const {AppSubUrl, StaticUrlPrefix, csrf} = window.config;
  374. import { export2Excel } from '../excel/util.js'
  375. export default{
  376. name:'ProAnalysis',
  377. components: {
  378. // barLabel,
  379. },
  380. data() {
  381. return {
  382. recordBeginTime:'',
  383. lastUpdatedTime:'',
  384. page:1,
  385. pageSize:10,
  386. params:{type:'all',page:1,pagesize:10,beginTime:'',endTime:'',q:'',sort:'openi'},
  387. tableData: [],
  388. totalPage:0,
  389. totalNum:0,
  390. pickerOptions: {
  391. },
  392. value_time: '',
  393. search:'',
  394. dynamic:7,
  395. //单个项目参数
  396. columns: [{title: '日期',key: 'date'},{title: '浏览量',key: 'view'},{title: '下载量',key: 'download'},{title: 'commit',key: 'commit'}],
  397. currentPage:1,
  398. pageSize1:10,
  399. paramsID:{type:'all' ,beginTime:'',endTime:'',openi:'false'},
  400. tableDataIDTotal: [],
  401. tableDataID: [],
  402. tableDataIDOpenI:[],
  403. tableDataContTop10:[],
  404. create_time_pro: '',
  405. dynamic_pro:7,
  406. pro_name:'',
  407. alias:'',
  408. pro_id:'',
  409. ownerName:'',
  410. radarOpenI:'',
  411. echartsOITd:'',
  412. echartsSelectData:'',
  413. option:'',
  414. };
  415. },
  416. methods: {
  417. // download_file(){
  418. // this.params.type='all'
  419. // },
  420. popMark(){
  421. alert("数据为空时,不能下载!")
  422. },
  423. exportData(){
  424. // this.getOneProList(this.pro_id,'all',true,7)
  425. // this.getOneProList(this.pro_id,'all',false,7)
  426. // this.fileName()
  427. if (this.tableDataID!=''){
  428. this.currentPage=1
  429. var saveFileName = this.getFileName()
  430. export2Excel(this.columns,this.tableDataID,saveFileName)
  431. }else{
  432. alert("数据为空时,不能下载!")
  433. }
  434. },
  435. getFileName(){
  436. var now = new Date(); // 当前日期
  437. var nowDayOfWeek = now.getDay(); // 今天本周的第几天
  438. var nowDay = now.getDate(); // 当前日
  439. var nowMonth = now.getMonth(); // 当前月
  440. var nowYear = now.getFullYear(); // 当前年
  441. var today = this.saveFormatDate(nowYear,nowMonth+1,nowDay);
  442. var tmp = new Date(now.setTime(now.getTime()-24*60*60*1000));
  443. var yesterday = this.saveFormatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate());
  444. var yesterday_tmp = this.formatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate())
  445. var startDate=''
  446. var endDate=''
  447. var saveFileName = ''
  448. if (typeof this.paramsID.type=="undefined" || this.paramsID.type=="null" || this.paramsID.type==""){
  449. // startDate= this.saveFormatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate());
  450. endDate = this.saveFormatDate(this.create_time_pro[1].getFullYear(),this.create_time_pro[1].getMonth() + 1,this.create_time_pro[1].getDate());
  451. var tmp = this.formatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate())
  452. startDate = this.comparedate(tmp,this.recordBeginTime)
  453. console.log("comparedate:"+startDate)
  454. saveFileName = this.alias+"_"+startDate+'_'+endDate
  455. }else{
  456. switch(this.paramsID.type){
  457. case "yesterday":{
  458. startDate = this.comparedate(yesterday_tmp,this.recordBeginTime)
  459. endDate = startDate
  460. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  461. break
  462. }
  463. case "current_week":{
  464. var now = new Date(); // 当前日期
  465. var nowDayOfWeek = now.getDay(); // 今天本周的第几天
  466. var day = nowDayOfWeek || 7;
  467. startDate = this.formatDate(now.getFullYear(), nowMonth+1, nowDay + 1 - day);
  468. startDate = this.comparedate(startDate,this.recordBeginTime)
  469. endDate = yesterday
  470. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  471. break
  472. }
  473. case "current_month":{
  474. startDate = this.formatDate(nowYear,nowMonth+1,1);
  475. startDate = this.comparedate(startDate,this.recordBeginTime)
  476. endDate = yesterday
  477. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  478. break
  479. }
  480. case "last_month":{
  481. let lastMonthDate = new Date(); // 上月日期
  482. lastMonthDate.setDate(1);
  483. lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
  484. let lastYear = lastMonthDate.getFullYear();
  485. let lastMonth = lastMonthDate.getMonth();
  486. startDate=this.formatDate(lastYear, lastMonth+1, 1);
  487. startDate = this.comparedate(startDate,this.recordBeginTime)
  488. var monthStartDate = new Date(lastYear, lastMonth, 1);
  489. var monthEndDate = new Date(lastYear, lastMonth+1, 1);
  490. var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24)
  491. endDate=this.saveFormatDate(lastYear, lastMonth+1, days); //月份从0开始,所以+1保存月份
  492. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  493. break
  494. }
  495. case "monthly":{
  496. var temp=new Date(now - 1000 * 60 * 60 * 24 * 30)
  497. startDate = this.formatDate(temp.getFullYear(),temp.getMonth()+1,temp.getDate());
  498. startDate = this.comparedate(startDate,this.recordBeginTime)
  499. endDate = yesterday
  500. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  501. break
  502. }
  503. case "current_year":{
  504. startDate = this.formatDate(now.getFullYear(), 1, 1);
  505. startDate = this.comparedate(startDate,this.recordBeginTime)
  506. endDate = yesterday
  507. saveFileName = this.alias+"_"+startDate+'_'+ endDate
  508. break
  509. }
  510. case "all":{
  511. console.log("e:"+today)
  512. startDate = 'all'
  513. endDate = yesterday
  514. saveFileName = this.alias+'_所有'
  515. break
  516. }
  517. }
  518. }
  519. return saveFileName
  520. },
  521. resetPage(){
  522. this.page=1
  523. this.params.page = 1
  524. },
  525. resetCurrentPage(){
  526. this.currentPage=1
  527. },
  528. handleSizeChange(val){
  529. this.params.pagesize = val
  530. this.resetPage()
  531. this.getAllProList(this.params.type, this.dynamic)
  532. },
  533. handleCurrentChange(val){
  534. console.log(val)
  535. this.params.page = val
  536. this.page = val
  537. switch(this.params.type){
  538. case "yesterday":{
  539. this.value_time=''
  540. this.getAllProList(this.params.type,1)
  541. break
  542. }
  543. case "current_week":{
  544. this.value_time=''
  545. this.getAllProList(this.params.type,2)
  546. break
  547. }
  548. case "current_month":{
  549. this.value_time=''
  550. this.getAllProList(this.params.type,3)
  551. break
  552. }
  553. case "last_month":{
  554. this.value_time=''
  555. this.getAllProList(this.params.type,4)
  556. break
  557. }
  558. case "monthly":{
  559. this.value_time=''
  560. this.getAllProList(this.params.type,5)
  561. break
  562. }
  563. case "current_year":{
  564. this.value_time=''
  565. this.getAllProList(this.params.type,6)
  566. break
  567. }
  568. case "all":{
  569. this.value_time=''
  570. this.getAllProList(this.params.type,7)
  571. break
  572. }
  573. case "":{
  574. // this.value_time=''
  575. this.getAllProList(this.params.type,0)
  576. break
  577. }
  578. }
  579. },
  580. saveFormatDate(myyear,mymonth,myweekday) {
  581. // var myyear = this.date.getFullYear();
  582. // var mymonth = this.date.getMonth() + 1;
  583. // var myweekday = this.date.getDate();
  584. if (mymonth < 10) {
  585. mymonth = "0" + mymonth;
  586. }
  587. if (myweekday < 10) {
  588. myweekday = "0" + myweekday;
  589. }
  590. console.log((myyear +''+ mymonth +''+ myweekday))
  591. return (myyear +''+ mymonth +''+ myweekday);
  592. },
  593. formatDate(myyear,mymonth,myweekday) {
  594. // var myyear = this.date.getFullYear();
  595. // var mymonth = this.date.getMonth() + 1;
  596. // var myweekday = this.date.getDate();
  597. if (mymonth < 10) {
  598. mymonth = "0" + mymonth;
  599. }
  600. if (myweekday < 10) {
  601. myweekday = "0" + myweekday;
  602. }
  603. return (myyear +'-'+ mymonth +'-'+ myweekday);
  604. },
  605. //获得某月的天数
  606. getAllProList(type_val,index){
  607. // console.log("类型:"+type_val)
  608. this.dynamic = index
  609. if (typeof type_val=="undefined" || type_val=="null" || type_val==""){
  610. this.params.type=''
  611. this.params.beginTime=this.formatDate(this.value_time[0].getFullYear(),this.value_time[0].getMonth() + 1,this.value_time[0].getDate())
  612. this.params.endTime=this.formatDate(this.value_time[1].getFullYear(),this.value_time[1].getMonth() + 1,this.value_time[1].getDate())
  613. }else{
  614. this.params.type=type_val
  615. this.params.beginTime=''
  616. this.params.endTime=''
  617. this.value_time=[]
  618. }
  619. this.$axios.get('../../api/v1/projectboard/project',{
  620. params:this.params
  621. }).then((res)=>{
  622. this.recordBeginTime=res.data.recordBeginTime
  623. this.lastUpdatedTime=res.data.lastUpdatedTime
  624. this.tableData = res.data.pageRecords
  625. this.totalPage=res.data.totalPage
  626. this.totalNum = res.data.totalCount//this.totalPage*this.params.pagesize
  627. // console.log("this.totalPage:"+this.totalPage)
  628. })
  629. },
  630. searchName(){
  631. this.params.q = this.search
  632. this.params.page = 1
  633. this.page=1
  634. this.getAllProList(this.params.type, this.dynamic)
  635. },
  636. goToDetailPage(pro_id,pro_name,ownerName,alias){
  637. this.currentPage=1
  638. document.getElementById("pro_main").style.display="none";
  639. document.getElementById("pro_detail").style.display="block";
  640. // console.log(pro_id)
  641. // console.log(pro_name)
  642. this.pro_name=pro_name;
  643. this.alias=alias;
  644. this.pro_id=pro_id;
  645. this.ownerName=ownerName
  646. this.getOneProData(pro_id);
  647. this.getOneProList(pro_id,"current_year",true,0);
  648. this.getOneProList(pro_id,"monthly",false,5);
  649. },
  650. tableHeaderStyle({row,column,rowIndex,columnIndex}){
  651. if(rowIndex===0){
  652. return 'background:#f5f5f6;color:#606266'
  653. }
  654. },
  655. cellStyle({row,column,rowIndex,columnIndex}){
  656. if(rowIndex%2 === 1){
  657. return 'background:#f5f5f6;color:#606266'
  658. }
  659. },
  660. handleSizeChangeID(val){
  661. this.pageSize1=val
  662. },
  663. handleCurrentChangeID(currentPage){
  664. this.currentPage = currentPage;
  665. },
  666. getOneProData(pro_id){
  667. this.$axios.get('../../api/v1/projectboard/project/'+pro_id,{
  668. }).then((res)=>{
  669. this.tableDataIDTotal = res.data
  670. this.tableDataContTop10=res.data.top10
  671. // this.drawLine()
  672. this.drawRadarOpenI()
  673. })
  674. },
  675. getOneProList(pro_id,type_val,bool_val,index){
  676. this.dynamic_pro=index
  677. // console.log("日期类型:"+type_val)
  678. if (typeof type_val=="undefined" || type_val=="null" || type_val==""){
  679. this.paramsID.type=''
  680. this.paramsID.beginTime= this.formatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate())
  681. this.paramsID.endTime=this.formatDate(this.create_time_pro[1].getFullYear(),this.create_time_pro[1].getMonth() + 1,this.create_time_pro[1].getDate())
  682. }else{
  683. this.create_time_pro=[]
  684. this.paramsID.type=type_val
  685. this.paramsID.beginTime=''
  686. this.paramsID.endTime=''
  687. }
  688. this.paramsID.openi=bool_val
  689. this.$axios.get('../../api/v1/projectboard/project/'+pro_id+"/period",{
  690. params:this.paramsID
  691. }).then((res)=>{
  692. if (bool_val){
  693. this.tableDataIDOpenI = res.data
  694. this.drawOpenItrend()
  695. }else{
  696. this.tableDataID = res.data
  697. this.drawSelectData()
  698. }
  699. })
  700. },
  701. drawRadarOpenI(){
  702. var ydata = [this.roundingF(this.tableDataIDTotal.impact),this.roundingF(this.tableDataIDTotal.completeness),this.roundingF(this.tableDataIDTotal.liveness),this.roundingF(this.tableDataIDTotal.projectHealth),this.roundingF(this.tableDataIDTotal.teamHealth),this.roundingF(this.tableDataIDTotal.growth)]
  703. console.log("ydata:",ydata)
  704. var i = -1;
  705. var option = {
  706. titile:{
  707. text:""
  708. },
  709. tooltip: {
  710. trigger: 'item',
  711. backgroundColor:'rgba(255,255,255,0.8)',
  712. color:'black',
  713. borderWidth:'1',
  714. borderColor:'gray',
  715. textStyle:{
  716. color:'black'
  717. },
  718. position: 'right',
  719. // formatter: function (params) {
  720. // console.log('params:',params)
  721. // console.log('params.data:',params[0])
  722. // let str = params.data.name + "<br />";
  723. // params.data.forEach((item) => {
  724. // str +=
  725. // '<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:'+params.color+'"></span>' + item.seriesName + " : " + '<span style="float:right">'+item.data[1] +'</span>'+ "<br />";
  726. // });
  727. // return str;
  728. // },
  729. // formatter: function (params, ticket, callback) {
  730. // console.log(params);
  731. // var showHtm="";
  732. // var data = params.data.value
  733. // for(var i=0;i<data.length;i++){
  734. // //x轴名称
  735. // var name = data[i];
  736. // //值
  737. // var value = params[i][2];
  738. // showHtm+= text+ '--' + name + ' :' + value+'<br>'
  739. // }
  740. // return showHtm;
  741. // }
  742. },//提示层
  743. legend: {
  744. // data: ['']
  745. },
  746. radar: {
  747. name: {
  748. textStyle: {
  749. color: 'rgb(0,0,0)', //字体颜色
  750. borderRadius: 3, //圆角
  751. padding: [3, 5] //padding
  752. }
  753. },
  754. slpitNumber:5,
  755. center: ['50%', '50%'],
  756. splitArea: { // 坐标轴在 grid 区域中的分隔区域
  757. show: false,
  758. },
  759. indicator: [{
  760. name: '社区影响力',
  761. max: 100
  762. },
  763. {
  764. name: '项目成熟度',
  765. max: 100
  766. },
  767. {
  768. name: '开发活跃度',
  769. max: 100
  770. },
  771. {
  772. name: '项目健康度',
  773. max: 100
  774. },
  775. {
  776. name: '团队健康度',
  777. max: 100
  778. },
  779. {
  780. name: '项目发展趋势',
  781. max: 100
  782. }
  783. ],
  784. },
  785. series: [{
  786. type: 'radar',
  787. lineStyle:{
  788. width:2,
  789. color: '#0366D6',
  790. normal:{
  791. color:'#0366D6 '
  792. }
  793. },
  794. itemStyle : {
  795. normal : {
  796. color:'#0366D6'
  797. }
  798. },
  799. data: [{
  800. value: ydata,
  801. name:"数据"
  802. }]
  803. }]
  804. }
  805. this.radarOpenI.setOption(option)
  806. },
  807. drawOpenItrend(){
  808. var xdata_openI=[]
  809. var ydata_openI=[]
  810. for(var i =0;i<this.tableDataIDOpenI.length;i++){
  811. xdata_openI.push(this.tableDataIDOpenI[i].date);
  812. ydata_openI.push(this.roundingF(this.tableDataIDOpenI[i].openi))
  813. }
  814. console.log("ydata_openI:"+ydata_openI)
  815. console.log(xdata_openI)
  816. var option = {
  817. title : {
  818. text: 'OpenI指数趋势',
  819. textStyle: {
  820.                 fontSize: 12,
  821.             },
  822. left:'center',
  823. top:'bottom',
  824. subtext: '',
  825. },
  826. tooltip : {
  827. trigger: 'axis',
  828. backgroundColor:'rgba(255,255,255,0.8)',
  829. color:'black',
  830. borderWidth:'1',
  831. borderColor:'#DCE7FB',
  832. textStyle:{
  833. color:'black'
  834. },
  835. },
  836. legend: {
  837. orient: 'vertical',
  838. top:'top',  
  839. },
  840. // calculable : true,
  841. xAxis : [
  842. {
  843. type : 'category',
  844. boundaryGap: false,
  845. data : xdata_openI,
  846. axisLine: {
  847. show: false, //x轴线消失
  848. },
  849. axisTick:{
  850. show:false//刻度隐藏
  851. }
  852. }
  853. ],
  854. yAxis : [
  855. {
  856. type : 'value',
  857. axisLine: {
  858. show: false, //x轴线消失
  859. },
  860. axisTick:{
  861. show:false//刻度隐藏
  862. }
  863. }
  864. ],
  865. series : [
  866. {
  867. data: ydata_openI,
  868. type: 'line',
  869. areaStyle: {
  870. type:'linear',
  871. color:'#DCE7FB',
  872. opacity: 0.3,
  873. origin:"start",
  874. normal:{
  875. color:'#DCE7FB'
  876. }
  877. },
  878. lineStyle:{
  879. width:1,
  880. normal:{
  881. color:'#0366D6'
  882. }
  883. },
  884. itemStyle : {
  885. normal : {
  886. color:'#0366D6'
  887. }
  888. },
  889. }
  890. ]
  891. };
  892. this.echartsOITd.setOption(option)
  893. // setTimeout(function (){
  894. // window.onresize = function () {
  895. // this.echartsOITd.resize();
  896. // }
  897. // },200)
  898. },
  899. drawSelectData(){
  900. // $("#selectData").removeAttr("selectData").empty();
  901. var xdata=[]
  902. var ydata_view=[]
  903. var ydata_download=[]
  904. var ydata_commit=[]
  905. // if ()
  906. for(var i =0;i<this.tableDataID.length;i++){
  907. xdata.push(this.tableDataID[this.tableDataID.length-1-i].date);
  908. ydata_view.push(this.tableDataID[this.tableDataID.length-1-i].view)
  909. ydata_download.push(this.tableDataID[this.tableDataID.length-1-i].download)
  910. ydata_commit.push(this.tableDataID[this.tableDataID.length-1-i].commit)
  911. }
  912. console.log("ydata_openI:"+ydata_download)
  913. console.log(xdata)
  914. this.option = {
  915. title : {
  916. text: '',
  917. textStyle: {
  918.                 fontSize: 12,
  919.             },
  920. left:'center',
  921. top:'bottom',
  922. subtext: '',
  923. },
  924. tooltip : {
  925. trigger: 'axis',
  926. backgroundColor:'rgba(255,255,255,0.8)',
  927. color:'black',
  928. borderWidth:'1',
  929. borderColor:'gray',
  930. textStyle:{
  931. color:'black'
  932. },
  933. },
  934. legend: {
  935. data:['浏览量','下载量','commit'],
  936. selected:{
  937. // '浏览量':true,
  938. // '下载量':true,
  939. // 'commit':true,
  940. }
  941. // orient: 'vertical',
  942. // top:'top',  
  943. },
  944. toolbox: {
  945. show : false,
  946. feature : {
  947. mark : {show: true},
  948. dataView : {show: false, readOnly: false},
  949. magicType : {show: true, type: ['line', 'bar']},
  950. restore : {show: false},
  951. saveAsImage : {show: true}
  952. }
  953. },
  954. calculable : true,
  955. xAxis : [
  956. {
  957. type : 'category',
  958. data : xdata,
  959. axisLine: {
  960. show: false, //x轴线消失
  961. },
  962. axisTick:{
  963. show:false//刻度隐藏
  964. }
  965. }
  966. ],
  967. yAxis : [
  968. {
  969. type : 'value',
  970. axisLine: {
  971. show: false, //x轴线消失
  972. },
  973. axisTick:{
  974. show:false//刻度隐藏
  975. }
  976. }
  977. ],
  978. series : [
  979. { name:"浏览量",
  980. data: ydata_view,
  981. type: 'line',
  982. areaStyle: {},
  983. },
  984. {
  985. name:"下载量",
  986. data: ydata_download,
  987. type: 'line',
  988. areaStyle: {},
  989. },
  990. {
  991. name:"commit",
  992. data: ydata_commit,
  993. type: 'line',
  994. areaStyle: {},
  995. },
  996. ]
  997. };
  998. // this.echartsSelectData.resize()
  999. var checkboxs=document.getElementsByName('checkboxchart');
  1000. for(var i=0; i<checkboxs.length; i++){
  1001. // console.log("selectArr[i]:",this.option.legend.data[i])
  1002. if(checkboxs[i].checked){
  1003. this.option.legend.selected[this.option.legend.data[i]]=true;
  1004. }else{
  1005. this.option.legend.selected[this.option.legend.data[i]]=false;
  1006. }
  1007. }
  1008. this.echartsSelectData.setOption(this.option)
  1009. // setTimeout(function (){
  1010. // window.onresize = function () {
  1011. // this.echartsSelectData.resize;
  1012. // }
  1013. // },200)
  1014. // // 使用刚指定的选择项数据显示图表。
  1015. // var selectArr = this.echartsSelectData.getOption().legend[0].data;//legend所有值
  1016. // var checkboxs=document.getElementsByName('checkboxchart');
  1017. // $(".checkboxchart").click(function(){
  1018. // var obj = {};
  1019. // for(var i=0; i<checkboxs.length; i++){
  1020. // if(checkboxs[i].checked){
  1021. // obj[selectArr[i]] = true;
  1022. // }else{
  1023. // obj[selectArr[i]] = false;
  1024. // }
  1025. // }
  1026. // option.legend.selected = obj;
  1027. // this.echartsSelectData.setOption(option);
  1028. // });
  1029. },
  1030. roundingF(value){
  1031. return Number(value).toFixed(2)
  1032. },
  1033. clickCheckBox(){
  1034. // 使用刚指定的选择项数据显示图表。
  1035. var selectArr = this.echartsSelectData.getOption().legend[0].data;//legend所有值
  1036. var checkboxs=document.getElementsByName('checkboxchart');
  1037. // $(".checkboxchart").click(function(){
  1038. var obj = {};
  1039. for(var i=0; i<checkboxs.length; i++){
  1040. if(checkboxs[i].checked){
  1041. obj[selectArr[i]] = true;
  1042. }else{
  1043. obj[selectArr[i]] = false;
  1044. }
  1045. }
  1046. this.option.legend.selected = obj;
  1047. this.echartsSelectData.setOption(this.option);
  1048. // });
  1049. },
  1050. comparedate(date1,date2){
  1051. console.log("date1:"+date1)
  1052. console.log("date1:"+date2)
  1053. var oDate1 = new Date(date1);
  1054. var oDate2 = new Date(date2);
  1055. if(oDate1.getTime() < oDate2.getTime()){
  1056. var data = date2.split('-')
  1057. return data[0]+''+data[1]+''+data[2]
  1058. } else {
  1059. var data = date1.split('-')
  1060. return data[0]+''+data[1]+''+data[2]
  1061. }
  1062. },
  1063. goBack(){
  1064. if( $("#pro_detail").is(':visible') ){
  1065. document.getElementById("pro_main").style.display = "block";
  1066. document.getElementById("pro_detail").style.display = "none";
  1067. }
  1068. },
  1069. },
  1070. filters:{
  1071. rounding (value) {
  1072. return Number(value).toFixed(2)
  1073. },
  1074. changeType(value){
  1075. if(value==false){
  1076. return "否"
  1077. }else{
  1078. return "是"
  1079. }
  1080. },
  1081. discriptionFun(value){
  1082. if(value==''){
  1083. return "暂无描述"
  1084. }
  1085. },
  1086. showMode(value){
  1087. if(value==1){
  1088. return "可读权限"
  1089. }else if(value==2){
  1090. return "可写权限"
  1091. }else if(value==3){
  1092. return "管理员"
  1093. }else if(value==4){
  1094. return "所有者"
  1095. }else{
  1096. return "未定义"
  1097. }
  1098. },
  1099. showContext(value){
  1100. if (value.mode!=-1){
  1101. return " <img class=\"ui avatar image\" src= \" "+ value.RelAvatarLink+ " \" > "+" <a href= \" " + AppSubUrl+"/"+value.user+ "\">"+value.user+" </a>"
  1102. }
  1103. else{
  1104. return " <a href=\" mailto:" + value.email + "class=\"circular ui button\">" +value.user+ "</a>"
  1105. }
  1106. },
  1107. transformTimestamp(timestamp){
  1108. let a = new Date(timestamp*1000);
  1109. const date = new Date(a);
  1110. const Y = date.getFullYear() + '/';
  1111. const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/';
  1112. const D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';
  1113. const h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':';
  1114. const m = (date.getMinutes() <10 ? '0'+date.getMinutes() : date.getMinutes());
  1115. const dateString = Y + M + D + h + m ;//+ s;
  1116. return dateString;
  1117. },
  1118. },
  1119. mounted() {
  1120. this.getAllProList("all",7)
  1121. console.log("id:"+this.pro_id);
  1122. document.getElementById('radar_openi').style.width = document.getElementById('pro_main').offsetWidth*0.22+'px'
  1123. document.getElementById('line_openi').style.width = document.getElementById('pro_main').offsetWidth*0.33+'px'
  1124. document.getElementById('selectData').style.width = document.getElementById('pro_main').offsetWidth*0.8+'px'
  1125. this.radarOpenI = this.$echarts.init(document.getElementById('radar_openi'))
  1126. this.echartsOITd = this.$echarts.init(document.getElementById('line_openi'))
  1127. this.echartsSelectData = this.$echarts.init(document.getElementById('selectData'))
  1128. if (window.history && window.history.pushState) {
  1129. history.pushState(null, null, document.URL);
  1130. window.addEventListener('popstate', this.goBack, false);
  1131. }
  1132. // window.onresize=function(){
  1133. // this.radarOpenI.resize();
  1134. // this.echartsOITd.resize();
  1135. // this.echartsSelectData.resize();
  1136. // }
  1137. // console.log("this.radarOpenI:"+this.radarOpenI)
  1138. },
  1139. watch:{
  1140. search(val){
  1141. if(!val){
  1142. this.params.q = this.search
  1143. this.params.page = 1
  1144. this.page=1
  1145. this.getAllProList(this.params.type, this.dynamic)
  1146. }
  1147. }
  1148. },
  1149. created() {
  1150. // this.download_a=document.getElementById("download_file")
  1151. },
  1152. updated(){
  1153. if(document.querySelectorAll('img[avatar]').length!==0){
  1154. window.LetterAvatar.transform()
  1155. }
  1156. }
  1157. }
  1158. </script>
  1159. <style scoped>
  1160. .pro_item{
  1161. font-size: 16px;
  1162. color: rgba(16, 16, 16, 100);
  1163. font-family: SourceHanSansSC-bold;
  1164. }
  1165. .sta_item{
  1166. font-size: 14px;
  1167. color: rgb(0 0 0);
  1168. font-family: SourceHanSansSC-bold;
  1169. }
  1170. .update_time{
  1171. line-height: 17px;
  1172. font-size: 12px;
  1173. color:rgba(187, 187, 187, 100);
  1174. margin-left: 10px;
  1175. }
  1176. .btnFirst{
  1177. line-height: 1.5;
  1178. margin: -3.5px;
  1179. border: 1px solid rgba(22, 132, 252, 100);
  1180. border-right: none;
  1181. background: #FFFF;
  1182. color: #1684FC;
  1183. width: 60px;
  1184. height: 30px;
  1185. border-radius:4px 0px 0px 4px;
  1186. }
  1187. .btn{
  1188. line-height: 1.5;
  1189. margin: -3.5px;
  1190. border: 1px solid rgba(22, 132, 252, 100);
  1191. border-right: none;
  1192. background: #FFFF;
  1193. color: #1684FC;
  1194. width: 60px;
  1195. height: 30px;
  1196. }
  1197. .btnLast{
  1198. line-height: 1.5;
  1199. margin: -3.5px;
  1200. border: 1px solid rgba(22, 132, 252, 100);
  1201. /* border-right: none; */
  1202. background: #FFFF;
  1203. color: #1684FC;
  1204. width: 60px;
  1205. height: 30px;
  1206. border-radius:0px 4px 4px 0px;
  1207. }
  1208. .btnFirst, .btn, .btnLast {
  1209. cursor: pointer;
  1210. }
  1211. /*
  1212. .btn:focus,
  1213. .btn:active{
  1214. background-color:#409effd6 ;
  1215. } */
  1216. /* /deep/ .el-date-picker {
  1217. width: 250px;
  1218. } */
  1219. /deep/ .el-table tbody tr:hover>td {
  1220. background-color:#D3D3D3!important;
  1221. opacity:1
  1222. }
  1223. /deep/ .el-table {
  1224. font-size: 12px;
  1225. }
  1226. /deep/ .el-range-separator{
  1227. width: 20% !important;
  1228. }
  1229. /deep/ .el-pagination {
  1230. padding-bottom: 30px;
  1231. }
  1232. .colorChange {
  1233. background-color: #1684FC;
  1234. color: #FFFF;
  1235. cursor: default;
  1236. }
  1237. .items{
  1238. text-align: center;
  1239. border-right:1px solid rgba(219, 219, 219, 100);
  1240. }
  1241. .item_l{
  1242. margin-right: 5px;
  1243. border:1px solid rgba(219, 219, 219, 100);
  1244. height: 370px;
  1245. width: 100%;
  1246. }
  1247. .item_r{
  1248. margin-right:5px;
  1249. border:1px solid rgba(219, 219, 219, 100);
  1250. height: 370px;
  1251. overflow:auto
  1252. }
  1253. .item_echart{
  1254. margin-top: 10px;
  1255. margin-right: 5px;
  1256. border:1px solid rgba(219, 219, 219, 100);
  1257. height: 350px;
  1258. width: 100%;
  1259. }
  1260. .item_content{
  1261. color:#0366D6;
  1262. margin-top: 10px;
  1263. font-weight:bold;
  1264. }
  1265. </style>