Merge branch 'minJeecg' into 'master'

Min jeecg

See merge request cxcxt/jeecguniapp!12
This commit is contained in:
闵 年泽 2025-06-04 11:22:36 +08:00
commit 1ac32902f9
5 changed files with 61 additions and 26 deletions

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

@ -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

@ -14,7 +14,7 @@
<view class="dot"></view>
<wd-text text="文件预览"></wd-text>
</view>
<view v-if="isH5">
<view v-if="ifH5">
<!-- 在线预览 by -->
<wd-text color="#1890ff" :lines='1' style="font-size: 40rpx;padding-left: 25rpx;padding-top: 25rpx;"
decoration="underline"
@ -35,9 +35,17 @@
</template>
<script setup>
import { isH5 } from '@/utils/platform'
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app';
const detail = ref({})
const detailArr = ref([])
const ifBackAll = ref(false); //
//h5 by
var ifH5 = false;
const onlinePreview = (url) => { //线 by
uni.navigateTo({
url: url
@ -50,13 +58,31 @@
}
onLoad((options) => {
console.log(2222)
detail.value = options.data
detailArr.value = options.data.split(",");
//#ifdef H5 || MP-WEIXIN
ifH5 = true;
//#endif
//
if (detailArr.value && detailArr.value.length == 1) {
let url = '/pages/onlinePreview/onlinePreview';
if (isH5) url = '/pages/onlinePreview/onlinePreviewH5'
onlinePreview(url + `?data=${JSON.stringify(options.data)}`);
if (ifH5) url = '/pages/onlinePreview/onlinePreviewH5'
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;