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