feat:地址配置
This commit is contained in:
@@ -1,36 +1,40 @@
|
||||
// 在此不用配置接口前缀
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://172.16.46.62:30081/admin-api'
|
||||
// const BaseUrl = isDev ? 'http://192.168.26.163:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||
//
|
||||
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
||||
const upgradeBaseUrl = 'http://192.168.26.116:888/admin-api'
|
||||
// 正式环境
|
||||
const BaseUrl = isDev ? 'http://172.17.19.29:48080/admin-api' : 'http://172.17.19.29:48080/admin-api'
|
||||
const upgradeBaseUrl = isDev? 'http://172.17.19.29:48080/admin-api':'http://172.17.19.29:48080/admin-api'
|
||||
const websocketUrl = isDev ? 'ws://172.17.19.11:30330' : 'ws://172.17.19.11:30330'
|
||||
|
||||
// 公司测试环境
|
||||
// const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||
// const upgradeBaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||
// const websocketUrl = isDev ? 'ws://192.168.26.116:888/ws' : 'ws://192.168.26.116:888/ws'
|
||||
|
||||
const tenantId = '1'
|
||||
export const clientId = 'zgty_lims'
|
||||
|
||||
function initDefaultBaseUrl() {
|
||||
uni.setStorageSync('base_url', BaseUrl)
|
||||
uni.setStorageSync('tenant_id', tenantId)
|
||||
uni.setStorageSync('baseUrl', BaseUrl)
|
||||
uni.setStorageSync('tenantId', tenantId)
|
||||
uni.setStorageSync('upgradeBaseUrl', upgradeBaseUrl)
|
||||
uni.setStorageSync('webSocketUrl', websocketUrl)
|
||||
}
|
||||
initDefaultBaseUrl()
|
||||
|
||||
export function getBaseUrl() {
|
||||
return uni.getStorageSync('base_url')
|
||||
return uni.getStorageSync('baseUrl')
|
||||
}
|
||||
|
||||
export function getImgBaseUrl() {
|
||||
return uni.getStorageSync('base_url').replace('/api', '')
|
||||
return uni.getStorageSync('baseUrl').replace('/api', '')
|
||||
}
|
||||
export function getTenantId() {
|
||||
return uni.getStorageSync('tenant_id')
|
||||
return uni.getStorageSync('tenantId')
|
||||
}
|
||||
|
||||
export function getUpgradeBaseUrl() {
|
||||
return uni.getStorageSync('upgradeBaseUrl')
|
||||
}
|
||||
export function getWebSocketUrl() {
|
||||
// return uni.getStorageSync('base_url').replace('/api', '') + '/ws'
|
||||
return 'ws://192.168.26.116:888/ws'
|
||||
return uni.getStorageSync('webSocketUrl')
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name" : "实验室管理系统",
|
||||
"appid" : "__UNI__4B3B4B0",
|
||||
"description" : "实验室管理系统",
|
||||
"versionName" : "1.0.1",
|
||||
"versionCode" : 101,
|
||||
"versionName" : "1.0.2",
|
||||
"versionCode" : 102,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
@@ -95,21 +95,21 @@
|
||||
/* 可选,JSON对象,应用UserAgent相关配置 **/
|
||||
"useragent" : {
|
||||
/* 可选,字符串类型,设置的默认userAgent值 */
|
||||
"value" : "LIMS-PDA/1.0.0",
|
||||
"value" : "LIMS-PDA/1.0.2",
|
||||
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
||||
"concatenate" : true
|
||||
},
|
||||
/* 可选,JSON对象,Android平台应用UserAgent相关配置,优先级高于useragent配置 */
|
||||
"useragent_android" : {
|
||||
/* 可选,字符串类型,设置的默认userAgent值 */
|
||||
"value" : "LIMS-PDA/1.0.0",
|
||||
"value" : "LIMS-PDA/1.0.2",
|
||||
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
||||
"concatenate" : true
|
||||
},
|
||||
/* 可选,JSON对象,iOS平台应用UserAgent相关配置,优先级高于useragent配置 */
|
||||
"useragent_ios" : {
|
||||
/* 可选,字符串类型,设置的默认userAgent值 */
|
||||
"value" : "LIMS-PDA/1.0.0",
|
||||
"value" : "LIMS-PDA/1.0.2",
|
||||
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
||||
"concatenate" : true
|
||||
}
|
||||
|
||||
@@ -237,6 +237,8 @@ export default {
|
||||
reportTemplate: res.content,
|
||||
reportData: JSON.stringify(reportData)
|
||||
}
|
||||
console.log(printData)
|
||||
|
||||
//连接打印服务
|
||||
let printList = uni.getStorageSync('KEY_PRINT_LIST')
|
||||
if (printList && printList.length > 0) {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<scroll-view scroll-y scroll-with-animation style="height: calc(82vh - 60px)">
|
||||
<block v-for="(sample, index) in sampleList" :key="index">
|
||||
<view class="sample-item">
|
||||
<u-row @click="showSampleDetail(sample.businessAssayTaskDataId, index)">
|
||||
<u-row @click="showSampleDetail(sample, index)">
|
||||
<u-col span="2" class="text-center">
|
||||
<view>
|
||||
<text>【{{ index + 1 }}】</text>
|
||||
@@ -61,8 +61,18 @@
|
||||
<rich-text :nodes="sample.assayProject"> </rich-text>
|
||||
</view>
|
||||
</u-col>
|
||||
<!-- <u-col span="2">
|
||||
<view class="remark-text">
|
||||
{{sample.remark}}
|
||||
</view>
|
||||
</u-col> -->
|
||||
</u-row>
|
||||
<u-icon class="sample-status" name="/static/images/status/return_b.png" size="45" />
|
||||
<u-icon
|
||||
v-if="sample.rollbackStatus"
|
||||
class="sample-status"
|
||||
:name="`/static/images/status/${sampleReturnIcon(sample.rollbackStatus)}.png`"
|
||||
size="45"
|
||||
/>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
@@ -116,6 +126,18 @@ function handleScrolltolower() {
|
||||
scrollToLower()
|
||||
}
|
||||
|
||||
const sampleReturnIcon = rollbackStatus => {
|
||||
switch (rollbackStatus) {
|
||||
case 'returned':
|
||||
return 'return_returned'
|
||||
case 'rejected':
|
||||
return 'return_rejected'
|
||||
case 'in_progress':
|
||||
return 'return_in_progress'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
}
|
||||
const currentTask = computed(() => {
|
||||
if (listData.value.length > 0) {
|
||||
return listData.value[selectedIndex.value]
|
||||
@@ -129,8 +151,9 @@ const switchTask = async index => {
|
||||
getAssayTaskDetail(currentTask.value.id)
|
||||
}
|
||||
|
||||
const showSampleDetail = (id, index) => {
|
||||
detailId.value = id
|
||||
const showSampleDetail = (sample, index) => {
|
||||
if(sample.rollbackStatus === 'returned') return
|
||||
detailId.value = sample.businessAssayTaskDataId
|
||||
showDetailPopup.value = true
|
||||
}
|
||||
const searchParams = computed(() => ({
|
||||
@@ -205,4 +228,7 @@ onBackPress(() => {
|
||||
.selected_Sample {
|
||||
background-color: #d7e9fa;
|
||||
}
|
||||
.remark-text{
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -54,11 +54,11 @@
|
||||
class="u-tab-item"
|
||||
:class="[
|
||||
currentSampleIndex === index ? 'u-tab-item-active' : '',
|
||||
sample.rollbackStatus === 'in_progress' ? 'u-tab-item-disabled' : ''
|
||||
]"
|
||||
:data-current="index"
|
||||
@tap.stop="switchSample(index, false)"
|
||||
>
|
||||
<!-- sample.rollbackStatus === 'in_progress' ? 'u-tab-item-disabled' : '' 退回disabled暂不显示 -->
|
||||
<u-badge type="warning" :value="index + 1"></u-badge>
|
||||
<view class="ml20">
|
||||
<view>
|
||||
|
||||
@@ -268,12 +268,17 @@ const realFormData = computed(() => {
|
||||
// 实际保存逻辑
|
||||
async function handleSave(change) {
|
||||
let params = {}
|
||||
const staticFieldKeys = staticFormSchema.map(item => item.fieldKey);
|
||||
const dynamicData = Object.fromEntries(
|
||||
Object.entries(realFormData.value).filter(([key]) => !staticFieldKeys.includes(key))
|
||||
);
|
||||
console.log(dynamicData)
|
||||
if (change) {
|
||||
// 计算样品数据
|
||||
updateTableDataByConfigFields()
|
||||
params = {
|
||||
...realFormData.value,
|
||||
formValue: JSON.stringify(realFormData.value),
|
||||
formValue: JSON.stringify(dynamicData),
|
||||
assayTaskAnalysisDataList: tabs.value.map(item => ({
|
||||
datas: item.tableData,
|
||||
analysisType: item.name
|
||||
@@ -282,7 +287,7 @@ async function handleSave(change) {
|
||||
} else {
|
||||
params = {
|
||||
...realFormData.value,
|
||||
formValue: JSON.stringify(realFormData.value)
|
||||
formValue: JSON.stringify(dynamicData)
|
||||
}
|
||||
}
|
||||
await nx.$api.assayTask.saveBatchSmpleAndQcAnalysis(params)
|
||||
|
||||
@@ -61,6 +61,11 @@
|
||||
<rich-text :nodes="sample.assayProject"> </rich-text>
|
||||
</view>
|
||||
</u-col>
|
||||
<!-- <u-col span="2">
|
||||
<view class="remark-text">
|
||||
{{sample.remark}}
|
||||
</view>
|
||||
</u-col> -->
|
||||
</u-row>
|
||||
</u-col>
|
||||
</u-row>
|
||||
@@ -295,4 +300,8 @@ onBackPress(() => {
|
||||
font-size: 18px;
|
||||
width: 95%;
|
||||
}
|
||||
.remark-text{
|
||||
padding-top: 25px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
<uni-forms-item v-if="showContent" label="app更新地址">
|
||||
<uni-easyinput v-model="upgradeBaseUrl" placeholder="请输入"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item v-if="showContent" label="webSocket地址">
|
||||
<uni-easyinput v-model="webSocketUrl" placeholder="请输入"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submitForm">保存</u-button>
|
||||
<u-button v-if="showContent" type="primary" @click="clearCache">清除缓存</u-button>
|
||||
@@ -24,6 +27,7 @@ import { ref, computed, onMounted } from 'vue'
|
||||
const baseUrl = ref('')
|
||||
const tenantId = ref('')
|
||||
const upgradeBaseUrl = ref('')
|
||||
const webSocketUrl = ref('')
|
||||
const clickCount = ref(0) // 初始化点击次数为0
|
||||
const threshold = 5 // 设置点击次数的阈值
|
||||
const thresholdTime = 2 // 设置连续点击的时间阈值(秒)
|
||||
@@ -36,9 +40,10 @@ const showContent = computed(() => {
|
||||
|
||||
// 页面加载时从缓存中读取已保存的配置
|
||||
onMounted(() => {
|
||||
baseUrl.value = uni.getStorageSync('base_url')
|
||||
tenantId.value = uni.getStorageSync('tenant_id')
|
||||
baseUrl.value = uni.getStorageSync('baseUrl')
|
||||
tenantId.value = uni.getStorageSync('tenantId')
|
||||
upgradeBaseUrl.value = uni.getStorageSync('upgradeBaseUrl')
|
||||
webSocketUrl.value = uni.getStorageSync('webSocketUrl')
|
||||
})
|
||||
|
||||
// 清除缓存方法
|
||||
@@ -66,9 +71,10 @@ function submitForm() {
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.setStorageSync('base_url', baseUrl.value)
|
||||
uni.setStorageSync('tenant_id', tenantId.value)
|
||||
uni.setStorageSync('baseUrl', baseUrl.value)
|
||||
uni.setStorageSync('tenantId', tenantId.value)
|
||||
uni.setStorageSync('upgradeBaseUrl', upgradeBaseUrl.value)
|
||||
uni.setStorageSync('webSocketUrl', webSocketUrl.value)
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
|
||||
Reference in New Issue
Block a user