Commit fdcf9779 by fengweida

V1.0.8 添加不需要sleep按钮

1 parent 7865882e
Showing 1 changed file with 19 additions and 10 deletions
......@@ -29,6 +29,8 @@
<button type="button" class="btn btn-default" @click="selectAll(2)">全不选</button>
</div>
<button type="button" class="btn btn-default navbar-btn" @click="copyNew">复制出来</button>
<button type="button" class="btn btn-default navbar-btn" v-if="sleepList.length > 0 && needSleep" @click="switchSleep">不需要sleep</button>
<button type="button" class="btn btn-default navbar-btn" v-if="sleepList.length > 0 && !needSleep" @click="switchSleep">需要sleep</button>
</div>
</div>
</nav>
......@@ -121,6 +123,7 @@
allServiceList: [], //服务列表
sleepList: [], //sleep列表
searchText: "", //搜索框的值
needSleep:true, //是否需要sleep
},
created: function () {
......@@ -289,7 +292,7 @@
//复制出来
copyNew: function () {
let {serviceList, allServiceList, sourceArr, sleepList} = this;
let {serviceList, allServiceList, sourceArr, sleepList, needSleep} = this;
if (!allServiceList.length) {
alert("你输入的内容不对");
} else {
......@@ -305,14 +308,17 @@
if (buildRow.startsWith("//")) {
buildRow = buildRow.split("//")[1];
}
let sleepRow = item.buildRowNo + 1;
sleepList.forEach(item => {
if (item.rowNo == sleepRow) {
if (item.row.startsWith("//")) {
item.row = item.row.split("//")[1];
}
}
});
//如果需要sleep,才去掉sleep的注释
if (needSleep){
let sleepRow = item.buildRowNo + 1;
sleepList.forEach(item => {
if (item.rowNo == sleepRow) {
if (item.row.startsWith("//")) {
item.row = item.row.split("//")[1];
}
}
});
}
} else {
//如果是关闭的 还没有注释的话,就注释掉
if (!uploadRow.startsWith("//")) {
......@@ -357,7 +363,10 @@
alert("复制成功");
}
},
switchSleep:function () {
this.needSleep = !this.needSleep;
},
//dealStr
dealStr: function (str) {
//如果是注释的
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!