Commit fdcf9779 by fengweida

V1.0.8 添加不需要sleep按钮

1 parent 7865882e
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<button type="button" class="btn btn-default" @click="selectAll(2)">全不选</button> <button type="button" class="btn btn-default" @click="selectAll(2)">全不选</button>
</div> </div>
<button type="button" class="btn btn-default navbar-btn" @click="copyNew">复制出来</button> <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>
</div> </div>
</nav> </nav>
...@@ -121,6 +123,7 @@ ...@@ -121,6 +123,7 @@
allServiceList: [], //服务列表 allServiceList: [], //服务列表
sleepList: [], //sleep列表 sleepList: [], //sleep列表
searchText: "", //搜索框的值 searchText: "", //搜索框的值
needSleep:true, //是否需要sleep
}, },
created: function () { created: function () {
...@@ -289,7 +292,7 @@ ...@@ -289,7 +292,7 @@
//复制出来 //复制出来
copyNew: function () { copyNew: function () {
let {serviceList, allServiceList, sourceArr, sleepList} = this; let {serviceList, allServiceList, sourceArr, sleepList, needSleep} = this;
if (!allServiceList.length) { if (!allServiceList.length) {
alert("你输入的内容不对"); alert("你输入的内容不对");
} else { } else {
...@@ -305,6 +308,8 @@ ...@@ -305,6 +308,8 @@
if (buildRow.startsWith("//")) { if (buildRow.startsWith("//")) {
buildRow = buildRow.split("//")[1]; buildRow = buildRow.split("//")[1];
} }
//如果需要sleep,才去掉sleep的注释
if (needSleep){
let sleepRow = item.buildRowNo + 1; let sleepRow = item.buildRowNo + 1;
sleepList.forEach(item => { sleepList.forEach(item => {
if (item.rowNo == sleepRow) { if (item.rowNo == sleepRow) {
...@@ -313,6 +318,7 @@ ...@@ -313,6 +318,7 @@
} }
} }
}); });
}
} else { } else {
//如果是关闭的 还没有注释的话,就注释掉 //如果是关闭的 还没有注释的话,就注释掉
if (!uploadRow.startsWith("//")) { if (!uploadRow.startsWith("//")) {
...@@ -357,6 +363,9 @@ ...@@ -357,6 +363,9 @@
alert("复制成功"); alert("复制成功");
} }
}, },
switchSleep:function () {
this.needSleep = !this.needSleep;
},
//dealStr //dealStr
dealStr: function (str) { 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!