t-w-zaoquan.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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. }else{
  109. uni.showToast({
  110. icon:"none",
  111. title:"暂未开通"
  112. })
  113. }
  114. }
  115. },
  116. getmodule(link){
  117. console.log(link)
  118. console.log(this.mine_code)
  119. // 二维码
  120. if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
  121. let pageId = ""
  122. function GetQueryString(name) {
  123. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  124. var r = link.match(reg);
  125. if (r != null) return unescape(r[2]);
  126. return null;
  127. }
  128. console.log(GetQueryString("pageId"))
  129. if (GetQueryString("pageId")) {
  130. pageId = GetQueryString("pageId")
  131. } else {
  132. pageId = link.split('=')[1]
  133. }
  134. uni.navigateTo({
  135. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  136. })
  137. }
  138. // h5
  139. if(link.indexOf("pageId") == -1 && link.indexOf("app:") == -1){
  140. uni.navigateTo({
  141. url:"../../workbench/h5/h5?url=" + link
  142. })
  143. }
  144. // 原生
  145. if(link.indexOf("pageId") == -1 && link.indexOf("app:") != -1){
  146. console.log("原生")
  147. console.log(link)
  148. // 发票助手
  149. if(link.indexOf("/workBench/invoice") != -1){
  150. console.log("发票助手")
  151. uni.navigateTo({
  152. url:"../../workbench/invoice_assistant/invoice_assistant"
  153. })
  154. }else if(link.indexOf("/productionData/logging") != -1){
  155. console.log("下井记录")
  156. // uni.navigateTo({
  157. // url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num="+people_num+"&depart_name="+depart_name+"&name="+name+"&mine="+this.mine
  158. // })
  159. // people_num 特殊值
  160. if(!uni.getStorageSync('people_code')){
  161. uni.navigateTo({
  162. url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name="+uni.getStorageSync('user').section+"&name="+uni.getStorageSync('user').name+"&mine=640181B0011010037723"
  163. })
  164. }else{
  165. uni.navigateTo({
  166. 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"
  167. })
  168. }
  169. }else if(link.indexOf("/browseQrcode/gridSubmitItem_win") != -1){
  170. console.log("网格排查")
  171. uni.navigateTo({
  172. url:"../../workbench/gridding/gridding"
  173. })
  174. }
  175. }
  176. }
  177. },
  178. }
  179. </script>
  180. <style>
  181. .headers{
  182. width: 100%;
  183. background-color: #F5F5F5;
  184. }
  185. .headers_img>image{
  186. width: 100%;
  187. height: 360rpx;
  188. }
  189. .headers_nav{
  190. width: 100%;
  191. background-color: #FFFFFF;
  192. margin-bottom: 25rpx;
  193. }
  194. .headers_ul{
  195. width: 100%;
  196. display: flex;
  197. flex-wrap:wrap;
  198. justify-content: space-around;
  199. margin-top: 10rpx;
  200. }
  201. .headers_ul::after{
  202. content: '';
  203. width: 25%;
  204. }
  205. .headers_title{
  206. margin-left: 40rpx;
  207. padding-top: 30rpx;
  208. padding-bottom: 5rpx;
  209. }
  210. .headers_li{
  211. width: 25%;
  212. text-align: center;
  213. margin-bottom: 25rpx;
  214. margin-top: 25rpx;
  215. }
  216. .headers_li_img>image{
  217. width: 100rpx;
  218. height: 100rpx;
  219. margin-bottom: 10rpx;
  220. }
  221. .headers_li_text{
  222. font-size: 14px;
  223. }
  224. .headers_title_h1{
  225. font-weight: 800;
  226. }
  227. .headers_list{
  228. width: 100%;
  229. background-color: #fff;
  230. }
  231. .ly-tree-node__label{
  232. color: #000000;
  233. }
  234. </style>