feat:系统更新

This commit is contained in:
houjunxiang
2025-12-24 15:46:30 +08:00
parent 164e305442
commit 7caeffbf1d
8 changed files with 63 additions and 33 deletions

View File

@@ -1,10 +1,10 @@
// 在此不用配置接口前缀
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://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'
const upgradeBaseUrl = 'http://192.168.26.116:888/admin-api'
const tenantId = '1'
export const clientId = 'zgty_lims'

View File

@@ -2,8 +2,8 @@
"name" : "实验室管理系统",
"appid" : "__UNI__4B3B4B0",
"description" : "实验室管理系统",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionName" : "1.0.1",
"versionCode" : 101,
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,
@@ -53,6 +53,11 @@
"ios" : {
"dSYMs" : false
},
"harmony" : {
"permissions" : [ "ohos.permission.INTERNET", "ohos.permission.GET_NETWORK_INFO" ],
"package" : "zzjc.test.app",
"compatibleSdkVersion" : 5
},
"sdkConfigs" : {},
"icons" : {
"android" : {
@@ -179,5 +184,21 @@
"base" : "./"
},
"template" : "template.h5.html"
},
"app-harmony" : {
"distribute" : {
"bundleName" : "zzjc.test.app",
"signingConfigs" : {
"default" : {
"certpath" : "certs\\DebugCert.cer",
"keyAlias" : "zzjc-test",
"keyPassword" : "0000001A62465932FE19E037517BC61FE03A8F9D69CB7892019EEC82A5A07691ECAE824A92BAD8FAEB34",
"profile" : "certs\\DebugProfileDebug.p7b",
"signAlg" : "SHA256withECDSA",
"storeFile" : "certs\\.p12",
"storePassword" : "0000001ACE8F050DA6F2E36A4D0EC332ECF3A78E16F485E7C0B9DA5919649626428710609023E1DD99FD"
}
}
}
}
}

View File

@@ -10,21 +10,27 @@ export default function () {
uni.request({
url:
getUpgradeBaseUrl() +
'/api/sys/app-client-version/latestVersionUniapp?clientId=' +
appId +
'&platform=' +
osName +
'&tenantId=' +
getTenantId(),
'/qms/version-management/checkUpdate?' +
'applicationCode=ytgg_lims' +
'&updatePlatform=android',
method: 'GET',
success: res => {
if (res.data && res.data.result) {
res.data.result.localVersion = plus.runtime.version
res.data.result.localWgtVersion = widgetInfo.version
res.data.result.url = getUpgradeBaseUrl() + res.data.result.url
console.log(res)
const data = res.data.data
if (data) {
data.localVersion = plus.runtime.version
data.localWgtVersion = widgetInfo.version
data.version = data.currentVersion
data.url = data.downloadUrl
data.type = data.updateType
data.platform = data.updatePlatform
data.is_silently = data.silenceFlag == '1'
data.is_mandatory = data.mustFlag == '1'
data.contents = data.updateContent
}
console.log('更新信息:', res.data)
resolve(res.data)
console.log('更新信息:', data)
resolve(data)
},
fail: err => {
reject(error)

View File

@@ -7,7 +7,7 @@ export default function(isShowNoUpdateToast = false) {
// #ifdef APP-PLUS
return new Promise((resolve, reject) => {
callCheckVersion().then(async (e) => {
if (!e.result) return;
if (!e) return;
const {
code,
message,
@@ -15,10 +15,10 @@ export default function(isShowNoUpdateToast = false) {
url, // 安装包下载地址
platform, // 安装包平台
type // 安装包类型
} = e.result;
} = e;
// 此处逻辑仅为实例,可自行编写
if (code > 0 && isUpdate(e.result)) {
if ( isUpdate(e)) {
console.log("更新逻辑。。。")
// 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回
/**
@@ -60,7 +60,7 @@ export default function(isShowNoUpdateToast = false) {
* 提示升级二
* 官方适配的升级弹窗可自行替换资源适配UI风格
*/
uni.setStorageSync(PACKAGE_INFO_KEY, e.result)
uni.setStorageSync(PACKAGE_INFO_KEY, e)
uni.navigateTo({
url: `/pages/setting/upgrade-popup?local_storage_key=${PACKAGE_INFO_KEY}`,
fail: (err) => {

View File

@@ -379,6 +379,7 @@ const parameterClassifyChange = v => {
function handleInputConfirm() {
selectedField.value.value = inputValue.value
syncFieldValueByEqualParamNo()
autoNextField()
}
function handleDateConfirm(e) {
@@ -703,7 +704,7 @@ const saveDetail = async () => {
}
// 如果是空白样和标样就需要根据配置信息来计算质控样、分析样
if (activeAssayTypeKey.value === 'kby' || activeAssayTypeKey.value === 'by') {
if (activeAssayTypeKey.value === 'kby' || activeAssayTypeKey.value === 'by' || activeAssayTypeKey.value === 'zkkby') {
// 处理其他页签的输入变化
const configInfomation = currentAssayType.value.configQCSampleMethodInfo
const row = currentSampleData.value
@@ -719,8 +720,8 @@ const saveDetail = async () => {
// 如果处理后的值不为空,重新赋值该字段到其他样品类型下的样品上,并触发每一个样品的计算
if (item.value !== null) {
for (const col of currentAssayType.value.columns) {
if (col.fieldIndex === sourceKey) {
dynamicFormData[item.target] = row[sourceKey].value
if (col.fieldIndex === sourceKey&&item.value) {
dynamicFormData[item.target] = item.value
}
}
updateTableDataByConfigFields()
@@ -753,7 +754,7 @@ function calcAverageValue(fieldIndex, tableData) {
// 表格数据更新后重新计算
function updateTableDataByConfigFields() {
let needCalcTabs = []
needCalcTabs = assayGroups.value.filter(t => t.value !== 'by' && t.value !== 'kby')
needCalcTabs = assayGroups.value.filter(t => t.value !== 'by' && t.value !== 'kby' && t.value !== 'zkkby')
if (needCalcTabs.length === 0) return
for (const key in dynamicFormData) {
for (const tab of needCalcTabs) {

View File

@@ -183,7 +183,7 @@ const configQCSampleMethodInfos = computed(() => {
// 表格数据更新后重新计算
async function updateTableDataByConfigFields() {
let needCalcTabs = []
needCalcTabs = tabs.value.filter(t => t.name !== 'by' && t.name !== 'kby')
needCalcTabs = tabs.value.filter(t => t.name !== 'by' && t.name !== 'kby' && t.name !== 'zkkby')
const formData = realFormData.value
if (needCalcTabs.length === 0) return
for (const key in formData) {

View File

@@ -57,7 +57,7 @@ import callCheckUpdate from '@/nx/utils/check-update'
const loading = ref(false)
const captchaEnable = true
let loginInfo = reactive({
username: 'ytjySjfx1',
username: 'ytjyZhfx1',
password: 'P@ssword25',
captchaVerification: ''
})
@@ -72,11 +72,11 @@ function togglePasswordVisibility() {
onShow(() => {
//检查APP更新
// #ifdef APP-PLUS
if (process.env.NODE_ENV !== 'development') {
// if (process.env.NODE_ENV !== 'development') {
setTimeout(() => {
callCheckUpdate()
}, 1500)
}
// }
// #endif
})
async function bindLogin() {

View File

@@ -205,9 +205,11 @@ async function closeUpdate() {
function downloadPackage() {
downloading.value = true
downloadTask = uni.downloadFile({
url: url.value,
header:{
"Accept-Encoding": "identity"
},
success: res => {
if (res.statusCode === 200) {
downloadSuccess.value = true