修改实时数据更新时间

wx-program
pangdundun 2024-01-18 09:47:38 +08:00
parent 9e1b02ff5a
commit f295de66a6
40 changed files with 60 additions and 52 deletions

View File

@ -213,7 +213,7 @@
</view> </view>
<view class="updateTime"> <view class="updateTime">
<span></span> <span></span>
<span>*更新数据时间&nbsp;: &nbsp;{{ updateTime }}</span> <span>*更新数据时间&nbsp;: &nbsp;{{ updateTime[index1] }}</span>
</view> </view>
</view> </view>
@ -341,7 +341,7 @@
typeList: [], typeList: [],
timer: null, timer: null,
updateTime: '' updateTime: []
} }
}, },
onLoad() { onLoad() {
@ -447,8 +447,9 @@
childList_fourteen: [],//14# childList_fourteen: [],//14#
} }
}) })
this.updateTime = []
this.waterAndFertilizerParamsList.forEach((i, index) => { this.waterAndFertilizerParamsList.forEach((i, index) => {
this.$http({ this.$http({
url: (i.equipmentName == 1 ? this.api.getFs_rtdata : this.api url: (i.equipmentName == 1 ? this.api.getFs_rtdata : this.api
.getcontrol_rtdata) + "?equipmentId=" + i.deviceId, .getcontrol_rtdata) + "?equipmentId=" + i.deviceId,
@ -483,12 +484,14 @@
i.childList_thirteen = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 13); i.childList_thirteen = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 13);
i.childList_fourteen = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 14); i.childList_fourteen = res.data.filter(el => (this.getStatus(el.equipmentNumber, el.targetValue)) == (el.equipmentNumber + '#') && el.equipmentNumber == 14);
this.updateTime = res.data[0].updateTime this.updateTime.push(res.data[0].updateTime ? res.data[0].updateTime : '暂无')
// console.log(this.waterAndFertilizerParamsList); // console.log(this.waterAndFertilizerParamsList);
} else { } else {
this.updateTime.push('暂无')
} }
console.log(this.updateTime,'this.updateTime');
}).catch(err => { }).catch(err => {
console.log('接口失败'); console.log('接口失败');
}) })

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1557,7 +1557,7 @@ function initData(vueOptions, context) {
try { try {
data = data.call(context); // 支持 Vue.prototype 上挂的数据 data = data.call(context); // 支持 Vue.prototype 上挂的数据
} catch (e) { } catch (e) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) { if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data); console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
} }
} }
@ -8934,7 +8934,7 @@ function type(obj) {
function flushCallbacks$1(vm) { function flushCallbacks$1(vm) {
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) { if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) { if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
var mpInstance = vm.$scope; var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid + console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']'); ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@ -8955,14 +8955,14 @@ function nextTick$1(vm, cb) {
//1.nextTick 之前 已 setData 且 setData 还未回调完成 //1.nextTick 之前 已 setData 且 setData 还未回调完成
//2.nextTick 之前存在 render watcher //2.nextTick 之前存在 render watcher
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) { if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){ if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance = vm.$scope; var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid + console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:nextVueTick'); ']:nextVueTick');
} }
return nextTick(cb, vm) return nextTick(cb, vm)
}else{ }else{
if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){ if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance$1 = vm.$scope; var mpInstance$1 = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid + console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
']:nextMPTick'); ']:nextMPTick');
@ -9058,7 +9058,7 @@ var patch = function(oldVnode, vnode) {
}); });
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData); var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
if (Object.keys(diffData).length) { if (Object.keys(diffData).length) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) { if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid + console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
']差量更新', ']差量更新',
JSON.stringify(diffData)); JSON.stringify(diffData));
@ -12674,7 +12674,7 @@ function _extends() {
var formatRegExp = /%[sdj%]/g; var formatRegExp = /%[sdj%]/g;
var warning = function warning() {}; // don't print warning message when in production env or node runtime var warning = function warning() {}; // don't print warning message when in production env or node runtime
if (typeof process !== 'undefined' && Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') { if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"greenhouse-wisdom-applet","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
warning = function warning(type, errors) { warning = function warning(type, errors) {
if (typeof console !== 'undefined' && console.warn) { if (typeof console !== 'undefined' && console.warn) {
if (errors.every(function (e) { if (errors.every(function (e) {

View File

@ -757,7 +757,7 @@ var _default = {
//countType计算类型 0是原数据 1是原数据-400 2是原数据/10 3是(原数据-400) / 10 //countType计算类型 0是原数据 1是原数据-400 2是原数据/10 3是(原数据-400) / 10
typeList: [], typeList: [],
timer: null, timer: null,
updateTime: '' updateTime: []
}; };
}, },
onLoad: function onLoad() { onLoad: function onLoad() {
@ -879,6 +879,7 @@ var _default = {
}); });
}); });
_this.updateTime = [];
_this.waterAndFertilizerParamsList.forEach(function (i, index) { _this.waterAndFertilizerParamsList.forEach(function (i, index) {
_this.$http({ _this.$http({
url: (i.equipmentName == 1 ? _this.api.getFs_rtdata : _this.api.getcontrol_rtdata) + "?equipmentId=" + i.deviceId, url: (i.equipmentName == 1 ? _this.api.getFs_rtdata : _this.api.getcontrol_rtdata) + "?equipmentId=" + i.deviceId,
@ -945,9 +946,13 @@ var _default = {
i.childList_fourteen = res.data.filter(function (el) { i.childList_fourteen = res.data.filter(function (el) {
return _this.getStatus(el.equipmentNumber, el.targetValue) == el.equipmentNumber + '#' && el.equipmentNumber == 14; return _this.getStatus(el.equipmentNumber, el.targetValue) == el.equipmentNumber + '#' && el.equipmentNumber == 14;
}); });
_this.updateTime = res.data[0].updateTime; _this.updateTime.push(res.data[0].updateTime ? res.data[0].updateTime : '暂无');
// console.log(this.waterAndFertilizerParamsList); // console.log(this.waterAndFertilizerParamsList);
} else {} } else {
_this.updateTime.push('暂无');
}
console.log(_this.updateTime, 'this.updateTime');
}).catch(function (err) { }).catch(function (err) {
console.log('接口失败'); console.log('接口失败');
}); });

File diff suppressed because one or more lines are too long