Header.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <div id="header">
  3. <div class="header_left">
  4. <span v-for="item in headerArr.slice(0,3)" :key="item.id" class="title">
  5. <span class="role_button" :role_button_code="item.role_button_code" :class="[item.chosen?'title_min_chosen':'title_min']" @click="clickFn(item.component)">{{item.name}}</span>
  6. </span>
  7. </div>
  8. <div class="header_mid">
  9. <div class="center_title" @click="clickFn('/origion/home')">
  10. 市住建委“一网通办”管理门户
  11. </div>
  12. </div>
  13. <div class="header_right">
  14. <span v-for="item in headerArr.slice(3)" :key="item.id" class="title">
  15. <span class="role_button" :class="[item.chosen?'title_min_chosen':'title_min']" :role_button_code="item.role_button_code" @click="clickFn(item.component)">{{item.name}}</span>
  16. </span>
  17. <span class="title role_title" @click="loginOut">{{userName}} ,退出</span>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import {mapMutations, mapState} from "vuex";
  23. import {mapEletricCardMutations, mapEvaluateMutations} from "@/units/map-units";
  24. import selectConfigModuleByRole from "@/role_button";
  25. import {userExit} from "@/commomUse";
  26. export default {
  27. name: "Header",
  28. data(){
  29. return{
  30. userName:'',
  31. headerArr:[
  32. {
  33. id:'1',
  34. name:'办件情况',
  35. component:'/origion/handleSituation',
  36. chosen:false,
  37. role_button_code:'354'
  38. },
  39. {
  40. id:'2',
  41. name:'办件分析',
  42. component:'/origion/handleAnalysis',
  43. chosen:false,
  44. role_button_code:'355'
  45. },
  46. {
  47. id:'3',
  48. name:'事项和指南',
  49. component:'/origion/mattersGuidance/mainBody',
  50. chosen:false,
  51. role_button_code:'353'
  52. },
  53. {
  54. id:'4',
  55. name:'好差评',
  56. component:'/origion/evaluate',
  57. chosen:false,
  58. role_button_code:'356'
  59. },
  60. {
  61. id:'5',
  62. name:'电子证照',
  63. component:'/origion/electricCard',
  64. chosen:false,
  65. role_button_code:'357'
  66. },
  67. {
  68. id:'6',
  69. name:'驾驶舱',
  70. component:'/origion/controlCabin',
  71. chosen:false,
  72. role_button_code:'358'
  73. },
  74. ]
  75. }
  76. },
  77. computed:{
  78. ...mapState({
  79. reFresh:'analysisRefresh',
  80. // firstLevel:'analysisFirstLevel',
  81. // secondLevel:'analysisSecondLevel',
  82. // thirdLevel:'analysisThirdLevel',
  83. // forthLevel:'analysisForthLevel',
  84. // dayCount:'analysisTimer'
  85. })
  86. },
  87. mounted(){
  88. this.userName =localStorage.getItem("ywtb_username")
  89. selectConfigModuleByRole(this);
  90. console.log(this.$route.path);
  91. for(let i=0;i<this.headerArr.length;i++){
  92. if(this.headerArr[i].component.indexOf(this.$route.path.substring(1,this.$route.path.length)) > -1){
  93. this.setChosen(this.headerArr[i]);
  94. this.headerArr[i].chosen=true;
  95. }else{
  96. this.headerArr[i].chosen=false;
  97. }
  98. }
  99. },
  100. methods:{
  101. loginOut:function (){
  102. userExit(this);
  103. },
  104. clickFn:function(component){
  105. this.$router.push(''+ component +'');
  106. this.matterGuidanceRefresh(true);
  107. this.matterGuidance({
  108. "matterGuidanceFirstLevel":'1',
  109. "matterGuidanceSecondLevel":'',
  110. "matterGuidanceThirdLevel":'',
  111. })
  112. this.handleSituationRefresh(true);
  113. this.handleSituation({
  114. "handleSituationFirstLevel":'',
  115. "handleSituationSecondLevel":'',
  116. "handleSituationThirdLevel":'1',
  117. "handleSituationForthLevel":'', //事项编码
  118. "handleSituationFifthLevel":'', //情形编码
  119. "handleSituationSixthLevel":'', //办件状态
  120. "handleSituationSeventhLevel":'', //办件类型
  121. "handleSituationSortTime":'', //时间排序查询
  122. "handleSituationOptimize":'', //可优化查询
  123. })
  124. this.analysisRefresh(true);
  125. this.analysis({
  126. "analysisFirstLevel":'',
  127. "analysisSecondLevel":'',
  128. "analysisThirdLevel":'',
  129. "analysisForthLevel":'',
  130. "analysisFifthLevel":'',
  131. "analysisTimer":'30',
  132. "analysisUnit":'',
  133. "analysisUrgeType":'SL_TX', //提醒,督办
  134. "analysisOptimizeType":'',
  135. })
  136. this.evaluateThirdLevel('');
  137. this.eletricCardRefresh(true);
  138. this.eletricCardCurrentId('');
  139. this.evaluateCurrentId('ana');
  140. for(let i=0;i<this.headerArr.length;i++){
  141. if(component==this.headerArr[i].component){
  142. this.headerArr[i].chosen=true;
  143. }else{
  144. this.headerArr[i].chosen=false;
  145. }
  146. }
  147. },
  148. onclickFn:function (component){
  149. for(let i=0;i<this.headerArr.length;i++){
  150. if(component==this.headerArr[i].component){
  151. this.headerArr[i].chosen=true;
  152. }else{
  153. this.headerArr[i].chosen=false;
  154. }
  155. }
  156. },
  157. setChosen:function (){
  158. },
  159. ...mapMutations(['matterGuidance','matterGuidanceRefresh','matterGuidanceSingleChange','handleSituationRefresh','handleSituation','analysis','analysisRefresh','analysisSingleChange']),
  160. ...mapEvaluateMutations(['evaluateCurrentId','evaluateFirstLevel','evaluateSecondLevel','evaluateThirdLevel','evaluateTimer']),
  161. ...mapEletricCardMutations(['eletricCardRefresh','eletricCardCurrentId']),
  162. },
  163. watch:{
  164. $route(to,from){
  165. console.log(to,from);
  166. this.onclickFn(to.path);
  167. }
  168. }
  169. }
  170. </script>
  171. <style scoped lang="scss">
  172. #header{
  173. margin-bottom: 10px;
  174. background-image: url("../../assets/imgs/title.png");
  175. background-size:100%;
  176. background-repeat: no-repeat,no-repeat;
  177. display: flex;
  178. height:10%;
  179. width:100%;
  180. flex-direction: row;
  181. align-items: center;
  182. justify-content: space-between;
  183. .header_left{
  184. width:25%;
  185. height:60%;
  186. display: flex;
  187. flex-direction: row;
  188. align-items: center;
  189. .title{
  190. display: flex;
  191. flex-direction: row;
  192. justify-content: center;
  193. .title_min{
  194. font-size: 20px;
  195. cursor: pointer;
  196. text-decoration : none;
  197. font-weight: 700;
  198. color: #71d7ff;
  199. }
  200. .title_min_chosen{
  201. font-size: 20px;
  202. cursor: pointer;
  203. text-decoration : none;
  204. font-weight: 700;
  205. color: #fdbf00;
  206. }
  207. width: 50%;
  208. text-align: center;
  209. }
  210. }
  211. .header_mid{
  212. width: 50%;
  213. font-weight: bold;
  214. font-size: 34px;
  215. cursor: pointer;
  216. box-sizing: border-box;
  217. color:#2aaef2;
  218. display: flex;
  219. justify-content: center;
  220. letter-spacing: 15px;
  221. .center_title{
  222. text-align-last:justify;
  223. text-align:justify;
  224. text-justify:distribute-all-lines; // 这行必加,兼容ie浏览器
  225. }
  226. background-image:-webkit-linear-gradient(left,#0173ff,#00e3ff,#0173ff);
  227. -webkit-background-clip:text;
  228. -webkit-text-fill-color:transparent;
  229. }
  230. .header_right{
  231. width:25%;
  232. height:60%;
  233. display: flex;
  234. flex-direction: row;
  235. align-items: center;
  236. .title{
  237. display: flex;
  238. flex-direction: row;
  239. justify-content: center;
  240. .title_min{
  241. font-size: 20px;
  242. cursor: pointer;
  243. text-decoration : none;
  244. font-weight: 700;
  245. color: #71d7ff;
  246. }
  247. .title_min_chosen{
  248. font-size: 20px;
  249. cursor: pointer;
  250. text-decoration : none;
  251. font-weight: 700;
  252. color: #fdbf00;
  253. }
  254. width: 50%;
  255. text-align: center;
  256. }
  257. .role_title{
  258. font-size: 16px;
  259. cursor: pointer;
  260. color:#2aaef2;
  261. }
  262. }
  263. }
  264. </style>