feat:查询条件调整

This commit is contained in:
houjunxiang
2025-11-14 17:46:43 +08:00
parent 45ba9b4899
commit d3f6ad4bf6
8 changed files with 412 additions and 136 deletions

View File

@@ -3,7 +3,7 @@
<u-popup :show="showAuncelSelector" closeable @close="close" @open="open" mode="right"> <u-popup :show="showAuncelSelector" closeable @close="close" @open="open" mode="right">
<view class="p10">天平选择</view> <view class="p10">天平选择</view>
<scroll-view scroll-y="true" class="content"> <scroll-view scroll-y="true" class="content">
<u-grid border :col="3" @click="doSelect"> <u-grid :col="3" @click="doSelect" style="gap: 20px">
<u-grid-item v-for="(auncel, index) in auncelList" :index="index" :key="index"> <u-grid-item v-for="(auncel, index) in auncelList" :index="index" :key="index">
<view class="auncel-item"> <view class="auncel-item">
<view class="auncel-name"> <view class="auncel-name">
@@ -18,6 +18,7 @@
<view v-if="auncel.isConnected === 1" class="weight-unit">{{ auncel.weightUnit }}</view> <view v-if="auncel.isConnected === 1" class="weight-unit">{{ auncel.weightUnit }}</view>
</view> </view>
</view> </view>
<view v-if="auncel.isConnected != 1" class="shade">天平断开</view>
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
</scroll-view> </scroll-view>
@@ -164,7 +165,7 @@ const handleDeviceStatus = res => {
if (item.id === res.deviceId) { if (item.id === res.deviceId) {
item.isConnected = res.connected item.isConnected = res.connected
if (res.connected == 0) { if (res.connected == 0) {
item.weightData = '天平断开' item.weightData = ''
item.weightUnit = '' item.weightUnit = ''
item.weightStable = 0 item.weightStable = 0
} }
@@ -199,7 +200,7 @@ onUnmounted(() => {
}) })
function getWeightText(auncel) { function getWeightText(auncel) {
if (auncel.isConnected !== 1) { if (auncel.isConnected !== 1) {
return '天平断开' return ''
} }
return auncel.weightData || '' return auncel.weightData || ''
} }
@@ -227,8 +228,9 @@ function getWeightStyle(auncel) {
<style scoped lang="scss"> <style scoped lang="scss">
.content { .content {
width: 80vw; width: 60vw;
height: 90vh; height: 90vh;
padding: 0 20px 40px 20px;
} }
.auncel-item { .auncel-item {
height: 180px; height: 180px;
@@ -239,6 +241,22 @@ function getWeightStyle(auncel) {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.shade {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
background-color: #000;
opacity: 0.6;
color: #fff;
font-weight: 500;
z-index: 10;
border-radius: 8px;
}
.auncel-name { .auncel-name {
flex: 1; flex: 1;
text-align: center; text-align: center;

View File

@@ -330,28 +330,36 @@ function accAdd(arg1, arg2) {
// 通过配置项分组 // 通过配置项分组
export function groupByField(list, cupNumFieldIndex, groupKey = 'groupDictionaryBusinessKey') { export function groupByField(list, cupNumFieldIndex, groupKey = 'groupDictionaryBusinessKey') {
const groupMap = new Map() const groupMap = new Map()
// 插入“全部”项
list.unshift({ groupDictionaryBusinessKey: 'all', groupDictionaryBusinessName: '全部' }) list.unshift({ groupDictionaryBusinessKey: 'all', groupDictionaryBusinessName: '全部' })
for (const item of list) { for (const item of list) {
// 赋值杯号fieldindex // 赋值杯号 fieldIndex
if (item.title === '杯号') { if (item.title === '杯号') {
cupNumFieldIndex.value = item.fieldIndex cupNumFieldIndex.value = item.fieldIndex
} }
const key = item[groupKey]
if (!key) continue // 跳过没有 group 的项(可选)
let key = item[groupKey]
// 如果没有有效 key统一归入自定义分组
if (!key) {
key = 'customParameter' // 使用固定字符串作为无 key 项的分组标识
}
// 如果该分组不存在,初始化
if (!groupMap.has(key)) { if (!groupMap.has(key)) {
groupMap.set(key, { groupMap.set(key, {
value: key, value: key,
label: item.groupDictionaryBusinessName, // 假设 title 在每个 item 中,且同组相同 label: key === 'customParameter' ? '分析项目' : item.groupDictionaryBusinessName || '未知分组',
fields: [] fields: []
}) })
} }
// 当前项(或仅需要的部分)推入 fields // 当前项加入对应分组
groupMap.get(key).fields.push(item) groupMap.get(key).fields.push(item)
} }
// 转为数组
return Array.from(groupMap.values()) return Array.from(groupMap.values())
} }

View File

@@ -6,9 +6,7 @@
import Request from 'luch-request' import Request from 'luch-request'
import { getBaseUrl, getTenantId } from '@/defaultBaseUrl' import { getBaseUrl, getTenantId } from '@/defaultBaseUrl'
import $store from '@/nx/store' import $store from '@/nx/store'
import { ApiEncryption } from '@/nx/utils/crypto.js' import qs from 'qs'
const apiEncryption = new ApiEncryption()
const options = { const options = {
// 显示操作成功消息 默认不显示 // 显示操作成功消息 默认不显示
@@ -62,7 +60,10 @@ const http = new Request({
// 跨域请求时是否携带凭证cookies仅H5支持HBuilderX 2.6.15+ // 跨域请求时是否携带凭证cookies仅H5支持HBuilderX 2.6.15+
withCredentials: false, withCredentials: false,
// #endif // #endif
custom: options custom: options,
paramsSerializer(params) {
return qs.stringify(params, { arrayFormat: 'indices' })
}
}) })
/** /**

247
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -15,10 +15,11 @@
"gm-crypto": "^0.1.12", "gm-crypto": "^0.1.12",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"luch-request": "^3.0.8", "luch-request": "^3.0.8",
"mathjs": "^13.0.3",
"md5": "^2.3.0", "md5": "^2.3.0",
"pinia": "^2.0.24", "pinia": "^2.0.24",
"pinia-plugin-persist-uni": "^1.2.0", "pinia-plugin-persist-uni": "^1.2.0",
"mathjs": "^13.0.3" "qs": "^6.14.0"
}, },
"devDependencies": { "devDependencies": {
"prettier": "^2.7.1", "prettier": "^2.7.1",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -188,7 +188,7 @@ const checkWork = () => {
const startWork = () => { const startWork = () => {
// if (!checkWork()) return // if (!checkWork()) return
uni.navigateTo({ uni.navigateTo({
url: `/pages/analysis/sample/sample-work-detail?currentTaskId=${currentTask.value.id}` url: `/pages/analysis/sample/sample-work-detail?currentTaskId=${currentTask.value.id}&configReportTemplateKey=${currentTask.value.configReportTemplateKey}`
}) })
} }
@@ -205,7 +205,8 @@ const switchTask = async index => {
const getAssayTask = () => { const getAssayTask = () => {
rollbackContent.value = '' rollbackContent.value = ''
const param = { const param = {
taskStatus: 'submit' taskAssignStatus: 'submitted',
taskAssayStatusList: ['not_start', 'saved']
// assayOper: userInfo.value.nickname // assayOper: userInfo.value.nickname
} }
nx.$api.assayTask.getAssayTaskList(param).then(res => { nx.$api.assayTask.getAssayTaskList(param).then(res => {