gatewayNewYearFrom.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <div class="annualLeagueTable">
  3. <el-dialog v-model="dialogVisible" :width="yearWidth()" :close-on-click-modal="false">
  4. <template #header>
  5. <div class="yearHeader">
  6. <span style="font-size:14px;color:#fff">年度排行榜</span>
  7. <el-select v-model="optionName" placeholder="请选择板块" @change="changeOption">
  8. <el-option
  9. v-for="item in optionArr"
  10. :key="item.value"
  11. :label="item.label"
  12. :value="item.value">
  13. </el-option>
  14. </el-select>
  15. </div>
  16. </template>
  17. <el-row class="yearFrom">
  18. <el-col :span="evaluationYearDataRight.length>0?12:24" :style="evaluationYearDataRight.length>0?'border-right: 1px solid #E1E3EA;': ''">
  19. <div class="yearFromHeader">
  20. <div class="headerNameTit" :style="winPix === 1.25?'padding: 8px 45px 8px 20px;':''">
  21. <div class="headerNameTit_left">
  22. <span>排名</span>
  23. <span style="margin-left: 20px">单位名称</span>
  24. </div>
  25. <div class="headerNameTit_right">
  26. <span>级别</span>
  27. <span style="margin-left: 20px">得分</span>
  28. </div>
  29. </div>
  30. </div>
  31. <div style="display: flex" v-for="(item, index) in evaluationYearDataLeft" :key="index">
  32. <div class="yearFromMsg">
  33. <div class="msgProgress">
  34. <span :style="rankStyle()">{{item.rank}}</span>
  35. <span :style="companyStyle()">{{item.company}}</span>
  36. <span>{{item.grade}}</span>
  37. <span :style="winPix === 1.25 || innerWidth < 1920?'width:20%':''">{{item.score}}</span>
  38. </div>
  39. </div>
  40. </div>
  41. </el-col>
  42. <el-col :span="12" v-if="evaluationYearDataRight.length>0">
  43. <div class="yearFromHeader">
  44. <div class="headerNameTit" :style="winPix === 1.25 || innerWidth < 1920?'padding: 8px 45px 8px 20px;':''">
  45. <div class="headerNameTit_left">
  46. <span>排名</span>
  47. <span style="margin-left: 20px">单位名称</span>
  48. </div>
  49. <div class="headerNameTit_right">
  50. <span>级别</span>
  51. <span style="margin-left: 20px">得分</span>
  52. </div>
  53. </div>
  54. </div>
  55. <div style="display: flex" v-for="(item, index) in evaluationYearDataRight" :key="index">
  56. <div class="yearFromMsg">
  57. <div class="msgProgress">
  58. <span :style="rankStyle()">{{item.rank}}</span>
  59. <span :style="companyStyle()">{{item.company}}</span>
  60. <span>{{item.grade}}</span>
  61. <span :style="winPix === 1.25 || innerWidth < 1920?'width:20%':''">{{item.score}}</span>
  62. </div>
  63. </div>
  64. </div>
  65. </el-col>
  66. </el-row>
  67. </el-dialog>
  68. </div>
  69. </template>
  70. <script>
  71. import {apiGetevaluationportallist} from '../../api/api'
  72. export default {
  73. data() {
  74. return {
  75. dialogVisible: false,
  76. evaluationYearDataLeft: [],
  77. evaluationYearDataRight: [],
  78. optionArr: [],
  79. optionName: '',
  80. yearData: '',
  81. seasonData: '',
  82. winPix: window.devicePixelRatio,
  83. innerWidth: window.innerWidth
  84. }
  85. },
  86. created() {
  87. this.optionArr = [
  88. {
  89. label: '火电板块',
  90. value: 'HD'
  91. },
  92. {
  93. label: '水电板块',
  94. value: 'SD'
  95. },
  96. {
  97. label: '新能源',
  98. value: 'XNYFG'
  99. },
  100. {
  101. label: '海外业务',
  102. value: 'GJYW'
  103. },
  104. {
  105. label: '煤电一体化',
  106. value: 'MDYTH'
  107. },
  108. {
  109. label: '综合支持',
  110. value: 'ZHZC'
  111. }
  112. ]
  113. },
  114. methods: {
  115. init(name, year, season) {
  116. this.dialogVisible = true
  117. this.optionName = name
  118. this.yearData = year
  119. this.seasonData = season
  120. this.evaluationYearDataLeft = []
  121. this.evaluationYearDataRight = []
  122. this.getYearData(name, year, season)
  123. },
  124. yearWidth() {
  125. if (this.innerWidth < 1920) {
  126. if (this.evaluationYearDataRight.length>0) {
  127. return '60vw'
  128. } else {
  129. return '33vw'
  130. }
  131. } else {
  132. if (this.winPix === 1.25) {
  133. if (this.evaluationYearDataRight.length>0) {
  134. return '60vw'
  135. } else {
  136. return '33vw'
  137. }
  138. } else {
  139. if (this.evaluationYearDataRight.length>0) {
  140. return '50vw'
  141. } else {
  142. return '28vw'
  143. }
  144. }
  145. }
  146. },
  147. rankStyle() {
  148. if (this.winPix === 1.25) {
  149. return 'width: 13%'
  150. }
  151. },
  152. companyStyle() {
  153. if (this.winPix === 1.25) {
  154. return 'width: 68%'
  155. }
  156. },
  157. changeOption(val) {
  158. this.evaluationYearDataLeft = []
  159. this.evaluationYearDataRight = []
  160. this.getYearData(val, this.yearData, this.seasonData)
  161. },
  162. getYearData(name, year, season) {
  163. let that = this
  164. let params = {
  165. binSection: name,
  166. year: year,
  167. season: season === '第一季度' ? '1' : season === '第二季度' ? '2' : '3'
  168. }
  169. apiGetevaluationportallist(params).then(datas =>{
  170. if (datas && datas.data && datas.data.year) {
  171. if (datas.data.year[name].length>0) {
  172. datas.data.year[name].forEach((item, index) =>{
  173. item.rank = index+1
  174. })
  175. if (datas.data.year[name].length>15) {
  176. that.evaluationYearDataLeft = datas.data.year[name].splice(0, 15)
  177. that.evaluationYearDataRight = datas.data.year[name]
  178. } else {
  179. that.evaluationYearDataLeft = datas.data.year[name]
  180. }
  181. }
  182. }
  183. })
  184. }
  185. }
  186. }
  187. </script>
  188. <style lang="less">
  189. .annualLeagueTable{
  190. .el-overlay{
  191. .el-dialog{
  192. margin-top: 5vh !important;
  193. .el-dialog__header{
  194. .yearHeader{
  195. width: 97%;
  196. display: flex;
  197. justify-content: space-between;
  198. .el-select{
  199. width: 120px;
  200. .el-input__inner{
  201. height:28px;
  202. }
  203. .el-input__suffix{
  204. .el-select__caret{
  205. line-height:28px;
  206. }
  207. }
  208. }
  209. }
  210. }
  211. .el-dialog__body{
  212. padding: 20px 0;
  213. .yearFrom{
  214. padding: 0 20px;
  215. .yearFromHeader{
  216. width: 100%;
  217. border-bottom: 1px solid #E1E3EA;
  218. .headerNameTit{
  219. display: flex;
  220. justify-content: space-between;
  221. // padding: 8px 20px;
  222. padding: 8px 36px 8px 20px;
  223. font-size: 14px;
  224. color: #414141;
  225. }
  226. .headerTit{
  227. position: relative;
  228. top: 10px;
  229. left: 150px;
  230. }
  231. }
  232. .yearFromMsg{
  233. display: flex;
  234. width: 100%;
  235. height: 35px;
  236. background: #F6F7FA;
  237. margin: 5px 8px;
  238. padding: 2px 10px 0;
  239. border-radius: 5px;
  240. .msgProgress{
  241. margin-top: 5px;
  242. display: flex;
  243. width: 100%;
  244. span{
  245. font-size: 14px;
  246. font-family: Microsoft YaHei;
  247. }
  248. span:nth-child(1){
  249. display: inline-block;
  250. width: 10%;
  251. font-weight: 600;
  252. color: #666;
  253. margin-left: 10px;
  254. }
  255. span:nth-child(2){
  256. display: inline-block;
  257. width: 72%;
  258. overflow: hidden;
  259. text-overflow: ellipsis;
  260. white-space: nowrap;
  261. font-weight: 400;
  262. color: #666;
  263. margin-right: 20px;
  264. }
  265. span:nth-child(3){
  266. font-weight: 600;
  267. margin-right: 30px;
  268. color: #F65177;
  269. }
  270. span:nth-child(4){
  271. display: inline-block;
  272. width: 13%;
  273. font-weight: 600;
  274. color: #666;
  275. }
  276. }
  277. }
  278. }
  279. }
  280. }
  281. }
  282. }
  283. </style>