1.修改实时数据,实现秒级数据查询

2.解决单个文件预览时返回上一级没有跳过中间件的问题
This commit is contained in:
lagos 2025-06-04 11:19:19 +08:00
parent 0b0836a91b
commit e204aaa917
8 changed files with 53 additions and 28 deletions

View File

@ -5,4 +5,4 @@ VITE_DELETE_CONSOLE = false
# 是否开启sourcemap # 是否开启sourcemap
VITE_SHOW_SOURCEMAP = true VITE_SHOW_SOURCEMAP = true
VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot' VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot' #VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'

View File

@ -17,8 +17,8 @@ export default defineManifestConfig({
name: VITE_APP_TITLE, name: VITE_APP_TITLE,
appid: VITE_UNI_APPID, appid: VITE_UNI_APPID,
description: '', description: '',
versionName: '2.0.0', versionName: '1.1.22',
versionCode: '20250529', versionCode: '20250530',
transformPx: false, transformPx: false,
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans' locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
/* 5+App特有相关 */ /* 5+App特有相关 */

View File

@ -106,6 +106,7 @@
// //
if (props.type === 'page') { if (props.type === 'page') {
const pages = getCurrentPages() const pages = getCurrentPages()
console.log(router)
if (props.backRouteName || props.backRoutePath) { if (props.backRouteName || props.backRoutePath) {
const prevPage = pages[pages.length - 2] const prevPage = pages[pages.length - 2]
if (prevPage) { if (prevPage) {

View File

@ -2,8 +2,8 @@
"name": "数智产销", "name": "数智产销",
"appid": "__UNI__9F097F0", "appid": "__UNI__9F097F0",
"description": "", "description": "",
"versionName": "2.0.0", "versionName": "1.1.22",
"versionCode": "20250529", "versionCode": "20250530",
"transformPx": false, "transformPx": false,
"app-plus": { "app-plus": {
"usingComponents": true, "usingComponents": true,

View File

@ -105,9 +105,9 @@
let pw = Base64.encode(encodeURIComponent(password.value)) let pw = Base64.encode(encodeURIComponent(password.value))
loading.value = true loading.value = true
/*生产环境 begin */ /*生产环境 begin */
loginApi({ username: un, password: pw }) // loginApi({ username: un, password: pw })
/*开发环境 begin */ /*开发环境 begin */
// loginApi({ username: userName.value, password: password.value, captcha: 'app' }) loginApi({ username: userName.value, password: password.value, captcha: 'app' })
.then((res : any) => { .then((res : any) => {
if (res.success) { if (res.success) {
const { result } = res const { result } = res

View File

@ -43,6 +43,7 @@
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
const detail = ref({}) const detail = ref({})
const detailArr = ref([]) const detailArr = ref([])
const ifBackAll = ref(false); //
//h5 by //h5 by
var ifH5 = false; var ifH5 = false;
const onlinePreview = (url) => { //线 by const onlinePreview = (url) => { //线 by
@ -57,6 +58,7 @@
} }
onLoad((options) => { onLoad((options) => {
console.log(2222)
detail.value = options.data detail.value = options.data
detailArr.value = options.data.split(","); detailArr.value = options.data.split(",");
//#ifdef H5 || MP-WEIXIN //#ifdef H5 || MP-WEIXIN
@ -64,9 +66,23 @@
//#endif //#endif
// //
if (detailArr.value && detailArr.value.length == 1) { if (detailArr.value && detailArr.value.length == 1) {
let url = '/pages/onlinePreview/onlinePreview'; let url = '/pages/onlinePreview/onlinePreview';
if (ifH5) url = '/pages/onlinePreview/onlinePreviewH5' if (ifH5) url = '/pages/onlinePreview/onlinePreviewH5'
onlinePreview(url + `?data=${JSON.stringify(options.data)}`); uni.navigateTo({ //
url: url + `?data=${JSON.stringify(options.data)}`,
success: () => ifBackAll.value = true //
})
}
})
onShow (()=>{
//
console.log(ifBackAll.value)
if(ifBackAll.value){
//
uni.navigateBack({
})
} }
}) })
</script> </script>

View File

@ -19,7 +19,7 @@
@clickItem="onClickItem" styleType="button" activeColor="#0055ff"></uni-segmented-control> @clickItem="onClickItem" styleType="button" activeColor="#0055ff"></uni-segmented-control>
</view> </view>
<view class="content"> <view class="content">
<view v-show="current === 0"> <view v-if="current === 0">
<view style="padding: 0 10px"> <view style="padding: 0 10px">
<view class="progress-bartime"> <view class="progress-bartime">
<!-- 动态设置宽度和颜色 --> <!-- 动态设置宽度和颜色 -->
@ -35,7 +35,7 @@
<yy-data></yy-data> <yy-data></yy-data>
</scroll-view> </scroll-view>
</view> </view>
<view v-show="current === 1"> <view v-if="current === 1">
<scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }"> <scroll-view scroll-y :style="{ height: scrollViewHeight + 'px' }">
<sssjForm></sssjForm> <sssjForm></sssjForm>
</scroll-view> </scroll-view>
@ -98,6 +98,11 @@
window.removeEventListener('resize', calculateScrollViewHeight); window.removeEventListener('resize', calculateScrollViewHeight);
}); });
onHide(()=>{ // by
console.log(555555)
current.value = 0;
})
const calculateScrollViewHeight = () => { const calculateScrollViewHeight = () => {
// //
const screenHeight = uni.getSystemInfoSync().windowHeight; const screenHeight = uni.getSystemInfoSync().windowHeight;

View File

@ -8,7 +8,7 @@
</cxc-szcx-stationJl-select> </cxc-szcx-stationJl-select>
</view> </view>
</view> </view>
<button size="mini" @click="getData">连接WebSocket</button> <!-- <button size="mini" @click="getData">连接WebSocket</button> -->
<view class="container"> <view class="container">
<view v-for="(item, index) in jlData" :key="index" class="card"> <view v-for="(item, index) in jlData" :key="index" class="card">
@ -114,18 +114,7 @@
}); });
uni.onSocketMessage(function(res) { uni.onSocketMessage(function(res) {
console.log('收到服务器内容:' + res.data); console.log('收到服务器内容:' + res.data);
// start
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = 'https://wzs1.oss-cn-beijing.aliyuncs.com/music.mp3';
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
innerAudioContext.onError(res => {
console.log(res.errMsg);
console.log(res.errCode);
});
// end
}); });
// socket // socket
uni.onSocketClose(function(res) { uni.onSocketClose(function(res) {
@ -141,15 +130,22 @@
console.log(2, e, data.value); console.log(2, e, data.value);
stationID.value = e stationID.value = e
stationName.value = data.value.title stationName.value = data.value.title
getScData(); //
}
const getScData= ()=>{
uni.request({ uni.request({
url: jlByzc.value + '?zhanc=' + stationID.value + '&jldLx=0', url: jlByzc.value + '?zhanc=' + stationID.value + '&jldLx=0',
method: 'GET', method: 'GET',
success: (res) => { success: (res) => {
console.log(res)
jlData.value = JSON.parse(res.data.result).JlData; jlData.value = JSON.parse(res.data.result).JlData;
} }
}) })
} }
const websock = ref(null); const websock = ref(null);
const timer2 = ref(null); const timer2 = ref(null);
// //
@ -157,7 +153,10 @@
timer2.value = setInterval(() => { timer2.value = setInterval(() => {
if (websock.value && websock.value.readyState === 1) { if (websock.value && websock.value.readyState === 1) {
// //
connectSocketInit() // connectSocketInit()
}
if(stationID.value){
getScData();
} }
}, 1000); }, 1000);
}; };
@ -177,7 +176,11 @@
websocketheart() websocketheart()
}) })
onUnmounted(()=>{ //
//
console.log(22222)
clearInterval(timer2.value);
})
// //
const formatNumber = (num) => { const formatNumber = (num) => {