运维端测试中控页面优化 功能优化
This commit is contained in:
parent
5da0f26acb
commit
9d998ff1ea
@ -17,8 +17,9 @@
|
||||
|
||||
const inputCodeValue = ref('');
|
||||
const {
|
||||
codeValue
|
||||
} = defineProps(["codeValue"]);
|
||||
codeValue,
|
||||
scanValue
|
||||
} = defineProps(["codeValue", "scanValue"]);
|
||||
inputCodeValue.value = codeValue;
|
||||
|
||||
const emit = defineEmits(['scan-change']);
|
||||
@ -45,7 +46,12 @@
|
||||
imei,
|
||||
sn
|
||||
};
|
||||
inputCodeValue.value = imei;
|
||||
|
||||
if (scanValue == "sn") {
|
||||
inputCodeValue.value = sn;
|
||||
} else {
|
||||
inputCodeValue.value = imei;
|
||||
}
|
||||
emit('scan-change', params);
|
||||
}
|
||||
}
|
||||
@ -55,10 +61,17 @@
|
||||
const onInput = (value) => {
|
||||
if (value.detail.value == "") return;
|
||||
inputCodeValue.value = value.detail.value;
|
||||
emit('scan-change', {
|
||||
imei: value.detail.value,
|
||||
sn: ""
|
||||
});
|
||||
if (scanValue == "sn") {
|
||||
emit('scan-change', {
|
||||
imei: "",
|
||||
sn: value.detail.value
|
||||
});
|
||||
} else {
|
||||
emit('scan-change', {
|
||||
imei: value.detail.value,
|
||||
sn: ""
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const onSetValue = (value) => {
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
<view class="container">
|
||||
<view class="form-panel">
|
||||
<uni-card>
|
||||
<uni-forms ref="ebikeInfoForm" :modelValue="ebikeInfo">
|
||||
<uni-forms :modelValue="ebikeInfo">
|
||||
<view v-if="modelShow" class="flex">
|
||||
<text class="cuIcon-order lg text-gray" @click="showClick"></text>
|
||||
<uni-forms-item label="中控编号" label-s name="bikeCode">
|
||||
<ecuCodeScan @scan-change="ecuCodeScanChange" :codeValue="ebikeInfo.ecuCode" />
|
||||
<uni-forms-item label="中控SN" label-s name="ecuSn">
|
||||
<ecuCodeScan @scan-change="ecuCodeScanChange" :codeValue="ebikeInfo.ecuSn" scanValue="sn" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view v-else class="flex">
|
||||
@ -526,7 +526,6 @@
|
||||
ebikeInfo.value.bikeId = res.data.bikeId;
|
||||
ebikeInfo.value.ecuId = res.data.ecuId;
|
||||
ebikeInfo.value.ecuSn = res.data.ecuSn;
|
||||
|
||||
detectionInfo.value.online.btuDisabled = false;
|
||||
detectionInfo.value.findEbike.btuDisabled = false;
|
||||
detectionInfo.value.gps.btuDisabled = false;
|
||||
@ -545,6 +544,18 @@
|
||||
const ecuCodeScanChange = (data) => {
|
||||
ebikeInfo.value.ecuCode = data["imei"];
|
||||
ebikeInfo.value.ecuSn = data["sn"];
|
||||
detectionInfo.value.online.btuDisabled = false;
|
||||
detectionInfo.value.findEbike.btuDisabled = false;
|
||||
detectionInfo.value.gps.btuDisabled = false;
|
||||
detectionInfo.value.soc.btuDisabled = false;
|
||||
detectionInfo.value.openBatteryLock.btuDisabled = false;
|
||||
detectionInfo.value.lock.btuDisabled = false;
|
||||
detectionInfo.value.unlock.btuDisabled = false;
|
||||
detectionInfo.value.openHelmet.btuDisabled = false;
|
||||
detectionInfo.value.voltage.btuDisabled = false;
|
||||
detectionInfo.value.cancelAntiTheft.btuDisabled = false;
|
||||
detectionInfo.value.powerOff.btuDisabled = false;
|
||||
navButtonGroup[0].disable = false
|
||||
};
|
||||
|
||||
const socClick = () => {
|
||||
@ -574,12 +585,12 @@
|
||||
|
||||
reqState.value = true;
|
||||
|
||||
var paramName = "ecuId";
|
||||
var data = ebikeInfo.value.ecuId
|
||||
var paramName = "ecuSn";
|
||||
var data = ebikeInfo.value.ecuSn
|
||||
var bikeId = ebikeInfo.value.bikeId
|
||||
api.callCoreApi(url['url'] + "?" + paramName + "=" + data + "&bikeId=" + bikeId, {}, 'get').then((res) => {
|
||||
api.callEcuCoreApi(url['url'] + "?" + paramName + "=" + data + "&bikeId=" + bikeId, {}, 'get').then((res) => {
|
||||
if (url['type']) {
|
||||
api.callCoreApi("gpsMsg" + "?ecuSn=" + ebikeInfo.value.ecuSn, {}, 'get').then((res) => {
|
||||
api.callEcuCoreApi("gpsMsg" + "?ecuSn=" + ebikeInfo.value.ecuSn, {}, 'get').then((res) => {
|
||||
detectionInfo.value[url['type']].load = '';
|
||||
reqState.value = false;
|
||||
detectionInfo.value[url['type']].btuDisable = false;
|
||||
@ -605,7 +616,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const recursionExecDetection = () => {
|
||||
|
||||
if (urlList.value[0]['type']) {
|
||||
@ -623,43 +633,44 @@
|
||||
var paramName = "ecuId";
|
||||
var data = ebikeInfo.value.ecuId
|
||||
var bikeId = ebikeInfo.value.bikeId
|
||||
api.callCoreApi(urlList.value[0]['url'] + "?" + paramName + "=" + data+ "&bikeId=" + bikeId, {}, 'get').then((res) => {
|
||||
if (urlList.value[0]['type']) {
|
||||
api.callCoreApi("gpsMsg" + "?ecuSn=" + ebikeInfo.value.ecuSn, {}, 'get').then((res) => {
|
||||
detectionInfo.value[urlList.value[0]['type']].load = '';
|
||||
api.callEcuCoreApi(urlList.value[0]['url'] + "?" + paramName + "=" + data + "&bikeId=" + bikeId, {}, 'get')
|
||||
.then((res) => {
|
||||
if (urlList.value[0]['type']) {
|
||||
api.callEcuCoreApi("gpsMsg" + "?ecuSn=" + ebikeInfo.value.ecuSn, {}, 'get').then((res) => {
|
||||
detectionInfo.value[urlList.value[0]['type']].load = '';
|
||||
reqState.value = false;
|
||||
detectionInfo.value[urlList.value[0]['type']].btuDisable = false;
|
||||
if (urlList.value[0]['type'] == 'gps') {
|
||||
detectionInfo.value[urlList.value[0]['type']].msg = "东经:" + res.data
|
||||
.longitude + "°,北纬:" +
|
||||
res.data.latitude + "°";
|
||||
} else {
|
||||
detectionInfo.value[urlList.value[0]['type']].msg = res.data[urlList.value[0][
|
||||
'type'
|
||||
]];
|
||||
}
|
||||
detectionInfo.value[urlList.value[0]['type']].detectionState = true;
|
||||
urlList.value.shift();
|
||||
if (urlList.value.length > 0) {
|
||||
recursionExecDetection();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
detectionInfo.value[urlList.value[0]['url']].load = '';
|
||||
reqState.value = false;
|
||||
detectionInfo.value[urlList.value[0]['type']].btuDisable = false;
|
||||
if (urlList.value[0]['type'] == 'gps') {
|
||||
detectionInfo.value[urlList.value[0]['type']].msg = "东经:" + res.data
|
||||
.longitude + "°,北纬:" +
|
||||
res.data.latitude + "°";
|
||||
detectionInfo.value[urlList.value[0]['url']].btuDisable = false;
|
||||
detectionInfo.value[urlList.value[0]['url']].msg = res.data.message;
|
||||
if (res.data.code == 200) {
|
||||
detectionInfo.value[urlList.value[0]['url']].detectionState = 'success';
|
||||
} else {
|
||||
detectionInfo.value[urlList.value[0]['type']].msg = res.data[urlList.value[0][
|
||||
'type'
|
||||
]];
|
||||
detectionInfo.value[urlList.value[0]['url']].detectionState = 'error';
|
||||
}
|
||||
detectionInfo.value[urlList.value[0]['type']].detectionState = true;
|
||||
urlList.value.shift();
|
||||
if (urlList.value.length > 0) {
|
||||
recursionExecDetection();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
detectionInfo.value[urlList.value[0]['url']].load = '';
|
||||
reqState.value = false;
|
||||
detectionInfo.value[urlList.value[0]['url']].btuDisable = false;
|
||||
detectionInfo.value[urlList.value[0]['url']].msg = res.data.message;
|
||||
if (res.data.code == 200) {
|
||||
detectionInfo.value[urlList.value[0]['url']].detectionState = 'success';
|
||||
} else {
|
||||
detectionInfo.value[urlList.value[0]['url']].detectionState = 'error';
|
||||
}
|
||||
urlList.value.shift();
|
||||
if (urlList.value.length > 0) {
|
||||
recursionExecDetection();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const autoDetection = () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user