提交 f71c6784 作者: wk

完成待办刷新

父级 54e264c4
const $imageUtils = {
httpToHttps: function(url) {
var newPath = ''
if (url) {
let array = url.split("://")
if (array[0] === "http") {
array[0] = "https"
newPath = array[0] + "://" + array[1]
} else {
newPath = url
}
}
if (newPath.indexOf(',') != -1) {
var urls = newPath.split(",")
return urls[0]
}
return newPath
}
}
export default $imageUtils
let base_oss_url = ""
if (process.env.NODE_ENV === 'development') {
// 开发环境
base_oss_url = 'https://dev-hibuilding.oss-cn-hangzhou.aliyuncs.com/'
} else {
// 生产环境
base_oss_url = 'https://hibuilding.oss-cn-hangzhou.aliyuncs.com/'
}
export default base_oss_url
...@@ -4,7 +4,7 @@ import './sha1.js'; ...@@ -4,7 +4,7 @@ import './sha1.js';
import { import {
Base64 Base64
} from './base64.js'; } from './base64.js';
import base_oss_url from '../config.js' import base_oss_url from "./config.js"
const uploadFileSize = 1024 * 1024 * 100; // 上传文件的大小限制100m const uploadFileSize = 1024 * 1024 * 100; // 上传文件的大小限制100m
const accesskey = 'IR6U1vqAnv7noj0qrMCwVFXjMdzFxL'; // 自己去申请 const accesskey = 'IR6U1vqAnv7noj0qrMCwVFXjMdzFxL'; // 自己去申请
const accessId = 'LTAILXlaleXLe8Cf' // 自己去申请 const accessId = 'LTAILXlaleXLe8Cf' // 自己去申请
...@@ -35,7 +35,8 @@ export default { ...@@ -35,7 +35,8 @@ export default {
}, },
getFileName(filename) { getFileName(filename) {
console.log('filename:', filename) console.log('filename:', filename)
return 'wx_img/' + new Date().getTime() + Math.random().toString(36).substring(3, 20) + this._getSuffix(filename) return 'wx_img/' + new Date().getTime() + Math.random().toString(36).substring(3, 20) + this._getSuffix(
filename)
}, },
getImage() { getImage() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<swiper-item v-for="(item,index) in list" :key='index' @click="$emit('clickItem',item)"> <swiper-item v-for="(item,index) in list" :key='index' @click="$emit('clickItem',item)">
<view v-if="list && list.length>0" class="item" <view v-if="list && list.length>0" class="item"
:class="[!crown ? '' : current==index ? 'crown-active':'crown']"> :class="[!crown ? '' : current==index ? 'crown-active':'crown']">
<image v-if="!slots" class="item-img" :class="[imgShadow?'imgShadow':'']" :src="item[imgKey]" <image v-if="!slots" class="item-img" :class="[imgShadow?'imgShadow':'']" :src="httpToHttps(item[imgKey])"
:style="{ borderRadius: imgRadius + 'px',width:imgWidth}" mode=""></image> :style="{ borderRadius: imgRadius + 'px',width:imgWidth}" mode=""></image>
<slot v-else :data='item'></slot> <slot v-else :data='item'></slot>
</view> </view>
...@@ -119,6 +119,9 @@ ...@@ -119,6 +119,9 @@
let current = event.detail.current let current = event.detail.current
this.current = current this.current = current
this.$emit('change', this.list[current]) this.$emit('change', this.list[current])
},
httpToHttps(url) {
return this.$imageUtils.httpToHttps(url)
} }
} }
} }
......
...@@ -8,10 +8,15 @@ import $toast from './common/toast.js' ...@@ -8,10 +8,15 @@ import $toast from './common/toast.js'
import $config from './common/config.js' import $config from './common/config.js'
import $mta from "api/mta.js" import $mta from "api/mta.js"
import $http from './api/request.js' import $http from './api/request.js'
import $imageUtils from './common/imageUtils.js'
Vue.prototype.$http = $http Vue.prototype.$http = $http
Vue.prototype.$mta = $mta Vue.prototype.$mta = $mta
Vue.prototype.$toast = $toast Vue.prototype.$toast = $toast
Vue.prototype.$config = $config Vue.prototype.$config = $config
Vue.prototype.$imageUtils = $imageUtils
// Vue.prototype.webUrl = "https://dev-console.hzdingmao.com"
// Vue.prototype.webUrl = "https://test-console.hzdingmao.com"
Vue.prototype.webUrl = "https://console.hibuilding.cn"
Vue.prototype.getToken = function() { Vue.prototype.getToken = function() {
return uni.getStorageSync("token") return uni.getStorageSync("token")
} }
......
...@@ -484,7 +484,25 @@ ...@@ -484,7 +484,25 @@
} }
} }
], ,{
"path" : "pages/monitor/zhgdMonitor/zhgdMonitor",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/monitor/labourMonitor/labourMonitor",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
......
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
<view v-for="(item,index) in list" :key="index" class="list-item" @click="itemClick(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @click="itemClick(item)">
<image class="image" src="../../../static/ic-jrdb.png"></image> <image class="image" src="../../../static/ic-jrdb.png"></image>
<view class="item-content"> <view class="item-content">
<view class="title">张三发起了隐患整改,请于2022/12/13 15:37:56前完成隐患整改。</view> <view class="title">{{item.created_by_name}}发起了{{item.app_name}},请于{{item.expect_end_date}}前完成。
</view>
<view class="time-content"> <view class="time-content">
<view class="create-time">2022/12/13 15:39:56</view> <view class="create-time">{{item.end_opt_time}}</view>
<view class="leave-time">处理倒计时:0天20小时23分</view> <view class="leave-time">处理倒计时:{{timeSpace(item.end_opt_time)}}</view>
</view> </view>
<view class="line" style="margin: 30rpx 0;"></view> <view class="line" style="margin: 30rpx 0;"></view>
</view> </view>
......
<template> <template>
<view class="content"> <view class="content">
<titleBar title="完成待办"></titleBar> <titleBar title="完成待办"></titleBar>
<view class="count-content">已经完成【10】条待办事项</view> <view class="count-content">已经完成【{{totalCount}}】条待办事项</view>
<view class="list-content"> <view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @click="itemClick(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @click="itemClick(item)">
<image class="image" src="../../../static/ic-jrdb.png"></image> <image class="image" src="../../../static/ic-jrdb.png"></image>
<view class="item-content"> <view class="item-content">
<view class="title">张三发起了隐患整改,请于2022/12/13 15:37:56前完成隐患整改。</view> <view class="title">{{item.created_by_name}}发起了{{item.app_name}},请于{{item.expect_end_date}}前完成。
</view>
<view class="time-content"> <view class="time-content">
<view class="create-time">2022/12/13 15:39:56</view> <view class="create-time">{{item.end_opt_time}}</view>
<view class="leave-time">处理倒计时:0天20小时23分</view> <view class="leave-time">处理倒计时:{{timeSpace(item.end_opt_time)}}</view>
</view> </view>
<view class="line" style="margin: 30rpx 0;"></view> <view class="line" style="margin: 30rpx 0;"></view>
</view> </view>
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
</template> </template>
<script> <script>
import Api from "../../../api/api.js"
export default { export default {
data() { data() {
return { return {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<navbar :title="title" :showBack="false"></navbar> <navbar :title="title" :showBack="false"></navbar>
<view class="project-content" :style="{top:statusBarHeight+45+'px'}" @click="toChangeOrg"> <view class="project-content" :style="{top:statusBarHeight+45+'px'}" @click="toChangeOrg">
<view class="name">{{orgName}}</view> <view class="name">{{orgName}}</view>
<image class="image" src="../../static/down-arrow.png"></image> <image class="image" src="../../static/down-arrow.png" v-if="role=='PM'"></image>
</view> </view>
<view class="message-content" :style="{top:statusBarHeight+78+'px'}"> <view class="message-content" :style="{top:statusBarHeight+78+'px'}">
<view class="item"> <view class="item">
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<uni-grid-item class="grid-item" v-for="(model,modelIndex) in item.data" :key="modelIndex"> <uni-grid-item class="grid-item" v-for="(model,modelIndex) in item.data" :key="modelIndex">
<view class="item" @click="toIndex(model)"> <view class="item" @click="toIndex(model)">
<image :src="model.ydt_logo" class="image" /> <image :src="model.ydt_logo" class="image" />
<view class="single-text" style="color: #666666;font-size: 28rpx;margin-top: 10rpx;"> <view class="name" style="color: #666666;font-size: 28rpx;margin-top: 10rpx;">
{{nameLengthDeal(model.app_name)}} {{nameLengthDeal(model.app_name)}}
</view> </view>
</view> </view>
...@@ -98,7 +98,6 @@ ...@@ -98,7 +98,6 @@
this.orgName = uni.getStorageSync("org_name") this.orgName = uni.getStorageSync("org_name")
} }
this.getAppGroup() this.getAppGroup()
this.getMostUsed()
}, },
onShow() { onShow() {
this.getMessages() this.getMessages()
...@@ -107,6 +106,7 @@ ...@@ -107,6 +106,7 @@
this.orgName = uni.getStorageSync("org_name") this.orgName = uni.getStorageSync("org_name")
}) })
this.getOrgTree() this.getOrgTree()
this.getMostUsed()
}, },
methods: { methods: {
getMostUsed() { getMostUsed() {
...@@ -523,7 +523,7 @@ ...@@ -523,7 +523,7 @@
height: 50rpx; height: 50rpx;
} }
text { .name {
margin-top: 20rpx; margin-top: 20rpx;
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<!-- </view> --> <!-- </view> -->
</view> </view>
<!-- 工地头条 --> <!-- 工地头条 -->
<view class=" top-new-content" @click="toLinkNew" v-if="isCompShow('OnePointNews')"> <view class=" top-new-content" @click="toLinkNew" v-if="isCompShow('OnePointNews')&&role!='VISITOR'">
<image src="../../static/notice.png" class="image"></image> <image src="../../static/notice.png" class="image"></image>
<view class="title">工地头条</view> <view class="title">工地头条</view>
<swiper circular="true" :autoplay="true" class="swiper" :vertical="true"> <swiper circular="true" :autoplay="true" class="swiper" :vertical="true">
...@@ -454,10 +454,14 @@ ...@@ -454,10 +454,14 @@
this.getMyScore() this.getMyScore()
uni.setStorageSync("org_no", this.userInfo.user.org_no) uni.setStorageSync("org_no", this.userInfo.user.org_no)
uni.setStorageSync("org_name", this.userInfo.currentProject.projectName) uni.setStorageSync("org_name", this.userInfo.currentProject.projectName)
this.city = this.userInfo.currentProject.city
this.getWeather()
} }
} }
this.getNews() if (this.role != 'VISITOR') {
this.getBanners() this.getNews()
this.getBanners()
}
} else { } else {
this.$toast.showToast(result.msg) this.$toast.showToast(result.msg)
} }
...@@ -505,7 +509,7 @@ ...@@ -505,7 +509,7 @@
// 获取用户的地理位置, // 获取用户的地理位置,
getLocation() { getLocation() {
const that = this const that = this
uni.getFuzzyLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
altitude: true, altitude: true,
success(res) { success(res) {
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
var urls = newPath.split(",") var urls = newPath.split(",")
return urls[0] return urls[0]
} }
return url return newPath
}, },
toLinkDetail(item) { toLinkDetail(item) {
uni.navigateTo({ uni.navigateTo({
......
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
} }
}, },
toLinkLogin() { toLinkLogin() {
uni.clearStorageSync()
uni.reLaunch({ uni.reLaunch({
url: "/pages/login/login/login" url: "/pages/login/login/login"
}) })
......
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
url: "",
tab: "1",
province_no: "",
city_no: ""
}
},
onLoad: function() {
let short_token = uni.getStorageSync("short_token")
console.log(short_token);
this.url =
`${this.webUrl}/mobileLaborScreen?token_id=${short_token}&tab=1&province_no=${this.province_no}&city_no=${this.city_no}`
},
onShow: function() {
uni.$once("refresh", (res) => {
let short_token = uni.getStorageSync("short_token")
this.province_no = res.province_no
this.city_no = res.city_no
this.url =
`${this.webUrl}/mobileLaborScreen?token_id=${short_token}&tab=2&province_no=${this.province_no}&city_no=${this.city_no}`
})
},
methods: {
}
}
</script>
<style>
</style>
<template> <template>
<view class="content"> <view class="content">
<titleBar title="欢迎您访问工地一点通"></titleBar> <titleBar title="欢迎您访问工地一点通"></titleBar>
<view class="default-content"> <view class="default-content" v-if="!isHasAuth">
<image src="../../static/ic-gth.png" class="image"></image> <image src="../../static/ic-gth.png" class="image"></image>
<view class="default-text">当前无监控台权限</view> <view class="default-text">当前无监控台权限</view>
</view> </view>
...@@ -17,10 +17,59 @@ ...@@ -17,10 +17,59 @@
data() { data() {
return { return {
title: '欢迎您访问一点通', title: '欢迎您访问一点通',
isHasAuth: false,
userInfo: {},
requestParam: {
page: 1,
per_page: 500,
authed: 1,
showed: 1,
app_endpoint: 2,
is_publish: 1,
app_sort: 2
},
apps: [],
} }
}, },
onLoad() {
this.getAppList()
},
onShow() {
this.userInfo = getApp().globalData.userInfo
this.isHasAuth = this.userInfo.identity.code == "PM"
},
methods: { methods: {
// 获取app列表数据
getAppList: function() {
let that = this
this.$http.consoleGet({
url: '/proxy/adminc/v1/system_manage/p_app/application',
data: this.requestParam,
header: {
"access_token": this.getToken()
}
}).then((res) => {
console.log(res.data);
if (res.data.code === 0) {
let list = res.data.data.list
this.apps = list
} else {
this.$toast.showToast(result.msg)
}
})
},
toIndex: function(index) {
let app = this.apps[index]
if (app.app_no == "appletboard") {
uni.navigateTo({
url: "/pages/monitor/zhgdMonitor/zhgdMonitor"
})
} else if (app.app_no == "appletlabourboard") {
uni.navigateTo({
url: "/pages/monitor/labourMonitor/labourMonitor"
})
}
}
} }
} }
</script> </script>
...@@ -63,5 +112,14 @@ ...@@ -63,5 +112,14 @@
color: #333; color: #333;
} }
} }
.list-content {
display: flex;
flex-direction: column;
.item-content {
position: relative;
}
}
} }
</style> </style>
<template>
<view>
<web-view :src="url" webview-styles="webview-style"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
url: "",
short_token: uni.getStorageSync("short_token")
}
},
onLoad: function() {
},
onShow: function() {
this.getWebPage()
},
methods: {
getWebPage: function() {
let userInfo = uni.getStorageSync("user_info")
let company_id = uni.getStorageSync("company_id")
if (!company_id || company_id == 0) {
company_id = userInfo.comp_id //兼容以前登录的账号
}
console.log("当前公司ID", userInfo.comp_id);
this.url =
`${this.webUrl}/mobilePagePreview?from=pageTemplate&categ_no=mobile-page&useage=mobile-page&is_mock=0&company_id=${company_id}&token_id=${this.short_token}&show_project_select=1`
console.log("监控台地址:", this.url);
},
}
}
</script>
<style>
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment