增加一键复制卷膜配置

feasure
lld 2026-03-09 23:01:41 +08:00
parent 835a054a8c
commit 5ed27eef4f
1 changed files with 47 additions and 10 deletions

View File

@ -55,11 +55,15 @@
:key="key"> :key="key">
<view > <view >
<view class="param-setting"> <view class="param-setting">
<view class="temp-dialog" @click="showSelect=true">{{ termList[current]['config'].refTemp }} <tn-button padding="0 20rpx" :plain="true" margin="10rpx 10rpx" @click="showSelect=true">
<uni-icons type="down"/> 参考温度{{ termList[current]['config'].refTemp }}
<uni-icons class="temp-dialog" type="down"/>
</tn-button>
<view @click="openParamDialog" class="param-dialog">
<tn-button padding="0 20rpx" :plain="true" margin="10rpx 10rpx" >
参数设置弹窗
</tn-button>
</view> </view>
<!-- <button class="cu-btn line-cyan round shadow" @click="showSelect=true">{{ result }}</button>-->
<text @click="openParamDialog" class="param-dialog">参数设置弹窗</text>
</view> </view>
<!-- F8F7F8--> <!-- F8F7F8-->
<view class="term-content"> <view class="term-content">
@ -105,7 +109,12 @@
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>
<view class="copy-term" v-if="termList[key]['terms'].length > 0">
<tn-button @click="copyTerm"
:shadow="true" width="100%" height="100rpx"
backgroundColor="#01BEFF" fontColor="#FFFFFF"
margin="10rpx 0">一键同步卷膜所有配置</tn-button>
</view>
<view class="add-term"> <view class="add-term">
<uni-icons color="var(--cyan)" type="plus" size="40" @click="addTerm"/> <uni-icons color="var(--cyan)" type="plus" size="40" @click="addTerm"/>
<text @click="addTerm"></text> <text @click="addTerm"></text>
@ -783,7 +792,7 @@ export default {
// -------------------------------------------------- // --------------------------------------------------
// //
updateSwiperHeight() { updateSwiperHeight() {
if (this.termList[this.current]['terms'].length>3) { if (this.termList[this.current]['terms'].length >= 3) {
// param-setting add-term // param-setting add-term
this.swiperHeight = this.swiperHeight + 160; this.swiperHeight = this.swiperHeight + 160;
} }
@ -791,11 +800,35 @@ export default {
// //
getSwiperHeight() { getSwiperHeight() {
this.swiperHeight = 720; this.swiperHeight = 720;
var length = this.termList[this.current]['terms'].length-4; var length = this.termList[this.current]['terms'].length-2;
if (length>0) { if (length>0) {
this.swiperHeight = this.swiperHeight + 160*length ; this.swiperHeight = this.swiperHeight + 160*length ;
} }
}, },
//
copyTerm() {
var temps = this.termList[this.current]['terms'];
var config = this.termList[this.current]['config'];
if (temps.length <= 0) return;
uni.showModal({
title: '操作提示:',
content: '确定复制当前卷膜配置到其他卷膜?',
cancelText: '取消',
confirmText: '确定',
success: (res) => {
if (res.confirm) {
for (const [index,value] of this.filmRollerList.entries()) {
if (index === this.current) continue;
// this.termList[index]['terms'] = [ ...temps ];
// this.termList[index]['config']= { ...config };
this.termList[index]['terms'] = JSON.parse(JSON.stringify(temps));
this.termList[index]['config']= JSON.parse(JSON.stringify(config));
this.termList[index]['config'].roller = `jm${index+1}`
}
}
}
})
},
// //
addTerm() { addTerm() {
var temps = this.termList[this.current]['terms']; var temps = this.termList[this.current]['terms'];
@ -1302,18 +1335,22 @@ export default {
//border-radius: 8px; //border-radius: 8px;
//background-color: #fff; //background-color: #fff;
} }
.copy-term {
margin: 0 10rpx;
}
.param-setting { .param-setting {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 28rpx; font-size: 28rpx;
color: #0a0a0a; color: #0a0a0a;
margin-top: 15rpx; .tn-btn-class {
border-radius: 15rpx;
}
.temp-dialog { .temp-dialog {
margin-left: 20rpx; margin-left: 10rpx;
} }
.param-dialog { .param-dialog {
margin-left: auto; /* 自动填充左侧空间,将按钮推到最右侧 */ margin-left: auto; /* 自动填充左侧空间,将按钮推到最右侧 */
margin-right: 20rpx;
} }
} }
.term-content { .term-content {