t-w-yangchangwan.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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"
  26. @click="getmodule(items.link)">
  27. <view class="headers_li_img">
  28. <image :src="items.icon" mode=""></image>
  29. </view>
  30. <view class="headers_li_text">
  31. {{items.title}}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. props: [
  41. "mine_code"
  42. ],
  43. data() {
  44. return {
  45. module: [],
  46. nav: [],
  47. header: "",
  48. };
  49. },
  50. created() {
  51. this.getworkbench()
  52. },
  53. methods: {
  54. getworkbench() {
  55. this.$api.workbench_index({
  56. }).then((res) => {
  57. // console.log(res)
  58. this.header = res.data.data.header
  59. this.nav = res.data.data.nav
  60. this.module = res.data.data.module
  61. })
  62. },
  63. getnav(link) {
  64. console.log(link)
  65. // 二维码
  66. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  67. let pageId = ""
  68. function GetQueryString(name) {
  69. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  70. var r = link.match(reg);
  71. if (r != null) return unescape(r[2]);
  72. return null;
  73. }
  74. console.log(GetQueryString("pageId"))
  75. if (GetQueryString("pageId")) {
  76. pageId = GetQueryString("pageId")
  77. } else {
  78. pageId = link.split('=')[1]
  79. }
  80. // uni.navigateTo({
  81. // url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  82. // })
  83. }
  84. // h5
  85. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  86. // uni.navigateTo({
  87. // url: "../../workbench/h5/h5?url=" + link
  88. // })
  89. }
  90. // 原生
  91. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  92. console.log("原生")
  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.navigateTo({
  105. url:"../../workbench/meeting_arrangements/meeting_arrangements"
  106. })
  107. }else{
  108. uni.showToast({
  109. icon:"none",
  110. title:"暂未开通"
  111. })
  112. }
  113. }
  114. },
  115. getmodule(link) {
  116. console.log(link)
  117. console.log(this.mine_code)
  118. // 二维码
  119. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  120. let pageId = ""
  121. function GetQueryString(name) {
  122. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  123. var r = link.match(reg);
  124. if (r != null) return unescape(r[2]);
  125. return null;
  126. }
  127. console.log(GetQueryString("pageId"))
  128. if (GetQueryString("pageId")) {
  129. pageId = GetQueryString("pageId")
  130. } else {
  131. pageId = link.split('=')[1]
  132. }
  133. uni.navigateTo({
  134. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  135. })
  136. }
  137. // h5
  138. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  139. uni.navigateTo({
  140. url: "../../workbench/h5/h5?url=" + link
  141. })
  142. }
  143. // 原生
  144. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  145. console.log("原生")
  146. console.log(link)
  147. // 发票助手
  148. if (link.indexOf("/workBench/invoice") != -1) {
  149. console.log("发票助手")
  150. uni.navigateTo({
  151. url: "../../workbench/invoice_assistant/invoice_assistant"
  152. })
  153. }else if(link.indexOf("/productionData/logging") != -1){
  154. console.log("下井记录")
  155. // uni.navigateTo({
  156. // url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num="+people_num+"&depart_name="+depart_name+"&name="+name+"&mine="+this.mine
  157. // })
  158. // people_num 特殊值
  159. if(!uni.getStorageSync('people_code')){
  160. uni.navigateTo({
  161. url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name="+uni.getStorageSync('user').section+"&name="+uni.getStorageSync('user').name+"&mine=640323B0011010019259"
  162. })
  163. }else{
  164. uni.navigateTo({
  165. 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=640323B0011010019259"
  166. })
  167. }
  168. }else if(link.indexOf("/productionData/persnoalLocation") != -1){
  169. // 人员定位
  170. uni.navigateTo({
  171. url:"../../production/personnel_orientation/personnel_orientation?mine=640181B0011010030750"
  172. })
  173. }else if(link.indexOf("/sendCars/addSendCarOrder_frm") != -1){
  174. // 申请用车
  175. uni.navigateTo({
  176. url:"../../workbench/vehicle_approval/apply_vehicle/apply_vehicle"
  177. })
  178. }else if(link.indexOf("/sendCars/userCarApproval_frm_his") != -1){
  179. // 用车历史
  180. uni.navigateTo({
  181. url:"../../workbench/vehicle_approval/vehicle_history/vehicle_history"
  182. })
  183. }else if(link.indexOf("/sendCars/userCarApproval_frm") != -1){
  184. // 用车 单据审批
  185. }else{
  186. uni.showToast({
  187. icon:"none",
  188. title:"暂未开通"
  189. })
  190. }
  191. }
  192. }
  193. },
  194. }
  195. </script>
  196. <style>
  197. .headers {
  198. width: 100%;
  199. background-color: #F5F5F5;
  200. }
  201. .headers_img>image {
  202. width: 100%;
  203. height: 360rpx;
  204. }
  205. .headers_nav {
  206. width: 100%;
  207. background-color: #FFFFFF;
  208. margin-bottom: 25rpx;
  209. }
  210. .headers_ul {
  211. width: 100%;
  212. /* display: flex;
  213. flex-wrap: wrap;
  214. justify-content: space-between; */
  215. margin-top: 10rpx;
  216. overflow: hidden;
  217. }
  218. .headers_ul::after {
  219. content: '';
  220. width: 25%;
  221. }
  222. .headers_title {
  223. margin-left: 40rpx;
  224. padding-top: 30rpx;
  225. padding-bottom: 5rpx;
  226. }
  227. .headers_li {
  228. float: left;
  229. width: 25%;
  230. text-align: center;
  231. margin-bottom: 25rpx;
  232. margin-top: 25rpx;
  233. }
  234. .headers_li_img>image {
  235. width: 100rpx;
  236. height: 100rpx;
  237. margin-bottom: 10rpx;
  238. }
  239. .headers_li_text {
  240. font-size: 14px;
  241. }
  242. .headers_title_h1 {
  243. font-weight: 800;
  244. }
  245. .headers_list {
  246. width: 100%;
  247. background-color: #fff;
  248. }
  249. .ly-tree-node__label {
  250. color: #000000;
  251. }
  252. </style>