t-w-zaoquan.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <view class="headers">
  3. <view class="headers_img">
  4. <image :src="header" mode="aspectFill"></image>
  5. </view>
  6. <view class="headers_nav">
  7. <view class="headers_ul">
  8. <view class="headers_li" v-for="(item,index) in nav" :key="index" @click="getnav(item.link)">
  9. <view class="headers_li_img">
  10. <image :src="item.icon" mode=""></image>
  11. </view>
  12. <view class="headers_li_text">
  13. {{item.title}}
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="headers_list" v-for="(item,index) in module" :key="index">
  19. <view class="headers_title">
  20. <text class="headers_title_h1">
  21. {{item.title}}
  22. </text>
  23. </view>
  24. <view class="headers_ul" >
  25. <view class="headers_li" v-for="(items,index) in item.children" :key="index" @click="getmodule(items.link)">
  26. <view class="headers_li_img">
  27. <image :src="items.icon" mode=""></image>
  28. </view>
  29. <view class="headers_li_text">
  30. {{items.title}}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. props: [
  40. "mine_code"
  41. ],
  42. data() {
  43. return {
  44. module:[],
  45. nav:[],
  46. header:"",
  47. };
  48. },
  49. created() {
  50. this.getworkbench()
  51. },
  52. methods:{
  53. getworkbench(){
  54. this.$api.workbench_index({
  55. }).then((res)=>{
  56. // console.log(res)
  57. this.header=res.data.data.header
  58. this.nav=res.data.data.nav
  59. this.module=res.data.data.module
  60. })
  61. },
  62. getnav(link){
  63. console.log(link)
  64. // 二维码
  65. if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
  66. let pageId = ""
  67. function GetQueryString(name) {
  68. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  69. var r = link.match(reg);
  70. if (r != null) return unescape(r[2]);
  71. return null;
  72. }
  73. console.log(GetQueryString("pageId"))
  74. if (GetQueryString("pageId")) {
  75. pageId = GetQueryString("pageId")
  76. } else {
  77. pageId = link.split('=')[1]
  78. }
  79. uni.navigateTo({
  80. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  81. })
  82. }
  83. // h5
  84. if(link.indexOf("pageId") == -1 && link.indexOf("app:") == -1){
  85. uni.navigateTo({
  86. url:"../../workbench/h5/h5?url=" + link
  87. })
  88. }
  89. // 原生
  90. if(link.indexOf("pageId") == -1 && link.indexOf("app:") != -1){
  91. console.log("原生")
  92. console.log(link)
  93. if(link.indexOf("/news/news_win") != -1){
  94. console.log("通知公告")
  95. uni.navigateTo({
  96. url:"../../my/message-reminder/message-reminder"
  97. })
  98. }else if(link.indexOf("/workBench/getDuty") != -1){
  99. console.log("值班信息")
  100. uni.navigateTo({
  101. url:"../../workbench/duty_information/duty_information"
  102. })
  103. }else if(link.indexOf("/workBench/huiyiList") != -1){
  104. // uni.showToast({
  105. // icon:"none",
  106. // title:"暂时没有会议"
  107. // })
  108. uni.navigateTo({
  109. url:"../../workbench/meeting_arrangements/meeting_arrangements"
  110. })
  111. }else{
  112. uni.showToast({
  113. icon:"none",
  114. title:"暂未开通"
  115. })
  116. }
  117. }
  118. },
  119. getmodule(link){
  120. console.log(link)
  121. console.log(this.mine_code)
  122. // 二维码
  123. if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
  124. let pageId = ""
  125. function GetQueryString(name) {
  126. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  127. var r = link.match(reg);
  128. if (r != null) return unescape(r[2]);
  129. return null;
  130. }
  131. console.log(GetQueryString("pageId"))
  132. if (GetQueryString("pageId")) {
  133. pageId = GetQueryString("pageId")
  134. } else {
  135. pageId = link.split('=')[1]
  136. }
  137. uni.navigateTo({
  138. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  139. })
  140. }
  141. // h5
  142. if(link.indexOf("pageId") == -1 && link.indexOf("app:") == -1){
  143. uni.navigateTo({
  144. url:"../../workbench/h5/h5?url=" + link
  145. })
  146. }
  147. // 原生
  148. if(link.indexOf("pageId") == -1 && link.indexOf("app:") != -1){
  149. console.log("原生")
  150. console.log(link)
  151. // 发票助手
  152. if(link.indexOf("/workBench/invoice") != -1){
  153. console.log("发票助手")
  154. uni.navigateTo({
  155. url:"../../workbench/invoice_assistant/invoice_assistant"
  156. })
  157. }else if(link.indexOf("/productionData/logging") != -1){
  158. console.log("下井记录")
  159. // uni.navigateTo({
  160. // url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num="+people_num+"&depart_name="+depart_name+"&name="+name+"&mine="+this.mine
  161. // })
  162. // people_num 特殊值
  163. if(!uni.getStorageSync('people_code')){
  164. uni.navigateTo({
  165. url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name="+uni.getStorageSync('user').section+"&name="+uni.getStorageSync('user').name+"&mine=640181B0011010037723"
  166. })
  167. }else{
  168. uni.navigateTo({
  169. url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num="+uni.getStorageSync('user').people_code+"&depart_name="+uni.getStorageSync('user').section+"&name="+uni.getStorageSync('user').name+"&mine=640181B0011010037723"
  170. })
  171. }
  172. }else if(link.indexOf("/browseQrcode/gridSubmitItem_win") != -1){
  173. console.log("网格排查")
  174. uni.navigateTo({
  175. url:"../../workbench/gridding/gridding"
  176. })
  177. }else if(link.indexOf("/workBench/evaluate") != -1){
  178. console.log("干部评测")
  179. uni.navigateTo({
  180. url:"../../workbench/h5/h5?mine_code=zaoquan&workBench=pingce"
  181. })
  182. }
  183. }
  184. }
  185. },
  186. }
  187. </script>
  188. <style>
  189. .headers{
  190. width: 100%;
  191. background-color: #F5F5F5;
  192. }
  193. .headers_img>image{
  194. width: 100%;
  195. height: 360rpx;
  196. }
  197. .headers_nav{
  198. width: 100%;
  199. background-color: #FFFFFF;
  200. margin-bottom: 25rpx;
  201. }
  202. .headers_ul{
  203. width: 100%;
  204. display: flex;
  205. flex-wrap:wrap;
  206. justify-content: space-around;
  207. margin-top: 10rpx;
  208. }
  209. .headers_ul::after{
  210. content: '';
  211. width: 25%;
  212. }
  213. .headers_title{
  214. margin-left: 40rpx;
  215. padding-top: 30rpx;
  216. padding-bottom: 5rpx;
  217. }
  218. .headers_li{
  219. width: 25%;
  220. text-align: center;
  221. margin-bottom: 25rpx;
  222. margin-top: 25rpx;
  223. }
  224. .headers_li_img>image{
  225. width: 100rpx;
  226. height: 100rpx;
  227. margin-bottom: 10rpx;
  228. }
  229. .headers_li_text{
  230. font-size: 14px;
  231. }
  232. .headers_title_h1{
  233. font-weight: 800;
  234. }
  235. .headers_list{
  236. width: 100%;
  237. background-color: #fff;
  238. }
  239. .ly-tree-node__label{
  240. color: #000000;
  241. }
  242. </style>