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
VITE_SHOW_SOURCEMAP = true
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,
appid: VITE_UNI_APPID,
description: '',
versionName: '2.0.0',
versionCode: '20250529',
versionName: '1.1.22',
versionCode: '20250530',
transformPx: false,
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
/* 5+App特有相关 */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
</cxc-szcx-stationJl-select>
</view>
</view>
<button size="mini" @click="getData">连接WebSocket</button>
<!-- <button size="mini" @click="getData">连接WebSocket</button> -->
<view class="container">
<view v-for="(item, index) in jlData" :key="index" class="card">
@ -114,18 +114,7 @@
});
uni.onSocketMessage(function(res) {
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
uni.onSocketClose(function(res) {
@ -141,15 +130,22 @@
console.log(2, e, data.value);
stationID.value = e
stationName.value = data.value.title
getScData(); //
}
const getScData= ()=>{
uni.request({
url: jlByzc.value + '?zhanc=' + stationID.value + '&jldLx=0',
method: 'GET',
success: (res) => {
console.log(res)
jlData.value = JSON.parse(res.data.result).JlData;
}
})
}
const websock = ref(null);
const timer2 = ref(null);
//
@ -157,7 +153,10 @@
timer2.value = setInterval(() => {
if (websock.value && websock.value.readyState === 1) {
//
connectSocketInit()
// connectSocketInit()
}
if(stationID.value){
getScData();
}
}, 1000);
};
@ -176,9 +175,13 @@
websocketheart()
})
onUnmounted(()=>{ //
//
console.log(22222)
clearInterval(timer2.value);
})
//
const formatNumber = (num) => {
let temp = 0;