IPanel.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <div>
  3. <el-card>
  4. <div slot="header" class="clearfix">
  5. <span> {{categorys['laws']}}</span>
  6. <el-button class="more-btn" type="text" @click="handleOpenMore('laws')">详情>></el-button>
  7. </div>
  8. <!-- -->
  9. <el-row :gutter="40" class="panel-group">
  10. <el-col :xs="8" :sm="8" :lg="8" class="card-panel-col" v-for="(item,index) in [1,2,3]" :key="index">
  11. <div class="card-panel" @click="handleSetLineChartData(index)">
  12. <div class="card-panel-icon-wrapper" :class="'color'+index">
  13. <svg-icon icon-class="education" class-name="card-panel-icon" />
  14. </div>
  15. <div class="card-panel-description">
  16. <div class="card-panel-text">
  17. {{status[item]}}
  18. </div>
  19. <count-to :start-val="0" :end-val="getAccount('laws', item)" :duration="2600" class="card-panel-num" />
  20. </div>
  21. </div>
  22. </el-col>
  23. </el-row>
  24. </el-card>
  25. <el-card>
  26. <div slot="header" class="clearfix">
  27. <span> {{categorys['result']}}</span>
  28. <el-button class="more-btn" type="text" @click="handleOpenMore('result')">详情>></el-button>
  29. </div>
  30. <!-- -->
  31. <el-row :gutter="40" class="panel-group">
  32. <el-col :xs="8" :sm="8" :lg="8" class="card-panel-col" v-for="(item,index) in [1,2,3]" :key="index">
  33. <div class="card-panel" @click="handleSetLineChartData(index)">
  34. <div class="card-panel-icon-wrapper" :class="'color'+index">
  35. <svg-icon icon-class="chart" class-name="card-panel-icon" />
  36. </div>
  37. <div class="card-panel-description">
  38. <div class="card-panel-text">
  39. {{status[item]}}
  40. </div>
  41. <count-to :start-val="0" :end-val="getAccount('result', item)" :duration="2600" class="card-panel-num" />
  42. </div>
  43. </div>
  44. </el-col>
  45. </el-row>
  46. </el-card>
  47. <el-card>
  48. <div slot="header" class="clearfix">
  49. <span> {{categorys['mechanism']}}</span>
  50. <el-button class="more-btn" type="text" @click="handleOpenMore('mechanism')">详情>></el-button>
  51. </div>
  52. <!-- -->
  53. <el-row :gutter="40" class="panel-group">
  54. <el-col :xs="8" :sm="8" :lg="8" class="card-panel-col" v-for="(item,index) in [1,2,3]" :key="index">
  55. <div class="card-panel" @click="handleSetLineChartData(index)">
  56. <div class="card-panel-icon-wrapper" :class="'color'+index">
  57. <svg-icon icon-class="example" class-name="card-panel-icon" />
  58. </div>
  59. <div class="card-panel-description">
  60. <div class="card-panel-text">
  61. {{status[item]}}
  62. </div>
  63. <count-to :start-val="0" :end-val="getAccount('mechanism', item)" :duration="2600" class="card-panel-num" />
  64. </div>
  65. </div>
  66. </el-col>
  67. </el-row>
  68. </el-card>
  69. <el-card>
  70. <div slot="header" class="clearfix">
  71. <span> {{categorys['other']}}</span>
  72. <el-button class="more-btn" type="text" @click="handleOpenMore('other')">详情>></el-button>
  73. </div>
  74. <!-- -->
  75. <el-row :gutter="40" class="panel-group">
  76. <el-col :xs="8" :sm="8" :lg="8" class="card-panel-col" v-for="(item,index) in [1,2,3]" :key="index">
  77. <div class="card-panel" @click="handleSetLineChartData(index)">
  78. <div class="card-panel-icon-wrapper" :class="'color'+index">
  79. <svg-icon icon-class="guide" class-name="card-panel-icon" />
  80. </div>
  81. <div class="card-panel-description">
  82. <div class="card-panel-text">
  83. {{status[item]}}
  84. </div>
  85. <count-to :start-val="0" :end-val="getAccount('other', item)" :duration="2600" class="card-panel-num" />
  86. </div>
  87. </div>
  88. </el-col>
  89. </el-row>
  90. </el-card>
  91. </div>
  92. </template>
  93. <script>
  94. import CountTo from 'vue-count-to'
  95. import data from '@/pages/data/data.js'
  96. export default {
  97. components: {
  98. CountTo
  99. },
  100. data(){
  101. return {
  102. categorys: data.categorys,
  103. status:{
  104. 1:'提交中',
  105. 2:'审核中',
  106. 3:'发布中'
  107. }
  108. }
  109. },
  110. props: {
  111. departmentId:{
  112. type: [String, Number],
  113. default:0
  114. },
  115. account: {
  116. type: Object,
  117. default: () => {
  118. return {
  119. 'laws1': 0,
  120. 'laws2': 0,
  121. 'laws3': 0,
  122. sumLogin: 0,
  123. sumFace: 0
  124. }
  125. }
  126. }
  127. },
  128. methods: {
  129. handleSetLineChartData( index ) {
  130. this.$emit('select', index )
  131. },
  132. getAccount( category, index){
  133. let key = category+index;
  134. return this.account[key]||0;
  135. },
  136. handleOpenMore( category ){
  137. console.log("handleOpenMore", this)
  138. let query = {category, departmentId: this.departmentId}
  139. let path = '/file-search'
  140. this.$router.push( {path, query})
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .panel-group {
  147. margin-top: 8px;
  148. .card-panel-col {
  149. margin-bottom: 8px;
  150. }
  151. .card-panel {
  152. height: 108px;
  153. cursor: pointer;
  154. font-size: 8px;
  155. position: relative;
  156. overflow: hidden;
  157. color: #666;
  158. background: #fff;
  159. box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
  160. border-color: rgba(0, 0, 0, .05);
  161. &:hover {
  162. .card-panel-icon-wrapper {
  163. color: #fff;
  164. }
  165. .color0{
  166. background: #40c9c6;
  167. }
  168. .color1{
  169. background: #f4516c;
  170. }
  171. .color2{
  172. background: #36a3f7
  173. }
  174. }
  175. .color0{
  176. color: #40c9c6;
  177. }
  178. .color1{
  179. color: #f4516c;
  180. }
  181. .color2{
  182. color: #36a3f7;
  183. }
  184. .icon-people {
  185. color: #40c9c6;
  186. }
  187. .icon-message {
  188. color: #36a3f7;
  189. }
  190. .icon-international {
  191. color: #f4516c;
  192. }
  193. .icon-tree-table {
  194. color: #34bfa3
  195. }
  196. .card-panel-icon-wrapper {
  197. float: left;
  198. margin: 14px 0 0 14px;
  199. padding: 16px;
  200. transition: all 0.38s ease-out;
  201. border-radius: 6px;
  202. }
  203. .card-panel-icon {
  204. float: left;
  205. font-size: 48px;
  206. }
  207. .card-panel-description {
  208. float: right;
  209. font-weight: bold;
  210. margin: 26px;
  211. margin-left: 0px;
  212. .card-panel-text {
  213. line-height: 18px;
  214. color: rgba(0, 0, 0, 0.45);
  215. font-size: 16px;
  216. margin-bottom: 8px;
  217. }
  218. .card-panel-num {
  219. font-size: 20px;
  220. }
  221. }
  222. }
  223. }
  224. // @media (max-width:550px) {
  225. // .card-panel-description {
  226. // display: none;
  227. // }
  228. // .card-panel-icon-wrapper {
  229. // float: none !important;
  230. // width: 40%;
  231. // height: 100%;
  232. // margin: 0 !important;
  233. // .svg-icon {
  234. // display: block;
  235. // margin: 14px auto !important;
  236. // float: none !important;
  237. // }
  238. // }
  239. // }
  240. </style>