workbench.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <view>
  3. <!-- 工作台头图 -->
  4. <view class="top">
  5. <image :src="header"></image>
  6. </view>
  7. <!-- nav -->
  8. <view class="section">
  9. <view class="list">
  10. <view class="item" v-for="(item,index) in nav" :key="index" @click="go_link(item)">
  11. <view class="icon">
  12. <image :src="item.icon" mode=""></image>
  13. </view>
  14. <view class="name">
  15. <view class="num" v-if="item.link.indexOf('http://oa_system.nxjiewei.com:8011/?m=ying&d=we&num=daiban&hideheader=true') != -1 && num_1 > 0">{{num_1}}</view>
  16. <view class="num" v-if="item.link.indexOf('http://oa_system.nxjiewei.com:8011/?m=ying&d=we&num=todo&hideheader=true') != -1 && num_2 > 0">{{num_2}}</view>
  17. <view class="name_title">{{item.title}}</view>
  18. <view class="sub_title">{{item.sub_title}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="section" v-for="(item,index) in module" :key="index">
  24. <view class="title">
  25. <view class="icon">
  26. <image :src="item.icon" mode=""></image>
  27. </view>
  28. <view class="text">{{item.title}}</view>
  29. </view>
  30. <view class="list">
  31. <view class="item" v-for="(item_2,index_2) in item.children" :key="index_2" @click="go_link(item_2)">
  32. <view class="icon">
  33. <image :src="item_2.icon" mode=""></image>
  34. </view>
  35. <view class="name">
  36. <view class="name_title">{{item_2.title}}</view>
  37. <view class="sub_title">{{item_2.sub_title}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. // 当前煤矿编码
  49. mine_code: "",
  50. // 头部图片
  51. header:"",
  52. nav: [],
  53. module: [],
  54. num_1:0,
  55. num_2:0
  56. };
  57. },
  58. onLoad() {
  59. // 初始化当前煤矿编码
  60. this.mine_code = uni.getStorageSync('mine_code')
  61. this.get_workbench_index()
  62. this.get_workflow_todo_query_1()
  63. this.get_workflow_todo_query_2()
  64. },
  65. methods: {
  66. // 获取基础数据
  67. get_workbench_index(){
  68. this.$api.workbench_index({
  69. }).then((res) => {
  70. this.header = res.data.data.header
  71. this.nav = res.data.data.nav
  72. this.module = res.data.data.module
  73. })
  74. },
  75. // 获取消息提醒数量
  76. get_workflow_todo_query_1(){
  77. this.$api.workflow_todo_query({
  78. staff_num: uni.getStorageSync('user').staff_num,
  79. query_type: 2
  80. }).then((res)=>{
  81. this.num_1 = res.data.content.data
  82. })
  83. },
  84. get_workflow_todo_query_2(){
  85. this.$api.workflow_todo_query({
  86. staff_num: uni.getStorageSync('user').staff_num,
  87. query_type: 1
  88. }).then((res)=>{
  89. this.num_2 = res.data.content.data
  90. })
  91. },
  92. go_link(item) {
  93. // console.log(item)
  94. let link = item.link
  95. // OA系统
  96. if(link.indexOf("oa_system.nxjiewei.com") != -1 ){
  97. uni.navigateTo({
  98. url:"../../origanization/OA/h5/h5",
  99. success: (res) =>{
  100. // 通过eventChannel向被打开页面传送数据
  101. res.eventChannel.emit('acceptDataFromOpenerPage', {
  102. url: link,
  103. title: item.title
  104. })
  105. }
  106. })
  107. return
  108. }
  109. // 二维码
  110. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  111. let pageId = ""
  112. function GetQueryString(name) {
  113. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  114. var r = link.match(reg);
  115. if (r != null) return unescape(r[2]);
  116. return null;
  117. }
  118. console.log(GetQueryString("pageId"))
  119. if (GetQueryString("pageId")) {
  120. pageId = GetQueryString("pageId")
  121. } else {
  122. pageId = link.split('=')[1]
  123. }
  124. uni.navigateTo({
  125. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  126. })
  127. }
  128. // h5
  129. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  130. console.log("H5")
  131. // #ifdef APP
  132. if (plus.os.name == 'Android') {
  133. if (link.indexOf("cmb.pb") != -1) {
  134. plus.runtime.launchApplication({
  135. pname: 'cmb.pb'
  136. }, (e) => {
  137. console.log('Open system default browser failed: ' + e.message)
  138. uni.showToast({
  139. icon: "none",
  140. title: "未安装此应用"
  141. })
  142. })
  143. } else if (link.indexOf("com.icbc") != -1) {
  144. plus.runtime.launchApplication({
  145. pname: 'com.icbc'
  146. }, (e) => {
  147. console.log('Open system default browser failed: ' + e.message)
  148. uni.showToast({
  149. icon: "none",
  150. title: "未安装此应用"
  151. })
  152. })
  153. } else {
  154. uni.navigateTo({
  155. url: "../../workbench/h5/h5?url=" + link
  156. })
  157. }
  158. }
  159. // #endif
  160. // #ifdef H5
  161. uni.navigateTo({
  162. url: "../../workbench/h5/h5?url=" + link
  163. })
  164. // #endif
  165. }
  166. // 原生
  167. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  168. console.log("原生")
  169. console.log(link)
  170. // 发票助手
  171. if (link.indexOf("/workBench/invoice") != -1) {
  172. console.log("发票助手")
  173. uni.navigateTo({
  174. url: "../../workbench/invoice_assistant/invoice_assistant"
  175. })
  176. } else if (link.indexOf("/news/news_win") != -1) {
  177. console.log("通知公告")
  178. uni.navigateTo({
  179. url: "../../my/message-reminder/message-reminder"
  180. })
  181. } else if (link.indexOf("/workBench/getDuty") != -1) {
  182. console.log("值班信息")
  183. uni.navigateTo({
  184. url: "../../workbench/duty_information/duty_information"
  185. })
  186. } else if (link.indexOf("/workBench/huiyiList") != -1) {
  187. console.log("会议列表")
  188. uni.navigateTo({
  189. url: "../../workbench/meeting_arrangements/meeting_arrangements"
  190. })
  191. } else if (link.indexOf("/workBench/lifeCircleWin") != -1) {
  192. console.log("生活圈")
  193. uni.showToast({
  194. icon: "none",
  195. title: "暂未开通"
  196. })
  197. } else if (link.indexOf("/productionData/logging") != -1) {
  198. console.log("下井记录")
  199. // people_num 特殊值
  200. if (!uni.getStorageSync('people_code')) {
  201. uni.navigateTo({
  202. url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name=" +
  203. uni.getStorageSync('user').section + "&name=" + uni.getStorageSync('user')
  204. .name + "&mine=640323B0011010019259"
  205. })
  206. } else {
  207. uni.navigateTo({
  208. url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=" +
  209. uni.getStorageSync('user').people_code + "&depart_name=" + uni.getStorageSync(
  210. 'user').section + "&name=" + uni.getStorageSync('user').name +
  211. "&mine=640323B0011010019259"
  212. })
  213. }
  214. }else if(link.indexOf("/browseQrcode/gridSubmitItem_win") != -1){
  215. console.log("网格排查")
  216. uni.navigateTo({
  217. url:"../../workbench/gridding/gridding"
  218. })
  219. }else if(link.indexOf("/workBench/evaluate") != -1){
  220. console.log("干部评测")
  221. uni.navigateTo({
  222. url:"../../workbench/h5/h5?mine_code=zaoquan&workBench=pingce"
  223. })
  224. }else if(link.indexOf("/productionData/persnoalLocation") != -1){
  225. uni.navigateTo({
  226. url:"../../production/personnel_orientation/personnel_orientation?mine=640181B0011010030750"
  227. })
  228. } else {
  229. uni.showToast({
  230. icon: "none",
  231. title: "暂未开通"
  232. })
  233. }
  234. }
  235. }
  236. },
  237. }
  238. </script>
  239. <style lang="scss">
  240. page{
  241. background-color: #F2FAF7;
  242. margin-bottom: 20rpx;
  243. }
  244. .top{
  245. image{
  246. width: 750rpx;
  247. height: 270rpx;
  248. display: block;
  249. }
  250. }
  251. .section{
  252. margin-top: 20rpx;
  253. background-color: #FFFFFF;
  254. padding: 25rpx;
  255. .title{
  256. display: flex;
  257. align-items: center;
  258. height: 90rpx;
  259. .icon{
  260. margin-right: 20rpx;
  261. image{
  262. width: 50rpx;
  263. height: 50rpx;
  264. display: block;
  265. }
  266. }
  267. .text{
  268. font-weight: 700;
  269. font-size: 34rpx;
  270. }
  271. }
  272. .list{
  273. margin-top: 30rpx;
  274. width: 700rpx;
  275. overflow: hidden;
  276. .item{
  277. float: left;
  278. margin-bottom: 30rpx;
  279. width: 350rpx;
  280. display: flex;
  281. align-items: center;
  282. height: 140rpx;
  283. .icon{
  284. margin-bottom: 10rpx;
  285. image{
  286. width: 90rpx;
  287. height: 90rpx;
  288. display: block;
  289. }
  290. }
  291. .name{
  292. position: relative;
  293. margin-left: 20rpx;
  294. .num{
  295. z-index: 10;
  296. position: absolute;
  297. top: -10rpx;
  298. right: -50rpx;
  299. width: 40rpx;
  300. text-align: center;
  301. line-height: 40rpx;
  302. background-color: #F56C6C;
  303. border-radius: 50%;
  304. color: #FFF;
  305. font-size: 26rpx;
  306. }
  307. .name_title{
  308. font-size: 28rpx;
  309. margin-bottom: 10rpx;
  310. }
  311. .sub_title{
  312. font-size: 24rpx;
  313. color: #999;
  314. }
  315. }
  316. }
  317. .item:nth-child(2n){
  318. box-sizing: border-box;
  319. border-left: 1rpx solid #F2FAF7;
  320. padding-left: 40rpx;
  321. }
  322. }
  323. }
  324. </style>