feat:系统更新
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
// 在此不用配置接口前缀
|
// 在此不用配置接口前缀
|
||||||
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.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.163:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||||
//
|
//
|
||||||
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
// 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'
|
const tenantId = '1'
|
||||||
export const clientId = 'zgty_lims'
|
export const clientId = 'zgty_lims'
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "实验室管理系统",
|
"name" : "实验室管理系统",
|
||||||
"appid" : "__UNI__4B3B4B0",
|
"appid" : "__UNI__4B3B4B0",
|
||||||
"description" : "实验室管理系统",
|
"description" : "实验室管理系统",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.1",
|
||||||
"versionCode" : "100",
|
"versionCode" : 101,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
@@ -53,6 +53,11 @@
|
|||||||
"ios" : {
|
"ios" : {
|
||||||
"dSYMs" : false
|
"dSYMs" : false
|
||||||
},
|
},
|
||||||
|
"harmony" : {
|
||||||
|
"permissions" : [ "ohos.permission.INTERNET", "ohos.permission.GET_NETWORK_INFO" ],
|
||||||
|
"package" : "zzjc.test.app",
|
||||||
|
"compatibleSdkVersion" : 5
|
||||||
|
},
|
||||||
"sdkConfigs" : {},
|
"sdkConfigs" : {},
|
||||||
"icons" : {
|
"icons" : {
|
||||||
"android" : {
|
"android" : {
|
||||||
@@ -179,5 +184,21 @@
|
|||||||
"base" : "./"
|
"base" : "./"
|
||||||
},
|
},
|
||||||
"template" : "template.h5.html"
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,21 +10,27 @@ export default function () {
|
|||||||
uni.request({
|
uni.request({
|
||||||
url:
|
url:
|
||||||
getUpgradeBaseUrl() +
|
getUpgradeBaseUrl() +
|
||||||
'/api/sys/app-client-version/latestVersionUniapp?clientId=' +
|
'/qms/version-management/checkUpdate?' +
|
||||||
appId +
|
'applicationCode=ytgg_lims' +
|
||||||
'&platform=' +
|
'&updatePlatform=android',
|
||||||
osName +
|
|
||||||
'&tenantId=' +
|
|
||||||
getTenantId(),
|
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.data && res.data.result) {
|
console.log(res)
|
||||||
res.data.result.localVersion = plus.runtime.version
|
|
||||||
res.data.result.localWgtVersion = widgetInfo.version
|
const data = res.data.data
|
||||||
res.data.result.url = getUpgradeBaseUrl() + res.data.result.url
|
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)
|
console.log('更新信息:', data)
|
||||||
resolve(res.data)
|
resolve(data)
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default function(isShowNoUpdateToast = false) {
|
|||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
callCheckVersion().then(async (e) => {
|
callCheckVersion().then(async (e) => {
|
||||||
if (!e.result) return;
|
if (!e) return;
|
||||||
const {
|
const {
|
||||||
code,
|
code,
|
||||||
message,
|
message,
|
||||||
@@ -15,10 +15,10 @@ export default function(isShowNoUpdateToast = false) {
|
|||||||
url, // 安装包下载地址
|
url, // 安装包下载地址
|
||||||
platform, // 安装包平台
|
platform, // 安装包平台
|
||||||
type // 安装包类型
|
type // 安装包类型
|
||||||
} = e.result;
|
} = e;
|
||||||
|
|
||||||
// 此处逻辑仅为实例,可自行编写
|
// 此处逻辑仅为实例,可自行编写
|
||||||
if (code > 0 && isUpdate(e.result)) {
|
if ( isUpdate(e)) {
|
||||||
console.log("更新逻辑。。。")
|
console.log("更新逻辑。。。")
|
||||||
// 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回
|
// 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回
|
||||||
/**
|
/**
|
||||||
@@ -60,7 +60,7 @@ export default function(isShowNoUpdateToast = false) {
|
|||||||
* 提示升级二
|
* 提示升级二
|
||||||
* 官方适配的升级弹窗,可自行替换资源适配UI风格
|
* 官方适配的升级弹窗,可自行替换资源适配UI风格
|
||||||
*/
|
*/
|
||||||
uni.setStorageSync(PACKAGE_INFO_KEY, e.result)
|
uni.setStorageSync(PACKAGE_INFO_KEY, e)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/setting/upgrade-popup?local_storage_key=${PACKAGE_INFO_KEY}`,
|
url: `/pages/setting/upgrade-popup?local_storage_key=${PACKAGE_INFO_KEY}`,
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
|
|||||||
@@ -379,6 +379,7 @@ const parameterClassifyChange = v => {
|
|||||||
|
|
||||||
function handleInputConfirm() {
|
function handleInputConfirm() {
|
||||||
selectedField.value.value = inputValue.value
|
selectedField.value.value = inputValue.value
|
||||||
|
syncFieldValueByEqualParamNo()
|
||||||
autoNextField()
|
autoNextField()
|
||||||
}
|
}
|
||||||
function handleDateConfirm(e) {
|
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 configInfomation = currentAssayType.value.configQCSampleMethodInfo
|
||||||
const row = currentSampleData.value
|
const row = currentSampleData.value
|
||||||
@@ -719,8 +720,8 @@ const saveDetail = async () => {
|
|||||||
// 如果处理后的值不为空,重新赋值该字段到其他样品类型下的样品上,并触发每一个样品的计算
|
// 如果处理后的值不为空,重新赋值该字段到其他样品类型下的样品上,并触发每一个样品的计算
|
||||||
if (item.value !== null) {
|
if (item.value !== null) {
|
||||||
for (const col of currentAssayType.value.columns) {
|
for (const col of currentAssayType.value.columns) {
|
||||||
if (col.fieldIndex === sourceKey) {
|
if (col.fieldIndex === sourceKey&&item.value) {
|
||||||
dynamicFormData[item.target] = row[sourceKey].value
|
dynamicFormData[item.target] = item.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateTableDataByConfigFields()
|
updateTableDataByConfigFields()
|
||||||
@@ -753,7 +754,7 @@ function calcAverageValue(fieldIndex, tableData) {
|
|||||||
// 表格数据更新后重新计算
|
// 表格数据更新后重新计算
|
||||||
function updateTableDataByConfigFields() {
|
function updateTableDataByConfigFields() {
|
||||||
let needCalcTabs = []
|
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
|
if (needCalcTabs.length === 0) return
|
||||||
for (const key in dynamicFormData) {
|
for (const key in dynamicFormData) {
|
||||||
for (const tab of needCalcTabs) {
|
for (const tab of needCalcTabs) {
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ const configQCSampleMethodInfos = computed(() => {
|
|||||||
// 表格数据更新后重新计算
|
// 表格数据更新后重新计算
|
||||||
async function updateTableDataByConfigFields() {
|
async function updateTableDataByConfigFields() {
|
||||||
let needCalcTabs = []
|
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
|
const formData = realFormData.value
|
||||||
if (needCalcTabs.length === 0) return
|
if (needCalcTabs.length === 0) return
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ import callCheckUpdate from '@/nx/utils/check-update'
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const captchaEnable = true
|
const captchaEnable = true
|
||||||
let loginInfo = reactive({
|
let loginInfo = reactive({
|
||||||
username: 'ytjySjfx1',
|
username: 'ytjyZhfx1',
|
||||||
password: 'P@ssword25',
|
password: 'P@ssword25',
|
||||||
captchaVerification: ''
|
captchaVerification: ''
|
||||||
})
|
})
|
||||||
@@ -72,11 +72,11 @@ function togglePasswordVisibility() {
|
|||||||
onShow(() => {
|
onShow(() => {
|
||||||
//检查APP更新
|
//检查APP更新
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
if (process.env.NODE_ENV !== 'development') {
|
// if (process.env.NODE_ENV !== 'development') {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
callCheckUpdate()
|
callCheckUpdate()
|
||||||
}, 1500)
|
}, 1500)
|
||||||
}
|
// }
|
||||||
// #endif
|
// #endif
|
||||||
})
|
})
|
||||||
async function bindLogin() {
|
async function bindLogin() {
|
||||||
|
|||||||
@@ -205,9 +205,11 @@ async function closeUpdate() {
|
|||||||
|
|
||||||
function downloadPackage() {
|
function downloadPackage() {
|
||||||
downloading.value = true
|
downloading.value = true
|
||||||
|
|
||||||
downloadTask = uni.downloadFile({
|
downloadTask = uni.downloadFile({
|
||||||
url: url.value,
|
url: url.value,
|
||||||
|
header:{
|
||||||
|
"Accept-Encoding": "identity"
|
||||||
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
downloadSuccess.value = true
|
downloadSuccess.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user