删除无用方法和css
parent
1732901bf9
commit
0ecae4ec9e
|
|
@ -135,6 +135,36 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
|
|
||||||
|
<uni-popup ref="inputDialog" mode="center">
|
||||||
|
<!-- 新增:修改运行时间的弹窗 -->
|
||||||
|
<view class="modal-container">
|
||||||
|
<view class="modal-title">{{ `【${selectedText} - ${currentCard.name}】设置` }}</view>
|
||||||
|
<view class="modal-input-wrap">
|
||||||
|
<text class="modal-label">当前时间:</text>
|
||||||
|
<text class="modal-current">{{ currentCardTime > 0 ? `${currentCardTime} 秒` : '未设置' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="modal-input-wrap">
|
||||||
|
<text class="modal-label">修改后时间:</text>
|
||||||
|
<input
|
||||||
|
class="modal-input"
|
||||||
|
type="number"
|
||||||
|
v-model.number="newLimitTime"
|
||||||
|
/>
|
||||||
|
<!-- <uni-number-box v-model="newLimitTime" />-->
|
||||||
|
<text class="modal-unit">秒</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="modal-input-wrap">
|
||||||
|
<text class="modal-label">别名设置:</text>
|
||||||
|
<uni-easyinput style="width: 100px" v-model="remark" placeholder="不填展示默认备注"/>
|
||||||
|
</view>
|
||||||
|
<view class="modal-btn-wrap">
|
||||||
|
<button class="modal-btn cancel" @click="close">取消</button>
|
||||||
|
<button class="modal-btn confirm" @click="confirmModifyTime">确定</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -303,16 +333,20 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// 滑动切换卷膜
|
||||||
change(e) {
|
change(e) {
|
||||||
this.current =e.detail.current
|
this.current =e.detail.current
|
||||||
},
|
},
|
||||||
|
// 切换卷膜
|
||||||
switchTab(e) {
|
switchTab(e) {
|
||||||
this.current=e.index
|
this.current=e.index
|
||||||
},
|
},
|
||||||
|
// 左上角选择时间
|
||||||
confirmTemp(event) {
|
confirmTemp(event) {
|
||||||
this.result = event[0]['label']
|
this.result = event[0]['label']
|
||||||
console.info(`选择温度:${event[0]['label']}`)
|
console.info(`选择温度:${event[0]['label']}`)
|
||||||
},
|
},
|
||||||
|
// 下拉刷新以及进入组件渲染
|
||||||
refresh() {
|
refresh() {
|
||||||
this.termList = {
|
this.termList = {
|
||||||
"jm1": [],
|
"jm1": [],
|
||||||
|
|
@ -324,24 +358,7 @@ export default {
|
||||||
this.getSwiperHeight(); // 页面初始化时也计算一次
|
this.getSwiperHeight(); // 页面初始化时也计算一次
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openDataModal(sensorCard) {
|
// 修改运行时间以及设备备注弹窗
|
||||||
if ((store.getters && store.getters.name !== 'admin')
|
|
||||||
&& this.$auth.hasRole("test")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.sensorCard = sensorCard;
|
|
||||||
this.remark = this.dtu_remark[sensorCard.key] || sensorCard.label;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 优化:封装温湿度单位判断函数
|
|
||||||
isEffectiveValue(value) {
|
|
||||||
return this.testNumber(value);
|
|
||||||
},
|
|
||||||
testNumber(data) {
|
|
||||||
const reg = /^-?\d+(\.\d+)?$/;
|
|
||||||
return reg.test(String(data).trim());
|
|
||||||
},
|
|
||||||
// 新增:打开修改运行时间的弹窗
|
|
||||||
openTimeModal(card) {
|
openTimeModal(card) {
|
||||||
if ((store.getters && store.getters.name !== 'admin')
|
if ((store.getters && store.getters.name !== 'admin')
|
||||||
&& this.$auth.hasRole("test")) {
|
&& this.$auth.hasRole("test")) {
|
||||||
|
|
@ -353,7 +370,7 @@ export default {
|
||||||
this.remark = this.dtu_remark[card.type] || card.name;
|
this.remark = this.dtu_remark[card.type] || card.name;
|
||||||
this.$refs.inputDialog.open()
|
this.$refs.inputDialog.open()
|
||||||
},
|
},
|
||||||
// 卡片点击事件(实际项目中调用接口修改状态) 功能标识
|
// 设备控制
|
||||||
handleCardClick(status, type) {
|
handleCardClick(status, type) {
|
||||||
const funcMsg = "该功能用来开启或暂停设备,按钮亮为开启,按钮暗为暂停设备"
|
const funcMsg = "该功能用来开启或暂停设备,按钮亮为开启,按钮暗为暂停设备"
|
||||||
if ((store.getters && store.getters.name !== 'admin')
|
if ((store.getters && store.getters.name !== 'admin')
|
||||||
|
|
@ -414,6 +431,7 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 修改运行时间以及备注 点击关闭
|
||||||
close() {
|
close() {
|
||||||
this.$refs.inputDialog.close()
|
this.$refs.inputDialog.close()
|
||||||
},
|
},
|
||||||
|
|
@ -490,7 +508,7 @@ export default {
|
||||||
: await addLimit(limitTimes);
|
: await addLimit(limitTimes);
|
||||||
if (limitRes.code === 200) {
|
if (limitRes.code === 200) {
|
||||||
isAllSuccess = true;
|
isAllSuccess = true;
|
||||||
this.getAgriByImei();
|
this.$emit("getAgriLimit")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -523,23 +541,14 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 添加条件更新窗口高度
|
||||||
getAgriByImei() {
|
|
||||||
getAgriByImei(this.imei).then(response => {
|
|
||||||
if (response.code === 200) {
|
|
||||||
if (!response.data) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.limitTimes = response.data;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
updateSwiperHeight() {
|
updateSwiperHeight() {
|
||||||
if (this.termList[this.term[this.current]].length>4) {
|
if (this.termList[this.term[this.current]].length>4) {
|
||||||
// 加上 param-setting 和 add-term 的高度,以及一些间距
|
// 加上 param-setting 和 add-term 的高度,以及一些间距
|
||||||
this.swiperHeight = this.swiperHeight + 160;
|
this.swiperHeight = this.swiperHeight + 160;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 获取窗口高度
|
||||||
getSwiperHeight() {
|
getSwiperHeight() {
|
||||||
this.swiperHeight = 800;
|
this.swiperHeight = 800;
|
||||||
var length = this.termList[this.term[this.current]].length-4;
|
var length = this.termList[this.term[this.current]].length-4;
|
||||||
|
|
@ -547,6 +556,7 @@ export default {
|
||||||
this.swiperHeight = this.swiperHeight + 160*length ;
|
this.swiperHeight = this.swiperHeight + 160*length ;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 添加条件方法
|
||||||
addTerm() {
|
addTerm() {
|
||||||
var tempList = this.termList[this.term[this.current]];
|
var tempList = this.termList[this.term[this.current]];
|
||||||
if (tempList.length >= this.maxTermLength) {
|
if (tempList.length >= this.maxTermLength) {
|
||||||
|
|
@ -572,6 +582,7 @@ export default {
|
||||||
// 确保value是字符串/数字,避免拼接出错
|
// 确保value是字符串/数字,避免拼接出错
|
||||||
return `${value}${unit}`;
|
return `${value}${unit}`;
|
||||||
},
|
},
|
||||||
|
// 删除条件
|
||||||
onDeleteItem(event, id) {
|
onDeleteItem(event, id) {
|
||||||
const currentKey = this.term[this.current];
|
const currentKey = this.term[this.current];
|
||||||
const tempList = this.termList[currentKey];
|
const tempList = this.termList[currentKey];
|
||||||
|
|
@ -593,13 +604,14 @@ export default {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 选择运行时间
|
||||||
changeTime(timeTag, timeIndex) {
|
changeTime(timeTag, timeIndex) {
|
||||||
this.timeTag = timeTag;
|
this.timeTag = timeTag;
|
||||||
this.timeIndex = timeIndex;
|
this.timeIndex = timeIndex;
|
||||||
this.selectTime = true;
|
this.selectTime = true;
|
||||||
},
|
},
|
||||||
|
// 选择时间串口点击确定
|
||||||
confirmTime(time) {
|
confirmTime(time) {
|
||||||
console.info(this.termList[this.term[this.current]])
|
|
||||||
this.termList[this.term[this.current]][this.timeIndex][this.timeTag] = `${time.hour}:${time.minute}`
|
this.termList[this.term[this.current]][this.timeIndex][this.timeTag] = `${time.hour}:${time.minute}`
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -691,26 +703,6 @@ export default {
|
||||||
padding-bottom: 15rpx;
|
padding-bottom: 15rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
|
||||||
width: 50rpx;
|
|
||||||
margin: 10rpx 10rpx 8rpx 0;
|
|
||||||
padding: 0;
|
|
||||||
height: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 26rpx;
|
|
||||||
box-shadow: 0 2rpx 8rpx #bfbec1
|
|
||||||
}
|
|
||||||
|
|
||||||
.tempStyle, .humiStyle {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text:first-child {
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-view {
|
.uni-view {
|
||||||
-webkit-flex: 1;
|
-webkit-flex: 1;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
@ -721,19 +713,6 @@ export default {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.data {
|
|
||||||
font-size: 13px;
|
|
||||||
display: inline-block;
|
|
||||||
line-height: 23px;
|
|
||||||
color: #3a3a3a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.data:nth-child(even) {
|
|
||||||
font-size: 12px;
|
|
||||||
margin-top: 3px;
|
|
||||||
color: #9c9c9c;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ .uni-section-header__slot-right {
|
/deep/ .uni-section-header__slot-right {
|
||||||
color: green;
|
color: green;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue