123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 |
- <template>
- <view>
- <!-- 工作台头图 -->
- <view class="top">
- <image :src="header"></image>
- </view>
-
- <!-- nav -->
- <view class="section">
- <view class="list">
- <view class="item" v-for="(item,index) in nav" :key="index" @click="go_link(item)">
- <view class="icon">
- <image :src="item.icon" mode=""></image>
- </view>
- <view class="name">
- <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>
- <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>
-
- <view class="name_title">{{item.title}}</view>
- <view class="sub_title">{{item.sub_title}}</view>
- </view>
- </view>
- </view>
- </view>
-
- <view class="section" v-for="(item,index) in module" :key="index">
- <view class="title">
- <view class="icon">
- <image :src="item.icon" mode=""></image>
- </view>
- <view class="text">{{item.title}}</view>
- </view>
- <view class="list">
- <view class="item" v-for="(item_2,index_2) in item.children" :key="index_2" @click="go_link(item_2)">
- <view class="icon">
- <image :src="item_2.icon" mode=""></image>
- </view>
- <view class="name">
- <view class="name_title">{{item_2.title}}</view>
- <view class="sub_title">{{item_2.sub_title}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 当前煤矿编码
- mine_code: "",
-
- // 头部图片
- header:"",
- nav: [],
- module: [],
-
- num_1:0,
- num_2:0
- };
- },
- onLoad() {
- // 初始化当前煤矿编码
- this.mine_code = uni.getStorageSync('mine_code')
- this.get_workbench_index()
-
- this.get_workflow_todo_query_1()
- this.get_workflow_todo_query_2()
- },
- methods: {
- // 获取基础数据
- get_workbench_index(){
- this.$api.workbench_index({
-
- }).then((res) => {
-
- this.header = res.data.data.header
- this.nav = res.data.data.nav
- this.module = res.data.data.module
- })
- },
-
- // 获取消息提醒数量
- get_workflow_todo_query_1(){
- this.$api.workflow_todo_query({
- staff_num: uni.getStorageSync('user').staff_num,
- query_type: 2
- }).then((res)=>{
-
- this.num_1 = res.data.content.data
- })
- },
- get_workflow_todo_query_2(){
- this.$api.workflow_todo_query({
- staff_num: uni.getStorageSync('user').staff_num,
- query_type: 1
- }).then((res)=>{
-
- this.num_2 = res.data.content.data
- })
- },
- go_link(item) {
- // console.log(item)
-
- let link = item.link
-
- // OA系统
- if(link.indexOf("oa_system.nxjiewei.com") != -1 ){
- uni.navigateTo({
- url:"../../origanization/OA/h5/h5",
- success: (res) =>{
- // 通过eventChannel向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- url: link,
- title: item.title
- })
- }
- })
-
- return
- }
- // 二维码
- if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
- let pageId = ""
- function GetQueryString(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
- var r = link.match(reg);
- if (r != null) return unescape(r[2]);
- return null;
- }
- console.log(GetQueryString("pageId"))
- if (GetQueryString("pageId")) {
- pageId = GetQueryString("pageId")
- } else {
- pageId = link.split('=')[1]
- }
- uni.navigateTo({
- url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
- })
- }
- // h5
- if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
- console.log("H5")
- // #ifdef APP
- if (plus.os.name == 'Android') {
-
- if (link.indexOf("cmb.pb") != -1) {
- plus.runtime.launchApplication({
- pname: 'cmb.pb'
- }, (e) => {
- console.log('Open system default browser failed: ' + e.message)
-
- uni.showToast({
- icon: "none",
- title: "未安装此应用"
- })
- })
- } else if (link.indexOf("com.icbc") != -1) {
- plus.runtime.launchApplication({
- pname: 'com.icbc'
- }, (e) => {
- console.log('Open system default browser failed: ' + e.message)
-
- uni.showToast({
- icon: "none",
- title: "未安装此应用"
- })
- })
- } else {
- uni.navigateTo({
- url: "../../workbench/h5/h5?url=" + link
- })
- }
-
-
- }
-
- // #endif
-
- // #ifdef H5
- uni.navigateTo({
- url: "../../workbench/h5/h5?url=" + link
- })
- // #endif
- }
- // 原生
- if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
- console.log("原生")
- console.log(link)
- // 发票助手
- if (link.indexOf("/workBench/invoice") != -1) {
- console.log("发票助手")
- uni.navigateTo({
- url: "../../workbench/invoice_assistant/invoice_assistant"
- })
- } else if (link.indexOf("/news/news_win") != -1) {
- console.log("通知公告")
- uni.navigateTo({
- url: "../../my/message-reminder/message-reminder"
- })
- } else if (link.indexOf("/workBench/getDuty") != -1) {
- console.log("值班信息")
- uni.navigateTo({
- url: "../../workbench/duty_information/duty_information"
- })
- } else if (link.indexOf("/workBench/huiyiList") != -1) {
- console.log("会议列表")
- uni.navigateTo({
- url: "../../workbench/meeting_arrangements/meeting_arrangements"
- })
- } else if (link.indexOf("/workBench/lifeCircleWin") != -1) {
- console.log("生活圈")
- uni.showToast({
- icon: "none",
- title: "暂未开通"
- })
- } else if (link.indexOf("/productionData/logging") != -1) {
- console.log("下井记录")
- // people_num 特殊值
- if (!uni.getStorageSync('people_code')) {
- uni.navigateTo({
- url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name=" +
- uni.getStorageSync('user').section + "&name=" + uni.getStorageSync('user')
- .name + "&mine=640323B0011010019259"
- })
- } else {
- uni.navigateTo({
- 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"
- })
- }
- }else if(link.indexOf("/browseQrcode/gridSubmitItem_win") != -1){
- console.log("网格排查")
- uni.navigateTo({
- url:"../../workbench/gridding/gridding"
- })
- }else if(link.indexOf("/workBench/evaluate") != -1){
- console.log("干部评测")
- uni.navigateTo({
- url:"../../workbench/h5/h5?mine_code=zaoquan&workBench=pingce"
- })
- }else if(link.indexOf("/productionData/persnoalLocation") != -1){
- uni.navigateTo({
- url:"../../production/personnel_orientation/personnel_orientation?mine=640181B0011010030750"
- })
- } else {
- uni.showToast({
- icon: "none",
- title: "暂未开通"
- })
- }
- }
- }
- },
- }
- </script>
- <style lang="scss">
- page{
- background-color: #F2FAF7;
- margin-bottom: 20rpx;
- }
- .top{
- image{
- width: 750rpx;
- height: 270rpx;
- display: block;
- }
- }
-
- .section{
- margin-top: 20rpx;
- background-color: #FFFFFF;
-
- padding: 25rpx;
- .title{
- display: flex;
- align-items: center;
- height: 90rpx;
- .icon{
- margin-right: 20rpx;
- image{
- width: 50rpx;
- height: 50rpx;
- display: block;
- }
- }
- .text{
- font-weight: 700;
- font-size: 34rpx;
- }
- }
-
- .list{
- margin-top: 30rpx;
- width: 700rpx;
- overflow: hidden;
- .item{
-
- float: left;
- margin-bottom: 30rpx;
-
- width: 350rpx;
-
- display: flex;
- align-items: center;
- height: 140rpx;
-
- .icon{
- margin-bottom: 10rpx;
- image{
- width: 90rpx;
- height: 90rpx;
- display: block;
- }
-
-
- }
- .name{
- position: relative;
-
- margin-left: 20rpx;
- .num{
- z-index: 10;
- position: absolute;
- top: -10rpx;
- right: -50rpx;
-
- width: 40rpx;
- text-align: center;
- line-height: 40rpx;
- background-color: #F56C6C;
- border-radius: 50%;
- color: #FFF;
- font-size: 26rpx;
- }
- .name_title{
- font-size: 28rpx;
- margin-bottom: 10rpx;
- }
- .sub_title{
- font-size: 24rpx;
- color: #999;
- }
- }
- }
-
- .item:nth-child(2n){
- box-sizing: border-box;
- border-left: 1rpx solid #F2FAF7;
-
- padding-left: 40rpx;
-
- }
-
- }
- }
- </style>
|