style:样式调整

This commit is contained in:
houjunxiang
2025-10-11 16:25:24 +08:00
parent c8b2d8683e
commit b5aed8573a
15 changed files with 405 additions and 721 deletions

View File

@@ -31,5 +31,5 @@ export function getUpgradeBaseUrl() {
} }
export function getWebSocketUrl() { export function getWebSocketUrl() {
// return uni.getStorageSync('base_url').replace('/api', '') + '/ws' // return uni.getStorageSync('base_url').replace('/api', '') + '/ws'
return 'ws://localhost:8330' return 'ws://192.168.26.178:8330'
} }

File diff suppressed because it is too large Load Diff

View File

@@ -165,7 +165,7 @@ export default {
}, },
//发送消息 //发送消息
send(data) { send(data) {
console.log('发送消息。。。') console.log('发送消息。。。', data)
if (!this.isOpen) { if (!this.isOpen) {
//关闭则打开 //关闭则打开
this.open() this.open()

View File

@@ -131,7 +131,6 @@ http.interceptors.response.use(
// } // }
const userStore = $store('user') const userStore = $store('user')
const isLogin = userStore.isLogin
response.config.custom.showLoading && closeLoading() response.config.custom.showLoading && closeLoading()
console.log('response', JSON.parse(JSON.stringify(response.data))) console.log('response', JSON.parse(JSON.stringify(response.data)))

View File

@@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<navbar-back title="天平状态"></navbar-back> <navbar-back title="天平状态"></navbar-back>
<up-grid border :col="3"> <up-grid border :col="4">
<up-grid-item v-for="(auncel, index) in auncelList" :index="index" :key="index"> <up-grid-item v-for="(auncel, index) in auncelList" :index="index" :key="index">
<view class="auncel-item" :style="{ backgroundImage: `url(${balanceBackground})` }"> <view class="auncel-item" :style="{ backgroundImage: `url(${balanceBackground})` }">
<view class="auncel-header"> <view class="auncel-header">
@@ -25,7 +25,7 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'
import { onUnload, onHide } from '@dcloudio/uni-app' import { onUnload, onHide } from '@dcloudio/uni-app'
import { getTenantId } from '@/defaultBaseUrl' import { getTenantId } from '@/defaultBaseUrl'
import nx from '@/nx' import nx from '@/nx'
const balanceBackground = new URL('/static/images/auncel.png', import.meta.url).href const balanceBackground = '/static/images/auncel.png'
// refs // refs
const auncelList = ref([]) const auncelList = ref([])
@@ -36,7 +36,7 @@ const userInfo = computed(() => nx.$store('user').userInfo)
// 页面加载 // 页面加载
onMounted(() => { onMounted(() => {
getPageData() getPageData()
// #ifdef H5
const regData = { const regData = {
msgId: nx.$helper.uuid(), msgId: nx.$helper.uuid(),
cmd: 'register', cmd: 'register',
@@ -48,8 +48,7 @@ onMounted(() => {
} }
} }
nx.$measure.setRegData(JSON.stringify(regData)) nx.$measure.setRegData(JSON.stringify(regData))
nx.$measure.reOpen() nx.$measure.open()
// #endif
// 监听 WebSocket 数据 // 监听 WebSocket 数据
uni.$on('deviceData', handleDeviceData) uni.$on('deviceData', handleDeviceData)

View File

@@ -0,0 +1,5 @@
export const getDataSourceTypeShow = val => {
if (val === 2) return '【筛上】'
if (val === 3) return '【筛下】'
return ''
}

View File

@@ -0,0 +1,79 @@
<!-- components/TaskItem.vue -->
<template>
<view class="u-tab-item" :class="{ 'u-tab-item-active': active }" @tap.stop="handleClick">
<u-row class="full-width">
<u-col span="2" class="text-center" style="position: relative">
<u-icon :color="taskStyle(task)" name="tags-fill" size="34"></u-icon>
<text class="seq">{{ seq }}</text>
</u-col>
<u-col span="10">
<view class="fs18">{{ task.taskNo }}</view>
<view class="mt3 mb3">{{ task.taskName }}{{ task.assayOper }}</view>
<view class="x-f">
<u-icon name="clock"></u-icon>
<text class="ml5">{{ task.taskOperTime }}</text>
</view>
</u-col>
</u-row>
</view>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
task: {
type: Object,
required: true
},
active: {
type: Boolean,
default: false
},
seq: {
type: Number,
required: true
}
})
const emit = defineEmits(['click'])
const handleClick = () => {
emit('click')
}
// 与原逻辑一致的 taskStyle 方法
const taskStyle = task => {
if ((task.weightTaskStatus === 0 || task.weightTaskStatus === 1) && task.reviewCount > 0) return 'red'
if (task.weightTaskStatus === 2 && task.reviewCount > 0) return 'green'
return ''
}
</script>
<style lang="scss" scoped>
.u-tab-item {
padding: 3px;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #444;
border-bottom: 2px dotted;
}
.u-tab-item-active {
position: relative;
color: #0055a2;
font-weight: 600;
background: #fff;
}
.seq {
position: absolute;
top: 9px;
left: 12px;
color: #fff;
font-size: 11px;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More