workbench-新版样式.vue 7.8 KB

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